[postgis-users] Possible Problem with "Hard Upgrade"instructions (UNCLASSIFIED)

Cowart, Donald Z SAJ Contractor Donald.Z.Cowart at saj02.usace.army.mil
Wed Dec 13 06:31:51 PST 2006


Classification:  UNCLASSIFIED 
Caveats: NONE

> 
> Hello,
> 
> strk at refractions.net schrieb:
> 
> > > So the fix would be to use:
> > >
> > > 	$ psql newdb
> > > 	newdb=> truncate spatial_ref_sys;
> > > 	TRUNCATE TABLE
> > > 	newdb=> \i spatial_ref_sys.sql
> >
> > Is 'truncate' available back to PostgreSQL 7.1 ?
> 
> Alternatively, "DELETE FROM spatial_ref_sys;" should work (albeit
> beeing a bit slower than TRUNCATE).
> 

http://www.postgresql.org/docs/7.1/static/sql-truncate.html  

Yes, according to the 7.1 docs the truncate command is there, but it also
states that it's not part of the SQL92 standard, so the "DELETE FROM
spatial_ref_sys" is probably the most portable way to do it.  

...

After a little checking yes, "Delete from" really is the better way to do it.
There are various different caveats with each version of postgresql about
that version of the truncate command.  Using "Delete from" keeps it simple
and portable across postgresql versions. Kudos to Markus.

> 
> HTH,
> Markus
> 
> --
> Markus Schaber | Logical Tracking&Tracing International AG
> Dipl. Inf.     | Software Development GIS
> 


--Donald

GIS Web Architect
Jacksonville, FL
Classification:  UNCLASSIFIED 
Caveats: NONE




More information about the postgis-users mailing list