pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Stefan Huehner <stefan@huehner.org>
To: pgsql-hackers@postgresql.org
Subject: 9.6beta2: query failure with 'cache lookup failed for type 0'
Date: Sat, 2 Jul 2016 13:10:56 +0000
Message-ID: <20160702131056.GD3165@huehner.biz> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

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



view thread (5+ messages)  latest in thread

Message-ID: <20160702131056.GD3165@huehner.biz>
Permalink:  ../20160702131056.GD3165@huehner.biz/
Also on:    postgresql.org/message-id/20160702131056.GD3165@huehner.biz

 · 

reply

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: stefan@huehner.org
  Subject: Re: 9.6beta2: query failure with 'cache lookup failed for type 0'
  In-Reply-To: <20160702131056.GD3165@huehner.biz>
  References: <20160702131056.GD3165@huehner.biz>

* 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