pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Oliver Jowett <oliver@opencloud.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Dickson S. Guedes <listas@guedesoft.net>
Cc: pgsql-jdbc <pgsql-jdbc@postgresql.org>
Subject: Re: Renaming sequence auto generated by SERIAL type don't update pg_attrdef
Date: Tue, 10 Mar 2009 17:06:57 +1300
Message-ID: <49B5E761.4060507@opencloud.com> (raw)
In-Reply-To: <21151.1236657248@sss.pgh.pa.us>
References: <1236650119.6410.73.camel@guedes-laptop>
	<20795.1236655715@sss.pgh.pa.us>
	<49B5E208.1080205@opencloud.com>
	<21151.1236657248@sss.pgh.pa.us>

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



view thread (10+ messages)  latest in thread

Message-ID: <49B5E761.4060507@opencloud.com>
Permalink:  ../49B5E761.4060507@opencloud.com/
Also on:    postgresql.org/message-id/49B5E761.4060507@opencloud.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: oliver@opencloud.com, tgl@sss.pgh.pa.us, listas@guedesoft.net
  Subject: Re: Renaming sequence auto generated by SERIAL type don't update pg_attrdef
  In-Reply-To: <49B5E761.4060507@opencloud.com>
  References: <1236650119.6410.73.camel@guedes-laptop> <20795.1236655715@sss.pgh.pa.us> <49B5E208.1080205@opencloud.com> <21151.1236657248@sss.pgh.pa.us> <49B5E761.4060507@opencloud.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox