473,385 Members | 1,329 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Trying to create a GiST index in 7.3

Hi, everybody!

I am trying to create a custom GiST index in 7.3, but getting an error,
that I don't know how to interpret:

testdb=# create table gist_test (field int8);
CREATE TABLE
testdb=# create index gist_idx on gist_test using gist (field);
ERROR: data type bigint has no default operator class for access method
"gist"
You must specify an operator class for the index or define a
default operator class for the data type
testdb=#

I have done all the setup that was required in 7.2.4:

testdb=# select * from pg_opclass where opcname = 'gist_index_ops';
-[ RECORD 1 ]+--------------
opcamid | 783
opcname | gist_index_ops
opcnamespace |
opcowner |
opcintype | 20
opcdefault | t
opckeytype | 0
testb=# select * from pg_am where oid=783;
-[ RECORD 1 ]---+-----------------
amname | gist
amowner | 1
amstrategies | 100
amsupport | 7
amorderstrategy | 0
amcanunique | f
amcanmulticol | t
amindexnulls | f
amconcurrent | f
amgettuple | gistgettuple
aminsert | gistinsert
ambeginscan | gistbeginscan
amrescan | gistrescan
amendscan | gistendscan
ammarkpos | gistmarkpos
amrestrpos | gistrestrpos
ambuild | gistbuild
ambulkdelete | gistbulkdelete
amcostestimate | gistcostestimate

rapidb=# select * from pg_type where oid=20;
-[ RECORD 1 ]-+--------
typname | int8
typnamespace | 11
typowner | 1
typlen | 8
typbyval | f
typtype | b
typisdefined | t
typdelim | ,
typrelid | 0
typelem | 0
typinput | int8in
typoutput | int8out
typalign | d
typstorage | p
typnotnull | f
typbasetype | 0
typtypmod | -1
typndims | 0
typdefaultbin |
typdefault |
Any ideas what's missing? Is there anything new in 7.3, that I have to do?

Thanks a lot!

Dima

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ma*******@postgresql.org)

Nov 11 '05 #1
4 2709
Dmitry Tkach <dm****@openratings.com> writes:
I am trying to create a custom GiST index in 7.3, but getting an error,
...
I have done all the setup that was required in 7.2.4:
You should not be using the 7.2 methods anymore --- there is a CREATE
OPERATOR CLASS, use that instead. (See the contrib gist classes for
examples.)
testdb=# select * from pg_opclass where opcname = 'gist_index_ops';
-[ RECORD 1 ]+--------------
opcamid | 783
opcname | gist_index_ops
opcnamespace |
opcowner |
opcintype | 20
opcdefault | t
opckeytype | 0


Those NULL fields probably explain your problems ... (the fields are
marked NOT NULL, but due to an oversight, the constraint is not
enforced against core system catalogs in 7.3 :-()

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postgresql.org so that your
message can get through to the mailing list cleanly

Nov 11 '05 #2
On Fri, 2003-08-08 at 16:08, Tom Lane wrote:
Dmitry Tkach <dm****@openratings.com> writes:
I am trying to create a custom GiST index in 7.3, but getting an error,
...
I have done all the setup that was required in 7.2.4:


You should not be using the 7.2 methods anymore --- there is a CREATE
OPERATOR CLASS, use that instead. (See the contrib gist classes for
examples.)


I'm having the same problem as Dmitry, but I've been unable to find a
solution. I've looked everywhere googleable for info on setting up GiST
indexes, but haven't found any info that doesn't look like post-doc
papers on the theory of indexability.

I'd be happy with an RTFM response, if I could just find TFM. :-)

Any info would be much appreciated.

Cheers,

Chris

--
Christopher Murtagh
Enterprise Systems Administrator
ISR / Web Communications Group
McGill University
Montreal, Quebec
Canada

Tel.: (514) 398-3122
Fax: (514) 398-2017

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 11 '05 #3
Hi there,

I'm back from vacation and clearing my mbox.
I intended to write documentation about GiST, but other things grab attention :)
There is quite short intro in Russian
http://www.sai.msu.su/~megera/postgr...teface-r.shtml
and a bunch of GiST modules
http://www.sai.msu.su/~megera/postgres/gist/
so you may learn by examples.

Oleg

On Wed, 17 Sep 2003, Christopher Murtagh wrote:
On Fri, 2003-08-08 at 16:08, Tom Lane wrote:
Dmitry Tkach <dm****@openratings.com> writes:
I am trying to create a custom GiST index in 7.3, but getting an error,
...
I have done all the setup that was required in 7.2.4:


You should not be using the 7.2 methods anymore --- there is a CREATE
OPERATOR CLASS, use that instead. (See the contrib gist classes for
examples.)


I'm having the same problem as Dmitry, but I've been unable to find a
solution. I've looked everywhere googleable for info on setting up GiST
indexes, but haven't found any info that doesn't look like post-doc
papers on the theory of indexability.

I'd be happy with an RTFM response, if I could just find TFM. :-)

Any info would be much appreciated.

Cheers,

Chris


Regards,
Oleg
__________________________________________________ ___________
Oleg Bartunov, sci.researcher, hostmaster of AstroNet,
Sternberg Astronomical Institute, Moscow University (Russia)
Internet: ol**@sai.msu.su, http://www.sai.msu.su/~megera/
phone: +007(095)939-16-83, +007(095)939-23-83

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ma*******@postgresql.org)

Nov 11 '05 #4
Christopher Murtagh <ch*****************@mcgill.ca> writes:
On Fri, 2003-08-08 at 16:08, Tom Lane wrote:
You should not be using the 7.2 methods anymore --- there is a CREATE
OPERATOR CLASS, use that instead. (See the contrib gist classes for
examples.)
I'm having the same problem as Dmitry, but I've been unable to find a
solution. I've looked everywhere googleable for info on setting up GiST
indexes, but haven't found any info that doesn't look like post-doc
papers on the theory of indexability.


That's about what there is AFAIK :-(. GiST suffers from a horrible lack
of documentation other than the original academic papers, which is one
of the reasons it's still not mainstream (although I'm not entirely sure
which is cause and which is effect here...)

However, if you have a working 7.2 opclass definition, it shouldn't be
that hard to make it into a 7.3 CREATE OPERATOR CLASS command. Compare
the 7.2 and 7.3 versions of any of the contrib GiST modules' sql.in
files, and all should become reasonably clear. The same basic
information is being supplied in both cases (operator names and strategy
numbers), 7.3 just does it with a much higher-level notation. For
instance, this part of 7.2's contrib/cube/cube.sql.in:

-- cube_left
INSERT INTO pg_amop (amopclaid, amopstrategy, amopreqcheck, amopopr)
SELECT opcl.oid, 1, false, c.opoid
FROM pg_opclass opcl, gist_cube_ops_tmp c
WHERE
opcamid = (SELECT oid FROM pg_am WHERE amname = 'gist')
and opcname = 'gist_cube_ops'
and c.oprname = '<<';

is replaced by a single line in 7.3's CREATE OPERATOR CLASS command:

OPERATOR 1 << ,

In particular look at this diff:
http://developer.postgresql.org/cvsw...?r1=1.4&r2=1.5

You might also want to study the docs for the pg_opclass, pg_amop,
and pg_amproc system catalogs, to clarify what the original code was
doing.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 11 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Denis St-Michel | last post by:
Hello All, Hope some Guru will be able to help me with this. Let's take this example table A ------------------------------------------------------------------------------- id | ...
65
by: Roger Smythe | last post by:
A means for the progressive decomposition a problem space into increasingly simpler component parts such that these component parts represent higher levels of conceptual abstraction, and are...
4
by: Peter Scott | last post by:
I created a table that has a column in that needs to contain a full Unix file path. Since 2048 was too long for a VARCHAR, I made it TEXT. I since populated the table. Now I want to make the...
0
by: George Essig | last post by:
I have installed tsearch2 and have noticed that the gist index used to do searches grows and grows as I update rows, delete rows, or run VACUUM FULL ANALYZE. Below are some details: PostgreSQL...
3
by: Eric Davies | last post by:
We've implemented a 5D box data type and have implemented both RTree and GiST access methods under PostgresSQL 7.4 and PostgresSQL 7.4.1. The 5D box internally looks like: struct Box5D{ float...
1
by: Greg Stark | last post by:
What does this mean? test=> create index cache_i_gist_sl on cache using gist (r_id, sl_ids); ERROR: index row requires 8216 bytes, maximum size is 8191 Postgres 7.4.2 I have btree_gist and...
3
by: David Thielen | last post by:
Hi; I created a virtual directory in IIS 6.0 and my asp.net app runs fine. But when it tries to write a file I get: Access to the path is denied. - C:\Inetpub\wwwroot\RunReportASP\images ...
5
by: snicks | last post by:
I'm trying to exec a program external to my ASP.NET app using the following code. The external app is a VB.NET application. Dim sPPTOut As String sPPTOut = MDEPDirStr + sID + ".ppt" Dim p As...
20
by: walterbyrd | last post by:
Reading "Think Like a Computer Scientist" I am not sure I understand the way it describes the way objects work with Python. 1) Can attributes can added just anywhere? I create an object called...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.