X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 479183A469A for ; Thu, 18 Nov 2004 13:33:26 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 79325-07 for ; Thu, 18 Nov 2004 13:33:21 +0000 (GMT) Received: from mail.ehbmail.com (69.37.81.108.ded.snet.net [69.37.81.108]) by svr1.postgresql.org (Postfix) with ESMTP id 5BE543A4668 for ; Thu, 18 Nov 2004 13:33:23 +0000 (GMT) Received: from [192.168.1.55] ([192.168.1.55]) by mail.ehbmail.com (8.12.10/8.12.10) with ESMTP id iAIDXYVi040821 for ; Thu, 18 Nov 2004 08:33:35 -0500 (EST) (envelope-from fredwohlfert@ehbmail.com) Message-ID: <419CA492.70801@ehbmail.com> Date: Thu, 18 Nov 2004 08:33:06 -0500 From: Fred Wohlfert User-Agent: Mozilla Thunderbird 0.8 (Windows/20040913) X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-admin@postgresql.org Subject: Error loading data with COPY Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.3 tagged_above=0.0 required=5.0 tests=UPPERCASE_25_50 X-Spam-Level: X-Archive-Number: 200411/155 X-Sequence-Number: 15539 I am in the prototyping phase of a conversion from dbase to postgresql I am trying to load data with the copy function,------- *ham-existing=# \copy invst from '/home/fmwdba/transcoma' using delimiters ',' I then get the following error -------- ERROR: value too long for type character(7) CONTEXT: COPY invst, line 1, column stknum: "'0020338'" ham-existing=#* however, if I use the insert command and give the field names the data will load. Can anyone see what I am doing wrong? I need to use the copy function as I have a lot of data to load. This is how I created the table CREATE TABLE Invst ( STKNUM CHAR(7) NOT NULL, RATIO NUMERIC(4,1), PUBLET_ CHAR(1), SORTNUM CHAR(1), BINNUM CHAR(4), BIN2 CHAR(4), WEIGHT NUMERIC(5,2), MUSICCDSLS NUMERIC(4), AZTOOHIGH CHAR(1), AZMAXPRICE NUMERIC(7,2), OVERSIZE CHAR(1), KEEPOFFWEB CHAR(1), NEWSTKNUM CHAR(7), ROLL_NUM NUMERIC(1), DATEONAZ DATE, AZCURINV NUMERIC(3) ); CREATE UNIQUE INDEX XPKInvst ON Invst ( STKNUM ); ALTER TABLE Invst ADD PRIMARY KEY (STKNUM);