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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Michael Fuhr <mike(at)fuhr(dot)org>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: vacuumlo nonstandard use of \\ in a string literal
Date: 2006-02-23 17:08:54
Message-ID: 23179.1140714534@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Michael Fuhr <mike(at)fuhr(dot)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

In response to

Browse pgsql-patches by date

  From Date Subject
Next Message Andrew Dunstan 2006-02-23 17:20:25 fix initdb -U
Previous Message Tom Lane 2006-02-23 16:54:36 Re: Zeroing damaged pages