Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.databases.postgresql > #416 > unrolled thread
| Started by | Franz Kruse <Franz.Kruse@t-online.de> |
|---|---|
| First post | 2012-10-31 00:12 +0100 |
| Last post | 2012-11-01 08:53 +0000 |
| Articles | 6 — 4 participants |
Back to article view | Back to comp.databases.postgresql
Line breaks in PostgreSQL tables Franz Kruse <Franz.Kruse@t-online.de> - 2012-10-31 00:12 +0100
Re: Line breaks in PostgreSQL tables Robert Klemme <shortcutter@googlemail.com> - 2012-10-31 19:51 +0100
Re: Line breaks in PostgreSQL tables Franz Kruse <Franz.Kruse@t-online.de> - 2012-10-31 20:58 +0100
Re: Line breaks in PostgreSQL tables mattheww@chiark.greenend.org.uk (Matthew Woodcraft) - 2012-10-31 20:39 +0000
Re: Line breaks in PostgreSQL tables Robert Klemme <shortcutter@googlemail.com> - 2012-11-01 23:37 +0100
Re: Line breaks in PostgreSQL tables Jasen Betts <jasen@xnet.co.nz> - 2012-11-01 08:53 +0000
| From | Franz Kruse <Franz.Kruse@t-online.de> |
|---|---|
| Date | 2012-10-31 00:12 +0100 |
| Subject | Line breaks in PostgreSQL tables |
| Message-ID | <k6pmsh$qir$1@news.albasani.net> |
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? Thanks for hints Franz
[toc] | [next] | [standalone]
| From | Robert Klemme <shortcutter@googlemail.com> |
|---|---|
| Date | 2012-10-31 19:51 +0100 |
| Message-ID | <afdaa5Fh1quU1@mid.individual.net> |
| In reply to | #416 |
On 10/31/2012 12:12 AM, Franz Kruse wrote: > 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? Cheers robert
[toc] | [prev] | [next] | [standalone]
| From | Franz Kruse <Franz.Kruse@t-online.de> |
|---|---|
| Date | 2012-10-31 20:58 +0100 |
| Message-ID | <k6rvsl$13g$1@news.albasani.net> |
| In reply to | #417 |
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 <CR><LF> sequences. Is this a standard in PG? Or can the line separator be configured? Franz
[toc] | [prev] | [next] | [standalone]
| From | mattheww@chiark.greenend.org.uk (Matthew Woodcraft) |
|---|---|
| Date | 2012-10-31 20:39 +0000 |
| Message-ID | <zdj*Cmgju@news.chiark.greenend.org.uk> |
| In reply to | #418 |
Franz Kruse <Franz.Kruse@t-online.de> wrote: > 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 <CR><LF> sequences. Is this a > standard in PG? Or can the line separator be configured? PostgreSQL doesn't really have a concept of a line separator. Both Linux and Windows web browsers use CRLF line endings when they send text data entered which has been entered into an HTML form to a web server. I expect that's why you're seeing CRLFs. -M-
[toc] | [prev] | [next] | [standalone]
| From | Robert Klemme <shortcutter@googlemail.com> |
|---|---|
| Date | 2012-11-01 23:37 +0100 |
| Message-ID | <afgbtkF7ruuU1@mid.individual.net> |
| In reply to | #418 |
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 <CR><LF> 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/
[toc] | [prev] | [next] | [standalone]
| From | Jasen Betts <jasen@xnet.co.nz> |
|---|---|
| Date | 2012-11-01 08:53 +0000 |
| Message-ID | <k6tdb1$d54$2@reversiblemaps.ath.cx> |
| In reply to | #416 |
On 2012-10-30, Franz Kruse <Franz.Kruse@t-online.de> wrote: > 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? You get out what you put in. possibly you could use the repalace function to modify the data or the result. OTOH \r\n should bnot be a problem in emails, all the EMAIL RFCs require \r\n. -- ⚂⚃ 100% natural --- news://freenews.netfront.net/ - complaints: news@netfront.net ---
[toc] | [prev] | [standalone]
Back to top | Article view | comp.databases.postgresql
csiph-web