Dollar quoted strings

From: John Gage <jsmgage(at)numericable(dot)fr>
To: Josh Kupershmidt <schmiddy(at)gmail(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org, Robert Manning <robert(dot)m(dot)manning(at)gmail(dot)com>, squirrel-sql-users(at)lists(dot)sourceforge(dot)net
Subject: Dollar quoted strings
Date: 2010-03-24 20:38:30
Message-ID: 27234E40-2601-43F2-8321-5D3ED37A21F6@numericable.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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(at)gmail(dot)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

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Robert Manning 2010-03-25 03:20:51 Re: Dollar quoted strings
Previous Message Josh Kupershmidt 2010-03-24 19:13:24 Re: window function to sort times series data?