show value of backslashes in string array argument - Mailing list pgsql-sql

From Sabin Coanda
Subject show value of backslashes in string array argument
Date
Msg-id fh95jt$1ff7$1@news.hub.org
Whole thread Raw
Responses Re: show value of backslashes in string array argument  (Achilleas Mantzios <achill@matrix.gatewaynet.com>)
Re: show value of backslashes in string array argument  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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
characterbackslash, 
 
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




pgsql-sql by date:

Previous
From: "Philippe Lang"
Date:
Subject: Re: Temporal databases
Next
From: Achilleas Mantzios
Date:
Subject: Re: show value of backslashes in string array argument