Ticket #1091 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

shp2pgsql gui wrong use of create spatial index

Reported by: aperi2007 Owned by: pramsey
Priority: blocker Milestone: PostGIS 2.0.0
Component: postgis Version: trunk
Keywords: Cc:

Description

Hi, using the postgis 200 experimental version for windows (r7518). I try to use the shp2pgsql-gui to import a shapefile and set the create spatial index option. After I see this well knowed error:

Failed SQL begins: "CREATE INDEX "am_com_region_am_com_geom_gist" ON "public"."am_com_region_am_com" USING GIST ("geom" gist_geometry_ops);
COMMIT;
"
Failed in pgui_exec(): ERROR:  operator class "gist_geometry_ops" does not exist for access method "gist"

Regards,

Change History

  Changed 3 years ago by robe

  • priority changed from medium to blocker

  Changed 3 years ago by robe

  • priority changed from blocker to medium

follow-up: ↓ 5   Changed 3 years ago by robe

Andrea,

Are you using this on a new PostGIS 2.0 database or an older one or a 1.5 one?

Hmm perhaps our loader no longer works with PostGIS 1.5. That would be a big bummer.

  Changed 3 years ago by robe

  • priority changed from medium to blocker

I see what you are saying now -- same issue as:

#1021

Another one of Paul's monsters not slain hiding in the closet.

in reply to: ↑ 3   Changed 3 years ago by aperi2007

NO, is a new database created just today using the postgis-200 r7518 experimental for windows.

It work unchecking the "create spatial index".

After, I see the same error in a my script where I have the same sintax

create index... using gist("geom" gist_geometry_ops)

but it was easy resolved removing the "gist_geometry_ops" string.

Replying to robe:

Andrea, Are you using this on a new PostGIS 2.0 database or an older one or a 1.5 one? Hmm perhaps our loader no longer works with PostGIS 1.5. That would be a big bummer.

  Changed 3 years ago by robe

I guess the command line will have the same issue? The problem seems to be at:

http://trac.osgeo.org/postgis/browser/trunk/loader/shp2pgsql-core.c#L1722

I'd change it myself, but I'm not sure what the right thing would be to do now that we support nd indexes. We might need another option or just always build 2D indexes by default. So I'll leave it to Paul to decide.

  Changed 3 years ago by dmiranda

Still not fixed with postgis 2.0.0SVN (R7856, Last Changed Date: 2011-09-15 14:43:57). I am using postgresql 9.1. Removing the gist_geometry_ops from the create index line solves the problem.

  Changed 3 years ago by pramsey

  • status changed from new to closed
  • resolution set to fixed

I think the best answer for a quick fix is to remove the opclass specification entirely and let the default opclass rule. I've done this at r7862. In the Future, we might want to provide an option to build the n-d index, in which case we'll have to add another option in the GUI.

Note: See TracTickets for help on using tickets.