pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Konstantin Knizhnik <k.knizhnik@postgrespro.ru>
To: Александр Денежкин <info@denezhkin.ru>
To: pgsql-bugs@lists.postgresql.org
Subject: Re: Postgres 10&11 data processing error
Date: Wed, 14 Aug 2019 16:05:57 +0300
Message-ID: <fbe95921-0c25-d84f-4833-ab15c99554d5@postgrespro.ru> (raw)
In-Reply-To: <CAHEfaNZpW=uQ2VZs=+NwF12V_YFf897=7b7LVwCiLjZv3T4+1A@mail.gmail.com>
References: <CAHEfaNZpW=uQ2VZs=+NwF12V_YFf897=7b7LVwCiLjZv3T4+1A@mail.gmail.com>

Hello,

On 14.08.2019 15:44, Александр Денежкин wrote:
> Hello, i guess there is the error in Postgresql 10.x and 11.x. I'm 
> using russian ERP platform 1C with Postgres for data processing and 
> storing.
>
> Postgres 10 and 11 (both Linux and Windows) logs error:
> 2019-08-14 09:05:10.758 MSK [31696] ERROR:  index key does not match 
> expected index column
>
> On query:
>
> 2019-08-14 07:40:03.417 MSK [12538] STATEMENT:  SELECT
> T1._IDRRef,
> T1._Fld745RRef,
> T1._Date_Time,
> T1._Fld740
> FROM _Document148 T1
> LEFT OUTER JOIN _Document148 T2
> ON (T1._IDRRef = T2._IDRRef) AND (T2._Fld376 = CAST(0 AS NUMERIC))
> WHERE ((T1._Fld376 = CAST(0 AS NUMERIC))) AND (((T2._Fld734RRef = 
> '\\237%\\014\\272J\\012\\005\\234B\\214\\177\\232/Ri\\350'::bytea) OR 
> (T2._Fld734RRef = 
> '\\244\\221k}F\\256\\031AML\\306!x\\376\\353\\234'::bytea)) AND 
> T1._Posted = TRUE AND (T1._Fld745RRef IN 
> ('\\274\\215\\364M0o\\375\\250\\021\\351C\\024Z(`\\236'::bytea)) AND 
> (((T1._Date_Time >= '2019-08-14 00:00:00'::timestamp) AND 
> (T1._Date_Time < '2019-09-10 23:59:00'::timestamp)) OR ((T1._Fld740 > 
> '2019-08-14 00:00:00'::timestamp) AND (T1._Fld740 <= '2019-09-10 
> 23:59:00'::timestamp))) AND (T1._Fld733RRef = 
> '\\317\\200\\364M0o\\375\\250\\021\\351<\\016\\331\\310\\247\\022'::bytea) 
> AND (T1._Fld754RRef = 
> '\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000'::bytea))
> ORDER BY (T1._Date_Time)
>
> On Postges 9.6 and earlier works fine....
>
> You can download DB dump from http://89.169.110.237/fitness1c.sql
>
> Let me know if you need any additional information
>
> Thank a lot...
>

Are you sure that you are not using PgPRO version of Postgres for 1C?
It includes self join patch where the bug with similar symptoms was 
recently fixed.

Please try to execute:

set enable_self_join_removal=off;

and repeat the query.
If such GUC assignment works then you definitely have version of 
Postgres with self join patch.
Unfortunately lack of this GUC doesn't mean that your version of 
Postgres doesn't include this optimization.
"enable_self_join_removal" is available only in PgPRO-EE but not in 
patch published at commitfest.





-- 
Konstantin Knizhnik
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company






view thread (2+ messages)

Message-ID: <fbe95921-0c25-d84f-4833-ab15c99554d5@postgrespro.ru>
Permalink:  ../fbe95921-0c25-d84f-4833-ab15c99554d5@postgrespro.ru/
Also on:    postgresql.org/message-id/fbe95921-0c25-d84f-4833-ab15c99554d5@postgrespro.ru

 · 

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-bugs@postgresql.org
  Cc: k.knizhnik@postgrespro.ru, info@denezhkin.ru
  Subject: Re: Postgres 10&11 data processing error
  In-Reply-To: <fbe95921-0c25-d84f-4833-ab15c99554d5@postgrespro.ru>
  References: <CAHEfaNZpW=uQ2VZs=+NwF12V_YFf897=7b7LVwCiLjZv3T4+1A@mail.gmail.com> <fbe95921-0c25-d84f-4833-ab15c99554d5@postgrespro.ru>

* 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