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

Поиск
Список
Период
Сортировка
От Bill Moran
Тема Re: there is a way to deactivate type validation on 8.3.1????
Дата
Msg-id 20100528143431.f9527fc5.wmoran@potentialtech.com
обсуждение исходный текст
Ответ на Re: there is a way to deactivate type validation on 8.3.1????  (Adrian Klaver <adrian.klaver@gmail.com>)
Список 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 по дате отправления:

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: there is a way to deactivate type validation on 8.3.1????
Следующее
От: Gary Fu
Дата:
Сообщение: Re: No lidbl.so in libpq.so (postgresql 8.4.4)