Thread: Dollaw sign quoting disabled

Dollaw sign quoting disabled

From
"snappingturtle"
Date:
It appears that in my installation of Postgres that dollaw sign quoting
is disabled.  For example, the following command returns an error:

 CREATE or replace FUNCTION add_em(int, int) RETURNS integer AS $$
     SELECT $1 + $2;
 $$ LANGUAGE SQL;

The error:

 psql:borman.sql:6: ERROR:  syntax error at or near "$" at character 72
 psql:borman.sql:7: ERROR:  syntax error at or near "$" at character 1

Putting something between the dollar signs (e.g. $FUNCTION$) produces
the same error. Using regular quotes works, however:

 CREATE or replace FUNCTION add_em(int, int) RETURNS integer AS '
     SELECT $1 + $2;
 ' LANGUAGE SQL;

 CREATE FUNCTION

I didn't do anything (that I know of) to disable dollar quoting.  Any
advice on how to enable dollar sign quoting?


Re: Dollaw sign quoting disabled

From
Bricklen Anderson
Date:
snappingturtle wrote:
> It appears that in my installation of Postgres that dollaw sign quoting
> is disabled.  For example, the following command returns an error:
>
<snip>
>
> I didn't do anything (that I know of) to disable dollar quoting.  Any
> advice on how to enable dollar sign quoting?

Are you on postgresql version 8+?

Re: Dollaw sign quoting disabled

From
"A. Kretschmer"
Date:
am  Wed, dem 22.11.2006, um 16:34:02 -0800 mailte snappingturtle folgendes:
> It appears that in my installation of Postgres that dollaw sign quoting
> is disabled.  For example, the following command returns an error:
>
>  CREATE or replace FUNCTION add_em(int, int) RETURNS integer AS $$
>      SELECT $1 + $2;
>  $$ LANGUAGE SQL;

It works for me without any errors, but are you sure that you have at
least version 8.0? The dollar-quoting - feature will only work with 8.x
and higher.

Andreas
--
Andreas Kretschmer
Kontakt:  Heynitz: 035242/47215,   D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID:   0x3FFF606C, privat 0x7F4584DA   http://wwwkeys.de.pgp.net

Re: Dollaw sign quoting disabled

From
"Miko O'Sullivan"
Date:
No, I realized afterwards that I had mistakenly installed a 7.x
version of PG.  I had hoped that cancelling my post to Google groups
would eradicate it, but alas, posting to the net is like throwing
feathers to the wind.

Sorry for the distraction.

Miko

On 11/24/06, Bricklen Anderson <banderson@presinet.com> wrote:
> snappingturtle wrote:
> > It appears that in my installation of Postgres that dollaw sign quoting
> > is disabled.  For example, the following command returns an error:
> >
> <snip>
> >
> > I didn't do anything (that I know of) to disable dollar quoting.  Any
> > advice on how to enable dollar sign quoting?
>
> Are you on postgresql version 8+?
>