On Mon, Apr 13, 2020 at 09:25:35AM +0200, Kamil Jońca wrote:
>
>I have problem with (pseudo) random backend crashes.
>They seems to happen at one query, but not every time.
>
>table:
>
>--8<---------------cut here---------------start------------->8---
>CREATE TABLE digitalocean.log (
> ts timestamp with time zone DEFAULT now() NOT NULL,
> actions jsonb NOT NULL,
> account text NOT NULL
>);
>
>ALTER TABLE ONLY digitalocean.log
> ADD CONSTRAINT log_ts_key UNIQUE (ts);
>--8<---------------cut here---------------end--------------->8---
>
>query:
>--8<---------------cut here---------------start------------->8---
>with x as (select jsonb_array_elements (actions->'actions')->'id' as id ,ts from digitalocean.log where
account='onet')select max(x.id::bigint) from x;
>--8<---------------cut here---------------end--------------->8---
>
I've tried to reproduce this, but unfortunately it does not fail for me.
Chances are this depends on data. Can you prepare a small data sample
that would trigger the issue?
regards
--
Tomas Vondra http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services