Paul Jungwirth <p...@illuminatedcomputing.com> writes:
>> Deferrability is a property of a constraint, not an index

> Yes, but creating a unique constraint implicitly creates an index, and
> creating a unique index implicitly creates a constraint.

No, it doesn't.  I'm using "constraint" in a technical sense here,
that is something that is recorded as a constraint in the system
catalogs.

regression=# select count(*) from pg_constraint;
 count 
-------
    34
(1 row)

regression=# create table foo(f1 int unique);
CREATE TABLE
regression=# select count(*) from pg_constraint;
 count 
-------
    35
(1 row)

regression=# create table bar(f1 int);
CREATE TABLE
regression=# create unique index on bar(f1);
CREATE INDEX
regression=# select count(*) from pg_constraint;
 count 
-------
    35
(1 row)

The index on bar didn't create a constraint.

                        regards, tom lane


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Reply via email to