Inconsistent format() behavior for argument-count inconsistency - Mailing list pgsql-hackers

From Tom Lane
Subject Inconsistent format() behavior for argument-count inconsistency
Date
Msg-id 10550.1358532193@sss.pgh.pa.us
Whole thread Raw
Responses Re: Inconsistent format() behavior for argument-count inconsistency
List pgsql-hackers
regression=# select format('%s %s', 'foo', 'bar');format  
---------foo bar
(1 row)

regression=# select format('%s %s', 'foo', 'bar', 'baz');format  
---------foo bar
(1 row)

regression=# select format('%s %s', 'foo');              
ERROR:  too few arguments for format

Why do we throw an error for too few arguments, but not too many?

(This came up when I started wondering whether the proposed VARIADIC
feature would really be very useful for format(), since it needs a
format string that matches up with its arguments.)
        regards, tom lane



pgsql-hackers by date:

Previous
From: Stephen Frost
Date:
Subject: Re: in-catalog Extension Scripts and Control parameters (templates?)
Next
From: Andres Freund
Date:
Subject: Re: Event Triggers: adding information