From: Tom Lane <tgl@sss.pgh.pa.us>
To: Michael Glaesemann <grzm@myrealbox.com>
Cc: venu gopal <gopalonline2@yahoo.co.uk>
Cc: pgsql-general <pgsql-general@postgresql.org>
Subject: Re: what the problem with this query
Date: Fri, 14 Apr 2006 11:48:22 -0400
Message-ID: <9724.1145029702@sss.pgh.pa.us> (raw)
In-Reply-To: <FBCAEF05-136A-4E49-A545-6E6877511517@myrealbox.com>
References: <20060414110916.9271.qmail@web25608.mail.ukl.yahoo.com>
<FBCAEF05-136A-4E49-A545-6E6877511517@myrealbox.com>
Michael Glaesemann <grzm@myrealbox.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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: tgl@sss.pgh.pa.us, grzm@myrealbox.com, gopalonline2@yahoo.co.uk, pgsql-general@postgresql.org
Subject: Re: what the problem with this query
In-Reply-To: <9724.1145029702@sss.pgh.pa.us>
References: <20060414110916.9271.qmail@web25608.mail.ukl.yahoo.com> <FBCAEF05-136A-4E49-A545-6E6877511517@myrealbox.com> <9724.1145029702@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox