Hi, Le lundi 27 août 2007, qinghuamail-postgresqlfans@yahoo.com a écrit : > I use COPY cmd to import large data to database,but I have a question, > > when occured the first error, It always stopped, I need it to be > continue,and reject the error rows to a file, how to do this? You can try out pgloader, which has been made for this kind of requirements. http://pgloader.projects.postgresql.org/ Please consider downloading the later version available, which is 2.2.1 as of now. Regards, -- dim
On 8/27/07, qinghuamail-postgresqlfans@yahoo.com <qinghuamail-postgresqlfans@yahoo.com> wrote: > hi,all > > I use COPY cmd to import large data to database,but I have a question, > > when occured the first error, It always stopped, I need it to be > continue,and reject the error rows to a file, how to do this? There are two common ways to do this. First, import to a temp table then fix up the data there until an "insert into real_table select * from temp_table" type statement to import the data. The second is to swrite some kind of app in bash, perl, php, awd, sed, C or whatever language you like to put the data into a format that the database won't choke on.
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера