I'm trying to connect to my postgres database.
Everything is working fine, but in my database I've got 2 schemas. One of them is created by default by PgAdmin
(public
), and the second one, ZTB
, which I have created.
When I connect to my database using NodeJS, it by default connects to the "public
" schema, and therefore I cannot query tables from "ZTB".
Is there any solution to switch the current working schema in the NodeJS server?
Regards
set search_path ...
postgresql.org/docs/current/static/… – a_horse_with_no_nameclient.query("SET search_path TO 'ZTB';");
did the job. Update: exactly as @a_horse_with_no_name said. – Rafael