From: Tom Lane <tgl@sss.pgh.pa.us> Sent: Thursday, January 30, 2020 6:27:02 PM To: memnik@hotmail.com <memnik@hotmail.com> Cc: pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org> Subject: Re: BUG #16238: Function " to_char(timestamp, text) " doesn't work properly
PG Bug reporting form <noreply@postgresql.org> writes: > As i noticed the problem is that the function " > to_char(timestamp, text) " doesn't work properly. 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.
No, that's behaving as expected and documented. If you don't want fixed-width output, use the FM prefix: