Re: COPY from on date field problem

Поиск
Список
Период
Сортировка
От Patrick Hatcher
Тема Re: COPY from on date field problem
Дата
Msg-id OFE050B7B2.77E562F8-ON88256B6C.007E36A1@fds.com
обсуждение исходный текст
Ответ на COPY from on date field problem  ("Patrick Hatcher" <PHatcher@macys.com>)
Ответы Re: COPY from on date field problem  (Oliver Elphick <olly@lfix.co.uk>)
Список pgsql-novice
Never mind found the answer.  I forgot to do the WITH NULL as '' at the end
of my COPY statement.
Thanks

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





    
                    "Patrick Hatcher"
    
                    <PHatcher@macys.com>          To:     pgsql-novice@postgresql.org
    
                    Sent by:                      cc:
    
                    pgsql-novice-owner@post       Subject:     [NOVICE] COPY from on date field problem
    
                    gresql.org
    

    

    
                    02/26/2002 02:46 PM
    

    

    




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




---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org





В списке pgsql-novice по дате отправления:

Предыдущее
От: "David J. Lines"
Дата:
Сообщение: Major newbie - Part deux
Следующее
От: Jochen Kaechelin
Дата:
Сообщение: Hello List