Re: Returning timestamp with timezone at specified timezone irrespective of client timezone

2020-09-27 Thread Jeremy Schneider
On 9/27/20 20:13, Jeremy Schneider wrote: > create or replace function to_char( >v_tstz timestamp with time zone > ,v_format text > ,v_tz text > ) returns text language plpgsql > immutable parallel safe > as $$ > begin > perform set_config('timezone',v_tz,true); > return to_char(v_tstz,

Re: Returning timestamp with timezone at specified timezone irrespective of client timezone

2020-09-27 Thread Jeremy Schneider
On 9/27/20 16:42, Jeremy Schneider wrote: > On 9/27/20 16:13, Ron wrote: >> On 9/27/20 4:16 PM, aNullValue (Drew Stemen) wrote: >>> What I need is for the ability to return a timestamp with timezone, >>> using the UTC offset that corresponds to a column-defined timezone, >>> irrespective of the cli

Re: Returning timestamp with timezone at specified timezone irrespective of client timezone

2020-09-27 Thread Greg Smith
If the time zone is not always known, then maybe the time zone field is NULL in that case? Would it be possible to use UTC for datetimes that have a known time zone (and thus specify UTC in the time zone field)? And NULL otherwise? Or is this a case where the datetime comes in without time zone

Re: Returning timestamp with timezone at specified timezone irrespective of client timezone

2020-09-27 Thread aNullValue (Drew Stemen)
Yes, unfortunately there's no easy way for me to convert the time to UTC for storage in pg, though I think that's more or less immaterial to the output problem I'm having. History: the table I'm working on holds the effective open/close hours of ballot drop-box open-for-service hours, and the

Re: Returning timestamp with timezone at specified timezone irrespective of client timezone

2020-09-27 Thread aNullValue (Drew Stemen)
At 2020-09-27T19:36:34-04:00, Tom Lane sent: > "aNullValue (Drew Stemen)" writes: > > What I need is for the ability to return a timestamp with timezone, using > > the UTC offset that corresponds to a column-defined timezone, irrespective > > of the client/session configured timezone. > > I mi

Re: Returning timestamp with timezone at specified timezone irrespective of client timezone

2020-09-27 Thread Jeremy Schneider
On 9/27/20 16:13, Ron wrote: > On 9/27/20 4:16 PM, aNullValue (Drew Stemen) wrote: >> What I need is for the ability to return a timestamp with timezone, >> using the UTC offset that corresponds to a column-defined timezone, >> irrespective of the client/session configured timezone. >> >> I have th

Re: Returning timestamp with timezone at specified timezone irrespective of client timezone

2020-09-27 Thread aNullValue (Drew Stemen)
At 2020-09-27T19:13:09-04:00, Ron sent: > On 9/27/20 4:16 PM, aNullValue (Drew Stemen) wrote: > >> Hello, >> >> I've attempted to obtain help with this problem from several other places, >> but numerous individuals recommended I ask this mailing list. >> >> What I need is for the ability to re

Re: Returning timestamp with timezone at specified timezone irrespective of client timezone

2020-09-27 Thread Greg Smith
Is it really a requirement to hold the datetime in the database actually in the specified time zone ? Usual practice is to hold UTC only and convert when necessary to user-configured (or specified) or column-specified time zone perhaps only when transferring to/from the db or when otherwise nece

Re: Returning timestamp with timezone at specified timezone irrespective of client timezone

2020-09-27 Thread Tom Lane
"aNullValue (Drew Stemen)" writes: > What I need is for the ability to return a timestamp with timezone, using the > UTC offset that corresponds to a column-defined timezone, irrespective of the > client/session configured timezone. I might be confused, but I think that the way to get the times

Re: Returning timestamp with timezone at specified timezone irrespective of client timezone

2020-09-27 Thread Ron
On 9/27/20 4:16 PM, aNullValue (Drew Stemen) wrote: Hello, I've attempted to obtain help with this problem from several other places, but numerous individuals recommended I ask this mailing list. What I need is for the ability to return a timestamp with timezone, using the UTC offset that co

Re: Returning timestamp with timezone at specified timezone irrespective of client timezone

2020-09-27 Thread aNullValue (Drew Stemen)
At 2020-09-27T18:31:49-04:00, Adrian Klaver sent: > On 9/27/20 2:16 PM, aNullValue (Drew Stemen) wrote: > > Hello, > > > > I've attempted to obtain help with this problem from several other > > places, but numerous individuals recommended I ask this mailing list. > > > > What I need is for the

Re: Returning timestamp with timezone at specified timezone irrespective of client timezone

2020-09-27 Thread Adrian Klaver
On 9/27/20 2:16 PM, aNullValue (Drew Stemen) wrote: Hello, I've attempted to obtain help with this problem from several other places, but numerous individuals recommended I ask this mailing list. What I need is for the ability to return a timestamp with timezone, using the UTC offset that co

Returning timestamp with timezone at specified timezone irrespective of client timezone

2020-09-27 Thread aNullValue (Drew Stemen)
Hello, I've attempted to obtain help with this problem from several other places, but numerous individuals recommended I ask this mailing list. What I need is for the ability to return a timestamp with timezone, using the UTC offset that corresponds to a column-defined timezone, irrespective of

help flattening json

2020-09-27 Thread Chris Stephens
posgresql verion: 12 i can accomplish this procedurally fairly easily but would like to do this strictly in SQL. jsondb=# select jsonb_typeof(jsonb_path_query(vdl_json,'$.tables[*]')) from vdl_json2; jsonb_typeof -- object object object object object object (6 rows) jsondb=# s

Re: pg_upgrade Python version issue on openSUSE

2020-09-27 Thread Adrian Klaver
On 9/27/20 10:30 AM, Adrian Klaver wrote: On 9/27/20 2:00 AM, Paul Förster wrote: Hi Adrian, On 27. Sep, 2020, at 00:09, Adrian Klaver wrote: Could it be that at some point in these instances history plpython* where installed as CREATE LANGUAGE and you are dealing with the vestiges of that?

Re: pg_upgrade Python version issue on openSUSE

2020-09-27 Thread Adrian Klaver
On 9/27/20 2:00 AM, Paul Förster wrote: Hi Adrian, On 27. Sep, 2020, at 00:09, Adrian Klaver wrote: Could it be that at some point in these instances history plpython* where installed as CREATE LANGUAGE and you are dealing with the vestiges of that? I do know for sure that that never happen

Re: pg_upgrade Python version issue on openSUSE

2020-09-27 Thread Adrian Klaver
On 9/26/20 8:07 AM, Adrian Klaver wrote: On 9/26/20 7:49 AM, Tom Lane wrote: =?utf-8?Q?Paul_F=C3=B6rster?= writes: On 26. Sep, 2020, at 16:07, Tom Lane wrote: However, I don't understand how "drop extension plpythonu" worked for you, given your previous query showing that that extension wasn

Re: pg_upgrade Python version issue on openSUSE

2020-09-27 Thread Paul Förster
Hi Adrian, > On 27. Sep, 2020, at 00:09, Adrian Klaver wrote: > Could it be that at some point in these instances history plpython* where > installed as CREATE LANGUAGE and you are dealing with the vestiges of that? I do know for sure that that never happened because the database clusters with