If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back  dBforums > Database Server Software > PostgreSQL > Confusion with User, Schemas & Databases

LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Registered User
Join Date: Dec 2012
Posts: 3
Confusion with User, Schemas & Databases

Hello everybody.

This may sound the dumbest confusion but yes, I am very confused with the concept of Users, Databases and Schemas in Postgresql. Can somebody help me to explain this with reference to a Cluster. Any explanation appreciated......

Reply With Quote
  #2 (permalink)  
Registered User
Join Date: Dec 2012
Posts: 32
The CLUSTER contains all DATABASES and ROLES of the PostgreSQL server.

Predefined are the databases "postgres", "template0" and "template1".
The databases "template0" and "template1" are templates for new databases you create.

ROLES (USERS are also ROLES who can login on the database server) are stored also global on the CLUSTER. There are no ROLES in a single database.

A database contains all objects (TABLE, INDEX, FUNCTION, etc.).
To avoid namespace pollution between more than one database application you can create and use an own schema for the objects.
If no SCHEMA is given the SCHEMA named like the username or the default SCHEMA "public" is used. The SCHEMA "public" is predifined in all new databases. You can change this by setting the search_pat.

For example:
SET search_path TO myschema,public;
Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On