Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id F14CEB886D9 for ; Fri, 3 Jun 2011 17:03:17 -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 80557-01 for ; Fri, 3 Jun 2011 20:03:10 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from spinlock.commandprompt.com (host-215.commandprompt.net [207.173.203.215]) by mail.postgresql.org (Postfix) with ESMTP id 8AB19B6F035 for ; Fri, 3 Jun 2011 17:03:10 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by spinlock.commandprompt.com (Postfix) with ESMTP id 6FEB1348045; Fri, 3 Jun 2011 13:03:09 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at commandprompt.com Received: from spinlock.commandprompt.com ([127.0.0.1]) by localhost (spinlock.commandprompt.com.commandprompt.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 02YXy5yp-nM8; Fri, 3 Jun 2011 13:03:07 -0700 (PDT) Received: from perhan.alvh.no-ip.org (unknown [190.95.16.242]) by spinlock.commandprompt.com (Postfix) with ESMTPSA id 4EDD2348044; Fri, 3 Jun 2011 13:03:07 -0700 (PDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 1BF206E499; Fri, 3 Jun 2011 16:03:04 -0400 (CLT) Content-Type: text/plain; charset=UTF-8 Cc: Daniel Cristian Cruz , pgsql-bugs Subject: Re: BUG #6050: Dump and restore of view after a schema change: can't restore the view From: Alvaro Herrera To: Tom Lane In-reply-to: <27042.1307113140@sss.pgh.pa.us> References: <201106031238.p53CcA8P075374@wwwmaster.postgresql.org> <27042.1307113140@sss.pgh.pa.us> Date: Fri, 03 Jun 2011 16:03:03 -0400 Message-Id: <1307131302-sup-3920@alvh.no-ip.org> User-Agent: Sup/git Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-5 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201106/44 X-Sequence-Number: 30423 Excerpts from Tom Lane's message of vie jun 03 10:59:00 -0400 2011: > I'm inclined to write this off as "so don't do that". There's nothing > that pg_dump can do to make this work: it has to use the USING syntax > for the join, and that doesn't offer any way to qualify the column name > on just one side. The only possible fix would be to try to make ALTER > TABLE reject the addition of the conflicting column name to "c" in the > first place. Would it be possible to dump USING as an equivalent ON condition on output (nodeToString), and then examine simple ON conditions to turn them into USING conditions on input (stringToNode)? -- Álvaro Herrera The PostgreSQL Company - Command Prompt, Inc. PostgreSQL Replication, Consulting, Custom Development, 24x7 support