Re: CREATE OR REPLACE FUNCTION now validates it's dependents - Mailing list pgsql-hackers

From Tom Lane
Subject Re: CREATE OR REPLACE FUNCTION now validates it's dependents
Date
Msg-id 542395.1748231641@sss.pgh.pa.us
Whole thread Raw
In response to CREATE OR REPLACE FUNCTION now validates it's dependents  (jian he <jian.universality@gmail.com>)
List pgsql-hackers
jian he <jian.universality@gmail.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



pgsql-hackers by date:

Previous
From: jian he
Date:
Subject: CREATE OR REPLACE FUNCTION now validates it's dependents
Next
From: Peter Eisentraut
Date:
Subject: Re: SQL:2011 application time