★ wanayoo — archive 1999 http://fr.php.net/manual/kr/ref.pgsql.phpNouvelle recherche | Portail wanayoo

PHP Home Page

Manual Table of Contents
Up to Function 참조
Quick Reference
English version of this pageGerman version of this pageJapanese version of this page
Italian version of this pageFrench version of this pageHungarian version of this page
Spanish version of this pageDutch version of this pageBrazilian Portuguese version of this page
Korean version of this pageCzech version of this page
Function 참조
* Apache
* Arrays
* Aspell
* BC math
* Calendar
* CCVS
* COM
* Classes/Objects
* ClibPDF
* CURL
* Cybercash
* dba
* Date/time
* dBase
* DBM
* Directories
* DOM XML
* Errors and Logging
* filePro
* Filesystem
* FDF
* FTP
* Functions
* gettext
* GMP
* HTTP
* Hyperwave
* ICAP
* Graphics
* IMAP
* Informix
* InterBase
* Ingres II
* LDAP
* Mail
* Math.
* MCAL
* mcrypt
* mhash
* MS SQL Server
* Misc.
* mSQL
* MySQL
* Network
* ODBC
* OCI8
* OpenSSL
* Oracle
* OvrimosSQL
* Output Control
* PDF
* Verisign Payflow Pro
* PHP options/info
* POSIX
* PostgreSQL
* Program Execution
* Pspell
* Readline
* Recode
* PCRE
* Regexps
* Satellite
* Semaphore
* SESAM
* Sessions
* shmop
* SWF
* SNMP
* Sockets
* Strings
* Sybase
* URLs
* Variables
* WDDX
* XML
* XSLT
* YAZ
* YP/NIS
* Zlib

  Thanks to:
 Chek.com
 easyDNS
 VA Linux Systems

  Related sites:
Apache
MySQL
PostgreSQL
Zend Tech.

  Community:
LinuxFund.org
OSDN
Manual: PostgreSQL functions
View the source code for this pageSearch the site



Previous page
 posix_getrlimit
 Updated
Mon, 22 Jan 2001
pg_close 
Next page


LV. PostgreSQL functions

Postgres, developed originally in the UC Berkeley Computer Science Department, pioneered many of the object-relational concepts now becoming available in some commercial databases. It provides SQL92/SQL3 language support, transaction integrity, and type extensibility. PostgreSQL is an open source descendant of this original Berkeley code.

PostgreSQL is available without cost. The current version is available at www.PostgreSQL.org.

Since version 6.3 (03/02/1998) PostgreSQL uses unix domain sockets. A table is shown below describing these new connection possibilities. This socket will be found in /tmp/.s.PGSQL.5432. This option can be enabled with the '-i' flag to postmaster and it's meaning is: "listen on TCP/IP sockets as well as Unix domain sockets".

Table 1. Postmaster and PHP

PostmasterPHPStatus
postmaster &pg_connect("dbname=MyDbName");OK
postmaster -i &pg_connect("dbname=MyDbName");OK
postmaster &pg_connect("host=localhost dbname=MyDbName"); Unable to connect to PostgreSQL server: connectDB() failed: Is the postmaster running and accepting TCP/IP (with -i) connection at 'localhost' on port '5432'? in /path/to/file.php3 on line 20.
postmaster -i &pg_connect("host=localhost dbname=MyDbName");OK

One can establish a connection with the following value pairs set in the command string: $conn = pg_Connect("host=myHost port=myPort tty=myTTY options=myOptions user=myUser password=myPassword dbname=myDB");

The previous syntax of: $conn = pg_connect ("host", "port", "options", "tty", "dbname") has been deprecated.

To use the large object (lo) interface, it is necessary to enclose it within a transaction block. A transaction block starts with a begin and if the transaction was valid ends with commit or end. If the transaction fails the transaction should be closed with rollback or abort.

Example 1. Using Large Objects


<?php
    $database = pg_Connect ("dbname=jacarta");
    pg_exec ($database, "begin");
    $oid = pg_locreate ($database);
    echo ("$oid\n");
    $handle = pg_loopen ($database, $oid, "w");
    echo ("$handle\n");
    pg_lowrite ($handle, "gaga");
    pg_loclose ($handle);
    pg_exec ($database, "commit");
?>
     

Table of Contents
pg_close — Close a PostgreSQL connection
pg_cmdtuples — Returns number of affected tuples
pg_connect — Open a PostgreSQL connection
pg_dbname — Get the database name
pg_end_copy — Sync with PostgreSQL backend
pg_errormessage — Get the error message string
pg_exec — Execute a query
pg_fetch_array — Fetch a row as an array
pg_fetch_object — Fetch a row as an object
pg_fetch_row — Get a row as an enumerated array
pg_fieldisnull — Test if a field is NULL
pg_fieldname — Returns the name of a field
pg_fieldnum — Returns the field number of the named field
pg_fieldprtlen — Returns the printed length
pg_fieldsize — Returns the internal storage size of the named field
pg_fieldtype — Returns the type name for the corresponding field number
pg_freeresult — Free result memory
pg_getlastoid — Returns the last object identifier
pg_host — Returns the host name associated with the connection
pg_loclose — Close a large object
pg_locreate — Create a large object
pg_loexport — Export a large object to file
pg_loimport — Import a large object from file
pg_loopen — Open a large object
pg_loread — Read a large object
pg_loreadall — Read a entire large object and send straight to browser
pg_lounlink — Delete a large object
pg_lowrite — Write a large object
pg_numfields — Returns the number of fields
pg_numrows — Returns the number of rows
pg_options — Get the options associated with the connection
pg_pconnect — Open a persistant PostgreSQL connection
pg_port — Return the port number associated with the connection
pg_put_line — Send a NULL-terminated string to PostgreSQL backend
pg_result — Returns values from a result identifier
pg_set_client_encoding — Set the client encoding
pg_client_encoding — Get the client encoding
pg_trace — Enable tracing a PostgreSQL connection
pg_tty — Return the tty name associated with the connection
pg_untrace — Disable tracing of a PostgreSQL connection

 About Notes


Previous page
 posix_getrlimit
 Updated
Mon, 22 Jan 2001
pg_close 
Next page





Who's responsible for this?
Top of this page

Site
Hosting:



Located in
France
Elements of this website are subject to copyright.
Questions about installing or using PHP should be directed to one of the mailing lists.
Only questions about the website should be directed to webmaster@php.net.