Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 47DA56329F3 for ; Tue, 10 Mar 2009 00:44:42 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 01144-07 for ; Tue, 10 Mar 2009 00:44:29 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from tremor.opencloud.co.nz (tremor.opencloud.co.nz [131.203.101.230]) by mail.postgresql.org (Postfix) with ESMTP id B344E63299E for ; Tue, 10 Mar 2009 00:44:16 -0300 (ADT) Received: from deluge.opencloud.co.nz ([192.168.0.16]) by tremor.opencloud.co.nz with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1Lgssz-0007fm-FG; Tue, 10 Mar 2009 16:44:09 +1300 Message-ID: <49B5E208.1080205@opencloud.com> Date: Tue, 10 Mar 2009 16:44:08 +1300 From: Oliver Jowett User-Agent: Thunderbird 2.0.0.19 (X11/20090105) MIME-Version: 1.0 To: Tom Lane CC: "Dickson S. Guedes" , pgsql-jdbc Subject: Re: Renaming sequence auto generated by SERIAL type don't update pg_attrdef References: <1236650119.6410.73.camel@guedes-laptop> <20795.1236655715@sss.pgh.pa.us> In-Reply-To: <20795.1236655715@sss.pgh.pa.us> 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 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200903/45 X-Sequence-Number: 19375 Tom Lane wrote: > "Dickson S. Guedes" writes: >> Shouldn't the JDBC driver use another query instead that, since docs >> alerts[1] to this problem? > > What's the default value being used for anyway? If it's to determine > which sequence is associated with the column, I think you shouldn't be > looking at pg_attrdef at all; you should look for a dependent sequence > via pg_depend. But maybe it's only being used to check if the column > has a default, in which case the possible staleness of the string > value isn't important. I'm guessing that particular query is from DatabaseMetaData.getColumns(), which returns amongst other things: 13. COLUMN_DEF String => default value (may be null) (yes, that's the sum total of the JDBC documentation about that piece of metadata) -O