Re: format() function with string_agg

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Raj Gandhi <raj01gandhi(at)gmail(dot)com>
Cc: David Johnston <david(dot)g(dot)johnston(at)gmail(dot)com>, pgsql-admin(at)postgresql(dot)org
Subject: Re: format() function with string_agg
Date: 2014-09-24 15:35:04
Message-ID: 17457.1411572904@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

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

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message David Johnston 2014-09-24 15:57:29 Re: format() function with string_agg
Previous Message Geoff Winkless 2014-09-24 15:25:08 Re: [ADMIN] readonly user