Skip to content

Instantly share code, notes, and snippets.

@olivermt
Created June 6, 2020 15:42
Show Gist options
  • Save olivermt/bc0343eea71fbdd43b3215488ca7faf1 to your computer and use it in GitHub Desktop.
Save olivermt/bc0343eea71fbdd43b3215488ca7faf1 to your computer and use it in GitHub Desktop.
start transaction;
insert into tenants (name) values ('test') returning id; -- id = 1
insert into sub_tenants (tenant_id, name) values (1, 'test');
commit;
-- 'Key (tenant_id)=(1) is not present in table "tenants".
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment