Thread

  1. index and sequence name length limit?

    Jean-Christian Imbeault <jc@mega-bucks.co.jp> — 2002-08-05T03:41:34Z

    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
    
    
    
  2. Re: index and sequence name length limit?

    Jeff Davis <list-pgsql-general@empires.org> — 2002-08-05T06:33:51Z

    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
    
    
    
    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
    
    
    
  3. Re: index and sequence name length limit?

    Neil Conway <nconway@klamath.dyndns.org> — 2002-08-05T07:44:20Z

    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