Re: Slow UPADTE, compared to INSERT

Ivar Zarans <iff@alcaron.ee>

From: Ivar Zarans <iff@alcaron.ee>
To: pgsql-performance@postgresql.org
Date: 2003-12-05T16:47:43Z
Lists: pgsql-performance
On Fri, Dec 05, 2003 at 01:23:43PM +0000, Richard Huxton wrote:

> Better IMHO would be: "UPDATE table1 SET status = %s WHERE recid = %s::int8"

Thanks for the hint!

> unexpectedly in this scenario. The reason is that the literal number is 
> treated as int4, whereas quoted it is marked as type unknown. Unkown gets 
> cast to int8, whereas int4 gets left as-is.

This explains a lot. Thanks!
BTW, is this mentioned somewhere in PostgreSQL documentation? I can't
remember anything on this subject. Maybe i just somehow skipped it...

-- 
Ivar