pg_dump dumps view ACLs before the view

From: pgsql-bugs(at)postgresql(dot)org
To: pgsql-bugs(at)postgresql(dot)org
Subject: pg_dump dumps view ACLs before the view
Date: 2001-05-31 00:01:01
Message-ID: 200105310001.f4V011V73603@hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Mark Reibert (mark(dot)reibert(at)datasoft(dot)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 view is created. The problem does not appear to exist with tables and sequences. The example in the "Example Code" section will illustrate. The workaround is to hand edit the TOC list and place the view ACLs after the view.

Sample Code
[mark(at)corsair mark]$ pg_dump -Fc wats > wats.pgdmp
[mark(at)corsair mark]$ pg_restore -l wats.pgdmp > wats.list
[mark(at)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(at)corsair mark]$ dropdb wats
DROP DATABASE
[mark(at)corsair mark]$ createdb wats
CREATE DATABASE
[mark(at)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 not exist
'.

No file was uploaded with this report

Browse pgsql-bugs by date

  From Date Subject
Next Message Arcady Genkin 2001-05-31 01:08:13 psql dumps core on \d<invalid table> command (7.1.1)
Previous Message Maxim Maletsky 2001-05-30 17:24:13 RE: a typo in Docs, 7.1