From 6694912b0fdd8742e583ff2a524f32284c330711 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Wed, 12 Jul 2023 09:45:56 +0200 Subject: [PATCH v12] fixup! Add temporal PRIMARY KEY and UNIQUE constraints --- src/bin/pg_dump/pg_dump.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c index a95e1d3696..33ad34ad66 100644 --- a/src/bin/pg_dump/pg_dump.c +++ b/src/bin/pg_dump/pg_dump.c @@ -7029,16 +7029,14 @@ getIndexes(Archive *fout, TableInfo tblinfo[], int numTables) "(SELECT pg_catalog.array_agg(attstattarget ORDER BY attnum) " " FROM pg_catalog.pg_attribute " " WHERE attrelid = i.indexrelid AND " - " attstattarget >= 0) AS indstatvals, " - "c.conexclop IS NOT NULL AS withoutoverlaps, "); + " attstattarget >= 0) AS indstatvals, "); else appendPQExpBufferStr(query, "0 AS parentidx, " "i.indnatts AS indnkeyatts, " "i.indnatts AS indnatts, " "'' AS indstatcols, " - "'' AS indstatvals, " - "null AS withoutoverlaps, "); + "'' AS indstatvals, "); if (fout->remoteVersion >= 150000) appendPQExpBufferStr(query, @@ -7047,6 +7045,13 @@ getIndexes(Archive *fout, TableInfo tblinfo[], int numTables) appendPQExpBufferStr(query, "false AS indnullsnotdistinct, "); + if (fout->remoteVersion >= 170000) + appendPQExpBufferStr(query, + "c.conexclop IS NOT NULL AS withoutoverlaps "); + else + appendPQExpBufferStr(query, + "null AS withoutoverlaps "); + /* * The point of the messy-looking outer join is to find a constraint that * is related by an internal dependency link to the index. If we find one, -- 2.41.0