Skip site navigation (1) Skip section navigation (2)

Re: Help with quotes in plpgsql

From: "Milen A(dot) Radev" <milen(at)radev(dot)net>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: Help with quotes in plpgsql
Date: 2006-12-19 20:22:09
Message-ID: 458849F1.1050100@radev.net (view raw or flat)
Thread:
Lists: pgsql-sql
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?


-- 
Milen A. Radev


In response to

Responses

pgsql-sql by date

Next:From: Richard RayDate: 2006-12-19 21:02:22
Subject: Re: Help with quotes in plpgsql
Previous:From: Jim ButtafuocoDate: 2006-12-19 20:20:29
Subject: Re: Help with quotes in plpgsql

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group