From: | Oliver Jowett <oliver(at)opencloud(dot)com> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | "Dickson S(dot) Guedes" <listas(at)guedesoft(dot)net>, pgsql-jdbc <pgsql-jdbc(at)postgresql(dot)org> |
Subject: | Re: Renaming sequence auto generated by SERIAL type don't update pg_attrdef |
Date: | 2009-03-10 04:06:57 |
Message-ID: | 49B5E761.4060507@opencloud.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-jdbc |
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
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2009-03-10 04:37:02 | Re: Renaming sequence auto generated by SERIAL type don't update pg_attrdef |
Previous Message | Tom Lane | 2009-03-10 03:54:08 | Re: Renaming sequence auto generated by SERIAL type don't update pg_attrdef |