tum index tipleri, index tablespace toplu degistirme scripti
Definition Description
/* semasi public, PK mi, ve tablespace NULL olanlari gosterir */ SELECT 'ALTER INDEX IF EXISTS public."'||"indexname" ||'"'||E'\n'||' SET TABLESPACE "indexTableSpace";',tablespace FROM pg_indexes s INNER JOIN pg_stat_user_indexes u ON s."indexname" = u."indexrelname" INNER JOIN pg_index i ON i.indexrelid=u.indexrelid WHERE s.schemaname='public' AND i.indisprimary='false' AND tablespace IS NULL
/* Tum indexleri gosterir. */ SELECT 'ALTER INDEX "'||"indexname"||'" SET TABLESPACE "indexTableSpace";',tablespace FROM pg_indexes WHERE schemaname='public'
/* index pk mi uniq mi onu sorgular,, tablo buyuk ise kontrol saglasin diye tablo ismi de eklendi */ SELECT s."indexname",s.tablespace ,i.indisprimary,"relname" FROM pg_indexes s INNER JOIN pg_stat_user_indexes u ON s."indexname" = u."indexrelname" INNER JOIN pg_index i ON i.indexrelid=u.indexrelid WHERE s.schemaname='public'