Re: Controlling the usage of a user-defined cast

From: Sami Imseih <samimseih(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Controlling the usage of a user-defined cast
Date: 2024-12-12 23:11:54
Message-ID: AA7185E8-12F2-4EB4-ADB9-5DA9C028461E@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> The requirement for ownership of at least one type means that the
> example you give could only be done by a superuser.

That's correct; and superuser should be doing the right thing.

> 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.

Point taken.

Looking at [1] I wonder if there should be more emphasis on this point. The point
being that a user-defined cast has the ability to override the behavior of a cast
that can be performed implicitly.

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

Regards,

Sami
Amazon Web Services (AWS)

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Smith 2024-12-12 23:11:58 Re: Adding a '--two-phase' option to 'pg_createsubscriber' utility.
Previous Message Tomas Vondra 2024-12-12 23:05:49 Re: Parallel heap vacuum