Skip site navigation (1) Skip section navigation (2)

BUG #14487: malformed empty array from array_fill

From: andrew(at)tao11(dot)riddles(dot)org(dot)uk
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #14487: malformed empty array from array_fill
Date: 2017-01-05 15:21:56
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-bugs
The following bug has been logged on the website:

Bug reference:      14487
Logged by:          Andrew Gierth
Email address:      andrew(at)tao11(dot)riddles(dot)org(dot)uk
PostgreSQL version: 9.6.1
Operating system:   any

array_fill returns a malformed empty array when given a size of zero:

select a, a = '{}' from (select array_fill(null::integer, array[0]) as a)
 a  | ?column? 
 {} | f

The result actually has ndims=1 and a length of 0, which can be checked with

Obvious fix is to move the fast-track empty result to after computing


pgsql-bugs by date

Next:From: Andrew GierthDate: 2017-01-05 15:33:19
Subject: Re: BUG #14487: malformed empty array from array_fill
Previous:From: Andres FreundDate: 2017-01-05 14:48:20
Subject: Re: [BUG] pg9.4.10 Logical decoding did not get the correct oldtuplelen

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group