{"Entry":{"collection":"type","key":"xid8","name":"xid8","aliases":[],"metadata":{"aliases":[],"category":"Object and transaction identifiers","content_hash":"ee6201b8515ad3e4ccb78b811b8d586a077d2d01812e5980982c0de59323b36b","imported_at":"2026-09-30T00:40:37.100971+08:00","name":"xid8","name_zh":"","slug":"xid8","summary":"full transaction id"}},"Definition":{"Collection":"type","Key":"xid8","SourceDatabase":"center","Version":"18","SourceTable":"data_type","SourceKey":"xid8","SourceRevision":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","Facts":{"aliases":[],"casts":[{"castcontext":"e","castfunc":"xid(xid8)","castmethod":"f","castsource":"xid8","casttarget":"xid"}],"catalog":{"array_type_name":"_xid8","array_type_oid":"271","descr":"full transaction id","oid":"5069","typacl":"_null_","typalign":"d","typanalyze":"-","typarray":"0","typbasetype":"0","typbyval":"FLOAT8PASSBYVAL","typcategory":"U","typcollation":"0","typdefault":"_null_","typdefaultbin":"_null_","typdelim":"','","typelem":"0","typinput":"xid8in","typisdefined":"t","typispreferred":"f","typlen":"8","typmodin":"-","typmodout":"-","typname":"xid8","typnamespace":"pg_catalog","typndims":"0","typnotnull":"f","typoutput":"xid8out","typowner":"POSTGRES","typreceive":"xid8recv","typrelid":"0","typsend":"xid8send","typstorage":"p","typsubscript":"-","typtype":"b","typtypmod":"-1"},"comparison_data":{"aliases":[],"casts":[{"castcontext":"e","castfunc":"xid(xid8)","castmethod":"f","castsource":"xid8","casttarget":"xid"}],"catalog":{"array_type_name":"_xid8","typacl":"_null_","typalign":"d","typanalyze":"-","typarray":"_xid8","typbasetype":"0","typbyval":"FLOAT8PASSBYVAL","typcategory":"U","typcollation":"0","typdefault":"_null_","typdefaultbin":"_null_","typdelim":",","typelem":"0","typinput":"xid8in","typisdefined":"t","typispreferred":"f","typlen":"8","typmodin":"-","typmodout":"-","typname":"xid8","typndims":"0","typnotnull":"f","typoutput":"xid8out","typreceive":"xid8recv","typrelid":"0","typsend":"xid8send","typstorage":"p","typsubscript":"-","typtype":"b","typtypmod":"-1"},"facts":[{"label":"Catalog name","value":"pg_catalog.xid8"},{"label":"Declared length","value":"8 bytes"},{"label":"Input function","value":"xid8in"},{"label":"Output function","value":"xid8out"},{"label":"Storage strategy","value":"plain"},{"label":"Type OID","value":"5069"},{"label":"Type kind","value":"Base type"}],"operator_classes":[{"opcdefault":"t","opcfamily":"btree/xid8_ops","opcintype":"xid8","opckeytype":"0","opcmethod":"btree","opcname":"xid8_ops"},{"opcdefault":"t","opcfamily":"hash/xid8_ops","opcintype":"xid8","opckeytype":"0","opcmethod":"hash","opcname":"xid8_ops"}],"operators":[{"oprcanhash":"f","oprcanmerge":"f","oprcode":"xid8ge","oprcom":"\u003c=(xid8,xid8)","oprjoin":"scalargejoinsel","oprkind":"b","oprleft":"xid8","oprname":"\u003e=","oprnegate":"\u003c(xid8,xid8)","oprrest":"scalargesel","oprresult":"bool","oprright":"xid8"},{"oprcanhash":"f","oprcanmerge":"f","oprcode":"xid8gt","oprcom":"\u003c(xid8,xid8)","oprjoin":"scalargtjoinsel","oprkind":"b","oprleft":"xid8","oprname":"\u003e","oprnegate":"\u003c=(xid8,xid8)","oprrest":"scalargtsel","oprresult":"bool","oprright":"xid8"},{"oprcanhash":"f","oprcanmerge":"f","oprcode":"xid8le","oprcom":"\u003e=(xid8,xid8)","oprjoin":"scalarlejoinsel","oprkind":"b","oprleft":"xid8","oprname":"\u003c=","oprnegate":"\u003e(xid8,xid8)","oprrest":"scalarlesel","oprresult":"bool","oprright":"xid8"},{"oprcanhash":"f","oprcanmerge":"f","oprcode":"xid8lt","oprcom":"\u003e(xid8,xid8)","oprjoin":"scalarltjoinsel","oprkind":"b","oprleft":"xid8","oprname":"\u003c","oprnegate":"\u003e=(xid8,xid8)","oprrest":"scalarltsel","oprresult":"bool","oprright":"xid8"},{"oprcanhash":"f","oprcanmerge":"f","oprcode":"xid8ne","oprcom":"\u003c\u003e(xid8,xid8)","oprjoin":"neqjoinsel","oprkind":"b","oprleft":"xid8","oprname":"\u003c\u003e","oprnegate":"=(xid8,xid8)","oprrest":"neqsel","oprresult":"bool","oprright":"xid8"},{"oprcanhash":"t","oprcanmerge":"t","oprcode":"xid8eq","oprcom":"=(xid8,xid8)","oprjoin":"eqjoinsel","oprkind":"b","oprleft":"xid8","oprname":"=","oprnegate":"\u003c\u003e(xid8,xid8)","oprrest":"eqsel","oprresult":"bool","oprright":"xid8"}],"ranges":[]},"comparison_hash":"16f10898a92a1d3d391c590474413c641d438c1738f31984c9db2b05b26cad47","coverage":"source inventory; exact declared input types for operator classes","description":["full transaction id"],"facts":[{"label":"Catalog name","value":"pg_catalog.xid8"},{"label":"Type OID","value":"5069"},{"label":"Type kind","value":"Base type"},{"label":"Declared length","value":"8 bytes"},{"label":"Storage strategy","value":"plain"},{"label":"Input function","value":"xid8in"},{"label":"Output function","value":"xid8out"}],"manual_documentation":"dedicated family chapter","manual_html":"\u003cdiv class=\"sect1\" id=\"DATATYPE-OID\"\u003e\n\u003cdiv class=\"titlepage\"\u003e\n\u003cdiv\u003e\n\u003cdiv\u003e\n\u003ch2 class=\"title\"\u003e8.19. Object Identifier Types \u003c/h2\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cp\u003eObject identifiers (OIDs) are used internally by \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e as primary keys for various system tables. Type \u003ccode class=\"type\"\u003eoid\u003c/code\u003e represents an object identifier. There are also several alias types for \u003ccode class=\"type\"\u003eoid\u003c/code\u003e, each named \u003ccode class=\"type\"\u003ereg\u003cem class=\"replaceable\"\u003e\u003ccode\u003esomething\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e. \u003ca class=\"xref\" href=\"/docs/18/datatype-oid.html#DATATYPE-OID-TABLE\" title=\"Table 8.26. Object Identifier Types\"\u003eTable 8.26\u003c/a\u003e shows an overview.\u003c/p\u003e\n\u003cp\u003eThe \u003ccode class=\"type\"\u003eoid\u003c/code\u003e type is currently implemented as an unsigned four-byte integer. Therefore, it is not large enough to provide database-wide uniqueness in large databases, or even in large individual tables.\u003c/p\u003e\n\u003cp\u003eThe \u003ccode class=\"type\"\u003eoid\u003c/code\u003e type itself has few operations beyond comparison. It can be cast to integer, however, and then manipulated using the standard integer operators. (Beware of possible signed-versus-unsigned confusion if you do this.)\u003c/p\u003e\n\u003cp\u003eThe OID alias types have no operations of their own except for specialized input and output routines. These routines are able to accept and display symbolic names for system objects, rather than the raw numeric value that type \u003ccode class=\"type\"\u003eoid\u003c/code\u003e would use. The alias types allow simplified lookup of OID values for objects. For example, to examine the \u003ccode class=\"structname\"\u003epg_attribute\u003c/code\u003e rows related to a table \u003ccode class=\"literal\"\u003emytable\u003c/code\u003e, one could write:\u003c/p\u003e\n\u003cpre class=\"programlisting\"\u003eSELECT * FROM pg_attribute WHERE attrelid = 'mytable'::regclass;\n\u003c/pre\u003e\n\u003cp\u003erather than:\u003c/p\u003e\n\u003cpre class=\"programlisting\"\u003eSELECT * FROM pg_attribute\n  WHERE attrelid = (SELECT oid FROM pg_class WHERE relname = 'mytable');\n\u003c/pre\u003e\n\u003cp\u003eWhile that doesn't look all that bad by itself, it's still oversimplified. A far more complicated sub-select would be needed to select the right OID if there are multiple tables named \u003ccode class=\"literal\"\u003emytable\u003c/code\u003e in different schemas. The \u003ccode class=\"type\"\u003eregclass\u003c/code\u003e input converter handles the table lookup according to the schema path setting, and so it does the \u003cspan class=\"quote\"\u003e“\u003cspan class=\"quote\"\u003eright thing\u003c/span\u003e”\u003c/span\u003e automatically. Similarly, casting a table's OID to \u003ccode class=\"type\"\u003eregclass\u003c/code\u003e is handy for symbolic display of a numeric OID.\u003c/p\u003e\n\u003cdiv class=\"table\" id=\"DATATYPE-OID-TABLE\"\u003e\n\u003cp class=\"title\"\u003e\u003cstrong\u003eTable 8.26. Object Identifier Types\u003c/strong\u003e\u003c/p\u003e\n\u003cdiv class=\"table-contents\"\u003e\n\u003ctable class=\"table\"\u003e\n\n\n\n\n\n\n\u003cthead\u003e\n\u003ctr\u003e\n\u003cth\u003eName\u003c/th\u003e\n\u003cth\u003eReferences\u003c/th\u003e\n\u003cth\u003eDescription\u003c/th\u003e\n\u003cth\u003eValue Example\u003c/th\u003e\n\u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode class=\"type\"\u003eoid\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003eany\u003c/td\u003e\n\u003ctd\u003enumeric object identifier\u003c/td\u003e\n\u003ctd\u003e\u003ccode class=\"literal\"\u003e564182\u003c/code\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode class=\"type\"\u003eregclass\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003e\u003ccode class=\"structname\"\u003epg_class\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003erelation name\u003c/td\u003e\n\u003ctd\u003e\u003ccode class=\"literal\"\u003epg_type\u003c/code\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode class=\"type\"\u003eregcollation\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003e\u003ccode class=\"structname\"\u003epg_collation\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003ecollation name\u003c/td\u003e\n\u003ctd\u003e\u003ccode class=\"literal\"\u003e\"POSIX\"\u003c/code\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode class=\"type\"\u003eregconfig\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003e\u003ccode class=\"structname\"\u003epg_ts_config\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003etext search configuration\u003c/td\u003e\n\u003ctd\u003e\u003ccode class=\"literal\"\u003eenglish\u003c/code\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode class=\"type\"\u003eregdictionary\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003e\u003ccode class=\"structname\"\u003epg_ts_dict\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003etext search dictionary\u003c/td\u003e\n\u003ctd\u003e\u003ccode class=\"literal\"\u003esimple\u003c/code\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode class=\"type\"\u003eregnamespace\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003e\u003ccode class=\"structname\"\u003epg_namespace\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003enamespace name\u003c/td\u003e\n\u003ctd\u003e\u003ccode class=\"literal\"\u003epg_catalog\u003c/code\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode class=\"type\"\u003eregoper\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003e\u003ccode class=\"structname\"\u003epg_operator\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003eoperator name\u003c/td\u003e\n\u003ctd\u003e\u003ccode class=\"literal\"\u003e+\u003c/code\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode class=\"type\"\u003eregoperator\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003e\u003ccode class=\"structname\"\u003epg_operator\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003eoperator with argument types\u003c/td\u003e\n\u003ctd\u003e\u003ccode class=\"literal\"\u003e*(integer,​integer)\u003c/code\u003e or \u003ccode class=\"literal\"\u003e-(NONE,​integer)\u003c/code\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode class=\"type\"\u003eregproc\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003e\u003ccode class=\"structname\"\u003epg_proc\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003efunction name\u003c/td\u003e\n\u003ctd\u003e\u003ccode class=\"literal\"\u003esum\u003c/code\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode class=\"type\"\u003eregprocedure\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003e\u003ccode class=\"structname\"\u003epg_proc\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003efunction with argument types\u003c/td\u003e\n\u003ctd\u003e\u003ccode class=\"literal\"\u003esum(int4)\u003c/code\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode class=\"type\"\u003eregrole\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003e\u003ccode class=\"structname\"\u003epg_authid\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003erole name\u003c/td\u003e\n\u003ctd\u003e\u003ccode class=\"literal\"\u003esmithee\u003c/code\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode class=\"type\"\u003eregtype\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003e\u003ccode class=\"structname\"\u003epg_type\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003edata type name\u003c/td\u003e\n\u003ctd\u003e\u003ccode class=\"literal\"\u003einteger\u003c/code\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003c/div\u003e\n\u003c/div\u003e\u003cbr class=\"table-break\"\u003e\n\u003cp\u003eAll of the OID alias types for objects that are grouped by namespace accept schema-qualified names, and will display schema-qualified names on output if the object would not be found in the current search path without being qualified. For example, \u003ccode class=\"literal\"\u003emyschema.mytable\u003c/code\u003e is acceptable input for \u003ccode class=\"type\"\u003eregclass\u003c/code\u003e (if there is such a table). That value might be output as \u003ccode class=\"literal\"\u003emyschema.mytable\u003c/code\u003e, or just \u003ccode class=\"literal\"\u003emytable\u003c/code\u003e, depending on the current search path. The \u003ccode class=\"type\"\u003eregproc\u003c/code\u003e and \u003ccode class=\"type\"\u003eregoper\u003c/code\u003e alias types will only accept input names that are unique (not overloaded), so they are of limited use; for most uses \u003ccode class=\"type\"\u003eregprocedure\u003c/code\u003e or \u003ccode class=\"type\"\u003eregoperator\u003c/code\u003e are more appropriate. For \u003ccode class=\"type\"\u003eregoperator\u003c/code\u003e, unary operators are identified by writing \u003ccode class=\"literal\"\u003eNONE\u003c/code\u003e for the unused operand.\u003c/p\u003e\n\u003cp\u003eThe input functions for these types allow whitespace between tokens, and will fold upper-case letters to lower case, except within double quotes; this is done to make the syntax rules similar to the way object names are written in SQL. Conversely, the output functions will use double quotes if needed to make the output be a valid SQL identifier. For example, the OID of a function named \u003ccode class=\"literal\"\u003eFoo\u003c/code\u003e (with upper case \u003ccode class=\"literal\"\u003eF\u003c/code\u003e) taking two integer arguments could be entered as \u003ccode class=\"literal\"\u003e' \"Foo\" ( int, integer ) '::regprocedure\u003c/code\u003e. The output would look like \u003ccode class=\"literal\"\u003e\"Foo\"(integer,integer)\u003c/code\u003e. Both the function name and the argument type names could be schema-qualified, too.\u003c/p\u003e\n\u003cp\u003eMany built-in \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e functions accept the OID of a table, or another kind of database object, and for convenience are declared as taking \u003ccode class=\"type\"\u003eregclass\u003c/code\u003e (or the appropriate OID alias type). This means you do not have to look up the object's OID by hand, but can just enter its name as a string literal. For example, the \u003ccode class=\"function\"\u003enextval(regclass)\u003c/code\u003e function takes a sequence relation's OID, so you could call it like this:\u003c/p\u003e\n\u003cpre class=\"programlisting\"\u003enextval('foo')              \u003cem class=\"lineannotation\"\u003e\u003cspan class=\"lineannotation\"\u003eoperates on sequence \u003ccode class=\"literal\"\u003efoo\u003c/code\u003e\u003c/span\u003e\u003c/em\u003e\nnextval('FOO')              \u003cem class=\"lineannotation\"\u003e\u003cspan class=\"lineannotation\"\u003esame as above\u003c/span\u003e\u003c/em\u003e\nnextval('\"Foo\"')            \u003cem class=\"lineannotation\"\u003e\u003cspan class=\"lineannotation\"\u003eoperates on sequence \u003ccode class=\"literal\"\u003eFoo\u003c/code\u003e\u003c/span\u003e\u003c/em\u003e\nnextval('myschema.foo')     \u003cem class=\"lineannotation\"\u003e\u003cspan class=\"lineannotation\"\u003eoperates on \u003ccode class=\"literal\"\u003emyschema.foo\u003c/code\u003e\u003c/span\u003e\u003c/em\u003e\nnextval('\"myschema\".foo')   \u003cem class=\"lineannotation\"\u003e\u003cspan class=\"lineannotation\"\u003esame as above\u003c/span\u003e\u003c/em\u003e\nnextval('foo')              \u003cem class=\"lineannotation\"\u003e\u003cspan class=\"lineannotation\"\u003esearches search path for \u003ccode class=\"literal\"\u003efoo\u003c/code\u003e\u003c/span\u003e\u003c/em\u003e\n\u003c/pre\u003e\n\u003cdiv class=\"note\"\u003e\n\u003ch3 class=\"title\"\u003eNote\u003c/h3\u003e\n\u003cp\u003eWhen you write the argument of such a function as an unadorned literal string, it becomes a constant of type \u003ccode class=\"type\"\u003eregclass\u003c/code\u003e (or the appropriate type). Since this is really just an OID, it will track the originally identified object despite later renaming, schema reassignment, etc. This \u003cspan class=\"quote\"\u003e“\u003cspan class=\"quote\"\u003eearly binding\u003c/span\u003e”\u003c/span\u003e behavior is usually desirable for object references in column defaults and views. But sometimes you might want \u003cspan class=\"quote\"\u003e“\u003cspan class=\"quote\"\u003elate binding\u003c/span\u003e”\u003c/span\u003e where the object reference is resolved at run time. To get late-binding behavior, force the constant to be stored as a \u003ccode class=\"type\"\u003etext\u003c/code\u003e constant instead of \u003ccode class=\"type\"\u003eregclass\u003c/code\u003e:\u003c/p\u003e\n\u003cpre class=\"programlisting\"\u003enextval('foo'::text)      \u003cem class=\"lineannotation\"\u003e\u003cspan class=\"lineannotation\"\u003e\u003ccode class=\"literal\"\u003efoo\u003c/code\u003e is looked up at runtime\u003c/span\u003e\u003c/em\u003e\n\u003c/pre\u003e\n\u003cp\u003eThe \u003ccode class=\"function\"\u003eto_regclass()\u003c/code\u003e function and its siblings can also be used to perform run-time lookups. See \u003ca class=\"xref\" href=\"/docs/18/functions-info.html#FUNCTIONS-INFO-CATALOG-TABLE\" title=\"Table 9.76. System Catalog Information Functions\"\u003eTable 9.76\u003c/a\u003e.\u003c/p\u003e\n\u003c/div\u003e\n\u003cp\u003eAnother practical example of use of \u003ccode class=\"type\"\u003eregclass\u003c/code\u003e is to look up the OID of a table listed in the \u003ccode class=\"literal\"\u003einformation_schema\u003c/code\u003e views, which don't supply such OIDs directly. One might for example wish to call the \u003ccode class=\"function\"\u003epg_relation_size()\u003c/code\u003e function, which requires the table OID. Taking the above rules into account, the correct way to do that is\u003c/p\u003e\n\u003cpre class=\"programlisting\"\u003eSELECT table_schema, table_name,\n       pg_relation_size((quote_ident(table_schema) || '.' ||\n                         quote_ident(table_name))::regclass)\nFROM information_schema.tables\nWHERE ...\n\u003c/pre\u003e\n\u003cp\u003eThe \u003ccode class=\"function\"\u003equote_ident()\u003c/code\u003e function will take care of double-quoting the identifiers where needed. The seemingly easier\u003c/p\u003e\n\u003cpre class=\"programlisting\"\u003eSELECT pg_relation_size(table_name)\nFROM information_schema.tables\nWHERE ...\n\u003c/pre\u003e\n\u003cp\u003eis \u003cspan class=\"emphasis\"\u003e\u003cem\u003enot recommended\u003c/em\u003e\u003c/span\u003e, because it will fail for tables that are outside your search path or have names that require quoting.\u003c/p\u003e\n\u003cp\u003eAn additional property of most of the OID alias types is the creation of dependencies. If a constant of one of these types appears in a stored expression (such as a column default expression or view), it creates a dependency on the referenced object. For example, if a column has a default expression \u003ccode class=\"literal\"\u003enextval('my_seq'::regclass)\u003c/code\u003e, \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e understands that the default expression depends on the sequence \u003ccode class=\"literal\"\u003emy_seq\u003c/code\u003e, so the system will not let the sequence be dropped without first removing the default expression. The alternative of \u003ccode class=\"literal\"\u003enextval('my_seq'::text)\u003c/code\u003e does not create a dependency. (\u003ccode class=\"type\"\u003eregrole\u003c/code\u003e is an exception to this property. Constants of this type are not allowed in stored expressions.)\u003c/p\u003e\n\u003cp\u003eAnother identifier type used by the system is \u003ccode class=\"type\"\u003exid\u003c/code\u003e, or transaction (abbreviated xact) identifier. This is the data type of the system columns \u003ccode class=\"structfield\"\u003exmin\u003c/code\u003e and \u003ccode class=\"structfield\"\u003exmax\u003c/code\u003e. Transaction identifiers are 32-bit quantities. In some contexts, a 64-bit variant \u003ccode class=\"type\"\u003exid8\u003c/code\u003e is used. Unlike \u003ccode class=\"type\"\u003exid\u003c/code\u003e values, \u003ccode class=\"type\"\u003exid8\u003c/code\u003e values increase strictly monotonically and cannot be reused in the lifetime of a database cluster. See \u003ca class=\"xref\" href=\"/docs/18/transaction-id.html\" title=\"67.1. Transactions and Identifiers\"\u003eSection 67.1\u003c/a\u003e for more details.\u003c/p\u003e\n\u003cp\u003eA third identifier type used by the system is \u003ccode class=\"type\"\u003ecid\u003c/code\u003e, or command identifier. This is the data type of the system columns \u003ccode class=\"structfield\"\u003ecmin\u003c/code\u003e and \u003ccode class=\"structfield\"\u003ecmax\u003c/code\u003e. Command identifiers are also 32-bit quantities.\u003c/p\u003e\n\u003cp\u003eA final identifier type used by the system is \u003ccode class=\"type\"\u003etid\u003c/code\u003e, or tuple identifier (row identifier). This is the data type of the system column \u003ccode class=\"structfield\"\u003ectid\u003c/code\u003e. A tuple ID is a pair (block number, tuple index within block) that identifies the physical location of the row within its table.\u003c/p\u003e\n\u003cp\u003e(The system columns are further explained in \u003ca class=\"xref\" href=\"/docs/18/ddl-system-columns.html\" title=\"5.6. System Columns\"\u003eSection 5.6\u003c/a\u003e.)\u003c/p\u003e\n\u003c/div\u003e","manual_path":"datatype-oid.html","operator_classes":[{"opcdefault":"t","opcfamily":"hash/xid8_ops","opcintype":"xid8","opckeytype":"0","opcmethod":"hash","opcname":"xid8_ops","opcnamespace":"pg_catalog","opcowner":"POSTGRES"},{"opcdefault":"t","opcfamily":"btree/xid8_ops","opcintype":"xid8","opckeytype":"0","opcmethod":"btree","opcname":"xid8_ops","opcnamespace":"pg_catalog","opcowner":"POSTGRES"}],"operators":[{"descr":"equal","oid":"5068","oprcanhash":"t","oprcanmerge":"t","oprcode":"xid8eq","oprcom":"=(xid8,xid8)","oprjoin":"eqjoinsel","oprkind":"b","oprleft":"xid8","oprname":"=","oprnamespace":"pg_catalog","oprnegate":"\u003c\u003e(xid8,xid8)","oprowner":"POSTGRES","oprrest":"eqsel","oprresult":"bool","oprright":"xid8"},{"descr":"not equal","oid":"5072","oprcanhash":"f","oprcanmerge":"f","oprcode":"xid8ne","oprcom":"\u003c\u003e(xid8,xid8)","oprjoin":"neqjoinsel","oprkind":"b","oprleft":"xid8","oprname":"\u003c\u003e","oprnamespace":"pg_catalog","oprnegate":"=(xid8,xid8)","oprowner":"POSTGRES","oprrest":"neqsel","oprresult":"bool","oprright":"xid8"},{"descr":"less than","oid":"5073","oprcanhash":"f","oprcanmerge":"f","oprcode":"xid8lt","oprcom":"\u003e(xid8,xid8)","oprjoin":"scalarltjoinsel","oprkind":"b","oprleft":"xid8","oprname":"\u003c","oprnamespace":"pg_catalog","oprnegate":"\u003e=(xid8,xid8)","oprowner":"POSTGRES","oprrest":"scalarltsel","oprresult":"bool","oprright":"xid8"},{"descr":"greater than","oid":"5074","oprcanhash":"f","oprcanmerge":"f","oprcode":"xid8gt","oprcom":"\u003c(xid8,xid8)","oprjoin":"scalargtjoinsel","oprkind":"b","oprleft":"xid8","oprname":"\u003e","oprnamespace":"pg_catalog","oprnegate":"\u003c=(xid8,xid8)","oprowner":"POSTGRES","oprrest":"scalargtsel","oprresult":"bool","oprright":"xid8"},{"descr":"less than or equal","oid":"5075","oprcanhash":"f","oprcanmerge":"f","oprcode":"xid8le","oprcom":"\u003e=(xid8,xid8)","oprjoin":"scalarlejoinsel","oprkind":"b","oprleft":"xid8","oprname":"\u003c=","oprnamespace":"pg_catalog","oprnegate":"\u003e(xid8,xid8)","oprowner":"POSTGRES","oprrest":"scalarlesel","oprresult":"bool","oprright":"xid8"},{"descr":"greater than or equal","oid":"5076","oprcanhash":"f","oprcanmerge":"f","oprcode":"xid8ge","oprcom":"\u003c=(xid8,xid8)","oprjoin":"scalargejoinsel","oprkind":"b","oprleft":"xid8","oprname":"\u003e=","oprnamespace":"pg_catalog","oprnegate":"\u003c(xid8,xid8)","oprowner":"POSTGRES","oprrest":"scalargesel","oprresult":"bool","oprright":"xid8"}],"ranges":[],"related":[{"label":"pg_type catalog","url":"/wiki/catalog/pg_type/?v=18"},{"label":"pg_cast catalog","url":"/wiki/catalog/pg_cast/?v=18"},{"label":"pg_operator catalog","url":"/wiki/catalog/pg_operator/?v=18"},{"label":"pg_opclass catalog","url":"/wiki/catalog/pg_opclass/?v=18"},{"label":"Arrays","url":"/wiki/type/arrays/?v=18"},{"label":"OID Types topic","url":"/wiki/oid/xid8/?v=18"},{"label":"btree index access method","url":"/wiki/indexam/btree/?v=18"},{"label":"hash index access method","url":"/wiki/indexam/hash/?v=18"}],"release":{"channel":"stable","label":"18.6","major":"18","manual_sha256":{"arrays.html":"0e1d5c5a7b4a949d4439995f44f74ad4264e050d16eb9ad2a850fbaee04032df","catalog-pg-type.html":"ea9c9313bab8e92a7da18ebc50c7ff1f908dd80999a7e0ca3bbc82ba626c58d4","datatype-binary.html":"0c03ec47b76e37888a3da7f5dcfd340128a5d356642a85185cc9ebe17856a904","datatype-bit.html":"c49124aad561636c18080b9e09572fde7785a6b9eae86f5a33283f0fd6774c37","datatype-boolean.html":"b633f663e6c8276e7056287640c413aa79dbc15d5353cee0d41653d58d376956","datatype-character.html":"c73eebe413ea709a7792e4cfc3cfe9fb68cb496ebe83c3ebaa9d09f8c40d0f73","datatype-datetime.html":"e366275d8b13845bfa4ef0d68faa093e5f3ecb708a1ec870cbcbf7e425b85699","datatype-enum.html":"cab38e53222e30cc94b24de4b33634fd22d7c93f58ebcf35f646c9b8da78fae8","datatype-geometric.html":"0eb3053cfe7d6b0a4b5592c5d7af8d97cae527e87f063c5793413bcba5c14cd9","datatype-json.html":"650162a05b660146b500a205d523374d00aee117a6a6240d30262be51b6e33e5","datatype-money.html":"8b29c14b90679683ac5c472b59a0a7e2853f32cc7db43fab417b2697a6879964","datatype-net-types.html":"96846e641cc37727ddcd8b8a1aa0dbe33cd9787760a2b4efb0dcb9403d5be63f","datatype-numeric.html":"b74619f7ac2f1ca9f85c48073df78c33dd30e464e61baba6008634534edcb500","datatype-oid.html":"8b3360302225f08ae72716ce1804596de95b568e5d31f788cb4597427b28cc38","datatype-pg-lsn.html":"339172f5107cc7eb7139bec911277647219e92a532cebd0f3da0a5dacf8195af","datatype-pseudo.html":"c7cf0b8214304bd8702c95f2142671ae5f0d631f83717f9c07d9e1f2579961b4","datatype-textsearch.html":"4b15e05be8b49a71b28aea22f2c46d0dbf639a91e7b4fe129a4c737c6daad47c","datatype-uuid.html":"292b307b3223c6182bdba687e7f69e6dca9038430143ad79d56327f6ed4c3246","datatype-xml.html":"061fc2295b7b69be704f0a741b8decd10ad721059f871fb0243c669bb54d7822","datatype.html":"e581f67c74e42006289638c8659e9b338adbfd7f068bd8bf2b3be3880fcd2254","domains.html":"82d486973ccc35d14276627a67ac76b434452f23f9ed4d8aa3fbb01fdf285fc2","functions-info.html":"78ac80bf81da2e4f4a33f3b850faa86f0f58ec54a083d6c31da557907de0df87","rangetypes.html":"e4960abc7ce8e51d794f94f1e57b099d30b7f75dd7f2b23a960eef91f6291c33","rowtypes.html":"74f99e029c3a9edfd3e18810ba3c8cb66d3aada91eb67b86476560871e6617e9","sql-createdomain.html":"e94f927196de1b0ea1ce35cd4603c1f6f544439adcc0edf1c4222358e832245b"},"ref":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2","revision":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","source_files":{"doc/src/sgml/datatype.sgml":"86328daa77e20d81d222376ec0306d9841a17104e436c08d138eb763aefb3700","src/include/catalog/pg_am.dat":"b3cb86b102a42fb0024cbd99779c9897afb40d12a71f5cc5a0e5aee7ff2f9969","src/include/catalog/pg_am.h":"3426799df799f32163fcc0765f43dbdb5e88e626acf31284fef9fc6014b69d8e","src/include/catalog/pg_cast.dat":"97911281ca2c81917394ccb2ec13367e37c6801fd461d5e1a3d2f28b911b46b2","src/include/catalog/pg_cast.h":"de585c7df687d698e7d1d100dce8a794ac9da52414ea48169191019178c8f053","src/include/catalog/pg_opclass.dat":"4ee7d3619a6aa106e1c0db55de903931c7d11b1c60ba053a022519c55f8ee668","src/include/catalog/pg_opclass.h":"9c218537806c8ef0398302faaca7f91315dfc1198c48706cebffb479b68defaf","src/include/catalog/pg_operator.dat":"5d35b9b2ef5f9797cc815263927ef8a12367fedace53e828b4e8b320e2a7f703","src/include/catalog/pg_operator.h":"621b18cfffe102413d79b746ce7a10f77fc60fdd097bac34c22b31070d3ee3c4","src/include/catalog/pg_opfamily.dat":"3b694879027b858f2ecf1fa1152b7e30c6e15a216ba99c2384291c30e9d52311","src/include/catalog/pg_opfamily.h":"e1f5fc8aebd3042df847455bf66bf755f768c2aa8a9b03d22f7ec8563eba59c0","src/include/catalog/pg_proc.dat":"1f934ce80d460159dda137714374a35f9896315ea2476709cbb4da13b38ef95a","src/include/catalog/pg_proc.h":"f7d59f07c5b95e2f3c7141762a0f576e8a3af7581ba54c27537f4d500472bea5","src/include/catalog/pg_range.dat":"5c2271f8e89e9378d1887204e5785060b77405b5f0ff3e6c719250c9c1dcfcc4","src/include/catalog/pg_range.h":"45546d952b5181f989bd9234721897fc2b37005c8e49ce2ddc156f26974c3ca4","src/include/catalog/pg_type.dat":"5f5887b75677cba2d4a1a0cfeb355df5ed91f85d385fac88bd8d7c605b3578f9","src/include/catalog/pg_type.h":"8fb198749fd82b6c1818a3c18455f226f66116fcfeb3d4959c65ce3fda22802e"},"source_sha256":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f"},"sections":[],"signature":"xid8","sources":[{"label":"PostgreSQL 18 English manual","path":"datatype-oid.html","sha256":"8b3360302225f08ae72716ce1804596de95b568e5d31f788cb4597427b28cc38","url":"/docs/18/datatype-oid.html"},{"label":"Matching PostgreSQL source archive","sha256":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","url":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2"}]},"ManualEvidence":{"manual_path":"datatype-oid.html","release":{"channel":"stable","label":"18.6","major":"18","manual_sha256":{"arrays.html":"0e1d5c5a7b4a949d4439995f44f74ad4264e050d16eb9ad2a850fbaee04032df","catalog-pg-type.html":"ea9c9313bab8e92a7da18ebc50c7ff1f908dd80999a7e0ca3bbc82ba626c58d4","datatype-binary.html":"0c03ec47b76e37888a3da7f5dcfd340128a5d356642a85185cc9ebe17856a904","datatype-bit.html":"c49124aad561636c18080b9e09572fde7785a6b9eae86f5a33283f0fd6774c37","datatype-boolean.html":"b633f663e6c8276e7056287640c413aa79dbc15d5353cee0d41653d58d376956","datatype-character.html":"c73eebe413ea709a7792e4cfc3cfe9fb68cb496ebe83c3ebaa9d09f8c40d0f73","datatype-datetime.html":"e366275d8b13845bfa4ef0d68faa093e5f3ecb708a1ec870cbcbf7e425b85699","datatype-enum.html":"cab38e53222e30cc94b24de4b33634fd22d7c93f58ebcf35f646c9b8da78fae8","datatype-geometric.html":"0eb3053cfe7d6b0a4b5592c5d7af8d97cae527e87f063c5793413bcba5c14cd9","datatype-json.html":"650162a05b660146b500a205d523374d00aee117a6a6240d30262be51b6e33e5","datatype-money.html":"8b29c14b90679683ac5c472b59a0a7e2853f32cc7db43fab417b2697a6879964","datatype-net-types.html":"96846e641cc37727ddcd8b8a1aa0dbe33cd9787760a2b4efb0dcb9403d5be63f","datatype-numeric.html":"b74619f7ac2f1ca9f85c48073df78c33dd30e464e61baba6008634534edcb500","datatype-oid.html":"8b3360302225f08ae72716ce1804596de95b568e5d31f788cb4597427b28cc38","datatype-pg-lsn.html":"339172f5107cc7eb7139bec911277647219e92a532cebd0f3da0a5dacf8195af","datatype-pseudo.html":"c7cf0b8214304bd8702c95f2142671ae5f0d631f83717f9c07d9e1f2579961b4","datatype-textsearch.html":"4b15e05be8b49a71b28aea22f2c46d0dbf639a91e7b4fe129a4c737c6daad47c","datatype-uuid.html":"292b307b3223c6182bdba687e7f69e6dca9038430143ad79d56327f6ed4c3246","datatype-xml.html":"061fc2295b7b69be704f0a741b8decd10ad721059f871fb0243c669bb54d7822","datatype.html":"e581f67c74e42006289638c8659e9b338adbfd7f068bd8bf2b3be3880fcd2254","domains.html":"82d486973ccc35d14276627a67ac76b434452f23f9ed4d8aa3fbb01fdf285fc2","functions-info.html":"78ac80bf81da2e4f4a33f3b850faa86f0f58ec54a083d6c31da557907de0df87","rangetypes.html":"e4960abc7ce8e51d794f94f1e57b099d30b7f75dd7f2b23a960eef91f6291c33","rowtypes.html":"74f99e029c3a9edfd3e18810ba3c8cb66d3aada91eb67b86476560871e6617e9","sql-createdomain.html":"e94f927196de1b0ea1ce35cd4603c1f6f544439adcc0edf1c4222358e832245b"},"ref":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2","revision":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","source_files":{"doc/src/sgml/datatype.sgml":"86328daa77e20d81d222376ec0306d9841a17104e436c08d138eb763aefb3700","src/include/catalog/pg_am.dat":"b3cb86b102a42fb0024cbd99779c9897afb40d12a71f5cc5a0e5aee7ff2f9969","src/include/catalog/pg_am.h":"3426799df799f32163fcc0765f43dbdb5e88e626acf31284fef9fc6014b69d8e","src/include/catalog/pg_cast.dat":"97911281ca2c81917394ccb2ec13367e37c6801fd461d5e1a3d2f28b911b46b2","src/include/catalog/pg_cast.h":"de585c7df687d698e7d1d100dce8a794ac9da52414ea48169191019178c8f053","src/include/catalog/pg_opclass.dat":"4ee7d3619a6aa106e1c0db55de903931c7d11b1c60ba053a022519c55f8ee668","src/include/catalog/pg_opclass.h":"9c218537806c8ef0398302faaca7f91315dfc1198c48706cebffb479b68defaf","src/include/catalog/pg_operator.dat":"5d35b9b2ef5f9797cc815263927ef8a12367fedace53e828b4e8b320e2a7f703","src/include/catalog/pg_operator.h":"621b18cfffe102413d79b746ce7a10f77fc60fdd097bac34c22b31070d3ee3c4","src/include/catalog/pg_opfamily.dat":"3b694879027b858f2ecf1fa1152b7e30c6e15a216ba99c2384291c30e9d52311","src/include/catalog/pg_opfamily.h":"e1f5fc8aebd3042df847455bf66bf755f768c2aa8a9b03d22f7ec8563eba59c0","src/include/catalog/pg_proc.dat":"1f934ce80d460159dda137714374a35f9896315ea2476709cbb4da13b38ef95a","src/include/catalog/pg_proc.h":"f7d59f07c5b95e2f3c7141762a0f576e8a3af7581ba54c27537f4d500472bea5","src/include/catalog/pg_range.dat":"5c2271f8e89e9378d1887204e5785060b77405b5f0ff3e6c719250c9c1dcfcc4","src/include/catalog/pg_range.h":"45546d952b5181f989bd9234721897fc2b37005c8e49ce2ddc156f26974c3ca4","src/include/catalog/pg_type.dat":"5f5887b75677cba2d4a1a0cfeb355df5ed91f85d385fac88bd8d7c605b3578f9","src/include/catalog/pg_type.h":"8fb198749fd82b6c1818a3c18455f226f66116fcfeb3d4959c65ce3fda22802e"},"source_sha256":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f"},"sources":[{"label":"PostgreSQL 18 English manual","path":"datatype-oid.html","sha256":"8b3360302225f08ae72716ce1804596de95b568e5d31f788cb4597427b28cc38","url":"/docs/18/datatype-oid.html"},{"label":"Matching PostgreSQL source archive","sha256":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","url":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2"}]},"MeasuredEvidence":{}},"Text":{"Collection":"type","Key":"xid8","SourceDatabase":"center","Version":"18","Locale":"en","Title":"xid8","Summary":"full transaction id","BodyHTML":"\u003cdiv id=\"DATATYPE-OID\"\u003e\n\u003cdiv\u003e\n\u003cdiv\u003e\n\u003cdiv\u003e\n\u003ch2\u003e8.19. Object Identifier Types \u003c/h2\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cp\u003eObject identifiers (OIDs) are used internally by \u003cspan\u003ePostgreSQL\u003c/span\u003e as primary keys for various system tables. Type \u003ccode\u003eoid\u003c/code\u003e represents an object identifier. There are also several alias types for \u003ccode\u003eoid\u003c/code\u003e, each named \u003ccode\u003ereg\u003cem\u003e\u003ccode\u003esomething\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e. \u003ca href=\"/docs/18/datatype-oid.html#DATATYPE-OID-TABLE\" rel=\"nofollow\"\u003eTable 8.26\u003c/a\u003e shows an overview.\u003c/p\u003e\n\u003cp\u003eThe \u003ccode\u003eoid\u003c/code\u003e type is currently implemented as an unsigned four-byte integer. Therefore, it is not large enough to provide database-wide uniqueness in large databases, or even in large individual tables.\u003c/p\u003e\n\u003cp\u003eThe \u003ccode\u003eoid\u003c/code\u003e type itself has few operations beyond comparison. It can be cast to integer, however, and then manipulated using the standard integer operators. (Beware of possible signed-versus-unsigned confusion if you do this.)\u003c/p\u003e\n\u003cp\u003eThe OID alias types have no operations of their own except for specialized input and output routines. These routines are able to accept and display symbolic names for system objects, rather than the raw numeric value that type \u003ccode\u003eoid\u003c/code\u003e would use. The alias types allow simplified lookup of OID values for objects. For example, to examine the \u003ccode\u003epg_attribute\u003c/code\u003e rows related to a table \u003ccode\u003emytable\u003c/code\u003e, one could write:\u003c/p\u003e\n\u003cpre\u003eSELECT * FROM pg_attribute WHERE attrelid = \u0026#39;mytable\u0026#39;::regclass;\n\u003c/pre\u003e\n\u003cp\u003erather than:\u003c/p\u003e\n\u003cpre\u003eSELECT * FROM pg_attribute\n  WHERE attrelid = (SELECT oid FROM pg_class WHERE relname = \u0026#39;mytable\u0026#39;);\n\u003c/pre\u003e\n\u003cp\u003eWhile that doesn\u0026#39;t look all that bad by itself, it\u0026#39;s still oversimplified. A far more complicated sub-select would be needed to select the right OID if there are multiple tables named \u003ccode\u003emytable\u003c/code\u003e in different schemas. The \u003ccode\u003eregclass\u003c/code\u003e input converter handles the table lookup according to the schema path setting, and so it does the \u003cspan\u003e“\u003cspan\u003eright thing\u003c/span\u003e”\u003c/span\u003e automatically. Similarly, casting a table\u0026#39;s OID to \u003ccode\u003eregclass\u003c/code\u003e is handy for symbolic display of a numeric OID.\u003c/p\u003e\n\u003cdiv id=\"DATATYPE-OID-TABLE\"\u003e\n\u003cp\u003e\u003cstrong\u003eTable 8.26. Object Identifier Types\u003c/strong\u003e\u003c/p\u003e\n\u003cdiv\u003e\n\u003ctable\u003e\n\n\n\n\n\n\n\u003cthead\u003e\n\u003ctr\u003e\n\u003cth\u003eName\u003c/th\u003e\n\u003cth\u003eReferences\u003c/th\u003e\n\u003cth\u003eDescription\u003c/th\u003e\n\u003cth\u003eValue Example\u003c/th\u003e\n\u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode\u003eoid\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003eany\u003c/td\u003e\n\u003ctd\u003enumeric object identifier\u003c/td\u003e\n\u003ctd\u003e\u003ccode\u003e564182\u003c/code\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode\u003eregclass\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003e\u003ccode\u003epg_class\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003erelation name\u003c/td\u003e\n\u003ctd\u003e\u003ccode\u003epg_type\u003c/code\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode\u003eregcollation\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003e\u003ccode\u003epg_collation\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003ecollation name\u003c/td\u003e\n\u003ctd\u003e\u003ccode\u003e\u0026#34;POSIX\u0026#34;\u003c/code\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode\u003eregconfig\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003e\u003ccode\u003epg_ts_config\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003etext search configuration\u003c/td\u003e\n\u003ctd\u003e\u003ccode\u003eenglish\u003c/code\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode\u003eregdictionary\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003e\u003ccode\u003epg_ts_dict\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003etext search dictionary\u003c/td\u003e\n\u003ctd\u003e\u003ccode\u003esimple\u003c/code\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode\u003eregnamespace\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003e\u003ccode\u003epg_namespace\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003enamespace name\u003c/td\u003e\n\u003ctd\u003e\u003ccode\u003epg_catalog\u003c/code\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode\u003eregoper\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003e\u003ccode\u003epg_operator\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003eoperator name\u003c/td\u003e\n\u003ctd\u003e\u003ccode\u003e+\u003c/code\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode\u003eregoperator\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003e\u003ccode\u003epg_operator\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003eoperator with argument types\u003c/td\u003e\n\u003ctd\u003e\u003ccode\u003e*(integer,​integer)\u003c/code\u003e or \u003ccode\u003e-(NONE,​integer)\u003c/code\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode\u003eregproc\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003e\u003ccode\u003epg_proc\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003efunction name\u003c/td\u003e\n\u003ctd\u003e\u003ccode\u003esum\u003c/code\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode\u003eregprocedure\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003e\u003ccode\u003epg_proc\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003efunction with argument types\u003c/td\u003e\n\u003ctd\u003e\u003ccode\u003esum(int4)\u003c/code\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode\u003eregrole\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003e\u003ccode\u003epg_authid\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003erole name\u003c/td\u003e\n\u003ctd\u003e\u003ccode\u003esmithee\u003c/code\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode\u003eregtype\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003e\u003ccode\u003epg_type\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003edata type name\u003c/td\u003e\n\u003ctd\u003e\u003ccode\u003einteger\u003c/code\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003c/div\u003e\n\u003c/div\u003e\u003cbr\u003e\n\u003cp\u003eAll of the OID alias types for objects that are grouped by namespace accept schema-qualified names, and will display schema-qualified names on output if the object would not be found in the current search path without being qualified. For example, \u003ccode\u003emyschema.mytable\u003c/code\u003e is acceptable input for \u003ccode\u003eregclass\u003c/code\u003e (if there is such a table). That value might be output as \u003ccode\u003emyschema.mytable\u003c/code\u003e, or just \u003ccode\u003emytable\u003c/code\u003e, depending on the current search path. The \u003ccode\u003eregproc\u003c/code\u003e and \u003ccode\u003eregoper\u003c/code\u003e alias types will only accept input names that are unique (not overloaded), so they are of limited use; for most uses \u003ccode\u003eregprocedure\u003c/code\u003e or \u003ccode\u003eregoperator\u003c/code\u003e are more appropriate. For \u003ccode\u003eregoperator\u003c/code\u003e, unary operators are identified by writing \u003ccode\u003eNONE\u003c/code\u003e for the unused operand.\u003c/p\u003e\n\u003cp\u003eThe input functions for these types allow whitespace between tokens, and will fold upper-case letters to lower case, except within double quotes; this is done to make the syntax rules similar to the way object names are written in SQL. Conversely, the output functions will use double quotes if needed to make the output be a valid SQL identifier. For example, the OID of a function named \u003ccode\u003eFoo\u003c/code\u003e (with upper case \u003ccode\u003eF\u003c/code\u003e) taking two integer arguments could be entered as \u003ccode\u003e\u0026#39; \u0026#34;Foo\u0026#34; ( int, integer ) \u0026#39;::regprocedure\u003c/code\u003e. The output would look like \u003ccode\u003e\u0026#34;Foo\u0026#34;(integer,integer)\u003c/code\u003e. Both the function name and the argument type names could be schema-qualified, too.\u003c/p\u003e\n\u003cp\u003eMany built-in \u003cspan\u003ePostgreSQL\u003c/span\u003e functions accept the OID of a table, or another kind of database object, and for convenience are declared as taking \u003ccode\u003eregclass\u003c/code\u003e (or the appropriate OID alias type). This means you do not have to look up the object\u0026#39;s OID by hand, but can just enter its name as a string literal. For example, the \u003ccode\u003enextval(regclass)\u003c/code\u003e function takes a sequence relation\u0026#39;s OID, so you could call it like this:\u003c/p\u003e\n\u003cpre\u003enextval(\u0026#39;foo\u0026#39;)              \u003cem\u003e\u003cspan\u003eoperates on sequence \u003ccode\u003efoo\u003c/code\u003e\u003c/span\u003e\u003c/em\u003e\nnextval(\u0026#39;FOO\u0026#39;)              \u003cem\u003e\u003cspan\u003esame as above\u003c/span\u003e\u003c/em\u003e\nnextval(\u0026#39;\u0026#34;Foo\u0026#34;\u0026#39;)            \u003cem\u003e\u003cspan\u003eoperates on sequence \u003ccode\u003eFoo\u003c/code\u003e\u003c/span\u003e\u003c/em\u003e\nnextval(\u0026#39;myschema.foo\u0026#39;)     \u003cem\u003e\u003cspan\u003eoperates on \u003ccode\u003emyschema.foo\u003c/code\u003e\u003c/span\u003e\u003c/em\u003e\nnextval(\u0026#39;\u0026#34;myschema\u0026#34;.foo\u0026#39;)   \u003cem\u003e\u003cspan\u003esame as above\u003c/span\u003e\u003c/em\u003e\nnextval(\u0026#39;foo\u0026#39;)              \u003cem\u003e\u003cspan\u003esearches search path for \u003ccode\u003efoo\u003c/code\u003e\u003c/span\u003e\u003c/em\u003e\n\u003c/pre\u003e\n\u003cdiv\u003e\n\u003ch3\u003eNote\u003c/h3\u003e\n\u003cp\u003eWhen you write the argument of such a function as an unadorned literal string, it becomes a constant of type \u003ccode\u003eregclass\u003c/code\u003e (or the appropriate type). Since this is really just an OID, it will track the originally identified object despite later renaming, schema reassignment, etc. This \u003cspan\u003e“\u003cspan\u003eearly binding\u003c/span\u003e”\u003c/span\u003e behavior is usually desirable for object references in column defaults and views. But sometimes you might want \u003cspan\u003e“\u003cspan\u003elate binding\u003c/span\u003e”\u003c/span\u003e where the object reference is resolved at run time. To get late-binding behavior, force the constant to be stored as a \u003ccode\u003etext\u003c/code\u003e constant instead of \u003ccode\u003eregclass\u003c/code\u003e:\u003c/p\u003e\n\u003cpre\u003enextval(\u0026#39;foo\u0026#39;::text)      \u003cem\u003e\u003cspan\u003e\u003ccode\u003efoo\u003c/code\u003e is looked up at runtime\u003c/span\u003e\u003c/em\u003e\n\u003c/pre\u003e\n\u003cp\u003eThe \u003ccode\u003eto_regclass()\u003c/code\u003e function and its siblings can also be used to perform run-time lookups. See \u003ca href=\"/docs/18/functions-info.html#FUNCTIONS-INFO-CATALOG-TABLE\" rel=\"nofollow\"\u003eTable 9.76\u003c/a\u003e.\u003c/p\u003e\n\u003c/div\u003e\n\u003cp\u003eAnother practical example of use of \u003ccode\u003eregclass\u003c/code\u003e is to look up the OID of a table listed in the \u003ccode\u003einformation_schema\u003c/code\u003e views, which don\u0026#39;t supply such OIDs directly. One might for example wish to call the \u003ccode\u003epg_relation_size()\u003c/code\u003e function, which requires the table OID. Taking the above rules into account, the correct way to do that is\u003c/p\u003e\n\u003cpre\u003eSELECT table_schema, table_name,\n       pg_relation_size((quote_ident(table_schema) || \u0026#39;.\u0026#39; ||\n                         quote_ident(table_name))::regclass)\nFROM information_schema.tables\nWHERE ...\n\u003c/pre\u003e\n\u003cp\u003eThe \u003ccode\u003equote_ident()\u003c/code\u003e function will take care of double-quoting the identifiers where needed. The seemingly easier\u003c/p\u003e\n\u003cpre\u003eSELECT pg_relation_size(table_name)\nFROM information_schema.tables\nWHERE ...\n\u003c/pre\u003e\n\u003cp\u003eis \u003cspan\u003e\u003cem\u003enot recommended\u003c/em\u003e\u003c/span\u003e, because it will fail for tables that are outside your search path or have names that require quoting.\u003c/p\u003e\n\u003cp\u003eAn additional property of most of the OID alias types is the creation of dependencies. If a constant of one of these types appears in a stored expression (such as a column default expression or view), it creates a dependency on the referenced object. For example, if a column has a default expression \u003ccode\u003enextval(\u0026#39;my_seq\u0026#39;::regclass)\u003c/code\u003e, \u003cspan\u003ePostgreSQL\u003c/span\u003e understands that the default expression depends on the sequence \u003ccode\u003emy_seq\u003c/code\u003e, so the system will not let the sequence be dropped without first removing the default expression. The alternative of \u003ccode\u003enextval(\u0026#39;my_seq\u0026#39;::text)\u003c/code\u003e does not create a dependency. (\u003ccode\u003eregrole\u003c/code\u003e is an exception to this property. Constants of this type are not allowed in stored expressions.)\u003c/p\u003e\n\u003cp\u003eAnother identifier type used by the system is \u003ccode\u003exid\u003c/code\u003e, or transaction (abbreviated xact) identifier. This is the data type of the system columns \u003ccode\u003exmin\u003c/code\u003e and \u003ccode\u003exmax\u003c/code\u003e. Transaction identifiers are 32-bit quantities. In some contexts, a 64-bit variant \u003ccode\u003exid8\u003c/code\u003e is used. Unlike \u003ccode\u003exid\u003c/code\u003e values, \u003ccode\u003exid8\u003c/code\u003e values increase strictly monotonically and cannot be reused in the lifetime of a database cluster. See \u003ca href=\"/docs/18/transaction-id.html\" rel=\"nofollow\"\u003eSection 67.1\u003c/a\u003e for more details.\u003c/p\u003e\n\u003cp\u003eA third identifier type used by the system is \u003ccode\u003ecid\u003c/code\u003e, or command identifier. This is the data type of the system columns \u003ccode\u003ecmin\u003c/code\u003e and \u003ccode\u003ecmax\u003c/code\u003e. Command identifiers are also 32-bit quantities.\u003c/p\u003e\n\u003cp\u003eA final identifier type used by the system is \u003ccode\u003etid\u003c/code\u003e, or tuple identifier (row identifier). This is the data type of the system column \u003ccode\u003ectid\u003c/code\u003e. A tuple ID is a pair (block number, tuple index within block) that identifies the physical location of the row within its table.\u003c/p\u003e\n\u003cp\u003e(The system columns are further explained in \u003ca href=\"/docs/18/ddl-system-columns.html\" rel=\"nofollow\"\u003eSection 5.6\u003c/a\u003e.)\u003c/p\u003e\n\u003c/div\u003e","SourceRevision":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","ContentHash":"225439693c875a7f84f0a82e75ed62f31d176cb24fc24fa7ed4dfda8d41d844c","Payload":{"description":["full transaction id"],"manual_html":"\u003cdiv class=\"sect1\" id=\"DATATYPE-OID\"\u003e\n\u003cdiv class=\"titlepage\"\u003e\n\u003cdiv\u003e\n\u003cdiv\u003e\n\u003ch2 class=\"title\"\u003e8.19. Object Identifier Types \u003c/h2\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cp\u003eObject identifiers (OIDs) are used internally by \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e as primary keys for various system tables. Type \u003ccode class=\"type\"\u003eoid\u003c/code\u003e represents an object identifier. There are also several alias types for \u003ccode class=\"type\"\u003eoid\u003c/code\u003e, each named \u003ccode class=\"type\"\u003ereg\u003cem class=\"replaceable\"\u003e\u003ccode\u003esomething\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e. \u003ca class=\"xref\" href=\"/docs/18/datatype-oid.html#DATATYPE-OID-TABLE\" title=\"Table 8.26. Object Identifier Types\"\u003eTable 8.26\u003c/a\u003e shows an overview.\u003c/p\u003e\n\u003cp\u003eThe \u003ccode class=\"type\"\u003eoid\u003c/code\u003e type is currently implemented as an unsigned four-byte integer. Therefore, it is not large enough to provide database-wide uniqueness in large databases, or even in large individual tables.\u003c/p\u003e\n\u003cp\u003eThe \u003ccode class=\"type\"\u003eoid\u003c/code\u003e type itself has few operations beyond comparison. It can be cast to integer, however, and then manipulated using the standard integer operators. (Beware of possible signed-versus-unsigned confusion if you do this.)\u003c/p\u003e\n\u003cp\u003eThe OID alias types have no operations of their own except for specialized input and output routines. These routines are able to accept and display symbolic names for system objects, rather than the raw numeric value that type \u003ccode class=\"type\"\u003eoid\u003c/code\u003e would use. The alias types allow simplified lookup of OID values for objects. For example, to examine the \u003ccode class=\"structname\"\u003epg_attribute\u003c/code\u003e rows related to a table \u003ccode class=\"literal\"\u003emytable\u003c/code\u003e, one could write:\u003c/p\u003e\n\u003cpre class=\"programlisting\"\u003eSELECT * FROM pg_attribute WHERE attrelid = 'mytable'::regclass;\n\u003c/pre\u003e\n\u003cp\u003erather than:\u003c/p\u003e\n\u003cpre class=\"programlisting\"\u003eSELECT * FROM pg_attribute\n  WHERE attrelid = (SELECT oid FROM pg_class WHERE relname = 'mytable');\n\u003c/pre\u003e\n\u003cp\u003eWhile that doesn't look all that bad by itself, it's still oversimplified. A far more complicated sub-select would be needed to select the right OID if there are multiple tables named \u003ccode class=\"literal\"\u003emytable\u003c/code\u003e in different schemas. The \u003ccode class=\"type\"\u003eregclass\u003c/code\u003e input converter handles the table lookup according to the schema path setting, and so it does the \u003cspan class=\"quote\"\u003e“\u003cspan class=\"quote\"\u003eright thing\u003c/span\u003e”\u003c/span\u003e automatically. Similarly, casting a table's OID to \u003ccode class=\"type\"\u003eregclass\u003c/code\u003e is handy for symbolic display of a numeric OID.\u003c/p\u003e\n\u003cdiv class=\"table\" id=\"DATATYPE-OID-TABLE\"\u003e\n\u003cp class=\"title\"\u003e\u003cstrong\u003eTable 8.26. Object Identifier Types\u003c/strong\u003e\u003c/p\u003e\n\u003cdiv class=\"table-contents\"\u003e\n\u003ctable class=\"table\"\u003e\n\n\n\n\n\n\n\u003cthead\u003e\n\u003ctr\u003e\n\u003cth\u003eName\u003c/th\u003e\n\u003cth\u003eReferences\u003c/th\u003e\n\u003cth\u003eDescription\u003c/th\u003e\n\u003cth\u003eValue Example\u003c/th\u003e\n\u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode class=\"type\"\u003eoid\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003eany\u003c/td\u003e\n\u003ctd\u003enumeric object identifier\u003c/td\u003e\n\u003ctd\u003e\u003ccode class=\"literal\"\u003e564182\u003c/code\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode class=\"type\"\u003eregclass\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003e\u003ccode class=\"structname\"\u003epg_class\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003erelation name\u003c/td\u003e\n\u003ctd\u003e\u003ccode class=\"literal\"\u003epg_type\u003c/code\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode class=\"type\"\u003eregcollation\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003e\u003ccode class=\"structname\"\u003epg_collation\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003ecollation name\u003c/td\u003e\n\u003ctd\u003e\u003ccode class=\"literal\"\u003e\"POSIX\"\u003c/code\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode class=\"type\"\u003eregconfig\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003e\u003ccode class=\"structname\"\u003epg_ts_config\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003etext search configuration\u003c/td\u003e\n\u003ctd\u003e\u003ccode class=\"literal\"\u003eenglish\u003c/code\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode class=\"type\"\u003eregdictionary\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003e\u003ccode class=\"structname\"\u003epg_ts_dict\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003etext search dictionary\u003c/td\u003e\n\u003ctd\u003e\u003ccode class=\"literal\"\u003esimple\u003c/code\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode class=\"type\"\u003eregnamespace\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003e\u003ccode class=\"structname\"\u003epg_namespace\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003enamespace name\u003c/td\u003e\n\u003ctd\u003e\u003ccode class=\"literal\"\u003epg_catalog\u003c/code\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode class=\"type\"\u003eregoper\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003e\u003ccode class=\"structname\"\u003epg_operator\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003eoperator name\u003c/td\u003e\n\u003ctd\u003e\u003ccode class=\"literal\"\u003e+\u003c/code\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode class=\"type\"\u003eregoperator\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003e\u003ccode class=\"structname\"\u003epg_operator\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003eoperator with argument types\u003c/td\u003e\n\u003ctd\u003e\u003ccode class=\"literal\"\u003e*(integer,​integer)\u003c/code\u003e or \u003ccode class=\"literal\"\u003e-(NONE,​integer)\u003c/code\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode class=\"type\"\u003eregproc\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003e\u003ccode class=\"structname\"\u003epg_proc\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003efunction name\u003c/td\u003e\n\u003ctd\u003e\u003ccode class=\"literal\"\u003esum\u003c/code\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode class=\"type\"\u003eregprocedure\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003e\u003ccode class=\"structname\"\u003epg_proc\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003efunction with argument types\u003c/td\u003e\n\u003ctd\u003e\u003ccode class=\"literal\"\u003esum(int4)\u003c/code\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode class=\"type\"\u003eregrole\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003e\u003ccode class=\"structname\"\u003epg_authid\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003erole name\u003c/td\u003e\n\u003ctd\u003e\u003ccode class=\"literal\"\u003esmithee\u003c/code\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode class=\"type\"\u003eregtype\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003e\u003ccode class=\"structname\"\u003epg_type\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003edata type name\u003c/td\u003e\n\u003ctd\u003e\u003ccode class=\"literal\"\u003einteger\u003c/code\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003c/div\u003e\n\u003c/div\u003e\u003cbr class=\"table-break\"\u003e\n\u003cp\u003eAll of the OID alias types for objects that are grouped by namespace accept schema-qualified names, and will display schema-qualified names on output if the object would not be found in the current search path without being qualified. For example, \u003ccode class=\"literal\"\u003emyschema.mytable\u003c/code\u003e is acceptable input for \u003ccode class=\"type\"\u003eregclass\u003c/code\u003e (if there is such a table). That value might be output as \u003ccode class=\"literal\"\u003emyschema.mytable\u003c/code\u003e, or just \u003ccode class=\"literal\"\u003emytable\u003c/code\u003e, depending on the current search path. The \u003ccode class=\"type\"\u003eregproc\u003c/code\u003e and \u003ccode class=\"type\"\u003eregoper\u003c/code\u003e alias types will only accept input names that are unique (not overloaded), so they are of limited use; for most uses \u003ccode class=\"type\"\u003eregprocedure\u003c/code\u003e or \u003ccode class=\"type\"\u003eregoperator\u003c/code\u003e are more appropriate. For \u003ccode class=\"type\"\u003eregoperator\u003c/code\u003e, unary operators are identified by writing \u003ccode class=\"literal\"\u003eNONE\u003c/code\u003e for the unused operand.\u003c/p\u003e\n\u003cp\u003eThe input functions for these types allow whitespace between tokens, and will fold upper-case letters to lower case, except within double quotes; this is done to make the syntax rules similar to the way object names are written in SQL. Conversely, the output functions will use double quotes if needed to make the output be a valid SQL identifier. For example, the OID of a function named \u003ccode class=\"literal\"\u003eFoo\u003c/code\u003e (with upper case \u003ccode class=\"literal\"\u003eF\u003c/code\u003e) taking two integer arguments could be entered as \u003ccode class=\"literal\"\u003e' \"Foo\" ( int, integer ) '::regprocedure\u003c/code\u003e. The output would look like \u003ccode class=\"literal\"\u003e\"Foo\"(integer,integer)\u003c/code\u003e. Both the function name and the argument type names could be schema-qualified, too.\u003c/p\u003e\n\u003cp\u003eMany built-in \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e functions accept the OID of a table, or another kind of database object, and for convenience are declared as taking \u003ccode class=\"type\"\u003eregclass\u003c/code\u003e (or the appropriate OID alias type). This means you do not have to look up the object's OID by hand, but can just enter its name as a string literal. For example, the \u003ccode class=\"function\"\u003enextval(regclass)\u003c/code\u003e function takes a sequence relation's OID, so you could call it like this:\u003c/p\u003e\n\u003cpre class=\"programlisting\"\u003enextval('foo')              \u003cem class=\"lineannotation\"\u003e\u003cspan class=\"lineannotation\"\u003eoperates on sequence \u003ccode class=\"literal\"\u003efoo\u003c/code\u003e\u003c/span\u003e\u003c/em\u003e\nnextval('FOO')              \u003cem class=\"lineannotation\"\u003e\u003cspan class=\"lineannotation\"\u003esame as above\u003c/span\u003e\u003c/em\u003e\nnextval('\"Foo\"')            \u003cem class=\"lineannotation\"\u003e\u003cspan class=\"lineannotation\"\u003eoperates on sequence \u003ccode class=\"literal\"\u003eFoo\u003c/code\u003e\u003c/span\u003e\u003c/em\u003e\nnextval('myschema.foo')     \u003cem class=\"lineannotation\"\u003e\u003cspan class=\"lineannotation\"\u003eoperates on \u003ccode class=\"literal\"\u003emyschema.foo\u003c/code\u003e\u003c/span\u003e\u003c/em\u003e\nnextval('\"myschema\".foo')   \u003cem class=\"lineannotation\"\u003e\u003cspan class=\"lineannotation\"\u003esame as above\u003c/span\u003e\u003c/em\u003e\nnextval('foo')              \u003cem class=\"lineannotation\"\u003e\u003cspan class=\"lineannotation\"\u003esearches search path for \u003ccode class=\"literal\"\u003efoo\u003c/code\u003e\u003c/span\u003e\u003c/em\u003e\n\u003c/pre\u003e\n\u003cdiv class=\"note\"\u003e\n\u003ch3 class=\"title\"\u003eNote\u003c/h3\u003e\n\u003cp\u003eWhen you write the argument of such a function as an unadorned literal string, it becomes a constant of type \u003ccode class=\"type\"\u003eregclass\u003c/code\u003e (or the appropriate type). Since this is really just an OID, it will track the originally identified object despite later renaming, schema reassignment, etc. This \u003cspan class=\"quote\"\u003e“\u003cspan class=\"quote\"\u003eearly binding\u003c/span\u003e”\u003c/span\u003e behavior is usually desirable for object references in column defaults and views. But sometimes you might want \u003cspan class=\"quote\"\u003e“\u003cspan class=\"quote\"\u003elate binding\u003c/span\u003e”\u003c/span\u003e where the object reference is resolved at run time. To get late-binding behavior, force the constant to be stored as a \u003ccode class=\"type\"\u003etext\u003c/code\u003e constant instead of \u003ccode class=\"type\"\u003eregclass\u003c/code\u003e:\u003c/p\u003e\n\u003cpre class=\"programlisting\"\u003enextval('foo'::text)      \u003cem class=\"lineannotation\"\u003e\u003cspan class=\"lineannotation\"\u003e\u003ccode class=\"literal\"\u003efoo\u003c/code\u003e is looked up at runtime\u003c/span\u003e\u003c/em\u003e\n\u003c/pre\u003e\n\u003cp\u003eThe \u003ccode class=\"function\"\u003eto_regclass()\u003c/code\u003e function and its siblings can also be used to perform run-time lookups. See \u003ca class=\"xref\" href=\"/docs/18/functions-info.html#FUNCTIONS-INFO-CATALOG-TABLE\" title=\"Table 9.76. System Catalog Information Functions\"\u003eTable 9.76\u003c/a\u003e.\u003c/p\u003e\n\u003c/div\u003e\n\u003cp\u003eAnother practical example of use of \u003ccode class=\"type\"\u003eregclass\u003c/code\u003e is to look up the OID of a table listed in the \u003ccode class=\"literal\"\u003einformation_schema\u003c/code\u003e views, which don't supply such OIDs directly. One might for example wish to call the \u003ccode class=\"function\"\u003epg_relation_size()\u003c/code\u003e function, which requires the table OID. Taking the above rules into account, the correct way to do that is\u003c/p\u003e\n\u003cpre class=\"programlisting\"\u003eSELECT table_schema, table_name,\n       pg_relation_size((quote_ident(table_schema) || '.' ||\n                         quote_ident(table_name))::regclass)\nFROM information_schema.tables\nWHERE ...\n\u003c/pre\u003e\n\u003cp\u003eThe \u003ccode class=\"function\"\u003equote_ident()\u003c/code\u003e function will take care of double-quoting the identifiers where needed. The seemingly easier\u003c/p\u003e\n\u003cpre class=\"programlisting\"\u003eSELECT pg_relation_size(table_name)\nFROM information_schema.tables\nWHERE ...\n\u003c/pre\u003e\n\u003cp\u003eis \u003cspan class=\"emphasis\"\u003e\u003cem\u003enot recommended\u003c/em\u003e\u003c/span\u003e, because it will fail for tables that are outside your search path or have names that require quoting.\u003c/p\u003e\n\u003cp\u003eAn additional property of most of the OID alias types is the creation of dependencies. If a constant of one of these types appears in a stored expression (such as a column default expression or view), it creates a dependency on the referenced object. For example, if a column has a default expression \u003ccode class=\"literal\"\u003enextval('my_seq'::regclass)\u003c/code\u003e, \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e understands that the default expression depends on the sequence \u003ccode class=\"literal\"\u003emy_seq\u003c/code\u003e, so the system will not let the sequence be dropped without first removing the default expression. The alternative of \u003ccode class=\"literal\"\u003enextval('my_seq'::text)\u003c/code\u003e does not create a dependency. (\u003ccode class=\"type\"\u003eregrole\u003c/code\u003e is an exception to this property. Constants of this type are not allowed in stored expressions.)\u003c/p\u003e\n\u003cp\u003eAnother identifier type used by the system is \u003ccode class=\"type\"\u003exid\u003c/code\u003e, or transaction (abbreviated xact) identifier. This is the data type of the system columns \u003ccode class=\"structfield\"\u003exmin\u003c/code\u003e and \u003ccode class=\"structfield\"\u003exmax\u003c/code\u003e. Transaction identifiers are 32-bit quantities. In some contexts, a 64-bit variant \u003ccode class=\"type\"\u003exid8\u003c/code\u003e is used. Unlike \u003ccode class=\"type\"\u003exid\u003c/code\u003e values, \u003ccode class=\"type\"\u003exid8\u003c/code\u003e values increase strictly monotonically and cannot be reused in the lifetime of a database cluster. See \u003ca class=\"xref\" href=\"/docs/18/transaction-id.html\" title=\"67.1. Transactions and Identifiers\"\u003eSection 67.1\u003c/a\u003e for more details.\u003c/p\u003e\n\u003cp\u003eA third identifier type used by the system is \u003ccode class=\"type\"\u003ecid\u003c/code\u003e, or command identifier. This is the data type of the system columns \u003ccode class=\"structfield\"\u003ecmin\u003c/code\u003e and \u003ccode class=\"structfield\"\u003ecmax\u003c/code\u003e. Command identifiers are also 32-bit quantities.\u003c/p\u003e\n\u003cp\u003eA final identifier type used by the system is \u003ccode class=\"type\"\u003etid\u003c/code\u003e, or tuple identifier (row identifier). This is the data type of the system column \u003ccode class=\"structfield\"\u003ectid\u003c/code\u003e. A tuple ID is a pair (block number, tuple index within block) that identifies the physical location of the row within its table.\u003c/p\u003e\n\u003cp\u003e(The system columns are further explained in \u003ca class=\"xref\" href=\"/docs/18/ddl-system-columns.html\" title=\"5.6. System Columns\"\u003eSection 5.6\u003c/a\u003e.)\u003c/p\u003e\n\u003c/div\u003e","related":[{"label":"pg_type catalog","url":"/wiki/catalog/pg_type/?v=18"},{"label":"pg_cast catalog","url":"/wiki/catalog/pg_cast/?v=18"},{"label":"pg_operator catalog","url":"/wiki/catalog/pg_operator/?v=18"},{"label":"pg_opclass catalog","url":"/wiki/catalog/pg_opclass/?v=18"},{"label":"Arrays","url":"/wiki/type/arrays/?v=18"},{"label":"OID Types topic","url":"/wiki/oid/xid8/?v=18"},{"label":"btree index access method","url":"/wiki/indexam/btree/?v=18"},{"label":"hash index access method","url":"/wiki/indexam/hash/?v=18"}],"sections":[]}},"RequestedLocale":"zh-Hans","Fallback":true,"Versions":["13","14","15","16","17","18","19","20"],"Locales":["en"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
