From: gab <korsani@free.fr>
To: pgsql-bugs@postgresql.org
Subject: BUG #6007: pg_restore -C -d <database> does not behave as expected when dump is done with pg_dump
Date: Thu, 5 May 2011 13:35:30 GMT
Message-ID: <201105051335.p45DZUIe006513@wwwmaster.postgresql.org> (raw)
The following bug has been logged online:
Bug reference: 6007
Logged by: gab
Email address: korsani@free.fr
PostgreSQL version: 8.4.8
Operating system: FreeBSD
Description: pg_restore -C -d <database> does not behave as expected
when dump is done with pg_dump
Details:
Create a database name 'test' and fill it :
CREATE TABLE t (
t text
);
ALTER TABLE public.t OWNER TO postgres;
--
-- Data for Name: t; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY t (t) FROM stdin;
plop
\.
Then dump it :
pg_dump -F c -f /tmp/plop test
Drop it :
psql -c 'drop database test;'
Try to restore it using :
pg_restore -C -d test /tmp/plop
pg_restore: [archiver (db)] connection to database "test" failed: FATAL:
database "test" does not exist
But the doc says that -C use the parameter of -d to CREATE the database ...
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: korsani@free.fr
Subject: Re: BUG #6007: pg_restore -C -d <database> does not behave as expected when dump is done with pg_dump
In-Reply-To: <201105051335.p45DZUIe006513@wwwmaster.postgresql.org>
References: <201105051335.p45DZUIe006513@wwwmaster.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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