Overview

The pg_type table stores information about built-in data types. It mimics the PostgreSQL system catalog pg_type.

Please note that Oxla doesn’t support the custom types.

Columns

This table is designed for compatibility with tools that require PostgreSQL system tables, so it mostly has dummy data. Please note that not all columns in pg_type are applicable to every type of relation.

The following columns are available for querying in pg_type:

ColumnTypeDescription
oidintThis column represents the Object ID (OID) for each type in the database
typnametextThis column represents the data type.
typlenintThis column represents the number of bytes in the internal representation of the type
typnamespaceintUnused
typownerintUnused
typtypetextUnused
typisdefinedboolUnused
typstoragetextUnused
typaligntextUnused
typnotnullboolUnused
typcategorytextUnused
typispreferredboolUnused
typdelimtextUnused
typrelidintUnused
typsubscriptintUnused
typelemintUnused
typarrayintUnused
typinputintUnused
typoutputintUnused
typreceiveintUnused
typsendintUnused
typmodinintUnused
typmodoutintUnused
typanalyzeintUnused
typaligntextUnused
typstoragetextUnused
typnotnullboolUnused
typbasetypeintUnused
typtypmodintUnused
typndimsintUnused
typcollationintUnused
typdefaultbintextUnused
typdefaulttextUnused
typacltextUnused

Example

This example query retrieves the Object ID (oid) and data type name (typname) from the pg_type catalog. You can adjust the columns in the SELECT statement based on your needs.

SELECT oid, typname FROM pg_type;

It will return the list of Oxla’s supported data type.

 oid  |   typname   
------+-------------
   23 | int4
  700 | float4
   16 | bool
   20 | int8
  701 | float8
   25 | text
 1114 | timestamp
 1184 | timestamptz
 1083 | time
 1186 | interval
 1082 | date
  114 | json
(12 rows)