X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 05797D1B494 for ; Sat, 20 Dec 2003 04:24:17 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 24474-03 for ; Sat, 20 Dec 2003 00:23:28 -0400 (AST) Received: from hotmail.com (bay9-f62.bay9.hotmail.com [64.4.47.62]) by svr1.postgresql.org (Postfix) with ESMTP id D213CD1B45A for ; Sat, 20 Dec 2003 00:23:27 -0400 (AST) Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Fri, 19 Dec 2003 20:23:27 -0800 Received: from 68.100.237.244 by by9fd.bay9.hotmail.msn.com with HTTP; Sat, 20 Dec 2003 04:23:26 GMT X-Originating-IP: [68.100.237.244] X-Originating-Email: [nutter_@hotmail.com] X-Sender: nutter_@hotmail.com From: "Matt Van Mater" To: bruno@wolff.to Cc: pgsql-sql@postgresql.org Subject: Re: how to preserve \n in select statement Date: Fri, 19 Dec 2003 23:23:26 -0500 Mime-Version: 1.0 Content-Type: text/plain; format=flowed Message-ID: X-OriginalArrivalTime: 20 Dec 2003 04:23:27.0109 (UTC) FILETIME=[03C26B50:01C3C6B1] X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200312/135 X-Sequence-Number: 16301 I just don't see why pgsql can't return my data exactly as I entered it. It wouldn't be hard for me to manipulate it before entry and add another escape character, but that's not really the point. The point is why is postgresql changing the data I insert into a field, and not giving me away to get it back in its original form? I wouldn't have a problem if I was notified during an insert that my escape characters would be modified, or even if I was given an error message and the insert failed. 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 To: Matt Van Mater CC: pgsql-sql@postgresql.org 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 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 majordomo@postgresql.org) _________________________________________________________________ Tired of slow downloads? Compare online deals from your local high-speed providers now. https://broadband.msn.com