Editing date values in PostgreSQL database

jamez's profile image jamez posted 1 year ago in General Permalink

How can I edit date/time fields by adding or subtracting a day?

Query shows date as '24.12.2022' but when I start to edit it, it becomes "24.1- -". I cannot use arrows to increment or decrement the value, I must enter the date in YYYY-MM-DD format from scratch.

Also, when I copy rows as Excel, then the second point becomes comma (24.12,2022). Why?

I tried unchecking "Local number format" but that didn't change anything. The default date format for my locale is DD.MM.YYYY.

ansgar's profile image ansgar posted 1 year ago Permalink

In MySQL mode HeidiSQL displays dates in YYYY-MM-DD format, anyway what's the locale on the client. But in PostgreSQL mode there may be something missing yet in HeidiSQL.

Could you try to set the default date format variable to ISO 8601 (YYYY-MM-DD HH:MM:SS), like described in https://www.postgresql.org/docs/7.2/sql-set.html :

SET datestyle = 'ISO';
jamez's profile image jamez posted 1 year ago Permalink

Thank you! That makes the date editable by increments! The downside is that I need to add an extra line to EVERY query. And I need to change formatting EVERY time I copy data to Excel.

I really hope there is a way to make editing retain the german datestyle.

Please login to leave a reply, or register at first.