pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
alter-table.sgml and DEFAULT clause
3+ messages / 3 participants
[nested] [flat]

* alter-table.sgml and DEFAULT clause
@ 2010-12-28 04:26 Fujii Masao <masao.fujii@gmail.com>
  2010-12-28 13:09 ` Re: alter-table.sgml and DEFAULT clause Alvaro Herrera <alvherre@commandprompt.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Fujii Masao @ 2010-12-28 04:26 UTC (permalink / raw)
  To: pgsql-docs

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

Attachments:

alter-table-add-column-default-v1.patch (application/octet-stream, 1.7K) download *** a/doc/src/sgml/ref/alter_table.sgml --- b/doc/src/sgml/ref/alter_table.sgml *************** *** 32,38 **** ALTER TABLE <replaceable class="PARAMETER">name</replaceable> <phrase>where <replaceable class="PARAMETER">action</replaceable> is one of:</phrase> ! ADD [ COLUMN ] <replaceable class="PARAMETER">column</replaceable> <replaceable class="PARAMETER">type</replaceable> [ <replaceable class="PARAMETER">column_constraint</replaceable> [ ... ] ] DROP [ COLUMN ] [ IF EXISTS ] <replaceable class="PARAMETER">column</replaceable> [ RESTRICT | CASCADE ] ALTER [ COLUMN ] <replaceable class="PARAMETER">column</replaceable> [ SET DATA ] TYPE <replaceable class="PARAMETER">type</replaceable> [ USING <replaceable class="PARAMETER">expression</replaceable> ] ALTER [ COLUMN ] <replaceable class="PARAMETER">column</replaceable> SET DEFAULT <replaceable class="PARAMETER">expression</replaceable> --- 32,38 ---- <phrase>where <replaceable class="PARAMETER">action</replaceable> is one of:</phrase> ! ADD [ COLUMN ] <replaceable class="PARAMETER">column</replaceable> <replaceable class="PARAMETER">type</replaceable> [ DEFAULT <replaceable>default_expr</replaceable> ] [ <replaceable class="PARAMETER">column_constraint</replaceable> [ ... ] ] DROP [ COLUMN ] [ IF EXISTS ] <replaceable class="PARAMETER">column</replaceable> [ RESTRICT | CASCADE ] ALTER [ COLUMN ] <replaceable class="PARAMETER">column</replaceable> [ SET DATA ] TYPE <replaceable class="PARAMETER">type</replaceable> [ USING <replaceable class="PARAMETER">expression</replaceable> ] ALTER [ COLUMN ] <replaceable class="PARAMETER">column</replaceable> SET DEFAULT <replaceable class="PARAMETER">expression</replaceable>
^ permalink raw reply [nested|flat] 3+ messages in thread

* Re: alter-table.sgml and DEFAULT clause
  2010-12-28 04:26 alter-table.sgml and DEFAULT clause Fujii Masao <masao.fujii@gmail.com>
@ 2010-12-28 13:09 ` Alvaro Herrera <alvherre@commandprompt.com>
  2010-12-28 15:21   ` Re: alter-table.sgml and DEFAULT clause Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 3+ messages in thread

From: Alvaro Herrera @ 2010-12-28 13:09 UTC (permalink / raw)
  To: Fujii Masao <masao.fujii@gmail.com>; +Cc: pgsql-docs

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



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: alter-table.sgml and DEFAULT clause
  2010-12-28 04:26 alter-table.sgml and DEFAULT clause Fujii Masao <masao.fujii@gmail.com>
  2010-12-28 13:09 ` Re: alter-table.sgml and DEFAULT clause Alvaro Herrera <alvherre@commandprompt.com>
@ 2010-12-28 15:21   ` Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 3+ messages in thread

From: Tom Lane @ 2010-12-28 15:21 UTC (permalink / raw)
  To: Alvaro Herrera <alvherre@commandprompt.com>; +Cc: Fujii Masao <masao.fujii@gmail.com>; pgsql-docs

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



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2010-12-28 15:21 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2010-12-28 04:26 alter-table.sgml and DEFAULT clause Fujii Masao <masao.fujii@gmail.com>
2010-12-28 13:09 ` Alvaro Herrera <alvherre@commandprompt.com>
2010-12-28 15:21   ` Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox