utils/spacewalk-dump-schema | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+)
New commits: commit 615f7ac0afe3718a39716961ed5cf4bf0f6371d2 Author: Milan Zazrivec mzazrivec@redhat.com Date: Tue Apr 30 16:30:19 2013 +0200
disable, enable & rebuild indexes for migrations
diff --git a/utils/spacewalk-dump-schema b/utils/spacewalk-dump-schema index b307bbd..6dde058 100755 --- a/utils/spacewalk-dump-schema +++ b/utils/spacewalk-dump-schema @@ -60,6 +60,19 @@ process_scripts($dbh, 'pre');
print <<'EOS'; \set ON_ERROR_STOP on +update pg_index + set indisvalid = false, + indisready = false +where indexrelid in ( + select pi.indexrelid + from pg_index pi, + pg_class pc, + pg_namespace pn + where pi.indexrelid = pc.oid and + pc.relnamespace = pn.oid and + pc.relkind = 'i'::"char" and + pn.nspname = current_schema() + ); EOS
my %ROWIDS = (); @@ -81,6 +94,23 @@ if (not $raw) { } }
+print <<'EOS'; +update pg_index + set indisvalid = true, + indisready = true +where indexrelid in ( + select pi.indexrelid + from pg_index pi, + pg_class pc, + pg_namespace pn + where pi.indexrelid = pc.oid and + pc.relnamespace = pn.oid and + pc.relkind = 'i'::"char" and + pn.nspname = current_schema() + ); +select pg_dblink_exec('reindex database ' || current_database() || ';'); +EOS + exit 0;
END {
spacewalk-commits@lists.fedorahosted.org