↑↓ 选择↵ 打开⌫ 切换范围完整搜索

PG.CENTER 连接 PostgreSQL 文档、百科与生态知识。由 Pigsty 维护。

Wiki / 过程语言

pltclu

PL/TclU untrusted procedural language

当前阅读 PG 18·选择有来源记录的版本

此版本暂无所选语言的定义,以下显示原始英文内容。

Kind
Bundled procedural-language variant
Family
PL/Tcl
Trusted
f
Handler
pltclu_call_handler
Library
$libdir/pltcl
Default version
1.0
Module pathname
$libdir/pltcl
Comment
PL/TclU untrusted procedural language
aliases
未知
manual path
/docs/18/pltcl-overview.html
signature
未知

版本定义 PG 18

42.1. Overview

PL/Tcl offers most of the capabilities a function writer has in the C language, with a few restrictions, and with the addition of the powerful string processing libraries that are available for Tcl.

One compelling good restriction is that everything is executed from within the safety of the context of a Tcl interpreter. In addition to the limited command set of safe Tcl, only a few commands are available to access the database via SPI and to raise messages via elog(). PL/Tcl provides no way to access internals of the database server or to gain OS-level access under the permissions of the PostgreSQL server process, as a C function can do. Thus, unprivileged database users can be trusted to use this language; it does not give them unlimited authority.

The other notable implementation restriction is that Tcl functions cannot be used to create input/output functions for new data types.

Sometimes it is desirable to write Tcl functions that are not restricted to safe Tcl. For example, one might want a Tcl function that sends email. To handle these cases, there is a variant of PL/Tcl called PL/TclU (for untrusted Tcl). This is exactly the same language except that a full Tcl interpreter is used. If PL/TclU is used, it must be installed as an untrusted procedural language so that only database superusers can create functions in it. The writer of a PL/TclU function must take care that the function cannot be used to do anything unwanted, since it will be able to do anything that could be done by a user logged in as the database administrator.

The shared object code for the PL/Tcl and PL/TclU call handlers is automatically built and installed in the PostgreSQL library directory if Tcl support is specified in the configuration step of the installation procedure. To install PL/Tcl and/or PL/TclU in a particular database, use the CREATE EXTENSION command, for example CREATE EXTENSION pltcl or CREATE EXTENSION pltclu.

比较版本

完整来源事实

attributes

{"comment":"PL/TclU untrusted procedural language","default_version":"1.0","family":"PL/Tcl","handler":"pltclu_call_handler","inline_handler":"","kind":"Bundled procedural-language variant","library":"$libdir/pltcl","module_pathname":"$libdir/pltcl","trusted":"f","validator":""}

source files

{"src/pl/tcl/pltclu--1.0.sql":"81990a8e4dd323fd70a2669dcbd33a9d74d250bc7a965790dee9d96b3f823d0c","src/pl/tcl/pltclu.control":"f8b2f8f3b14be8d14326913047eb320227f6891f6d303eecf300f0231ac853d4"}

来源引用

完整定义与证据 JSON

定义来源

center · PostgreSQL 18 · 555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f

正文语言: en · 555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f