{"Entry":{"collection":"language","key":"internal","name":"internal","aliases":[],"metadata":{"aliases":[],"category":"Native function languages","content_hash":"327a404d56489f3bde4df5e0355167f5d0cc004aded2cc4820126ea837634a8a","derived_content_hash":"b6ba0cbdf27adab381a2156bc31a4318ae99268e66f00e5781df558060fe7b38","imported_at":"2026-09-30T00:40:44.33721+08:00","name":"internal","name_zh":"","slug":"internal","summary":"built-in functions"}},"Definition":{"Collection":"language","Key":"internal","SourceDatabase":"center","Version":"18","SourceTable":"procedural_language","SourceKey":"internal","SourceRevision":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","Facts":{"aliases":[],"attributes":{"handler":"","kind":"Native function language","trusted":"f","validator":"fmgr_internal_validator"},"catalog":{"descr":"built-in functions","lanacl":"_null_","laninline":"0","lanispl":"f","lanname":"internal","lanowner":"POSTGRES","lanplcallfoid":"0","lanpltrusted":"f","lanvalidator":"fmgr_internal_validator","oid":"12","oid_symbol":"INTERNALlanguageId"},"comparison_data":{"handler":"","kind":"Native function language","trusted":"f","validator":"fmgr_internal_validator"},"comparison_hash":"d6ad14fc74d34352071f1975e70a9077d1bd11b93deb9f26398e7de1d5cc18b9","description":["built-in functions"],"description_zh":"过程语言 internal。","description_zh_html":"\u003cp\u003e过程语言 internal。\u003c/p\u003e\u003cdl\u003e\u003cdt\u003e受信任\u003c/dt\u003e\u003cdd\u003e\u003ccode\u003e否\u003c/code\u003e\u003c/dd\u003e\u003cdt\u003e验证函数\u003c/dt\u003e\u003cdd\u003e\u003ccode\u003efmgr_internal_validator\u003c/code\u003e\u003c/dd\u003e\u003c/dl\u003e\u003ch3\u003e同版本中文手册节选\u003c/h3\u003e\u003cp\u003e\n    内部函数由 C 编写并且已经被静态链接到 \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e\n    服务器中。该函数定义的\u003cspan class=\"quote\"\u003e“\u003cspan class=\"quote\"\u003e主体\u003c/span\u003e”\u003c/span\u003e指定该函数的 C 语言名称，它不必与为 SQL 使用而声明的名称相同。（出于向后兼容的原因，也接受空主体，此时会认为 C 语言函数名与 SQL 函数名相同。）\n   \u003c/p\u003e\u003cp\u003e\n    通常，所有存在于服务器中的内部函数都在数据库集簇的初始化（见\u003ca class=\"xref\" href=\"/zh/docs/18/creating-cluster.html\"\u003e第 18.2 节\u003c/a\u003e）期间被声明，但是用户可以使用\n    \u003ccode class=\"command\"\u003eCREATE FUNCTION\u003c/code\u003e 为一个内部函数创建额外的别名。在 \u003ccode class=\"command\"\u003eCREATE FUNCTION\u003c/code\u003e 中用语言名 \u003ccode class=\"literal\"\u003einternal\u003c/code\u003e 来声明内部函数。例如，要为\n    \u003ccode class=\"function\"\u003esqrt\u003c/code\u003e 函数创建一个别名：\n\u003c/p\u003e\u003cp\u003e\n    （大部分内部函数应该被声明为\u003cspan class=\"quote\"\u003e“\u003cspan class=\"quote\"\u003e严格\u003c/span\u003e”\u003c/span\u003e）。\n   \u003c/p\u003e\u003cp\u003e\u003ca href=\"/zh/docs/18/xfunc-internal.html\"\u003e查看完整中文手册与上下文\u003c/a\u003e。\u003c/p\u003e","facts":[{"label":"Kind","value":"Native function language"},{"label":"Trusted","value":"f"},{"label":"Validator","value":"fmgr_internal_validator"}],"facts_zh":[{"label":"种类","value":"原生函数语言"},{"label":"可信","value":"f"},{"label":"校验函数","value":"fmgr_internal_validator"}],"manual_html":"\u003cdiv class=\"sect1\" id=\"XFUNC-INTERNAL\"\u003e\n\u003cdiv class=\"titlepage\"\u003e\n\u003cdiv\u003e\n\u003cdiv\u003e\n\u003ch2 class=\"title\"\u003e36.9. Internal Functions \u003c/h2\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cp\u003eInternal functions are functions written in C that have been statically linked into the \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e server. The \u003cspan class=\"quote\"\u003e“\u003cspan class=\"quote\"\u003ebody\u003c/span\u003e”\u003c/span\u003e of the function definition specifies the C-language name of the function, which need not be the same as the name being declared for SQL use. (For reasons of backward compatibility, an empty body is accepted as meaning that the C-language function name is the same as the SQL name.)\u003c/p\u003e\n\u003cp\u003eNormally, all internal functions present in the server are declared during the initialization of the database cluster (see \u003ca class=\"xref\" href=\"/docs/18/creating-cluster.html\" title=\"18.2. Creating a Database Cluster\"\u003eSection 18.2\u003c/a\u003e), but a user could use \u003ccode class=\"command\"\u003eCREATE FUNCTION\u003c/code\u003e to create additional alias names for an internal function. Internal functions are declared in \u003ccode class=\"command\"\u003eCREATE FUNCTION\u003c/code\u003e with language name \u003ccode class=\"literal\"\u003einternal\u003c/code\u003e. For instance, to create an alias for the \u003ccode class=\"function\"\u003esqrt\u003c/code\u003e function:\u003c/p\u003e\n\u003cpre class=\"programlisting\"\u003eCREATE FUNCTION square_root(double precision) RETURNS double precision\n    AS 'dsqrt'\n    LANGUAGE internal\n    STRICT;\n\u003c/pre\u003e\n\u003cp\u003e(Most internal functions expect to be declared \u003cspan class=\"quote\"\u003e“\u003cspan class=\"quote\"\u003estrict\u003c/span\u003e”\u003c/span\u003e.)\u003c/p\u003e\n\u003cdiv class=\"note\"\u003e\n\u003ch3 class=\"title\"\u003eNote\u003c/h3\u003e\n\u003cp\u003eNot all \u003cspan class=\"quote\"\u003e“\u003cspan class=\"quote\"\u003epredefined\u003c/span\u003e”\u003c/span\u003e functions are \u003cspan class=\"quote\"\u003e“\u003cspan class=\"quote\"\u003einternal\u003c/span\u003e”\u003c/span\u003e in the above sense. Some predefined functions are written in SQL.\u003c/p\u003e\n\u003c/div\u003e\n\u003c/div\u003e","manual_path":"/docs/18/xfunc-internal.html","related":[],"release":{"catalog_fingerprint":"65c93d6048ef30e61023a84f9680fa6a92b1c383b7eb226741170077eb078502","channel":"stable","label":"18.6","major":"18","ref":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2","revision":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","source_sha256":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f"},"sections":[],"sections_zh":[],"signature":"","sources":[{"label":"Matching PostgreSQL source archive","sha256":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","url":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2"},{"label":"PostgreSQL 18 English manual","path":"xfunc-internal.html","sha256":"643c2623380e298d3a3f2f371d32f3b208ac6717275b64ec75f681a2c3f2fa7f","url":"/docs/18/xfunc-internal.html"}],"tables":[],"tables_zh":[],"zh_from":{"authored_translation":"source-derived-structured-summary","body_sha256":"ec7303e47e8a4abe99771c95f7fb3220fa6661dc68657aa87a661b3e2101bcb6","kind":"same-version-chinese-manual-with-source-derived-structured-summary","manual":{"anchor":"","build_id":107,"extraction":"concept-introduction","fragment_sha256":"d2c623f44bad7b3497ca07ae00895ee1ee5556508573ae52d452e29d15f95db8","locale":"zh-Hans","page_key":"xfunc-internal.html","source_hash":"581c995ec3f75b5881f827b676f6137e581bb1428e4cec05b6e81edeb1a2e957","source_revision":"unknown:rendered-translation-baseline","translated_from_revision":null,"translation_revision":"git:b1b500221dbe5437cfca004d6b04d3f6e422765d;html-sha256:08e987a66af27b98444a8057c256314eafa13611a3fb9e888214fc436824244b","url":"/zh/docs/18/xfunc-internal.html","version":"18"},"runtime_rerun":false,"source_facts_revision":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f"}},"ManualEvidence":{"manual_path":"/docs/18/xfunc-internal.html","release":{"catalog_fingerprint":"65c93d6048ef30e61023a84f9680fa6a92b1c383b7eb226741170077eb078502","channel":"stable","label":"18.6","major":"18","ref":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2","revision":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","source_sha256":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f"},"sources":[{"label":"Matching PostgreSQL source archive","sha256":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","url":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2"},{"label":"PostgreSQL 18 English manual","path":"xfunc-internal.html","sha256":"643c2623380e298d3a3f2f371d32f3b208ac6717275b64ec75f681a2c3f2fa7f","url":"/docs/18/xfunc-internal.html"}]},"MeasuredEvidence":{}},"Text":{"Collection":"language","Key":"internal","SourceDatabase":"center","Version":"18","Locale":"en","Title":"internal","Summary":"built-in functions","BodyHTML":"\u003cdiv id=\"XFUNC-INTERNAL\"\u003e\n\u003cdiv\u003e\n\u003cdiv\u003e\n\u003cdiv\u003e\n\u003ch2\u003e36.9. Internal Functions \u003c/h2\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cp\u003eInternal functions are functions written in C that have been statically linked into the \u003cspan\u003ePostgreSQL\u003c/span\u003e server. The \u003cspan\u003e“\u003cspan\u003ebody\u003c/span\u003e”\u003c/span\u003e of the function definition specifies the C-language name of the function, which need not be the same as the name being declared for SQL use. (For reasons of backward compatibility, an empty body is accepted as meaning that the C-language function name is the same as the SQL name.)\u003c/p\u003e\n\u003cp\u003eNormally, all internal functions present in the server are declared during the initialization of the database cluster (see \u003ca href=\"/docs/18/creating-cluster.html\" rel=\"nofollow\"\u003eSection 18.2\u003c/a\u003e), but a user could use \u003ccode\u003eCREATE FUNCTION\u003c/code\u003e to create additional alias names for an internal function. Internal functions are declared in \u003ccode\u003eCREATE FUNCTION\u003c/code\u003e with language name \u003ccode\u003einternal\u003c/code\u003e. For instance, to create an alias for the \u003ccode\u003esqrt\u003c/code\u003e function:\u003c/p\u003e\n\u003cpre\u003eCREATE FUNCTION square_root(double precision) RETURNS double precision\n    AS \u0026#39;dsqrt\u0026#39;\n    LANGUAGE internal\n    STRICT;\n\u003c/pre\u003e\n\u003cp\u003e(Most internal functions expect to be declared \u003cspan\u003e“\u003cspan\u003estrict\u003c/span\u003e”\u003c/span\u003e.)\u003c/p\u003e\n\u003cdiv\u003e\n\u003ch3\u003eNote\u003c/h3\u003e\n\u003cp\u003eNot all \u003cspan\u003e“\u003cspan\u003epredefined\u003c/span\u003e”\u003c/span\u003e functions are \u003cspan\u003e“\u003cspan\u003einternal\u003c/span\u003e”\u003c/span\u003e in the above sense. Some predefined functions are written in SQL.\u003c/p\u003e\n\u003c/div\u003e\n\u003c/div\u003e","SourceRevision":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","ContentHash":"803e882ef4552496a7597b7de3b35827126eaaf44755adb72355d0dcd4185840","Payload":{"description":["built-in functions"],"manual_html":"\u003cdiv class=\"sect1\" id=\"XFUNC-INTERNAL\"\u003e\n\u003cdiv class=\"titlepage\"\u003e\n\u003cdiv\u003e\n\u003cdiv\u003e\n\u003ch2 class=\"title\"\u003e36.9. Internal Functions \u003c/h2\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cp\u003eInternal functions are functions written in C that have been statically linked into the \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e server. The \u003cspan class=\"quote\"\u003e“\u003cspan class=\"quote\"\u003ebody\u003c/span\u003e”\u003c/span\u003e of the function definition specifies the C-language name of the function, which need not be the same as the name being declared for SQL use. (For reasons of backward compatibility, an empty body is accepted as meaning that the C-language function name is the same as the SQL name.)\u003c/p\u003e\n\u003cp\u003eNormally, all internal functions present in the server are declared during the initialization of the database cluster (see \u003ca class=\"xref\" href=\"/docs/18/creating-cluster.html\" title=\"18.2. Creating a Database Cluster\"\u003eSection 18.2\u003c/a\u003e), but a user could use \u003ccode class=\"command\"\u003eCREATE FUNCTION\u003c/code\u003e to create additional alias names for an internal function. Internal functions are declared in \u003ccode class=\"command\"\u003eCREATE FUNCTION\u003c/code\u003e with language name \u003ccode class=\"literal\"\u003einternal\u003c/code\u003e. For instance, to create an alias for the \u003ccode class=\"function\"\u003esqrt\u003c/code\u003e function:\u003c/p\u003e\n\u003cpre class=\"programlisting\"\u003eCREATE FUNCTION square_root(double precision) RETURNS double precision\n    AS 'dsqrt'\n    LANGUAGE internal\n    STRICT;\n\u003c/pre\u003e\n\u003cp\u003e(Most internal functions expect to be declared \u003cspan class=\"quote\"\u003e“\u003cspan class=\"quote\"\u003estrict\u003c/span\u003e”\u003c/span\u003e.)\u003c/p\u003e\n\u003cdiv class=\"note\"\u003e\n\u003ch3 class=\"title\"\u003eNote\u003c/h3\u003e\n\u003cp\u003eNot all \u003cspan class=\"quote\"\u003e“\u003cspan class=\"quote\"\u003epredefined\u003c/span\u003e”\u003c/span\u003e functions are \u003cspan class=\"quote\"\u003e“\u003cspan class=\"quote\"\u003einternal\u003c/span\u003e”\u003c/span\u003e in the above sense. Some predefined functions are written in SQL.\u003c/p\u003e\n\u003c/div\u003e\n\u003c/div\u003e","related":[],"sections":[],"tables":[]}},"RequestedLocale":"en","Fallback":false,"Versions":["10","11","12","13","14","15","16","17","18","19","20"],"Locales":["en","zh-Hans"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
