X-Original-To: pgsql-docs-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 39980529E1 for ; Mon, 28 Mar 2005 17:23:02 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 96114-02 for ; Mon, 28 Mar 2005 16:22:52 +0000 (GMT) Received: from fetter.org (dsl092-188-065.sfo1.dsl.speakeasy.net [66.92.188.65]) by svr1.postgresql.org (Postfix) with ESMTP id 1FBB353347 for ; Mon, 28 Mar 2005 17:22:51 +0100 (BST) Received: from fetter.org (localhost.localdomain [127.0.0.1]) by fetter.org (8.13.1/8.12.10) with ESMTP id j2SGMjv3011835; Mon, 28 Mar 2005 08:22:45 -0800 Received: (from shackle@localhost) by fetter.org (8.13.1/8.13.1/Submit) id j2SGMi0f011834; Mon, 28 Mar 2005 08:22:44 -0800 Date: Mon, 28 Mar 2005 08:22:44 -0800 From: David Fetter To: Josh Berkus Cc: Alvaro Herrera , Tom Lane , pgsql-docs@postgresql.org Subject: Re: Missing doc on expression format for ALTER TABLE Message-ID: <20050328162244.GB11442@fetter.org> References: <200503261655.25658.josh@agliodbs.com> <200503271711.44046.josh@agliodbs.com> <20050328020050.GB28150@dcc.uchile.cl> <200503272150.48053.josh@agliodbs.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200503272150.48053.josh@agliodbs.com> User-Agent: Mutt/1.4.2i X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.056 tagged_above=0 required=5 tests=AWL, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200503/29 X-Sequence-Number: 2925 On Sun, Mar 27, 2005 at 09:50:47PM -0800, Josh Berkus wrote: > Guys, > > > > Well, yes, actually. Where in the documentation is a type > > > conversion expression defined? Do we use NEW and OLD? Or the > > > name of the column? Or something else? > > > > I think the ALTER TABLE page is in dire need of a "See also" > > section, at least. And a reference to where is > > defined would be nice to have. > > What I'm pointing out here is that the USING clause can't be just > ANY expression, it needs to be a specific type of expression. And > the docs don't explain what kind of expression is usable here. > Even a single example would go a long way ... I sent a patch in awhile ago that added this: "To change an integer column containing UNIX timestamps to timestamp with time zone via a USING clause: ALTER TABLE foo ALTER COLUMN foo_timestamp TYPE timestamp with time zone USING timestamp with time zone 'epoch' + foo_timestamp * interval '1 second'; " That is at least something, although I agree that more examples of the exact kind of expression would be a very good thing. Cheers, D -- David Fetter david@fetter.org http://fetter.org/ phone: +1 510 893 6100 mobile: +1 415 235 3778 Remember to vote!