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

Re: determine sequence name for a serial

From: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>
To: Greg Stark <gsstark(at)mit(dot)edu>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: determine sequence name for a serial
Date: 2004-10-29 00:40:47
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-general
On Thu, Oct 28, 2004 at 07:55:51PM -0400, Greg Stark wrote:
> "Ed L." <pgsql(at)bluepolka(dot)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]>)
"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

In response to

pgsql-general by date

Next:From: Jean-Luc LachanceDate: 2004-10-29 01:18:33
Subject: Re: Sorting street addresses
Previous:From: GreyGeekDate: 2004-10-29 00:39:53
Subject: export-import problem

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