pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: brsaweda@gmail.com
To: pgsql-bugs@postgresql.org
Cc: brsaweda@gmail.com
Subject: BUG #14826: Malformed array dimensions for empty arrays in return column "lexemes" of ts_debug()
Date: Sat, 23 Sep 2017 12:57:23 +0000
Message-ID: <20170923125723.1448.39412@wrigleys.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

The following bug has been logged on the website:

Bug reference:      14826
Logged by:          Erwin Brandstetter
Email address:      brsaweda@gmail.com
PostgreSQL version: 9.6.5
Operating system:   any
Description:        

Empty strings in this column seem to be "out of this world" - comparison to
'{}'::text[] returns FALSE:

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:

test=# SELECT token, dictionaries, lexemes
test-#      , array_dims(lexemes) AS lex_dims
test-#      , array_dims(dictionaries) AS dict_dims
test-# FROM   ts_debug('a title');
 token |  dictionaries  | lexemes | lex_dims | dict_dims
-------+----------------+---------+----------+-----------
 a     | {english_stem} | {}      | [1:0]    | [1:1]
       | {}             |         |          |
 title | {english_stem} | {titl}  | [1:1]    | [1:1]

I tested in versions 8.4 to 10 Beta, always the same result.

Related question on dba.stackexchange:
https://dba.stackexchange.com/questions/186715/how-do-i-select-arrays-that-are-not-empty


Regards
Erwin Brandstetter


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs


view thread (2+ messages)  latest in thread

Message-ID: <20170923125723.1448.39412@wrigleys.postgresql.org>
Permalink:  ../20170923125723.1448.39412@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/20170923125723.1448.39412@wrigleys.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 using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: brsaweda@gmail.com
  Subject: Re: BUG #14826: Malformed array dimensions for empty arrays in return column "lexemes" of ts_debug()
  In-Reply-To: <20170923125723.1448.39412@wrigleys.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