Re: Inconsistent format() behavior for argument-count inconsistency
В списке pgsql-hackers по дате отправления:
| От | Stephen Frost |
|---|---|
| Тема | Re: Inconsistent format() behavior for argument-count inconsistency |
| Дата | |
| Msg-id | 20130118181056.GD16126@tamriel.snowman.net обсуждение исходный текст |
| Ответ на | Inconsistent format() behavior for argument-count inconsistency (Tom Lane <tgl@sss.pgh.pa.us>) |
| Список | pgsql-hackers |
* Tom Lane (tgl@sss.pgh.pa.us) wrote:
> Why do we throw an error for too few arguments, but not too many?
Not sure offhand, though I could see how it might be useful. A use-case
might be that you have a variable template string which is user defined,
where they can choose from the arguments that are passed which ones they
want displayed and how. Otherwise, you'd have to have a bunch of
different call sites to format() depending on which options are
requested.
I'd go look at what C sprintf() does, as I feel like that's what we're
trying to emulate and see what it does.
There is also a patch that I reviewed/commented on about changing format
around a bit. I'm guessing it needs more review/work, just havn't
gotten back around to it yet.
Thanks,
Stephen
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера