Re: default postgreSQL schema

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Alain Roger wrote:
Hi,

I would like to know if under PHP i can setup the default schema for a
PostgreSQL database ?

e.g if my database name is 'mydb', my schema 'immense', i would like to
avoid :

immense.my_function_name(parameter1, parameter2,..)

...
select * from immense.table1 WHERE immense.table1.field1 =
immense.table2.field5;

Definitely not a php thing but here's a page with how to do it:

http://www.postgresql.org/docs/8.1/interactive/ddl-schemas.html

Basically you need to do:

pg_query('SET search_path TO myschema,public');

straight after your pg_connect call.

--
Postgresql & php tutorials
http://www.designmagick.com/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux