array_fill function - Mailing list pgsql-patches

From Pavel Stehule
Subject array_fill function
Date
Msg-id 162867790806052206l7f6aae61ha29f6720c66caa6@mail.gmail.com
Whole thread Raw
Responses Re: array_fill function
List 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

pgsql-patches by date:

Previous
From: Mario Weilguni
Date:
Subject: Re: Logging conflicted queries on deadlocks
Next
From: Teodor Sigaev
Date:
Subject: Re: GIN improvements