Re: Implicit coercions need to be reined in - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: Implicit coercions need to be reined in
Date
Msg-id Pine.LNX.4.30.0111221640400.766-100000@peter.localdomain
Whole thread Raw
In response to Implicit coercions need to be reined in  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Implicit coercions need to be reined in
List pgsql-hackers
Tom Lane writes:

> What I'd like to suggest (for 7.3 or later) is adding a boolean column
> to pg_proc that indicates "can be implicit coercion".

Great!  I've always wished for this sort of thing.

I think from this there are only a few more steps to the full SQL99
specification of user-defined casts.  In particular it'd involve two
boolean flags: one that means "this is a cast function" (the function is
used internally for a CAST() invocation), and one for allowing it to be
used for automatic conversion.  We currently don't have the first one on
the radar because we use the function name and argument types as the
indicator.

One more thing is that instead of looking up a cast function from type A
to type B as "returns A, is named A, takes arg B" it could be looked up as
"returns A, takes arg B, is a cast function", which would generalize this
whole thing a bit more.

References: SQL99 Part 2 11.49, 11.52  (I haven't read the whole thing,
but I think it's the idea.)

-- 
Peter Eisentraut   peter_e@gmx.net



pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: OCTET_LENGTH is wrong
Next
From: Tom Lane
Date:
Subject: Re: OCTET_LENGTH is wrong