{"Entry":{"collection":"catalog","key":"pg_cast","name":"pg_cast","aliases":[],"metadata":{"changed_in":["8.4","12"],"changes":[{"added":[],"attributes":[],"description_changed":false,"descriptions":[{"from":"Indicates what contexts the cast may be invoked in. e means only as an explicit cast (using CAST, ::, or function-call syntax). a means implicitly in assignment to a target column, as well as explicitly. i means implicitly in expressions, as well as the other cases.","name":"castcontext","to":"Indicates what contexts the cast may be invoked in. e means only as an explicit cast (using CAST or :: syntax). a means implicitly in assignment to a target column, as well as explicitly. i means implicitly in expressions, as well as the other cases."}],"from":"7.4","listing":[],"order":false,"removed":[],"status":"reworded","to":"8.0","types":[],"unlisted":[]},{"added":[],"attributes":[],"description_changed":false,"descriptions":[{"from":"Indicates what contexts the cast may be invoked in. e means only as an explicit cast (using CAST or :: syntax). a means implicitly in assignment to a target column, as well as explicitly. i means implicitly in expressions, as well as the other cases.","name":"castcontext","to":"Indicates what contexts the cast may be invoked in. e means only as an explicit cast (using CAST or :: syntax). a means implicitly in assignment to a target column, as well as explicitly. i means implicitly in expressions, as well as the other cases"},{"from":"The OID of the function to use to perform this cast. Zero is stored if the data types are binary compatible (that is, no run-time operation is needed to perform the cast).","name":"castfunc","to":"The OID of the function to use to perform this cast. Zero is stored if the data types are binary compatible (that is, no run-time operation is needed to perform the cast)"}],"from":"8.1","listing":[],"order":false,"removed":[],"status":"reworded","to":"8.2","types":[],"unlisted":[]},{"added":[],"attributes":[],"description_changed":true,"descriptions":[{"from":"Indicates what contexts the cast may be invoked in. e means only as an explicit cast (using CAST or :: syntax). a means implicitly in assignment to a target column, as well as explicitly. i means implicitly in expressions, as well as the other cases","name":"castcontext","to":"Indicates what contexts the cast can be invoked in. e means only as an explicit cast (using CAST or :: syntax). a means implicitly in assignment to a target column, as well as explicitly. i means implicitly in expressions, as well as the other cases"}],"from":"8.2","listing":[],"order":false,"removed":[],"status":"reworded","to":"8.3","types":[],"unlisted":[]},{"added":["castmethod"],"attributes":[],"description_changed":true,"descriptions":[{"from":"The OID of the function to use to perform this cast. Zero is stored if the data types are binary compatible (that is, no run-time operation is needed to perform the cast)","name":"castfunc","to":"The OID of the function to use to perform this cast. Zero is stored if the cast method doesn't require a function."}],"from":"8.3","listing":[],"order":false,"removed":[],"status":"changed","to":"8.4","types":[],"unlisted":[]},{"added":[],"attributes":[],"description_changed":false,"descriptions":[{"from":"Indicates what contexts the cast can be invoked in. e means only as an explicit cast (using CAST or :: syntax). a means implicitly in assignment to a target column, as well as explicitly. i means implicitly in expressions, as well as the other cases","name":"castcontext","to":"Indicates what contexts the cast can be invoked in. e means only as an explicit cast (using CAST or :: syntax). a means implicitly in assignment to a target column, as well as explicitly. i means implicitly in expressions, as well as the other cases."},{"from":"Indicates how the cast is performed. f means that the function specified in the castfunc field is used. i means that the input/output functions are used. b means that the types are binary-coercible, thus no conversion is required","name":"castmethod","to":"Indicates how the cast is performed. f means that the function specified in the castfunc field is used. i means that the input/output functions are used. b means that the types are binary-coercible, thus no conversion is required."}],"from":"8.4","listing":[],"order":false,"removed":[],"status":"reworded","to":"9.0","types":[],"unlisted":[]},{"added":[],"attributes":[],"description_changed":true,"descriptions":[],"from":"9.1","listing":[],"order":false,"removed":[],"status":"reworded","to":"9.2","types":[],"unlisted":[]},{"added":[],"attributes":[],"description_changed":true,"descriptions":[],"from":"9.6","listing":[],"order":false,"removed":[],"status":"reworded","to":"10","types":[],"unlisted":[]},{"added":[],"attributes":[{"attribute":"hidden","from":true,"name":"oid","to":false}],"description_changed":false,"descriptions":[],"from":"11","listing":[],"order":false,"removed":[],"status":"changed","to":"12","types":[],"unlisted":[]}],"column_count":6,"content_hash":"be762afb0a1fb3280cce30a960b44ad509155c26046407efe0e04b4bc4d69e95","first_version":"7.4","imported_at":"2026-09-30T00:40:55.399056+08:00","kind":"catalog","last_version":"20","name":"pg_cast","position":13,"present_in":["7.4","8.0","8.1","8.2","8.3","8.4","9.0","9.1","9.2","9.3","9.4","9.5","9.6","10","11","12","13","14","15","16","17","18","19","20"],"relation_oid":null,"relkind":"r","shared":false,"source_rev":"english-manuals:06160dbb2681f321547840547d21b8a606ed3293a91577f91251a8fa19ff3918","summary":"The catalog pg_cast stores data type conversion paths, both built-in and user-defined.","summary_zh":""}},"Definition":{"Collection":"catalog","Key":"pg_cast","SourceDatabase":"center","Version":"18","SourceTable":"catalog","SourceKey":"pg_cast","SourceRevision":"english-manuals:06160dbb2681f321547840547d21b8a606ed3293a91577f91251a8fa19ff3918","Facts":{"columns":[{"array_dimensions":0,"attnum":1,"description":"Row identifier","description_zh":"","documented":true,"documented_name":"oid","hidden":false,"name":"oid","not_null":true,"references":"","type":"oid","type_modifier":-1,"type_oid":26},{"array_dimensions":0,"attnum":2,"description":"OID of the source data type","description_zh":"","documented":true,"documented_name":"castsource","hidden":false,"name":"castsource","not_null":true,"references":"pg_type.oid","type":"oid","type_modifier":-1,"type_oid":26},{"array_dimensions":0,"attnum":3,"description":"OID of the target data type","description_zh":"","documented":true,"documented_name":"casttarget","hidden":false,"name":"casttarget","not_null":true,"references":"pg_type.oid","type":"oid","type_modifier":-1,"type_oid":26},{"array_dimensions":0,"attnum":4,"description":"The OID of the function to use to perform this cast. Zero is stored if the cast method doesn't require a function.","description_zh":"","documented":true,"documented_name":"castfunc","hidden":false,"name":"castfunc","not_null":true,"references":"pg_proc.oid","type":"oid","type_modifier":-1,"type_oid":26},{"array_dimensions":0,"attnum":5,"description":"Indicates what contexts the cast can be invoked in. e means only as an explicit cast (using CAST or :: syntax). a means implicitly in assignment to a target column, as well as explicitly. i means implicitly in expressions, as well as the other cases.","description_zh":"","documented":true,"documented_name":"castcontext","hidden":false,"name":"castcontext","not_null":true,"references":"","type":"char","type_modifier":-1,"type_oid":18},{"array_dimensions":0,"attnum":6,"description":"Indicates how the cast is performed. f means that the function specified in the castfunc field is used. i means that the input/output functions are used. b means that the types are binary-coercible, thus no conversion is required.","description_zh":"","documented":true,"documented_name":"castmethod","hidden":false,"name":"castmethod","not_null":true,"references":"","type":"char","type_modifier":-1,"type_oid":18}],"description":"The catalog pg_cast stores data type conversion paths, both built-in and user-defined.\n\nIt should be noted that pg_cast does not represent every type conversion that the system knows how to perform; only those that cannot be deduced from some generic rule. For example, casting between a domain and its base type is not explicitly represented in pg_cast. Another important exception is that “automatic I/O conversion casts”, those performed using a data type's own I/O functions to convert to or from text or other string types, are not explicitly represented in pg_cast.","description_zh":"","doc":{"anchor":"id-1.10.4.12.5","file":"catalog-pg-cast.html","lang":"en","sha256":"f501c9340132488ecf887782e1a56a7352ba1a4f62082a80a5b02432292f26b7","slug":"18"},"kind":"catalog","lang":"en","measured_attributes":true,"metadata_release":"18.6","runtime_columns":["oid","castsource","casttarget","castfunc","castcontext","castmethod"],"runtime_verified":false,"source":"english-manual"},"ManualEvidence":{"doc":{"anchor":"id-1.10.4.12.5","file":"catalog-pg-cast.html","lang":"en","sha256":"f501c9340132488ecf887782e1a56a7352ba1a4f62082a80a5b02432292f26b7","slug":"18"}},"MeasuredEvidence":{"measured_attributes":true,"metadata_release":"18.6","runtime_columns":["oid","castsource","casttarget","castfunc","castcontext","castmethod"],"runtime_verified":false}},"Text":{"Collection":"catalog","Key":"pg_cast","SourceDatabase":"pgweb","Version":"18","Locale":"zh-Hans","Title":"pg_cast","Summary":"目录pg_cast存储数据类型转换路径，包括内置路径和用户定义路径。\n\n需要注意的是，pg_cast并不表示系统知道如何执行的所有类型转换，它只包括那些不能从某些通用规则推导出的转换。例如，一个域及其基础类型之间的转换并未显式地在pg_cast中展示。另一个重要的例外是“自动的基于 I/O 的类型转换”，它们通过数据类型自己的 I/O 函数来转换成（或者转换自）text或其他字符串类型，这些转换也没有显式地在pg_cast中表示。","BodyHTML":"\u003cp\u003e目录pg_cast存储数据类型转换路径，包括内置路径和用户定义路径。\n\n需要注意的是，pg_cast并不表示系统知道如何执行的所有类型转换，它只包括那些不能从某些通用规则推导出的转换。例如，一个域及其基础类型之间的转换并未显式地在pg_cast中展示。另一个重要的例外是“自动的基于 I/O 的类型转换”，它们通过数据类型自己的 I/O 函数来转换成（或者转换自）text或其他字符串类型，这些转换也没有显式地在pg_cast中表示。\u003c/p\u003e","SourceRevision":"2026-09-27@419045e","ContentHash":"bc96ba3b192e3dfbca9c3569a75302287b5acae2b6eebc34abcaaeea23b964d5","Payload":{"columns":[{"description_zh":"行标识符","name":"oid","type":"oid","zh_from":"doc"},{"description_zh":"源数据类型的OID","name":"castsource","type":"oid","zh_from":"doc"},{"description_zh":"目标数据类型的OID","name":"casttarget","type":"oid","zh_from":"doc"},{"description_zh":"执行该转换的函数的OID。如果该转换方法不需要一个函数则存储0。","name":"castfunc","type":"oid","zh_from":"doc"},{"description_zh":"指示可在哪些上下文中调用此类型转换。e 表示只能显式调用（使用 CAST 或 :: 语法）。a 表示可在向目标列赋值时隐式调用，也可显式调用。i 表示可在表达式中隐式调用，也允许前述其他调用方式。","name":"castcontext","type":"\"char\"","zh_from":"doc"},{"description_zh":"指示转换如何被执行。f表明使用castfunc中指定的函数。i表明使用输入/输出函数。b表明该类型是二进制可强制转换的，因此不需要转换。","name":"castmethod","type":"\"char\"","zh_from":"doc"}],"description_zh":"目录pg_cast存储数据类型转换路径，包括内置路径和用户定义路径。\n\n需要注意的是，pg_cast并不表示系统知道如何执行的所有类型转换，它只包括那些不能从某些通用规则推导出的转换。例如，一个域及其基础类型之间的转换并未显式地在pg_cast中展示。另一个重要的例外是“自动的基于 I/O 的类型转换”，它们通过数据类型自己的 I/O 函数来转换成（或者转换自）text或其他字符串类型，这些转换也没有显式地在pg_cast中表示。","zh_from":"doc"}},"RequestedLocale":"zh-Hans","Fallback":false,"Versions":["10","11","12","13","14","15","16","17","18","19","20","7.4","8.0","8.1","8.2","8.3","8.4","9.0","9.1","9.2","9.3","9.4","9.5","9.6"],"Locales":["en","zh-Hans"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
