pg_transaction_status
Prev | 4.2.Connection Status Commands | Next

## pg_transaction_status

pg_transaction_status — 現在の一括処理内の状態を得る Get the current in-transaction status

## 構文 Synopsis

    pg_transaction_status conn

## 説明 Description

`pg_transaction_status` は現在の接続の状態を返す: 一括処理区間の内部か､一括処理の外部か､失敗した一括処理の内部か｡一括処理はsql命令 `BEGIN` で始まり､sql命令の一つの `COMMIT` か `ROLLBACK` で終わる｡失敗した一括処理はどれかの不都合が生じた後のものである; PostgreSQL は一括処理が終わる迄､全てのsql命令を無視する｡`pg_transaction_status` は応用譜に一括処理内か､失敗した一括処理か定めることを許容する｡ `pg_transaction_status` returns the current status of the connection: whether it is inside a transaction block, outside a transaction block, or inside a failed transaction block. A transaction block begins with the SQL command `BEGIN`, and ends with one of the SQL commands `COMMIT` or `ROLLBACK`. A failed transaction block is a transaction block after any error occurs; PostgreSQL will ignore all SQL commands until the end of the transaction block. `pg_transaction_status` allows an application to determine if it is in a transaction block or failed transaction block.

## 引数 Arguments

`conn`

  一括処理の状態を報告する接続の把持子｡ The handle of the connection on which to report transaction status.

## 返り値 Return Value

次の表内の文字列の一つ: One of the string values in the following table:

Value | Description
--- | ---
IDLE | 接続は暇､一括処理区間ではない Connection is idle, not in a transaction block.
INTRANS | 接続は(非失敗)一括処理区間内 Connection is in a (non-failed) transaction block.
INERROR | 接続は失敗した一括処理区間内 Connection is in a failed transaction block.
UNKNOWN | 接続は駄目か未知の状態 Connection is bad or in an unknown state.

## Notes

この命令は PostgreSQL libpq function `PQtransactionStatus` を使うか模擬する｡ This command uses or emulates the PostgreSQL libpq function `PQtransactionStatus`.

Prev | Up | Next
4.2.Connection Status Commands | Home | pg_parameter_status