That is probably the issue. You cannot have nulls (\x0) in char fields in
Postgres. I am not sure about text fields. I would recommend getting a hold
of Bruce Momjian's Postgres book. The O'Reilly DBI book might cover this as
well...
-K
> From: Bart Lateur <[EMAIL PROTECTED]>
> Organization: MediaMind
> Date: Mon, 19 Mar 2001 13:42:48 +0100
> To: [EMAIL PROTECTED]
> Subject: Re: [MacPerl] Storable.pm -- freezing data structures
>
> On Mon, 19 Mar 2001 13:56:18 +0200, Sean Carte wrote:
>
>> If I print the contents of the serialized data, this is what I get:
>>
>> '
>
>
>
>
>> It seemed to me initially (and still does) that Storable is using
>> return characters (or newlines) to delimit the data, and that this is
>> causing the SQL to fail.
>>
>> Does that make sense?
>
> Kinda. I think that your specific database doesn't accept binary data
> for its text fields. Does this dB have any BLOB type fields?
>
> You can still try and UUencode the data before inserting it. There's a
> built-in function in Perl that can handle that:
>
> pack 'u', $data;
>
> But it might still contain newlines.
>
> How about base64? You need an external module, MIME::Base64, which is
> included with MacPerl. Base64 encoded strings, too, contain newlines,
> but at least it's safe to delete them all. Not so with UUE, because
> there each line starts with a count byte. Base64 is all data.
>
> use MIME::Base64;
> (my $b64 = encode_base64($binary)) =~ tr/\n//d;
>
> my $decoded_binary = decode_base64($b64);
>
> --
> Bart.
>