Re: determine sequence name for a serial - Mailing list pgsql-general

From Michael Fuhr
Subject Re: determine sequence name for a serial
Date
Msg-id 20041028233135.GA76231@winnie.fuhr.org
Whole thread Raw
In response to Re: determine sequence name for a serial  ("Ed L." <pgsql@bluepolka.net>)
Responses Re: determine sequence name for a serial
List pgsql-general
On Thu, Oct 28, 2004 at 04:51:05PM -0600, Ed L. wrote:
>
> But I didn't understand why you care to get rid of the explicit reference to
> the sequence object in your code in the first place.  In PostgreSQL, at
> least for the past 5 years if not longer, if you create a SERIAL column for
> (schemaname, tablename, columnname), then your sequence will *always* be
> "schemaname.tablename_columnname_seq".

Only for certain values of "always."  Tables and columns can be renamed,
so the sequence name might no longer be "tablename_columnname_seq",
but rather "oldtablename_oldcolumnname_seq".

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

pgsql-general by date:

Previous
From: Jonathan Daugherty
Date:
Subject: Re: determine sequence name for a serial
Next
From: "Ed L."
Date:
Subject: Re: determine sequence name for a serial