Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1utq2r-00EgqW-0F for pgsql-admin@arkaria.postgresql.org; Wed, 03 Sep 2025 16:09:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1utq2p-00AKtm-Ml for pgsql-admin@arkaria.postgresql.org; Wed, 03 Sep 2025 16:09:12 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1utq2p-00AKte-BN for pgsql-admin@lists.postgresql.org; Wed, 03 Sep 2025 16:09:11 +0000 Received: from mail-ot1-x330.google.com ([2607:f8b0:4864:20::330]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1utq2o-000MAG-0U for pgsql-admin@lists.postgresql.org; Wed, 03 Sep 2025 16:09:10 +0000 Received: by mail-ot1-x330.google.com with SMTP id 46e09a7af769-74595f3852cso96541a34.0 for ; Wed, 03 Sep 2025 09:09:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1756915749; x=1757520549; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=5do6ONCh73GtVYXofdR3+Cd/Q8k58ayzpY4rewnJwFc=; b=lWJD6LhM+dyfj20CrVT4n6IQ67yhT3EWPbprjek6quxzipxI441qHvq2u2DZBK5Me7 znGzD30g0lskseQZTCIem12JACKC1CRCpFizWcNMLdkPNmifqPS+9WraqsTIjUzfVlf8 nPh49Slz3rurVUTtPY8WRsE7789Fc6OnuN73IeZ/4VbqQM5s2XtQ9dV/dvfHO4ZTnDzj F5GDTqmMEq7nk+es0Wd21UlrUsUPdIJg565YJTpkHjy/vt1M4MHaiVPSYOQTAgmbIg0Z LgMSCyfEdtohRZsyKayn9DnRtc9fX2pL1ryVpK/iGgn6YDMER431uqumG3JXQl45Hbjc /VUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756915749; x=1757520549; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=5do6ONCh73GtVYXofdR3+Cd/Q8k58ayzpY4rewnJwFc=; b=eCTdeAaPATy0Huu6ftDNl2rnMI6nObDN2+YOLzBX2/9su76QuUStqQhdCWlVw54GFC A8nN1MEL5Jp3faRWTIx3j6eNkWtsUVvbTnAXSsfHtcb0H4ToUrFVOIkwySL1+rVFBNrd t4UWcOE6hfoInrA9luU8KadwxU0DT7CROM7eKAjE8qMK19sGwQyqcMUY/uD4jaeF8D9V tPa1VY8W0ZppEDA3+rfYmMFbNa1YVEbYr1AIpFlumq9bBBHj8lzPzM5lDtjhTNUDaa7E IaLV7YL/ZgHNDNkTRag2ADG2HvLzuvriN+f9UwRab7m2DtvAR0iMidDFrpsUK/hteE/e UjOA== X-Gm-Message-State: AOJu0YyHzxE1rkjlSiG9nutf49uNP2UFtN6g/17Yu0hmKBIEMx0iZFvF eW0OWc4pqKMpIWufdi0xTrtHwU5k5UClmn4IoQJalKdVE7tAky7wcBAxOVMiGZHLjMcnqRBP4XP NrH4zyWHuE2cNpL6SnLatICTK+uKPO74= X-Gm-Gg: ASbGncs2r8JAZvpYKAbQ/CZC0gvZeBIBfRnWGeVJhm7wug7xXexf1S/8QE1fBqN8cR/ PAoryCuvWlcgQRAjoVGPR8r6ZsE31PC9XGrn9Ew5emgwL2pgVLhid3UYqaxRZS4/hVYrFji5kUp IiDzsBVZvUie0DOSkkcJAn3ThS1TwNp9+rByvLzFwb8CsT1w7S7dRnkHvzllcfazkgtPBOWleNV 8hbT/pgBjLE8ilrpg== X-Google-Smtp-Source: AGHT+IF7TfgNCJXxOxTuSZh/aXC0ohDbwtlU6rZjiP7LuBKlvWzvBbIRo1XMLdnCTgLpnWR4GQhe/+Pq7QLwYn7ufe8= X-Received: by 2002:a05:6830:67ec:b0:73a:6d48:dec9 with SMTP id 46e09a7af769-74569d75dfemr11502502a34.4.1756915749066; Wed, 03 Sep 2025 09:09:09 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a05:6802:1d88:10b0:5df:b5f6:b71 with HTTP; Wed, 3 Sep 2025 09:09:07 -0700 (PDT) In-Reply-To: References: From: "David G. Johnston" Date: Wed, 3 Sep 2025 09:09:07 -0700 X-Gm-Features: Ac12FXzONxJKdcxznFRE2oiBvTRB0GDASqWrUybLg0f-xxfPqn_k6gyA0w3zZAM Message-ID: Subject: Re: Adding timestamp column To: Mauricio Fernandez Cc: Pgsql-admin Content-Type: multipart/alternative; boundary="0000000000001f9e59063de7d38b" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000001f9e59063de7d38b Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 =E2=80=9Cstored=E2=80=9D is mandatory (since the implemented in 18 virtual = is the default). David J. --0000000000001f9e59063de7d38b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wednesday, September 3, 2025, Mauricio Fernandez <mmauricio.fernandez@gmail.com> wrote:<= blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px= #ccc solid;padding-left:1ex">

But, whe= n I want to alter the table I get=C2=A0 a syntax=C2=A0error

<= /div>
alter table MDL_LOGSTORE_STANDARD_LOG
=C2=A0 add column datec= reated timestamp
=C2=A0 generated always as ( timezone ('America/Sa= ntiago'::text, to_timestamp(timecreated::double precision)));
<= /div>

SQL Error [42601]: ERROR: syntax error at end of i= nput
=C2=A0 Position: 185

Unless you are experimenting with v18 the docs clearly indicat= e the keyword =E2=80=9Cstored=E2=80=9D is mandatory (since the implemented = in 18 virtual is the default).

David J.
= =C2=A0
--0000000000001f9e59063de7d38b--