Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id CDBD263347E for ; Fri, 9 Jul 2010 04:41:10 -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 05170-06 for ; Fri, 9 Jul 2010 07:41:02 +0000 (UTC) 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 8AAB9632516 for ; Fri, 9 Jul 2010 04:41:01 -0300 (ADT) Received: from localhost (localhost.localdomain [127.0.0.1]) by serveurmail01.codata.be (Postfix) with ESMTP id B9407900A5; Fri, 9 Jul 2010 09:40:59 +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 66xpaIf+1bEj; Fri, 9 Jul 2010 09:40:55 +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 03BF49008D; Fri, 9 Jul 2010 09:40:53 +0200 (CEST) Message-ID: <4C36D285.3090508@codata.eu> Date: Fri, 09 Jul 2010 09:40:53 +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 To: Hiroshi Inoue CC: pgsql-odbc@postgresql.org Subject: Re: 'default nextval()' loses schema-qualification in dump ? References: <4C32FF36.8030604@codata.eu> <27289.1278426134@sss.pgh.pa.us> <4C334593.7030300@codata.eu> <28564.1278429458@sss.pgh.pa.us> <4C342318.7040502@codata.eu> <4C342FA5.3050105@archonet.com> <4C35799E.2010401@codata.eu> <4C3697F7.1060600@tpf.co.jp> In-Reply-To: <4C3697F7.1060600@tpf.co.jp> 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=-10 required=5 tests=BAYES_00=-1.9, RDNS_DYNAMIC=0.982 X-Spam-Level: X-Archive-Number: 201007/17 X-Sequence-Number: 10360 Le 9/07/2010 5:31, Hiroshi Inoue a écrit : > Arnaud Lesauvage wrote: >> Le 7/07/2010 9:41, Richard Huxton a écrit : >>> On 07/07/10 07:47, Arnaud Lesauvage wrote: >>>> Le 6/07/2010 17:17, Tom Lane a écrit : >>>>> Arnaud Lesauvage writes: >>>>>> 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 ? >>> >>>> [9.125]conn=095C4198, query='select n.nspname, c.relname, a.attname, >>>> a.atttypid, t.typname, a.attnum, a.attlen, a.atttypmod, a.attnotnull, >>>> c.relhasrules, c.relkind, c.oid, d.adsrc, case t.typtype when 'd' then >>>> t.typbasetype else 0 end, t.typtypmod from (((pg_catalog.pg_class c >>>> inner join pg_catalog.pg_namespace n on n.oid = c.relnamespace and >>>> c.relname = E'mytable' and n.nspname = E'myschema') inner join >>>> pg_catalog.pg_attribute a on (not a.attisdropped) and a.attnum> 0 and >>>> a.attrelid = c.oid) inner join pg_catalog.pg_type t on t.oid = >>>> a.atttypid) left outer join pg_attrdef d on a.atthasdef and d.adrelid = >>>> a.attrelid and d.adnum = a.attnum order by n.nspname, c.relname, >>>> attnum' >>> >>> This is psqlODBC getting the sequence name (if you run this query it's >>> the adsrc column). If I remember correctly, that's supposed to be the >>> human-readable version of an expression and preserved *as entered by the >>> user* (or pg_restore in your case). >>> >>> If you start psql with the "-E" option and do \d myschema.mytable you'll >>> be able to see how it gets the sequence-name. About half-way down the >>> list of queries it runs you'll see a reference to pg_get_expr(...) - >>> that turns an internal representation into a useful usable one. >>> >>> I don't know why psqlODBC isn't using that. The function has been around >>> for a while. Hmm - it's present back in 7.4 although it's not used in \d >>> - that does reference adsrc directly. >>> >>> Just grabbed the source download for the latest version and it still >>> looks like it's using adsrc (I just searched for that and pg_get_expr). >>> There should probably be a change in info.c around line 2091 to add a >>> check for a recent version of PG (8+) and use pg_get_expr. Check on the >>> odbc mailing-list - there may be an updated version available for you to >>> test. >>> >> >> >> I haven't found a version more recent than the one I am using. >> Is this thread enough for a bug report, or should a new one be opened ? >> >> I don't think I know enough of either psqlODBC's internals to explain >> the problem to the developers, and I am not sure this thread will get >> their attention. > > Could you please try the drivers on testing for 8.4.0201 at > http://www.geocities.jp/inocchichichi/psqlodbc/index.html > ? It works fine Hiroshi, thanks a lot ! Do you know when a release as an msi installer will be available ? We deploy this driver through an active directory policy. Thanks again ! Regards, Arnaud Lesauvage