Re: ora2pg and invalid command \N

From: Julien Rouhaud <rjuju123(at)gmail(dot)com>
To: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
Cc: Charlin Barak <charlinbarak(at)gmail(dot)com>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, "pgsql-general(at)postgresql(dot)org >> PG-General Mailing List" <pgsql-general(at)postgresql(dot)org>, Gilles Darold <gilles(at)darold(dot)net>
Subject: Re: ora2pg and invalid command \N
Date: 2018-03-16 19:40:23
Message-ID: CAOBaU_YLSKHSQ6nQB5ouRA8BS2D0ff3SkG1Rova=KE1zVrE6Gw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Mar 16, 2018 at 8:28 PM, Adrian Klaver
<adrian(dot)klaver(at)aklaver(dot)com> wrote:
> On 03/16/2018 11:36 AM, Charlin Barak wrote:
>>
>> Thanks for your response.
>>
>> the NULL values from Oracle were indeed replaced by \N in the data output.
>> How do I go about loading this file? I hope I do not have to temporary
>> replace \N with a string in the flat file and then later update in Postgres.
>
>
> That should not be necessary:
>
> https://www.postgresql.org/docs/10/static/sql-copy.html
>
> "NULL
>
> Specifies the string that represents a null value. The default is \N
> (backslash-N) in text format, and an unquoted empty string in CSV format.
> You might prefer an empty string even in text format for cases where you
> don't want to distinguish nulls from empty strings. This option is not
> allowed when using binary format."
>
>
> To solve this is going to require more information. From my previous post:
>
> What was the complete command you used to generate the data file?
>
> Can we see the complete error?
>
> Also a section of the data file that contains the data that caused the
> error?

I pinged the original author, and he thinks it might be because of a
nested user defined type. If that's the case, you should try with
current development version
(https://github.com/darold/ora2pg/archive/master.zip) where the issue
should be fixed. If not, you should try to open an issue on
https://github.com/darold/ora2pg/issues.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Victoria 2018-03-16 20:06:54 Re: Nvim as external editor in psql as Postgres root user - .vimrc (environment?) issue
Previous Message Adrian Klaver 2018-03-16 19:28:17 Re: ora2pg and invalid command \N