[postgis-devel] [PostGIS] #1932: index tablespace handing in raster2psql broken

PostGIS trac at osgeo.org
Wed Jul 25 06:26:53 PDT 2012


#1932: index tablespace handing in raster2psql broken
---------------------------+------------------------------------------------
 Reporter:  kib            |       Owner:  mcayland     
     Type:  defect         |      Status:  new          
 Priority:  medium         |   Milestone:  PostGIS 2.0.2
Component:  loader/dumper  |     Version:  2.0.x        
 Keywords:                 |  
---------------------------+------------------------------------------------
 I tried using "-X" option for raster2psql but got a PostgreSQL syntax
 error.

 raster2psql in version 2.0.1 outputs the following SQL:
 {{{
 CREATE TABLE "2mt_20120802_00" ("rid" serial PRIMARY KEY,"rast" raster)
 USING INDEX TABLESPACE "data"
 TABLESPACE "data";
 }}}
 while the correct PostgreSQL 9.1 syntax is:
 {{{
 CREATE TABLE "2mt_20120802_00" ("rid" serial PRIMARY KEY USING INDEX
 TABLESPACE "data","rast" raster)
 TABLESPACE "data";
 }}}
 where as it can be changed to use correct PostgreSQL syntax by changing
 code in raster/loader/raster2psql.c line 899 to:

 {{{
 sprintf(sql, "CREATE TABLE %s%s (\"rid\" serial PRIMARY KEY%s%s,%s
 raster%s)%s%s;",
 (schema != NULL ? schema : ""),
 table,
 (idx_tablespace != NULL ? " USING INDEX TABLESPACE " : ""),
 (idx_tablespace != NULL ? idx_tablespace : ""),
 column,
 (file_column ? ",\"filename\" text" : ""),
 (tablespace != NULL ? " TABLESPACE " : ""),
 (tablespace != NULL ? tablespace : "")
 );
 }}}

-- 
Ticket URL: <http://trac.osgeo.org/postgis/ticket/1932>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-devel mailing list