Re: [postgis-users] Convert already loaded table into a spatial table (points)

2010-08-12 Thread Paul Ramsey
PgSQL uses MVCC for row-level transaction handling. You might thing that when you "update" a row, new values are simply written on top of the old ones. They are not. A new copy of the row is created, with a new timestamp. Eventually, w

Re: [postgis-users] Convert already loaded table into a spatial table (points)

2010-08-12 Thread Mauricio Miranda
On Aug 12, 2010, at 15:56 PM, Paul Ramsey wrote: > Because of transaction handling, updating every row in a database is > the equivalent of a full load. It might actually take longer than the > initial load. > > I'd suggest something like > > create newtable as select st_makepoint(x,y) as point

Re: [postgis-users] Convert already loaded table into a spatial table (points)

2010-08-12 Thread Paul Ramsey
Because of transaction handling, updating every row in a database is the equivalent of a full load. It might actually take longer than the initial load. I'd suggest something like create newtable as select st_makepoint(x,y) as point, a1, a2, a2... from oldtable drop oldtable alter newtable

Re: [postgis-users] Convert already loaded table into a spatial table (points)

2010-08-12 Thread Fred Lehodey
Hi, ST_MakePoint return point with unknow geometry. You need to use something like: ST_SetSRID(ST_MakePoint(x,y,z),) Fred On Thu, Aug 12, 2010 at 7:09 PM, Andrea Peri wrote: > > >I have already loaded a table that contains X, Y and Z values. AT the time > >of loading it was thought we did n

[postgis-users] Convert already loaded table into a spatial table (points)

2010-08-12 Thread Andrea Peri
>I have already loaded a table that contains X, Y and Z values. AT the time of >loading it was thought we did not need a spatial component to this table. >Now we realize that we do have a need but do not want to reload the 190 >million records again and create the point features on load. >Is it p

Re: [postgis-users] Convert already loaded table into a spatial table (points)

2010-08-12 Thread Fabio Renzo Panettieri
> SELECT AddGeometryColumn > ('public','my_table','the_geom',4326,'POINT',2); > http://postgis.refractions.net/docs/AddGeometryColumn.html Ups, my mistake. This should be SELECT AddGeometryColumn ('public','my_table','the_geom',4326,'POINT',3); -- Fabio R. Panettieri Software Architect http://w

Re: [postgis-users] Convert already loaded table into a spatial table (points)

2010-08-12 Thread Fabio Renzo Panettieri
On Thu, 2010-08-12 at 12:53 -0500, Appel, Tony wrote: > I have already loaded a table that contains X, Y and Z values. AT the > time of loading it was thought we did not need a spatial component to > this table. > > > > Now we realize that we do have a need but do not want to reload the > 190 m

[postgis-users] Convert already loaded table into a spatial table (points)

2010-08-12 Thread Appel, Tony
I have already loaded a table that contains X, Y and Z values. AT the time of loading it was thought we did not need a spatial component to this table. Now we realize that we do have a need but do not want to reload the 190 million records again and create the point features on load. Is it poss