Numeric to integer Type conversion

From: "Saravanan Bellan" <saravanan_bellan(at)symantec(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Numeric to integer Type conversion
Date: 2007-01-24 07:47:08
Message-ID: D3B33C1884C0DC49A4DDBBDE36766B4C04367789@svlxchcln6.enterprise.veritas.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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,

Responses

Browse pgsql-general by date

  From Date Subject
Next Message A. Kretschmer 2007-01-24 08:58:58 Re: Numeric to integer Type conversion
Previous Message pankaj_wolfhunter@yahoo.co.in 2007-01-24 07:13:02 NETEZZA cursors, anyone?