Port Bug Report: Insertion of line return character inconsistent.

From: Unprivileged user <nobody>
To: pgsql-ports(at)postgresql(dot)org
Subject: Port Bug Report: Insertion of line return character inconsistent.
Date: 1999-06-02 00:28:28
Message-ID: 199906020028.UAA66864@hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-ports


============================================================================
POSTGRESQL BUG REPORT TEMPLATE
============================================================================

Your name : John Garrott
Your email address : johnga(at)primenet(dot)com

Category : unknown
Severity : non-critical

Summary: Insertion of line return character inconsistent.

System Configuration
--------------------
Operating System : Linux2.0.35 ELF

PostgreSQL version : 6.4.2

Compiler used : gcc 2.7.2.3

Hardware:
---------
Linux nadrek 2.0.35 #1 Fri May 21 08:48:00 PDT 1999 i586 unknown

Versions of other tools:
------------------------
GNU Make version 3.76.1
flex version 2.5.4
GNU Bison version 1.25

--------------------------------------------------------------------------

Problem Description:
--------------------
Storing text with included returns seems inconsistent. The return
character at the end of a text string must be escaped. If the lines
are double spaced, the next one cannot be or three extra lines are
generated instead of one.

Example: (Standard C conventions in character representation)
Intended:

"This is a double spaced comment.

This is the second line."

If inserted as "This is a double spaced comment.\n\nThis is the second line."
the stored result is

"This is a double spaced comment.
This is the second line."

If both returns are escaped:
"This is a double spaced comment.\\\n\\\nThis is the second line."
the stored result is

"This is a double spaced comment.

This is the second line."

Finally, if only the first return is escaped, everything is normal:
"This is a double spaced comment.\\\n\nThis is the second line."
The stored result is

"This is a double spaced comment.

This is the second line."

The field the text is stored in is a varchar(2048).

--------------------------------------------------------------------------

Test Case:
----------

--------------------------------------------------------------------------

Solution:
---------

--------------------------------------------------------------------------

Responses

Browse pgsql-ports by date

  From Date Subject
Next Message Bruce Momjian 1999-06-02 01:06:28 Re: [PORTS] Port Bug Report: compile errors for embedded sql (in c)
Previous Message Unprivileged user 1999-06-01 23:40:42 Port Bug Report: compile errors for embedded sql (in c)