test: add tests for bulk upserts with surrogate keys

This commit is contained in:
Laurence Isla
2024-11-15 12:05:14 -05:00
parent fcf828fd92
commit 9c863dbddc
4 changed files with 70 additions and 0 deletions
+6
View File
@@ -924,3 +924,9 @@ INSERT INTO process_supervisor VALUES (4, 1);
INSERT INTO process_supervisor VALUES (4, 2);
INSERT INTO process_supervisor VALUES (5, 3);
INSERT INTO process_supervisor VALUES (6, 3);
TRUNCATE TABLE surr_serial_upsert CASCADE;
INSERT INTO surr_serial_upsert(name, extra) VALUES ('value', 'existing value');
TRUNCATE TABLE surr_gen_default_upsert CASCADE;
INSERT INTO surr_gen_default_upsert(name, extra) VALUES ('value', 'existing value');
+2
View File
@@ -39,6 +39,8 @@ GRANT USAGE ON SEQUENCE
, items3_id_seq
, callcounter_count
, leak_id_seq
, surr_serial_upsert_id_seq
, surr_gen_default_upsert_id_seq
TO postgrest_test_anonymous;
GRANT USAGE ON SEQUENCE channels_id_seq TO postgrest_test_anonymous;
+12
View File
@@ -3782,3 +3782,15 @@ create table process_supervisor (
supervisor_id int references supervisors(id),
primary key (process_id, supervisor_id)
);
create table surr_serial_upsert (
id serial primary key,
name text,
extra text
);
create table surr_gen_default_upsert (
id int generated by default as identity primary key,
name text,
extra text
);