Re: How can I change a cast from explicit only to implicit?

From: "Julian Scarfe" <julian(at)avbrief(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: How can I change a cast from explicit only to implicit?
Date: 2004-11-25 18:56:23
Message-ID: 02d501c4d320$76e1f2f0$0600a8c0@Wilbur
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

From: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>

> > So how can I force a built-in cast to become implicit?
>
> If you're intent on doing that, you can change its entry in pg_cast.
> But I think you'd be far better off to fix your application. Implicit
> casts across type categories have a habit of kicking in when you least
> expected it, causing the backend to adopt surprising and unpleasant
> interpretations of straightforward-looking queries. If you check the
> pgsql-bugs archives you will find some of the examples that prompted us
> to change this cast to non-implicit...

It's a fair point, Tom. Having developed the code with 7.2, we are looking
for the simplest way to recreate backward compatible behaviour in 7.4. Sure
enough, we'll flag the code for revision next time it gets an overhaul, but
a single change to the database would be preferable in the short term. I
think the current default of these casts being explicit only is sensible.

Thanks

Julian

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Dave Smith 2004-11-25 19:09:41 Re: Using IN with subselect
Previous Message Tom Lane 2004-11-25 18:02:21 Re: How can I change a cast from explicit only to implicit?