For example:
# Create table a (id int primary key);
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index 'a_pkey' for table 'a'
CREATE TABLE
# Create table b (id2 text references a(id));
NOTICE: CREATE TABLE will create implicit trigger(s) for FOREIGN KEY check(s)
CREATE TABLE
# \d a Table "public.a" Column | Type | Modifiers --------+---------+----------- id | integer | not null Indexes: a_pkey primary key btree (id)
# \d b
Table "public.b"
Column | Type | Modifiers
--------+------+-----------
id2 | text |
Foreign Key constraints: $1 FOREIGN KEY (id2) REFERENCES a(id) ON UPDATE NO ACTION ON DELETE NO ACTION
Jean-Christian Imbeault
---------------------------(end of broadcast)--------------------------- TIP 8: explain analyze is your friend