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_END_COPY(3)PG_END_COPY(3)pg_end_copy - Sync with PostgreSQL backendSYNOPSIS
bool pg_end_copy ([resource $connection])
DESCRIPTION pg_end_copy(3) syncs the PostgreSQL frontend (usually a web server process) with the PostgreSQL server after doing a copy operation per-
formed by pg_put_line(3). pg_end_copy(3) must be issued, otherwise the PostgreSQL server may get out of sync with the frontend and will
report an error.
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 TRUE on success or FALSE on failure.
EXAMPLES
Example #1
pg_end_copy(3) example
<?php
$conn = pg_pconnect("dbname=foo");
pg_query($conn, "create table bar (a int4, b char(16), d float8)");
pg_query($conn, "copy bar from stdin");
pg_put_line($conn, "3 hello world 4.5
");
pg_put_line($conn, "4 goodbye world 7.11
");
pg_put_line($conn, "\.
");
pg_end_copy($conn);
?>
SEE ALSO pg_put_line(3).
PHP Documentation Group PG_END_COPY(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)