Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Robert Klemme Newsgroups: comp.databases.postgresql Subject: Re: Line breaks in PostgreSQL tables Date: Thu, 01 Nov 2012 23:37:27 +0100 Lines: 33 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net Vhxs9hwnOOKhRTQcen37gQZOlfFohPMvL3nvkDq7kyYfGgxh2+Z7xTpuEMYDWxnF4= Cancel-Lock: sha1:njegrBwUgptTi+UFo8DVOCtvCRk= User-Agent: Mozilla/5.0 (Windows NT 6.0; WOW64; rv:16.0) Gecko/20121026 Thunderbird/16.0.2 In-Reply-To: Xref: csiph.com comp.databases.postgresql:421 On 31.10.2012 20:58, Franz Kruse wrote: > Robert Klemme: > >>> We just started to use PostgreSQL. For new table entries (type TEXT) we >>> find line breaks represented as \r\n (the Windows convention), wich is >>> OK when shown in a browser, but causes strange multiple empty lines when >>> these entries are sent via email. >>> >>> Can this behaviour be configured, such that simple \n are used for line >>> breaks? >> >> I'd assume that PG happily stores what you insert so it's probably a >> client side issue. Are you inserting from Windows? > > The inserts take place on a Linux machine in a Perl CGI script that gets > its data from web forms sent from different computers in the world. A > test showed that it makes no difference whether the web request comes > from a Windows machine or a Linux machine. This makes me believe PG > itself decides to separate text lines with sequences. Is this a > standard in PG? Or can the line separator be configured? See Matthew's answer. Believing usually leads to bad results in software engineering. :-) It's better to verify facts - in this case actually find out what you actually insert into the database (e.g. via degugging or logging). Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/