pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: P <user2037@live.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: Quirks in Sorting Pg_description
Date: Wed, 03 Mar 2010 10:13:49 -0500
Message-ID: <24383.1267629229@sss.pgh.pa.us> (raw)
In-Reply-To: <BLU0-SMTP6181655A9EC3DB104B4AFFB43A0@phx.gbl>
References: <BLU0-SMTP6181655A9EC3DB104B4AFFB43A0@phx.gbl>

P <user2037@live.com> writes:
> The following query works from Psql's prompt but not from Psql's "-c" 
> command or from PHP's PDO interface.

> SELECT description FROM pg_catalog.pg_description WHERE description 
> SIMILAR TO '\d+' ORDER BY description::integer DESC LIMIT 1;

1. I think you'll find that "SIMILAR TO '\d+'" doesn't do what you
think; or at least, if it does, that's an implementation artifact
not to be relied on.  Use a POSIX regex operator instead.

2. Perhaps the context sensitivity of the behavior is explained by the
shell or PHP eating the backslash?  It certainly seems like you're at
risk for different numbers of levels of backslash processing in these
cases.

			regards, tom lane



view thread (2+ messages)

Message-ID: <24383.1267629229@sss.pgh.pa.us>
Permalink:  ../24383.1267629229@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/24383.1267629229@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: tgl@sss.pgh.pa.us, user2037@live.com
  Subject: Re: Quirks in Sorting Pg_description
  In-Reply-To: <24383.1267629229@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox