pg.ddx.io pgsql-bugs@postgresql.org mailing list archive
help / color / mirror / Atom feedBUG #6007: pg_restore -C -d <database> does not behave as expected when dump is done with pg_dump
2+ messages / 2 participants
[nested] [flat]
* BUG #6007: pg_restore -C -d <database> does not behave as expected when dump is done with pg_dump
@ 2011-05-05 13:35 gab <korsani@free.fr>
2011-05-05 14:34 ` Re: BUG #6007: pg_restore -C -d <database> does not behave as expected when dump is done with pg_dump Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 2+ messages in thread
From: gab @ 2011-05-05 13:35 UTC (permalink / raw)
To: pgsql-bugs
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 ...
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: BUG #6007: pg_restore -C -d <database> does not behave as expected when dump is done with pg_dump
2011-05-05 13:35 BUG #6007: pg_restore -C -d <database> does not behave as expected when dump is done with pg_dump gab <korsani@free.fr>
@ 2011-05-05 14:34 ` Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 0 replies; 2+ messages in thread
From: Tom Lane @ 2011-05-05 14:34 UTC (permalink / raw)
To: gab <korsani@free.fr>; +Cc: pgsql-bugs
"gab" <korsani@free.fr> writes:
> 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 ...
Well, if the docs say that they shouldn't. When you use -C, the
database named by -d is just the one where pg_restore initially connects
to issue the CREATE DATABASE command. Please specify where you think
the documentation is telling you something else.
regards, tom lane
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2011-05-05 14:34 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2011-05-05 13:35 BUG #6007: pg_restore -C -d <database> does not behave as expected when dump is done with pg_dump gab <korsani@free.fr>
2011-05-05 14:34 ` Tom Lane <tgl@sss.pgh.pa.us>
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