Re: operator is not unique: integer || integer

From: Daniel Schuchardt <daniel_schuchardt(at)web(dot)de>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: operator is not unique: integer || integer
Date: 2008-05-06 08:33:37
Message-ID: fvp550$27an$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Alban Hertroys schrieb:
>> another example?:
>>
>> RAISE NOTICE "error during validation % :",
>> 'ks:"'||ks||'"@"'||loopdate||'"'; (here LoopDate is a DateTime)
>
> Ehm... What's wrong with RAISE NOTICE "error during validation
> ks:"%"@"%" :', ks, loopdate; ? (I don't quite understand the purpose
> of that colon at the end, btw).
> Allows you to format the date to your liking too, just add a
> to_char(loopdate, <format string>).
>
> I know these were just a few examples of your troubles, but so far it
> appears it's desirable to get rid of them for better code.
>
may be thats a good thing but its not possible. we have to do a major
rollout for this. we have to look through all the code.
and our next and more important project is to become .net compatible. we
have to upgrade our development enviroment because of trouble with
incompatibilities ;-)
so we have to stay on postgresql81 the next years.
if it is nice or not to work with autocasts doesnt matter, it was able
to do it so we used it for many years.

here another nice example:
(old.dbrid is INTEGER)

EXECUTE 'UPDATE '||old.rc_tablename||' SET wvod=NULL WHERE
dbrid='||old.rc_dbrid;

TIMESTAMP
f:=EXTRACT(MINUTE FROM new.bd_anf_rund-CAST('0:'||CAST(f3 AS
VARCHAR) AS TIME));

TIMESTAMP too
new.bd_anf_rund:=timestamp_to_date(new.bd_anf) || ' ' || f4+f2 ||
':' || f1*tplrund;

PS:

i pick up only some string concatanation examples because i can identify
them fast. all other things i cant see so easy.
(varcharfield=integerfield ^^)

PSPS:
don't touch a running system ;-)

Daniel.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Dave Page 2008-05-06 08:46:14 Re: Custom C function - is palloc broken?
Previous Message Daniel Schuchardt 2008-05-06 08:08:06 Re: operator is not unique: integer || integer