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

From Alvaro Herrera
Subject Re: determine sequence name for a serial
Date
Msg-id 20041029004047.GC15970@surnet.cl
Whole thread Raw
In response to Re: determine sequence name for a serial  (Greg Stark <gsstark@mit.edu>)
List pgsql-general
On Thu, Oct 28, 2004 at 07:55:51PM -0400, Greg Stark wrote:
>
> "Ed L." <pgsql@bluepolka.net> writes:
>
> > 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.
>
> I hope you're wrong about people expecting that to be true because it isn't.
> The resulting sequence name is limited to 63 characters and gets truncated if
> it goes over. (63!? was it intended to be 64?) I believe the limit used to be
> 32 characters too.

The NAMEDATALEN constant is defined to be 64, and that includes the
trailing \0, so identifiers are limited to 63 bytes.

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"Before you were born your parents weren't as boring as they are now. They
got that way paying your bills, cleaning up your room and listening to you
tell them how idealistic you are."  -- Charles J. Sykes' advice to teenagers


pgsql-general by date:

Previous
From: Jerry LeVan
Date:
Subject: Upgrading from beta3 to beta4
Next
From: Jean-Luc Lachance
Date:
Subject: Re: Sorting street addresses