Re: escape string syntax and pg_dumpall

From: Patrick Welche <prlw1(at)newn(dot)cam(dot)ac(dot)uk>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: andrew(at)supernews(dot)com, pgsql-hackers(at)postgresql(dot)org
Subject: Re: escape string syntax and pg_dumpall
Date: 2005-07-19 15:35:03
Message-ID: 20050719153503.GC915@quartz.newn.cam.ac.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Jul 18, 2005 at 03:01:31PM -0400, Tom Lane wrote:
> Andrew - Supernews <andrew+nonews(at)supernews(dot)com> writes:
> >>> "WHERE spcname NOT LIKE E'pg\\_%'");
>
> > It's not even correct as it stands - if you want to match a literal _
> > using LIKE then you would need E'pg\\\\_%' there.
>
> Good point!
>
> > Would NOT LIKE 'pg!_%' ESCAPE '!' be better?
>
> Seems like a fine solution --- I was about to object that ESCAPE
> doesn't go back as far as PG 7.0, but neither does pg_tablespace,
> so that seems OK.

The ESCAPE version which you commited works, thanks!

> Or perhaps better, use a regular regex: spcname !~ '^pg_'. The
> majority of the comparable cases in psql's describe.c do it this
> way, and they seem more readable to me ...

Likewise.. then again your fix already works..

Cheers,

Patrick

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas F. O'Connell 2005-07-19 15:43:13 bgwriter, inherited temp tables TODO items?
Previous Message Tom Lane 2005-07-19 14:03:39 Re: Patch to fix plpython on OS X