BUG #18464: Replacing a SQL function silently drops the generated columns that use this function - Mailing list pgsql-bugs

From PG Bug reporting form
Subject BUG #18464: Replacing a SQL function silently drops the generated columns that use this function
Date
Msg-id 18464-9f1edc4037b65003@postgresql.org
Whole thread Raw
Responses Re: BUG #18464: Replacing a SQL function silently drops the generated columns that use this function
Re: BUG #18464: Replacing a SQL function silently drops the generated columns that use this function
List pgsql-bugs
The following bug has been logged on the website:

Bug reference:      18464
Logged by:          Rémi Cura
Email address:      remi.cura@gmail.com
PostgreSQL version: 14.10
Operating system:   Linux
Description:

I have a SQL function that I defined myself. Let's call it MyFunction().
I use MyFunction in generated columns of 2 distinct tables.
Whe trying to delete MyFunction, the DB correctly raises an error.
However, when I `CREATE OR REPLACE` this existing function in place, the DB
silently drop all the generated columns depending on this function.
This is not the expected behavior.
I should get either an error, or no columns should be dropped.
if they are dropped, I should get at the very least a warning.

This is pretty major: having columns disappear magically on prod dbs is not
what postgres usually do.


pgsql-bugs by date:

Previous
From: Dmitry Dolgov
Date:
Subject: Re: BUG #18463: Possible bug in stored procedures with polymorphic OUT parameters
Next
From: Muhammad Waqas
Date:
Subject: Re: BUG #18464: Replacing a SQL function silently drops the generated columns that use this function