バージョンごとのドキュメント一覧

第45章 PL/Perl — Perl手続き言語

目次

45.1. PL/Perl関数と引数
45.2. PL/Perlにおけるデータ値
45.3. 組み込み関数
45.3.1. PL/Perlからのデータベースアクセス
45.3.2. PL/Perlのユーティリティ関数
45.4. PL/Perlにおけるグローバルな値
45.5. 信頼されたPL/Perlおよび信頼されないPL/Perl
45.6. PL/Perlトリガ
45.7. PL/Perlイベントトリガ
45.8. PL/Perlの内部
45.8.1. 設定
45.8.2. 制限および存在しない機能
<title>PL/Perl &mdash; Perl Procedural Language</title>

PL/Perl is a loadable procedural language that enables you to write <productname>PostgreSQL</productname> functions and procedures in the <ulink url="https://www.perl.org">Perl programming language</ulink>. PL/PerlはPerlプログラミング言語を使用してPostgreSQL関数とプロシージャを作成することができる、ロード可能な手続き言語です。

The main advantage to using PL/Perl is that this allows use, within stored functions and procedures, of the manyfold <quote>string munging</quote> operators and functions available for Perl. Parsing complex strings might be easier using Perl than it is with the string functions and control structures provided in PL/pgSQL. PL/Perlを使用する主たる利点は、ストアド関数やプロシージャの中で、Perlで使用可能なさまざまな文字列操作や関数を使用できるという点です。 複雑な文字列解析は、PL/pgSQLで提供される文字列関数や制御構造体を使用するよりPerlを使用する方が簡単に行うことができます。

To install PL/Perl in a particular database, use <literal>CREATE EXTENSION plperl</literal>. PL/Perlを特定のデータベースにインストールするには、CREATE EXTENSION plperlを使用してください。

ヒント

If a language is installed into <literal>template1</literal>, all subsequently created databases will have the language installed automatically. 言語をtemplate1にインストールすると、その後に作成されるデータベース全てにその言語は自動的にインストールされます。

注記

Users of source packages must specially enable the build of PL/Perl during the installation process. (Refer to <xref linkend="installation"/> for more information.) Users of binary packages might find PL/Perl in a separate subpackage. ソースパッケージを使用するユーザは、インストール作業時にPL/Perlを特別に使用可能にする必要があります。 (詳細については、第17章を参照してください。) バイナリパッケージを使用する場合は、別個のサブパッケージにPL/Perlが入っている可能性があります。