postgres.git / summary / log / commit / refs
commit 182cdf5aeaf7b34a288a135d66f2893dc288a24e
Author: Peter Eisentraut <peter@eisentraut.org>
Date: Tue Mar 17 08:46:06 2026 +0000
pg_dump: Add appropriate version check
Some code added by commit 2f094e7ac69 needs to be behind a version
check so that it is not run against older databases.
Author: Andrew Dunstan <andrew@dunslane.net>
Reviewed-by: Junwang Zhao <zhjwpku@gmail.com>
Discussion: https://www.postgresql.org/message-id/afe3f099-3271-4fc4-8e32-467b5309affb%40dunslane.net
src/bin/pg_dump/pg_dump.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c
index b41a3ae3db4..23af95027e6 100644
--- a/src/bin/pg_dump/pg_dump.c
+++ b/src/bin/pg_dump/pg_dump.c
@@ -20473,11 +20473,12 @@ getDependencies(Archive *fout)
* Translate dependencies of pg_propgraph_element entries into
* dependencies of their parent pg_class entry.
*/
- appendPQExpBufferStr(query, "UNION ALL\n"
- "SELECT 'pg_class'::regclass AS classid, pgepgid AS objid, refclassid, refobjid, deptype "
- "FROM pg_depend d, pg_propgraph_element pge "
- "WHERE deptype NOT IN ('p', 'e', 'i') AND "
- "classid = 'pg_propgraph_element'::regclass AND objid = pge.oid\n");
+ if (fout->remoteVersion >= 190000)
+ appendPQExpBufferStr(query, "UNION ALL\n"
+ "SELECT 'pg_class'::regclass AS classid, pgepgid AS objid, refclassid, refobjid, deptype "
+ "FROM pg_depend d, pg_propgraph_element pge "
+ "WHERE deptype NOT IN ('p', 'e', 'i') AND "
+ "classid = 'pg_propgraph_element'::regclass AND objid = pge.oid\n");
/* Sort the output for efficiency below */
appendPQExpBufferStr(query, "ORDER BY 1,2");
[parent: 233e6ae95330]