pg_last_error
特定の接続から直近のエラーメッセージ文字列を取得する
&reftitle.description;
stringpg_last_error
PgSql\Connectionnullconnection&null;
pg_last_error は、指定した
connection から直近のエラーメッセージを返します。
エラーメッセージは、内部的な PostgreSQL(libpq) 関数コールにより
上書きされる可能性があります。PostgreSQL モジュール関数の中で複数の
エラーが発生した場合には、この関数は適切なエラーメッセージを返さない
可能性があります。
エラー処理を改善するために
pg_result_error、pg_result_error_field、
pg_result_status および
pg_connection_status を使用ください。
この関数は、以前は pg_errormessage と呼ばれていました。
&reftitle.parameters;
connection
&pgsql.parameter.connection-with-nullable-default;
&reftitle.returnvalues;
指定した connection の直近のエラーメッセージを
含む文字列を返します。
&reftitle.changelog;
&Version;
&Description;
&pgsql.changelog.connection-object;
8.0.0
connection は、nullable になりました。
&reftitle.examples;
pg_last_error の例
]]>
&reftitle.seealso;
pg_result_error
pg_result_error_field