BUG REPORT: GiST - default operator type for boolean

From: James Pittman <j(dot)pittman(at)travelaudience(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Cc: Norbert Buchmüller <n(dot)buchmueller(at)travelaudience(dot)com>
Subject: BUG REPORT: GiST - default operator type for boolean
Date: 2014-11-05 15:13:29
Message-ID: 545A3E99.7020800@travelaudience.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Apologies if this is more of a 'feature request' than a bug. I thought
I'd repeat it as it seems an unusual missing feature.

With btree_gist it does not apepar possible to use the equals constraint
with a boolean type.

Therefore this (slightly contrived) example fails:

CREATE TABLE meetings_calendar (
id serial,
firstname varchar NOT NULL,
meeting_time daterange NOT NULL,
is_alternative_schedule boolean NOT NULL,
PRIMARY KEY (id),
CONSTRAINT no_time_overlap_except_alternative
EXCLUDE USING gist
(meeting_time WITH &&, is_alternative_schedule WITH =)

);

ERROR: data type boolean has no default operator class for access
method "gist"

My workaround is to recast the boolean to an integer in the constraint
itself.

CONSTRAINT no_time_overlap_except_alternative
EXCLUDE USING gist
(meeting_time WITH &&, (is_alternative_schedule::int) WITH =)

This however, only works with btree_gist - unexpended GiST does not have
a default operator for integers either.

Therefore it might be worth considering this as a feature enhancement.
Apologies if this is already on the TODO list. The GiST documentation
was quite weighty and it did not seem obvious if this has been discussed.

Eitherway, I hope this request is of assistance

Kind regards,

James

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2014-11-05 15:13:42 Re: BUG REPORT: Unable to cast boolean::smallint
Previous Message gauchard 2014-11-05 14:44:48 BUG #11882: make HAVE_WORKING_LINK an option