Saturday, July 27, 2013

Make your schemas in postgresql localized

Depend on your requirement, database can be designed with many schemas. But to make it localized, that is when you want to fetch data or use the tables, it should be visible to the code, without the need to search it with schema, with any application you use, for eg., pgadmin, phppgadmin or any other application which you may develop. To achieve this, use the search_path attributes in postgresql.

syntax:
search_path = '"$user",public'

To implement it at user level, try the following syntax:
ALTER USER username SET search_path = schema1,schema2,schema3,etc;  

No comments: