pg_dump dumps view ACLs before the view - Mailing list pgsql-bugs

From pgsql-bugs@postgresql.org
Subject pg_dump dumps view ACLs before the view
Date
Msg-id 200105310001.f4V011V73603@hub.org
Whole thread Raw
List pgsql-bugs
Mark Reibert (mark.reibert@datasoft.com) reports a bug with a severity of 3
The lower the number the more severe it is.

Short Description
pg_dump dumps view ACLs before the view

Long Description
System Configuration:
  - Intel Pentium
  - Red Hat 6.2 (Linux 2.2.19)

Version [output of "select version()"]:
  PostgreSQL 7.1.2 on i686-pc-linux-gnu, compiled by GCC egcs-2.91.66

Problem Description:

For views, pg_dump dumps the ACLs before the view. This causes errors on restore since the ACLs are applied before the
viewis created. The problem does not appear to exist with tables and sequences. The example in the "Example Code"
sectionwill illustrate. The workaround is to hand edit the TOC list and place the view ACLs after the view. 


Sample Code
[mark@corsair mark]$ pg_dump -Fc wats > wats.pgdmp
[mark@corsair mark]$ pg_restore -l wats.pgdmp > wats.list
[mark@corsair mark]$ cat wats.list
;
; Archive created at Wed May 30 16:49:41 2001
;     dbname: wats
;     TOC Entries: 801
;     Compression: -1
;     Dump Version: 1.5-6
;     Format: CUSTOM
;
;
; Selected TOC Entries:
;
346; 18720 FUNCTION "plpgsql_call_handler" () postgres
347; 18721 PROCEDURAL LANGUAGE plpgsql
2; 31617 SEQUENCE moneytransaction_id_seq watsadmin
4; 31617 ACL moneytransaction_id_seq
;
; [ Entries snipped here ]
;
125; 32396 TABLE statetype watsadmin
126; 32396 ACL statetype
127; 32426 TABLE actiontype watsadmin
128; 32426 ACL actiontype
;
; [ Entries snipped here ]
;
258; 34356 ACL waterrequests_view
257; 34377 VIEW waterrequests_view watsadmin
260; 34381 ACL customeraccount_view
259; 34412 VIEW customeraccount_view watsadmin

[mark@corsair mark]$ dropdb wats
DROP DATABASE
[mark@corsair mark]$ createdb wats
CREATE DATABASE
[mark@corsair mark]$ pg_restore -Fc -L wats.list -d wats wats.pgdmp
Archiver(db): Could not execute query. Code = 7. Explanation from backend: 'ERROR:  Relation 'waterrequests_view' does
notexist 
'.


No file was uploaded with this report

pgsql-bugs by date:

Previous
From: "Maxim Maletsky"
Date:
Subject: RE: a typo in Docs, 7.1
Next
From: pgsql-bugs@postgresql.org
Date:
Subject: REVOKE ... FROM username equals REVOKE ... FROM PUBLIC