Re: Sudden database error with COUNT(*) making Query Planner crashes: variable not found in subplan target list

Поиск
Список
Период
Сортировка
От David Rowley
Тема Re: Sudden database error with COUNT(*) making Query Planner crashes: variable not found in subplan target list
Дата
Msg-id CAApHDvqCeSV8eWx_aKFWqPszs=aGxd7jVg_e53ZdE4UA8GT=4g@mail.gmail.com
обсуждение исходный текст
Ответ на Sudden database error with COUNT(*) making Query Planner crashes: variable not found in subplan target list  (Jean Landercy - BEEODIVERSITY <jean.landercy@beeodiversity.com>)
Ответы RE: Sudden database error with COUNT(*) making Query Planner crashes: variable not found in subplan target list  (Jean Landercy - BEEODIVERSITY <jean.landercy@beeodiversity.com>)
Список pgsql-hackers
On Mon, 6 Jun 2022 at 21:34, Jean Landercy - BEEODIVERSITY
<jean.landercy@beeodiversity.com> wrote:
> SELECT COUNT(*) FROM items;
> -- ERROR:  variable not found in subplan target list
> -- SQL state: XX000

Can you share some more details about what "items" is. psql's "\d
items" output would be useful.  From what you've reported we can't
tell if this is a table or a view.

> The bug is tricky to reproduce, I could not succeed to replicate elsewhere (dump/restore does not preserve it).

Can you share the output of:

select attname,atttypid::regtype,attnum,atthasdef,atthasmissing,attgenerated,attisdropped
from pg_attribute where attrelid = 'items'::regclass order by attnum;

This will let us see if there's something strange going on with
dropped or has missing columns.  There may be some sequence of ALTER
TABLE ADD COLUMN ... DEFAULT / DROP COLUMN that is causing this. The
output of that might help us see if that could be a factor.

David



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: oat_post_create expected behavior
Следующее
От: David Rowley
Дата:
Сообщение: Re: pgcon unconference / impact of block size on performance