Daniel Schuchardt wrote:
Tino Wildenhain schrieb:

RETURN extract(year FROM $1)*100+extract(month FROM $1)-1;

was too clean and easy? ;))

Looks like a good oportunity to clean up your code before anything
unexpected happens :-)

Cheers
T.



LOL. Yes I don't like such easy things  :-P
> RAISE NOTICE "error during validation % :", 'ks:"'||ks||'"@"'||loopdate||'"'; (here LoopDate is a DateTime)

You know you can use more than one % in a raise and it will take care of the data types?

create function atest() returns integer as $$
declare
  ks integer;
  loopdate timestamp;
begin
  ks := 3;
  loopdate := now();
  raise notice 'blah ks:[EMAIL PROTECTED]', ks, loopdate;
  return 1;
end;
$$ language plpgsql;

postgres=# select atest();
NOTICE:  blah ks:[EMAIL PROTECTED] 09:58:55.812
atest
-------
    1
(1 row)

klint.

--
Klint Gore
Database Manager
Sheep CRC
A.G.B.U.
University of New England
Armidale NSW 2350

Ph: 02 6773 3789 Fax: 02 6773 3266
EMail: [EMAIL PROTECTED]


--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Reply via email to