record
Identifies a function taking or returning an unspecified row type.
当前阅读 PG 18·选择有来源记录的版本
此版本暂无所选语言的定义,以下显示原始英文内容。
- Catalog name
- pg_catalog.record
- Type OID
- 2249
- Type kind
- Pseudo-type
- Declared length
- Variable length (varlena)
- Storage strategy
- extended
- Input function
- record_in
- Output function
- record_out
- Documented declaration
- record
- Manual description
- Identifies a function taking or returning an unspecified row type.
- aliases
- 未知
- casts
- 未知
- coverage
- source inventory; exact declared input types for operator classes
- manual documentation
- dedicated family chapter
- manual path
- datatype-pseudo.html
- ranges
- 未知
- signature
- record
版本定义 PG 18
8.21. Pseudo-Types
The PostgreSQL type system contains a number of special-purpose entries that are collectively called pseudo-types. A pseudo-type cannot be used as a column data type, but it can be used to declare a function's argument or result type. Each of the available pseudo-types is useful in situations where a function's behavior does not correspond to simply taking or returning a value of a specific SQL data type. Table 8.27 lists the existing pseudo-types.
Table 8.27. Pseudo-Types
| Name | Description |
|---|---|
any |
Indicates that a function accepts any input data type. |
anyelement |
Indicates that a function accepts any data type (see Section 36.2.5). |
anyarray |
Indicates that a function accepts any array data type (see Section 36.2.5). |
anynonarray |
Indicates that a function accepts any non-array data type (see Section 36.2.5). |
anyenum |
Indicates that a function accepts any enum data type (see Section 36.2.5 and Section 8.7). |
anyrange |
Indicates that a function accepts any range data type (see Section 36.2.5 and Section 8.17). |
anymultirange |
Indicates that a function accepts any multirange data type (see Section 36.2.5 and Section 8.17). |
anycompatible |
Indicates that a function accepts any data type, with automatic promotion of multiple arguments to a common data type (see Section 36.2.5). |
anycompatiblearray |
Indicates that a function accepts any array data type, with automatic promotion of multiple arguments to a common data type (see Section 36.2.5). |
anycompatiblenonarray |
Indicates that a function accepts any non-array data type, with automatic promotion of multiple arguments to a common data type (see Section 36.2.5). |
anycompatiblerange |
Indicates that a function accepts any range data type, with automatic promotion of multiple arguments to a common data type (see Section 36.2.5 and Section 8.17). |
anycompatiblemultirange |
Indicates that a function accepts any multirange data type, with automatic promotion of multiple arguments to a common data type (see Section 36.2.5 and Section 8.17). |
cstring |
Indicates that a function accepts or returns a null-terminated C string. |
internal |
Indicates that a function accepts or returns a server-internal data type. |
language_handler |
A procedural language call handler is declared to return language_handler. |
fdw_handler |
A foreign-data wrapper handler is declared to return fdw_handler. |
table_am_handler |
A table access method handler is declared to return table_am_handler. |
index_am_handler |
An index access method handler is declared to return index_am_handler. |
tsm_handler |
A tablesample method handler is declared to return tsm_handler. |
record |
Identifies a function taking or returning an unspecified row type. |
trigger |
A trigger function is declared to return trigger. |
event_trigger |
An event trigger function is declared to return event_trigger. |
pg_ddl_command |
Identifies a representation of DDL commands that is available to event triggers. |
void |
Indicates that a function returns no value. |
unknown |
Identifies a not-yet-resolved type, e.g., of an undecorated string literal. |
Functions coded in C (whether built-in or dynamically loaded) can be declared to accept or return any of these pseudo-types. It is up to the function author to ensure that the function will behave safely when a pseudo-type is used as an argument type.
Functions coded in procedural languages can use pseudo-types only as allowed by their implementation languages. At present most procedural languages forbid use of a pseudo-type as an argument type, and allow only void and record as a result type (plus trigger or event_trigger when the function is used as a trigger or event trigger). Some also support polymorphic functions using the polymorphic pseudo-types, which are shown above and discussed in detail in Section 36.2.5.
The internal pseudo-type is used to declare functions that are meant only to be called internally by the database system, and not by direct invocation in an SQL query. If a function has at least one internal-type argument then it cannot be called from SQL. To preserve the type safety of this restriction it is important to follow this coding rule: do not create any function that is declared to return internal unless it has at least one internal argument.
比较版本
完整来源事实
catalog
{"array_type_name":"_record","array_type_oid":"2287","descr":"pseudo-type representing any composite type","oid":"2249","typacl":"_null_","typalign":"d","typanalyze":"-","typarray":"_record","typbasetype":"0","typbyval":"f","typcategory":"P","typcollation":"0","typdefault":"_null_","typdefaultbin":"_null_","typdelim":"','","typelem":"0","typinput":"record_in","typisdefined":"t","typispreferred":"f","typlen":"-1","typmodin":"-","typmodout":"-","typname":"record","typnamespace":"pg_catalog","typndims":"0","typnotnull":"f","typoutput":"record_out","typowner":"POSTGRES","typreceive":"record_recv","typrelid":"0","typsend":"record_send","typstorage":"x","typsubscript":"-","typtype":"p","typtypmod":"-1"}operator classes
map[opcdefault:t opcfamily:btree/record_ops opcintype:record opckeytype:0 opcmethod:btree opcname:record_ops opcnamespace:pg_catalog opcowner:POSTGRES], map[opcdefault:t opcfamily:hash/record_ops opcintype:record opckeytype:0 opcmethod:hash opcname:record_ops opcnamespace:pg_catalog opcowner:POSTGRES], map[opcdefault:f opcfamily:btree/record_image_ops opcintype:record opckeytype:0 opcmethod:btree opcname:record_image_ops opcnamespace:pg_catalog opcowner:POSTGRES]
operators
map[descr:equal oid:2988 oid_symbol:RECORD_EQ_OP oprcanhash:t oprcanmerge:t oprcode:record_eq oprcom:=(record,record) oprjoin:eqjoinsel oprkind:b oprleft:record oprname:= oprnamespace:pg_catalog oprnegate:<>(record,record) oprowner:POSTGRES oprrest:eqsel oprresult:bool oprright:record], map[descr:not equal oid:2989 oprcanhash:f oprcanmerge:f oprcode:record_ne oprcom:<>(record,record) oprjoin:neqjoinsel oprkind:b oprleft:record oprname:<> oprnamespace:pg_catalog oprnegate:=(record,record) oprowner:POSTGRES oprrest:neqsel oprresult:bool oprright:record], map[descr:less than oid:2990 oid_symbol:RECORD_LT_OP oprcanhash:f oprcanmerge:f oprcode:record_lt oprcom:>(record,record) oprjoin:scalarltjoinsel oprkind:b oprleft:record oprname:< oprnamespace:pg_catalog oprnegate:>=(record,record) oprowner:POSTGRES oprrest:scalarltsel oprresult:bool oprright:record], map[descr:greater than oid:2991 oid_symbol:RECORD_GT_OP oprcanhash:f oprcanmerge:f oprcode:record_gt oprcom:<(record,record) oprjoin:scalargtjoinsel oprkind:b oprleft:record oprname:> oprnamespace:pg_catalog oprnegate:<=(record,record) oprowner:POSTGRES oprrest:scalargtsel oprresult:bool oprright:record], map[descr:less than or equal oid:2992 oprcanhash:f oprcanmerge:f oprcode:record_le oprcom:>=(record,record) oprjoin:scalarlejoinsel oprkind:b oprleft:record oprname:<= oprnamespace:pg_catalog oprnegate:>(record,record) oprowner:POSTGRES oprrest:scalarlesel oprresult:bool oprright:record], map[descr:greater than or equal oid:2993 oprcanhash:f oprcanmerge:f oprcode:record_ge oprcom:<=(record,record) oprjoin:scalargejoinsel oprkind:b oprleft:record oprname:>= oprnamespace:pg_catalog oprnegate:<(record,record) oprowner:POSTGRES oprrest:scalargesel oprresult:bool oprright:record], map[descr:identical oid:3188 oprcanhash:f oprcanmerge:t oprcode:record_image_eq oprcom:*=(record,record) oprjoin:eqjoinsel oprkind:b oprleft:record oprname:*= oprnamespace:pg_catalog oprnegate:*<>(record,record) oprowner:POSTGRES oprrest:eqsel oprresult:bool oprright:record], map[descr:not identical oid:3189 oprcanhash:f oprcanmerge:f oprcode:record_image_ne oprcom:*<>(record,record) oprjoin:neqjoinsel oprkind:b oprleft:record oprname:*<> oprnamespace:pg_catalog oprnegate:*=(record,record) oprowner:POSTGRES oprrest:neqsel oprresult:bool oprright:record], map[descr:less than oid:3190 oprcanhash:f oprcanmerge:f oprcode:record_image_lt oprcom:*>(record,record) oprjoin:scalarltjoinsel oprkind:b oprleft:record oprname:*< oprnamespace:pg_catalog oprnegate:*>=(record,record) oprowner:POSTGRES oprrest:scalarltsel oprresult:bool oprright:record], map[descr:greater than oid:3191 oprcanhash:f oprcanmerge:f oprcode:record_image_gt oprcom:*<(record,record) oprjoin:scalargtjoinsel oprkind:b oprleft:record oprname:*> oprnamespace:pg_catalog oprnegate:*<=(record,record) oprowner:POSTGRES oprrest:scalargtsel oprresult:bool oprright:record], map[descr:less than or equal oid:3192 oprcanhash:f oprcanmerge:f oprcode:record_image_le oprcom:*>=(record,record) oprjoin:scalarlejoinsel oprkind:b oprleft:record oprname:*<= oprnamespace:pg_catalog oprnegate:*>(record,record) oprowner:POSTGRES oprrest:scalarlesel oprresult:bool oprright:record], map[descr:greater than or equal oid:3193 oprcanhash:f oprcanmerge:f oprcode:record_image_ge oprcom:*<=(record,record) oprjoin:scalargejoinsel oprkind:b oprleft:record oprname:*>= oprnamespace:pg_catalog oprnegate:*<(record,record) oprowner:POSTGRES oprrest:scalargesel oprresult:bool oprright:record]
来源引用
定义来源
center · PostgreSQL 18 · 555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f
正文语言: en · 555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f