<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html style="direction: ltr;">
<head>
<meta content="text/html; charset=windows-1255"
http-equiv="Content-Type">
<title></title>
</head>
<body style="direction: ltr;" bidimailui-charset-is-forced="true"
text="#000000" bgcolor="#ffffff">
On 06/12/2010 12:08, Patrick_schirmer wrote:
<blockquote cite="mid:4CFCB61C.9050101@gmx.ch" type="cite">
<meta content="text/html; charset=windows-1255"
http-equiv="Content-Type">
Micha, <br>
<br>
attached a txt-file with the output you asked for. Following
workaround
did work for the files, which makes me think that it is not a
problem
of postgresql:<br>
<br>
</blockquote>
<br>
I'm glad you found a way to solve the problem, but if you don't mind
to help find why it didn't "just work" with v.db.join as it should,
then another check please:<br>
Can you do db.describe with the -c option as it appears in the
v.db.join script. So:<br>
<br>
db.describe -c driver=pg database=<your database>
table=<your table> | grep '^Column' | cut -d ':' -f 3 | tr -s
' ' '_'<br>
<br>
(The above all on one line)<br>
What output do you get ? You should see a string of the column
names. And the doulbe precision columns should appear as
"DOUBLE_PRECISION" ( with *no* width after the name)<br>
<br>
Thanks,<br>
Micha<br>
<br>
<blockquote cite="mid:4CFCB61C.9050101@gmx.ch" type="cite">
<br>
v.db.addcolumn map=GR_xy_wohnort col="x_arbeit double precision,
y_arbeit double precision"<br>
echo "UPDATE GR_xy_wohnort SET x_arbeit=(SELECT x_arbeit FROM
GR_xy_arbeitsort WHERE GR_xy_arbeitsort.id=GR_xy_wohnort.id)" >
help1.txt<br>
echo "UPDATE GR_xy_wohnort SET y_arbeit=(SELECT y_arbeit FROM
GR_xy_arbeitsort WHERE GR_xy_arbeitsort.id=GR_xy_wohnort.id)" >
help2.txt<br>
db.execute help1.txt<br>
db.execute help2.txt<br>
rm help2.txt<br>
rm help1.txt<br>
<br>
Cheers, Patrick<br>
<br>
<br>
On 12/03/2010 03:47 PM, Micha Silver wrote:
<blockquote cite="mid:4CF9031A.6060302@arava.co.il" type="cite">
<meta content="text/html; charset=windows-1255"
http-equiv="Content-Type">
<title></title>
On 03/12/2010 16:01, Micha Silver wrote:
<blockquote cite="mid:4CF8F846.7050702@arava.co.il" type="cite">
<meta content="text/html; charset=windows-1255"
http-equiv="Content-Type">
On 12/03/2010 09:53 AM, Patrick_schirmer wrote:
<blockquote cite="mid:4CF8A1DC.5050801@gmx.ch" type="cite">
<meta content="text/html; charset=windows-1255"
http-equiv="Content-Type">
Thanks Micha,<br>
<br>
Yes, commands are what I typed, just renamed the filenames
before
sending mail to the list:<br>
x_arbeit = x_last<br>
x_wohn = x_current<br>
<br>
<i>That syntax is an error in postgres: double precision
does not
take a length qualifier.<br>
There's nothing in the v.db.join script that I can find
that would add
such a thing.</i>"<br>
<br>
Is it a problem of postgres or of v.db.addcolumn which is
called within
v.db.join? Can someone reproduce this mistake?<br>
</blockquote>
<br>
Well, postgresql doesn't accept a length qualifier for the
type "double
precision". But the grass module v.db.addcol doesn't add any
qualifier
either. So I can't see where the error is originating from.<br>
<br>
Would you mind to post the output of:<br>
v.info -c <br>
v.db.connect -p<br>
for each of the point vectors?<br>
Maybe that will give us some hint...<br>
</blockquote>
<br>
And one more test, please:<br>
db.describe table=<your vector points map><br>
<br>
<blockquote cite="mid:4CF8F846.7050702@arava.co.il" type="cite">
<br>
<blockquote cite="mid:4CF8A1DC.5050801@gmx.ch" type="cite"><br>
Cheers, Patrick<br>
<br>
<br>
<br>
On 12/01/2010 08:48 PM, Micha Silver wrote:
<blockquote cite="mid:4CF6A69F.4060905@arava.co.il"
type="cite">
<meta content="text/html; charset=windows-1255"
http-equiv="Content-Type">
<title></title>
Hi Patrick<br>
<br>
On 12/01/2010 05:29 PM, Patrick_schirmer wrote:
<blockquote cite="mid:4CF669BE.6060702@gmx.ch" type="cite">
<meta http-equiv="content-type" content="text/html;
charset=windows-1255">
Hi, me again :-/<br>
<br>
I got two vectorfiles with points - one file
representing the current
location of persons and the other one representing
previous locations
of the same persons. Persons are unique and have an id
which is present
in both files. I would like to calculate the distance
each person has
moved. Thought it would be best doing this in the
datbase.<br>
<br>
<u>my approach:</u><br>
v.db.addcolumn map=GR_xy_current col="x_current double
precision,
y_current double precision, distance double precision"<br>
v.db.addcolumn map=GR_xy_last col="x_last double
precision, y_last
double precision"<br>
v.to.db map=GR_xy_current option=coor
col=x_current,y_current<br>
v.to.db map=GR_xy_last option=coor col=x_last,y_last<br>
v.db.join map=GR_xy_current column=id otable=GR_xy_last
ocolumn=id <br>
<br>
<u>All commands will run except the last one, creating
this
error:</u><br>
<br>
DBMI-Postgres driver error:<br>
Cannot execute: <br>
ALTER TABLE GR_xy_current ADD COLUMN x_arbeit DOUBLE
PRECISION(8)<br>
ERROR: syntax error at or near "("<br>
LINE 1: ... TABLE GR_xy_current ADD COLUMN x_arbeit
DOUBLE PRECISION(8)<br>
^<br>
</blockquote>
ERROR: Error while executing: 'ALTER TABLE
GR_xy_current ADD COLUMN<br>
<blockquote cite="mid:4CF669BE.6060702@gmx.ch" type="cite">
x_last
DOUBLE
PRECISION(8)'<br>
ERROR: Unable to add column <x_last DOUBLE
PRECISION(8)>.<br>
ERROR: Error creating column <x_last>.<br>
<br>
<br>
datbase: PG; Grass-version 7.0<br>
</blockquote>
<br>
</blockquote>
<br>
</blockquote>
</blockquote>
</blockquote>
<br>
<br>
<br>
This mail was received via Mail-SeCure System.<br>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="62">--
Micha Silver
<a class="moz-txt-link-freetext" href="http://www.surfaces.co.il/">http://www.surfaces.co.il/</a>
Arava Development Co. +972-52-3665918
</pre>
</body>
</html>