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 2FE2C3A4102 for ; Wed, 17 Nov 2004 16:43:31 +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 32218-09 for ; Wed, 17 Nov 2004 16:43:24 +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 BCAD43A3C5D for ; Wed, 17 Nov 2004 16:43: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 iAHGhXVi026379 for ; Wed, 17 Nov 2004 11:43:34 -0500 (EST) (envelope-from fredwohlfert@ehbmail.com) Message-ID: <419B7F99.1080407@ehbmail.com> Date: Wed, 17 Nov 2004 11:43:05 -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=1.1 tagged_above=0.0 required=5.0 tests=UPPERCASE_50_75 X-Spam-Level: * X-Archive-Number: 200411/157 X-Sequence-Number: 15541 I am trying to load data with the copy function, *ham-existing=# \copy invst from '/home/fmwdba/transcoma' using delimiters ',' \. 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 laod. 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), BIN3 CHAR(4), BIN4 CHAR(4), PUBSTNUM CHAR(10), TITLE CHAR(40), BUYPRICE NUMERIC(6), SELLPRICE NUMERIC(6), INVENTORY1 NUMERIC(4), INVENTORY2 NUMERIC(4), CURINV NUMERIC(4), COPYPUR NUMERIC(4), RESTOCKBIN NUMERIC(4), H8DATE DATE, BUYER CHAR(2), PRICED CHAR(2), PULP NUMERIC(4), PUBPRICE NUMERIC(7,2), HALFCOM NUMERIC(7,2), KEEP2 CHAR(1), NEWDATE2 DATE, CONDITION CHAR(1), FEATURE CHAR(2), RESTOCKEDX NUMERIC(2), 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);