Re: Question about the NAME type used in pg_proc and pg_class

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Tony Caduto <tony_caduto(at)amsoftwaredesign(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Question about the NAME type used in pg_proc and pg_class
Date: 2005-08-15 15:27:12
Message-ID: 20050815152712.GA22561@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Aug 15, 2005 at 10:02:01AM -0500, Tony Caduto wrote:
> Just had a quick question about the name type used by pg_proc and
> pg_class etc to return the name of a function,table,seq,view etc.
>
> Is this type limited to 64 bytes? ( could not find it in the docs)

See the "Character Types" section of the "Data Types" chapter:

http://www.postgresql.org/docs/8.0/static/datatype-character.html

"The name type exists _only_ for storage of identifiers in the internal
system catalogs and is not intended for use by the general user. Its
length is currently defined as 64 bytes (63 usable characters plus
terminator) but should be referenced using the constant NAMEDATALEN.
The length is set at compile time (and is therefore adjustable for
special uses); the default maximum length may change in a future
release."

> Must function/table names be limited to 64 characters in length?

See "Identifiers and Key Words" in the "SQL Syntax" chapter:

http://www.postgresql.org/docs/8.0/static/sql-syntax.html#SQL-SYNTAX-IDENTIFIERS

"The system uses no more than NAMEDATALEN-1 characters of an identifier;
longer names can be written in commands, but they will be truncated. By
default, NAMEDATALEN is 64 so the maximum identifier length is 63."

--
Michael Fuhr

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Douglas McNaught 2005-08-15 15:41:20 Re: Serial Unique question
Previous Message WELTY, RICHARD 2005-08-15 15:19:29 Re: Postgresql Books: Which one ?