Re: CREATE OR REPLACE FUNCTION now validates it's dependents

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: jian he <jian(dot)universality(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: CREATE OR REPLACE FUNCTION now validates it's dependents
Date: 2025-05-26 03:54:01
Message-ID: 542395.1748231641@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

jian he <jian(dot)universality(at)gmail(dot)com> writes:
> The attached patch allows CREATE OR REPLACE FUNCTION to correctly update domain
> constraints when the function they depend on is changed.

Why is this a problem that needs solving?

Our fundamental expectation is that domain constraints are immutable
(see the Notes section under CREATE DOMAIN [1]). If the user changes
a function used in a constraint in a way that changes its behavior,
that's their fault not our problem. I don't think we should add a
bunch of code (that we have to maintain) and a bunch of overhead for
every CREATE OR REPLACE FUNCTION in order to slap people on the wrist
if they get this wrong.

regards, tom lane

[1] https://www.postgresql.org/docs/current/sql-createdomain.html

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Smith 2025-05-26 05:07:25 Re: [WIP]Vertical Clustered Index (columnar store extension) - take2
Previous Message jian he 2025-05-26 03:36:22 CREATE OR REPLACE FUNCTION now validates it's dependents