Обсуждение: alter-table.sgml and DEFAULT clause

Поиск
Список
Период
Сортировка

alter-table.sgml and DEFAULT clause

От
Fujii Masao
Дата:
Hi,

We seem to have forgotten to add the reference to DEFAULT clause
into the following syntax in alter-table.sgml. How about the attached
patch?

        ADD [ COLUMN ] column type [ column_constraint [ ... ] ]

Regards,

--
Fujii Masao
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center

Вложения

Re: alter-table.sgml and DEFAULT clause

От
Alvaro Herrera
Дата:
Excerpts from Fujii Masao's message of mar dic 28 01:26:09 -0300 2010:
> Hi,
>
> We seem to have forgotten to add the reference to DEFAULT clause
> into the following syntax in alter-table.sgml. How about the attached
> patch?
>
>         ADD [ COLUMN ] column type [ column_constraint [ ... ] ]

Hmm, and this works all the way back to 8.2 ...

--
Álvaro Herrera <alvherre@commandprompt.com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

Re: alter-table.sgml and DEFAULT clause

От
Tom Lane
Дата:
Alvaro Herrera <alvherre@commandprompt.com> writes:
> Excerpts from Fujii Masao's message of mar dic 28 01:26:09 -0300 2010:
>> We seem to have forgotten to add the reference to DEFAULT clause
>> into the following syntax in alter-table.sgml. How about the attached
>> patch?
>>
>> ADD [ COLUMN ] column type [ column_constraint [ ... ] ]

> Hmm, and this works all the way back to 8.2 ...

I wonder whether it would be better to leave ALTER alone and change the
CREATE syntax diagram to fold DEFAULT in as one of the column_constraint
options.  The current syntax diagram is flat out wrong, because it
states that DEFAULT must precede any constraint phrase, which isn't so.
Copying that error into the ALTER syntax doesn't seem like a good fix
to me.

Probably the reason it's like it is is that somebody felt that DEFAULT
didn't seem like a kind of constraint.  While that doesn't bother me
especially, we could perhaps deal with that objection by renaming the
"column_constraint" nonterminal to some other phrase, like
"column_property" or "column_option".

            regards, tom lane