Re: foreign key on virtual generated column
Srinath Reddy Sadipiralla <srinath2133@gmail.com>
From: Srinath Reddy Sadipiralla <srinath2133@gmail.com>
To: jian he <jian.universality@gmail.com>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2025-11-04T17:12:27Z
Lists: pgsql-hackers
Hi Jian,
did initial testing and review ,the patches LGTM except
indentation we can solve this by running pg_indent.
i have one doubt that why we are using compute_virtual
argument todo the same work in both cases, is it because
of future proofing ,like we may do something different for
stored and virtual in future?
/* No luck, so prepare the expression for execution */
if (attgenerated == ATTRIBUTE_GENERATED_STORED)
{
ri_GeneratedExprs[i] = ExecPrepareExpr(expr, estate);
ri_NumGeneratedNeeded++;
}
else if (compute_virtual)
{
ri_GeneratedExprs[i] = ExecPrepareExpr(expr, estate);
ri_NumGeneratedNeeded++;
}
--
Thanks,
Srinath Reddy Sadipiralla
EDB: https://www.enterprisedb.com/