Re: Adding timestamp column - Mailing list pgsql-admin

From David G. Johnston
Subject Re: Adding timestamp column
Date
Msg-id CAKFQuwYQBr7Fw4S9y_nWNS7A6WnyDXf5HZ+Zq85_3nW4kUxKLg@mail.gmail.com
Whole thread Raw
In response to Adding timestamp column  (Mauricio Fernandez <mmauricio.fernandez@gmail.com>)
List pgsql-admin
On Wednesday, September 3, 2025, Mauricio Fernandez <mmauricio.fernandez@gmail.com> wrote:

But, when I want to alter the table I get  a syntax error

alter table MDL_LOGSTORE_STANDARD_LOG
  add column datecreated timestamp
  generated always as ( timezone ('America/Santiago'::text, to_timestamp(timecreated::double precision)));

SQL Error [42601]: ERROR: syntax error at end of input
  Position: 185


Unless you are experimenting with v18 the docs clearly indicate the keyword “stored” is mandatory (since the implemented in 18 virtual is the default).

David J.
 

pgsql-admin by date:

Previous
From: Mauricio Fernandez
Date:
Subject: Adding timestamp column
Next
From: Holger Jakobs
Date:
Subject: Re: Adding timestamp column