Commit ac7a7e32 authored by Teodor Sigaev's avatar Teodor Sigaev

Fix pg_dump support for pre-8.2 versions

Unify indnkeys/indnatts/indnkeyatts usage  for all version of query to get
index information, remove indnkeys column  from query as unused.

Author: Marina Polyakova
Noticed by: Peter Eisentraut
parent a7a73875
...@@ -6786,7 +6786,6 @@ getIndexes(Archive *fout, TableInfo tblinfo[], int numTables) ...@@ -6786,7 +6786,6 @@ getIndexes(Archive *fout, TableInfo tblinfo[], int numTables)
"pg_catalog.pg_get_indexdef(i.indexrelid) AS indexdef, " "pg_catalog.pg_get_indexdef(i.indexrelid) AS indexdef, "
"i.indnkeyatts AS indnkeyatts, " "i.indnkeyatts AS indnkeyatts, "
"i.indnatts AS indnatts, " "i.indnatts AS indnatts, "
"t.relnatts AS indnkeys, "
"i.indkey, i.indisclustered, " "i.indkey, i.indisclustered, "
"i.indisreplident, t.relpages, " "i.indisreplident, t.relpages, "
"c.contype, c.conname, " "c.contype, c.conname, "
...@@ -6824,7 +6823,6 @@ getIndexes(Archive *fout, TableInfo tblinfo[], int numTables) ...@@ -6824,7 +6823,6 @@ getIndexes(Archive *fout, TableInfo tblinfo[], int numTables)
"pg_catalog.pg_get_indexdef(i.indexrelid) AS indexdef, " "pg_catalog.pg_get_indexdef(i.indexrelid) AS indexdef, "
"i.indnatts AS indnkeyatts, " "i.indnatts AS indnkeyatts, "
"i.indnatts AS indnatts, " "i.indnatts AS indnatts, "
"t.relnatts AS indnkeys, "
"i.indkey, i.indisclustered, " "i.indkey, i.indisclustered, "
"i.indisreplident, t.relpages, " "i.indisreplident, t.relpages, "
"c.contype, c.conname, " "c.contype, c.conname, "
...@@ -6858,7 +6856,6 @@ getIndexes(Archive *fout, TableInfo tblinfo[], int numTables) ...@@ -6858,7 +6856,6 @@ getIndexes(Archive *fout, TableInfo tblinfo[], int numTables)
"pg_catalog.pg_get_indexdef(i.indexrelid) AS indexdef, " "pg_catalog.pg_get_indexdef(i.indexrelid) AS indexdef, "
"i.indnatts AS indnkeyatts, " "i.indnatts AS indnkeyatts, "
"i.indnatts AS indnatts, " "i.indnatts AS indnatts, "
"t.relnatts AS indnkeys, "
"i.indkey, i.indisclustered, " "i.indkey, i.indisclustered, "
"false AS indisreplident, t.relpages, " "false AS indisreplident, t.relpages, "
"c.contype, c.conname, " "c.contype, c.conname, "
...@@ -6888,7 +6885,6 @@ getIndexes(Archive *fout, TableInfo tblinfo[], int numTables) ...@@ -6888,7 +6885,6 @@ getIndexes(Archive *fout, TableInfo tblinfo[], int numTables)
"pg_catalog.pg_get_indexdef(i.indexrelid) AS indexdef, " "pg_catalog.pg_get_indexdef(i.indexrelid) AS indexdef, "
"i.indnatts AS indnkeyatts, " "i.indnatts AS indnkeyatts, "
"i.indnatts AS indnatts, " "i.indnatts AS indnatts, "
"t.relnatts AS indnkeys, "
"i.indkey, i.indisclustered, " "i.indkey, i.indisclustered, "
"false AS indisreplident, t.relpages, " "false AS indisreplident, t.relpages, "
"c.contype, c.conname, " "c.contype, c.conname, "
...@@ -6919,7 +6915,8 @@ getIndexes(Archive *fout, TableInfo tblinfo[], int numTables) ...@@ -6919,7 +6915,8 @@ getIndexes(Archive *fout, TableInfo tblinfo[], int numTables)
"t.relname AS indexname, " "t.relname AS indexname, "
"0 AS parentidx, " "0 AS parentidx, "
"pg_catalog.pg_get_indexdef(i.indexrelid) AS indexdef, " "pg_catalog.pg_get_indexdef(i.indexrelid) AS indexdef, "
"t.relnatts AS indnkeys, " "t.relnatts AS indnkeyatts, "
"t.relnatts AS indnatts, "
"i.indkey, i.indisclustered, " "i.indkey, i.indisclustered, "
"false AS indisreplident, t.relpages, " "false AS indisreplident, t.relpages, "
"c.contype, c.conname, " "c.contype, c.conname, "
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment