suggestions for tracking down syntax errors?

Поиск
Список
Период
Сортировка
От Terrence Brannon
Тема suggestions for tracking down syntax errors?
Дата
Msg-id 3F855148.8070105@urth.org
обсуждение исходный текст
Ответ на autoupdate sequences after copy  (CSN <cool_screen_name90001@yahoo.com>)
Ответы Re: suggestions for tracking down syntax errors?
Re: suggestions for tracking down syntax errors?
Список 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 по дате отправления:

Предыдущее
От: "John Wells"
Дата:
Сообщение: Response from MySql AB (Re: Humor me: Postgresql vs. MySql (esp. licensing))
Следующее
От: Terrence Brannon
Дата:
Сообщение: relation vs table...