Incorrect (?) escape of the $1

From: andrew(at)pillette(dot)com
To: pgsql-novice(at)postgresql(dot)org
Subject: Incorrect (?) escape of the $1
Date: 2003-12-22 19:13:55
Message-ID: 200312221913.hBMJDt129684@pillette.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Is there any magic sequence of quotes or backslashes that will get the following (simplified version) to do the obvious thing?

CREATE FUNCTION doesnt_work(integer) RETURNS date LANGUAGE SQL AS
'SELECT (date ''epoch'' + interval '' $1 day'')::date ' STRICT IMMUTABLE;

No variable interpolation is performed; the interval 1 day is always used.

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Bruce Momjian 2003-12-22 21:14:36 Re: data/index file size info
Previous Message Matt Lynch 2003-12-22 18:14:12 Re: postgres logs