Re: change year in timestamp - Mailing list pgsql-novice

From brew@theMode.com
Subject Re: change year in timestamp
Date
Msg-id Pine.BSF.4.44.0302141221470.83942-100000@themode.com
Whole thread Raw
In response to change year in timestamp  (list DB <listdb@hot.ee>)
List pgsql-novice
argo......

> How can i change the year in a timestamp ?=20
> F.e from 2019-06-11 19:38:29+03 to 2003-06-11 19:38:29+03

Looks similiar to a problem I had, moving classified expirations nearer in
time to get them out of the database. (I send emails to the users telling
them of the pending expiration of their listing).

While I could have certainly have written a perl script to parse out the
timestamp components and reassemble them again what I did was update all
the rows posted a certain month from years past that expire way in the
future and move them all to expire on a date in the near future.  I moved
them month by month to expire on different days in the near future.

Of course I could do that because I have both date_posted and date_expire
timestamps for each record.

Maybe some of the SQL gurus here can tell us an even easier way.

brew

 ==========================================================================
                  Strange Brew   (brew@theMode.com)
     Check out my Musician's Online Database Exchange (The MODE Pages)
                        http://www.TheMode.com
 ==========================================================================



pgsql-novice by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: [SQL] Passing arrays
Next
From: Josh Berkus
Date:
Subject: Re: Executing SQL commands in script files