hstore ?& operator versus mathematics

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-hackers(at)postgreSQL(dot)org
Subject: hstore ?& operator versus mathematics
Date: 2011-01-09 21:10:25
Message-ID: 28266.1294607425@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

hstore's "hstore ?& text[]" operator is defined as "contains all", ie,
it will return true if all the key names found in the text array are
present in the hstore.

ISTM that a sane definition of this operator would provide that if the
array is empty, it returns true: every set contains the empty set.
However, the code goes out of its way to return false instead.

Perhaps this was done intentionally because there was no way to make
GIN index searches work compatibly ... but now there is, so I see no
reason to remain bug-compatible with this behavior.

Barring objections, I'm going to fix it.

regards, tom lane

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Noah Misch 2011-01-09 21:59:52 ALTER TYPE 0: Introduction; test cases
Previous Message Heikki Linnakangas 2011-01-09 19:38:06 Re: GiST insert algorithm rewrite