Re: using copy to load odd characters

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: "Johnson, Shaunn" <SJohnson6(at)bcbsm(dot)com>
Cc: "'pgsql-general(at)postgresql(dot)org '" <pgsql-general(at)postgresql(dot)org>
Subject: Re: using copy to load odd characters
Date: 2003-10-07 10:17:26
Message-ID: Pine.LNX.4.44.0310071215350.20152-100000@peter.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2003-10-07 10:28:43 Re: concenation of strings and null values
Previous Message Kaare Rasmussen 2003-10-07 10:07:09 Re: PostgreSQL Beta4 Tag'd and Bundle'd ...