pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Raj Gandhi <raj01gandhi@gmail.com>
Cc: David Johnston <david.g.johnston@gmail.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: format() function with string_agg
Date: Wed, 24 Sep 2014 11:35:04 -0400
Message-ID: <17457.1411572904@sss.pgh.pa.us> (raw)
In-Reply-To: <CALU_HCMFJLqPm1ZCFoCqBHCYBTTXz8h3bfvhnASj_7hgkUXFHg@mail.gmail.com>
References: <CALU_HCOEBFAibCcCSBGKdGL7+Shd5vSZLGVBe6XqmM77SanUJA@mail.gmail.com>
	<1411528144063-5820251.post@n5.nabble.com>
	<CALU_HCOeLnY2x9Rs=kQTjHJEybEku1R00RT1WzRa6LOQ=g=6Zg@mail.gmail.com>
	<CAKFQuwaDV4eaLg+uuMUeojVgiekgwXQQSq3CCGxkNSuNbBceYA@mail.gmail.com>
	<CALU_HCMFJLqPm1ZCFoCqBHCYBTTXz8h3bfvhnASj_7hgkUXFHg@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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


-- 
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin



view thread (8+ messages)  latest in thread

Message-ID: <17457.1411572904@sss.pgh.pa.us>
Permalink:  ../17457.1411572904@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/17457.1411572904@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: tgl@sss.pgh.pa.us, raj01gandhi@gmail.com, david.g.johnston@gmail.com
  Subject: Re: format() function with string_agg
  In-Reply-To: <17457.1411572904@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox