Re: Bug in -c CLI option of pg_dump/pg_restore

Поиск
Список
Период
Сортировка
От Guillaume Lelarge
Тема Re: Bug in -c CLI option of pg_dump/pg_restore
Дата
Msg-id 1350397910.2054.80.camel@localhost.localdomain
обсуждение исходный текст
Ответ на Bug in -c CLI option of pg_dump/pg_restore  (Guillaume Lelarge <guillaume@lelarge.info>)
Ответы Re: Bug in -c CLI option of pg_dump/pg_restore  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
On Sat, 2012-10-13 at 16:47 +0200, Guillaume Lelarge wrote:
> Hi,
> 
> One of my colleagues, Jehan-Guillaume de Rorthais, found a weird
> behaviour of the "-c" command line option in the pg_restore tool while
> doing a training. Here is the following steps he followed:
> 
> createdb foo
> <adds a few objets in foo>
> pg_dump -Fc foo > foo.dump
> createdb bar
> pg_restore -c -d bar foo.dump
> 
> bar contains the same objects as foo (nothing unusual here), but... foo
> is no longer present. Actually, if you use the "-c" command line option,
> you get a "DROP DATABASE" statement. To me, it feels like a quite
> terrible bug.
> 
> It's quite easy to reproduce. Just create a database, and use pg_dump
> with the "-c" option:
> 
> createdb foo
> pg_dump -s -c foo | grep DATABASE
> 
> and you end up with this:
> 
> DROP DATABASE foo;
> 
> I tried from 8.3 till 9.2, and only 9.2 has this behaviour.
> 
> You'll find attached a patch that fixes this issue. Another colleague,
> Gilles Darold, tried it in every possible way, and it works. I'm not
> sure the test I added makes it a very good patch, but it fixes the bug.
> 

Any comments on this?


-- 
Guillaume
http://blog.guillaume.lelarge.info
http://www.dalibo.com




В списке pgsql-hackers по дате отправления:

Предыдущее
От: Jan Wieck
Дата:
Сообщение: Re: [RFC][PATCH] wal decoding, attempt #2 - Design Documents (really attached)
Следующее
От: Simon Riggs
Дата:
Сообщение: Re: Global Sequences