How can I change a cast from explicit only to implicit? - Mailing list pgsql-general

From Julian Scarfe
Subject How can I change a cast from explicit only to implicit?
Date
Msg-id 029101c4d313$7fceb8b0$0600a8c0@Wilbur
Whole thread Raw
Responses Re: How can I change a cast from explicit only to implicit?
List pgsql-general
In 7.2.x

template1=# select point('1'::text, '2'::text);
 point
-------
 (1,2)
(1 row)

but in 7.4.x

template1=# select point('1'::text, '2'::text);
ERROR:  function point(text, text) does not exist
HINT:  No function matches the given name and argument types. You may need
to add explicit type casts.

                                          List of casts
         Source type         |         Target type         |      Function
|   Implicit?
-----------------------------+-----------------------------+----------------
-----+---------------
...
 text                        | double precision            | float8
| no

OK, so to make the cast work without explicit casts in the SQL, I need the
text to float8 (or another suitable numeric type) cast to be implicit.  But:

template1=# create cast (text as float8) with function float8(text) as
implicit;
ERROR:  cast from type text to type float8 already existsoat8(text) as
implicit;

template1=# drop cast (text as float8);
ERROR:  cannot drop cast from text to double precision because it is
required by the database system

So how can I force a built-in cast to become implicit?

Thanks

Julian Scarfe



pgsql-general by date:

Previous
From: Dave Smith
Date:
Subject: Re: Using IN with subselect
Next
From: Martijn van Oosterhout
Date:
Subject: Re: Using IN with subselect