On Fri, 5 Nov 2004 16:31:21 -0500, Goutam Paruchuri
<[EMAIL PROTECTED]> wrote:
> 
> Iam trying to import data from ms-sql server to postgres. I export the data
> which has datetime columns in sql server using BCP. I use the following to
> import back into postgres.
>  
> copy tablename from 'c:\\bcpdata\\mcfa\\tablename.txt' with delimiter as
> '\t' 
>  
> I get the following error !!
> invalid input syntax for type timestamp: ""
>  
> My input file has the timestamp value like 
>  
> 2004-09-30 11:31:00.000
>  
> Any clues ???

I recently did the same thing, I left DELIMITER alone since \t is the
default, but I did have to do "WITH NULL as ''" since some of the
datetimes in MSSQL were empty.

By default the copy will bomb out on NULL fields even if you don't
have a NOT NULL constraint on the column, for one reason or another.

I suppose "WITH NULL as NULL" would've worked just as well, in hindsight.

-Allen

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

               http://www.postgresql.org/docs/faqs/FAQ.html

Reply via email to