Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 07EC8B6208A for ; Fri, 3 Jun 2011 14:19:36 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 68840-04 for ; Fri, 3 Jun 2011 17:19:28 +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 8D90DB5FAFD for ; Fri, 3 Jun 2011 14:19:28 -0300 (ADT) 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 p53HJRgq001358; Fri, 3 Jun 2011 13:19:27 -0400 (EDT) To: Robert Haas cc: Daniel Cristian Cruz , pgsql-bugs@postgresql.org Subject: Re: BUG #6050: Dump and restore of view after a schema change: can't restore the view In-reply-to: References: <201106031238.p53CcA8P075374@wwwmaster.postgresql.org> <27042.1307113140@sss.pgh.pa.us> Comments: In-reply-to Robert Haas message dated "Fri, 03 Jun 2011 12:47:01 -0400" Date: Fri, 03 Jun 2011 13:19:27 -0400 Message-ID: <1357.1307121567@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: 201106/37 X-Sequence-Number: 30416 Robert Haas writes: > On Fri, Jun 3, 2011 at 10:59 AM, Tom Lane wrote: >> Personally my advice is to avoid USING: it wasn't one of the SQL >> committee's better ideas. > I don't understand why we can't just translate the USING into some > equivalent construct that doesn't involve USING. There is no directly equivalent construct, because USING changes the shape of the output table (the join has one fewer output column than would exist without USING). Now, if the query doesn't involve any explicit reference to "joinalias.*", we could probably fake it with some ugly thing involving COALESCE(leftcol, rightcol) ... but I don't think people will want to read that, and anyway the idea falls apart as soon as you do have a whole-row reference. regards, tom lane