Skip to content

show-dump

show-dump command

This command provides details about all objects and data that can be restored, similar to the pg_restore -l command in PostgreSQL. It helps you inspect the contents of the dump before performing the actual restoration.

Parameters:

  • --format — format of printing. Can be text or json.

To display metadata information about a dump, use the following command:

greenmask --config=config.yml show-dump dumpID
;
; Archive created at 2023-10-30 12:52:38 UTC
; dbname: demo
; TOC Entries: 17
; Compression: -1
; Dump Version: 15.4
; Format: DIRECTORY
; Integer: 4 bytes
; Offset: 8 bytes
; Dumped from database version: 15.4
; Dumped by pg_dump version: 15.4
;
;
; Selected TOC Entries:
;
3444; 0 0 ENCODING - ENCODING
3445; 0 0 STDSTRINGS - STDSTRINGS
3446; 0 0 SEARCHPATH - SEARCHPATH
3447; 1262 24970 DATABASE - demo postgres
3448; 0 0 DATABASE PROPERTIES - demo postgres
222; 1259 24999 TABLE bookings flights postgres
223; 1259 25005 SEQUENCE bookings flights_flight_id_seq postgres
3460; 0 0 SEQUENCE OWNED BY bookings flights_flight_id_seq postgres
3281; 2604 25030 DEFAULT bookings flights flight_id postgres
3462; 0 24999 TABLE DATA bookings flights postgres
3289; 2606 25044 CONSTRAINT bookings flights flights_flight_no_scheduled_departure_key postgres
3291; 2606 25046 CONSTRAINT bookings flights flights_pkey postgres
3287; 1259 42848 INDEX bookings flights_aircraft_code_status_idx postgres
3292; 1259 42847 INDEX bookings flights_status_aircraft_code_idx postgres
3293; 2606 25058 FK CONSTRAINT bookings flights flights_aircraft_code_fkey postgres
3294; 2606 25063 FK CONSTRAINT bookings flights flights_arrival_airport_fkey postgres
3295; 2606 25068 FK CONSTRAINT bookings flights flights_departure_airport_fkey postgres

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
{
  "startedAt": "2023-10-29T20:50:19.948017+02:00", // (1)
  "completedAt": "2023-10-29T20:50:22.19333+02:00", // (2)
  "originalSize": 4053842, // (3)
  "compressedSize": 686557, // (4)
  "transformers": [ // (5)
    {
      "Schema": "bookings", // (6)
      "Name": "flights", // (7)
      "Query": "", // (8)
      "Transformers": [ // (9)
        {
          "Name": "RandomDate", // (10)
          "Params": { // (11)
            "column": "c2NoZWR1bGVkX2RlcGFydHVyZQ==",
            "max": "MjAyMy0wMS0wMiAwMDowMDowMC4wKzAz",
            "min": "MjAyMy0wMS0wMSAwMDowMDowMC4wKzAz"
          }
        }
      ],
      "ColumnsTypeOverride": null // (12)
    }
  ],
  "header": { // (13)
    "creationDate": "2023-10-29T20:50:20+02:00",
    "dbName": "demo",
    "tocEntriesCount": 15,
    "dumpVersion": "16.0 (Homebrew)",
    "format": "TAR",
    "integer": 4,
    "offset": 8,
    "dumpedFrom": "16.0 (Debian 16.0-1.pgdg120+1)",
    "dumpedBy": "16.0 (Homebrew)",
    "tocFileSize": 8090,
    "compression": 0
  },
  "entries": [ // (14)
    {
      "dumpId": 3416,
      "databaseOid": 0,
      "objectOid": 0,
      "objectType": "ENCODING",
      "schema": "",
      "name": "ENCODING",
      "owner": "",
      "section": "PreData",
      "originalSize": 0,
      "compressedSize": 0,
      "fileName": "",
      "dependencies": null
    },
    {
      "dumpId": 3417,
      "databaseOid": 0,
      "objectOid": 0,
      "objectType": "STDSTRINGS",
      "schema": "",
      "name": "STDSTRINGS",
      "owner": "",
      "section": "PreData",
      "originalSize": 0,
      "compressedSize": 0,
      "fileName": "",
      "dependencies": null
    },
    {
      "dumpId": 3418,
      "databaseOid": 0,
      "objectOid": 0,
      "objectType": "SEARCHPATH",
      "schema": "",
      "name": "SEARCHPATH",
      "owner": "",
      "section": "PreData",
      "originalSize": 0,
      "compressedSize": 0,
      "fileName": "",
      "dependencies": null
    },
    {
      "dumpId": 3419,
      "databaseOid": 16384,
      "objectOid": 1262,
      "objectType": "DATABASE",
      "schema": "",
      "name": "demo",
      "owner": "postgres",
      "section": "PreData",
      "originalSize": 0,
      "compressedSize": 0,
      "fileName": "",
      "dependencies": null
    },
    {
      "dumpId": 3420,
      "databaseOid": 0,
      "objectOid": 0,
      "objectType": "DATABASE PROPERTIES",
      "schema": "",
      "name": "demo",
      "owner": "postgres",
      "section": "PreData",
      "originalSize": 0,
      "compressedSize": 0,
      "fileName": "",
      "dependencies": null
    },
    {
      "dumpId": 222,
      "databaseOid": 16414,
      "objectOid": 1259,
      "objectType": "TABLE",
      "schema": "bookings",
      "name": "flights",
      "owner": "postgres",
      "section": "PreData",
      "originalSize": 0,
      "compressedSize": 0,
      "fileName": "",
      "dependencies": null
    },
    {
      "dumpId": 223,
      "databaseOid": 16420,
      "objectOid": 1259,
      "objectType": "SEQUENCE",
      "schema": "bookings",
      "name": "flights_flight_id_seq",
      "owner": "postgres",
      "section": "PreData",
      "originalSize": 0,
      "compressedSize": 0,
      "fileName": "",
      "dependencies": [
        222
      ]
    },
    {
      "dumpId": 3432,
      "databaseOid": 0,
      "objectOid": 0,
      "objectType": "SEQUENCE OWNED BY",
      "schema": "bookings",
      "name": "flights_flight_id_seq",
      "owner": "postgres",
      "section": "PreData",
      "originalSize": 0,
      "compressedSize": 0,
      "fileName": "",
      "dependencies": [
        223
      ]
    },
    {
      "dumpId": 3254,
      "databaseOid": 16445,
      "objectOid": 2604,
      "objectType": "DEFAULT",
      "schema": "bookings",
      "name": "flights flight_id",
      "owner": "postgres",
      "section": "PreData",
      "originalSize": 0,
      "compressedSize": 0,
      "fileName": "",
      "dependencies": [
        223,
        222
      ]
    },
    {
      "dumpId": 3434,
      "databaseOid": 16414,
      "objectOid": 0,
      "objectType": "TABLE DATA",
      "schema": "\"bookings\"",
      "name": "\"flights\"",
      "owner": "\"postgres\"",
      "section": "Data",
      "originalSize": 4045752,
      "compressedSize": 678467,
      "fileName": "3434.dat.gz",
      "dependencies": []
    },
    {
      "dumpId": 3261,
      "databaseOid": 16461,
      "objectOid": 2606,
      "objectType": "CONSTRAINT",
      "schema": "bookings",
      "name": "flights flights_flight_no_scheduled_departure_key",
      "owner": "postgres",
      "section": "PostData",
      "originalSize": 0,
      "compressedSize": 0,
      "fileName": "",
      "dependencies": [
        222,
        222
      ]
    },
    {
      "dumpId": 3263,
      "databaseOid": 16463,
      "objectOid": 2606,
      "objectType": "CONSTRAINT",
      "schema": "bookings",
      "name": "flights flights_pkey",
      "owner": "postgres",
      "section": "PostData",
      "originalSize": 0,
      "compressedSize": 0,
      "fileName": "",
      "dependencies": [
        222
      ]
    },
    {
      "dumpId": 3264,
      "databaseOid": 16477,
      "objectOid": 2606,
      "objectType": "FK CONSTRAINT",
      "schema": "bookings",
      "name": "flights flights_aircraft_code_fkey",
      "owner": "postgres",
      "section": "PostData",
      "originalSize": 0,
      "compressedSize": 0,
      "fileName": "",
      "dependencies": [
        222
      ]
    },
    {
      "dumpId": 3265,
      "databaseOid": 16482,
      "objectOid": 2606,
      "objectType": "FK CONSTRAINT",
      "schema": "bookings",
      "name": "flights flights_arrival_airport_fkey",
      "owner": "postgres",
      "section": "PostData",
      "originalSize": 0,
      "compressedSize": 0,
      "fileName": "",
      "dependencies": [
        222
      ]
    },
    {
      "dumpId": 3266,
      "databaseOid": 16487,
      "objectOid": 2606,
      "objectType": "FK CONSTRAINT",
      "schema": "bookings",
      "name": "flights flights_departure_airport_fkey",
      "owner": "postgres",
      "section": "PostData",
      "originalSize": 0,
      "compressedSize": 0,
      "fileName": "",
      "dependencies": [
        222
      ]
    }
  ]
}

  1. The date when the backup has been initiated, also indicating the snapshot date.
  2. The date when the backup process was successfully completed.
  3. The original size of the backup in bytes.
  4. The size of the backup after compression in bytes.
  5. A list of tables that underwent transformation during the backup.
  6. The schema name of the table.
  7. The name of the table.
  8. Custom query override, if applicable.
  9. A list of transformers that were applied during the backup.
  10. The name of the transformer.
  11. The parameters provided for the transformer.
  12. A mapping of overridden column types.
  13. The header information in the table of contents file. This provides the same details as the --format=text output in the previous snippet.
  14. The list of restoration entries. This offers the same information as the --format=text output in the previous snippet.

Note

The json format provides more detailed information compared to the text format. The text format is primarily used for backward compatibility and for generating a restoration list that can be used with pg_restore -L listfile. On the other hand, the json format provides comprehensive metadata about the dump, including information about the applied transformers and their parameters. The json format is especially useful for detailed dump introspection.