From: James Pittman <j.pittman@travelaudience.com>
To: pgsql-bugs@postgresql.org
Cc: Norbert Buchmüller <n.buchmueller@travelaudience.com>
Subject: BUG REPORT: GiST - default operator type for boolean
Date: Wed, 05 Nov 2014 16:13:29 +0100
Message-ID: <545A3E99.7020800@travelaudience.com> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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
Attachments:
signature.asc (application/pgp-signature, 818B) download
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: j.pittman@travelaudience.com, n.buchmueller@travelaudience.com
Subject: Re: BUG REPORT: GiST - default operator type for boolean
In-Reply-To: <545A3E99.7020800@travelaudience.com>
References: <545A3E99.7020800@travelaudience.com>
* 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