"Julian Scarfe" <julian.scarfe@ntlworld.com> writes:
> 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:
> ...
> 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...
regards, tom lane