Re: pg_restore - cannot to restore blobs in dictionary format from older pg dumps

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема Re: pg_restore - cannot to restore blobs in dictionary format from older pg dumps
Дата
Msg-id CAFj8pRBYhuYF787bs22Tf6g8nFmFJgpz5VzSBiA_TF0P3ZChCQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: pg_restore - cannot to restore blobs in dictionary format from older pg dumps  (Pavel Stehule <pavel.stehule@gmail.com>)
Ответы Re: pg_restore - cannot to restore blobs in dictionary format from older pg dumps
Список pgsql-hackers
Hi

 
The problem is related to the commit a45c78e 

I am not sure if this is correct fix, but it fixed this issue

diff --git a/src/bin/pg_dump/pg_backup_directory.c b/src/bin/pg_dump/pg_backup_directory.c
index 21b00792a8a..16da4decbd0 100644
--- a/src/bin/pg_dump/pg_backup_directory.c
+++ b/src/bin/pg_dump/pg_backup_directory.c
@@ -415,7 +415,15 @@ _LoadLOs(ArchiveHandle *AH, TocEntry *te)
     * now there can be multiple.  We don't need to worry what version we are
     * reading though, because tctx->filename should be correct either way.
     */
-   setFilePath(AH, tocfname, tctx->filename);
+
+   /*
+    * probably there is a bug in older releases (tested in Postgres 11).
+    * The filename is not correct - instead "blobs.toc" it is NNNN.dat. 
+    */
+   if (AH->version < K_VERS_1_16)
+       setFilePath(AH, tocfname, "blobs.toc");
+   else
+       setFilePath(AH, tocfname, tctx->filename);
 
    CFH = ctx->LOsTocFH = InitDiscoverCompressFileHandle(tocfname, PG_BINARY_R);

Regards

It is a problem of PostgreSQL 11 - the pg_dump from PostgreSQL 12 sets filename correctly,
and pg_restore doesn't need patching (in this case).

Regards

Pavel

 

Pavel

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