Re: Using COPY
От | Joel Burton |
---|---|
Тема | Re: Using COPY |
Дата | |
Msg-id | JGEPJNMCKODMDHGOBKDNEEDLCOAA.joel@joelburton.com обсуждение исходный текст |
Ответ на | Re: Using COPY (Tom Lane <tgl@sss.pgh.pa.us>) |
Ответы |
Re: Using COPY
|
Список | pgsql-general |
> -----Original Message----- > From: pgsql-general-owner@postgresql.org > [mailto:pgsql-general-owner@postgresql.org]On Behalf Of Tom Lane > Sent: Tuesday, May 14, 2002 11:04 AM > To: joe@jwebmedia.com > Cc: pgsql-general@postgresql.org > Subject: Re: [GENERAL] Using COPY > > > Joseph Koenig <joe@jwebmedia.com> writes: > > We're converting a db from Access to PostgreSQL for a client - I need to > > export all of his data into postgres on Linux - I'm trying to use the > > COPY command, however, his comment fields have line breaks in them which > > causes the copy to throw a parse error at that line. I'm sure others > > have run into this - is there an easy way to avoid this? Thanks, > > You'll need to transform the linebreaks that should be data into \n > (backslash-n) or \LF (backslash-newline) sequences. This would be the best way. It arrives perfectly in PG. Or, if that's tricky for you to do w/the conversion/output tools you have at your disposal, turn the linebreaks into some unusual marker ("@@~@@") using any tool (emacs, perl, even Microsoft Word will do), pull the data in using COPY, and once in pgsql, you can fix this with a query. If you're going to use Access as a front-end onto the data, there's a document with some help for this setup at http://joelburton.com/resources/pgaccess. HTH. - J. Joel BURTON | joel@joelburton.com | joelburton.com | aim: wjoelburton Knowledge Management & Technology Consultant
В списке pgsql-general по дате отправления: