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)
Check Out this Related Man Page
PG_PUT_LINE(3)PG_PUT_LINE(3)pg_put_line - Send a NULL-terminated string to PostgreSQL backendSYNOPSIS
bool pg_put_line ([resource $connection], string $data)
DESCRIPTION pg_put_line(3) sends a NULL-terminated string to the PostgreSQL backend server. This is needed in conjunction with PostgreSQL's COPY FROM
command.
COPY is a high-speed data loading interface supported by PostgreSQL. Data is passed in without being parsed, and in a single transaction.
An alternative to using raw pg_put_line(3) commands is to use pg_copy_from(3). This is a far simpler interface.
Note
The application must explicitly send the two characters "." on the last line to indicate to the backend that it has finished send-
ing its data, before issuing pg_end_copy(3).
Warning
Use of the pg_put_line(3) causes most large object operations, including pg_lo_read(3) and pg_lo_tell(3), to subsequently fail. You
can use pg_copy_from(3) and pg_copy_to(3) instead.
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).
o $data
- A line of text to be sent directly to the PostgreSQL backend. A NULL terminator is added automatically.
RETURN VALUES
Returns TRUE on success or FALSE on failure.
EXAMPLES
Example #1
pg_put_line(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_end_copy(3).
PHP Documentation Group PG_PUT_LINE(3)
I am very new to all of this. I tcsh into a Unix box at work. I receive "hints" from a guy here at work that is helping me without doing everything for me.
I need to use rx display to x connect to a remote host. I then need to tell the machine (unsure if he meant mine or the box I connected... (2 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)
Hi
I want the Sync file server together (at the moment)
All server to a web server
What can I do to update Joomla or WordPress files even when taken together are equal
Databases together are replicated
What is the solutions ?
Thanks (2 Replies)