From: Zu-Ming Jiang <zuming.jiang@inf.ethz.ch>
To: pgsql-bugs@lists.postgresql.org
Subject: Fwd: Server closed the connection unexpectedly (memory leak)
Date: Fri, 23 Jun 2023 18:20:56 +0200
Message-ID: <bc25534f-5fdf-60db-564d-a4792146ce6e@inf.ethz.ch> (raw)
In-Reply-To: <08f7224c-2de9-0996-549a-c9e9d806fdef@inf.ethz.ch>
References: <08f7224c-2de9-0996-549a-c9e9d806fdef@inf.ethz.ch>
Sorry that the test cases is a bit large. It is difficult for me to
reduce it to the minimal, because when I removed some parts, the bug
easily disappears.
Best wishes,
Zuming Jiang
------------------------------------------------------------------------
*From:* Zu-Ming Jiang [mailto:zuming.jiang@inf.ethz.ch]
*Sent:* Friday, June 23, 2023 at 6:06 PM
*To:* pgsql-bugs@lists.postgresql.org
*Subject:* Server closed the connection unexpectedly (memory leak)
My fuzzer finds a bug in Postgres, which makes the connection closed
unexpectedly. This bug still can be reproduced even after applying the
patch for
https://www.postgresql.org/message-id/flat/b2bd02dff61af15e3526293e2771f874cf2a3be7.camel@cybertec.a...
--- Steps to reproduce the bug ---
1. /usr/local/pgsql/bin/psql -d postgres -c "drop database redb";
2. /usr/local/pgsql/bin/psql -d postgres -c "create database redb";
3. /usr/local/pgsql/bin/psql -d redb -f pg_testdb55_bk.sql;
4. /usr/local/pgsql/bin/psql -d redb -f unexpected.sql
pg_testdb55_bk.sql and unexpected.sql are attached.
--- Expected behavior ---
No error triggered.
--- Actual behavior ---
The test case makes the connection closed unexpectedly:
psql:unexpected.sql:695: server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
psql:unexpected.sql:695: error: connection to server was lost
--- Postgres version ---
Github commit: f5c446e3367527f9db1506d7c38d2f56e20950b6
Version: PostgreSQL 16beta1 on x86_64-pc-linux-gnu, compiled by gcc
(Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0, 64-bit
--- Platform information ---
Platform: Ubuntu 20.04
Kernel: Linux 5.4.0-147-generic
Attachments:pg_testdb55_bk.sql (text/plain, 13.4K) download
--
-- PostgreSQL database dump
--
-- Dumped from database version 16beta1
-- Dumped by pg_dump version 16beta1
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'SQL_ASCII';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET xmloption = content;
SET client_min_messages = warning;
SET row_security = off;
SET default_tablespace = '';
SET default_table_access_method = heap;
--
-- Name: t0; Type: TABLE; Schema: public; Owner: zuming
--
CREATE TABLE public.t0 (
vkey integer NOT NULL,
pkey integer,
c0 integer,
c1 double precision,
c2 text,
c3 timestamp without time zone
);
ALTER TABLE public.t0 OWNER TO zuming;
--
-- Name: t1; Type: TABLE; Schema: public; Owner: zuming
--
CREATE TABLE public.t1 (
vkey integer NOT NULL,
pkey integer,
c4 text,
c5 integer
);
ALTER TABLE public.t1 OWNER TO zuming;
--
-- Name: t2; Type: TABLE; Schema: public; Owner: zuming
--
CREATE TABLE public.t2 (
vkey integer,
pkey integer,
c6 double precision
);
ALTER TABLE public.t2 OWNER TO zuming;
--
-- Name: t3; Type: VIEW; Schema: public; Owner: zuming
--
CREATE VIEW public.t3 AS
SELECT
CASE
WHEN (c4 !~~ '%%_'::text) THEN ( SELECT t0.c2
FROM public.t0
ORDER BY t0.c2
OFFSET 1
LIMIT 1)
ELSE c4
END AS c_0,
vkey AS c_1,
vkey AS c_2,
c4 AS c_3,
( SELECT t1.c4
FROM public.t1
ORDER BY t1.c4
OFFSET 4
LIMIT 1) AS c_4,
CASE
WHEN ((vkey >= ( SELECT t1.vkey
FROM public.t1
ORDER BY t1.vkey
OFFSET 4
LIMIT 1)) AND (vkey <= int4inc(vkey))) THEN pkey
ELSE (vkey | ( SELECT t0.vkey
FROM public.t0
ORDER BY t0.vkey
OFFSET 64
LIMIT 1))
END AS c_5,
regexp_count(c4, c4, c5, c4) AS c_6,
COALESCE(c4, c4) AS c_7,
pkey AS c_8,
dpow(var_samp(float8up(( SELECT t0.c1
FROM public.t0
ORDER BY t0.c1
OFFSET 6
LIMIT 1))) OVER (PARTITION BY c5 ORDER BY vkey DESC, pkey, c4 DESC, c5 DESC), NULL::double precision) AS c_9,
dround(cos(
CASE
WHEN (( SELECT bit_or(t1.vkey) AS bit_or
FROM public.t1) <> vkey) THEN ( SELECT t2.c6
FROM public.t2
ORDER BY t2.c6
OFFSET 43
LIMIT 1)
ELSE atanh(( SELECT t0.c1
FROM public.t0
ORDER BY t0.c1
OFFSET 51
LIMIT 1))
END)) AS c_10,
c4 AS c_11,
vkey AS c_12,
"substring"(md5(c4), pkey) AS c_13,
vkey AS c_14,
(((EXISTS ( SELECT ref_2.c2 AS c_0,
( SELECT min(t0.c3) AS min
FROM public.t0) AS c_1,
ref_2.c2 AS c_2,
ref_2.vkey AS c_3,
( SELECT t1.c4
FROM public.t1
ORDER BY t1.c4
OFFSET 3
LIMIT 1) AS c_4,
ref_2.vkey AS c_5,
( SELECT t0.c1
FROM public.t0
ORDER BY t0.c1
OFFSET 6
LIMIT 1) AS c_6,
( SELECT max(t2.vkey) AS max
FROM public.t2) AS c_7,
ref_2.vkey AS c_8
FROM public.t0 ref_2
WHERE (NULL::boolean AND true))) AND false) OR true OR (EXISTS ( SELECT DISTINCT (ref_0.c4 = ref_0.c4) AS c_0,
false AS c_1
FROM public.t2 ref_3
WHERE (true OR (NOT true))
UNION
SELECT false AS c_0,
(ref_4.c2 = ref_0.c4) AS c_1
FROM public.t0 ref_4
WHERE ((( SELECT t0.vkey
FROM public.t0
ORDER BY t0.vkey
OFFSET 5
LIMIT 1) <> ref_0.vkey) AND NULL::boolean))) OR (c4 ~>~ c4) OR (c4 ~~ 'mjo'::text)) AS c_15,
CASE
WHEN (c4 <= ( SELECT t1.c4
FROM public.t1
ORDER BY t1.c4
OFFSET 5
LIMIT 1)) THEN ((vkey >= ( SELECT t1.vkey
FROM public.t1
ORDER BY t1.vkey
OFFSET 6
LIMIT 1)) AND (vkey <= c5))
ELSE ((( SELECT t1.c4
FROM public.t1
ORDER BY t1.c4
OFFSET 4
LIMIT 1) !~~ 'L_%'::text) AND (false OR (( SELECT max(t0.c2) AS max
FROM public.t0) !~ c4)))
END AS c_16,
bit_and(pkey) OVER (PARTITION BY c5 ORDER BY vkey, pkey, c4 DESC, c5 DESC) AS c_17,
(vkey + ( SELECT t1.vkey
FROM public.t1
ORDER BY t1.vkey
OFFSET 3
LIMIT 1)) AS c_18,
( SELECT t1.pkey
FROM public.t1
ORDER BY t1.pkey
OFFSET 4
LIMIT 1) AS c_19,
pkey AS c_20,
similar_to_escape(c4, c4) AS c_21
FROM public.t1 ref_0
WHERE (bool((( SELECT max(t0.vkey) AS max
FROM public.t0) >> c5)) IN ( SELECT (NOT false) AS c_0
FROM public.t1 ref_1
WHERE ((0.0 < '-55.30'::numeric) AND NULL::boolean AND (true OR (ref_0.c5 <> ref_1.pkey)))));
ALTER VIEW public.t3 OWNER TO zuming;
--
-- Name: t4; Type: VIEW; Schema: public; Owner: zuming
--
CREATE VIEW public.t4 AS
SELECT DISTINCT stddev(ref_0.c_9) OVER (PARTITION BY ref_0.c_18, ref_2.c_20 ORDER BY ref_0.c_0 DESC, ref_0.c_1 DESC, ref_0.c_2 DESC, ref_0.c_3, ref_0.c_4, ref_0.c_5, ref_0.c_6 DESC, ref_0.c_7 DESC, ref_0.c_8, ref_0.c_9, ref_0.c_10 DESC, ref_0.c_11 DESC, ref_0.c_12 DESC, ref_0.c_13 DESC, ref_0.c_14 DESC, ref_0.c_15 DESC, ref_0.c_16, ref_0.c_17 DESC, ref_0.c_18 DESC, ref_0.c_19, ref_0.c_20 DESC, ref_0.c_21, ref_1.c_0, ref_1.c_1, ref_1.c_2 DESC, ref_1.c_3 DESC, ref_1.c_4, ref_1.c_5, ref_1.c_6, ref_1.c_7 DESC, ref_1.c_8, ref_1.c_9, ref_1.c_10 DESC, ref_1.c_11, ref_1.c_12, ref_1.c_13, ref_1.c_14 DESC, ref_1.c_15 DESC, ref_1.c_16, ref_1.c_17, ref_1.c_18 DESC, ref_1.c_19 DESC, ref_1.c_20 DESC, ref_1.c_21 DESC, ref_2.c_0 DESC, ref_2.c_1 DESC, ref_2.c_2, ref_2.c_3, ref_2.c_4 DESC, ref_2.c_5, ref_2.c_6, ref_2.c_7 DESC, ref_2.c_8, ref_2.c_9 DESC, ref_2.c_10 DESC, ref_2.c_11 DESC, ref_2.c_12 DESC, ref_2.c_13, ref_2.c_14 DESC, ref_2.c_15 DESC, ref_2.c_16 DESC, ref_2.c_17, ref_2.c_18, ref_2.c_19, ref_2.c_20, ref_2.c_21 DESC) AS c_0,
ref_0.c_8 AS c_1,
ref_0.c_3 AS c_2,
CASE
WHEN NULL::boolean THEN ( SELECT t1.c4
FROM public.t1
ORDER BY t1.c4
OFFSET 33
LIMIT 1)
ELSE "left"('O'::text, ref_1.c_5)
END AS c_3,
COALESCE(( SELECT var_pop(t0.c1) AS var_pop
FROM public.t0), ref_0.c_10) AS c_4,
(ref_1.c_18 <= ref_2.c_19) AS c_5,
acosh(min(ref_2.c_9) OVER (PARTITION BY ref_1.c_4 ORDER BY ref_0.c_0, ref_0.c_1 DESC, ref_0.c_2 DESC, ref_0.c_3 DESC, ref_0.c_4, ref_0.c_5 DESC, ref_0.c_6, ref_0.c_7 DESC, ref_0.c_8 DESC, ref_0.c_9 DESC, ref_0.c_10 DESC, ref_0.c_11 DESC, ref_0.c_12 DESC, ref_0.c_13 DESC, ref_0.c_14 DESC, ref_0.c_15, ref_0.c_16, ref_0.c_17, ref_0.c_18 DESC, ref_0.c_19 DESC, ref_0.c_20 DESC, ref_0.c_21, ref_1.c_0, ref_1.c_1 DESC, ref_1.c_2 DESC, ref_1.c_3 DESC, ref_1.c_4, ref_1.c_5, ref_1.c_6 DESC, ref_1.c_7, ref_1.c_8, ref_1.c_9, ref_1.c_10, ref_1.c_11 DESC, ref_1.c_12, ref_1.c_13, ref_1.c_14, ref_1.c_15 DESC, ref_1.c_16 DESC, ref_1.c_17 DESC, ref_1.c_18 DESC, ref_1.c_19, ref_1.c_20 DESC, ref_1.c_21, ref_2.c_0 DESC, ref_2.c_1 DESC, ref_2.c_2 DESC, ref_2.c_3 DESC, ref_2.c_4, ref_2.c_5 DESC, ref_2.c_6 DESC, ref_2.c_7, ref_2.c_8 DESC, ref_2.c_9 DESC, ref_2.c_10 DESC, ref_2.c_11, ref_2.c_12, ref_2.c_13, ref_2.c_14 DESC, ref_2.c_15 DESC, ref_2.c_16, ref_2.c_17, ref_2.c_18 DESC, ref_2.c_19 DESC, ref_2.c_20 DESC, ref_2.c_21)) AS c_6
FROM ((public.t3 ref_0
CROSS JOIN public.t3 ref_1)
RIGHT JOIN public.t3 ref_2 ON ((ref_1.c_11 = ref_2.c_0)))
WHERE ((( SELECT t0.c3
FROM public.t0
ORDER BY t0.c3
OFFSET 4
LIMIT 1) < ( SELECT t0.c3
FROM public.t0
ORDER BY t0.c3
OFFSET 6
LIMIT 1)) OR NULL::boolean);
ALTER VIEW public.t4 OWNER TO zuming;
--
-- Name: t5; Type: TABLE; Schema: public; Owner: zuming
--
CREATE TABLE public.t5 (
vkey integer,
pkey integer,
c7 text,
c8 integer,
c9 integer,
c10 text,
c11 double precision,
c12 text,
c13 timestamp without time zone,
c14 text,
c15 timestamp without time zone
);
ALTER TABLE public.t5 OWNER TO zuming;
--
-- Data for Name: t0; Type: TABLE DATA; Schema: public; Owner: zuming
--
COPY public.t0 (vkey, pkey, c0, c1, c2, c3) FROM stdin;
4 14000 0 \N \N
7 17000 0 97.99 i7N+ 2032-03-24 19:42:31
17 27000 0 \N 2046-07-04 04:03:09
20 30000 -20 -20.82 #}!BA 2020-03-28 07:00:32
21 31000 0 0 2071-12-27 18:48:27
22 32000 25 0 c~xm 2059-09-16 07:48:14
23 33000 -75 -41.97 2m7 2098-10-14 08:31:51
28 38000 18 20.97 \N \N
43 53000 0 -33.25 I) \N
45 55000 45 49.7 N? 2006-02-08 17:46:12
47 57000 0 4.1 \N
58 68000 -14 6.94 1978-11-07 17:18:49
60 70000 0 70.93 :y 1978-05-25 17:30:52
78 88000 -43 38.11 1975-03-20 01:01:10
88 98000 0 19.31 Q,JuM 2046-03-01 07:33:12
92 102000 -17 87.62 8e2$9 2098-03-17 16:01:47
93 103000 0 59.35 2021-02-23 14:24:24
99 109000 \N -93.55 e 2003-12-08 22:21:34
100 110000 \N 0 $|xxP 2086-10-19 01:16:23
105 115000 0 0 2042-04-09 08:01:32
110 120000 -48 8.29 \N \N
112 122000 19 70.3 S \N
119 129000 \N \N 2002-07-19 09:47:53
\.
--
-- Data for Name: t1; Type: TABLE DATA; Schema: public; Owner: zuming
--
COPY public.t1 (vkey, pkey, c4, c5) FROM stdin;
9 19000 6#)8@ -12
15 25000 0
24 34000 ;p,,[ -4
30 40000 0
36 46000 h2 -2
38 48000 \N -89
41 51000 IR,V 91
42 52000 77N 35
50 60000 a+[e> 22
53 63000 \N
57 67000 `:5 99
62 72000 \N -15
67 77000 6Jl -25
68 78000 ?O 40
69 79000 ;z -36
71 81000 q/8nz -82
77 87000 \N -11
82 92000 \N 0
83 93000 g \N
85 95000 OV -22
91 101000 : \N
94 104000 Q@R 0
96 106000 [IY- 43
97 107000 @ 0
103 113000 \N -38
111 121000 ,Pk 70
114 124000 S7-8Y 42
115 125000 hc 49
120 130000 \N \N
\.
--
-- Data for Name: t2; Type: TABLE DATA; Schema: public; Owner: zuming
--
COPY public.t2 (vkey, pkey, c6) FROM stdin;
2 12000 28.4
3 13000 52.1
5 15000 30.99
8 18000 75.9
10 20000 -79.4
11 21000 0
16 26000 -41.54
19 29000 43.68
25 35000 77.37
27 37000 57.78
29 39000 \N
32 42000 3.64
33 43000 -2.83
37 47000 98.44
40 50000 -82.3
48 58000 64.4
54 64000 -5.71
55 65000 6.65
56 66000 -63.49
59 69000 0
64 74000 4.8
65 75000 -34.9
70 80000 \N
73 83000 -42.3
74 84000 53.83
76 86000 0
79 89000 0
80 90000 45.84
81 91000 0
86 96000 0
95 105000 92.13
98 108000 -7.24
101 111000 -99.86
106 116000 0
108 118000 91.4
113 123000 -18.98
117 127000 \N
118 128000 1.6
121 131000 0
\.
--
-- Data for Name: t5; Type: TABLE DATA; Schema: public; Owner: zuming
--
COPY public.t5 (vkey, pkey, c7, c8, c9, c10, c11, c12, c13, c14, c15) FROM stdin;
1 11000 V? -17 -75 X \N WTF \N TJ \N
6 16000 mc -57 76 \N 0 ]5tk) 1993-05-09 13:13:22 \N 2082-12-19 19:30:03
12 22000 0 0 vnX! 0 iRx]U 2011-05-07 00:55:30 Ay1U8 2001-04-17 04:34:26
13 23000 9q -33 \N Z:/wH -57.57 \N 2035-12-11 02:06:16 2087-01-07 18:54:42
14 24000 ] -63 -85 a3 -68.57 tr \N ``-n 2094-02-27 16:51:46
18 28000 hEa 0 5 + 0 $4:` 2067-12-01 07:43:42 PPca 1985-09-20 13:24:48
26 36000 Ylz; 73 -92 z9U 3.36 OgWn@ 2101-08-11 03:10:29 X+ \N
31 41000 87 0 Zd \N 2051-08-02 05:56:02 2101-07-16 06:13:24
34 44000 =?=p \N -12 XZ 0 \N \N 2023-01-06 20:39:23
35 45000 \N -43 -96 1 -43.29 1998-05-03 18:44:20 (X] 1984-01-06 21:37:58
39 49000 tB`h 63 6 ]w&H -14.4 M)^-& 2039-02-10 20:47:53 I 3T9 2030-03-22 03:29:02
44 54000 77l -98 69 5q^c 77.93 9y/W 2061-01-26 15:36:42 3SeJQ 2102-06-14 16:03:19
46 56000 B 0 0 \N 70.84 J<!Q~ 2014-06-05 00:08:59 = $ 2007-07-18 13:22:56
49 59000 S -91 65 KQa3! -93.5 \N 1988-12-20 20:29:30 \N 2080-01-09 12:41:05
51 61000 2;}s -27 \N 0cD@4 -87.74 \N 2074-07-05 08:21:05 O?] 2035-07-25 16:19:40
52 62000 kII -80 64 \N wTYQ 2037-02-01 18:40:59 +R* 2058-11-23 22:28:18
61 71000 @d 0 -75 `Q<DE 0 .+M \N \N 2069-02-22 22:01:44
63 73000 \N \N 21 g Gg{ -60.66 PXI 1990-11-28 18:55:49 Ud \N
66 76000 f02 -14 23 -78.58 ij 1999-08-07 15:51:08 m 2046-01-04 02:31:56
72 82000 \N \N 86 Vw 0 MZ[B 2104-05-21 10:57:41 \N 2071-12-17 07:06:45
75 85000 R8dp -89 79 w; \N \N 1975-10-13 17:28:33 vV^ 2028-07-19 15:55:30
84 94000 } 0 63 mR 66.83 P#80p 2076-05-24 23:06:30 Rnrm 1970-11-02 06:35:18
87 97000 mXL2 0 0 <eQey 77.46 \N 2103-10-28 01:50:49 #X 1981-08-17 11:20:32
89 99000 SGk 0 89 \N 0 WRbI1 1974-02-20 21:22:43 @@ 1995-05-28 06:28:48
90 100000 pXB -71 -20 0 v 1974-10-03 02:59:12 \N 2062-04-28 15:11:49
102 112000 $i 86 0 \N 36.76 At 1972-03-26 03:39:46 4G 1989-12-24 21:45:53
104 114000 -E(0 2 -78 \N 76.9 S+ 1998-10-02 13:14:36 fIoP 2054-04-23 07:57:51
107 117000 7 -94 -45 H* 27.27 2010-11-03 06:40:41 2028-10-15 19:57:22
109 119000 Y1ekT -53 -3 7V -94.42 2009-07-05 06:13:42 p( 2044-06-04 02:32:49
116 126000 Ma -21 59 @KSc -72.57 |B=o9 2018-03-20 03:05:09 !6 2025-12-11 22:19:13
\.
--
-- Name: t0 t0_pkey; Type: CONSTRAINT; Schema: public; Owner: zuming
--
ALTER TABLE ONLY public.t0
ADD CONSTRAINT t0_pkey PRIMARY KEY (vkey);
--
-- Name: t1 t1_pkey; Type: CONSTRAINT; Schema: public; Owner: zuming
--
ALTER TABLE ONLY public.t1
ADD CONSTRAINT t1_pkey PRIMARY KEY (vkey);
--
-- Name: i0; Type: INDEX; Schema: public; Owner: zuming
--
CREATE INDEX i0 ON public.t0 USING btree (c3 DESC, vkey, c0, c1);
--
-- PostgreSQL database dump complete
--
unexpected.sql (text/plain, 33.9K) download
with
cte_2 AS (select distinct
case when true then ((case when false then (ref_14.c_1) else (ref_14.c_1) end
) & (case when true then (ref_14.c_1) else (ref_14.c_1) end
)) else ((ref_14.c_1) << (ref_14.c_1)) end
as c_0,
case when ((((ref_14.c_2) is not null)
or (not ((ref_14.c_2) is not null)))
or (((ref_14.c_2) is not null) is null)) then (ref_14.c_2) else (case when ((((((ref_14.c_6) in (select
ref_14.c_4 as c_0
from
t3 as ref_81
where null::bool
window w0 as (partition by ref_14.c_4 order by ref_14.c_0 desc, ref_14.c_1 desc, ref_14.c_2 desc, ref_14.c_3 asc, ref_14.c_4 desc, ref_14.c_5 asc, ref_14.c_6 desc, ref_81.c_0 desc, ref_81.c_1 desc, ref_81.c_2 desc, ref_81.c_3 desc, ref_81.c_4 desc, ref_81.c_5 desc, ref_81.c_6 asc, ref_81.c_7 asc, ref_81.c_8 desc, ref_81.c_9 desc, ref_81.c_10 asc, ref_81.c_11 desc, ref_81.c_12 asc, ref_81.c_13 desc, ref_81.c_14 desc, ref_81.c_15 desc, ref_81.c_16 desc, ref_81.c_17 asc, ref_81.c_18 desc, ref_81.c_19 desc, ref_81.c_20 asc, ref_81.c_21 asc)
order by c_0 desc))
or ((null::bool)
or (null::bool)))
or ((ref_14.c_1) < (ref_14.c_1)))
or ((']da') > (ref_14.c_2)))
and (not ((null::bool)
and ((ref_14.c_2) not like 'H_b')))) then (case when ((ref_14.c_1) is not null) then (ref_14.c_2) else (ref_14.c_2) end
) else (ref_14.c_3) end
) end
as c_1,
case when ((((ref_14.c_1) between (ref_14.c_1) and (ref_14.c_1))
and (not ((ref_14.c_1) between (ref_14.c_1) and (ref_14.c_1))))
and (((ref_14.c_1) between (ref_14.c_1) and (ref_14.c_1)) is not null)) then (case when (null::bool) then (ref_14.c_1) else (nullif(ref_14.c_1, 0)) end
) else (ref_14.c_1) end
as c_2,
case when false then (ref_14.c_0) else (ref_14.c_4) end
as c_3,
case when true then (ref_14.c_5) else ((ref_14.c_3) <= (ref_14.c_3)) end
as c_4,
case when false then (ref_14.c_1) else (null::int4) end
as c_5,
case when true then (ref_14.c_5) else (((ref_14.c_4) is null)
and ((pg_catalog.btrim(ref_14.c_3,
ref_14.c_3)) ~~* (ref_14.c_3))) end
as c_6,
case when false then ((pg_catalog.timestamp(null::timestamp,
ref_14.c_1)) <> (pg_catalog.timestamp_smaller(make_timestamp(2029, 11, 19, 20, 38, 38),
make_timestamp(2029, 3, 7, 10, 28, 28)))) else (ref_14.c_5) end
as c_7,
case when false then (ref_14.c_6) else (ref_14.c_4) end
as c_8,
case when false then ((coalesce(ref_14.c_2, pg_catalog.rpad(ref_14.c_3,
ref_14.c_1,
ref_14.c_3))) not like '_%_') else ((case when true then (case when (((case when (((false::bool)
or (not (false::bool)))
or ((false::bool) is null)) then (ref_14.c_2) else (ref_14.c_2) end
) not like 'Rn/')) then (case when (((false::bool)
and (not (false::bool)))
and ((false::bool) is not null)) then (ref_14.c_2) else (null::text) end
) else (case when ((((ref_14.c_3) > (ref_14.c_3))
and (not ((ref_14.c_3) > (ref_14.c_3))))
and (((ref_14.c_3) > (ref_14.c_3)) is not null)) then (ref_14.c_3) else (ref_14.c_2) end
) end
) else (ref_14.c_2) end
) ~* (case when (((true::bool)
and (not (true::bool)))
and ((true::bool) is not null)) then (ref_14.c_2) else (ref_14.c_3) end
)) end
as c_9
from
t4 as ref_14
),
cte_3 AS (select
case when true then (subq_1.c_0) else (subq_1.c_9) end
as c_0,
case when true then (case when (((case when true then (case when ((((case when true then (subq_1.c_3) else (subq_1.c_9) end
) >= (case when false then (17) else (-25) end
))
and ((case when true then (subq_1.c_3) else (subq_1.c_9) end
) <= (case when ((((subq_1.c_5) not like '_>_')
and (not ((subq_1.c_5) not like '_>_')))
and (((subq_1.c_5) not like '_>_') is not null)) then (subq_1.c_3) else (subq_1.c_3) end
)))) then (case when ((((((subq_1.c_9) between (subq_1.c_0) and (subq_1.c_0))
or (null::bool))
or ((subq_1.c_9) <> (subq_1.c_0)))
or (not ((((subq_1.c_9) between (subq_1.c_0) and (subq_1.c_0))
or (null::bool))
or ((subq_1.c_9) <> (subq_1.c_0)))))
or (((((subq_1.c_9) between (subq_1.c_0) and (subq_1.c_0))
or (null::bool))
or ((subq_1.c_9) <> (subq_1.c_0))) is null)) then (subq_1.c_6) else (subq_1.c_6) end
) else (case when (((null::bool)
and (not (null::bool)))
and ((null::bool) is not null)) then (subq_1.c_6) else (subq_1.c_1) end
) end
) else (case when ((((subq_1.c_1) not like 'Y.m')
and ((null::bool)
or (not ((subq_1.c_6) > (subq_1.c_5)))))
or ((subq_1.c_5) <> (subq_1.c_5))) then (subq_1.c_1) else (subq_1.c_6) end
) end
) <> (case when ((((subq_1.c_9) > (subq_1.c_9))
or (not ((subq_1.c_9) > (subq_1.c_9))))
or (((subq_1.c_9) > (subq_1.c_9)) is null)) then (subq_1.c_5) else (subq_1.c_5) end
))) then (case when true then (case when ((not ((not (((((subq_1.c_9) between (subq_1.c_0) and (subq_1.c_3))
or (not ((subq_1.c_9) between (subq_1.c_0) and (subq_1.c_3))))
or (((subq_1.c_9) between (subq_1.c_0) and (subq_1.c_3)) is null))
and ((case when (((((subq_1.c_0) > (subq_1.c_0))
or (null::bool))
and (not (((subq_1.c_0) > (subq_1.c_0))
or (null::bool))))
and ((((subq_1.c_0) > (subq_1.c_0))
or (null::bool)) is not null)) then (subq_1.c_7) else (subq_1.c_4) end
) <> (case when (((((subq_1.c_2) is null)
and ((subq_1.c_6) ~~* (subq_1.c_6)))
or (not (((subq_1.c_2) is null)
and ((subq_1.c_6) ~~* (subq_1.c_6)))))
or ((((subq_1.c_2) is null)
and ((subq_1.c_6) ~~* (subq_1.c_6))) is null)) then (subq_1.c_2) else (subq_1.c_7) end
))))
and (not (((((make_timestamp(1996, 11, 24, 12, 12, 52)) <> (null::timestamp))
or (not ((make_timestamp(1996, 11, 24, 12, 12, 52)) <> (null::timestamp))))
or (((make_timestamp(1996, 11, 24, 12, 12, 52)) <> (null::timestamp)) is null))
and (not ((not ((((true::bool)
and (not (true::bool)))
and ((true::bool) is not null))
or (not (((((make_timestamp(2082, 8, 28, 23, 52, 10)) = (make_timestamp(2024, 11, 16, 2, 32, 7)))
or (not ((make_timestamp(2082, 8, 28, 23, 52, 10)) = (make_timestamp(2024, 11, 16, 2, 32, 7)))))
or (((make_timestamp(2082, 8, 28, 23, 52, 10)) = (make_timestamp(2024, 11, 16, 2, 32, 7))) is null))
and ((case when ((((0) is not null)
and (not ((0) is not null)))
and (((0) is not null) is not null)) then (subq_1.c_6) else (subq_1.c_6) end
) = (case when (((null::bool)
or (not (null::bool)))
or ((null::bool) is null)) then (subq_1.c_1) else (subq_1.c_1) end
))))))
or (not (((((make_timestamp(2062, 4, 13, 16, 25, 40)) < (make_timestamp(2032, 5, 20, 12, 29, 54)))
or (not ((make_timestamp(2062, 4, 13, 16, 25, 40)) < (make_timestamp(2032, 5, 20, 12, 29, 54)))))
or (((make_timestamp(2062, 4, 13, 16, 25, 40)) < (make_timestamp(2032, 5, 20, 12, 29, 54))) is null))
and (((case when (((null::bool)
and (not (null::bool)))
and ((null::bool) is not null)) then (subq_1.c_3) else (subq_1.c_9) end
) >= (case when ((((exists (
select
ref_104.vkey as c_0
from
t1 as ref_104
where (subq_1.c_3) >= (
select
ref_104.c5 as c_0
from
t4 as ref_105
where (subq_1.c_5) > (ref_105.c_2)
order by c_0 desc
limit 1)
intersect
select
subq_1.c_3 as c_0
from
t5 as ref_106
where false::bool))
or (((subq_1.c_0) <= (subq_1.c_0))
and ((subq_1.c_5) not like '%%m')))
and (not ((exists (
select
ref_104.vkey as c_0
from
t1 as ref_104
where (subq_1.c_3) >= (
select
ref_104.c5 as c_0
from
t4 as ref_105
where (subq_1.c_5) > (ref_105.c_2)
order by c_0 desc
limit 1)
intersect
select
subq_1.c_3 as c_0
from
t5 as ref_106
where false::bool))
or (((subq_1.c_0) <= (subq_1.c_0))
and ((subq_1.c_5) not like '%%m')))))
and (((exists (
select
ref_104.vkey as c_0
from
t1 as ref_104
where (subq_1.c_3) >= (
select
ref_104.c5 as c_0
from
t4 as ref_105
where (subq_1.c_5) > (ref_105.c_2)
order by c_0 desc
limit 1)
intersect
select
subq_1.c_3 as c_0
from
t5 as ref_106
where false::bool))
or (((subq_1.c_0) <= (subq_1.c_0))
and ((subq_1.c_5) not like '%%m'))) is not null)) then (subq_1.c_9) else (subq_1.c_3) end
))
and ((case when (((null::bool)
and (not (null::bool)))
and ((null::bool) is not null)) then (subq_1.c_3) else (subq_1.c_9) end
) <= (case when (((((subq_1.c_1) ~* (subq_1.c_6))
or (false::bool))
and (not (((subq_1.c_1) ~* (subq_1.c_6))
or (false::bool))))
and ((((subq_1.c_1) ~* (subq_1.c_6))
or (false::bool)) is not null)) then (subq_1.c_0) else (subq_1.c_9) end
)))))))))))) then (case when (((not (((subq_1.c_1) ^@ (subq_1.c_6))
and ((subq_1.c_5) < (subq_1.c_5))))
and (not (not (((subq_1.c_1) ^@ (subq_1.c_6))
and ((subq_1.c_5) < (subq_1.c_5))))))
and ((not (((subq_1.c_1) ^@ (subq_1.c_6))
and ((subq_1.c_5) < (subq_1.c_5)))) is not null)) then (subq_1.c_5) else (subq_1.c_6) end
) else (case when (((not (false::bool))
and (not (not (false::bool))))
and ((not (false::bool)) is not null)) then (case when (false::bool) then (subq_1.c_1) else (subq_1.c_1) end
) else (subq_1.c_6) end
) end
) else ((subq_1.c_6) || (subq_1.c_5)) end
) else (case when ((((null::bool)
or ((subq_1.c_6) ~* (subq_1.c_6)))
and (not ((null::bool)
or ((subq_1.c_6) ~* (subq_1.c_6)))))
and (((null::bool)
or ((subq_1.c_6) ~* (subq_1.c_6))) is not null)) then (subq_1.c_5) else (subq_1.c_1) end
) end
) else (case when (null::bool) then (subq_1.c_6) else (subq_1.c_6) end
) end
as c_1
from
(select
case when ((((make_timestamp(2104, 11, 23, 14, 7, 42)) <> (make_timestamp(2106, 9, 20, 4, 43, 30)))
or (not ((make_timestamp(2104, 11, 23, 14, 7, 42)) <> (make_timestamp(2106, 9, 20, 4, 43, 30)))))
or (((make_timestamp(2104, 11, 23, 14, 7, 42)) <> (make_timestamp(2106, 9, 20, 4, 43, 30))) is null)) then (-0) else (ref_16.c_1) end
as c_0,
case when (((false::bool)
or (not (false::bool)))
or ((false::bool) is null)) then (ref_15.c_2) else (ref_15.c_3) end
as c_1,
case when ((((((ref_15.c_1) is null)
or ((make_timestamp(2073, 8, 5, 19, 26, 3)) > (make_timestamp(2024, 11, 14, 6, 30, 27))))
or ((((make_timestamp(2100, 2, 12, 17, 12, 2)) = (make_timestamp(2037, 4, 6, 9, 26, 17)))
and (((not ((null::text) >= (ref_16.c_2)))
or (null::bool))
or (null::bool)))
and (false::bool)))
or (not ((((ref_15.c_1) is null)
or ((make_timestamp(2073, 8, 5, 19, 26, 3)) > (make_timestamp(2024, 11, 14, 6, 30, 27))))
or ((((make_timestamp(2100, 2, 12, 17, 12, 2)) = (make_timestamp(2037, 4, 6, 9, 26, 17)))
and (((not ((null::text) >= (ref_16.c_2)))
or (null::bool))
or (null::bool)))
and (false::bool)))))
or (((((ref_15.c_1) is null)
or ((make_timestamp(2073, 8, 5, 19, 26, 3)) > (make_timestamp(2024, 11, 14, 6, 30, 27))))
or ((((make_timestamp(2100, 2, 12, 17, 12, 2)) = (make_timestamp(2037, 4, 6, 9, 26, 17)))
and (((not ((null::text) >= (ref_16.c_2)))
or (null::bool))
or (null::bool)))
and (false::bool))) is null)) then (ref_16.c_4) else (ref_16.c_4) end
as c_2,
case when (((null::bool)
and (not (null::bool)))
and ((null::bool) is not null)) then (ref_15.c_1) else (ref_15.c_1) end
as c_3,
case when ((((null::bool) < ((ref_16.c_1) between (ref_15.c_1) and (ref_15.c_1)))
or (not ((null::bool) < ((ref_16.c_1) between (ref_15.c_1) and (ref_15.c_1)))))
or (((null::bool) < ((ref_16.c_1) between (ref_15.c_1) and (ref_15.c_1))) is null)) then (ref_16.c_4) else (0.0) end
as c_4,
case when (((null::bool)
and (not (null::bool)))
and ((null::bool) is not null)) then (ref_16.c_2) else (ref_16.c_2) end
as c_5,
case when ((((('/zI,') < (ref_16.c_3)) = (not (false::bool)))
or (not ((('/zI,') < (ref_16.c_3)) = (not (false::bool)))))
or (((('/zI,') < (ref_16.c_3)) = (not (false::bool))) is null)) then (ref_15.c_2) else (ref_15.c_2) end
as c_6,
case when ((((ref_15.c_3) <= (ref_15.c_3))
and (not ((ref_15.c_3) <= (ref_15.c_3))))
and (((ref_15.c_3) <= (ref_15.c_3)) is not null)) then (ref_15.c_4) else (ref_16.c_6) end
as c_7,
case when ((((ref_15.c_1) between (ref_15.c_1) and (ref_15.c_1))
or (not ((ref_15.c_1) between (ref_15.c_1) and (ref_15.c_1))))
or (((ref_15.c_1) between (ref_15.c_1) and (ref_15.c_1)) is null)) then (ref_15.c_5) else (false::bool) end
as c_8,
case when (((exists (
select
(ref_16.c_3) ~<=~ (ref_16.c_2) as c_0,
ref_107.c_2 as c_1
from
t4 as ref_107
where (((ref_15.c_2) ~~* (ref_16.c_2))
or (false::bool))
or (((make_timestamp(2103, 12, 25, 1, 57, 36)) > (make_timestamp(1971, 9, 1, 9, 59, 47)))
or ((ref_107.c_2) in (select distinct
ref_16.c_3 as c_0
from
t0 as ref_108
where false::bool
order by c_0 asc)))
except
select
null::bool as c_0,
ref_15.c_2 as c_1
from
t4 as ref_109
where true::bool))
or (not (exists (
select
(ref_16.c_3) ~<=~ (ref_16.c_2) as c_0,
ref_107.c_2 as c_1
from
t4 as ref_107
where (((ref_15.c_2) ~~* (ref_16.c_2))
or (false::bool))
or (((make_timestamp(2103, 12, 25, 1, 57, 36)) > (make_timestamp(1971, 9, 1, 9, 59, 47)))
or ((ref_107.c_2) in (select distinct
ref_16.c_3 as c_0
from
t0 as ref_108
where false::bool
order by c_0 asc)))
except
select
null::bool as c_0,
ref_15.c_2 as c_1
from
t4 as ref_109
where true::bool))))
or ((exists (
select
(ref_16.c_3) ~<=~ (ref_16.c_2) as c_0,
ref_107.c_2 as c_1
from
t4 as ref_107
where (((ref_15.c_2) ~~* (ref_16.c_2))
or (false::bool))
or (((make_timestamp(2103, 12, 25, 1, 57, 36)) > (make_timestamp(1971, 9, 1, 9, 59, 47)))
or ((ref_107.c_2) in (select distinct
ref_16.c_3 as c_0
from
t0 as ref_108
where false::bool
order by c_0 asc)))
except
select
null::bool as c_0,
ref_15.c_2 as c_1
from
t4 as ref_109
where true::bool)) is null)) then (ref_15.c_1) else (ref_16.c_1) end
as c_9
from
(t4 as ref_15
inner join t4 as ref_16
on (ref_15.c_0 = ref_16.c_0 ))
where not ((false::bool)
or (not ((true::bool)
and (((((null::int4) between (ref_16.c_1) and (ref_16.c_1))
or (not ((null::int4) between (ref_16.c_1) and (ref_16.c_1))))
or (((null::int4) between (ref_16.c_1) and (ref_16.c_1)) is null))
and ((case when ((((ref_15.c_3) not like '__S')
and (not ((ref_15.c_3) not like '__S')))
and (((ref_15.c_3) not like '__S') is not null)) then (ref_15.c_1) else (ref_16.c_1) end
) > (case when ((((ref_15.c_2) !~~* (ref_15.c_3))
or (not ((ref_15.c_2) !~~* (ref_15.c_3))))
or (((ref_15.c_2) !~~* (ref_15.c_3)) is null)) then (ref_15.c_1) else (ref_15.c_1) end
))))))) as subq_1
)
select
case when ((((((null::bool)
or (false::bool))
or ((((subq_2.c_8) !~~* (subq_2.c_8))
and ((subq_2.c_11) !~* (subq_2.c_8)))
and (null::bool)))
or ((ref_22.c0) is not null))
or (not ((((null::bool)
or (false::bool))
or ((((subq_2.c_8) !~~* (subq_2.c_8))
and ((subq_2.c_11) !~* (subq_2.c_8)))
and (null::bool)))
or ((ref_22.c0) is not null))))
or (((((null::bool)
or (false::bool))
or ((((subq_2.c_8) !~~* (subq_2.c_8))
and ((subq_2.c_11) !~* (subq_2.c_8)))
and (null::bool)))
or ((ref_22.c0) is not null)) is null)) then (case when (((((subq_3.c_2) in (select
(ref_22.vkey) between (subq_2.c_7) and (ref_22.c0) as c_0
from
(t4 as ref_125
right outer join t4 as ref_126
on (ref_125.c_6 = ref_126.c_0 ))
where (null::bool)
and (null::bool)
union
select
(ref_127.c5) in (select
subq_2.c_1 as c_0
from
cte_2 as ref_128
where true::bool) as c_0
from
t1 as ref_127
where true::bool))
and (not ((subq_3.c_2) in (select
(ref_22.vkey) between (subq_2.c_7) and (ref_22.c0) as c_0
from
(t4 as ref_125
right outer join t4 as ref_126
on (ref_125.c_6 = ref_126.c_0 ))
where (null::bool)
and (null::bool)
union
select
(ref_127.c5) in (select
subq_2.c_1 as c_0
from
cte_2 as ref_128
where true::bool) as c_0
from
t1 as ref_127
where true::bool))))
and (((subq_3.c_2) in (select
(ref_22.vkey) between (subq_2.c_7) and (ref_22.c0) as c_0
from
(t4 as ref_125
right outer join t4 as ref_126
on (ref_125.c_6 = ref_126.c_0 ))
where (null::bool)
and (null::bool)
union
select
(ref_127.c5) in (select
subq_2.c_1 as c_0
from
cte_2 as ref_128
where true::bool) as c_0
from
t1 as ref_127
where true::bool)) is not null))
or ((true::bool) in (select
case when (((((true::bool)
or (not (true::bool)))
or ((true::bool) is null))
and ((case when (((false::bool)
or (not (false::bool)))
or ((false::bool) is null)) then (subq_2.c_9) else (ref_29.c_11) end
) like 'u6_')) is null) then (false::bool) else ((((true::bool)
or (not (true::bool)))
or ((true::bool) is null))
and ((case when (((false::bool)
or (not (false::bool)))
or ((false::bool) is null)) then (subq_2.c_9) else (ref_29.c_11) end
) like 'u6_')) end
as c0
from
t3 as ref_29
where true::bool))) then (((ref_22.c1) = (ref_22.c1))
or (true::bool)) else (null::bool) end
) else (true::bool) end
as c_2,
((((pg_catalog.regexp_replace(subq_2.c_2,
ref_22.c2,
ref_22.c2)) !~~* ((subq_2.c_8) || (ref_22.c2)))
and (not ((pg_catalog.regexp_replace(subq_2.c_2,
ref_22.c2,
ref_22.c2)) !~~* ((subq_2.c_8) || (ref_22.c2)))))
and (((pg_catalog.regexp_replace(subq_2.c_2,
ref_22.c2,
ref_22.c2)) !~~* ((subq_2.c_8) || (ref_22.c2))) is not null))
or (not ((not (((((ref_22.c2) > (subq_2.c_9))
and (not ((ref_22.c2) > (subq_2.c_9))))
and (((ref_22.c2) > (subq_2.c_9)) is not null))
or ((true::bool) in (select
case when ((null::bool) is null) then (false::bool) else (null::bool) end
as c0
from
t3 as ref_30
where true::bool))))
or (not (((((subq_2.c_9) <= (subq_2.c_9))
and (not ((subq_2.c_9) <= (subq_2.c_9))))
and (((subq_2.c_9) <= (subq_2.c_9)) is not null))
or ((case when ((((-61) <> (
select
subq_3.c_0 as c_0
from
t4 as ref_130
where ((subq_2.c_9) <> (ref_22.c2))
or ((ref_130.c_2) not like '_6%')
order by c_0 desc
limit 1))
or (not ((-61) <> (
select
subq_3.c_0 as c_0
from
t4 as ref_130
where ((subq_2.c_9) <> (ref_22.c2))
or ((ref_130.c_2) not like '_6%')
order by c_0 desc
limit 1))))
or (((-61) <> (
select
subq_3.c_0 as c_0
from
t4 as ref_130
where ((subq_2.c_9) <> (ref_22.c2))
or ((ref_130.c_2) not like '_6%')
order by c_0 desc
limit 1)) is null)) then (case when (((((ref_22.c0) is null)
or (not ((ref_22.c0) is null)))
or (((ref_22.c0) is null) is null))
and ((case when (((true::bool)
and (not (true::bool)))
and ((true::bool) is not null)) then (ref_22.c1) else (ref_22.c1) end
) >= (case when (((((subq_2.c_11) ~ (subq_2.c_9))
or ((ref_22.vkey) between (subq_2.c_6) and (subq_2.c_3)))
and (not (((subq_2.c_11) ~ (subq_2.c_9))
or ((ref_22.vkey) between (subq_2.c_6) and (subq_2.c_3)))))
and ((((subq_2.c_11) ~ (subq_2.c_9))
or ((ref_22.vkey) between (subq_2.c_6) and (subq_2.c_3))) is not null)) then (ref_22.c1) else (ref_22.c1) end
))) then (case when (((((subq_2.c_5) = (subq_2.c_4))
and (null::bool))
and (not (((subq_2.c_5) = (subq_2.c_4))
and (null::bool))))
and ((((subq_2.c_5) = (subq_2.c_4))
and (null::bool)) is not null)) then (subq_2.c_11) else (subq_2.c_2) end
) else (case when (((null::bool)
or (not (null::bool)))
or ((null::bool) is null)) then (subq_2.c_11) else (subq_2.c_9) end
) end
) else (subq_2.c_2) end
) ^@ (case when ((((subq_2.c_2) ~* (subq_2.c_11))
and (not ((subq_2.c_2) ~* (subq_2.c_11))))
and (((subq_2.c_2) ~* (subq_2.c_11)) is not null)) then (pg_catalog.rpad(subq_2.c_11,
subq_2.c_10)) else (subq_2.c_8) end
)))))) as c_3,
((((pg_catalog.substring(subq_2.c_8,
-0,
subq_2.c_0)) ~~ (subq_2.c_8))
or (not ((pg_catalog.substring(subq_2.c_8,
-0,
subq_2.c_0)) ~~ (subq_2.c_8))))
or (((pg_catalog.substring(subq_2.c_8,
-0,
subq_2.c_0)) ~~ (subq_2.c_8)) is null))
and (not ((not (((((ref_22.c3) <= (ref_22.c3))
and (not ((ref_22.c3) <= (ref_22.c3))))
and (((ref_22.c3) <= (ref_22.c3)) is not null))
or ((case when (((true::bool)
and (not (true::bool)))
and ((true::bool) is not null)) then (subq_2.c_2) else (subq_2.c_2) end
) not like '_%%')))
and (not (((((subq_2.c_9) = (subq_2.c_9))
or (not ((subq_2.c_9) = (subq_2.c_9))))
or (((subq_2.c_9) = (subq_2.c_9)) is null))
and (not ((not (((((ref_22.c2) !~ (subq_2.c_8))
and (not ((ref_22.c2) !~ (subq_2.c_8))))
and (((ref_22.c2) !~ (subq_2.c_8)) is not null))
or (not ((not (null::bool))
and (not (null::bool))))))
or (not ((((null::bool)
and (not (null::bool)))
and ((null::bool) is not null))
or ((case when ((((subq_2.c_9) !~* (subq_2.c_9))
and (not ((subq_2.c_9) !~* (subq_2.c_9))))
and (((subq_2.c_9) !~* (subq_2.c_9)) is not null)) then (subq_2.c_5) else (subq_2.c_1) end
) < (case when (((null::bool)
and (not (null::bool)))
and ((null::bool) is not null)) then (96) else (pg_catalog.gin_compare_jsonb(case when (((false::bool)
and (not (false::bool)))
and ((false::bool) is not null)) then (subq_2.c_2) else (null::text) end
,
case when ((((false::bool) is null)
and (not ((false::bool) is null)))
and (((false::bool) is null) is not null)) then (subq_2.c_9) else (subq_2.c_2) end
)) end
)))))))))) as c_4,
case when ((((ref_22.c1) >= (pg_catalog.tsrange_subdiff(make_timestamp(2091, 10, 11, 21, 41, 25),
ref_22.c3)))
or (not ((ref_22.c1) >= (pg_catalog.tsrange_subdiff(make_timestamp(2091, 10, 11, 21, 41, 25),
ref_22.c3)))))
or (((ref_22.c1) >= (pg_catalog.tsrange_subdiff(make_timestamp(2091, 10, 11, 21, 41, 25),
ref_22.c3))) is null)) then ((case when ((((((((subq_2.c_9) ^@ (subq_2.c_9))
or (null::bool))
and (null::bool))
or (null::bool))
and ((ref_22.pkey) is not null))
and (not ((((((subq_2.c_9) ^@ (subq_2.c_9))
or (null::bool))
and (null::bool))
or (null::bool))
and ((ref_22.pkey) is not null))))
and (((((((subq_2.c_9) ^@ (subq_2.c_9))
or (null::bool))
and (null::bool))
or (null::bool))
and ((ref_22.pkey) is not null)) is not null)) then (nullif(ref_22.c1, ref_22.c1)) else (pg_catalog.float8smaller(case when ((((subq_2.c_3) between (subq_2.c_7) and (subq_2.c_4))
and (not ((subq_2.c_3) between (subq_2.c_7) and (subq_2.c_4))))
and (((subq_2.c_3) between (subq_2.c_7) and (subq_2.c_4)) is not null)) then (ref_22.c1) else (ref_22.c1) end
,
case when ((((subq_2.c_1) = (ref_22.vkey))
or (not ((subq_2.c_1) = (ref_22.vkey))))
or (((subq_2.c_1) = (ref_22.vkey)) is null)) then (ref_22.c1) else (ref_22.c1) end
)) end
) / (case when (((true::bool)
and (not (true::bool)))
and ((true::bool) is not null)) then (ref_22.c1) else ((case when (((false::bool)
or (not (false::bool)))
or ((false::bool) is null)) then (ref_22.c1) else (ref_22.c1) end
) / (case when (((true::bool)
and (not (true::bool)))
and ((true::bool) is not null)) then (ref_22.c1) else (ref_22.c1) end
)) end
)) else (pg_catalog.cotd(ref_22.c1)) end
as c_5
from
((select
case when false then (ref_17.c5) else (ref_17.pkey) end
as c_0,
case when false then (ref_18.c_0) else (ref_18.c_0) end
as c_1,
case when true then (ref_18.c_1) else (ref_18.c_1) end
as c_2,
case when false then (ref_17.c5) else (ref_17.vkey) end
as c_3,
case when true then (ref_17.c5) else (ref_17.c5) end
as c_4,
case when false then (ref_18.c_0) else (ref_18.c_0) end
as c_5,
case when false then (ref_17.vkey) else (ref_17.pkey) end
as c_6,
case when true then (ref_18.c_0) else (ref_17.c5) end
as c_7,
case when false then (ref_18.c_1) else (ref_18.c_1) end
as c_8,
case when true then (ref_18.c_1) else (ref_18.c_1) end
as c_9,
case when false then (ref_17.pkey) else (ref_17.vkey) end
as c_10,
case when false then (ref_18.c_1) else (ref_18.c_1) end
as c_11
from
(t1 as ref_17
cross join cte_3 as ref_18
)
where not ((false::bool)
or (not ((true::bool)
and (null::bool))))) as subq_2
left outer join (t0 as ref_22
left outer join (select
case when ((((ref_23.c_8) > (ref_23.c_3))
and (not ((ref_23.c_8) > (ref_23.c_3))))
and (((ref_23.c_8) > (ref_23.c_3)) is not null)) then (ref_23.c_2) else (ref_23.c_2) end
as c_0,
case when ((((2) between (ref_23.c_2) and (ref_23.c_0))
or (not ((2) between (ref_23.c_2) and (ref_23.c_0))))
or (((2) between (ref_23.c_2) and (ref_23.c_0)) is null)) then (ref_23.c_6) else (null::bool) end
as c_1,
case when ((((ref_23.c_0) <= (ref_23.c_0))
and (not ((ref_23.c_0) <= (ref_23.c_0))))
and (((ref_23.c_0) <= (ref_23.c_0)) is not null)) then (true::bool) else (ref_23.c_9) end
as c_2,
((case when ((((ref_23.c_1) <= (ref_23.c_1))
or (not ((ref_23.c_1) <= (ref_23.c_1))))
or (((ref_23.c_1) <= (ref_23.c_1)) is null)) then (ref_23.c_3) else (ref_23.c_3) end
) <= (case when (((((ref_23.c_1) ~<=~ (ref_23.c_1))
or (null::bool))
or (not (((ref_23.c_1) ~<=~ (ref_23.c_1))
or (null::bool))))
or ((((ref_23.c_1) ~<=~ (ref_23.c_1))
or (null::bool)) is null)) then (ref_23.c_8) else (ref_23.c_8) end
)) as c_3
from
cte_2 as ref_23
where not ((false::bool)
or (not ((true::bool)
and ((((false::bool)
and (not (false::bool)))
and ((false::bool) is not null))
or ((case when (((((true::bool)
and (null::bool))
and (false::bool))
and (not (((true::bool)
and (null::bool))
and (false::bool))))
and ((((true::bool)
and (null::bool))
and (false::bool)) is not null)) then (ref_23.c_0) else (ref_23.c_5) end
) is not null)))))) as subq_3
on (ref_22.pkey = subq_3.c_0 ))
on (subq_2.c_0 = ref_22.vkey ))
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 using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: zuming.jiang@inf.ethz.ch, pgsql-bugs@lists.postgresql.org
Subject: Re: Fwd: Server closed the connection unexpectedly (memory leak)
In-Reply-To: <bc25534f-5fdf-60db-564d-a4792146ce6e@inf.ethz.ch>
* 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