★ wanayoo — archive 1999 http://www.phpbuilder.com/manual/ref.pgsql.php3Nouvelle recherche | Portail wanayoo

    



Search:

Keywords:

Manual Table of Contents
Up to Function Reference
Function Reference
* Adabas D
* Apache
* Arrays
* aspell
* BC math
* Calendar
* Date/time
* dBase
* DBM
* Directories
* Dyn.loading
* Program Execution
* filePro
* Filesystem
* HTTP
* Hyperwave
* Graphics
* IMAP
* PHP options/info
* Informix
* InterBase
* LDAP
* Mail
* Math.
* Misc.
* mSQL
* MS SQL Server
* MySQL
* Sybase
* Network
* ODBC
* OCI8
* Oracle
* PDF
* PostgreSQL
* Regexps
* Semaphore
* Solid
* SNMP
* Strings
* URLs
* Variables
* Vmailmgr
* WDDX
* Zlib
* XML


Previous page
 PDF_execute_image
pg_Close 
Next page


XXXV. 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 a public-domain, open source descendant of this original Berkeley code.

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

Since version 6.3 (03/02/1998) PostgreSQL use unix domain sockets, a table is given to this new 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 socket".

Table 1. Postmaster and PHP

PostmasterPHPStatus
postmaster &pg_connect("", "", "", "", "dbname");OK
postmaster -i &pg_connect("", "", "", "", "dbname");OK
postmaster &pg_connect("localhost", "", "", "", "dbname");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("localhost", "", "", "", "dbname");OK

One can also establish a connection with the following command: $conn = pg_Connect("host=localhost port=5432 dbname=chris");

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 and end. If the transaction fails the transaction should be closed with abort and rollback.

Example 1. Using Large Objects

<?php
$database = pg_Connect ("", "", "", "", "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")
pg_exec ($database, "end")
?>


Previous page
 PDF_execute_image
pg_Close 
Next page




 

Sample Code | Columns | Mail Archive | Support | Get Started! | Links | Contribute!

Contact (non support questions)

By viewing these pages you agree to the Legal Terms of Service.

 

 

 

  Geocrawler.com | GoToCity.com | DirectriCity.com | PHPBuilder.com | The Des Moines City.net