Dollaw sign quoting disabled

From: "snappingturtle" <mikosullivan(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Dollaw sign quoting disabled
Date: 2006-11-23 00:34:02
Message-ID: 1164242042.629558.126570@f16g2000cwb.googlegroups.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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?

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2006-11-23 01:26:28 Re: Buffer overflow in psql
Previous Message Adrian Klaver 2006-11-23 00:30:27 Re: Data