can't reproduce example

Started by Nonameover 8 years ago3 messagesdocs
Jump to latest
#1Noname
herve@duchesne.me

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/9.5/static/rangetypes.html
Description:

I tried to reproduce the example :
CREATE EXTENSION btree_gist;
CREATE TABLE room_reservation (
room text,
during tsrange,
EXCLUDE USING GIST (room WITH =, during WITH &&)
);

but I got this error :
ERROR: data type text has no default operator class for access method
"gist"
HINT: You must specify an operator class for the index or define a default
operator class for the data type.

That means by default nobody is able to reproduce your example... Howto use
gist with text or varchar?

--
Sent via pgsql-docs mailing list (pgsql-docs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-docs

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Noname (#1)
Re: can't reproduce example

herve@duchesne.me writes:

I tried to reproduce the example :
CREATE EXTENSION btree_gist;
CREATE TABLE room_reservation (
room text,
during tsrange,
EXCLUDE USING GIST (room WITH =, during WITH &&)
);

but I got this error :
ERROR: data type text has no default operator class for access method
"gist"

It works for me. You sure you installed the extension successfully?

regards, tom lane

--
Sent via pgsql-docs mailing list (pgsql-docs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-docs

#3Herve Duchesne
hduchesn@gmail.com
In reply to: Tom Lane (#2)
Re: can't reproduce example

You are right,

CREATE EXTENSION btree_gist;

the command failed because I was not superuser. I did it as postgres
user and It works now.

Thanks.

Le 22/09/2017 à 17:47, Tom Lane a écrit :

herve@duchesne.me writes:

I tried to reproduce the example :
CREATE EXTENSION btree_gist;
CREATE TABLE room_reservation (
room text,
during tsrange,
EXCLUDE USING GIST (room WITH =, during WITH &&)
);
but I got this error :
ERROR: data type text has no default operator class for access method
"gist"

It works for me. You sure you installed the extension successfully?

regards, tom lane

--
Sent via pgsql-docs mailing list (pgsql-docs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-docs