Paul Jungwirth 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

Search Discussions

Discussion Posts

Previous

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 4 of 4 | next ›
Discussion Overview
grouppgsql-general @
categoriespostgresql
postedAug 19, '13 at 5:46p
activeAug 19, '13 at 7:01p
posts4
users2
websitepostgresql.org
irc#postgresql

2 users in discussion

Tom Lane: 2 posts Paul Jungwirth: 2 posts

People

Translate

site design / logo © 2018 Grokbase