On Thu, Jan 30, 2020 at 11:49:45AM +0000, PG Bug reporting form wrote:
> For example this query "
> select to_char('2020-01-29'::date,'Day') " give me this result "Wednesday",
> but this query " select to_char('2020-01-31'::date,'Day') " give me this
> result "Friday ".
> So, i guess it is not right to have days with many spaces as a result and
> some days without any space.
First of all - it's not a bug - function works exactly as documented:
https://www.postgresql.org/docs/current/functions-formatting.html#FUNCTIONS-FORMATTING-DATETIME-TABLE
says:
"Day" -> full capitalized day name (blank-padded to 9 chars).
If you don't want the padding, use FM modifier, like:
select to_char('2020-01-31'::date,'FMDay');
Best regards,
depesz