Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

PostgreSQL: owner of relation changed by restorepkg

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

  1. TomKu

    TomKu Member

    Joined:
    Oct 10, 2011
    Messages:
    18
    Likes Received:
    0
    Trophy Points:
    51
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. TomKu

    TomKu Member

    Joined:
    Oct 10, 2011
    Messages:
    18
    Likes Received:
    0
    Trophy Points:
    51
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    43,943
    Likes Received:
    1,821
    Trophy Points:
    363
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice