From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Pavel Stehule <pavel.stehule@gmail.com>
Cc: Ron <ronljohnsonjr@gmail.com>
Cc: pgsql-general <pgsql-general@lists.postgresql.org>
Subject: Re: Changing displayed time zone in RAISE NOTICE output?
Date: Thu, 12 Jan 2023 08:27:46 -0800
Message-ID: <95af71c3-2d32-352e-cd7c-9cd276aee607@aklaver.com> (raw)
In-Reply-To: <CAFj8pRA9QjKgDO+4JP0OwB4C2acSD=BPmF2R2VEutF4n0-UKwg@mail.gmail.com>
References: <6b5f2616-f44a-10c5-974d-fc19cc493473@gmail.com>
<0ccb4bf8-2f7f-7455-49ac-ff06cda36438@aklaver.com>
<6a7ddac2-48e1-7339-5919-a69d6d7801ae@gmail.com>
<f4d4e8f2-0c73-577f-4184-c7a78121ef8f@aklaver.com>
<CAFj8pRA9QjKgDO+4JP0OwB4C2acSD=BPmF2R2VEutF4n0-UKwg@mail.gmail.com>
On 1/12/23 08:22, Pavel Stehule wrote:
>
>
> čt 12. 1. 2023 v 16:39 odesílatel Adrian Klaver
> <adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com>> napsal:
>
> On 1/11/23 21:25, Ron wrote:
> > On 1/11/23 15:06, Adrian Klaver wrote:
>
> >
> > Hmm. I'd have sworn this didn't work when I tried it:
>
> Did you do?:
>
> DO $$
> BEGIN
> RAISE NOTICE '%', clock_timestamp() at timezone 'UTC';
> END$$;
> ERROR: syntax error at or near "timezone"
> LINE 3: RAISE NOTICE '%', clock_timestamp() at timezone 'UTC';
>
>
> there should be space >>AT TIME ZONE<<
>
> (2023-01-12 17:21:10) postgres=# DO $$
> BEGIN
> RAISE NOTICE '%', clock_timestamp() at time zone 'UTC';
> END$$;
> NOTICE: 2023-01-12 16:21:14.063256
> DO
> (2023-01-12 17:21:14) postgres=#
Yeah I know, I was responding to Ron saying his previous attempt had
failed. Using 'timezone' instead of 'time zone' is a mistake I have made
often enough that I threw it out there as a possible cause for the failure.
>
>
> >
> > postgres=#
> > postgres=# DO $$
> > BEGIN
> > RAISE NOTICE '%', clock_timestamp() at time zone 'UTC';
> > END$$;
> > NOTICE: 2023-01-12 05:22:40.517299
> >
> > But it does work, so all's well that ends well.
> >
>
> --
> Adrian Klaver
> adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com>
>
>
>
--
Adrian Klaver
adrian.klaver@aklaver.com
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: adrian.klaver@aklaver.com, pavel.stehule@gmail.com, ronljohnsonjr@gmail.com
Subject: Re: Changing displayed time zone in RAISE NOTICE output?
In-Reply-To: <95af71c3-2d32-352e-cd7c-9cd276aee607@aklaver.com>
References: <6b5f2616-f44a-10c5-974d-fc19cc493473@gmail.com> <0ccb4bf8-2f7f-7455-49ac-ff06cda36438@aklaver.com> <6a7ddac2-48e1-7339-5919-a69d6d7801ae@gmail.com> <f4d4e8f2-0c73-577f-4184-c7a78121ef8f@aklaver.com> <CAFj8pRA9QjKgDO+4JP0OwB4C2acSD=BPmF2R2VEutF4n0-UKwg@mail.gmail.com> <95af71c3-2d32-352e-cd7c-9cd276aee607@aklaver.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox