Page 1 of 1

PostgreSQL

Posted: Wed Dec 20, 2006 11:53 pm
by madhu
Hi all,

Can anyone know how to use PostgreSQL functions insteadof Mysql functions as DATABASE.

Please suggest if any installation is needed for use of PostgreSQL Functions.

Waiting for your valuable replies.........

Thanks in advance................
MADHU

Posted: Thu Dec 21, 2006 12:09 am
by dibyendrah
Just replace the mysql and replace with pg. I guess that should work for postgreSQL. The best way to make the application work for multiple database is to use ADODB.

Posted: Thu Dec 21, 2006 12:09 am
by klarinetking
Hi,

Looking in the PHP Manual will provide the answers you need.
php.net wrote:Requirements

To use PostgreSQL support, you need PostgreSQL 6.5 or later, PostgreSQL 8.0 or later to enable all PostgreSQL module features. PostgreSQL supports many character encodings including multibyte character encoding. The current version and more information about PostgreSQL is available at http://www.postgresql.org/ and the PostgreSQL Documentation.
Installation

In order to enable PostgreSQL support, --with-pgsql[=DIR] is required when you compile PHP. DIR is the PostgreSQL base install directory, defaults to /usr/local/pgsql. If shared object module is available, PostgreSQL module may be loaded using extension directive in php.ini or dl() function.
klarinetking

Posted: Thu Dec 21, 2006 2:40 am
by CoderGoblin
As Dibyendrah stated, if you are likely to need to use MySQL and/or postgres at different times it may be worth looking at ADODB. It is important to also note that the table structures (notably automatic sequencing) differ. You cannot simply get last inserted id in postgres. You need to get the sequence, then insert it if you need it again.