PostgreSQL: Change default schemaΒΆ

Refer to official documentation too.

-- Use this to show the current search_path
-- Should return: "$user",public
SHOW search_path;

-- Create another schema
CREATE SCHEMA my_schema;
GRANT ALL ON SCHEMA my_schema TO my_user;

-- To change search_path on a connection-level
SET search_path TO my_schema;

-- To change search_path on a database-level
ALTER database "my_database" SET search_path TO my_schema;
comments powered by Disqus

Previous topic

Postfix: send-only configuration

Next topic

PostgreSQL: Make root log in as postgres user

This Page