Re: NUMERIC and arithmetics

Поиск
Список
Период
Сортировка
От Christoph Dalitz
Тема Re: NUMERIC and arithmetics
Дата
Msg-id 20020919152516.3062958c.christoph.dalitz@hs-niederrhein.de
обсуждение исходный текст
Ответ на Re: NUMERIC and arithmetics  (Martijn van Oosterhout <kleptog@svana.org>)
Ответы Re: NUMERIC and arithmetics  (Martijn van Oosterhout <kleptog@svana.org>)
Список pgsql-general
On Thu, 19 Sep 2002 22:57:28 +1000
Martijn van Oosterhout <kleptog@svana.org> wrote:
> >
> >     ERROR:  Unable to identify an operator '>' for types 'numeric' and 'float8'
> >
> > preis is typed NUMERIC(8,2). Strangely, "preis > 3" works.
> >
>
> If you do:
>
> delete from produkt where preis > '3.00';
>
> it works fine. I'm thinking we could save ourselves a lot of hassle by
> requiring all constants to be quoted :)
>
This is strange. I thought '3.00' would be a string constant, ie. of type
VARCHAR. In Oracle 3.00 is a number constant and '3.00' a string constant
which needs to be explicitly converted with to_number().

Does this mean that string constants in PostgreSQL are implicitly cast to
numeric when '>' is used? Or is preis implicitly cast to VARCHAR and the
comparison is not done numeric but according to the ASCII table?

Christoph Dalitz

В списке pgsql-general по дате отправления:

Предыдущее
От: Chris Bowlby
Дата:
Сообщение: Re: array issue....
Следующее
От: "Robert Treat"
Дата:
Сообщение: Re: [HACKERS] PGXLOG variable worthwhile?