Numeric to integer Type conversion - Mailing list pgsql-general

From Saravanan Bellan
Subject Numeric to integer Type conversion
Date
Msg-id D3B33C1884C0DC49A4DDBBDE36766B4C04367789@svlxchcln6.enterprise.veritas.com
Whole thread Raw
Responses Re: Numeric to integer Type conversion
List 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 by date:

Previous
From: "A. Kretschmer"
Date:
Subject: Re: Postgresql.conf
Next
From: "A. Kretschmer"
Date:
Subject: Re: Numeric to integer Type conversion