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

From Pavel Stehule
Subject Re: Re: proposal: a width specification for s specifier (format function), fix behave when positional and ordered placeholders are used
Date
Msg-id CAFj8pRAOwi4s2m2RNd+1SiFYBvDM9xKAH5QrW0CS9dzK1eA4qA@mail.gmail.com
Whole thread Raw
In response to Re: Re: proposal: a width specification for s specifier (format function), fix behave when positional and ordered placeholders are used  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
2013/1/28 Tom Lane <tgl@sss.pgh.pa.us>:
> Pavel Stehule <pavel.stehule@gmail.com> writes:
>> 2013/1/28 Dean Rasheed <dean.a.rasheed@gmail.com>:
>>> Starting with the first patch - it issues a new WARNING if the format
>>> string contains a mixture of format specifiers with and without
>>> parameter indexes (e.g., 'Hello %s, %1$s').
>>>
>>> Having thought about it a bit, I really don't like this for a number of reasons:
>
>> I am not sure what you dislike?
>> warnings or redesign of behave.
>
> Both.  If we had done this when we first implemented format(), it'd be
> fine, but it's too late to change it now.  There very likely are
> applications out there that depend on the current behavior.  As Dean
> says, it's not incompatible with SUS, just a superset, so ISTM this
> patch is proposing to remove documented functionality --- for no very
> strong reason.

I disagree - but I have not a arguments. I am thinking so current
implementation is wrong, and now is last time when we can to fix it -
format() function is not too old and there is relative chance to
minimal impact to users.

I didn't propose removing this functionality, but fixing via more
logical independent counter for ordered arguments. Dependency on
previous positional argument is unpractical and unclean. I am not
satisfied so it is undefined and then it is ok.

Regards

Pavel


>
> I vote for rejecting this change entirely.
>
>                         regards, tom lane



pgsql-hackers by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: enhanced error fields
Next
From: Pavel Stehule
Date:
Subject: Re: Re: proposal: a width specification for s specifier (format function), fix behave when positional and ordered placeholders are used