Skip site navigation (1) Skip section navigation (2)

Re: parse error at or near "(" -- Huh???

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alex Beamish <talexb(at)gmail(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: parse error at or near "(" -- Huh???
Date: 2004-12-13 02:45:49
Message-ID: 14681.1102905949@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-sql
Alex Beamish <talexb(at)gmail(dot)com> writes:
> I'm getting a frustrating error
>   ERROR:  parser: parse error at or near "(" at character 201
> in a CREATE TABLE statement from an SQL script that I'm running from
> within a Perl script. When I run the same script from the command
> line, either as a regular user or as root, it works fine.

One would have to suppose that the Perl environment is somehow munging
the SQL commands you think you are sending.  Try enabling statement
logging on the server side --- when you can see what was really sent,
all will probably become much clearer.

> And speaking of that, how I
> am to interpret 'character 201' -- should I collapse the SQL into it's
> minimal state (least number spaces) and go from that?

One character per character, whether that be a visible character or
whitespace (including newlines).  Collapsing out whitespace is
definitely not going to give you the right count.

			regards, tom lane

In response to

Responses

pgsql-sql by date

Next:From: Josh BerkusDate: 2004-12-13 02:48:27
Subject: Re: Query is not using index when it should
Previous:From: Michael FuhrDate: 2004-12-13 02:18:00
Subject: Re: parse error at or near "(" -- Huh???

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group