Incorrect (?) escape of the $1 - Mailing list pgsql-novice

From andrew@pillette.com
Subject Incorrect (?) escape of the $1
Date
Msg-id 200312221913.hBMJDt129684@pillette.com
Whole thread Raw
Responses Re: Incorrect (?) escape of the $1
List 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.

pgsql-novice by date:

Previous
From: "Matthew Rudolph"
Date:
Subject: INDEX and NULL
Next
From: darbinj@npd.hcltech.com
Date:
Subject: Installing PostgreSQL on Windowns 2000