create database testdb;

\c testdb

create table foo (id int primary key, data text);

create table bar (id int primary key
                , fooid int constraint "foobar" references foo
                , data text);

insert into foo (id, data)
  values
  (1, 'one')
, (2, 'two')
, (3, 'three');

insert into bar (id, fooid, data)
  values
  (100, 1, 'A')
, (101, 1, 'B')
, (200, 2, 'C');


