From: Ivar Zarans <iff@alcaron.ee>
To: pgsql-performance@postgresql.org
Subject: Re: Slow UPADTE, compared to INSERT
Date: Fri, 5 Dec 2003 18:47:43 +0200
Message-ID: <20031205164743.GA30510@alcaron.ee> (raw)
In-Reply-To: <200312051323.43966.dev@archonet.com>
References: <20031204185751.GA15893@alcaron.ee>
<20031205123843.GA27170@alcaron.ee>
<3FD07EEA.8030007@persistent.co.in>
<200312051323.43966.dev@archonet.com>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: iff@alcaron.ee
Subject: Re: Slow UPADTE, compared to INSERT
In-Reply-To: <20031205164743.GA30510@alcaron.ee>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox