Re: Creating unique constraints on OID

Поиск
Список
Период
Сортировка
От Christopher Kings-Lynne
Тема Re: Creating unique constraints on OID
Дата
Msg-id ECEHIKNFIMMECLEBJFIGAEENCCAA.chriskl@familyhealth.com.au
обсуждение исходный текст
Ответ на Re: Creating unique constraints on OID  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Creating unique constraints on OID  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
So the result of all this is that the behaviour of my ADD UNIQUE code is
correct in this case?

> Peter Eisentraut <peter_e@gmx.net> writes:
> > Shouldn't this work?
> > create table test ( a int, unique (oid) );
> > ERROR:  CREATE TABLE: column "oid" named in key does not exist
>
> Now it does.

In 7.2 you mean?  Or did you just fix it then?

> > And shouldn't the last one say "ALTER"?
>
> The reason that happens is that parser/analyze.c transforms the command
> into an ALTER TABLE step that adds a constraint (a no-op in this case)
> plus a CREATE INDEX step.  The commandTag emitted by the last step is
> what psql shows.  This could possibly be fixed, but it seems not worth
> the trouble.

If it were to be changed - I really wouldn't know where to do that...

Chris



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

Предыдущее
От: Hiroshi Inoue
Дата:
Сообщение: Re: [GENERAL] To Postgres Devs : Wouldn't changing the
Следующее
От: "Christopher Kings-Lynne"
Дата:
Сообщение: Re: Index of a table is not used (in any case)