Re: Renaming sequence auto generated by SERIAL type don't update pg_attrdef

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Dickson S(dot) Guedes" <listas(at)guedesoft(dot)net>
Cc: 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 03:28:35
Message-ID: 20795.1236655715@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

"Dickson S. Guedes" <listas(at)guedesoft(dot)net> 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.

regards, tom lane

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Scott Carey 2009-03-10 03:38:50 Re: [PERFORM] Query much slower when run from postgres function
Previous Message Dickson S. Guedes 2009-03-10 01:55:19 Renaming sequence auto generated by SERIAL type don't update pg_attrdef