suggestions for tracking down syntax errors? - Mailing list pgsql-general

From Terrence Brannon
Subject suggestions for tracking down syntax errors?
Date
Msg-id 3F855148.8070105@urth.org
Whole thread Raw
In response to autoupdate sequences after copy  (CSN <cool_screen_name90001@yahoo.com>)
Responses Re: suggestions for tracking down syntax errors?  (Richard Huxton <dev@archonet.com>)
Re: suggestions for tracking down syntax errors?  (Francois Suter <francois@monpetitcoin.com>)
List 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,



pgsql-general by date:

Previous
From: "John Wells"
Date:
Subject: Response from MySql AB (Re: Humor me: Postgresql vs. MySql (esp. licensing))
Next
From: Terrence Brannon
Date:
Subject: relation vs table...