pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: remi.cura@gmail.com
Subject: BUG #18464: Replacing a SQL function silently drops the generated columns that use this function
Date: Tue, 14 May 2024 15:26:15 +0000
Message-ID: <18464-9f1edc4037b65003@postgresql.org> (raw)

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.



view thread (6+ messages)  latest in thread

Message-ID: <18464-9f1edc4037b65003@postgresql.org>
Permalink:  ../18464-9f1edc4037b65003@postgresql.org/
Also on:    postgresql.org/message-id/18464-9f1edc4037b65003@postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, remi.cura@gmail.com
  Subject: Re: BUG #18464: Replacing a SQL function silently drops the generated columns that use this function
  In-Reply-To: <18464-9f1edc4037b65003@postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox