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

From Jonathan Daugherty
Subject Re: determine sequence name for a serial
Date
Msg-id 20041028232510.GA26259@vulcan.cprogrammer.org
Whole thread Raw
In response to Re: determine sequence name for a serial  ("Ed L." <pgsql@bluepolka.net>)
List pgsql-general
# 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".  If that naming convention changes,
# there will be a whole lotta breakage world-wide.

When a table is renamed, related sequences' names don't change (as of
7.4.5).  The ability to automagically pull the sequence based on the
schema.table.column would be nice if you don't want to worry about
having to update your table name and sequence name references in code.

--
  Jonathan Daugherty
  Command Prompt, Inc. - http://www.commandprompt.com/
  PostgreSQL Replication & Support Services, (503) 667-4564


pgsql-general by date:

Previous
From: Michael Fuhr
Date:
Subject: Re: Turning a subselect into an array
Next
From: Michael Fuhr
Date:
Subject: Re: determine sequence name for a serial