Re: Slow UPADTE, compared to INSERT - Mailing list pgsql-performance

From Ivar Zarans
Subject Re: Slow UPADTE, compared to INSERT
Date
Msg-id 20031205164743.GA30510@alcaron.ee
Whole thread Raw
In response to Re: Slow UPADTE, compared to INSERT  (Richard Huxton <dev@archonet.com>)
Responses Re: Slow UPADTE, compared to INSERT
List 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


pgsql-performance by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: [ADMIN] Index not used. WHY?
Next
From: Ivar Zarans
Date:
Subject: Re: Slow UPADTE, compared to INSERT