Results 1 to 2 of 2
  1. #1
    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......

    Thanks

  2. #2
    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;

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •