Inconsistent format() behavior for argument-count inconsistency

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Inconsistent format() behavior for argument-count inconsistency
Дата
Msg-id 10550.1358532193@sss.pgh.pa.us
обсуждение исходный текст
Ответы Re: Inconsistent format() behavior for argument-count inconsistency  (Stephen Frost <sfrost@snowman.net>)
Список 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 по дате отправления:

Предыдущее
От: Stephen Frost
Дата:
Сообщение: Re: in-catalog Extension Scripts and Control parameters (templates?)
Следующее
От: Andres Freund
Дата:
Сообщение: Re: Event Triggers: adding information