SET CONSTRAINTS todo

Поиск
Список
Период
Сортировка
От Dan Colish
Тема SET CONSTRAINTS todo
Дата
Msg-id 55C31350-E559-4DEB-9814-994FB7302D9C@gmail.com
обсуждение исходный текст
Ответы Re: SET CONSTRAINTS todo  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
I wanted to work on this todo item and I have a few questions about the semantics of it. Essentially, it is not
possibleto have more than one relname for a constraint, even though the comment in trigger.c says otherwise. I have
usedthis code to test this: 

<<<
CREATE TABLE products (
      product_no integer CONSTRAINT must_be_different UNIQUE DEFERRABLE,
                name text,
                          price numeric
                                ); 

CREATE TABLE products2 (
       product_no integer CONSTRAINT must_be_different UNIQUE DEFERRABLE,
                 name text,
                           price numeric
                                 ); 
>>>

which results in the following error:

<<<ERROR:  relation "must_be_different" already exists
>>>

Therefore prefixing them with a table name does not seem to make sense. Additionally, there is already the feature of
prefixingthe constraint relname with a schema to limit the search space. 

Is the intention of the todo to allow the user to specify a tablename which limits the search path to that table's
schemaor is the feature to extend constraints to allow per table naming. In other words, would the feature allow
multipleconstraints of the same name in a schema since they would be table specific? 

--Dan

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Josh Berkus
Дата:
Сообщение: Re: 9.0 release notes
Следующее
От: Jan Wieck
Дата:
Сообщение: Re: Exposing the Xact commit order to the user