PostgreSQL: How to find last Day of the Month

In this post, I am sharing aUser defined function to find Last Day of The Month in PostgreSQL.

Once in a month, One of our Postgres reporting servers requires maintenance like VACUUM FULL activity.

For us that one day would be the last day of the month because on the last day of the month we are calculating some additional information.

Here, I am sharing one UDF to find out the Last Day of the month which we can use for scheduling the maintenance.

Function script:

Sample executions:


Please share your ideas and opinions about this topic with me, your contribution will add true value to this topic.
If anyone has doubts on this topic then please do let me know by leaving comments or send me an email.

If you like this post, then please share it with others.
Please follow dbrnd.com, I will share my experience towards the success of Database Research and Development Activity.

I put up a post every day, please keep reading and learning.
Discover Yourself, Happy Blogging !
Anvesh M. Patel.

More from dbrnd.com

Leave a Reply

Be the First to Comment!

Notify of
avatar
wpDiscuz