suggestions for tracking down syntax errors?

From: Terrence Brannon <metaperl(at)urth(dot)org>
To:
Cc: pgsql-general(at)postgresql(dot)org
Subject: suggestions for tracking down syntax errors?
Date: 2003-10-09 12:15:04
Message-ID: 3F855148.8070105@urth.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I created a schema and piped it to psql but got an error message:

~/hacks/psql $ cat create.sql | psql test
ERROR: table "country" does not exist
ERROR: parser: parse error at or near ")" at character 91
ERROR: table "customer" does not exist
NOTICE: CREATE TABLE will create implicit sequence
'customer_customer_id_seq' for SERIAL column 'customer.customer_id'

But I don't know exactly where character 91 is... a line number
(including the comments in the file) would be more useful to me. I can
sort of triangualate where the problem with the parenthesis is by noting
where the "DROP TABLE" stmts failed, but that leaves two parenthetic
expressions to examine for correctness. Here is the relevant part of the
file that I piped to psql:

/*==========================================================================*/
/* Project Filename: C:\Program Files\Datanamic\DeZign for Databases
V3\sample models\licenses.dez*/
/* Project
Name: */
/*
Author: */
/* DBMS: PostgreSQL
7 */
/*
Copyright: */
/* Generated on: 10/7/2003 5:24:50
PM */
/*==========================================================================*/

/*==========================================================================*/
/*
Tables */
/*==========================================================================*/

DROP TABLE country;
CREATE TABLE country (
country_id VARCHAR(3) PRIMARY KEY,

country VARCHAR(80),
);

DROP TABLE customer;
CREATE TABLE customer (
customer_id SERIAL PRIMARY KEY,
country_id VARCHAR(3) REFERENCES country(country_id),

name VARCHAR(100) NOT NULL,
companyname VARCHAR(100) NOT NULL,
address1 VARCHAR(100) NOT NULL,

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Francois Suter 2003-10-09 12:29:48 Re: suggestions for tracking down syntax errors?
Previous Message John Wells 2003-10-09 11:59:23 Response from MySql AB (Re: Humor me: Postgresql vs. MySql (esp. licensing))