31

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

asked Sep 13, 2018 at 16:21

2 Answers 2

29

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)
answered Sep 13, 2018 at 16:47
1
  • 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? Commented Sep 9, 2024 at 10:57
6
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

answered Oct 16, 2020 at 14:19

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.