Return-Path: postman Received: from localhost.Berkeley.EDU (localhost.Berkeley.EDU [127.0.0.1]) by nobozo.CS.Berkeley.EDU (8.6.9/8.6.3) with SMTP id NAA08530 for postgres-redist; Tue, 20 Sep 1994 13:02:25 -0700 Resent-From: POSTGRES mailing list Resent-Message-Id: <199409202002.NAA08530@nobozo.CS.Berkeley.EDU> X-Authentication-Warning: nobozo.CS.Berkeley.EDU: Host localhost.Berkeley.EDU didn't use HELO protocol Sender: owner-postman@postgres.Berkeley.EDU X-Return-Path: owner-postman Received: from EIGER.EDRC.CMU.EDU (EIGER.EDRC.CMU.EDU [128.2.214.41]) by nobozo.CS.Berkeley.EDU (8.6.9/8.6.3) with SMTP id NAA08520 for ; Tue, 20 Sep 1994 13:02:18 -0700 Received: from Messages.8.5.N.CUILIB.3.45.SNAP.NOT.LINKED.EIGER.EDRC.CMU.EDU.pmax.mach via MS.5.6.EIGER.EDRC.CMU.EDU.pmax_mach; Tue, 20 Sep 1994 16:01:33 -0400 (EDT) Message-ID: Date: Tue, 20 Sep 1994 16:01:33 -0400 (EDT) From: Robert.Patrick@cs.cmu.edu To: postgres@postgres.Berkeley.EDU Subject: Text string w/ a '\n' character??? In-Reply-To: References: Resent-To: postgres-redist@postgres.Berkeley.EDU Resent-Date: Tue, 20 Sep 94 13:02:25 -0700 Resent-XMts: smtp We are developing an application which uses Postgres to store it's data. The problem is that I need to be able to store text strings with carriage return characters in them. First, I tried just passing the raw '\n' character embedded in the string to libpq. This causes me to receive a "scanner error"(something about unterminated char or string) and nothing is stored in the text field. Next, I tried inserting a '\' before the '\n' (since this appears to work properly if done from the monitor). However, when executed via libpq, Postgres just drops the carriage return entirely! So I figured it was just a problem with the text data type and converted everything to octal and tried to store it as a bytea data type. Unfortunately, Postgres seems to treat the bytea data type exactly like text (at least in this respect). Is it possible to store a piece of text in Postgres without losing the formatting (i.e., carriage returns)? Robert -- +------------------------------------------------------------------------+ | Robert Patrick _/_/_/_/ _/ _/ _/_/_/_/ | | n-dim Group _/ _/ _/ _/ _/ _/ | | Engineering Design Research Center _/ _/ _/ _/ _/ _/ | | Department of Chemical Engineering _/ _/ _/ _/ _/ _/ | | Carnegie Mellon University _/_/_/_/ _/_/_/_/_/ _/_/_/_/ | | Pittsburgh, PA 15213 _/ _/ _/ _/ _/ | | Phone: (412)268-5215 _/ _/ _/ _/ _/ | | Fax: (412)268-5229 _/ _/ _/ _/ _/ | | rp2y+@eiger.edrc.cmu.edu _/ _/ _/ _/ _/ | | rp2y+@andrew.cmu.edu | | World Wide Web: http://paneer.ndim.edrc.cmu.edu:8888/~rp2y/Home.html | +------------------------------------------------------------------------+ ============================================================================== To add/remove yourself to/from the POSTGRES mailing list: send mail with the subject line ADD or DEL to "postgres-request@postgres.Berkeley.EDU" If this fails, send mail to "post_questions@postgres.Berkeley.EDU" and a human will deal with it. DO NOT post to the "postgres" mailing list. ==============================================================================