#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2002
    Location
    Chennai, India
    Posts
    69
    Rep Power
    13

    same table name by another user in same database ???


    I have a database called 'dev' with users u_test, u_hris.

    If user u_test creates a table d_hris_per_1, user u_hris cannot create a table with the same name! It gives the error...

    ERROR: Relation 'd_hris_per_1' already exists

    Anyone can query, but DML is possible by owner only.

    Is this functionality ? Why can't another user create any table in his space ??

    So, now it is possible to restrict users access to a database ?? For eg.,

    - user 'u_test' should access 'test' database only in pg_hba.conf

    - user 'u_hris' should access 'hris' database only

    Thanks for your valuable input.

    Regards.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2002
    Posts
    409
    Rep Power
    13
    ggnanaraj,

    Are you coming from the Oracle world?

    The behavior you are seeing isn't a bug, it's normal. Users share one global tablespace, each user does not have their own schema, as they do in Oracle.

    This feature will most likely be included in the upcoming 7.3 release.

    So for now your users will need to create unique table names.

    One workaround is just to have them preface the table names with their usernames, like,

    u_test_d_hris_per_1
    u_hris_d_hris_per_1
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2002
    Location
    Chennai, India
    Posts
    69
    Rep Power
    13
    Originally posted by Ted Striker
    ggnanaraj,

    Are you coming from the Oracle world?

    Yea, true.

    BTW, nice to know that schemas will be introduced in the next release.

    Best Regards.

IMN logo majestic logo threadwatch logo seochat tools logo