Howto Select Schema in PostgresSql

Forum related to version 6.5.1 (alpha) and 6.6.x (beta) of ZeosLib's DBOs

Moderators: gto, cipto_kh, EgonHugeist

Post Reply
Terence
Zeos Dev Team
Zeos Dev Team
Posts: 141
Joined: 22.09.2005, 14:11
Location: Stuttgart
Contact:

Howto Select Schema in PostgresSql

Post 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.
btrewern
Expert Boarder
Expert Boarder
Posts: 193
Joined: 06.10.2005, 18:51

Post 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
Post Reply