Re: vacuumlo nonstandard use of \\ in a string literal - Mailing list pgsql-patches

From Tom Lane
Subject Re: vacuumlo nonstandard use of \\ in a string literal
Date
Msg-id 23179.1140714534@sss.pgh.pa.us
Whole thread Raw
In response to vacuumlo nonstandard use of \\ in a string literal  (Michael Fuhr <mike@fuhr.org>)
List 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 by date:

Previous
From: Michael Fuhr
Date:
Subject: vacuumlo nonstandard use of \\ in a string literal
Next
From: Andrew Dunstan
Date:
Subject: fix initdb -U