Add FROM targets aliasing to avoid conflict in embeds
This commit is contained in:
committed by
Steve Chávez
parent
8e2a0e05ea
commit
ff709a65e5
Vendored
+13
@@ -346,3 +346,16 @@ INSERT INTO tiobe_pls VALUES ('Java', 1), ('C', 2), ('Python', 4);
|
||||
|
||||
TRUNCATE TABLE only_pk CASCADE;
|
||||
INSERT INTO only_pk VALUES (1), (2);
|
||||
|
||||
TRUNCATE TABLE family_tree CASCADE;
|
||||
INSERT INTO family_tree VALUES ('1', 'Parental Unit', NULL);
|
||||
INSERT INTO family_tree VALUES ('2', 'Kid One', '1');
|
||||
INSERT INTO family_tree VALUES ('3', 'Kid Two', '1');
|
||||
INSERT INTO family_tree VALUES ('4', 'Grandkid One', '2');
|
||||
INSERT INTO family_tree VALUES ('5', 'Grandkid Two', '3');
|
||||
|
||||
TRUNCATE TABLE organizations CASCADE;
|
||||
INSERT INTO organizations VALUES (1, 'Referee Org', null, null);
|
||||
INSERT INTO organizations VALUES (2, 'Auditor Org', null, null);
|
||||
INSERT INTO organizations VALUES (3, 'Acme', 1, 2);
|
||||
INSERT INTO organizations VALUES (4, 'Umbrella', 1, 2);
|
||||
|
||||
Vendored
+2
@@ -66,6 +66,8 @@ GRANT ALL ON TABLE
|
||||
, employees
|
||||
, tiobe_pls
|
||||
, only_pk
|
||||
, family_tree
|
||||
, organizations
|
||||
TO postgrest_test_anonymous;
|
||||
|
||||
GRANT INSERT ON TABLE insertonly TO postgrest_test_anonymous;
|
||||
|
||||
Vendored
+16
@@ -1374,3 +1374,19 @@ create table test.tiobe_pls(
|
||||
name text primary key,
|
||||
rank smallint
|
||||
);
|
||||
|
||||
create table test.family_tree (
|
||||
id text not null primary key,
|
||||
name text not null,
|
||||
parent text
|
||||
);
|
||||
alter table only test.family_tree add constraint pptr foreign key (parent) references test.family_tree(id);
|
||||
|
||||
create table test.organizations (
|
||||
id integer primary key,
|
||||
name text,
|
||||
referee integer,
|
||||
auditor integer
|
||||
);
|
||||
alter table only test.organizations add constraint pptr1 foreign key (referee) references test.organizations(id);
|
||||
alter table only test.organizations add constraint pptr2 foreign key (auditor) references test.organizations(id);
|
||||
|
||||
Reference in New Issue
Block a user