pg.ddx.io pgsql-bugs@postgresql.org mailing list archive
help / color / mirror / Atom feedBUG #14009: pg_restore not restoring privilegs when one login/group role is missing
8+ messages / 3 participants
[nested] [flat]
* BUG #14009: pg_restore not restoring privilegs when one login/group role is missing
@ 2016-03-09 15:15 alexander@spiteri.org
2016-03-09 20:32 ` Re: BUG #14009: pg_restore not restoring privilegs when one login/group role is missing Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 8+ messages in thread
From: alexander@spiteri.org @ 2016-03-09 15:15 UTC (permalink / raw)
To: pgsql-bugs
The following bug has been logged on the website:
Bug reference: 14009
Logged by: Alexander Spiteri
Email address: alexander@spiteri.org
PostgreSQL version: 9.5.1
Operating system: CentOS Linux release 7.2.1511 (Core)
Description:
I have just installed a new instance of postgres 9.5.1 and have an issue
with restoring the database, specifically privilges of the login/group
roles.
In the past I was working with postgres 8.4 and when I took a backup from
the live server to the testing server pg_restore would grant all privilages
to login/group roles which existed on the testing server and give an error
for those that do not exist.
On the new 9.5.1 server when I try to restore a database, if one login/group
role does not exist pg_restore gives an error about it and then does not
grant any rights to all the other login/group roles that do exist. No errors
/ notices are issued about the grants that are not applied.
This behaviour is puzzling. I expected to get errors for users that are not
found but why aren't privilges assigned to users that do exist?
I reproduced this behaviour on different installations running version 9.5.1
and 9.3.11.
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: BUG #14009: pg_restore not restoring privilegs when one login/group role is missing
2016-03-09 15:15 BUG #14009: pg_restore not restoring privilegs when one login/group role is missing alexander@spiteri.org
@ 2016-03-09 20:32 ` Tom Lane <tgl@sss.pgh.pa.us>
2016-03-10 09:24 ` Re: BUG #14009: pg_restore not restoring privilegs when one login/group role is missing Alexander Spiteri <alexander@spiteri.org>
0 siblings, 1 reply; 8+ messages in thread
From: Tom Lane @ 2016-03-09 20:32 UTC (permalink / raw)
To: alexander@spiteri.org; +Cc: pgsql-bugs
alexander@spiteri.org writes:
> I have just installed a new instance of postgres 9.5.1 and have an issue
> with restoring the database, specifically privilges of the login/group
> roles.
> In the past I was working with postgres 8.4 and when I took a backup from
> the live server to the testing server pg_restore would grant all privilages
> to login/group roles which existed on the testing server and give an error
> for those that do not exist.
> On the new 9.5.1 server when I try to restore a database, if one login/group
> role does not exist pg_restore gives an error about it and then does not
> grant any rights to all the other login/group roles that do exist. No errors
> / notices are issued about the grants that are not applied.
That's fairly hard to believe. Can you provide a self-contained test
case?
regards, tom lane
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: BUG #14009: pg_restore not restoring privilegs when one login/group role is missing
2016-03-09 15:15 BUG #14009: pg_restore not restoring privilegs when one login/group role is missing alexander@spiteri.org
2016-03-09 20:32 ` Re: BUG #14009: pg_restore not restoring privilegs when one login/group role is missing Tom Lane <tgl@sss.pgh.pa.us>
@ 2016-03-10 09:24 ` Alexander Spiteri <alexander@spiteri.org>
2016-03-10 16:24 ` Re: BUG #14009: pg_restore not restoring privilegs when one login/group role is missing Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 8+ messages in thread
From: Alexander Spiteri @ 2016-03-10 09:24 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-bugs
Please find a test case attached. I tried to put as much detail as i could.
Regards,
Alexander Spiteri
On 9 March 2016 at 21:32, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> alexander@spiteri.org writes:
> > I have just installed a new instance of postgres 9.5.1 and have an issue
> > with restoring the database, specifically privilges of the login/group
> > roles.
>
> > In the past I was working with postgres 8.4 and when I took a backup from
> > the live server to the testing server pg_restore would grant all
> privilages
> > to login/group roles which existed on the testing server and give an
> error
> > for those that do not exist.
>
> > On the new 9.5.1 server when I try to restore a database, if one
> login/group
> > role does not exist pg_restore gives an error about it and then does not
> > grant any rights to all the other login/group roles that do exist. No
> errors
> > / notices are issued about the grants that are not applied.
>
> That's fairly hard to believe. Can you provide a self-contained test
> case?
>
> regards, tom lane
>
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
Attachments:
test_case.txt (text/plain, 22.8K) download
-- Summary
-- Server 1: created sample database stgsample01 with owner stgsamplelogin01
-- Server 1: the sample database has 6 tables, each table has rights assigned to group roles sample_read_role and sample_write_role
-- Server 1: used pg_dump to export the database
-- Server 2: created sample empty database stgsample02 with owner stgsamplelogin02
-- Server 2: purposly did not create the old owner stgsamplelogin01
-- Server 2: used pg_restore to restore the dump
-- Server 2: pg_restore gave an error when setting owner stgsamplelogin01 and then did not assign any rights to group roles sample_read_role and sample_write_role
-- Server 3: created sample empty database stgsample03 with owner stgsamplelogin01
-- Server 3: purposly did not create group role sample_read_role
-- Server 3: used pg_restore to restore the dump
-- Server 3: pg_restore gave an error when group role sample_read_role was not found and then did not assign any rights to group roles sample_write_role
---- On SERVER_1 ----
CREATE ROLE sample_read_role
NOSUPERUSER INHERIT NOCREATEDB NOCREATEROLE NOREPLICATION;
CREATE ROLE sample_write_role
NOSUPERUSER INHERIT NOCREATEDB NOCREATEROLE NOREPLICATION;
CREATE ROLE stgsamplelogin01 LOGIN
ENCRYPTED PASSWORD 'md5ea60c5e12ef0bd0e1344eb53e0078a67'
NOSUPERUSER INHERIT NOCREATEDB NOCREATEROLE NOREPLICATION;
GRANT sample_write_role TO stgsamplelogin01;
CREATE DATABASE stgsample01
WITH OWNER = stgsamplelogin01
TEMPLATE=TEMPLATE0
ENCODING = 'SQL_ASCII'
TABLESPACE = pg_default
LC_COLLATE = 'en_US.UTF-8'
LC_CTYPE = 'en_US.UTF-8'
CONNECTION LIMIT = 20;
psql stgsample01 < /var/lib/pgsql/data/dumps/sample_schema.sql
pg_dump -v -p 5432 -Fc -s stgsample01 > /var/lib/pgsql/data/dumps/stgsample01_schema.dump
pg_dump: reading extensions
pg_dump: identifying extension members
pg_dump: reading schemas
pg_dump: reading user-defined tables
pg_dump: reading user-defined functions
pg_dump: reading user-defined types
pg_dump: reading procedural languages
pg_dump: reading user-defined aggregate functions
pg_dump: reading user-defined operators
pg_dump: reading user-defined operator classes
pg_dump: reading user-defined operator families
pg_dump: reading user-defined text search parsers
pg_dump: reading user-defined text search templates
pg_dump: reading user-defined text search dictionaries
pg_dump: reading user-defined text search configurations
pg_dump: reading user-defined foreign-data wrappers
pg_dump: reading user-defined foreign servers
pg_dump: reading default privileges
pg_dump: reading user-defined collations
pg_dump: reading user-defined conversions
pg_dump: reading type casts
pg_dump: reading transforms
pg_dump: reading table inheritance information
pg_dump: reading event triggers
pg_dump: finding extension tables
pg_dump: finding inheritance relationships
pg_dump: reading column info for interesting tables
pg_dump: finding the columns and types of table "public.country"
pg_dump: finding the columns and types of table "public.country_alias"
pg_dump: finding the columns and types of table "public.log"
pg_dump: finding the columns and types of table "public.result"
pg_dump: finding the columns and types of table "public.tariff"
pg_dump: finding the columns and types of table "public.tariff_bk20140630"
pg_dump: flagging inherited columns in subtables
pg_dump: reading indexes
pg_dump: reading indexes for table "public.country"
pg_dump: reading indexes for table "public.country_alias"
pg_dump: reading indexes for table "public.log"
pg_dump: reading indexes for table "public.result"
pg_dump: reading indexes for table "public.tariff"
pg_dump: reading constraints
pg_dump: reading foreign key constraints for table "public.country"
pg_dump: reading foreign key constraints for table "public.country_alias"
pg_dump: reading foreign key constraints for table "public.log"
pg_dump: reading foreign key constraints for table "public.result"
pg_dump: reading foreign key constraints for table "public.tariff"
pg_dump: reading triggers
pg_dump: reading triggers for table "public.country"
pg_dump: reading triggers for table "public.country_alias"
pg_dump: reading triggers for table "public.log"
pg_dump: reading triggers for table "public.result"
pg_dump: reading triggers for table "public.tariff"
pg_dump: reading rewrite rules
pg_dump: reading policies
pg_dump: reading row security enabled for table "public.country"
pg_dump: reading policies for table "public.country"
pg_dump: reading row security enabled for table "public.country_alias"
pg_dump: reading policies for table "public.country_alias"
pg_dump: reading row security enabled for table "public.log"
pg_dump: reading policies for table "public.log"
pg_dump: reading row security enabled for table "public.result"
pg_dump: reading policies for table "public.result"
pg_dump: reading row security enabled for table "public.tariff"
pg_dump: reading policies for table "public.tariff"
pg_dump: reading row security enabled for table "public.tariff_bk20140630"
pg_dump: reading policies for table "public.tariff_bk20140630"
pg_dump: reading dependency data
pg_dump: saving encoding = SQL_ASCII
pg_dump: saving standard_conforming_strings = on
pg_dump: saving database definition
[postgres@server1 ~]$ psql
psql (9.5.1)
Type "help" for help.
postgres=# \connect stgsample01 stgsamplelogin01
You are now connected to database "stgsample01" as user "stgsamplelogin01".
stgsample01=> \dp
Access privileges
Schema | Name | Type | Access privileges | Column privileges | Policies
--------+-------------------+-------+--------------------------------------------+-------------------+----------
public | country | table | stgsamplelogin01=arwdDxt/stgsamplelogin01 +| |
| | | sample_read_role=r/stgsamplelogin01 +| |
| | | sample_write_role=arwdDxt/stgsamplelogin01 | |
public | country_alias | table | stgsamplelogin01=arwdDxt/stgsamplelogin01 +| |
| | | sample_read_role=r/stgsamplelogin01 +| |
| | | sample_write_role=arwdDxt/stgsamplelogin01 | |
public | log | table | stgsamplelogin01=arwdDxt/stgsamplelogin01 +| |
| | | sample_read_role=r/stgsamplelogin01 +| |
| | | sample_write_role=arwdDxt/stgsamplelogin01 | |
public | result | table | stgsamplelogin01=arwdDxt/stgsamplelogin01 +| |
| | | sample_read_role=r/stgsamplelogin01 +| |
| | | sample_write_role=arwdDxt/stgsamplelogin01 | |
public | tariff | table | stgsamplelogin01=arwdDxt/stgsamplelogin01 +| |
| | | sample_read_role=r/stgsamplelogin01 +| |
| | | sample_write_role=arwdDxt/stgsamplelogin01 | |
public | tariff_bk20140630 | table | | |
(6 rows)
---- On SERVER_2 ----
-- transfer dump from server 1
CREATE ROLE sample_read_role
NOSUPERUSER INHERIT NOCREATEDB NOCREATEROLE NOREPLICATION;
CREATE ROLE sample_write_role
NOSUPERUSER INHERIT NOCREATEDB NOCREATEROLE NOREPLICATION;
CREATE ROLE stgsamplelogin02 LOGIN
ENCRYPTED PASSWORD 'md5ea60c5e12ef0bd0e1344eb53e0078a67'
NOSUPERUSER INHERIT NOCREATEDB NOCREATEROLE NOREPLICATION;
GRANT sample_write_role TO stgsamplelogin02;
CREATE DATABASE stgsample02
WITH OWNER = stgsamplelogin02
TEMPLATE=TEMPLATE0
ENCODING = 'SQL_ASCII'
TABLESPACE = pg_default
LC_COLLATE = 'en_US.UTF-8'
LC_CTYPE = 'en_US.UTF-8'
CONNECTION LIMIT = 20;
[postgres@server2 ~]$ pg_restore -v -p 5432 -d stgsample02 /var/lib/pgsql/data/dumps/stgsample01_schema.dump
pg_restore: connecting to database for restore
pg_restore: creating SCHEMA "public"
pg_restore: creating COMMENT "SCHEMA public"
pg_restore: creating EXTENSION "plpgsql"
pg_restore: creating COMMENT "EXTENSION plpgsql"
pg_restore: creating FUNCTION "public.levenshtein(text, text)"
pg_restore: creating FUNCTION "public.metaphone(text, integer)"
pg_restore: creating FUNCTION "public.soundex(text)"
pg_restore: creating FUNCTION "public.text_soundex(text)"
pg_restore: creating TABLE "public.country"
pg_restore: [archiver (db)] Error while PROCESSING TOC:
pg_restore: [archiver (db)] Error from TOC entry 181; 1259 95214081 TABLE country stgsamplelogin01
pg_restore: [archiver (db)] could not execute query: ERROR: role "stgsamplelogin01" does not exist
Command was: ALTER TABLE country OWNER TO stgsamplelogin01;
pg_restore: creating TABLE "public.country_alias"
pg_restore: [archiver (db)] Error from TOC entry 182; 1259 95214087 TABLE country_alias stgsamplelogin01
pg_restore: [archiver (db)] could not execute query: ERROR: role "stgsamplelogin01" does not exist
Command was: ALTER TABLE country_alias OWNER TO stgsamplelogin01;
pg_restore: creating TABLE "public.log"
pg_restore: [archiver (db)] Error from TOC entry 183; 1259 95214093 TABLE log stgsamplelogin01
pg_restore: [archiver (db)] could not execute query: ERROR: role "stgsamplelogin01" does not exist
Command was: ALTER TABLE log OWNER TO stgsamplelogin01;
pg_restore: creating TABLE "public.result"
pg_restore: [archiver (db)] Error from TOC entry 184; 1259 95214099 TABLE result stgsamplelogin01
pg_restore: [archiver (db)] could not execute query: ERROR: role "stgsamplelogin01" does not exist
Command was: ALTER TABLE result OWNER TO stgsamplelogin01;
pg_restore: creating TABLE "public.tariff"
pg_restore: [archiver (db)] Error from TOC entry 185; 1259 95214105 TABLE tariff stgsamplelogin01
pg_restore: [archiver (db)] could not execute query: ERROR: role "stgsamplelogin01" does not exist
Command was: ALTER TABLE tariff OWNER TO stgsamplelogin01;
pg_restore: creating TABLE "public.tariff_bk20140630"
pg_restore: creating CONSTRAINT "public.country_alias_pkey"
pg_restore: creating CONSTRAINT "public.country_country_code_key"
pg_restore: creating CONSTRAINT "public.country_pkey"
pg_restore: creating CONSTRAINT "public.log_pkey"
pg_restore: creating CONSTRAINT "public.result_pkey"
pg_restore: creating CONSTRAINT "public.tariff_pkey"
pg_restore: creating FK CONSTRAINT "public.$1"
pg_restore: creating FK CONSTRAINT "public.$1"
pg_restore: creating FK CONSTRAINT "public.$1"
pg_restore: creating FK CONSTRAINT "public.$2"
pg_restore: creating FK CONSTRAINT "public.$2"
pg_restore: setting owner and privileges for DATABASE "stgsample01"
pg_restore: setting owner and privileges for SCHEMA "public"
pg_restore: setting owner and privileges for COMMENT "SCHEMA public"
pg_restore: setting owner and privileges for ACL "public"
pg_restore: setting owner and privileges for EXTENSION "plpgsql"
pg_restore: setting owner and privileges for COMMENT "EXTENSION plpgsql"
pg_restore: setting owner and privileges for FUNCTION "public.levenshtein(text, text)"
pg_restore: setting owner and privileges for FUNCTION "public.metaphone(text, integer)"
pg_restore: setting owner and privileges for FUNCTION "public.soundex(text)"
pg_restore: setting owner and privileges for FUNCTION "public.text_soundex(text)"
pg_restore: setting owner and privileges for TABLE "public.country"
pg_restore: setting owner and privileges for ACL "public.country"
pg_restore: [archiver (db)] Error from TOC entry 3067; 0 0 ACL country stgsamplelogin01
pg_restore: [archiver (db)] could not execute query: ERROR: role "stgsamplelogin01" does not exist
Command was: REVOKE ALL ON TABLE country FROM PUBLIC;
REVOKE ALL ON TABLE country FROM stgsamplelogin01;
GRANT ALL ON TABLE country TO st...
pg_restore: setting owner and privileges for TABLE "public.country_alias"
pg_restore: setting owner and privileges for ACL "public.country_alias"
pg_restore: [archiver (db)] Error from TOC entry 3068; 0 0 ACL country_alias stgsamplelogin01
pg_restore: [archiver (db)] could not execute query: ERROR: role "stgsamplelogin01" does not exist
Command was: REVOKE ALL ON TABLE country_alias FROM PUBLIC;
REVOKE ALL ON TABLE country_alias FROM stgsamplelogin01;
GRANT ALL ON TABLE c...
pg_restore: setting owner and privileges for TABLE "public.log"
pg_restore: setting owner and privileges for ACL "public.log"
pg_restore: [archiver (db)] Error from TOC entry 3069; 0 0 ACL log stgsamplelogin01
pg_restore: [archiver (db)] could not execute query: ERROR: role "stgsamplelogin01" does not exist
Command was: REVOKE ALL ON TABLE log FROM PUBLIC;
REVOKE ALL ON TABLE log FROM stgsamplelogin01;
GRANT ALL ON TABLE log TO stgsamplelogin...
pg_restore: setting owner and privileges for TABLE "public.result"
pg_restore: setting owner and privileges for ACL "public.result"
pg_restore: [archiver (db)] Error from TOC entry 3070; 0 0 ACL result stgsamplelogin01
pg_restore: [archiver (db)] could not execute query: ERROR: role "stgsamplelogin01" does not exist
Command was: REVOKE ALL ON TABLE result FROM PUBLIC;
REVOKE ALL ON TABLE result FROM stgsamplelogin01;
GRANT ALL ON TABLE result TO stgsa...
pg_restore: setting owner and privileges for TABLE "public.tariff"
pg_restore: setting owner and privileges for ACL "public.tariff"
pg_restore: [archiver (db)] Error from TOC entry 3071; 0 0 ACL tariff stgsamplelogin01
pg_restore: [archiver (db)] could not execute query: ERROR: role "stgsamplelogin01" does not exist
Command was: REVOKE ALL ON TABLE tariff FROM PUBLIC;
REVOKE ALL ON TABLE tariff FROM stgsamplelogin01;
GRANT ALL ON TABLE tariff TO stgsa...
pg_restore: setting owner and privileges for TABLE "public.tariff_bk20140630"
pg_restore: setting owner and privileges for CONSTRAINT "public.country_alias_pkey"
pg_restore: setting owner and privileges for CONSTRAINT "public.country_country_code_key"
pg_restore: setting owner and privileges for CONSTRAINT "public.country_pkey"
pg_restore: setting owner and privileges for CONSTRAINT "public.log_pkey"
pg_restore: setting owner and privileges for CONSTRAINT "public.result_pkey"
pg_restore: setting owner and privileges for CONSTRAINT "public.tariff_pkey"
pg_restore: setting owner and privileges for FK CONSTRAINT "public.$1"
pg_restore: setting owner and privileges for FK CONSTRAINT "public.$1"
pg_restore: setting owner and privileges for FK CONSTRAINT "public.$1"
pg_restore: setting owner and privileges for FK CONSTRAINT "public.$2"
pg_restore: setting owner and privileges for FK CONSTRAINT "public.$2"
WARNING: errors ignored on restore: 10
[postgres@server2 ~]$ psql
psql (9.5.1)
Type "help" for help.
postgres=# \connect stgsample02 stgsamplelogin02
You are now connected to database "stgsample02" as user "stgsamplelogin02".
stgsample02=> \dp
Access privileges
Schema | Name | Type | Access privileges | Column privileges | Policies
--------+-------------------+-------+-------------------+-------------------+----------
public | country | table | | |
public | country_alias | table | | |
public | log | table | | |
public | result | table | | |
public | tariff | table | | |
public | tariff_bk20140630 | table | | |
(6 rows)
---- On SERVER_3 ----
-- transfer dump from server 1
-- sample_read_role not created on purpose
CREATE ROLE sample_write_role
NOSUPERUSER INHERIT NOCREATEDB NOCREATEROLE NOREPLICATION;
CREATE ROLE stgsamplelogin01 LOGIN
ENCRYPTED PASSWORD 'md5ea60c5e12ef0bd0e1344eb53e0078a67'
NOSUPERUSER INHERIT NOCREATEDB NOCREATEROLE NOREPLICATION;
GRANT sample_write_role TO stgsamplelogin01;
CREATE DATABASE stgsample03
WITH OWNER = stgsamplelogin01
TEMPLATE=TEMPLATE0
ENCODING = 'SQL_ASCII'
TABLESPACE = pg_default
LC_COLLATE = 'en_US.UTF-8'
LC_CTYPE = 'en_US.UTF-8'
CONNECTION LIMIT = 20;
[postgres@server3 ~]$ pg_restore -v -p 5432 -d stgsample03 /var/lib/pgsql/data/dumps/stgsample01_schema.dump
pg_restore: connecting to database for restore
pg_restore: creating SCHEMA "public"
pg_restore: creating COMMENT "SCHEMA public"
pg_restore: creating EXTENSION "plpgsql"
pg_restore: creating COMMENT "EXTENSION plpgsql"
pg_restore: creating FUNCTION "public.levenshtein(text, text)"
pg_restore: creating FUNCTION "public.metaphone(text, integer)"
pg_restore: creating FUNCTION "public.soundex(text)"
pg_restore: creating FUNCTION "public.text_soundex(text)"
pg_restore: creating TABLE "public.country"
pg_restore: creating TABLE "public.country_alias"
pg_restore: creating TABLE "public.log"
pg_restore: creating TABLE "public.result"
pg_restore: creating TABLE "public.tariff"
pg_restore: creating TABLE "public.tariff_bk20140630"
pg_restore: creating CONSTRAINT "public.country_alias_pkey"
pg_restore: creating CONSTRAINT "public.country_country_code_key"
pg_restore: creating CONSTRAINT "public.country_pkey"
pg_restore: creating CONSTRAINT "public.log_pkey"
pg_restore: creating CONSTRAINT "public.result_pkey"
pg_restore: creating CONSTRAINT "public.tariff_pkey"
pg_restore: creating FK CONSTRAINT "public.$1"
pg_restore: creating FK CONSTRAINT "public.$1"
pg_restore: creating FK CONSTRAINT "public.$1"
pg_restore: creating FK CONSTRAINT "public.$2"
pg_restore: creating FK CONSTRAINT "public.$2"
pg_restore: setting owner and privileges for DATABASE "stgsample01"
pg_restore: setting owner and privileges for SCHEMA "public"
pg_restore: setting owner and privileges for COMMENT "SCHEMA public"
pg_restore: setting owner and privileges for ACL "public"
pg_restore: setting owner and privileges for EXTENSION "plpgsql"
pg_restore: setting owner and privileges for COMMENT "EXTENSION plpgsql"
pg_restore: setting owner and privileges for FUNCTION "public.levenshtein(text, text)"
pg_restore: setting owner and privileges for FUNCTION "public.metaphone(text, integer)"
pg_restore: setting owner and privileges for FUNCTION "public.soundex(text)"
pg_restore: setting owner and privileges for FUNCTION "public.text_soundex(text)"
pg_restore: setting owner and privileges for TABLE "public.country"
pg_restore: setting owner and privileges for ACL "public.country"
pg_restore: [archiver (db)] Error while PROCESSING TOC:
pg_restore: [archiver (db)] Error from TOC entry 3067; 0 0 ACL country stgsamplelogin01
pg_restore: [archiver (db)] could not execute query: ERROR: role "sample_read_role" does not exist
Command was: REVOKE ALL ON TABLE country FROM PUBLIC;
REVOKE ALL ON TABLE country FROM stgsamplelogin01;
GRANT ALL ON TABLE country TO st...
pg_restore: setting owner and privileges for TABLE "public.country_alias"
pg_restore: setting owner and privileges for ACL "public.country_alias"
pg_restore: [archiver (db)] Error from TOC entry 3068; 0 0 ACL country_alias stgsamplelogin01
pg_restore: [archiver (db)] could not execute query: ERROR: role "sample_read_role" does not exist
Command was: REVOKE ALL ON TABLE country_alias FROM PUBLIC;
REVOKE ALL ON TABLE country_alias FROM stgsamplelogin01;
GRANT ALL ON TABLE c...
pg_restore: setting owner and privileges for TABLE "public.log"
pg_restore: setting owner and privileges for ACL "public.log"
pg_restore: [archiver (db)] Error from TOC entry 3069; 0 0 ACL log stgsamplelogin01
pg_restore: [archiver (db)] could not execute query: ERROR: role "sample_read_role" does not exist
Command was: REVOKE ALL ON TABLE log FROM PUBLIC;
REVOKE ALL ON TABLE log FROM stgsamplelogin01;
GRANT ALL ON TABLE log TO stgsamplelogin...
pg_restore: setting owner and privileges for TABLE "public.result"
pg_restore: setting owner and privileges for ACL "public.result"
pg_restore: [archiver (db)] Error from TOC entry 3070; 0 0 ACL result stgsamplelogin01
pg_restore: [archiver (db)] could not execute query: ERROR: role "sample_read_role" does not exist
Command was: REVOKE ALL ON TABLE result FROM PUBLIC;
REVOKE ALL ON TABLE result FROM stgsamplelogin01;
GRANT ALL ON TABLE result TO stgsa...
pg_restore: setting owner and privileges for TABLE "public.tariff"
pg_restore: setting owner and privileges for ACL "public.tariff"
pg_restore: [archiver (db)] Error from TOC entry 3071; 0 0 ACL tariff stgsamplelogin01
pg_restore: [archiver (db)] could not execute query: ERROR: role "sample_read_role" does not exist
Command was: REVOKE ALL ON TABLE tariff FROM PUBLIC;
REVOKE ALL ON TABLE tariff FROM stgsamplelogin01;
GRANT ALL ON TABLE tariff TO stgsa...
pg_restore: setting owner and privileges for TABLE "public.tariff_bk20140630"
pg_restore: setting owner and privileges for CONSTRAINT "public.country_alias_pkey"
pg_restore: setting owner and privileges for CONSTRAINT "public.country_country_code_key"
pg_restore: setting owner and privileges for CONSTRAINT "public.country_pkey"
pg_restore: setting owner and privileges for CONSTRAINT "public.log_pkey"
pg_restore: setting owner and privileges for CONSTRAINT "public.result_pkey"
pg_restore: setting owner and privileges for CONSTRAINT "public.tariff_pkey"
pg_restore: setting owner and privileges for FK CONSTRAINT "public.$1"
pg_restore: setting owner and privileges for FK CONSTRAINT "public.$1"
pg_restore: setting owner and privileges for FK CONSTRAINT "public.$1"
pg_restore: setting owner and privileges for FK CONSTRAINT "public.$2"
pg_restore: setting owner and privileges for FK CONSTRAINT "public.$2"
WARNING: errors ignored on restore: 5
[postgres@tstpgdb02 ~]$ psql
psql (9.5.1)
Type "help" for help.
postgres=# \connect stgsample03 stgsamplelogin01
You are now connected to database "stgsample03" as user "stgsamplelogin01".
stgsample03=> \dp
Access privileges
Schema | Name | Type | Access privileges | Column privileges | Policies
--------+-------------------+-------+-------------------+-------------------+----------
public | country | table | | |
public | country_alias | table | | |
public | log | table | | |
public | result | table | | |
public | tariff | table | | |
public | tariff_bk20140630 | table | | |
(6 rows)
sample_schema.sql (application/x-sql, 9.3K) download
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: BUG #14009: pg_restore not restoring privilegs when one login/group role is missing
2016-03-09 15:15 BUG #14009: pg_restore not restoring privilegs when one login/group role is missing alexander@spiteri.org
2016-03-09 20:32 ` Re: BUG #14009: pg_restore not restoring privilegs when one login/group role is missing Tom Lane <tgl@sss.pgh.pa.us>
2016-03-10 09:24 ` Re: BUG #14009: pg_restore not restoring privilegs when one login/group role is missing Alexander Spiteri <alexander@spiteri.org>
@ 2016-03-10 16:24 ` Tom Lane <tgl@sss.pgh.pa.us>
2016-03-14 08:18 ` Re: BUG #14009: pg_restore not restoring privilegs when one login/group role is missing Alexander Spiteri <alexander@spiteri.org>
0 siblings, 1 reply; 8+ messages in thread
From: Tom Lane @ 2016-03-10 16:24 UTC (permalink / raw)
To: Alexander Spiteri <alexander@spiteri.org>; +Cc: pgsql-bugs
Alexander Spiteri <alexander@spiteri.org> writes:
> Please find a test case attached. I tried to put as much detail as i could.
Okay, I see what's going on. I really doubt that there is a regression
here from 8.4 though. I will bet that the difference is you used plain
text output from pg_dump back in 8.4, and now in 9.5 you are trying to
use pg_restore direct-to-database mode.
The proximate cause of the problem is that pg_dump bundles up GRANT/REVOKE
statements for any object into a single "ACL" entry in the archive file.
If you dump to SQL text this doesn't matter because it just looks like a
stream of separate statements. But if pg_restore is trying to restore
direct to database then it issues the whole text of each archive file
entry as a single PQexec() operation, which means that an error in one
statement in that string causes the rest of 'em to be skipped.
As a short-term workaround you could try restoring in this way:
pg_restore foo.dump | psql
To really fix it, I think we'd need either to expand "ACL" archive entries
into a separate entry for each target user, or to change pg_restore to
parse the entry contents into separate statements. The latter seems
messy and bug-prone. The former solution wouldn't fix the problem
for dumps from existing pg_dump versions; but on the other hand, it might
provide additional flexibility for selective restores, so I'm not sure
that it's a bad idea going forward.
regards, tom lane
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: BUG #14009: pg_restore not restoring privilegs when one login/group role is missing
2016-03-09 15:15 BUG #14009: pg_restore not restoring privilegs when one login/group role is missing alexander@spiteri.org
2016-03-09 20:32 ` Re: BUG #14009: pg_restore not restoring privilegs when one login/group role is missing Tom Lane <tgl@sss.pgh.pa.us>
2016-03-10 09:24 ` Re: BUG #14009: pg_restore not restoring privilegs when one login/group role is missing Alexander Spiteri <alexander@spiteri.org>
2016-03-10 16:24 ` Re: BUG #14009: pg_restore not restoring privilegs when one login/group role is missing Tom Lane <tgl@sss.pgh.pa.us>
@ 2016-03-14 08:18 ` Alexander Spiteri <alexander@spiteri.org>
2016-03-14 10:41 ` Re: BUG #14009: pg_restore not restoring privilegs when one login/group role is missing Alexander Spiteri <alexander@spiteri.org>
2016-03-15 02:57 ` Re: BUG #14009: pg_restore not restoring privilegs when one login/group role is missing Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 2 replies; 8+ messages in thread
From: Alexander Spiteri @ 2016-03-14 08:18 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-bugs
I tried the command as you suggested but still had the same issue.
[postgres@server4 ~]$ pg_restore -p 5432 -d stgsample04
/var/lib/pgsql/data/dumps/stgsample01_schema.dump | psql
pg_restore: [archiver (db)] Error while PROCESSING TOC:
pg_restore: [archiver (db)] Error from TOC entry 3067; 0 0 ACL country
stgsamplelogin01
pg_restore: [archiver (db)] could not execute query: ERROR: role
"sample_read_role" does not exist
Command was: REVOKE ALL ON TABLE country FROM PUBLIC;
REVOKE ALL ON TABLE country FROM stgsamplelogin01;
GRANT ALL ON TABLE country TO st...
pg_restore: [archiver (db)] Error from TOC entry 3068; 0 0 ACL
country_alias stgsamplelogin01
pg_restore: [archiver (db)] could not execute query: ERROR: role
"sample_read_role" does not exist
Command was: REVOKE ALL ON TABLE country_alias FROM PUBLIC;
REVOKE ALL ON TABLE country_alias FROM stgsamplelogin01;
GRANT ALL ON TABLE c...
pg_restore: [archiver (db)] Error from TOC entry 3069; 0 0 ACL log
stgsamplelogin01
pg_restore: [archiver (db)] could not execute query: ERROR: role
"sample_read_role" does not exist
Command was: REVOKE ALL ON TABLE log FROM PUBLIC;
REVOKE ALL ON TABLE log FROM stgsamplelogin01;
GRANT ALL ON TABLE log TO stgsamplelogin...
pg_restore: [archiver (db)] Error from TOC entry 3070; 0 0 ACL result
stgsamplelogin01
pg_restore: [archiver (db)] could not execute query: ERROR: role
"sample_read_role" does not exist
Command was: REVOKE ALL ON TABLE result FROM PUBLIC;
REVOKE ALL ON TABLE result FROM stgsamplelogin01;
GRANT ALL ON TABLE result TO stgsa...
pg_restore: [archiver (db)] Error from TOC entry 3071; 0 0 ACL tariff
stgsamplelogin01
pg_restore: [archiver (db)] could not execute query: ERROR: role
"sample_read_role" does not exist
Command was: REVOKE ALL ON TABLE tariff FROM PUBLIC;
REVOKE ALL ON TABLE tariff FROM stgsamplelogin01;
GRANT ALL ON TABLE tariff TO stgsa...
WARNING: errors ignored on restore: 5
[postgres@server4 ~]$ psql
psql (9.5.1)
Type "help" for help.
postgres=# \connect stgsample04 stgsamplelogin01
You are now connected to database "stgsample04" as user "stgsamplelogin01".
stgsample04=> \dp
Access privileges
Schema | Name | Type | Access privileges | Column privileges
| Policies
--------+-------------------+-------+-------------------+-------------------+----------
public | country | table | |
|
public | country_alias | table | |
|
public | log | table | |
|
public | result | table | |
|
public | tariff | table | |
|
public | tariff_bk20140630 | table | |
|
(6 rows)
Regards,
Alexander Spiteri
On 10 March 2016 at 17:24, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Alexander Spiteri <alexander@spiteri.org> writes:
> > Please find a test case attached. I tried to put as much detail as i
> could.
>
> Okay, I see what's going on. I really doubt that there is a regression
> here from 8.4 though. I will bet that the difference is you used plain
> text output from pg_dump back in 8.4, and now in 9.5 you are trying to
> use pg_restore direct-to-database mode.
>
> The proximate cause of the problem is that pg_dump bundles up GRANT/REVOKE
> statements for any object into a single "ACL" entry in the archive file.
> If you dump to SQL text this doesn't matter because it just looks like a
> stream of separate statements. But if pg_restore is trying to restore
> direct to database then it issues the whole text of each archive file
> entry as a single PQexec() operation, which means that an error in one
> statement in that string causes the rest of 'em to be skipped.
>
> As a short-term workaround you could try restoring in this way:
>
> pg_restore foo.dump | psql
>
> To really fix it, I think we'd need either to expand "ACL" archive entries
> into a separate entry for each target user, or to change pg_restore to
> parse the entry contents into separate statements. The latter seems
> messy and bug-prone. The former solution wouldn't fix the problem
> for dumps from existing pg_dump versions; but on the other hand, it might
> provide additional flexibility for selective restores, so I'm not sure
> that it's a bad idea going forward.
>
> regards, tom lane
>
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: BUG #14009: pg_restore not restoring privilegs when one login/group role is missing
2016-03-09 15:15 BUG #14009: pg_restore not restoring privilegs when one login/group role is missing alexander@spiteri.org
2016-03-09 20:32 ` Re: BUG #14009: pg_restore not restoring privilegs when one login/group role is missing Tom Lane <tgl@sss.pgh.pa.us>
2016-03-10 09:24 ` Re: BUG #14009: pg_restore not restoring privilegs when one login/group role is missing Alexander Spiteri <alexander@spiteri.org>
2016-03-10 16:24 ` Re: BUG #14009: pg_restore not restoring privilegs when one login/group role is missing Tom Lane <tgl@sss.pgh.pa.us>
2016-03-14 08:18 ` Re: BUG #14009: pg_restore not restoring privilegs when one login/group role is missing Alexander Spiteri <alexander@spiteri.org>
@ 2016-03-14 10:41 ` Alexander Spiteri <alexander@spiteri.org>
1 sibling, 0 replies; 8+ messages in thread
From: Alexander Spiteri @ 2016-03-14 10:41 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-bugs
Always used pg_dump and pg_restore when using v8.3.7, v8.3.23 and v8.4.5.
I never had this issue on 8.4.5 however I have a particular server running
v8.3.23 which has this exact issue. Could this behaviour be the result of
patch applied between 8.3.7 and 8.3.23 ?
Regards,
Alexander Spiteri
On 14 March 2016 at 09:18, Alexander Spiteri <alexander@spiteri.org> wrote:
> I tried the command as you suggested but still had the same issue.
>
> [postgres@server4 ~]$ pg_restore -p 5432 -d stgsample04
> /var/lib/pgsql/data/dumps/stgsample01_schema.dump | psql
>
> pg_restore: [archiver (db)] Error while PROCESSING TOC:
> pg_restore: [archiver (db)] Error from TOC entry 3067; 0 0 ACL country
> stgsamplelogin01
> pg_restore: [archiver (db)] could not execute query: ERROR: role
> "sample_read_role" does not exist
> Command was: REVOKE ALL ON TABLE country FROM PUBLIC;
> REVOKE ALL ON TABLE country FROM stgsamplelogin01;
> GRANT ALL ON TABLE country TO st...
> pg_restore: [archiver (db)] Error from TOC entry 3068; 0 0 ACL
> country_alias stgsamplelogin01
> pg_restore: [archiver (db)] could not execute query: ERROR: role
> "sample_read_role" does not exist
> Command was: REVOKE ALL ON TABLE country_alias FROM PUBLIC;
> REVOKE ALL ON TABLE country_alias FROM stgsamplelogin01;
> GRANT ALL ON TABLE c...
> pg_restore: [archiver (db)] Error from TOC entry 3069; 0 0 ACL log
> stgsamplelogin01
> pg_restore: [archiver (db)] could not execute query: ERROR: role
> "sample_read_role" does not exist
> Command was: REVOKE ALL ON TABLE log FROM PUBLIC;
> REVOKE ALL ON TABLE log FROM stgsamplelogin01;
> GRANT ALL ON TABLE log TO stgsamplelogin...
> pg_restore: [archiver (db)] Error from TOC entry 3070; 0 0 ACL result
> stgsamplelogin01
> pg_restore: [archiver (db)] could not execute query: ERROR: role
> "sample_read_role" does not exist
> Command was: REVOKE ALL ON TABLE result FROM PUBLIC;
> REVOKE ALL ON TABLE result FROM stgsamplelogin01;
> GRANT ALL ON TABLE result TO stgsa...
> pg_restore: [archiver (db)] Error from TOC entry 3071; 0 0 ACL tariff
> stgsamplelogin01
> pg_restore: [archiver (db)] could not execute query: ERROR: role
> "sample_read_role" does not exist
> Command was: REVOKE ALL ON TABLE tariff FROM PUBLIC;
> REVOKE ALL ON TABLE tariff FROM stgsamplelogin01;
> GRANT ALL ON TABLE tariff TO stgsa...
> WARNING: errors ignored on restore: 5
>
> [postgres@server4 ~]$ psql
> psql (9.5.1)
> Type "help" for help.
>
> postgres=# \connect stgsample04 stgsamplelogin01
> You are now connected to database "stgsample04" as user "stgsamplelogin01".
> stgsample04=> \dp
> Access privileges
> Schema | Name | Type | Access privileges | Column
> privileges | Policies
>
> --------+-------------------+-------+-------------------+-------------------+----------
> public | country | table |
> | |
> public | country_alias | table |
> | |
> public | log | table |
> | |
> public | result | table |
> | |
> public | tariff | table |
> | |
> public | tariff_bk20140630 | table |
> | |
> (6 rows)
>
>
> Regards,
> Alexander Spiteri
>
> On 10 March 2016 at 17:24, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
>> Alexander Spiteri <alexander@spiteri.org> writes:
>> > Please find a test case attached. I tried to put as much detail as i
>> could.
>>
>> Okay, I see what's going on. I really doubt that there is a regression
>> here from 8.4 though. I will bet that the difference is you used plain
>> text output from pg_dump back in 8.4, and now in 9.5 you are trying to
>> use pg_restore direct-to-database mode.
>>
>> The proximate cause of the problem is that pg_dump bundles up GRANT/REVOKE
>> statements for any object into a single "ACL" entry in the archive file.
>> If you dump to SQL text this doesn't matter because it just looks like a
>> stream of separate statements. But if pg_restore is trying to restore
>> direct to database then it issues the whole text of each archive file
>> entry as a single PQexec() operation, which means that an error in one
>> statement in that string causes the rest of 'em to be skipped.
>>
>> As a short-term workaround you could try restoring in this way:
>>
>> pg_restore foo.dump | psql
>>
>> To really fix it, I think we'd need either to expand "ACL" archive entries
>> into a separate entry for each target user, or to change pg_restore to
>> parse the entry contents into separate statements. The latter seems
>> messy and bug-prone. The former solution wouldn't fix the problem
>> for dumps from existing pg_dump versions; but on the other hand, it might
>> provide additional flexibility for selective restores, so I'm not sure
>> that it's a bad idea going forward.
>>
>> regards, tom lane
>>
>
>
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: BUG #14009: pg_restore not restoring privilegs when one login/group role is missing
2016-03-09 15:15 BUG #14009: pg_restore not restoring privilegs when one login/group role is missing alexander@spiteri.org
2016-03-09 20:32 ` Re: BUG #14009: pg_restore not restoring privilegs when one login/group role is missing Tom Lane <tgl@sss.pgh.pa.us>
2016-03-10 09:24 ` Re: BUG #14009: pg_restore not restoring privilegs when one login/group role is missing Alexander Spiteri <alexander@spiteri.org>
2016-03-10 16:24 ` Re: BUG #14009: pg_restore not restoring privilegs when one login/group role is missing Tom Lane <tgl@sss.pgh.pa.us>
2016-03-14 08:18 ` Re: BUG #14009: pg_restore not restoring privilegs when one login/group role is missing Alexander Spiteri <alexander@spiteri.org>
@ 2016-03-15 02:57 ` Tom Lane <tgl@sss.pgh.pa.us>
2016-03-16 07:39 ` Re: BUG #14009: pg_restore not restoring privilegs when one login/group role is missing Alexander Spiteri <alexander@spiteri.org>
1 sibling, 1 reply; 8+ messages in thread
From: Tom Lane @ 2016-03-15 02:57 UTC (permalink / raw)
To: Alexander Spiteri <alexander@spiteri.org>; +Cc: pgsql-bugs
Alexander Spiteri <alexander@spiteri.org> writes:
> I tried the command as you suggested but still had the same issue.
> [postgres@server4 ~]$ pg_restore -p 5432 -d stgsample04
> /var/lib/pgsql/data/dumps/stgsample01_schema.dump | psql
Uh, no, you need to drop the -d switch from the pg_restore call ...
(and the -p switch is useless as well)
regards, tom lane
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: BUG #14009: pg_restore not restoring privilegs when one login/group role is missing
2016-03-09 15:15 BUG #14009: pg_restore not restoring privilegs when one login/group role is missing alexander@spiteri.org
2016-03-09 20:32 ` Re: BUG #14009: pg_restore not restoring privilegs when one login/group role is missing Tom Lane <tgl@sss.pgh.pa.us>
2016-03-10 09:24 ` Re: BUG #14009: pg_restore not restoring privilegs when one login/group role is missing Alexander Spiteri <alexander@spiteri.org>
2016-03-10 16:24 ` Re: BUG #14009: pg_restore not restoring privilegs when one login/group role is missing Tom Lane <tgl@sss.pgh.pa.us>
2016-03-14 08:18 ` Re: BUG #14009: pg_restore not restoring privilegs when one login/group role is missing Alexander Spiteri <alexander@spiteri.org>
2016-03-15 02:57 ` Re: BUG #14009: pg_restore not restoring privilegs when one login/group role is missing Tom Lane <tgl@sss.pgh.pa.us>
@ 2016-03-16 07:39 ` Alexander Spiteri <alexander@spiteri.org>
0 siblings, 0 replies; 8+ messages in thread
From: Alexander Spiteri @ 2016-03-16 07:39 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-bugs
I need the -d to specify the target database, without it restore is made to
the current user which in my case was "postgres".
moving -d to psql worked fine :
pg_restore /var/lib/pgsql/data/dumps/stgsample01_schema.dump | psql -d
stgsample05
---- On SERVER_5 ----
-- transfer dump from server 1
-- sample_read_role not created on purpose
CREATE ROLE sample_write_role
NOSUPERUSER INHERIT NOCREATEDB NOCREATEROLE NOREPLICATION;
CREATE ROLE stgsamplelogin01 LOGIN
ENCRYPTED PASSWORD 'md5ea60c5e12ef0bd0e1344eb53e0078a67'
NOSUPERUSER INHERIT NOCREATEDB NOCREATEROLE NOREPLICATION;
GRANT sample_write_role TO stgsamplelogin01;
CREATE DATABASE stgsample05
WITH OWNER = stgsamplelogin01
TEMPLATE=TEMPLATE0
ENCODING = 'SQL_ASCII'
TABLESPACE = pg_default
LC_COLLATE = 'en_US.UTF-8'
LC_CTYPE = 'en_US.UTF-8'
CONNECTION LIMIT = 20;
[postgres@server5 ~]$ pg_restore
/var/lib/pgsql/data/dumps/stgsample01_schema.dump | psql -d stgsample05
SET
SET
SET
SET
SET
SET
SET
CREATE EXTENSION
COMMENT
SET
CREATE FUNCTION
ALTER FUNCTION
CREATE FUNCTION
ALTER FUNCTION
CREATE FUNCTION
ALTER FUNCTION
CREATE FUNCTION
ALTER FUNCTION
SET
SET
CREATE TABLE
ALTER TABLE
CREATE TABLE
ALTER TABLE
CREATE TABLE
ALTER TABLE
CREATE TABLE
ALTER TABLE
CREATE TABLE
ALTER TABLE
CREATE TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
REVOKE
REVOKE
GRANT
GRANT
REVOKE
REVOKE
GRANT
ERROR: role "sample_read_role" does not exist
GRANT
REVOKE
REVOKE
GRANT
ERROR: role "sample_read_role" does not exist
GRANT
REVOKE
REVOKE
GRANT
ERROR: role "sample_read_role" does not exist
GRANT
REVOKE
REVOKE
GRANT
ERROR: role "sample_read_role" does not exist
GRANT
REVOKE
REVOKE
GRANT
ERROR: role "sample_read_role" does not exist
GRANT
[postgres@server5 ~]$ psql
psql (9.5.1)
Type "help" for help.
postgres=# \connect stgsample05 stgsamplelogin01
You are now connected to database "stgsample05" as user "stgsamplelogin01".
stgsample05=> \dp
Access privileges
Schema | Name | Type | Access
privileges | Column privileges | Policies
--------+-------------------+-------+--------------------------------------------+-------------------+----------
public | country | table |
stgsamplelogin01=arwdDxt/stgsamplelogin01 +| |
| | |
sample_write_role=arwdDxt/stgsamplelogin01 | |
public | country_alias | table |
stgsamplelogin01=arwdDxt/stgsamplelogin01 +| |
| | |
sample_write_role=arwdDxt/stgsamplelogin01 | |
public | log | table |
stgsamplelogin01=arwdDxt/stgsamplelogin01 +| |
| | |
sample_write_role=arwdDxt/stgsamplelogin01 | |
public | result | table |
stgsamplelogin01=arwdDxt/stgsamplelogin01 +| |
| | |
sample_write_role=arwdDxt/stgsamplelogin01 | |
public | tariff | table |
stgsamplelogin01=arwdDxt/stgsamplelogin01 +| |
| | |
sample_write_role=arwdDxt/stgsamplelogin01 | |
public | tariff_bk20140630 | table
| | |
(6 rows)
Regards,
Alexander Spiteri
On 15 March 2016 at 03:57, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Alexander Spiteri <alexander@spiteri.org> writes:
> > I tried the command as you suggested but still had the same issue.
> > [postgres@server4 ~]$ pg_restore -p 5432 -d stgsample04
> > /var/lib/pgsql/data/dumps/stgsample01_schema.dump | psql
>
> Uh, no, you need to drop the -d switch from the pg_restore call ...
> (and the -p switch is useless as well)
>
> regards, tom lane
>
^ permalink raw reply [nested|flat] 8+ messages in thread
end of thread, other threads:[~2016-03-16 07:39 UTC | newest]
Thread overview: 8+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2016-03-09 15:15 BUG #14009: pg_restore not restoring privilegs when one login/group role is missing alexander@spiteri.org
2016-03-09 20:32 ` Tom Lane <tgl@sss.pgh.pa.us>
2016-03-10 09:24 ` Alexander Spiteri <alexander@spiteri.org>
2016-03-10 16:24 ` Tom Lane <tgl@sss.pgh.pa.us>
2016-03-14 08:18 ` Alexander Spiteri <alexander@spiteri.org>
2016-03-14 10:41 ` Alexander Spiteri <alexander@spiteri.org>
2016-03-15 02:57 ` Tom Lane <tgl@sss.pgh.pa.us>
2016-03-16 07:39 ` Alexander Spiteri <alexander@spiteri.org>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox