comparison: smallint & 2^extract(dow from date)

From: Travel Jadoo <jadoo(at)xs4all(dot)nl>
To: pgsql-general(at)postgresql(dot)org
Subject: comparison: smallint & 2^extract(dow from date)
Date: 2003-12-27 23:35:38
Message-ID: 1072568138.3776.75.camel@server
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

I used the & operator to evaluate whether a certain day would match the
days of operation of a flight.

In v7.2.3 I could use the following to do that:

select 127::smallint & 2^extract(dow from '17-7-2004'::date) != 0 );

In v7.3.4 I get now:

ERROR: Unable to identify an operator '&' for types 'smallint' and 'double precision'
You will have to retype this query using an explicit cast

I realise that the docs do say that extract returns a double but how am
I to figure this out ie recast I suppose but how should I do that?

Thanks,
Alfred

Browse pgsql-general by date

  From Date Subject
Next Message Christopher Murtagh 2003-12-28 00:08:27 Re: Is my MySQL Gaining ?
Previous Message Tom Lane 2003-12-27 23:16:54 Re: [GENERAL] Strange permission problem regarding pg_settings