Re: Automatic update of time column

2025-01-16 Thread Tom Lane
"=?UTF-8?B?6LW15a6H6bmPKOWuh+W9rSk=?=" writes: > MySQL offers a similar feature through ON UPDATE CURRENT_TIMESTAMP. Is there > any > consideration for PostgreSQL to implement this functionality? It's been considered and rejected multiple times before. I don't really see why we'd alter that dec

Automatic update of time column

2025-01-16 Thread 赵宇鹏(宇彭)
Hello, CREATE TABLE test ( id INT, create_time TIMESTAMPTZ DEFAULT now(), update_time TIMESTAMPTZ DEFAULT now()); With a table like this, users often want the update_time to automatically update to the current timestamp when executing an UPDATE statement, without having to exp