Re: Virtual generated columns - Mailing list pgsql-hackers

From Alexander Lakhin
Subject Re: Virtual generated columns
Date
Msg-id 75eb1a6f-d59f-42e6-8a78-124ee808cda7@gmail.com
Whole thread Raw
In response to Virtual generated columns  (Peter Eisentraut <peter@eisentraut.org>)
List pgsql-hackers
Hello Peter,

07.02.2025 14:34, Peter Eisentraut wrote:
> I've committed it.  Thanks.

Please look at a planner error with a virtual generated column triggered
by the following script:
CREATE TABLE t(a int, b int GENERATED ALWAYS AS (a * 1));

SELECT SUM(CASE WHEN t.b = 1 THEN 1 ELSE 1 END) OVER (PARTITION BY t.a)
FROM t AS t1 LEFT JOIN T ON true;

ERROR:  XX000: wrong varnullingrels (b) (expected (b 3)) for Var 2/1
LOCATION:  search_indexed_tlist_for_var, setrefs.c:2901

(I discovered this anomaly with SQLsmith.)

Best regards,
Alexander Lakhin
Neon (https://neon.tech)



pgsql-hackers by date:

Previous
From: Laurenz Albe
Date:
Subject: Re: Expanding HOT updates for expression and partial indexes
Next
From: Pavel Luzanov
Date:
Subject: Re: Things I don't like about \du's "Attributes" column