Cced: to pgpool-general:

> Dear Tatsuo.
> 
> how to analyse sql statement like this
> 
> BEGIN ;
> DELETE FROM "test" ;
> DELETE FROM "log" ;
> COMMIT ;
> 
> I just need that last commmand is "COMMIT ;" , there is separator ";" at the 
> end command.
> also there is BEGIN ;
> 
> using "node" ?.
> Would you like give me clue where I start reading code ?.

Please take a look at is_commit_query().

        stmt = (TransactionStmt *)node;

where stmt is one of:

typedef enum TransactionStmtKind
{
        TRANS_STMT_BEGIN,
        TRANS_STMT_START,                       /* semantically identical to 
BEGIN */
        TRANS_STMT_COMMIT,
        TRANS_STMT_ROLLBACK,
        TRANS_STMT_SAVEPOINT,
        TRANS_STMT_RELEASE,
        TRANS_STMT_ROLLBACK_TO,
        TRANS_STMT_PREPARE,
        TRANS_STMT_COMMIT_PREPARED,
        TRANS_STMT_ROLLBACK_PREPARED
} TransactionStmtKind;

So for example you need to know the query is "BEGIN", you can check if
it is either TRANS_STMT_BEGIN or TRANS_STMT_START.
Hope this helps,
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese: http://www.sraoss.co.jp
_______________________________________________
Pgpool-general mailing list
[email protected]
http://pgfoundry.org/mailman/listinfo/pgpool-general

Reply via email to