Re: Mistakes between an example and its description
От | Martín Marqués |
---|---|
Тема | Re: Mistakes between an example and its description |
Дата | |
Msg-id | CAPdiE1zARLreHEowYuG8Gk5-Eph-tq1v09SomLofr1FGNQ0c6A@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Mistakes between an example and its description (Eugene Wang <eugenewangfw@gmail.com>) |
Ответы |
Re: Mistakes between an example and its description
|
Список | pgsql-docs |
2018-05-10 16:04 GMT-03:00 Eugene Wang <eugenewangfw@gmail.com>: > Unique Constraint and Unique Index should be the same in this single-column > case, right? The unique index is what enforces the uniqueness of the field with a UNIQUE constraint, but a unique index is not necessarily a constraint. For example, you can use a unique index to create a primary key constraint with the USING clause, but you can't use the UNIQUE index created by a UNIQUE CONSTRAINT for this action. > Because, according to CONSTRAINT page in Postgres Documentation, Unique > Constraint on single column is realized as Unique B-TREE index. > > I have just realized that it is still a btree index, but I think this > example is not exactly a regular btree example. At least I will put the > example as: CREATE INDEX title_idx ON films USING BTREE(title); Yes, I agree on dropping the UNIQUE, just like Alvaro. There's another example which creates a UNIQUE index later in the doc, and not the best choice for a first example. Regards, -- Martín Marqués http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services
В списке pgsql-docs по дате отправления: