How to access a table inside a schema without using a schema prefix (Postgres + PHP)?

I have several tables created by schema. At the moment, I can access the table in the schema using:

select * from myschema.mytable

I am looking for ways to avoid using a schema name. sort of:

select * from mytable

But I do not find the answers.

You can help? Thanks

+4
source share
1 answer

To do this, the scheme search path will work:

To see the current value:

SHOW search_path;

To change a value (add a new schema):

SET search_path TO myschema,public;

This is described here in section 5.7.3

+7
source

All Articles