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

Re: pg_restore ignores -C when using a restore list -L

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Russell Smith <mr-russ(at)pws(dot)com(dot)au>
Cc: PostgreSQL-Bugs <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: pg_restore ignores -C when using a restore list -L
Date: 2010-05-12 17:39:24
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-bugs
Russell Smith <mr-russ(at)pws(dot)com(dot)au> writes:
> pg_restore silently ignores the inclusion of -C when you do use a
> restore list.

It would work as you expect if you use -C when creating the list file.
The reason for this is that -C basically means "don't skip the DATABASE
entry".  When you use -l without -C, you get a list file that doesn't
include the DATABASE entry.  In the last step, you need both -C and
the DATABASE entry listed in the list file in order to have the CREATE
DATABASE command emitted.

We could possibly "fix" this by emitting the DATABASE entry during -l
with or without -C.  I'm not sure if that would have any bad side
effects, but a quick test suggests that it will still skip the DATABASE
entry if it's listed in the list file but -C isn't given.  Of course,
if you manually remove the DATABASE entry from the list file, you lose

			regards, tom lane

In response to


pgsql-bugs by date

Next:From: RumkoDate: 2010-05-12 17:48:34
Subject: Bug report (#5456) not showing up on the ML
Previous:From: Tom LaneDate: 2010-05-12 15:26:49
Subject: Re: BUG #5459: Unable to cancel query while in send()

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