Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 98307633119 for ; Tue, 10 Mar 2009 01:07:06 -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 06400-01 for ; Tue, 10 Mar 2009 01:07:04 -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 B5B0E632D77 for ; Tue, 10 Mar 2009 01:07:04 -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 1LgtF5-0007lE-5S; Tue, 10 Mar 2009 17:06:59 +1300 Message-ID: <49B5E761.4060507@opencloud.com> Date: Tue, 10 Mar 2009 17:06:57 +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> <49B5E208.1080205@opencloud.com> <21151.1236657248@sss.pgh.pa.us> In-Reply-To: <21151.1236657248@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/47 X-Sequence-Number: 19377 Tom Lane wrote: > Hmm. The correct, pg_dump-tested way to get the default expression is > pg_catalog.pg_get_expr(adbin, adrelid) > but that's fairly expensive. I'm having a hard time recommending > that you put it into DatabaseMetaData.getColumns, when probably 99.99% > of applications won't even look at the value let alone care if it is > stale. OTOH the joins involved are not-cheap already, so maybe this > worry is just premature micro-optimization. I don't think DBMD.getColumns() is expected to be called all that much, certainly not in performance-critical paths, so perhaps the more complex expression is the way to go. How far back, version-wise, will that expression work? > BTW, is there a reason for the query to be using LIKE 'name' instead of > = 'name'? And if so, is whatever generates it smart about underscores > and % and \ in the name? The API lets the application specify a pattern to search on, using the same syntax that LIKE expects, so the driver just passes it straight through into the query (modulo normal string escaping) -O