Re: vacuumlo nonstandard use of \\ in a string literal

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: vacuumlo nonstandard use of \\ in a string literal
Дата
Msg-id 23179.1140714534@sss.pgh.pa.us
обсуждение исходный текст
Ответ на vacuumlo nonstandard use of \\ in a string literal  (Michael Fuhr <mike@fuhr.org>)
Список pgsql-patches
Michael Fuhr <mike@fuhr.org> writes:
> How backward compatible should vacuumlo remain?  This patch changes
> the string to E'...' but other ways would be to use dollar quotes
> or ESCAPE.

In this particular case, a far better answer is to replace

> !     strcat(buf, "      AND s.nspname NOT LIKE 'pg\\\\_%'");

with

> !     strcat(buf, "      AND s.nspname !~ '^pg_'");

which sidesteps the problem entirely and is more readable to boot.

            regards, tom lane

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

Предыдущее
От: Michael Fuhr
Дата:
Сообщение: vacuumlo nonstandard use of \\ in a string literal
Следующее
От: Andrew Dunstan
Дата:
Сообщение: fix initdb -U