Skip site navigation (1) Skip section navigation (2)

Re: Privileges where not restored

From: Düster Horst <Horst(dot)Duester(at)bd(dot)so(dot)ch>
To: 'Michael Fuhr' <mike(at)fuhr(dot)org>
Cc: "'pgsql-admin(at)postgresql(dot)org'" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Privileges where not restored
Date: 2005-01-20 07:47:13
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-admin

Thank you for your response.

>Are you sure reordering was necessary?  Did you try to restore
>without reordering the objects?

Yes I tried the restore without reordering, but it doesn't work due to the
fact that pg_restore tries to restore some objects of my DB before it is
allowed to restore them. (View before Table and so on). Thus it is necessary
to reorder.
I discussed this item last autumn without a satisfactory solution. It seems
to be not possible detect the correct order of DB objects for pg_dump. 


Dr. Horst Düster 
GIS-Koordinator /Amtschef Stv.

Kanton Solothurn 
Amt für Geoinformation
Abteilung SO!GIS Koordination
Werkhofstr. 65
CH-4509 Solothurn 

Tel.: ++41 (0)32 627 25 32 
Fax: ++41 (0)32 627 22 14


-----Ursprüngliche Nachricht-----
Von: Michael Fuhr [mailto:mike(at)fuhr(dot)org]
Gesendet am: Donnerstag, 20. Januar 2005 05:07
An: Düster Horst
Cc: 'pgsql-admin(at)postgresql(dot)org'
Betreff: Re: [ADMIN] Privileges where not restored

On Wed, Jan 19, 2005 at 05:33:37PM +0100, Düster Horst wrote:

> I want to migrate a DB from PG 7.4.6 to PG 8.0.0. Thus I dumped a PG 7.4.6
> DB with the command
> pg_dump -Fc -h host -U user dbname > db.dmp   (pg_dump Version
> 8.0.0)
> after the dump I create a TOC list file with
> pg_restore -l db.dmp > db.lst                 (pg_restore Version
> (PostgreSQL) 8.0.0)
> This step is nessesary to reorder the DB objects for correct import.

Are you sure reordering was necessary?  Did you try to restore
without reordering the objects?

> After reordering the DB objects I restore the DB with 
> pg_restore  -L db.lst -v db.dmp | psql -d db

You could also specify the database as an option to pg_restore and
skip piping the output into psql, unless perhaps you have a specific
reason for using psql.

> All DB objects where restored but not their user previleges.  

Hmmm...I see the same behavior.  The following restores objects
with their original permissions:

pg_restore -d testdb db.dump

The following restores objects without their permissions:

pg_restore -l db.dump > db.list
pg_restore -d testdb -L db.list db.dump

> I did the above described steps successful with PG 7.4.6. The listfile
> created with PG 7.4.6 shows many records with the ACL keyword. These
> are missing in the PG 8.0.0 created listfile.

I see that as well; I'll mention it on pgsql-bugs.

Michael Fuhr


pgsql-admin by date

Next:From: Michael FuhrDate: 2005-01-20 08:02:01
Subject: Re: Privileges where not restored
Previous:From: Joshua D. DrakeDate: 2005-01-20 05:57:59
Subject: Re: Command prompt replication.

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group