Skip site navigation (1) Skip section navigation (2)

Re: determine sequence name for a serial

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: "Ed L(dot)" <pgsql(at)bluepolka(dot)net>
Cc: Robby Russell <robby(at)planetargon(dot)com>,pgsql-general(at)postgresql(dot)org
Subject: Re: determine sequence name for a serial
Date: 2004-10-28 23:31:35
Message-ID: 20041028233135.GA76231@winnie.fuhr.org (view raw or flat)
Thread:
Lists: 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/

In response to

Responses

pgsql-general by date

Next:From: Ed L.Date: 2004-10-28 23:50:35
Subject: Re: determine sequence name for a serial
Previous:From: Jonathan DaughertyDate: 2004-10-28 23:25:10
Subject: Re: determine sequence name for a serial

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group