One complaint about MYSQL is that it often does 'the next best thing' and doesn't notify the user that their command or input has been altered in some way. It seems like this is the same scenario with pgsql. I think this behavior stems from a security problem psql had a while back where escape characters were being interpreted, and this may be another instance of that functionality.
----Original Message Follows---- From: Bruno Wolff III <[EMAIL PROTECTED]> To: Matt Van Mater <[EMAIL PROTECTED]> CC: [EMAIL PROTECTED] Subject: Re: [SQL] how to preserve \n in select statement Date: Fri, 19 Dec 2003 15:26:07 -0600
On Fri, Dec 19, 2003 at 10:06:28 -0500,
Matt Van Mater <[EMAIL PROTECTED]> wrote:
> I have a table that has a few text value types, and I enter a bunch of text
> with '\n' representing a newline. When I select the records from that
> table, postgresql 7.3 represents those \n as newlines and actually outputs
> the a newline rather than as a \n as entered. I want to be able to get my
> \n text out of the select statement in the exact same manner it was
> inserted.
If you really want to store \n so that something else will interpret \n as a newline, then use '\\n' in the string constant.
---------------------------(end of broadcast)--------------------------- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])
_________________________________________________________________
Tired of slow downloads? Compare online deals from your local high-speed providers now. https://broadband.msn.com
---------------------------(end of broadcast)--------------------------- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]