index and sequence name length limit?

Started by Jean-Christian Imbeaultover 23 years ago3 messagesgeneral
Jump to latest
#1Jean-Christian Imbeault
jc@mega-bucks.co.jp

What is the limit on the length of a index or sequence's name?

I have some table with long names and I find it confusing when pgsql
truncates the table name when creating indexes or sequences (for serials).

Why does such a limit exist? I would think that since there are
virtually no limits on the size of data that a table or column can hold
there should be no limit on the length of names assigned to
tables/sequences/indexes/etc ... or if that a limit would be rather long
(say 256 characters?).

Jc

#2Jeff Davis
pgsql@j-davis.com
In reply to: Jean-Christian Imbeault (#1)
Re: index and sequence name length limit?

I believe that this question relates to a discussion on -hackers, in which
they are deciding how large to allow the names to be. It looks like the next
release will allow either 64 or 128 characters.

Eventually, I think there are plans to make it a true variable length type for
efficiency and flexibility. I don't think that it will make the next release,
however (7.3).

Regards,
Jeff Davis

Show quoted text

On Sunday 04 August 2002 08:41 pm, Jean-Christian Imbeault wrote:

What is the limit on the length of a index or sequence's name?

I have some table with long names and I find it confusing when pgsql
truncates the table name when creating indexes or sequences (for serials).

Why does such a limit exist? I would think that since there are
virtually no limits on the size of data that a table or column can hold
there should be no limit on the length of names assigned to
tables/sequences/indexes/etc ... or if that a limit would be rather long
(say 256 characters?).

Jc

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

#3Neil Conway
neilc@samurai.com
In reply to: Jean-Christian Imbeault (#1)
Re: index and sequence name length limit?

Jean-Christian Imbeault <jc@mega-bucks.co.jp> writes:

What is the limit on the length of a index or sequence's name?

31 by default, but you can increase that by changing the value of
NAMEDATALEN in src/include/pg_config.h, re-compiling, and re-running
initdb.

Cheers,

Neil

--
Neil Conway <neilconway@rogers.com>
PGP Key ID: DB3C29FC