pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: John Gage <jsmgage@numericable.fr>
To: Josh Kupershmidt <schmiddy@gmail.com>
Cc: pgsql-sql@postgresql.org, Robert Manning <robert.m.manning@gmail.com>
Cc: squirrel-sql-users@lists.sourceforge.net
Subject: Dollar quoted strings
Date: Wed, 24 Mar 2010 21:38:30 +0100
Message-ID: <27234E40-2601-43F2-8321-5D3ED37A21F6@numericable.fr> (raw)
In-Reply-To: <4ec1cf761003241213p26d5bccesdaf5283dda2725ca@mail.gmail.com>
References: <20100324140832.GA5864@apartia.fr>
	<cd15286d1003241138i486a4139ha66c5d57ab8a196c@mail.gmail.com>
	<4ec1cf761003241213p26d5bccesdaf5283dda2725ca@mail.gmail.com>

Thanks very much for this.  I am using 8.4.2.

This query works as you describe in pgAdmin.

I had tried it in the SquirrelSQL client, which is where it produced the

<Unknown(2,003)>

result.

Obviously, this is a SquirrelSQL problem at least in part.

What does <Unknown(2,003)> mean?

Thanks again for directing me to the doc's on dollar quoting.

John


On Mar 24, 2010, at 8:13 PM, Josh Kupershmidt wrote:

> On Wed, Mar 24, 2010 at 2:38 PM, John Gage <jsmgage@gmail.com> wrote:
>> In going through the arcana of string functions, I have come across  
>> the
>> following series of selects that contain, for me, a mysterious "$re 
>> $".
>>
>> -- return all matches from regexp
>> SELECT regexp_matches('foobarbequebaz', $re$(bar)(beque)$re$);
>
> The $re$ is just an arbitrary identifier for a dollar-quoted string
> constant. See:
>
> http://www.postgresql.org/docs/current/static/sql-syntax-lexical.html
>
> Maybe you're on an old version which doesn't support dollar-quoted  
> strings?
>
> On 8.3 for the above query, I get:
>
> SELECT regexp_matches('foobarbequebaz', $re$(bar)(beque)$re$);
> regexp_matches
> ----------------
> {bar,beque}
> (1 row)
>
> Josh




view thread (2+ messages)  latest in thread

Message-ID: <27234E40-2601-43F2-8321-5D3ED37A21F6@numericable.fr>
Permalink:  ../27234E40-2601-43F2-8321-5D3ED37A21F6@numericable.fr/
Also on:    postgresql.org/message-id/27234E40-2601-43F2-8321-5D3ED37A21F6@numericable.fr

 · 

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-sql@postgresql.org
  Cc: jsmgage@numericable.fr, schmiddy@gmail.com, robert.m.manning@gmail.com, squirrel-sql-users@lists.sourceforge.net
  Subject: Re: Dollar quoted strings
  In-Reply-To: <27234E40-2601-43F2-8321-5D3ED37A21F6@numericable.fr>

* 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