Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 99232634160 for ; Tue, 6 Jul 2010 07:02:43 -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 77614-03; Tue, 6 Jul 2010 10:02:34 +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 AEB85633EBB; Tue, 6 Jul 2010 07:02:34 -0300 (ADT) Received: from localhost (localhost.localdomain [127.0.0.1]) by serveurmail01.codata.be (Postfix) with ESMTP id 6DE169004F; Tue, 6 Jul 2010 12:02:32 +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 36h135e1d-LV; Tue, 6 Jul 2010 12:02:31 +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 709B29004D; Tue, 6 Jul 2010 12:02:31 +0200 (CEST) Message-ID: <4C32FF36.8030604@codata.eu> Date: Tue, 06 Jul 2010 12:02:30 +0200 From: Arnaud Lesauvage 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-general@postgresql.org To: pgsql-odbc@postgresql.org, pgsql-general Subject: 'default nextval()' loses schema-qualification in dump ? Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.482 tagged_above=-5 required=5 tests=BAYES_05=-0.5, RDNS_DYNAMIC=0.982 X-Spam-Level: X-Archive-Number: 201007/153 X-Sequence-Number: 165038 Hi lists ! We ran into a problem after restoring a database dump. Postgesql version is 8.4.3 on Win32. The tables are linked with psqlODBC (v8.03.0400) and have SERIAL primary keys (that's why I cross-posted to psql-odbc). Before the restore, insertion in MSAccess was fine. After the restore, insertions failed with a 'currval() not set' error. 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. Why this doesn't matter in psql, I don't know (the schema in question is not in the search_path), but this does break psqlODBC's handling of "auto numbering" columns. I tried a simple dump of the table structure, and indeed the restore sets the search_path first and then creates the table without schema qualification, neither for the table nore for the sequence. Is this by design ? How can I work around this ? I am not sure this is really normal, since the restored database's strucure is not matching perfectly the original one's. Thanks a lot for your thoughts and help on this matter. Regards, Arnaud Lesauvage