[postgis-users] more effective way?
I have a postgis table that contains radar. My problem is every 3 minutes I update the radar table and sometimes the end user has no radar showing due to the new data loading is there a more effective way than doing it like I am with the following code, shp2pgsql -D -a -s 4269 last.shp base05 base05.sql psql -c TRUNCATE TABLE base05 -d wxserver psql -d wxserver -f base05.sql I was dropping the table but that would cause my wms server to freakout. ___ postgis-users mailing list postgis-users@postgis.refractions.net http://postgis.refractions.net/mailman/listinfo/postgis-users
Re: [postgis-users] more effective way?
You can run ddl in a transaction context, so the best way is to . Upload data to mynewtable . Begin . Alter table mytable rename to myoldtable . Alter table mynewtable rename to mytable . Commit . Drop table myoldtable P. On 2012-06-03, at 7:02 AM, chris brisendine ki4...@gmail.com wrote: I have a postgis table that contains radar. My problem is every 3 minutes I update the radar table and sometimes the end user has no radar showing due to the new data loading is there a more effective way than doing it like I am with the following code, shp2pgsql -D -a -s 4269 last.shp base05 base05.sql psql -c TRUNCATE TABLE base05 -d wxserver psql -d wxserver -f base05.sql I was dropping the table but that would cause my wms server to freakout. ___ postgis-users mailing list postgis-users@postgis.refractions.net http://postgis.refractions.net/mailman/listinfo/postgis-users ___ postgis-users mailing list postgis-users@postgis.refractions.net http://postgis.refractions.net/mailman/listinfo/postgis-users
[postgis-users] More effective way instead of doping table?
I'm looking for a more effective way to clear all records then add the new ones instead of dropping table . I am wanting to Truncate all records from the table then add the new shapefile. Currently im using this command shp2pgsql -d -s 4269 NWSWatch.shp watches geoserver| psql -d geoserver is there a way to do this? The reason is that my clients are sometimes updating when Im dropping the table and its throwing them into all types of errors. The field names will always be the same. ___ postgis-users mailing list postgis-users@postgis.refractions.net http://postgis.refractions.net/mailman/listinfo/postgis-users
Re: [postgis-users] More effective way instead of doping table?
You can run commands from the shell using the -c parameter with psql. So psql -c delete from mytable -d mydatabase shp2pgsql ... etc ... Or if you are less transactionally minded... psql -c truncate mytable -d mydatabase shp2pgsql ... etc ... Paul On Sat, Nov 20, 2010 at 11:47 PM, chris brisendine ki4...@gmail.com wrote: I'm looking for a more effective way to clear all records then add the new ones instead of dropping table . I am wanting to Truncate all records from the table then add the new shapefile. Currently im using this command shp2pgsql -d -s 4269 NWSWatch.shp watches geoserver| psql -d geoserver is there a way to do this? The reason is that my clients are sometimes updating when Im dropping the table and its throwing them into all types of errors. The field names will always be the same. ___ postgis-users mailing list postgis-users@postgis.refractions.net http://postgis.refractions.net/mailman/listinfo/postgis-users ___ postgis-users mailing list postgis-users@postgis.refractions.net http://postgis.refractions.net/mailman/listinfo/postgis-users