Обсуждение: valide date in an ascii file

Поиск
Список
Период
Сортировка

valide date in an ascii file

От
dhoubrechts
Дата:
I'm trying to copy data from an ascii file to a postgres table using :
copy table using 'Home/tetrao/tetrao.txt' using delimiters ';';
My question is : How do i enter valide dates form that file when the
column is empty (;;)? Postgres want some valide date and don't want ''

Please help !


Re: valide date in an ascii file

От
Jeff Eckermann
Дата:
Add "with null as ''" to your COPY statement.  

Alternatively, edit the file to replace those empty
strings with some other NULL representation (COPY
expects "\N" by default; otherwise the syntax above is
required), or else insert dummy dates into your file.
--- dhoubrechts <dhoubrechts@cybernet.be> wrote:
> I'm trying to copy data from an ascii file to a
> postgres table using :
> copy table using 'Home/tetrao/tetrao.txt' using
> delimiters ';';
> My question is : How do i enter valide dates form
> that file when the
> column is empty (;;)? Postgres want some valide date
> and don't want ''
> 
> Please help !
> 
> ---------------------------(end of
> broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to
majordomo@postgresql.org


__________________________________________________
Do You Yahoo!?
Great stuff seeking new owners in Yahoo! Auctions! 
http://auctions.yahoo.com