Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 9F33B632871 for ; Tue, 6 Jul 2010 11:22:25 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 07073-09; Tue, 6 Jul 2010 14:22:18 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 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 0044862F51F; Tue, 6 Jul 2010 11:22:17 -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 o66EMEnO027290; Tue, 6 Jul 2010 10:22:14 -0400 (EDT) To: Arnaud Lesauvage cc: pgsql-odbc@postgresql.org, pgsql-general Subject: Re: 'default nextval()' loses schema-qualification in dump ? In-reply-to: <4C32FF36.8030604@codata.eu> References: <4C32FF36.8030604@codata.eu> Comments: In-reply-to Arnaud Lesauvage message dated "Tue, 06 Jul 2010 12:02:30 +0200" Date: Tue, 06 Jul 2010 10:22:14 -0400 Message-ID: <27289.1278426134@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: 201007/165 X-Sequence-Number: 165050 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. 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. regards, tom lane