PG_TRANSACTION_STATUS(3)PG_TRANSACTION_STATUS(3)pg_transaction_status - Returns the current in-transaction status of the server.SYNOPSIS
int pg_transaction_status (resource $connection)
DESCRIPTION
Returns the current in-transaction status of the server.
Caution
pg_transaction_status(3) will give incorrect results when using a PostgreSQL 7.3 server that has the parameter autocommit set to
off. The server-side autocommit feature has been deprecated and does not exist in later server versions.
PARAMETERS
o $connection
- PostgreSQL database connection resource.
RETURN VALUES
The status can be PGSQL_TRANSACTION_IDLE (currently idle), PGSQL_TRANSACTION_ACTIVE (a command is in progress), PGSQL_TRANSACTION_INTRANS
(idle, in a valid transaction block), or PGSQL_TRANSACTION_INERROR (idle, in a failed transaction block). PGSQL_TRANSACTION_UNKNOWN is
reported if the connection is bad. PGSQL_TRANSACTION_ACTIVE is reported only when a query has been sent to the server and not yet com-
pleted.
EXAMPLES
Example #1
pg_transaction_status(3) example
<?php
$dbconn = pg_connect("dbname=publisher") or die("Could not connect");
$stat = pg_transaction_status($dbconn);
if ($stat === PGSQL_TRANSACTION_UNKNOWN) {
echo 'Connection is bad';
} else if ($stat === PGSQL_TRANSACTION_IDLE) {
echo 'Connection is currently idle';
} else {
echo 'Connection is in a transaction state';
}
?>
PHP Documentation Group PG_TRANSACTION_STATUS(3)
Check Out this Related Man Page
PG_VERSION(3)PG_VERSION(3)pg_version - Returns an array with client, protocol and server version (when available)SYNOPSIS
array pg_version ([resource $connection])
DESCRIPTION pg_version(3) returns an array with the client, protocol and server version. Protocol and server versions are only available if PHP was
compiled with PostgreSQL 7.4 or later.
For more detailed server information, use pg_parameter_status(3).
PARAMETERS
o $connection
- PostgreSQL database connection resource. When $connection is not present, the default connection is used. The default connection
is the last connection made by pg_connect(3) or pg_pconnect(3).
RETURN VALUES
Returns an array with client, protocol and server keys and values (if available). Returns FALSE on error or invalid connection.
EXAMPLES
Example #1
pg_version(3) example
<?php
$dbconn = pg_connect("host=localhost port=5432 dbname=mary")
or die("Could not connect");
$v = pg_version($dbconn);
echo $v['client'];
?>
The above example will output:
7.4
SEE ALSO pg_parameter_status(3).
PHP Documentation Group PG_VERSION(3)
Hi,
would like to know the server status from the following 'top' out put. Because, the application is giving a bad performance. would like to know whether the load is within the acceptable limit.
Murali...
System: shpu28 Tue Feb 3 10:03:31... (4 Replies)
OS : Solaris sparc
In c program After socket created when I do Connect() it results "Connection refused", but the system is online and I am able to do telnet, ping everything, but it says connection refused.
What would need to correct ? (6 Replies)
Hi Experts,
I am here with very simple request:
#!bin/bash
a=`stat -c %y log1.csv`
echo $a
and this stat command returning value as
2013-08-11 05:42:10.000000000 -0400:
But I want to see in mm/dd/yyyy format?
any help is highly appreciated thank you
---------- Post... (9 Replies)
Hi Guys,
I have two databases where I copy archivelog files from server A to server B frequently...yesterday we did the VM upgrade now...I am struggling to copy/ship the files from server A to server B...
I manually tested the file transfer but the big files, e.g 46M, stall. I can copy small... (2 Replies)
Hello All,
Actually, We have a problem in our server (RHEL 7.1), 1st server is used for payment apps like switch card payment (passthru only), and 2nd server is used for Database transaction.
When high transaction there is different connection between Apps Server and DB server, Apps Server... (0 Replies)