diff options
author | Michael Meskes <meskes@postgresql.org> | 2009-09-18 13:13:32 +0000 |
---|---|---|
committer | Michael Meskes <meskes@postgresql.org> | 2009-09-18 13:13:32 +0000 |
commit | dacaeff5ae2978bd1e77c16bd79ce99d5f9b5382 (patch) | |
tree | 8f783e939052c8347b16dfd13c465ffec430e416 /src/interfaces/ecpg/ecpglib/misc.c | |
parent | 20f7f019f9a6c44e71d33ca3d1b616b4fc1bb3c8 (diff) |
Added patch by Bernd Helmle <bernd.helmle@credativ.de> that adds a low level
function that returns the current transaction status.
Diffstat (limited to 'src/interfaces/ecpg/ecpglib/misc.c')
-rw-r--r-- | src/interfaces/ecpg/ecpglib/misc.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/interfaces/ecpg/ecpglib/misc.c b/src/interfaces/ecpg/ecpglib/misc.c index f70e3734ba5..fafe9aceba8 100644 --- a/src/interfaces/ecpg/ecpglib/misc.c +++ b/src/interfaces/ecpg/ecpglib/misc.c @@ -1,4 +1,4 @@ -/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/misc.c,v 1.51 2009/09/03 09:09:01 meskes Exp $ */ +/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/misc.c,v 1.52 2009/09/18 13:13:32 meskes Exp $ */ #define POSTGRES_ECPG_INTERNAL #include "postgres_fe.h" @@ -170,6 +170,21 @@ ECPGstatus(int lineno, const char *connection_name) return (true); } +PGTransactionStatusType +ECPGtransactionStatus(const char *connection_name) +{ + const struct connection *con; + + con = ecpg_get_connection(connection_name); + if (con == NULL) { + /* transaction status is unknown */ + return PQTRANS_UNKNOWN; + } + + return PQtransactionStatus(con->connection); + +} + bool ECPGtrans(int lineno, const char *connection_name, const char *transaction) { |