Re: determine sequence name for a serial

From: Jonathan Daugherty <cygnus(at)cprogrammer(dot)org>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: determine sequence name for a serial
Date: 2004-10-28 23:25:10
Message-ID: 20041028232510.GA26259@vulcan.cprogrammer.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Michael Fuhr 2004-10-28 23:31:35 Re: determine sequence name for a serial
Previous Message Michael Fuhr 2004-10-28 23:21:52 Re: Turning a subselect into an array