Received: from shaked.cc.openu.ac.il (shaked.cc.openu.ac.il [147.233.145.65]) by hub.org (8.9.1/8.9.1) with ESMTP id HAA18113 for ; Sun, 8 Nov 1998 07:16:11 -0500 (EST) (envelope-from herouth@oumail.openu.ac.il) Received: from [147.233.159.109] (herouth@mac-herouth.pc.openu.ac.il [147.233.159.109]) by shaked.cc.openu.ac.il (8.8.5/8.8.5) with ESMTP id OAA22516; Sun, 8 Nov 1998 14:12:10 +0200 (IST) X-Sender: herouth@shaked.cc.openu.ac.il Message-Id: In-Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Date: Sun, 8 Nov 1998 14:12:28 +0200 To: "Sergei M. Suntsov" From: Herouth Maoz Subject: Re: [SQL] newline in text field Cc: pgsql-sql@postgreSQL.org At 13:50 +0200 on 8/11/98, Sergei M. Suntsov wrote: > Hello > I would like to insert into text field strings separated by newline > character ('\n') using psql. How should I quote newline characters if it > is possible ? > Thanx in advance. > Sergei It depends on the context. If you want to put it in an insert string, you don't have to quote it. You do something like: INSERT INTO my_table ( text_field ) VALUES ( '...And yet by heaven I swear my love as rare As any she belied with false compare!' ); If you are doing it within COPY, where newline has significance as a delimiter, you should put a backslash before it: COPY my_table FROM stdin; ...And yet by heaven I swear my love as rare\ As any she belied with false compare! \. Herouth -- Herouth Maoz, Internet developer. Open University of Israel - Telem project http://telem.openu.ac.il/~herutma