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

array_fill function

From: "Pavel Stehule" <pavel(dot)stehule(at)gmail(dot)com>
To: pgsql-patches <pgsql-patches(at)postgresql(dot)org>
Subject: array_fill function
Date: 2008-06-06 05:06:04
Message-ID: 162867790806052206l7f6aae61ha29f6720c66caa6@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-patches
Hello

Proposal: http://archives.postgresql.org/pgsql-hackers/2008-06/msg00057.php

I changed name to array_fill and order of arguments.

postgres=# SELECT array_fill(0, ARRAY[2,3]);
    array_fill
-------------------
 {{0,0,0},{0,0,0}}
(1 row)

postgres=# SELECT array_fill(0, ARRAY[2,3], ARRAY[1,2]);
          array_fill
------------------------------
 [1:2][2:4]={{0,0,0},{0,0,0}}
(1 row)

postgres=# SELECT array_fill(0, ARRAY[4], ARRAY[2]);
   array_fill
-----------------
 [2:5]={0,0,0,0}
(1 row)

postgres=# SELECT array_fill(NULL::int, ARRAY[4]);
      array_fill
-----------------------
 {NULL,NULL,NULL,NULL}
(1 row)

Regards
Pavel Stehule

Attachment: array_fill.diff
Description: text/x-patch (13.3 KB)

Responses

pgsql-patches by date

Next:From: Teodor SigaevDate: 2008-06-06 13:54:20
Subject: Re: GIN improvements
Previous:From: Mario WeilguniDate: 2008-06-05 13:17:46
Subject: Re: Logging conflicted queries on deadlocks

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