Skip to content

Instantly share code, notes, and snippets.

@fab1an
Created December 6, 2016 13:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fab1an/1c2c04038149ef514df68434f2ad027e to your computer and use it in GitHub Desktop.
Save fab1an/1c2c04038149ef514df68434f2ad027e to your computer and use it in GitHub Desktop.
## works
create schema core;
create table core.items (
id serial primary key
);
create table core.other (
id serial primary key,
item_id int not null references core.items on delete restrict
);
create view api.core_other as
select * from core.other;
create view api.core_items as
select * from core.items;
## does not work
create table items (
id serial primary key
);
create table other (
id serial primary key,
item_id int not null references items on delete restrict
);
create view api.other as
select * from other;
create view api.items as
select * from items;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment