PostgreSQL: owner of relation changed by restorepkg

TomKu

Member
Oct 10, 2011
18
0
51
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.
 

TomKu

Member
Oct 10, 2011
18
0
51
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.
 

cPanelMichael

Technical Support Community Manager
Staff member
Apr 11, 2011
47,911
2,233
363
cPanel Access Level
DataCenter Provider
Twitter
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.