Re: BUG #17476: ERROR: "variable not found in subplan target list" when running SELECT COUNT(*)

From: Miloš Urbánek <milos(dot)urbanek(at)email(dot)cz>
To: "Pavel Stehule" <pavel(dot)stehule(at)gmail(dot)com>
Cc: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "PostgreSQL mailing lists" <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: BUG #17476: ERROR: "variable not found in subplan target list" when running SELECT COUNT(*)
Date: 2022-05-09 08:35:33
Message-ID: 609.wBLt.62HW}58GAL}.1YUD9L@scif.cz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


Difference in shared_buffers (1GB) and effective_cache_size (default) only.

When I delete all data from the table, SELECT count(*) works..

--

Miloš Urbánek

tel.: 736 608 345

---------- Původní e-mail ----------
Od: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Komu: Miloš Urbánek <milos(dot)urbanek(at)email(dot)cz>
Datum: 9. 5. 2022 10:22:16
Předmět: Re: BUG #17476: ERROR: "variable not found in subplan target list"
when running SELECT COUNT(*)
"

Hi

po 9. 5. 2022 v 9:22 odesílatel Miloš Urbánek <milos(dot)urbanek(at)email(dot)cz
(mailto:milos(dot)urbanek(at)email(dot)cz)> napsal:

"

I have 2 (ordinary) tables in 900+ table database restored from PG 9.6 (with
PostGIS geometries BTW) where this problem occurs.

The count() queries into the other tables are OK.

Also the problem happens only at the server but not at my Windows 10
workstation with the same PG 14.2.

"

Is there the same configuration on the server like on your workstation?  The
different configuration can enforce a different execution plan.

Regards

Pavel

"

No clue what could be wrong.

PGAdmin4 fails even when trying to list SQL creation statement.

--

Milos Urbanek

---------- Původní e-mail ----------
Od: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us(mailto:tgl(at)sss(dot)pgh(dot)pa(dot)us)>
Komu: milos(dot)urbanek(at)email(dot)cz(mailto:milos(dot)urbanek(at)email(dot)cz)
Datum: 9. 5. 2022 2:22:10
Předmět: Re: BUG #17476: ERROR: "variable not found in subplan target list"
when running SELECT COUNT(*)
"PG Bug reporting form <noreply(at)postgresql(dot)org
(mailto:noreply(at)postgresql(dot)org)> writes:
> Trying to run simple SELECT COUNT(*) from some table gives me the
following
> error (either running by hand or trying to run EXPLAIN using pgadmin or by

> hand):

> 2022-05-09 00:06:30.428 CEST [1196] ERROR: variable not found in subplan
> target list
> 2022-05-09 00:06:30.428 CEST [1196] STATEMENT: SELECT COUNT(*) FROM
> "domino_efekty_havarijniprojev"

Is that really just a table? I could believe a bug like this for
some types of views, but it's a bit hard to credit for a plain table.

In any case, we can't do much with this report unless you can provide
a reproducer case --- preferably a SQL script that creates an object
that triggers the problem.

regards, tom lane
"
"

"

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Miloš Urbánek 2022-05-09 08:39:11 Re: BUG #17476: ERROR: "variable not found in subplan target list" when running SELECT COUNT(*)
Previous Message Pavel Stehule 2022-05-09 08:21:33 Re: BUG #17476: ERROR: "variable not found in subplan target list" when running SELECT COUNT(*)