BUG #5258: Unique and foreign key constraints fail on columns with reserved names, but not check constraints
От | Ben Woosley |
---|---|
Тема | BUG #5258: Unique and foreign key constraints fail on columns with reserved names, but not check constraints |
Дата | |
Msg-id | 201001040348.o043mxeS037581@wwwmaster.postgresql.org обсуждение исходный текст |
Ответы |
Re: BUG #5258: Unique and foreign key constraints fail on
columns with reserved names, but not check constraints
Re: BUG #5258: Unique and foreign key constraints fail on columns with reserved names, but not check constraints |
Список | pgsql-bugs |
The following bug has been logged online: Bug reference: 5258 Logged by: Ben Woosley Email address: ben.woosley@gmail.com PostgreSQL version: 8.4.2 Operating system: Mac OS 10.6 Description: Unique and foreign key constraints fail on columns with reserved names, but not check constraints Details: Check constraints successfully accept columns named with reserved words when they are qualified by table using the . syntax, e.g. "check (mod(table.as, 2) = 0)" However, unique and foreign key constraints added using the "alter table add constraint" syntax fail on the column name. At this point the statement has enough information (the host table name) to properly identify the column despite the unorthodox name. Alternatively, you could allow the . syntax qualification inside the argument to the constraint. Now, you may say that this is a reserved word and should never be used, but coming from the Ruby world, where reserved words are only reserved when they're truly ambiguous, I very much appreciate the freedom of using these names when it's unambiguous. This particularly so given that keywords are often chosen for their terseness and overlap with the most appropriate column name.
В списке pgsql-bugs по дате отправления: