PG_CLIENT_ENCODING(3)PG_CLIENT_ENCODING(3)pg_client_encoding - Gets the client encodingSYNOPSIS
string pg_client_encoding ([resource $connection])
DESCRIPTION
PostgreSQL supports automatic character set conversion between server and client for certain character sets. pg_client_encoding(3) returns
the client encoding as a string. The returned string will be one of the standard PostgreSQL encoding identifiers.
Note
This function requires PHP 4.0.3 or higher and PostgreSQL 7.0 or higher. If libpq is compiled without multibyte encoding support,
pg_client_encoding(3) always returns SQL_ASCII. Supported encoding depends on PostgreSQL version. Refer to the PostgreSQL Documenta-
tion supported encodings.
The function used to be called pg_clientencoding(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
The client encoding, or FALSE on error.
EXAMPLES
Example #1
pg_client_encoding(3) example
<?php
// Assume $conn is a connection to a ISO-8859-1 database
$encoding = pg_client_encoding($conn);
echo "Client encoding is: ", $encoding, "
";
?>
The above example will output:
Client encoding is: ISO-8859-1
SEE ALSO pg_set_client_encoding(3).
PHP Documentation Group PG_CLIENT_ENCODING(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 All,
Has anyone of you connected to a remote PostgreSQL database through a shell/perl script. Can you please let me know the steps involed?
Thanks.
Rahul. (0 Replies)
Hi All
I have a clarification. I am running a database on CentOS 4.5 final, PostgreSQL version 8.1.9. The question is about memory usage on the system. The memory used statistic has risen consistently over the past few days... by about 2-3% a day. I want to know why this memory is growing.... (1 Reply)
Hi
My client connection to RAC Oracle Release 10.2.0.4.0 database suddenly stopped working.
ACPT_1 - works but not with OEM.
ACPT_2 - does not work at all.
Getting error ORA-12564: TNS:connection refused
Any ideas very much appreciated
Thanks
ACPT_1 =
(DESCRIPTION =
... (4 Replies)
Hi guys
I'm trying to configure a collaboration suit (PHP, PostgreSQL, Apache) plus a mail server(Sendmail and Dovecot) on a single box. It will be used heavily 24*7. So having a long up time is really needed. I'm looking for 3 to 6 month up time. I want to know about kernel update... (6 Replies)
I want to check if the string is WINDOWS-1251 or UTF-8
can you help me to find the string encoding???
or maybe to get URL Content-Type charset with wget?
this is my function on PHP
function check_utf8($str) {
$len = strlen($str);
for($i = 0; $i < $len; $i++){
$c =... (2 Replies)