Re: Question about the NAME type used in pg_proc and pg_class - Mailing list pgsql-general

From Michael Fuhr
Subject Re: Question about the NAME type used in pg_proc and pg_class
Date
Msg-id 20050815152712.GA22561@winnie.fuhr.org
Whole thread Raw
In response to Question about the NAME type used in pg_proc and pg_class  (Tony Caduto <tony_caduto@amsoftwaredesign.com>)
Responses Re: Question about the NAME type used in pg_proc and pg_class  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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

pgsql-general by date:

Previous
From: "WELTY, RICHARD"
Date:
Subject: Re: Postgresql Books: Which one ?
Next
From: David Fetter
Date:
Subject: Re: Postgresql Books: Which one ?