Skip site navigation (1) Skip section navigation (2)

Character Data Type 'Name'

From: Andy Anderson <aanderson(at)amherst(dot)edu>
To: pgsql-general(at)postgresql(dot)org
Subject: Character Data Type 'Name'
Date: 2008-04-29 21:46:35
Message-ID: A6089029-3A1F-4F47-951C-0D75D8126731@amherst.edu (view raw or flat)
Thread:
Lists: pgsql-general
I'm creating my own table of metadata about other tables in my  
database. As such, one column will be the names of those other tables,  
and the maximum length of the data in this column would be the allowed  
length of an identifier. So one possible data type for this column  
would be 'varchar(NAMEDATALEN - 1)'.

However, it would seem to be much simpler to use the special character  
type 'name', except that the documentation in section 8.3 warns that  
"The 'name' type exists only for storage of identifiers in the  
internal system catalogs and is not intended for use by the general  
user. "

Is there any real harm in using 'name', though, other than lack of  
portability?

-- Andy

Responses

pgsql-general by date

Next:From: Dan ArmbrustDate: 2008-04-29 21:54:48
Subject: Deadlock situation?
Previous:From: Viktor RosenfeldDate: 2008-04-29 21:04:25
Subject: Re: Re: passing a temporary table with more than one column to a stored procedure

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group