Index USING in pg_dump

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Index USING in pg_dump
Дата
Msg-id 200203080451.g284pqT02419@candle.pha.pa.us
обсуждение исходный текст
Ответы Re: Index USING in pg_dump  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
The following patch supresses "USING btree" for btree indexes in
pg_dump:

    CREATE INDEX ii ON test (x);

    CREATE INDEX kkas ON test USING hash (x);

This is possible because btree is the default.  TODO item is:

    * Remove USING clause from pg_get_indexdef() if index is btree (Bruce)

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026
Index: src/backend/utils/adt/ruleutils.c
===================================================================
RCS file: /cvsroot/pgsql/src/backend/utils/adt/ruleutils.c,v
retrieving revision 1.92
diff -c -r1.92 ruleutils.c
*** src/backend/utils/adt/ruleutils.c    6 Mar 2002 19:58:26 -0000    1.92
--- src/backend/utils/adt/ruleutils.c    8 Mar 2002 04:45:51 -0000
***************
*** 395,405 ****
       * Start the index definition
       */
      initStringInfo(&buf);
!     appendStringInfo(&buf, "CREATE %sINDEX %s ON %s USING %s (",
                       idxrec->indisunique ? "UNIQUE " : "",
                       quote_identifier(NameStr(idxrelrec->relname)),
!                      quote_identifier(NameStr(indrelrec->relname)),
                       quote_identifier(NameStr(amrec->amname)));

      /*
       * Collect the indexed attributes in keybuf
--- 395,410 ----
       * Start the index definition
       */
      initStringInfo(&buf);
!     appendStringInfo(&buf, "CREATE %sINDEX %s ON %s ",
                       idxrec->indisunique ? "UNIQUE " : "",
                       quote_identifier(NameStr(idxrelrec->relname)),
!                      quote_identifier(NameStr(indrelrec->relname)));
!
!     if (strcmp(NameStr(amrec->amname), "btree") != 0)
!         appendStringInfo(&buf, "USING %s ",
                       quote_identifier(NameStr(amrec->amname)));
+
+     appendStringInfo(&buf, "(");

      /*
       * Collect the indexed attributes in keybuf

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Char selectivity
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Patch for removal of RULE bracket use