Skip to content

Commit 54487d1

Browse files
committed
Fix table dump in pg_dump[all] with backends older than 9.5
The access method name "amname" can be dumped as of 3b925e9, but queries for backends older than 9.5 forgot to map it to a dummy NULL value, causing the column to not be mapped to a number. As a result, pg_dump was throwing some spurious errors in its stderr output coming from libpq: pg_dump: column number -1 is out of range 0..36 Fix this issue by adding a mapping of "amname" to NULL to all the older queries. Discussion: https://postgr.es/m/20190522083038.GA16837@paquier.xyz Author: Michael Paquier Reviewed-by: Dmitry Dolgov, Andres Freund, Tom Lane
1 parent f916221 commit 54487d1

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/bin/pg_dump/pg_dump.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6113,6 +6113,7 @@ getTables(Archive *fout, int *numTables)
61136113
"tc.relminmxid AS tminmxid, "
61146114
"c.relpersistence, c.relispopulated, "
61156115
"c.relreplident, c.relpages, "
6116+
"NULL AS amname, "
61166117
"CASE WHEN c.reloftype <> 0 THEN c.reloftype::pg_catalog.regtype ELSE NULL END AS reloftype, "
61176118
"d.refobjid AS owning_tab, "
61186119
"d.refobjsubid AS owning_col, "
@@ -6162,6 +6163,7 @@ getTables(Archive *fout, int *numTables)
61626163
"tc.relminmxid AS tminmxid, "
61636164
"c.relpersistence, c.relispopulated, "
61646165
"c.relreplident, c.relpages, "
6166+
"NULL AS amname, "
61656167
"CASE WHEN c.reloftype <> 0 THEN c.reloftype::pg_catalog.regtype ELSE NULL END AS reloftype, "
61666168
"d.refobjid AS owning_tab, "
61676169
"d.refobjsubid AS owning_col, "
@@ -6211,6 +6213,7 @@ getTables(Archive *fout, int *numTables)
62116213
"tc.relminmxid AS tminmxid, "
62126214
"c.relpersistence, c.relispopulated, "
62136215
"'d' AS relreplident, c.relpages, "
6216+
"NULL AS amname, "
62146217
"CASE WHEN c.reloftype <> 0 THEN c.reloftype::pg_catalog.regtype ELSE NULL END AS reloftype, "
62156218
"d.refobjid AS owning_tab, "
62166219
"d.refobjsubid AS owning_col, "
@@ -6260,6 +6263,7 @@ getTables(Archive *fout, int *numTables)
62606263
"0 AS tminmxid, "
62616264
"c.relpersistence, 't' as relispopulated, "
62626265
"'d' AS relreplident, c.relpages, "
6266+
"NULL AS amname, "
62636267
"CASE WHEN c.reloftype <> 0 THEN c.reloftype::pg_catalog.regtype ELSE NULL END AS reloftype, "
62646268
"d.refobjid AS owning_tab, "
62656269
"d.refobjsubid AS owning_col, "
@@ -6307,6 +6311,7 @@ getTables(Archive *fout, int *numTables)
63076311
"0 AS tminmxid, "
63086312
"'p' AS relpersistence, 't' as relispopulated, "
63096313
"'d' AS relreplident, c.relpages, "
6314+
"NULL AS amname, "
63106315
"CASE WHEN c.reloftype <> 0 THEN c.reloftype::pg_catalog.regtype ELSE NULL END AS reloftype, "
63116316
"d.refobjid AS owning_tab, "
63126317
"d.refobjsubid AS owning_col, "
@@ -6353,6 +6358,7 @@ getTables(Archive *fout, int *numTables)
63536358
"0 AS tminmxid, "
63546359
"'p' AS relpersistence, 't' as relispopulated, "
63556360
"'d' AS relreplident, c.relpages, "
6361+
"NULL AS amname, "
63566362
"NULL AS reloftype, "
63576363
"d.refobjid AS owning_tab, "
63586364
"d.refobjsubid AS owning_col, "
@@ -6399,6 +6405,7 @@ getTables(Archive *fout, int *numTables)
63996405
"0 AS tminmxid, "
64006406
"'p' AS relpersistence, 't' as relispopulated, "
64016407
"'d' AS relreplident, c.relpages, "
6408+
"NULL AS amname, "
64026409
"NULL AS reloftype, "
64036410
"d.refobjid AS owning_tab, "
64046411
"d.refobjsubid AS owning_col, "
@@ -6444,6 +6451,7 @@ getTables(Archive *fout, int *numTables)
64446451
"0 AS tfrozenxid, 0 AS tminmxid,"
64456452
"'p' AS relpersistence, 't' as relispopulated, "
64466453
"'d' AS relreplident, relpages, "
6454+
"NULL AS amname, "
64476455
"NULL AS reloftype, "
64486456
"d.refobjid AS owning_tab, "
64496457
"d.refobjsubid AS owning_col, "

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy