Re: there is a way to deactivate type validation on 8.3.1???? - Mailing list pgsql-general

From Bill Moran
Subject Re: there is a way to deactivate type validation on 8.3.1????
Date
Msg-id 20100528143431.f9527fc5.wmoran@potentialtech.com
Whole thread Raw
In response to Re: there is a way to deactivate type validation on 8.3.1????  (Adrian Klaver <adrian.klaver@gmail.com>)
List pgsql-general
In response to Adrian Klaver <adrian.klaver@gmail.com>:

> On 05/28/2010 11:20 AM, erobles wrote:
> > hi!
> > only for ask, there is a way to deactivate type validation, so i can do
> >
> > select rtrim(number_field) from table ; with no error and the message:
> > "You might need to explicit type casts"
> >
> > this is postgres 8.3.1.
> >
>
> What are you trying to do? I am trying to think what rtrim does on a number.

It doesn't work on numbers, which is why he gets the "need type casts" error.

Direct answer to the question: no, there is no way to disable type validation,
it's a core feature and it wouldn't make sense.

Solution to your problem:
select rtrim(CAST(number_field AS TEXT)) from table;

Although I can't imagine why you'd be trying to trim whitespace from a
numeric field ... it will never have whitespace.

--
Bill Moran
http://www.potentialtech.com
http://people.collaborativefusion.com/~wmoran/

pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: there is a way to deactivate type validation on 8.3.1????
Next
From: Gary Fu
Date:
Subject: Re: No lidbl.so in libpq.so (postgresql 8.4.4)