Search Postgresql Archives

Re: operator is not unique: integer || integer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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:%@%', ks, loopdate;
  return 1;
end;
$$ language plpgsql;

postgres=# select atest();
NOTICE:  blah ks:3@2008-05-06 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: kgore4@xxxxxxxxxx



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux