Re: missing possibility to use alternative translated month names in to_char function

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: missing possibility to use alternative translated month names in to_char function
Date: 2026-08-12 07:13:02
Message-ID: CAFj8pRDqXN5Rr1DeVP8dQm29YZAEgnhOnsyFOnLkAHkcDEFe+w@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi

út 11. 8. 2026 v 17:14 odesílatel Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
napsal:

>
>
> út 11. 8. 2026 v 17:06 odesílatel Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
> napsal:
>
>> Hi
>>
>> My customer reported an interesting issue. He needs translated month
>> name, and then he use
>> to_char(current_date, 'tmmonth');
>>
>> Unfortunately, glibc returns nouns in the genitive case instead of the
>> nominative case.
>>
>> This is a glibc feature from the 2.28 release. Genitive case makes sense,
>> when the result holds a day, but without it, it is messy.
>>
>> glibc has alternative month names, that can be taken by usage placeholder
>> '%OB' of function strftime.
>> https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/V1_chap07.html
>> - see alt_mon.
>>
>> Can we enhance prefixes (maybe tmo) to be possible to use alternative
>> names?
>>
>
> example:
>
> pavel(at)nemesis:~/src/orafce$ date +'%B'
> srpna
> pavel(at)nemesis:~/src/orafce$ date +'%OB'
> srpen
> pavel(at)nemesis:~/src/orafce$ LANG=C date +'%OB'
> August
>
>
attached patch that implements 'TAM' modifier for data/timestamp formatting

Regards

Pavel

>
>
>>
>> Regards
>>
>> Pavel
>>
>>
>>
>>
>>
>>

Attachment Content-Type Size
0001-introduce-tam-modifier-for-date-timestamp-formatting.patch text/x-patch 12.2 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message torikoshia 2026-08-12 07:16:03 Re: Why is the LSN reported for pg_logical_emit_message() different from other decoded operations?
Previous Message John Naylor 2026-08-12 06:51:55 Re: [PATCH] Remove redundant ORDER BY from COUNT aggregates