Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id EDC311336B42 for ; Tue, 28 Dec 2010 11:21:37 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 46512-09 for ; Tue, 28 Dec 2010 15:21:32 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 67D4F1337B53 for ; Tue, 28 Dec 2010 11:21:30 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id oBSFLSuO019460; Tue, 28 Dec 2010 10:21:28 -0500 (EST) To: Alvaro Herrera cc: Fujii Masao , pgsql-docs Subject: Re: alter-table.sgml and DEFAULT clause In-reply-to: <1293541749-sup-6741@alvh.no-ip.org> References: <1293541749-sup-6741@alvh.no-ip.org> Comments: In-reply-to Alvaro Herrera message dated "Tue, 28 Dec 2010 10:09:41 -0300" Date: Tue, 28 Dec 2010 10:21:28 -0500 Message-ID: <19458.1293549688@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201012/46 X-Sequence-Number: 6282 Alvaro Herrera 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