PostgreSQL system catalog tables

This page contains information about the PostgreSQL system catalogtables available in Spanner.

PostgreSQL system catalog tablesstore schema data, such as information about tables and columns, and internalbookkeeping information. These system catalog tables are part of a namespacecalledpg_catalog.

Limitations and differences

This section lists the columns that are missing and other differences betweenthe Spanner implementation of PostgreSQL system catalogtables and PostgreSQL.

Unsupported columns

Spanner doesn't support every column in its implementation ofPostgreSQL system catalog tables. The following columns aren'tsupported and therefore don't show up in the table.

Catalog table nameMissing column names
pg_amamhandler
pg_attributeattacl,attmissingval
pg_classrelacl
pg_namespacenspacl
pg_procprosupport,proacl
pg_sequencesdata_type
pg_typetypsubscript,typinput,typoutput,typreceive,typsend,typmodin,typmodout,typanalyze,typacl

Empty columns

Some columns in supported system catalog tables don't contain data. Thesecolumns could have content added later so avoid queries that rely on thesecolumns being empty. For each table listed on this page, supported columns arelisted, along with information about whether or not the column has content.

Empty tables

Some tables and views have no data in them. This is so that queries can refer tothem without encountering errors. This improves compatibility with tools withoutrequiring rewrites to avoid those tables.

Difference from PostgreSQL

In PostgreSQL, you can write to these tables directly to modify thedatabase. In Spanner, system tables are read-only.

The Spanner implementation contains the following changes toPostgreSQL system catalog columns:

  • pg_node_tree columns (most notablypg_attrdef.adbin andpg_proc.prosqlbody) are text columns that contain the SQLexpressions.

  • oidvector columns (most notablypg_proc.proargtypes) areoid[]columns.

  • int2vector columns areint8[] columns.

  • pg_class.relnatts column isNULL for sequences because you can't selectthem in Spanner.

  • pg_collation only contains default and C. General collation support isn'tavailable.

PostgreSQL system catalog tables list

This section contains the PostgreSQL system catalog tables thatSpanner supports.

pg_am

Thepg_amtable has content.

The following table shows whether columns have content.

Column nameTypeHas content
oidoidY
amnametextY
amtypecharY

pg_attrdef

Thepg_attrdeftable has content.

The following table shows whether columns have content.

Column nameTypeHas content
oidoidY
adrelidoidY
adnumint8Y
adbintextY

Theadbin column should contain atext value that represents the serializedvalue of the default value.

pg_attribute

Thepg_attributetable has content.

The following table shows whether columns have content.

Column nameTypeHas content
attrelidoidY
attnametextY
atttypidoidY
attstattargetint8N
attlenint8N
attnumint8Y
attndimsint8Y
attcacheoffint8Y
atttypmodint8N
attbyvalboolN
attaligncharN
attstoragecharN
attcompressioncharY
attnotnullboolY
atthasdefboolY
atthasmissingboolY
attidentitycharY
attgeneratedcharY
attisdroppedboolY
attislocalboolY
attinhcountint8Y
attcollationoidN
attoptionstext[]N
attfdwoptionstext[]N

pg_class

Thepg_class

has content.

The following table shows whether columns have content.

Column nameTypeHas content
oidoidY
relnametextY
relnamespaceoidY
reltypeoidN
reloftypeoidN
relowneroidN
relamoidY
relfilenodeoidN
reltablespaceoidN
relpagesint8N
reltuplesfloat8N
relallvisibleint8N
reltoastrelidoidN
relhasindexboolY
relissharedboolN
relpersistencecharY
relkindcharY
relnattsint8Y
relchecksint8Y
relhasrulesboolN
relhastriggersboolN
relhassubclassboolN
relrowsecurityboolN
relforcerowsecurityboolN
relispopulatedboolY
relreplidentcharN
relispartitionboolN
relrewriteoidN
relfrozenxidint8N
relminmxidint8N
reloptionstext[]N
relpartboundtextN

pg_collation

Thepg_collationtable has content.

The following table shows whether columns have content.

Column nameTypeHas content
oidoidY
collnametextY
collnamespaceoidY
collowneroidN
collprovidercharY
collisdeterministicboolY
collencodingint8Y
collcollatetextN
collctypetextN
colliculocaletextN
collversiontextN

pg_constraint

Thepg_constrainttable has content.

The following table shows whether columns have content.

Column nameTypeHas content
oidoidY
connametextY
connamespaceoidY
contypecharY
condeferrableboolN
condeferredboolN
convalidatedboolY
conrelidoidY
contypidoidN
conindidoidN
conparentidoidN
confrelidoidY
confupdtypecharY
confdeltypecharY
confmatchtypecharN
conislocalboolN
coninhcountint8N
connoinheritboolN
conkeyint8[]Y
confkeyint8[]Y
conpfeqopoid[]N
conppeqopoid[]N
conffeqopoid[]N
conexclopoid[]N
confdelsetcolsint8[]N
conbintextN

pg_description

Thepg_descriptiontable has no content.

The following table shows whether columns have content.

Column nameTypeHas content
objoidoidN
classoidoidN
objsubidint64N
descriptiontextN

pg_enum

Thepg_enum

table has no content.

The following table shows whether columns have content.

Column nameTypeHas content
oidoidN
enumtypidoidN
collnamespacefloat8N
enumlabeltextN

pg_index

Thepg_index

table has content.

The following table shows whether columns have content.

Column nameTypeHas content
indexrelidoidY
indrelidoidY
indnattsint8Y
indnkeyattsint8Y
indisuniqueboolY
indnullsnotdistinctboolN
indisprimaryboolY
indisexclusionboolY
indimmediateboolN
indisclusteredboolY
indisvalidboolY
indcheckxminboolY
indisreadyboolY
indisliveboolY
indisreplidentboolY
indkeyint8[]N
indcollationoid[]N
indclassoid[]N
indoptionint8[]N
indexprstextN
indpredtextN

pg_namespace

Thepg_namespacetable has content.

The following table shows whether columns have content.

Column nameTypeHas content
oidoidY
nspnametextY
nspowneroidN

pg_proc

Thepg_proc tablehas content.

The following table shows whether columns have content.

Column nameTypeHas content
oidoidY
pronametextY
pronamespaceoidY
proowneroidN
prolangoidN
procostfloat8N
prorowsfloat8N
provariadicoidY
prokindcharY
prosecdefboolN
proleakproofboolN
proisstrictboolN
proretsetboolY
provolatilecharN
proparallelcharN
pronargsint8Y
pronargdefaultsint8Y
prorettypeoidY
proargtypesoid[]Y
proallargtypesoid[]N
proargmodeschar[]N
proargdefaultstextN
protrftypesoid[]N
prosrctext[]N
probintext[]N
prosqlbodytextY
proconfigtext[]N

pg_sequence

Thepg_sequencetable has content.

The following table shows whether columns have content.

Column nameTypeHas content
seqrelidoidY
seqtypidoidY
seqstartint8Y
seqincrementint8N
seqmaxint8N
seqminint8N
seqcacheint8Y
seqcycleboolY

pg_type

Thepg_type tablehas content.

The following table shows whether columns have content.

Column nameTypeHas content
oidoidY
typnametextY
typnamespaceoidY
typowneroidN
typlenint8Y
typbyvalboolY
typtypecharY
typcategorycharY
typispreferredboolY
typisdefinedboolY
typdelimcharY
typrelidoidY
typelemoidY
typarrayoidY
typaligncharN
typstoragecharN
typnotnullboolN
typbasetypeoidN
typtypmodint8N
typndimsint8N
typcollationoidN
typdeafultbintextN
typdefaulttextN

What's next

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-12-17 UTC.