Re: Text data type doesn't accept newlines?

From: Randall Perry <rgp(at)systame(dot)com>
To: Bryan White <bryan(at)arcamax(dot)com>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: Text data type doesn't accept newlines?
Date: 2001-06-05 18:13:40
Message-ID: B7429994.9A2C%rgp@systame.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

on 6/5/01 12:00 PM, Bryan White at bryan(at)arcamax(dot)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(at)postgresql(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Fran Fabrizio 2001-06-05 18:20:50 Re: Calling external programs
Previous Message John Moo 2001-06-05 18:11:04 [newbie] Relations...