How to insert a string with '/' using COPY command from a text file

Поиск
Список
Период
Сортировка
От shreedhar
Тема How to insert a string with '/' using COPY command from a text file
Дата
Msg-id 008f01c2ff4c$76c38e40$1201a8c0@a4005
обсуждение исходный текст
Ответы Re: How to insert a string with '/' using COPY command from a text file
Список pgsql-general
Hello All
 
 
 tblTemp (
catalogid INTEGER NOT NULL DEFAULT 0,
DirPath Varchar(250) NOT NULL DEFAULT '',
TypeName VARCHAR(100)  NOT NULL DEFAULT '', 
size FLOAT NOT  NULL DEFAULT 0, 
filedate datetime NOT NULL
) ;
 
Input text file
10|cdrom\games\themes\newyears1.zip|WinZip File (Folder)|729990|11/24/2001 01:41:32 AM
 
If I directly use Copy command
 
1) data is storing in table as following
 
catalogid     dirpath                                        typename                 size                    filedate
10    cdromgamesthemesnewyears1.zip         WinZip File            729990        2001-11-24 01:41:32
 
 
2) If change input as
 
10|cdrom/\games/\themes/\newyears1.zip|WinZip File (Folder)|729990|11/24/2001 01:41:32 AM
 
Output in table is
 
catalogid     dirpath                                typename                 size                    filedate
10    cdrom/games/    hemes                 WinZip File            729990               2001-11-24 01:41:32
        / ewyears1.zip                
 
I mean it is taking TAB and NEWLINE characters.
 
3) If change input as
 
10|cdrom/\games\\themes\\newyears1.zip|WinZip File (Folder)|729990|11/24/2001 01:41:32 AM
 
Output in table is
 
catalogid     dirpath                                typename                 size                    filedate
10    cdrom/games\themes\newyears1.zip               WinZip File            729990               2001-11-24 01:41:32
 
I mean '\' is appearing instead of '/'
 
My expected output is
catalogid     dirpath                                typename                 size                    filedate
10    cdrom/games/themes/newyears1.zip               WinZip File            729990               2001-11-24 01:41:32
 
How can I change my input file to get expected result.
 
REGARDS,
SREEDHAR                        

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

Предыдущее
От: Lincoln Yeoh
Дата:
Сообщение: Re: pg_dump / pg_dumpall / memory issues
Следующее
От: Richard Huxton
Дата:
Сообщение: Re: How to insert a string with '/' using COPY command from a text file