Re: "Pg_restore -C" is not creating a database ( Was Create database bug in 8.1.3 ? )
От | Milen Kulev |
---|---|
Тема | Re: "Pg_restore -C" is not creating a database ( Was Create database bug in 8.1.3 ? ) |
Дата | |
Msg-id | 001201c65c11$28760360$0a00a8c0@trivadis.com обсуждение исходный текст |
Ответ на | Re: "Pg_restore -C" is not creating a database ( Was Create database bug in 8.1.3 ? ) (Tom Lane <tgl@sss.pgh.pa.us>) |
Список | pgsql-general |
Great hint Tom! pg_restore -C -Fc -d template1 < tdb1b.bak Did the job. Actually if I specify any other database I am getting the same result ;) I wanted to use custom (-Fc) option to backup BLOB files. Why should I use the output of pg_restore to restore my BLOBs (if it is possible at all)? If it were the case I simply would have used the plain text backup (pg_dump -Fp and then psql)... Regards. Milen -----Original Message----- From: pgsql-general-owner@postgresql.org [mailto:pgsql-general-owner@postgresql.org] On Behalf Of Tom Lane Sent: Sunday, April 09, 2006 9:45 PM To: Milen Kulev Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] "Pg_restore -C" is not creating a database ( Was Create database bug in 8.1.3 ? ) "Milen Kulev" <makulev@gmx.net> writes: >> I am getting the commands you mention: >> pg_restore -C -Fc tdb1b.bak 1> OUT >> Less OUT: >> CREATE DATABASE testdb1 WITH TEMPLATE = template0 ENCODING = 'UTF8' >> TABLESPACE = tbs1; ALTER DATABASE testdb1 OWNER TO pg; \connect >> testdb1 ... >> , but testdb1 is NOT created ! Um ... you do realize that in this mode pg_restore just prints the SQL commands to its stdout? You're supposed to pipe them into psql if you want anything to really happen. Or you can add a -d switch (usually "-d template1" when using -C) if you want pg_restore to connect to a database server and issue the commands directly. regards, tom lane ---------------------------(end of broadcast)--------------------------- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq
В списке pgsql-general по дате отправления: