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
This commit is contained in:
Peter Eisentraut
2026-03-17 09:46:06 +01:00
parent 233e6ae953
commit 182cdf5aea

View File

@ -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");