[pgsql-jp: 26613] Re: トランザクション中の select文でエラーが発生した場合
Shigeki Mimura
mimu @ telepass.co.jp
2002年 7月 8日 (月) 15:44:15 JST
三村です。
shohei> トランザクション中のselect文でエラーが発生した場合に下記
shohei> のようなエラーとなってしまうのですが、これを回避する方法
shohei> はないのでしょうか。実際にやりたい事はテーブル上に oid が
shohei> 存在するかどうかを判定したいだけなのですが。
shohei>
shohei> 環境
shohei> Win2000 + PostgreSQL 7.2.1 for Windows
shohei> LASER5 7.2 + PostgreSQL 7.1.3-2
shohei>
shohei> hoge=# begin;
shohei> BEGIN
shohei> hoge=# select oid1 from abc;
shohei> ERROR: Attribute 'oid1' not found
shohei> hoge=# select oid from abc;
shohei> NOTICE: current transaction is aborted, queries ignored
shohei> until end of transaction block
shohei> *ABORT STATE*
shohei> hoge=#
s
oid1というカラムが存在しないからですよね。
これだと、その後はこのトランザクションブロックでは実行されません。
カラムの存在を確かめたいのでしょうか?
それとも特定のoidを持つものを検索したいのですか?
pgsql-jp メーリングリストの案内