Re: proposal: a width specification for s specifier (format function), fix behave when positional and ordered placeholders are used

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема Re: proposal: a width specification for s specifier (format function), fix behave when positional and ordered placeholders are used
Дата
Msg-id CAFj8pRBjMdAjybSZkczyez0x=FhC8WXvgR2wOYGuhrk1TUkraA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: proposal: a width specification for s specifier (format function), fix behave when positional and ordered placeholders are used  (Stephen Frost <sfrost@snowman.net>)
Ответы Re: proposal: a width specification for s specifier (format function), fix behave when positional and ordered placeholders are used
Список pgsql-hackers
Hello

2012/12/31 Stephen Frost <sfrost@snowman.net>:
> Pavel,
>
> * Pavel Stehule (pavel.stehule@gmail.com) wrote:
>> A result from ours previous talk was a completely disabling mixing
>> positional and ordered placeholders - like is requested by man and gcc
>> raises warnings there.
>>
>> But mixing is not explicitly disallowed in doc, and mixing was tested
>> in our regress tests. There are tests where placeholders are mixed -
>> so anybody can use it.
>> select format('Hello %s %1$s %s', 'World', 'Hello again'); -- is
>> enabled and supported and result is expected
>
> Alright, then I agree that raising a warning in that case makes sense
> and let's update the docs to reflect that it shouldn't be done (like
> what glibc/gcc do).

so there are two patches - first is fix in logic when positional and
ordered parameters are mixed + add warning in this situation. Second
patch enables possibility to specify width for %s conversion.

I didn't finalize documentation due my net good English skills -
probably there is necessary new paragraph about function "format"
elsewhere than in table

Regards

Pavel

>
>         Thanks,
>
>                 Stephen

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tomas Vondra
Дата:
Сообщение: Re: PATCH: optimized DROP of multiple tables within a transaction
Следующее
От: "Karl O. Pinc"
Дата:
Сообщение: Re: Submission Review: User control over psql error stream