Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 5DE369FB693 for ; Mon, 7 May 2007 22:52:04 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 64013-06 for ; Mon, 7 May 2007 22:51:55 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from rrmailscan3.safenetbox.biz (unknown [203.25.40.75]) by postgresql.org (Postfix) with ESMTP id D73409FB583 for ; Mon, 7 May 2007 22:52:00 -0300 (ADT) Received: from rrmailscan3.safenetbox.biz (rrmailscan3.safenetbox.biz [127.0.0.1]) by rrmailscan3.safenetbox.biz (Postfix) with ESMTP id E95B71D48453 for ; Tue, 8 May 2007 11:51:58 +1000 (EST) Received: from [127.0.0.1] (online4-new.lnk.telstra.net [139.130.169.227]) (Authenticated sender: remote) by rrmailscan3.safenetbox.biz (Postfix) with ESMTP id 37BA61D48448 for ; Tue, 8 May 2007 11:51:58 +1000 (EST) Message-ID: <463FD7B8.9030700@autoledgers.com.au> Date: Tue, 08 May 2007 09:51:52 +0800 From: Paul Lambert User-Agent: Thunderbird 1.5.0.10 (Windows/20070221) MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: Query RE using COPY Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200705/52 X-Sequence-Number: 28333 I use the COPY command to load data from a file into tables in my database. The following is an example done in psql: COPY deals_temp_load FROM 'c:/temp/autodrs_deals.txt' WITH DELIMITER AS '^' QUOTE '\f' CSV HEADER; If a column is added to the table but has not been added to the extracts which create the autodrs_deals.txt file, this errors thusly: ERROR: missing data for column "location" CONTEXT: COPY deals_temp_load, line 2: "line containing data removed for confidentiality - suffice to say it does not contain the 'location' column" Is there any way of telling it to ignore columns that have not been specified in the file used to load? I have tried giving the column a default value but I still get the error. The column in this case 'location' is a nullable column and does not always have data (yes, bad design for a database, but we'll skip that point for now) thus I am not concerned if the load procedure doesn't supply it. BTW, this is done on Weendoze. Thanks, Paul. -- Paul Lambert Database Administrator AutoLedgers