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

第9章 関数と演算子

目次

9.1. 論理演算子
9.2. 比較関数および演算子
9.3. 算術関数と演算子
9.4. 文字列関数と演算子
9.4.1. format
9.5. バイナリ文字列関数と演算子
9.6. ビット文字列関数と演算子
9.7. パターンマッチ
9.7.1. LIKE
9.7.2. SIMILAR TO正規表現
9.7.3. POSIX正規表現
9.8. データ型書式設定関数
9.9. 日付/時刻関数と演算子
9.9.1. EXTRACT, date_part
9.9.2. date_trunc
9.9.3. date_bin
9.9.4. AT TIME ZONE
9.9.5. 現在の日付/時刻
9.9.6. 遅延実行
9.10. 列挙型サポート関数
9.11. 幾何関数と演算子
9.12. ネットワークアドレス関数と演算子
9.13. テキスト検索関数と演算子
9.14. UUID関数
9.15. XML関数
9.15.1. XML内容の生成
9.15.2. XML述語
9.15.3. XMLの処理
9.15.4. XMLにテーブルをマップ
9.16. JSON関数と演算子
9.16.1. JSONデータの処理と生成
9.16.2. SQL/JSONパス言語
9.17. シーケンス操作関数
9.18. 条件式
9.18.1. CASE
9.18.2. COALESCE
9.18.3. NULLIF
9.18.4. GREATESTおよびLEAST
9.19. 配列関数と演算子
9.20. 範囲/多重範囲関数と演算子
9.21. 集約関数
9.22. ウィンドウ関数
9.23. 副問い合わせ式
9.23.1. EXISTS
9.23.2. IN
9.23.3. NOT IN
9.23.4. ANY/SOME
9.23.5. ALL
9.23.6. 単独行に関する比較
9.24. 行と配列の比較
9.24.1. IN
9.24.2. NOT IN
9.24.3. ANY/SOME (配列)
9.24.4. ALL (配列)
9.24.5. 行コンストラクタの比較
9.24.6. 複合型の比較
9.25. 集合を返す関数
9.26. システム情報関数と演算子
9.26.1. セッション情報関数
9.26.2. アクセス権限照会関数
9.26.3. スキーマ可視性問い合わせ関数
9.26.4. システムカタログ情報関数
9.26.5. オブジェクトの情報とアドレス付関数
9.26.6. コメント情報関数
9.26.7. データ有効性検証関数
9.26.8. トランザクションIDとスナップショット情報関数
9.26.9. コミット済みトランザクション情報関数
9.26.10. コントロールデータ関数
9.27. システム管理関数
9.27.1. 構成設定関数
9.27.2. サーバシグナル送信関数
9.27.3. バックアップ制御関数
9.27.4. リカバリ制御関数
9.27.5. スナップショット同期関数
9.27.6. レプリケーション管理関数
9.27.7. データベースオブジェクト管理関数
9.27.8. インデックス保守関数
9.27.9. 汎用ファイルアクセス関数
9.27.10. 勧告的ロック用関数
9.28. トリガ関数
9.29. イベントトリガ関数
9.29.1. コマンド側での変更を捕らえる
9.29.2. DDLコマンドで削除されたオブジェクトの処理
9.29.3. テーブル書き換えイベントの処理
9.30. 統計情報関数
9.30.1. MCVリストの検査
<title>Functions and Operators</title>

<productname>PostgreSQL</productname> provides a large number of functions and operators for the built-in data types. This chapter describes most of them, although additional special-purpose functions appear in relevant sections of the manual. Users can also define their own functions and operators, as described in <xref linkend="server-programming"/>. The <application>psql</application> commands <command>\df</command> and <command>\do</command> can be used to list all available functions and operators, respectively. PostgreSQLは組み込みデータ型に対して数多くの関数と演算子を用意しています。 この章ではそのほとんどについて説明しますが、特殊用途の関数はマニュアルの関連する節に記載しています。 また、パート Vで解説しているように、ユーザは独自の関数と演算子を定義することもできます。 psql\dfコマンドと\doコマンドはそれぞれ全ての使用可能な関数と演算子をリストするのに使用されます。

The notation used throughout this chapter to describe the argument and result data types of a function or operator is like this: この章全体で関数と演算子の引数と返り値のデータ型の記述は以下のようになります。

repeat ( text, integer ) → text

which says that the function <function>repeat</function> takes one text and one integer argument and returns a result of type text. The right arrow is also used to indicate the result of an example, thus: つまり関数repeatは、一つのテキスト型と一つの整数型の引数を取り、テキスト型の結果を返します。 また、右矢印を使ってある例の結果を示します。ですから、以下のようになります。

repeat('Pg', 4) → PgPgPgPg

If you are concerned about portability then note that most of the functions and operators described in this chapter, with the exception of the most trivial arithmetic and comparison operators and some explicitly marked functions, are not specified by the <acronym>SQL</acronym> standard. Some of this extended functionality is present in other <acronym>SQL</acronym> database management systems, and in many cases this functionality is compatible and consistent between the various implementations. もし移植性が気になるのであれば、最も基本的な算術および比較演算子と、いくつかの明示的に印を付けた関数を除き、本章で説明する大多数の関数と演算子は、標準SQLで規定されていない点に注意してください。 この拡張機能のいくつかは、他のSQLデータベース管理システムにも備わっており、多くの場合この機能には各種実装間で互換性と整合性があります。

split-func0-end split-func1-start split-func1-end split-func2-start split-func2-end split-func3-start split-func3-end split-func4-start