Received: from maia.hub.org (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 44A69632F71 for ; Wed, 14 Apr 2010 20:11:54 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 89669-03 for ; Wed, 14 Apr 2010 23:11:37 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 74BDD632CA5 for ; Wed, 14 Apr 2010 20:11:43 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id o3ENBeUA016680; Wed, 14 Apr 2010 19:11:40 -0400 (EDT) To: Mario Splivalo cc: pgsql-sql@postgresql.org Subject: Re: Using CASE in plpgsql causes 'ERROR: cache lookup failed' In-reply-to: <4BC58F7B.4000405@megafon.hr> References: <4BC58F7B.4000405@megafon.hr> Comments: In-reply-to Mario Splivalo message dated "Wed, 14 Apr 2010 11:48:43 +0200" Date: Wed, 14 Apr 2010 19:11:39 -0400 Message-ID: <16679.1271286699@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.119 tagged_above=-10 required=5 tests=AWL=-0.209, BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201004/57 X-Sequence-Number: 33984 Mario Splivalo writes: > When I call 'service_something' function and provide nonexistent > service_id I get this error: > ERROR: cache lookup failed for type 37 Hmm. Looks like exec_eval_expr should be more careful about setting a result datatype when the expression returns no rows. NULL is NULL, but it still has a defined datatype ... regards, tom lane