Re: format() function with string_agg - Mailing list pgsql-admin

From Tom Lane
Subject Re: format() function with string_agg
Date
Msg-id 17457.1411572904@sss.pgh.pa.us
Whole thread Raw
In response to Re: format() function with string_agg  (Raj Gandhi <raj01gandhi@gmail.com>)
Responses Re: format() function with string_agg  (David Johnston <david.g.johnston@gmail.com>)
List pgsql-admin
Raj Gandhi <raj01gandhi@gmail.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


pgsql-admin by date:

Previous
From: Geoff Winkless
Date:
Subject: Re: readonly user
Next
From: David Johnston
Date:
Subject: Re: format() function with string_agg