Re: escape string syntax and pg_dumpall
Andrew - Supernews <andrew+nonews@supernews.com>
From: Andrew - Supernews <andrew+nonews@supernews.com>
To: pgsql-hackers@postgresql.org
Date: 2005-07-18T18:13:16Z
Lists: 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