Re: Character Data Type 'Name'

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andy Anderson <aanderson(at)amherst(dot)edu>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Character Data Type 'Name'
Date: 2008-04-30 01:46:15
Message-ID: 12047.1209519975@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Andy Anderson <aanderson(at)amherst(dot)edu> writes:
> 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?

Well, the warning is just there because we don't want anyone whining
that we broke their app if we decide to whack around the properties
of "name". If you're intentionally tracking PG-specific behavior,
though, I think using "name" is perfectly sensible.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2008-04-30 02:20:06 Re: Deadlock situation?
Previous Message Alvaro Herrera 2008-04-29 22:33:59 Re: Deadlock situation?