Command pg_restore does not import / restore any data, printing "depends on"
0
votes
1
answer
116
views
A database
origin
was dumped in postgres _"custom"_ format using: pg_dump -d origin --data-only -Fc > file.dump
.
The dump was then used to restore all data in a **different database with the same table names**, as in the origin
db. Command: pg_restore -l -d target --verbose -Fc file.dump
.
;
; Archive created at 2024-03-19 14:00:10 UTC
; dbname: origin
; TOC Entries: 215
; Compression: 0
; Dump Version: 1.13-0
; Format: CUSTOM
; Integer: 4 bytes
; Offset: 8 bytes
; Dumped from database version: 11.18 (Ubuntu 11.18-1.pgdg18.04+1)
; Dumped by pg_dump version: 11.18 (Ubuntu 11.18-1.pgdg18.04+1)
;
;
; Selected TOC Entries:
;
5357; 0 0 ENCODING - ENCODING
5358; 0 0 STDSTRINGS - STDSTRINGS
5359; 0 0 SEARCHPATH - SEARCHPATH
5360; 1262 16387 DATABASE - origin userA
5361; 0 0 DATABASE PROPERTIES - origin userA
; depends on: 5360
5145; 0 730750 TABLE DATA subpartitions backends_y2024w03 userA
; depends on: 237
5166; 0 738268 TABLE DATA subpartitions backends_y2024w04 userA
; depends on: 258
5189; 0 745798 TABLE DATA subpartitions backends_y2024w05 userA
; depends on: 281
.........
- **Problem:** Nothing was restored. As shown it seems like the _"custom"_ backup dump has some depends on: xxx
remarks encoded inside, which do not exist in the target database. Converting the dump to a plain SQL file, only containing commands like COPY subpartitions.backends_y2024w03 ("time", dbname, data, tag_data) FROM stdin;
, imported all data **without any issues**.
**Question:** How are depends on: xxx
missing entities detected, to what does xxx
refer to when restoring a _"custom"_ backup file and how to disable those checks? (as all real dependencies existed in the example)
Asked by FireEmerald
(101 rep)
Mar 21, 2024, 01:20 PM
Last activity: May 2, 2024, 09:22 AM
Last activity: May 2, 2024, 09:22 AM