BUG #6155: literal definition of arrays with double qoutes leads to error - Mailing list pgsql-bugs

From listar
Subject BUG #6155: literal definition of arrays with double qoutes leads to error
Date
Msg-id 201108082022.p78KM2jZ050528@wwwmaster.postgresql.org
Whole thread Raw
Responses Re: BUG #6155: literal definition of arrays with double qoutes leads to error
List pgsql-bugs
The following bug has been logged online:

Bug reference:      6155
Logged by:          listar
Email address:      listar@mail.ru
PostgreSQL version: 8.4.5
Operating system:   Gentoo 4.4.4-r2 p1.3, pie-0.4.5 64-bit
Description:        literal definition of arrays with double qoutes leads to
error
Details:

for example:
SELECT ('{string "with" double quotes}'::text[])[1] as value;
gives:

ERROR:  malformed array literal: "{string "with" double quotes}"
LINE 1: SELECT ('{string "with" double quotes}'::text[])[1] as value...
                ^
********** Error **********
ERROR: malformed array literal: "{string "with" double quotes}"
SQL state: 22P02
Character: 9

Expected result:
         value
---------------------------
string "with" double quotes
(1 row)


I tried to escape input string in different ways, but it wasn't successful
=(

as I can understood the problem is in "switch" statement in method
"ArrayCount(...)" in file \src\backend\utils\adt\arrayfuncs.c
(that switch doesn't cover all possible cases)

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #6154: wrong result with nested left-joins
Next
From: Tom Lane
Date:
Subject: Re: BUG #6154: wrong result with nested left-joins