Thread: 'bitwise and' index

'bitwise and' index

From
Lance Jacob
Date:
I have an Oracle database that I migrated to Postgres.  I’ve been successful with everything except the creation of one index.  On the oracle side the index was created with the syntax “create index abc on xyz (bitand(column_name,16384))”.  What would be the proper syntax for creating a similar bitwise function-based index in Postgres?  Or, is it even possible?

LanceJacob



NOTICE: This email message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.

Re: 'bitwise and' index

From
Igor Neyman
Date:

 

 

From: pgsql-sql-owner@postgresql.org [mailto:pgsql-sql-owner@postgresql.org] On Behalf Of Lance Jacob
Sent: Friday, March 20, 2015 1:28 PM
To: pgsql-sql@postgresql.org
Subject: [SQL] 'bitwise and' index

 

I have an Oracle database that I migrated to Postgres.  I’ve been successful with everything except the creation of one index.  On the oracle side the index was created with the syntax “create index abc on xyz (bitand(column_name,16384))”.  What would be the proper syntax for creating a similar bitwise function-based index in Postgres?  Or, is it even possible?

 

LanceJacob

 


Try:

create index abc on xyz (column_name & 16384);

 

Regards,

Igor Neyman