[Pgsql-ayuda] dateadd(text,int,date)

sandrigo lezcano psql@msa.com.py
Fri, 13 Jun 2003 15:42:22 +0100


----- Original Message -----
"Manuel Sugawara" Sent: Friday, June 13, 2003 5:12 PM

> > db=# SELECT DATE '2003-06-11' - INTERVAL '5 months';

> create or replace function dateadd(text,int,date) returns date as '
> declare
>   v_tmp text;
> begin
>   v_tmp := $2 || '' '' || $1;
>   return $3 + cast(v_tmp as interval);
> end;
> ' language 'plpgsql';

dbtests=# select dateadd('months',-5,'2003-11-06');
ERROR: Function dateadd("unknown", integer, "unknown") does not exist
       Unable to identify a function that satisfies the given argument types
       You may need to add explicit typecasts

dbtests=# select dateadd('months',-5,current_date);
ERROR: Function dateadd("unknown", integer, date) does not exist
       Unable to identify a function that satisfies the given argument types
       You may need to add explicit typecasts

??????...


sandrigo