Received: from wallace.ece.rice.edu (wallace.ece.rice.edu [128.42.12.154]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id eALM8xs28054 for ; Tue, 21 Nov 2000 17:08:59 -0500 (EST) (envelope-from reedstrm@rice.edu) Received: by rice.edu via sendmail from stdin id (Debian Smail3.2.0.102) for pgsql-interfaces@postgresql.org; Tue, 21 Nov 2000 16:06:48 -0600 (CST) Date: Tue, 21 Nov 2000 16:06:48 -0600 From: "Ross J. Reedstrom" To: David Coley Cc: pgsql-interfaces@postgresql.org Subject: Re: Create tables using Perl DBI Message-ID: <20001121160648.A6279@rice.edu> Mail-Followup-To: David Coley , pgsql-interfaces@postgresql.org References: <20001121145414.A5837@rice.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii User-Agent: Mutt/1.0i In-Reply-To: ; from davidcoley@home.com on Tue, Nov 21, 2000 at 04:50:54PM -0500 X-Archive-Number: 200011/227 X-Sequence-Number: 263 Hmm, after reformating your SQL so I can read it, I found this: "create table customer ( ID serial PRIMARY KEY, name text NOT NULL, email text NOT NULL, phone text NOT NULL, ---> fax text DEFAULT, address text NOT NULL, ---> address2 text DEFAULT, zip text NOT NULL, city text NOT NULL, state text NOT NULL, country text NOT NULL)" What are you expecting to happen with DEFAULT with nothing after it? That's the 'at or near ","' part. Either drop the DEFAULT or add a text to default to. Are you perhaps looking for NULL? (as apposed to NOT NULL?) It's allowed in the grammar, but is the default, so you don't need it. Ross On Tue, Nov 21, 2000 at 04:50:54PM -0500, David Coley wrote: > Hum... I tried adding that extra ) at end of the prepare: > > $sth = $dbh->prepare("create table customer (ID serial PRIMARY KEY, name > text NOT NULL, email text NOT NULL, phone text NOT NULL, fax text DEFAULT, > address text NOT NULL, address2 text DEFAULT, zip text NOT NULL, city text > NOT NULL, state text NOT NULL, country text NOT NULL)") > or die "Could not Create Table: $DBI::errstr"; > $sth->execute; > #disconnect from the database. > $dbh->disconnect(); > > > > > It looks like you're missing a ")" in there somewhere. > > Parse error usually = syntax error. > > > > Still the same error: > > DBD::Pg::st execute failed: ERROR: parser: parse error at or near "," > > David Coley > davidcoley@home.com > http://www.davidcoley.com >