Re: format() function with string_agg

From: Raj Gandhi <raj01gandhi(at)gmail(dot)com>
To: David Johnston <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: format() function with string_agg
Date: 2014-09-24 19:53:59
Message-ID: CALU_HCPE3MRTfZSRZm8nrAkf-6o2vEwo7E9bmYw5c2+738Lhew@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Thanks David and Tom. Unfortunately I can't immediately upgrade to 9.3.

On Wed, Sep 24, 2014 at 11:57 AM, David Johnston <david(dot)g(dot)johnston(at)gmail(dot)com
> wrote:

> On Wednesday, September 24, 2014, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
>> Raj Gandhi <raj01gandhi(at)gmail(dot)com> writes:
>> > SQL with VARIADIC also gives the same error in 9.1:
>> > select format('%s %s', VARIADIC array_agg(val))
>> > from (values ('1'),('2')) src (val)
>> > ==
>> > ERROR: too few arguments for format
>>
>> You need 9.3 or later for that to work. Per the 9.3 release notes:
>>
>> * Allow concat() and format() to properly expand VARIADIC-labeled
>> arguments (Pavel Stehule)
>>
>> regards, tom lane
>>
>
> Found it.
>
> http://www.postgresql.org/docs/9.3/interactive/functions-string.html
>
> In the comments after table 9.6
>
> This whole feature could maybe be made more visible in the 9.3
> documentation but (arguably) since it was a feature and not a bug fix back
> patching was not possible. Specifically it seems like it was too invasive
> a change to make it work properly in the back branches.
>
> David J.
>

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message AL-Temimi, Muthana 2014-09-25 10:12:39 Latest checkpoint's NextOID
Previous Message David Johnston 2014-09-24 15:57:29 Re: format() function with string_agg