Adding timestamp column - Mailing list pgsql-admin

From Mauricio Fernandez
Subject Adding timestamp column
Date
Msg-id CAMdfv4XEHpa8XSYf1C5EG5CE_VbcpptxiijUNOzj3HEvwLOaxQ@mail.gmail.com
Whole thread Raw
Responses Re: Adding timestamp column
Re: Adding timestamp column
List pgsql-admin
Hi admins, greetings.

I'm trying to add a timestamp column in an existent table.

This query works fine:

select timecreated, timezone('America/Santiago'::text, to_timestamp(timecreated::double precision)) datecreated  
from MDL_LOGSTORE_STANDARD_LOG;

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

I would appreciate some tips

Thanks in advanced

kind regards

Mauricio Fernández

pgsql-admin by date:

Previous
From: Laurenz Albe
Date:
Subject: Re: Query Spins
Next
From: "David G. Johnston"
Date:
Subject: Re: Adding timestamp column