Aw: Time zone offset in to_char()

From: Karsten Hilbert <Karsten(dot)Hilbert(at)gmx(dot)net>
To:
Cc: "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Aw: Time zone offset in to_char()
Date: 2024-01-11 15:14:23
Message-ID: trinity-e8b8c7d3-95a6-46b7-ba71-a56763a5a11d-1704986063957@3c-app-gmx-bs12
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> > In the above, I worked around the issue using a couple of user-defined functions in PG. That should give a reasonable idea of the desired functionality, but it's not an ideal solution to my problem:
> > 1). The first function has as a drawback that it changes the time zone for the entire transaction (not sufficiently isolated to my tastes), while
> > 2). The second function has the benefit that it doesn't leak the time zone change, but has as drawback that the time zone is now hardcoded into the function definition, while
> > 3). Both functions need to be created in the caching database before we can use them, while we have several environments where they would apply (DEV, pre-PROD, PROD).
>
> Would a function that dispatches its calls to a suitable array of hard-coded functions based on an IN parameter help any ?

Without testing the idea - could it even generate the hardcoded function as needed, based on the parameter, and then run it ?

Karsten

In response to

Browse pgsql-general by date

  From Date Subject
Next Message michael 2024-01-11 15:25:36 Re: Time zone offset in to_char()
Previous Message Karsten Hilbert 2024-01-11 15:11:59 Aw: Time zone offset in to_char()