Re: Text data type doesn't accept newlines?

Randall Perry <rgp@systame.com>

From: Randall Perry <rgp@systame.com>
To: Bryan White <bryan@arcamax.com>, <pgsql-general@postgresql.org>
Date: 2001-06-05T18:13:40Z
Lists: pgsql-general
on 6/5/01 12:00 PM, Bryan White at bryan@arcamax.com wrote:

>> I have a logging database that logs errors. The error messages contain
>> newlines. Pgsql doesn't accept them on insert in a text data field.
> 
> I have never had a problem storing newlines in a text field.  What interface
> are you using?
> The only ascii character that I have found I have to escape is the single
> quote character.
> ---------
> Bryan White
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
> 

I'm using the Pg perl interface. But, think my problem was that I had
unescaped single quotes in the string. Added the following to my code to
escape them and it works now:

    $self->{errors} =~ s"'"\\'"g;        # escape single quotes


-- 
Randy Perry
sysTame
Mac Consulting/Sales