Re: operator is not unique: integer || integer

From: Klint Gore <kgore4(at)une(dot)edu(dot)au>
To: Daniel Schuchardt <daniel_schuchardt(at)web(dot)de>
Cc: Tino Wildenhain <tino(at)wildenhain(dot)de>, pgsql-general(at)postgresql(dot)org
Subject: Re: operator is not unique: integer || integer
Date: 2008-05-06 00:05:18
Message-ID: 481FA0BE.6050305@une.edu.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

postgres=# select atest();
NOTICE: blah ks:3(at)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(at)une(dot)edu(dot)au

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Craig Ringer 2008-05-06 00:42:16 Re: Custom C function - is palloc broken?
Previous Message Dan "Heron" Myers 2008-05-05 22:57:08 Re: Custom C function - is palloc broken?