Page 1 of 1

Howto Select Schema in PostgresSql

Posted: 01.05.2006, 09:49
by Terence
Hi!

How can i preselect a schema for all upcoming db acess, like inserts, selects, deletes, and more..?

If i connect to std db postgres where i have a schema 'test' i can access all tables in test via 'test.tablename', bute how can i preselect 'test' as domain for all following sqls. That way i could e.g "select * from tablename" in context of 'test'.

Tx in advance,
greets Terence.

Posted: 02.05.2006, 17:35
by btrewern
Run something like:

Code: Select all

SET search_path = test;
via a ZQuery and then for that connection you will be able to use

Code: Select all

SELECT * from tablename;
instead of

Code: Select all

SELECT * from test.tablename;
Regards,

Ben