From: Tom Lane <tgl@sss.pgh.pa.us>
To: brsaweda@gmail.com
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #14826: Malformed array dimensions for empty arrays in return column "lexemes" of ts_debug()
Date: Sat, 23 Sep 2017 12:26:08 -0400
Message-ID: <26928.1506183968@sss.pgh.pa.us> (raw)
In-Reply-To: <20170923125723.1448.39412@wrigleys.postgresql.org>
References: <20170923125723.1448.39412@wrigleys.postgresql.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
brsaweda@gmail.com writes:
> test=# SELECT token, lexemes, lexemes = '{}'::text[]
> test-# FROM ts_debug('a title');
> token | lexemes | ?column?
> -------+---------+----------
> a | {} | f
> | |
> title | {titl} | f
> The root of the problem seems to be malformed array dimensions.
> array_dims(lexemes) returns [1:0], while I would expect NULL:
Yeah, that's a bug --- looks like ts_lexize is the root problem.
I'm a bit tempted to fix this centrally by having construct_array()
do something different for zero-dimensioned input, rather than
putting a special case into ts_lexize(). We've been bitten by
this type of insect a few times too many. The question is
whether there's any code that relies on being able to construct
such malformed arrays ...
regards, tom lane
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
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-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, brsaweda@gmail.com
Subject: Re: BUG #14826: Malformed array dimensions for empty arrays in return column "lexemes" of ts_debug()
In-Reply-To: <26928.1506183968@sss.pgh.pa.us>
* 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