Re: Copy command and import - MS SQL Server to Postgres
От | Allen Landsidel |
---|---|
Тема | Re: Copy command and import - MS SQL Server to Postgres |
Дата | |
Msg-id | 88f1825a0411051348701ce02e@mail.gmail.com обсуждение исходный текст |
Ответ на | Copy command and import - MS SQL Server to Postgres ("Goutam Paruchuri" <gparuchuri@oneil.com>) |
Ответы |
Re: Copy command and import - MS SQL Server to Postgres
|
Список | pgsql-general |
On Fri, 5 Nov 2004 16:31:21 -0500, Goutam Paruchuri <gparuchuri@oneil.com> 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
В списке pgsql-general по дате отправления: