postgresql/src/backend/rewrite
Tom Lane feca6c688c Correctly check updatability of columns targeted by INSERT...DEFAULT.
If a view has some updatable and some non-updatable columns, we failed
to verify updatability of any columns for which an INSERT or UPDATE
on the view explicitly specifies a DEFAULT item (unless the view has
a declared default for that column, which is rare anyway, and one
would almost certainly not write one for a non-updatable column).
This would lead to an unexpected "attribute number N not found in
view targetlist" error rather than the intended error.

Per bug #18546 from Alexander Lakhin.  This bug is old, so back-patch
to all supported branches.

Discussion: https://postgr.es/m/18546-84a292e759a9361d@postgresql.org
2024-07-20 13:40:15 -04:00
..
Makefile Row-Level Security Policies (RLS) 2014-09-19 11:18:35 -04:00
rewriteDefine.c Disallow converting a table to a view within an outer SQL command. 2024-04-30 15:22:56 -04:00
rewriteHandler.c Correctly check updatability of columns targeted by INSERT...DEFAULT. 2024-07-20 13:40:15 -04:00
rewriteManip.c Fix multi-row DEFAULT handling for INSERT ... SELECT rules. 2023-02-23 10:57:46 +00:00
rewriteRemove.c Remove superfluous tqual.h includes. 2019-01-21 12:15:02 -08:00
rewriteSupport.c Remove superfluous tqual.h includes. 2019-01-21 12:15:02 -08:00
rowsecurity.c Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00