pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruno Wolff III <bruno@wolff.to>
To: Rudi Starcevic <rudi@oasis.net.au>
Cc: pgsql-sql@postgresql.org
Subject: Re: Bitwise operation
Date: Mon, 30 Jun 2003 07:42:49 -0500
Message-ID: <20030630124249.GB26142@wolff.to> (raw)
In-Reply-To: <20030630122815.M76087@oasis.net.au>
References: <20030630122815.M76087@oasis.net.au>

On Mon, Jun 30, 2003 at 22:28:15 +1000,
  Rudi Starcevic <rudi@oasis.net.au> wrote:
> 
> Hi,
> 
> I'm learning to use Postgresql's bitwise operator's as I'm interested
> in building super fast search's based on user selections in web forms.
> 
> So far so good but I have just lost it a little so I thought I'd post.
> Please growl at me if I'm asking on the wrong list :-)
> 
> I understand this:
> 
> SELECT 111 & 11 = 11
> 
> but not this
> 
> SELECT 1111 & 111 = 71
> 
> I was expecting the second example to be 
> 
> SELECT 1111 & 111 = 111

In the above examples the numbers are decimal values.

Maybe you wanted to do something like the following:

area=> select b'1111' & b'0111';
 ?column?
----------
 0111
(1 row)



view thread (4+ messages)  latest in thread

Message-ID: <20030630124249.GB26142@wolff.to>
Permalink:  ../20030630124249.GB26142@wolff.to/
Also on:    postgresql.org/message-id/20030630124249.GB26142@wolff.to

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: bruno@wolff.to, rudi@oasis.net.au
  Subject: Re: Bitwise operation
  In-Reply-To: <20030630124249.GB26142@wolff.to>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox