Re: Renaming sequence auto generated by SERIAL type don't update pg_attrdef
От | Tom Lane |
---|---|
Тема | Re: Renaming sequence auto generated by SERIAL type don't update pg_attrdef |
Дата | |
Msg-id | 21151.1236657248@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Re: Renaming sequence auto generated by SERIAL type don't update pg_attrdef (Oliver Jowett <oliver@opencloud.com>) |
Ответы |
Re: Renaming sequence auto generated by SERIAL type don't
update pg_attrdef
|
Список | pgsql-jdbc |
Oliver Jowett <oliver@opencloud.com> writes: > Tom Lane wrote: >> What's the default value being used for anyway? > 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) 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. 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? regards, tom lane
В списке pgsql-jdbc по дате отправления: