Last active
September 11, 2020 18:38
-
-
Save abevieiramota/0988e38baee94b76e060e1dfefad939c to your computer and use it in GitHub Desktop.
estranho.sql
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 characters
create temporary table a (id serial primary key); | |
create temporary table b (nome text not null) inherits (a); | |
create temporary table c (id_a int not null references a(id)); | |
insert into b values (default, 'teste'); | |
select * from a; | |
-- 1 | |
insert into c values (1); | |
--SQL Error [23503]: ERROR: insert or update on table "c" violates foreign key constraint "c_id_a_fkey" | |
-- Detalhe: Key (id_a)=(1) is not present in table "a". |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment