pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: listar <listar@mail.ru>
To: pgsql-bugs@postgresql.org
Subject: BUG #6155: literal definition of arrays with double qoutes leads to error
Date: Mon, 8 Aug 2011 20:22:02 GMT
Message-ID: <201108082022.p78KM2jZ050528@wwwmaster.postgresql.org> (raw)


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)



view thread (3+ messages)  latest in thread

Message-ID: <201108082022.p78KM2jZ050528@wwwmaster.postgresql.org>
Permalink:  ../201108082022.p78KM2jZ050528@wwwmaster.postgresql.org/
Also on:    postgresql.org/message-id/201108082022.p78KM2jZ050528@wwwmaster.postgresql.org

 · 

reply

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: listar@mail.ru
  Subject: Re: BUG #6155: literal definition of arrays with double qoutes leads to error
  In-Reply-To: <201108082022.p78KM2jZ050528@wwwmaster.postgresql.org>
  References: <201108082022.p78KM2jZ050528@wwwmaster.postgresql.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