Re: there is a way to deactivate type validation on 8.3.1????

From: Bill Moran <wmoran(at)potentialtech(dot)com>
To: Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com>
Cc: erobles <erobles(at)sensacd(dot)com(dot)mx>, pgsql-general(at)postgresql(dot)org
Subject: Re: there is a way to deactivate type validation on 8.3.1????
Date: 2010-05-28 18:34:31
Message-ID: 20100528143431.f9527fc5.wmoran@potentialtech.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

In response to Adrian Klaver <adrian(dot)klaver(at)gmail(dot)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/

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Wilcox 2010-05-28 18:39:56 Re: Out of Memory and Configuration Problems (Big Computer)
Previous Message Adrian Klaver 2010-05-28 18:26:41 Re: there is a way to deactivate type validation on 8.3.1????