From: Sabin Coanda <sabin.coanda@deuromedia.ro>
To: pgsql-sql@postgresql.org
Subject: show value of backslashes in string array argument
Date: Mon, 12 Nov 2007 11:15:48 +0200
Message-ID: <fh95jt$1ff7$1@news.hub.org> (raw)
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: sabin.coanda@deuromedia.ro
Subject: Re: show value of backslashes in string array argument
In-Reply-To: <fh95jt$1ff7$1@news.hub.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox