Don't treate IndexStmt like AlterTable when DefineIndex is called from ProcessUtilitySlow.

Поиск
Список
Период
Сортировка
От 正华吕
Тема Don't treate IndexStmt like AlterTable when DefineIndex is called from ProcessUtilitySlow.
Дата
Msg-id CANerzActdrdFO1r4RSqK0M2d0Xtwu5t5bH=ZOoLsAQ=HhZrB=g@mail.gmail.com
обсуждение исходный текст
Ответы Re: Don't treate IndexStmt like AlterTable when DefineIndex is called from ProcessUtilitySlow.  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Hi,

  Recently read the code, I find that when calling DefineIndex
  from ProcessUtilitySlow, is_alter_table will be set true if
  this statement is came from expandTableLikeClause.

  I check the code of DefineIndex, there are only two places use
  is_alter_table:
    1. the function index_check_primary_key
    2. print a debug log on what the statement is

  For 1, since we are doing create table xxx (like yyy including
  indexes), we are sure that the check relationHasPrimaryKey in the
  function index_check_primary_key will be satisfied because we are just
  create the new table.

  For 2, I do not think it will mislead the user if we print it as
  CreateStmt.

  Based on the above, I think  we can always a false value
  for is_alter_table when DefineIndex is called from
  ProcessUtilitySlow.

   Here I attach a patch. Any ideas? 
   Thanks a lot.

Best,
Zhenghua Lyu
Вложения

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

Предыдущее
От: Bharath Rupireddy
Дата:
Сообщение: Introduce a new view for checkpointer related stats
Следующее
От: Bharath Rupireddy
Дата:
Сообщение: Re: Report checkpoint progress with pg_stat_progress_checkpoint (was: Report checkpoint progress in server logs)