Re: BUG #14826: Malformed array dimensions for empty arrays in return column "lexemes" of ts_debug()

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: brsaweda(at)gmail(dot)com
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #14826: Malformed array dimensions for empty arrays in return column "lexemes" of ts_debug()
Date: 2017-09-23 16:26:08
Message-ID: 26928.1506183968@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

brsaweda(at)gmail(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Andrew Dunstan 2017-09-23 17:48:23 Re: [BUGS] BUG #14825: enum type: unsafe use?
Previous Message Tom Lane 2017-09-23 15:16:45 Re: BUG #14825: enum type: unsafe use?