Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bJMd9-0005mo-OU for pgsql-hackers@arkaria.postgresql.org; Sat, 02 Jul 2016 15:14:51 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bJMd9-0006DF-2R for pgsql-hackers@arkaria.postgresql.org; Sat, 02 Jul 2016 15:14:51 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bJMbo-0004jE-2n for pgsql-hackers@postgresql.org; Sat, 02 Jul 2016 15:13:28 +0000 Received: from mx.huehner.biz ([52.29.210.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bJMbl-0007LQ-4I for pgsql-hackers@postgresql.org; Sat, 02 Jul 2016 15:13:26 +0000 Received: from huehner.biz (huehner.biz [52.28.21.226]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx.huehner.biz (Postfix) with ESMTPSA id B833A6058B for ; Sat, 2 Jul 2016 15:13:08 +0000 (UTC) Received: by huehner.biz (Postfix, from userid 105) id B0D056031C; Sat, 2 Jul 2016 15:11:49 +0000 (UTC) Received: by huehner.biz (Postfix, from userid 1001) id 833CF60329; Sat, 2 Jul 2016 13:10:56 +0000 (UTC) Date: Sat, 2 Jul 2016 13:10:56 +0000 From: Stefan Huehner To: pgsql-hackers@postgresql.org Subject: 9.6beta2: query failure with 'cache lookup failed for type 0' Message-ID: <20160702131056.GD3165@huehner.biz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Hello, re-testing our application Openbravo on 9.6beta2 i found the following query failing to run with ERROR: cache lookup failed for type 0 Tested on 9.6beta2 Specifically debian package version '9.6~beta2-1.pgdg+1' from apt.postgresql.org SELECT SUM(C_ORDERLINE.LINENETAMT), C_CURRENCY_SYMBOL2 (SUM(C_ORDERLINE.LINENETAMT)) FROM C_ORDER, C_ORDERLINE WHERE C_ORDER.C_ORDER_ID = C_ORDERLINE.C_ORDER_ID GROUP BY C_ORDER.DOCUMENTNO ORDER BY C_ORDER.DOCUMENTNO; Note: query is slimmed down manually which still reproduces the issue (cut down from biggger query), which explain the kind of (now)(now) useless pl-function. To reproduce in new empty database: CREATE OR REPLACE FUNCTION public.c_currency_symbol2(p_amount numeric) RETURNS character varying AS $BODY$ DECLARE BEGIN RETURN p_amount; END ; $BODY$ LANGUAGE plpgsql VOLATILE COST 100; create table c_order (c_order_id varchar(32) primary key, documentno varchar(60)); create table c_orderline (c_orderline_id varchar(32) primary key, c_order_id varchar(32), linenetamt numeric, c_currency_id varchar(32)); Deleting any more out of the query seems to no longer trigger the problem. Also changing the 'c_orderline' create table statement to not have the last column 'c_currency_id' (which is not even referenced in the query) also makes the issue no longer reproducible. Regards, Stefan -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers