CREATE TABLE table_test (
foo text NOT NULL,
CONSTRAINT test_pk PRIMARY KEY (foo),
CONSTRAINT test_uq UNIQUE (foo)
);
building index "pg_toast_29364884_index" on table "pg_toast_29364884"
serially
building index "test_pk" on table "table_test" serially
pg_class has 3 records, table, its pk and unique indexes.
select * from pg_class where relname ~ '
pg_toast_29364884_index|test_pk|table_test';
but pg_constraint has just one record.
select * from pg_constraint where conrelid::regclass::text ~
'table_test|pg_toast_29364884'
Is that correct ? That second index exists but not its constraint.
This happens only when the primary key field is text, so it needs toast.
regards
Marcos