Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dvnG0-00036N-Qs for pgsql-bugs@arkaria.postgresql.org; Sat, 23 Sep 2017 16:26:20 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dvnFz-0002Fv-Er for pgsql-bugs@arkaria.postgresql.org; Sat, 23 Sep 2017 16:26:19 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dvnFz-0002Fl-0D for pgsql-bugs@postgresql.org; Sat, 23 Sep 2017 16:26:19 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dvnFr-00074N-2L for pgsql-bugs@postgresql.org; Sat, 23 Sep 2017 16:26:18 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id v8NGQ8JL026929; Sat, 23 Sep 2017 12:26:08 -0400 From: Tom Lane 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() In-reply-to: <20170923125723.1448.39412@wrigleys.postgresql.org> References: <20170923125723.1448.39412@wrigleys.postgresql.org> Comments: In-reply-to brsaweda@gmail.com message dated "Sat, 23 Sep 2017 12:57:23 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <26927.1506183968.1@sss.pgh.pa.us> Date: Sat, 23 Sep 2017 12:26:08 -0400 Message-ID: <26928.1506183968@sss.pgh.pa.us> List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org 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