Re: escape string syntax and pg_dumpall - Mailing list pgsql-hackers

From Andrew - Supernews
Subject Re: escape string syntax and pg_dumpall
Date
Msg-id slrnddns9s.2k2r.andrew+nonews@trinity.supernews.net
Whole thread Raw
In response to escape string syntax and pg_dumpall  (Patrick Welche <prlw1@newn.cam.ac.uk>)
Responses Re: escape string syntax and pg_dumpall  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On 2005-07-18, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> That comes from v1.62 of pg_dumpall.c :
>
>>     res = executeQuery(conn, "SELECT spcname, "
>>                      "pg_catalog.pg_get_userbyid(spcowner) AS spcowner, "
>>                        "spclocation, spcacl "
>>                        "FROM pg_catalog.pg_tablespace "
>>                        "WHERE spcname NOT LIKE E'pg\\_%'");
>
> This query needs to be version-dependent, Bruce ...

It's not even correct as it stands - if you want to match a literal _
using LIKE then you would need E'pg\\\\_%' there.

Would  NOT LIKE 'pg!_%' ESCAPE '!'  be better?

-- 
Andrew, Supernews
http://www.supernews.com - individual and corporate NNTP services


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: escape string syntax and pg_dumpall
Next
From: Tom Lane
Date:
Subject: Re: escape string syntax and pg_dumpall