mirror of
https://github.com/postgres/postgres.git
synced 2026-10-23 13:29:09 +03:00
pg_dump: Add appropriate version check
Some code added by commit 2f094e7ac6 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:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user