Re: Implicit coercions need to be reined in

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Implicit coercions need to be reined in
Date: 2001-11-22 16:29:39
Message-ID: Pine.LNX.4.30.0111221640400.766-100000@peter.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)gmx(dot)net

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2001-11-22 16:29:57 Re: OCTET_LENGTH is wrong
Previous Message Peter Eisentraut 2001-11-22 16:29:09 Re: postgresql.conf (Proposed settings)