Re: Controlling the usage of a user-defined cast - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Controlling the usage of a user-defined cast
Date
Msg-id 659109.1734022297@sss.pgh.pa.us
Whole thread Raw
In response to Controlling the usage of a user-defined cast  (Sami Imseih <samimseih@gmail.com>)
Responses Re: Controlling the usage of a user-defined cast
List pgsql-hackers
Sami Imseih <samimseih@gmail.com> writes:
> When a user-defined CAST is created, it has the ability to break behavior of built-in
> casts that could be performed implicitly, i.e. without a cast defined in pg_cast.

The requirement for ownership of at least one type means that the
example you give could only be done by a superuser.  I think there
could be an argument for requiring ownership of *both* types, but
perhaps that would break some useful cases.

> There is currently no way to prevent the usage of a user-defined cast. Should there be one?

I don't think so, and I don't see any reasonable way to do it.
You will get nowhere proposing a GUC that changes query semantics ---
we learned that that was a bad idea decades ago.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Allow subfield references without parentheses
Next
From: "David G. Johnston"
Date:
Subject: Re: Document NULL