Hello,
We're using pg_dumpall (from 14.1) to dump older clusters and
restore them into a new 14.1 cluster. The dump contains some databases
together with roles etc.
Is there some easy way to restore only one database out of this dump
file?
Thanks in advance
matthias
--
Matthias Apitz, ✉ guru@unixarea.de, http://www.unixarea.de/ +49-176-38902045
Public GnuPG key: http://www.unixarea.de/key.pub
Matthias Apitz <guru@unixarea.de> writes:
> We're using pg_dumpall (from 14.1) to dump older clusters and
> restore them into a new 14.1 cluster. The dump contains some databases
> together with roles etc.
> Is there some easy way to restore only one database out of this dump
> file?
No; pg_dumpall's output is just a flat SQL script.
You might consider using "pg_dumpall -g" to get just the roles
(and tablespaces if any), and then dumping desired databases
individually with pg_dump.
If all you have is a previously-made dumpall script, you'd
have to slice it up with an editor.
regards, tom lane
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера