Re: default postgreSQL schema

From: Date: Tue, 21 Nov 2006 05:20:23 +0000
Subject: Re: default postgreSQL schema
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-244940@lists.php.net to get a copy of this message
thanks a lot. I also find that i can setup it directly to DB thanks to alter command. I was thinking that maybe PHP had a special command for that, but it seems not. Alain On 11/21/06, Chris <dmagick@gmail.com> wrote:
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/
-- Alain ------------------------------------ Windows XP SP2 PostgreSQL 8.1.4 Apache 2.0.58 PHP 5

« previous php.general (#244940) next »