Numeric to integer Type conversion

Поиск
Список
Период
Сортировка
От Saravanan Bellan
Тема Numeric to integer Type conversion
Дата
Msg-id D3B33C1884C0DC49A4DDBBDE36766B4C04367789@svlxchcln6.enterprise.veritas.com
обсуждение исходный текст
Ответы Re: Numeric to integer Type conversion  ("A. Kretschmer" <andreas.kretschmer@schollglas.com>)
Список pgsql-general
We have database table with the following columns,

     foo
------------------
name VARCHAR(20)
bar  NUMERIC(20,0)

We were running version 7.2.1 until now.

The following SQL used to work fine in 7.2.1,

SELECT name FROM foo WHERE (bar & 64) <> 0;


Now we upgraded to version 8.1.5 and getting the error,

ERROR:  operator does not exist: numeric & integer
HINT:  No operator matches the given name and argument type(s). You may
need to add explicit type casts.

NUMERIC(20,0) is probably not the best way to define a column to be used
for bit arithmetic, but we cant change the column type because of
legacy.

Is there anyway I can get the existing SQL to work without any changes
on the application side.


Thanks,


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

Предыдущее
От: "A. Kretschmer"
Дата:
Сообщение: Re: Postgresql.conf
Следующее
От: "A. Kretschmer"
Дата:
Сообщение: Re: Numeric to integer Type conversion