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,



---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Reply via email to