1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-02 09:02:37 +03:00

Added patch by Bernd Helmle <bernd.helmle@credativ.de> that adds a low level

function that returns the current transaction status.
This commit is contained in:
Michael Meskes
2009-09-18 13:13:32 +00:00
parent 20f7f019f9
commit dacaeff5ae
4 changed files with 46 additions and 5 deletions

View File

@ -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)
{