Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 088E0632B87 for ; Tue, 6 Jul 2010 12:03:00 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 25381-07; Tue, 6 Jul 2010 15:02:48 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from serveurmail01.codata.be (113.123.146.82.ipv4.evonet.be [82.146.123.113]) by mail.postgresql.org (Postfix) with ESMTP id D156A62F51F; Tue, 6 Jul 2010 12:02:47 -0300 (ADT) Received: from localhost (localhost.localdomain [127.0.0.1]) by serveurmail01.codata.be (Postfix) with ESMTP id 5B6969004D; Tue, 6 Jul 2010 17:02:46 +0200 (CEST) X-Virus-Scanned: amavisd-new at serveurmail01.codata.be Received: from serveurmail01.codata.be ([127.0.0.1]) by localhost (serveurmail01.codata.be [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6Rtu9eHb6zLm; Tue, 6 Jul 2010 17:02:44 +0200 (CEST) Received: from [127.0.0.1] (38-179-112-217.fix.adsl.belcenter.be [217.112.179.38]) by serveurmail01.codata.be (Postfix) with ESMTPSA id EBD269004A; Tue, 6 Jul 2010 17:02:43 +0200 (CEST) Message-ID: <4C334593.7030300@codata.eu> Date: Tue, 06 Jul 2010 17:02:43 +0200 From: Arnaud Lesauvage Reply-To: arnaud.listes@codata.eu User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.9.2.4) Gecko/20100608 Lightning/1.0b2 Thunderbird/3.1 MIME-Version: 1.0 Followup-To: pgsql-odbc@postgresql.org To: Tom Lane CC: pgsql-odbc@postgresql.org, pgsql-general Subject: Re: 'default nextval()' loses schema-qualification in dump ? References: <4C32FF36.8030604@codata.eu> <27289.1278426134@sss.pgh.pa.us> In-Reply-To: <27289.1278426134@sss.pgh.pa.us> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.918 tagged_above=-5 required=5 tests=BAYES_00=-1.9, RDNS_DYNAMIC=0.982 X-Spam-Level: X-Archive-Number: 201007/167 X-Sequence-Number: 165052 Le 6/07/2010 16:22, Tom Lane a écrit : > Arnaud Lesauvage writes: >> After some research, we found in psqlODBC's log that before the restore >> psqlODBC was getting the sequence's nextval with a schema qualified >> call, and after the restore the call was not schema qualified. >> I checked in pg_attrdef before and after the dump/restore, and indeed >> the "default nextval()" on this problematic table loses it's schema >> qualification in the process. > > This is a pretty inadequate description of your problem. Let's see the > exact SQL you are dealing with. What is the exact information you want me to give ? Everything I checked came from my analysis of psqlODBC's log. I saw that in the first case (before the restore) a schema-qualified nextval() was issued, and after the restore it was not schema qualified anymore. I looked further up in the log to see where the sequence name came from, and it seemed that it came from pg_attrdef.adsrc. I checked the value of this field in both databases, and it was different. Maybe psqlODBC does the wrong thing when taking the sequence name from this field, but my guess was that the problem came from here. > Note that if the argument of nextval is a plain regclass constant, like > nextval('seq'::regclass) > then the constant is in fact a reference to a specific sequence. > Whether it's displayed with a schema name depends on whether that > sequence is visible in your search_path. Displayed in pg_attrdef.adsrc ? It is not in the search_path, and it is schema qualified before the dump/restore and not after. As you have understood, I am not very savvy about postgresql's internals, but from what you say my guess is that the problem is int the psqlODBC is getting the default value of the sequence ? Regards, Arnaud Lesauvage