X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 741503A6809 for ; Mon, 13 Dec 2004 02:46:02 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 26363-07 for ; Mon, 13 Dec 2004 02:45:49 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id E41333A6871 for ; Mon, 13 Dec 2004 02:45:51 +0000 (GMT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id iBD2joRP014682; Sun, 12 Dec 2004 21:45:50 -0500 (EST) To: Alex Beamish Cc: pgsql-sql@postgresql.org Subject: Re: parse error at or near "(" -- Huh??? In-reply-to: References: Comments: In-reply-to Alex Beamish message dated "Thu, 09 Dec 2004 15:19:56 -0500" Date: Sun, 12 Dec 2004 21:45:49 -0500 Message-ID: <14681.1102905949@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.006 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200412/73 X-Sequence-Number: 19693 Alex Beamish 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