29

I can not find any references to the data type 'name' in the postgres documentation but I am seeing it as a data type on the pgagent.pga_jobstep table for the column 'jstdbname'. The udt_name is also 'name'. Selecting the rows from that table makes them appear as if they are strings.

It is not listed here: Postgres data types

2 Answers 2

27

Name is a 63 byte (varchar) type used for storing system identifiers.

Using psql you can get type information using \dT or \dT+

So for the name type:

# \dT name

                           List of data types
   Schema   | Name |                 Description                 
------------+------+---------------------------------------------
 pg_catalog | name | 63-byte type for storing system identifiers
(1 row)

or

# \dT+ name
                                                    List of data types
   Schema   | Name | Internal name | Size | Elements |  Owner   | Access privileges |                 Description                 
------------+------+---------------+------+----------+----------+-------------------+---------------------------------------------
 pg_catalog | name | name          | 64   |          | postgres |                   | 63-byte type for storing system identifiers
(1 row)
1
  • I read that this is not intended for general use, like in user-defined routines. Is it preferred over REGCLASS? and what is the equivalent object identifier data type for columns? REGTYPE?
    – Rafs
    Commented Sep 9 at 10:57
4
Table 8.5. Special Character Types

Name    Storage Size  Description
"char"  1 byte        single-byte internal type
name    64 bytes      internal type for object names

https://www.postgresql.org/docs/current/datatype-character.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.