[postgis-users] index tablespace handing in raster2psql broken

Sandro Santilli strk at keybit.net
Wed Jul 25 06:15:13 PDT 2012


Thanks for the contribution Kim, the best way to report bugs would
be on the bug tracker, can you do that ?

http://trac.osgeo.org/postgis/login
(just hit Cancel for instructions on how to get an OSGeo id).

--strk;

On Wed, Jul 25, 2012 at 02:36:13PM +0200, Kim Bisgaard wrote:
> Hi,
> 
> 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 : "")
> );
> 
> Furthermore is the raster2psql command installed into /usr and
> /usr/bin in the debian packages - I have not debugged this, so I do
> not know why. It may be in "make install" or something in Ubuntu’s
> packages.
> 
> Thanks for the very useful SW!
> 
> Regards,
> 
> -- 
> Kim Bisgaard
> 
> Application Development Division     Phone: +45 3915 7562 (direct)
> Danish Meteorological Institute      Fax: +45 3915 7460 (division)
> 
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users



More information about the postgis-users mailing list