Week numbers in PostgreSQL
To get the current ISO 8601 week number in PostgreSQL, use the following code snippet:
SELECT EXTRACT(WEEK FROM CURRENT_DATE);
* Ensure your system or application regional settings are set to follow ISO 8601 standards (weeks start on Monday) if the output varies.