Re: format() function with string_agg

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wednesday, September 24, 2014, Tom Lane <tgl@xxxxxxxxxxxxx> wrote:
Raj Gandhi <raj01gandhi@xxxxxxxxx> 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.

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux