Re: what the problem with this query

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Michael Glaesemann <grzm(at)myrealbox(dot)com>
Cc: venu gopal <gopalonline2(at)yahoo(dot)co(dot)uk>, pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: what the problem with this query
Date: 2006-04-14 15:48:22
Message-ID: 9724.1145029702@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-general

Michael Glaesemann <grzm(at)myrealbox(dot)com> writes:
> I'm not familiar with the syntax you're using, but one problem is
> that your parentheses are not balanced -- there's an extra closing
> parenthesis. That's probably what the error is complaining about. You
> might want to try to use whitespace to see the structure of your
> query better, e.g.,

Also, consider using a newer Postgres release. 8.0 and up provide
a cursor pointer so that you don't have to count characters:

regression=# SELECT o.orgunitname AS ouname, e.entrynumber AS value_field, centroid(c.the_geom) AS the_geom, c.ogc_fid AS ogc_fid FROM (ctrphc AS c INNER JOIN orgunit o ON c.dhs_ouname = o.orgunitname) INNER JOIN (SELECT orgunitid, entrynumber FROM routinedataou4 WHERE dataelementid=1195 AND dataperiodid = 86) AS e ON o.orgunitid = e.orgunitid) AS new_table USING UNIQUE ogc_fid USING SRID=-1;
ERROR: syntax error at or near ")" at character 333
LINE 1: ...taperiodid = 86) AS e ON o.orgunitid = e.orgunitid) AS new_t...
^
regression=#

regards, tom lane

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Pierre LEBRECH 2006-04-14 17:42:29 Re: Slony1 or DRBD for replication ?
Previous Message Joshua D. Drake 2006-04-14 15:25:23 Re: Slony1 or DRBD for replication ?

Browse pgsql-general by date

  From Date Subject
Next Message Raphael Bauduin 2006-04-14 15:54:02 Re: ilike and utf-8
Previous Message Tom Lane 2006-04-14 15:40:29 Re: corrupted item pointer:???