to_char function returning wrong data

From: Sreeni Survi <sreenisurvi(at)gmail(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: to_char function returning wrong data
Date: 2019-02-04 17:16:06
Message-ID: CAD91y4RLdbXvr+oNoN++Wmn2SjxHYRJZnT95f=BPZcSO0OBTxg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi,

Below code has caused my data to be wiped off a table as my where clause
depends on the below returned value.

*select to_char(current_date - interval '5 weeks','IYYYWW') ;*
*201953*

If the number of weeks is 4 or 6 or 3 it returns correct value.

select to_char(current_date - interval '4 weeks','IYYYWW') ;
201901

select to_char(current_date - interval '6 weeks','IYYYWW') ;
201852

This issue can have a serious effect.

Thanks,
Sreeni

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2019-02-04 17:24:32 Re: BUG #15602: pg_dump archive items not in correct section order
Previous Message Axel Andersson 2019-02-04 08:50:03 Re: BUG #15608: Index is used for an inherit table but not for the table with the index