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