Re: BUG #18464: Replacing a SQL function silently drops the generated columns that use this function

From: Muhammad Waqas <waqas(dot)m(at)bitnine(dot)net>
To: remi(dot)cura(at)gmail(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #18464: Replacing a SQL function silently drops the generated columns that use this function
Date: 2024-05-14 15:42:46
Message-ID: CAHYHq4WcbMZnz9hQQgpEn-KCqrQfcz+NQcP3gdD4YSLrogsDmQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

When you drop any object with cascade option all associated object will be
dropped. That is the normal behavior just and other behavior is not normal

2024년 5월 14일 (화) 오후 8:37, PG Bug reporting form <noreply(at)postgresql(dot)org>님이
작성:

> The following bug has been logged on the website:
>
> Bug reference: 18464
> Logged by: Rémi Cura
> Email address: remi(dot)cura(at)gmail(dot)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.
>
>

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Laurenz Albe 2024-05-14 15:45:35 Re: BUG #18362: unaccent rules and Old Greek text
Previous Message PG Bug reporting form 2024-05-14 15:26:15 BUG #18464: Replacing a SQL function silently drops the generated columns that use this function