Re: using copy to load odd characters

From: "Johnson, Shaunn" <SJohnson6(at)bcbsm(dot)com>
To: "''pgsql-general(at)postgresql(dot)org ' '" <pgsql-general(at)postgresql(dot)org>
Subject: Re: using copy to load odd characters
Date: 2003-10-07 12:01:11
Message-ID: 73309C2FDD95D11192E60008C7B1D5BB05FED9D8@snt452.corp.bcbsm.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

--thanks for the reply!

--i've tried your example and it
--doesn't work for me.

--i'm also interested in why it's doing
--that (the problem). it seems that if the
--field is a null and the column size is
--char(1) or so, the load will fail. in my
--case, the field is a char(2) - would that have
--an impact on the load?

--maybe this is a red herring ...

-X

-----Original Message-----
From: Peter Eisentraut
To: Johnson, Shaunn
Cc: 'pgsql-general(at)postgresql(dot)org '
Sent: 10/7/03 6:17 AM
Subject: Re: [GENERAL] using copy to load odd characters

Johnson, Shaunn writes:

> I'm trying to load data from a text file that
> has an odd character in it (^@). From what I
> could tell, it's a NULL character. How can I
> load that into the database via the command line?

Depends on what data type the column is supposed to have. Character
data
types cannot contain null bytes. The type bytea can store arbitrary
binary data. It requires you to escape null bytes so '\\000'.

--
Peter Eisentraut peter_e(at)gmx(dot)net

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Richard Huxton 2003-10-07 12:20:07 Re: Problems defining a primary key !!
Previous Message Karsten Hilbert 2003-10-07 11:54:11 Re: Problems defining a primary key !!