<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>

<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body bgcolor="#ffffff" text="#006600">
<font face="Courier New, Courier, monospace">All,<br>
<br>
I have a test file that contains the data to the loaded to the spatial
table I have. The table structure is
<lat,lon,data1,data2,spatialPoint>. Sample data in the txt file :
<-64.7647, -56.57647, 1234548, 1221312>. <br>
<br>
So I want to load the table from this text file. I use the COPY query
below. <br>
<br>
<b>COPY "table_name" (lat,lon,data1,data2) FROM 'FILE' DELIMITER ','</b><br>
<br>
But the problem is I am not able to update the spatialPoint using copy
query. So for now I am loading the lat,lon,data1,data2 fields and then
update the spatialPoint using a separate query similar to one below:<br>
<br>
<b>UPDATE "table_name" SET "spatialPoint" =
ST_SetSRID(ST_MakePoint(lat,lon),4326) WHERE "spatialPoint" IS NULL</b><br>
<br>
My question is, is there a way to avoid the second query so that I can
also load the spatialPoint in the COPY query?<br>
<br>
Also I initial dint want to have lat,lon in the table and have only the
spatialPoint field. Because of the above problem I was forced to have
lat,lon fields in the table. Someway to achieve this will help me a lot.<br>
</font><br>
 <br>
<pre class="moz-signature" cols="72">Thanks,
Sairam Krishnamurthy
+1 612 859 8161
</pre>
</body>
</html>