Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

pg_end_copy(3) [php man page]

PG_END_COPY(3)															    PG_END_COPY(3)

pg_end_copy - Sync with PostgreSQL backend

SYNOPSIS
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 backend

SYNOPSIS
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)
Man Page

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

I need remote connection help

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)
Discussion started by: noobie_doo
2 Replies

2. Programming

PostgreSQL - can not find server

(1 Reply)
Discussion started by: barlom
1 Replies

3. Solaris

Determining PostgreSQL version

I need to find out if a version of PostgreSQL installed in SPARC Solaris is > 7.2 please tell me how to do it. thanks. (4 Replies)
Discussion started by: orange47
4 Replies

4. Shell Programming and Scripting

Script to parse a file faster

My example file is as given below: conn=1 uid=oracle conn=2 uid=db2 conn=3 uid=oracle conn=4 uid=hash conn=5 uid=skher conn=6 uid=oracle conn=7 uid=mpalkar conn=8 uid=anarke conn=1 op=-1 msgId=-1 - fd=104 slot=104 LDAPS connection from 10.10.5.6 to 10.18.6.5 conn=2 op=-1 msgId=-1 -... (7 Replies)
Discussion started by: sags007_99
7 Replies

5. Emergency UNIX and Linux Support

Different OS Kernel Update Frequency

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)
Discussion started by: majid.merkava
6 Replies

6. Shell Programming and Scripting

Need help to replace a perl pattern matching

My example file is as given below: conn=1 uid=oracle conn=2 uid=db2 conn=3 uid=oracle conn=4 uid=hash conn=5 uid=skher conn=6 uid=oracle conn=7 uid=mpalkar conn=8 uid=anarke conn=9 uid=oracle conn=1 op=-1 msgId=-1 - fd=104 slot=104 LDAPS connection from 10.10.5.6 to 10.18.6.5 conn=2... (4 Replies)
Discussion started by: sags007_99
4 Replies

7. Shell Programming and Scripting

Help need with PERL multiple search pattern matching!

My example file is as given below: conn=1 uid=oracle conn=2 uid=db2 conn=3 uid=oracle conn=4 uid=hash conn=5 uid=skher conn=6 uid=oracle conn=7 uid=mpalkar conn=8 uid=anarke conn=9 uid=oracle conn=1 op=-1 msgId=-1 - fd=104 slot=104 LDAPS connection from 10.10.5.6 to 10.18.6.5 conn=2... (3 Replies)
Discussion started by: sags007_99
3 Replies

8. Programming

Mysql++

code: #include <mysql/mysql.h> #include <my_global.h> int main(int argc, char **argv) { MYSQL *conn; conn = mysql_init(NULL); mysql_real_connect(conn, "localhost", "zetcode", "passwd", "testdb", 0, NULL, 0); mysql_query(conn, "use vobd_db"); mysql_query(conn, "select *... (1 Reply)
Discussion started by: raj6
1 Replies

9. Red Hat

Storage Cluster ?

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)
Discussion started by: mnnn
2 Replies