patternsqlMajor
What is the data type 'name' in PostgreSQL
Viewed 0 times
postgresqlthewhattypenamedata
Problem
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
It is not listed here: Postgres data types
Solution
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:
or
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)Code Snippets
# \dT name
List of data types
Schema | Name | Description
------------+------+---------------------------------------------
pg_catalog | name | 63-byte type for storing system identifiers
(1 row)# \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)Context
StackExchange Database Administrators Q#217533, answer score: 27
Revisions (0)
No revisions yet.