The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

PostgreSQL: owner of relation changed by restorepkg

Discussion in 'Database Discussions' started by TomKu, Mar 12, 2014.

  1. TomKu

    TomKu Member

    Joined:
    Oct 10, 2011
    Messages:
    18
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Chicago
    cPanel Access Level:
    Root Administrator
    Source host (psql 9.1):

    username_test=# \dt
    List of relations
    Schema | Name | Type | Owner
    --------+--------+-------+----------------
    public | table1 | table | username_testu

    /scripts/pkgacct username
    copy

    Destination host (psql 9.3):

    /scripts/restorepkg username
    ERROR: role "username_test" is a member of role "username_test"

    username_test=> \dt
    List of relations
    Schema | Name | Type | Owner
    --------+--------+-------+----------
    public | table1 | table | username


    Code that was working on source host now produces:
    ERROR: permission denied for relation table1

    The dump prepared by pkgacct contains
    ALTER TABLE public.table1 OWNER TO username_testu;
    anyway final result is as above.

    I am testing account migration but I already found 3-4 mysql/postgresql obstacles (posted earlier on the forum)
    that make the work tedious task as things need to be manually repaired.
     
  2. TomKu

    TomKu Member

    Joined:
    Oct 10, 2011
    Messages:
    18
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Chicago
    cPanel Access Level:
    Root Administrator
    UPDATE:
    Looks like the 'permission denied' error goes away automatically after I enter 'cPanel - Databases - PostgreSQL Databases' and dbuser can use the table then.

    The above action seems to run:

    REVOKE ALL ON TABLE table1 FROM PUBLIC;
    REVOKE ALL ON TABLE table1 FROM username;
    GRANT ALL ON TABLE table1 TO username;
    GRANT ALL ON TABLE table1 TO username_test;

    in the background.

    The table owner still remains changed but as long as he stays in correct ROLE it may not be a problem.
     
  3. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    653
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    Feel free to open a support ticket using the link in my signature so we can take a closer look. You can post the ticket number here so we can update this thread with the outcome.

    Thank you.
     
Loading...

Share This Page