Last active
December 26, 2015 04:48
-
-
Save ppadron/7095522 to your computer and use it in GitHub Desktop.
Revisions
-
ppadron revised this gist
Oct 22, 2013 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -12,7 +12,7 @@ CREATE TABLE chefs ( ) INHERITS (people); CREATE TABLE people_i_like ( person_id integer references people(id), reason text ); @@ -21,4 +21,4 @@ insert into chefs values (default, 'Bob', 'medium'); insert into people_i_like values (1, 'taught me math'); --ERROR: insert or update on table "people_i_like" violates foreign key constraint "people_i_like_people_id_fkey" --DETAIL: Key (person_id)=(1) is not present in table "people". -
ppadron created this gist
Oct 22, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,24 @@ CREATE TABLE people ( id serial primary key, name text ); CREATE TABLE scientists ( university text ) INHERITS (people); CREATE TABLE chefs ( hat_size text ) INHERITS (people); CREATE TABLE people_i_like ( people_id integer references people(id), reason text ); insert into scientists values (default, 'Alice', 'MIT'); insert into chefs values (default, 'Bob', 'medium'); insert into people_i_like values (1, 'taught me math'); --ERROR: insert or update on table "people_i_like" violates foreign key constraint "people_i_like_people_id_fkey" --DETAIL: Key (people_id)=(1) is not present in table "people".