show value of backslashes in string array argument

From: "Sabin Coanda" <sabin(dot)coanda(at)deuromedia(dot)ro>
To: pgsql-sql(at)postgresql(dot)org
Subject: show value of backslashes in string array argument
Date: 2007-11-12 09:15:48
Message-ID: fh95jt$1ff7$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi there,

I have a problem using backslash character as part of a string array item.

I use "PostgreSQL 8.2.4 on i686-pc-mingw32, compiled by GCC gcc.exe (GCC)
3.4.2 (mingw-special)" version, with standard_conforming_strings = 'on'.

I found that, is that in spite of using standard_conforming_strings = 'on',
the string array items are shown in C escape sequences conventions.

Use the following scenario:
- create a table with
CREATE TABLE test
(
"colVarchar" character varying,
"colVarcharArray" character varying[]
)
- insert a row with a string composed by just one character backslash,
and an array with just one item, with the same value of one backslash, with:
INSERT INTO test VALUES ( '\', ARRAY[ '\' ] );
- show the values with:
SELECT * FROM test

And the result is:

colVarchar | colVarcharArray
------------+-----------------
\ | {"\\"}

The question is why the two strings are shown different in spite they are
the same, and standard_conforming_strings = 'on' ?

Sabin

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Sabin Coanda 2007-11-12 09:51:41 Re: show value of backslashes in string array argument
Previous Message Philippe Lang 2007-11-12 09:07:51 Re: Temporal databases