Re: operator is not unique: integer || integer - Mailing list pgsql-general

From Daniel Schuchardt
Subject Re: operator is not unique: integer || integer
Date
Msg-id fvp550$27an$1@news.hub.org
Whole thread Raw
In response to Re: operator is not unique: integer || integer  (Alban Hertroys <dalroi@solfertje.student.utwente.nl>)
List 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.

pgsql-general by date:

Previous
From: "Dave Page"
Date:
Subject: Re: Custom C function - is palloc broken?
Next
From: Daniel Schuchardt
Date:
Subject: Re: now i'm really confused. insert/update does autocast, where sometimes.