COPY from on date field problem

From: "Patrick Hatcher" <PHatcher(at)macys(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: COPY from on date field problem
Date: 2002-02-26 22:46:18
Message-ID: OF5B6319E1.94ABF7B8-ON88256B6C.007B4D21@fds.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Pg ver: 7.2
I'm trying to do a COPY function from a tab delimited file into a table
defined as such:

CREATE TABLE "mdc_priceschedule" (
"keyp_price" int4 NOT NULL,
"keyf_products" int4 NOT NULL,
"date_start" date ,
"date_end" date ,
"price_normal" numeric(13, 2) ,
"inc_event_type" int2 ,
"sale_value" numeric(13, 2) ,
"price_sale" numeric(13, 2) ,
CONSTRAINT "xpkmdc_priceschedule" UNIQUE ("keyp_price")
) WITH OIDS;

record example:
112116 73440 2/9/2002 2/9/2007 49 2 0 .01
112117 73017 1/7/2002 12/7/2006 189 2 0 65.99
112118 73450 0 0 0 0
112119 73016 1/7/2002 12/6/2006 69 2 0 23.99

Some of the date fields and numeric fields maybe a NULL value. However,
whenever I try to import any record that may have a NULL value in the
date_start field for example, I get a message stating Bad date external
representation ''.
Any clue why this would happen?
Just a FYI, I have tried putting DEFAULT NULL on the date fields, but Pg
keeps removing them. I assume that this means NULL is a default.

TIA

Patrick Hatcher
Macys.Com
Legacy Integration Developer
415-932-0610 office

Browse pgsql-novice by date

  From Date Subject
Next Message David J. Lines 2002-02-26 22:48:38 Major newbie - Part deux
Previous Message Travis Hoyt 2002-02-26 20:58:19 Re: Help formulating multi-table SELECT statement