Re: determine sequence name for a serial

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: determine sequence name for a serial
Дата
Msg-id 20041029004047.GC15970@surnet.cl
обсуждение исходный текст
Ответ на Re: determine sequence name for a serial  (Greg Stark <gsstark@mit.edu>)
Список 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 по дате отправления:

Предыдущее
От: Jerry LeVan
Дата:
Сообщение: Upgrading from beta3 to beta4
Следующее
От: Jean-Luc Lachance
Дата:
Сообщение: Re: Sorting street addresses