Re: Help with quotes in plpgsql - Mailing list pgsql-sql

From Richard Ray
Subject Re: Help with quotes in plpgsql
Date
Msg-id Pine.LNX.4.64.0612191454250.30942@rray.drdc.mstc.ms.gov
Whole thread Raw
In response to Re: Help with quotes in plpgsql  ("Milen A. Radev" <milen@radev.net>)
Responses Re: Help with quotes in plpgsql  ("Milen A. Radev" <milen@radev.net>)
List pgsql-sql
On Tue, 19 Dec 2006, Milen A. Radev wrote:

> Richard Ray ÿÿÿÿÿÿÿÿÿÿÿÿ:
>> How should this be properly quoted
>>
>> create or replace function test(integer) returns setof text as $$
>> declare
>>   a record;
>> begin
>>   select into a now() - interval '$1 day';
>>   return next a;
>>   return;
>> end
>> $$ language 'plpgsql';
>>
>> I'm not having a lot of luck
>
>
> Welcome to psql 8.2.0, the PostgreSQL interactive terminal.
>
> Type:  \copyright for distribution terms
>       \h for help with SQL commands
>       \? for help with psql commands
>       \g or terminate with semicolon to execute query
>       \q to quit
>
> milen=> create or replace function test(integer) returns setof text as $$
> milen$> declare
> milen$>   a record;
> milen$> begin
> milen$>   select into a now() - interval '$1 day';
> milen$>   return next a;
> milen$>   return;
> milen$> end
> milen$> $$ language 'plpgsql';
> CREATE FUNCTION
> milen=>
>
>
>
> No problems here. What version are you using?
>

I'm using 8.1.0 but I don't think that's the problem
I have no problem creating the function but it will only substract 1 day



>
>

pgsql-sql by date:

Previous
From: Richard Ray
Date:
Subject: Re: Help with quotes in plpgsql
Next
From: "A. Kretschmer"
Date:
Subject: Re: Help with quotes in plpgsql