Hi hacker,

Before getting into reviewing this feature, I read through the thread
first.  I don't understand it in detail yet, but just going by the
discussion, a thought occurred to me:

> About the main feature patch: I'm not a fan of the CREATE CAST
> ... WITH SAFE FUNCTION syntax.  First, the CREATE CAST syntax is part
> of the SQL standard.  [...]  Second, we didn't do this when we
> introduced error-safe type input functions.  There is a note on the
> CREATE TYPE man page that use of ereturn() is encouraged, and then we
> left it to extension authors to do the right thing.

To me this reads more like a property of the function than of the cast.
I don't fully understand what "safe" means here, but it seems to be
something a function either does or doesn't, regardless of which cast
references it.  So if we mark it anywhere, wouldn't CREATE FUNCTION be a
more natural place than CREATE CAST?

CREATE FUNCTION already carries non-standard attributes of this kind.

If it lived on the function, a cast wouldn't need any marker of its own
-- it would just use whatever function it already references, and
CREATE CAST could stay exactly as the standard has it.

I haven't worked through the details, so this is a direction to consider
rather than a concrete proposal.

Best regards,
Henson

Reply via email to