X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 260B0D1B43A for ; Fri, 5 Dec 2003 16:48:19 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 85689-07 for ; Fri, 5 Dec 2003 12:47:47 -0400 (AST) Received: from uhh.alcaron.ee (uhh.alcaron.ee [194.204.62.169]) by svr1.postgresql.org (Postfix) with ESMTP id 6B46FD1B46D for ; Fri, 5 Dec 2003 12:47:46 -0400 (AST) Received: from iff by uhh.alcaron.ee with local id 1ASJ7H-0007wW-00; Fri, 05 Dec 2003 18:47:43 +0200 Date: Fri, 5 Dec 2003 18:47:43 +0200 To: pgsql-performance@postgresql.org Subject: Re: Slow UPADTE, compared to INSERT Message-ID: <20031205164743.GA30510@alcaron.ee> References: <20031204185751.GA15893@alcaron.ee> <20031205123843.GA27170@alcaron.ee> <3FD07EEA.8030007@persistent.co.in> <200312051323.43966.dev@archonet.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200312051323.43966.dev@archonet.com> User-Agent: Mutt/1.3.28i From: Ivar Zarans X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200312/127 X-Sequence-Number: 4987 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