Re: Bug in reindexdb's error reporting

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: Bug in reindexdb's error reporting
Дата
Msg-id 20190510153323.GA4967@alvherre.pgsql
обсуждение исходный текст
Ответ на Re: Bug in reindexdb's error reporting  (Julien Rouhaud <rjuju123@gmail.com>)
Ответы Re: Bug in reindexdb's error reporting  (Julien Rouhaud <rjuju123@gmail.com>)
Список pgsql-hackers
On 2019-May-10, Julien Rouhaud wrote:

> On Fri, May 10, 2019 at 4:43 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:

> > Patch is good as far as it goes, but I wonder if it'd be smarter to
> > convert the function's "type" argument from a string to an enum,
> > and then replace the if/else chains with switches?
> 
> I've also thought about it.  I think the reason why type argument was
> kept as a string is that reindex_one_database is doing:
> 
>     appendPQExpBufferStr(&sql, type);
> 
> to avoid an extra switch to append the textual reindex type.  I don't
> have a strong opinion on whether to change that on master or not.

I did have the same thought.  It seem clear now that we should do it :-)
ISTM that the way to fix that problem is to use the proposed enum
everywhere and turn it into a string when generating the SQL command,
not before.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



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

Предыдущее
От: Julien Rouhaud
Дата:
Сообщение: Re: Bug in reindexdb's error reporting
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Why is infinite_recurse test suddenly failing?