pg_dump file question - Mailing list pgsql-hackers

From Robert Partyka
Subject pg_dump file question
Date
Msg-id 5.1.0.14.0.20021008115750.009e8c00@ares.fils.us.edu.pl
Whole thread Raw
Responses Re: pg_dump file question  (Neil Conway <neilc@samurai.com>)
List pgsql-hackers
Hi,

My friend just notice me with some thing that make using dump files harder 
to use.

So here we go:
first we make some chaos :)
\c template1 postgres
create user foo with password 'bar' createdb nocreateuser;
\c template1 foo
create database foodb;
\c template1 postgres
alter user foo with nocreatedb;

then we... pg_dumpall -s (nowaday for explain we need only schemas :)

and we try to applay this pg_dumpall file.... and suprise :)

we have something like that:

\connect template1
.....
CREATE USER "foo" WITH SYSID 32 PASSWORD 'bar' NOCREATEDB NOCREATEUSER;
.....
\connect template1 "foo"
CREATE DATABASE "foodb" WITH TEMPLATE = template0 ENCODING = 'LATIN2';
\connect "foodb" "foo"

I think evryone see why it dont work.

I think that rebuild of dumping procedure to detect such a problems and 
remake dump file like that

\connect template1
.....
CREATE USER "foo" WITH SYSID 32 PASSWORD 'bar' CREATEDB NOCREATEUSER;
.....
\connect template1 "foo"
CREATE DATABASE "foodb" WITH TEMPLATE = template0 ENCODING = 'LATIN2';
\connect template1 "postgres"
ALTER USER "foo" WITH NOCREATEDB;
\connect "foodb" "foo"

will solve this problem.

regards
Robert Partyka
bobson@wdg.pl
www.WDG.pl 



pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Statistical Analysis, Vacuum, and Selectivity Restriction (PostGIS) (fwd)
Next
From: "Erwan DUROSELLE"
Date:
Subject: Rép. : Re: [HACKERS] Hot Backup