pg.ddx.io pgsql-jdbc@postgresql.org mailing list archive
help / color / mirror / Atom feedSQL solution for my JDBC timezone issue
17+ messages / 5 participants
[nested] [flat]
* SQL solution for my JDBC timezone issue
@ 2015-02-23 13:40 George Woodring <george.woodring@iglass.net>
2015-02-23 14:16 ` Re: SQL solution for my JDBC timezone issue Dave Cramer <pg@fastcrypt.com>
0 siblings, 1 reply; 17+ messages in thread
From: George Woodring @ 2015-02-23 13:40 UTC (permalink / raw)
To: pgsql-general <pgsql-general@postgresql.org>
Anyone have a suggestion for setting the timezone back to the Postgres db
default on a connection. JDBC now sets the timezone to be the client which
is my web server and ignores the default timezone that I have set in the
DB. There are large parts of my code that I have never worried about
timezones because the DB would handle it. Before I head down that path, I
thought I would check and see if there was an easier way for me to put it
back into the database.
My latest issue is I create a date object and set it to 3am PST, If I save
it into a timestamp with timezone the db saves it at 3am PST when I pull it
out. If I save it to timestamp without timezone, I get 6am now where as
before I would get 3am.
Any suggestions would be appreciated
George Woodring
iGLASS Networks
www.iglass.net
^ permalink raw reply [nested|flat] 17+ messages in thread
* Re: SQL solution for my JDBC timezone issue
2015-02-23 13:40 SQL solution for my JDBC timezone issue George Woodring <george.woodring@iglass.net>
@ 2015-02-23 14:16 ` Dave Cramer <pg@fastcrypt.com>
2015-02-23 15:42 ` Re: SQL solution for my JDBC timezone issue George Woodring <george.woodring@iglass.net>
0 siblings, 1 reply; 17+ messages in thread
From: Dave Cramer @ 2015-02-23 14:16 UTC (permalink / raw)
To: George Woodring <george.woodring@iglass.net>; +Cc: pgsql-general <pgsql-general@postgresql.org>
Well you could always just put it back to whatever you want when you open
the connection ie "set timezone ...."
Dave Cramer
dave.cramer(at)credativ(dot)ca
http://www.credativ.ca
On 23 February 2015 at 08:40, George Woodring <george.woodring@iglass.net>
wrote:
> Anyone have a suggestion for setting the timezone back to the Postgres db
> default on a connection. JDBC now sets the timezone to be the client which
> is my web server and ignores the default timezone that I have set in the
> DB. There are large parts of my code that I have never worried about
> timezones because the DB would handle it. Before I head down that path, I
> thought I would check and see if there was an easier way for me to put it
> back into the database.
>
> My latest issue is I create a date object and set it to 3am PST, If I
> save it into a timestamp with timezone the db saves it at 3am PST when I
> pull it out. If I save it to timestamp without timezone, I get 6am now
> where as before I would get 3am.
>
> Any suggestions would be appreciated
> George Woodring
> iGLASS Networks
> www.iglass.net
>
^ permalink raw reply [nested|flat] 17+ messages in thread
* Re: SQL solution for my JDBC timezone issue
2015-02-23 13:40 SQL solution for my JDBC timezone issue George Woodring <george.woodring@iglass.net>
2015-02-23 14:16 ` Re: SQL solution for my JDBC timezone issue Dave Cramer <pg@fastcrypt.com>
@ 2015-02-23 15:42 ` George Woodring <george.woodring@iglass.net>
2015-02-23 15:45 ` Re: SQL solution for my JDBC timezone issue Dave Cramer <pg@fastcrypt.com>
2015-02-23 15:49 ` Re: SQL solution for my JDBC timezone issue Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 2 replies; 17+ messages in thread
From: George Woodring @ 2015-02-23 15:42 UTC (permalink / raw)
To: Dave Cramer <pg@fastcrypt.com>; +Cc: pgsql-general <pgsql-general@postgresql.org>
Yes, that is where we think we are heading, the issue is that the code does
not know what it needs to be set back to. We have 90 databases with 5
different time zones. I was just hoping for a more elegant solution than
writing a lookup table that says if you are connecting to db x then set to
timezone y.
George Woodring
iGLASS Networks
www.iglass.net
On Mon, Feb 23, 2015 at 9:16 AM, Dave Cramer <pg@fastcrypt.com> wrote:
> Well you could always just put it back to whatever you want when you open
> the connection ie "set timezone ...."
>
>
>
> Dave Cramer
>
> dave.cramer(at)credativ(dot)ca
> http://www.credativ.ca
>
> On 23 February 2015 at 08:40, George Woodring <george.woodring@iglass.net>
> wrote:
>
>> Anyone have a suggestion for setting the timezone back to the Postgres db
>> default on a connection. JDBC now sets the timezone to be the client which
>> is my web server and ignores the default timezone that I have set in the
>> DB. There are large parts of my code that I have never worried about
>> timezones because the DB would handle it. Before I head down that path, I
>> thought I would check and see if there was an easier way for me to put it
>> back into the database.
>>
>> My latest issue is I create a date object and set it to 3am PST, If I
>> save it into a timestamp with timezone the db saves it at 3am PST when I
>> pull it out. If I save it to timestamp without timezone, I get 6am now
>> where as before I would get 3am.
>>
>> Any suggestions would be appreciated
>> George Woodring
>> iGLASS Networks
>> www.iglass.net
>>
>
>
^ permalink raw reply [nested|flat] 17+ messages in thread
* Re: SQL solution for my JDBC timezone issue
2015-02-23 13:40 SQL solution for my JDBC timezone issue George Woodring <george.woodring@iglass.net>
2015-02-23 14:16 ` Re: SQL solution for my JDBC timezone issue Dave Cramer <pg@fastcrypt.com>
2015-02-23 15:42 ` Re: SQL solution for my JDBC timezone issue George Woodring <george.woodring@iglass.net>
@ 2015-02-23 15:45 ` Dave Cramer <pg@fastcrypt.com>
1 sibling, 0 replies; 17+ messages in thread
From: Dave Cramer @ 2015-02-23 15:45 UTC (permalink / raw)
To: George Woodring <george.woodring@iglass.net>; +Cc: pgsql-general <pgsql-general@postgresql.org>
Timestamps have always been a bit of a pain since JDBC does not support
both with and without timezones. It really only supports timestamps with
timezone.
We have made decisions in the driver which are not optimal for everyone.
The reason it does this is for binary transfers of data. We need to control
which timezone both the server and the client are operating in.
I'm open to suggestions ?
Dave Cramer
dave.cramer(at)credativ(dot)ca
http://www.credativ.ca
On 23 February 2015 at 10:42, George Woodring <george.woodring@iglass.net>
wrote:
> Yes, that is where we think we are heading, the issue is that the code
> does not know what it needs to be set back to. We have 90 databases with 5
> different time zones. I was just hoping for a more elegant solution than
> writing a lookup table that says if you are connecting to db x then set to
> timezone y.
>
> George Woodring
>
> iGLASS Networks
> www.iglass.net
>
> On Mon, Feb 23, 2015 at 9:16 AM, Dave Cramer <pg@fastcrypt.com> wrote:
>
>> Well you could always just put it back to whatever you want when you open
>> the connection ie "set timezone ...."
>>
>>
>>
>> Dave Cramer
>>
>> dave.cramer(at)credativ(dot)ca
>> http://www.credativ.ca
>>
>> On 23 February 2015 at 08:40, George Woodring <george.woodring@iglass.net
>> > wrote:
>>
>>> Anyone have a suggestion for setting the timezone back to the Postgres
>>> db default on a connection. JDBC now sets the timezone to be the client
>>> which is my web server and ignores the default timezone that I have set in
>>> the DB. There are large parts of my code that I have never worried about
>>> timezones because the DB would handle it. Before I head down that path, I
>>> thought I would check and see if there was an easier way for me to put it
>>> back into the database.
>>>
>>> My latest issue is I create a date object and set it to 3am PST, If I
>>> save it into a timestamp with timezone the db saves it at 3am PST when I
>>> pull it out. If I save it to timestamp without timezone, I get 6am now
>>> where as before I would get 3am.
>>>
>>> Any suggestions would be appreciated
>>> George Woodring
>>> iGLASS Networks
>>> www.iglass.net
>>>
>>
>>
>
^ permalink raw reply [nested|flat] 17+ messages in thread
* Re: SQL solution for my JDBC timezone issue
2015-02-23 13:40 SQL solution for my JDBC timezone issue George Woodring <george.woodring@iglass.net>
2015-02-23 14:16 ` Re: SQL solution for my JDBC timezone issue Dave Cramer <pg@fastcrypt.com>
2015-02-23 15:42 ` Re: SQL solution for my JDBC timezone issue George Woodring <george.woodring@iglass.net>
@ 2015-02-23 15:49 ` Tom Lane <tgl@sss.pgh.pa.us>
2015-02-23 16:57 ` Re: [GENERAL] SQL solution for my JDBC timezone issue Dave Cramer <pg@fastcrypt.com>
2015-02-23 20:15 ` Re: SQL solution for my JDBC timezone issue George Woodring <george.woodring@iglass.net>
1 sibling, 2 replies; 17+ messages in thread
From: Tom Lane @ 2015-02-23 15:49 UTC (permalink / raw)
To: George Woodring <george.woodring@iglass.net>; +Cc: Dave Cramer <pg@fastcrypt.com>; pgsql-general <pgsql-general@postgresql.org>
George Woodring <george.woodring@iglass.net> writes:
> Yes, that is where we think we are heading, the issue is that the code does
> not know what it needs to be set back to. We have 90 databases with 5
> different time zones. I was just hoping for a more elegant solution than
> writing a lookup table that says if you are connecting to db x then set to
> timezone y.
"RESET timezone" ?
regards, tom lane
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
^ permalink raw reply [nested|flat] 17+ messages in thread
* Re: [GENERAL] SQL solution for my JDBC timezone issue
2015-02-23 13:40 SQL solution for my JDBC timezone issue George Woodring <george.woodring@iglass.net>
2015-02-23 14:16 ` Re: SQL solution for my JDBC timezone issue Dave Cramer <pg@fastcrypt.com>
2015-02-23 15:42 ` Re: SQL solution for my JDBC timezone issue George Woodring <george.woodring@iglass.net>
2015-02-23 15:49 ` Re: SQL solution for my JDBC timezone issue Tom Lane <tgl@sss.pgh.pa.us>
@ 2015-02-23 16:57 ` Dave Cramer <pg@fastcrypt.com>
1 sibling, 0 replies; 17+ messages in thread
From: Dave Cramer @ 2015-02-23 16:57 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; pgsql-jdbc; +Cc: George Woodring <george.woodring@iglass.net>; pgsql-general <pgsql-general@postgresql.org>
For posterity please be aware this will very likely break any timestamps
transfer using JDBC and binary transfer.
This is not recommended for general consumption
Dave Cramer
dave.cramer(at)credativ(dot)ca
http://www.credativ.ca
On 23 February 2015 at 10:49, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> George Woodring <george.woodring@iglass.net> writes:
> > Yes, that is where we think we are heading, the issue is that the code
> does
> > not know what it needs to be set back to. We have 90 databases with 5
> > different time zones. I was just hoping for a more elegant solution than
> > writing a lookup table that says if you are connecting to db x then set
> to
> > timezone y.
>
> "RESET timezone" ?
>
> regards, tom lane
>
^ permalink raw reply [nested|flat] 17+ messages in thread
* Re: SQL solution for my JDBC timezone issue
2015-02-23 13:40 SQL solution for my JDBC timezone issue George Woodring <george.woodring@iglass.net>
2015-02-23 14:16 ` Re: SQL solution for my JDBC timezone issue Dave Cramer <pg@fastcrypt.com>
2015-02-23 15:42 ` Re: SQL solution for my JDBC timezone issue George Woodring <george.woodring@iglass.net>
2015-02-23 15:49 ` Re: SQL solution for my JDBC timezone issue Tom Lane <tgl@sss.pgh.pa.us>
@ 2015-02-23 20:15 ` George Woodring <george.woodring@iglass.net>
2015-02-23 20:29 ` Re: SQL solution for my JDBC timezone issue Adrian Klaver <adrian.klaver@aklaver.com>
1 sibling, 1 reply; 17+ messages in thread
From: George Woodring @ 2015-02-23 20:15 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Dave Cramer <pg@fastcrypt.com>; pgsql-general <pgsql-general@postgresql.org>
This is what I was looking for, however the JDBC does something to make its
timezone the default.
My cluster is set to GMT, I have a DB that is set to US/Pacific, when I
get the connection from JDBC it is US/Eastern. The reset command does not
affect it. I can set timezone in the code to 'US/Pacific" and I see it
change, when I do another RESET timezone it goes back to US/Eastern.
Thanks,
George Woodring
iGLASS Networks
www.iglass.net
On Mon, Feb 23, 2015 at 10:49 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> George Woodring <george.woodring@iglass.net> writes:
> > Yes, that is where we think we are heading, the issue is that the code
> does
> > not know what it needs to be set back to. We have 90 databases with 5
> > different time zones. I was just hoping for a more elegant solution than
> > writing a lookup table that says if you are connecting to db x then set
> to
> > timezone y.
>
> "RESET timezone" ?
>
> regards, tom lane
>
^ permalink raw reply [nested|flat] 17+ messages in thread
* Re: SQL solution for my JDBC timezone issue
2015-02-23 13:40 SQL solution for my JDBC timezone issue George Woodring <george.woodring@iglass.net>
2015-02-23 14:16 ` Re: SQL solution for my JDBC timezone issue Dave Cramer <pg@fastcrypt.com>
2015-02-23 15:42 ` Re: SQL solution for my JDBC timezone issue George Woodring <george.woodring@iglass.net>
2015-02-23 15:49 ` Re: SQL solution for my JDBC timezone issue Tom Lane <tgl@sss.pgh.pa.us>
2015-02-23 20:15 ` Re: SQL solution for my JDBC timezone issue George Woodring <george.woodring@iglass.net>
@ 2015-02-23 20:29 ` Adrian Klaver <adrian.klaver@aklaver.com>
2015-02-23 20:32 ` Re: SQL solution for my JDBC timezone issue Dave Cramer <pg@fastcrypt.com>
2015-02-24 14:25 ` Re: SQL solution for my JDBC timezone issue George Woodring <george.woodring@iglass.net>
0 siblings, 2 replies; 17+ messages in thread
From: Adrian Klaver @ 2015-02-23 20:29 UTC (permalink / raw)
To: George Woodring <george.woodring@iglass.net>; Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Dave Cramer <pg@fastcrypt.com>; pgsql-general <pgsql-general@postgresql.org>
On 02/23/2015 12:15 PM, George Woodring wrote:
> This is what I was looking for, however the JDBC does something to make
> its timezone the default.
>
> My cluster is set to GMT, I have a DB that is set to US/Pacific, when I
> get the connection from JDBC it is US/Eastern. The reset command does
> not affect it. I can set timezone in the code to 'US/Pacific" and I see
> it change, when I do another RESET timezone it goes back to US/Eastern.
In your original post you mentioned that access to the databases is
through a Web server.
Is there just one Web server with one time zone?
>
> Thanks,
> George Woodring
>
> iGLASS Networks
> www.iglass.net <http://www.iglass.net;
>
> On Mon, Feb 23, 2015 at 10:49 AM, Tom Lane <tgl@sss.pgh.pa.us
> <mailto:tgl@sss.pgh.pa.us>> wrote:
>
> George Woodring <george.woodring@iglass.net
> <mailto:george.woodring@iglass.net>> writes:
> > Yes, that is where we think we are heading, the issue is that the code does
> > not know what it needs to be set back to. We have 90 databases with 5
> > different time zones. I was just hoping for a more elegant solution than
> > writing a lookup table that says if you are connecting to db x then set to
> > timezone y.
>
> "RESET timezone" ?
>
> regards, tom lane
>
>
--
Adrian Klaver
adrian.klaver@aklaver.com
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
^ permalink raw reply [nested|flat] 17+ messages in thread
* Re: SQL solution for my JDBC timezone issue
2015-02-23 13:40 SQL solution for my JDBC timezone issue George Woodring <george.woodring@iglass.net>
2015-02-23 14:16 ` Re: SQL solution for my JDBC timezone issue Dave Cramer <pg@fastcrypt.com>
2015-02-23 15:42 ` Re: SQL solution for my JDBC timezone issue George Woodring <george.woodring@iglass.net>
2015-02-23 15:49 ` Re: SQL solution for my JDBC timezone issue Tom Lane <tgl@sss.pgh.pa.us>
2015-02-23 20:15 ` Re: SQL solution for my JDBC timezone issue George Woodring <george.woodring@iglass.net>
2015-02-23 20:29 ` Re: SQL solution for my JDBC timezone issue Adrian Klaver <adrian.klaver@aklaver.com>
@ 2015-02-23 20:32 ` Dave Cramer <pg@fastcrypt.com>
2015-02-23 21:31 ` Re: SQL solution for my JDBC timezone issue Tom Lane <tgl@sss.pgh.pa.us>
1 sibling, 1 reply; 17+ messages in thread
From: Dave Cramer @ 2015-02-23 20:32 UTC (permalink / raw)
To: Adrian Klaver <adrian.klaver@aklaver.com>; +Cc: George Woodring <george.woodring@iglass.net>; Tom Lane <tgl@sss.pgh.pa.us>; pgsql-general <pgsql-general@postgresql.org>
George,
Everytime you get a connection the driver will issue set timezone ...
It does not change the default time zone for the server (AFAICS)
Dave Cramer
dave.cramer(at)credativ(dot)ca
http://www.credativ.ca
On 23 February 2015 at 15:29, Adrian Klaver <adrian.klaver@aklaver.com>
wrote:
> On 02/23/2015 12:15 PM, George Woodring wrote:
>
>> This is what I was looking for, however the JDBC does something to make
>> its timezone the default.
>>
>> My cluster is set to GMT, I have a DB that is set to US/Pacific, when I
>> get the connection from JDBC it is US/Eastern. The reset command does
>> not affect it. I can set timezone in the code to 'US/Pacific" and I see
>> it change, when I do another RESET timezone it goes back to US/Eastern.
>>
>
> In your original post you mentioned that access to the databases is
> through a Web server.
>
> Is there just one Web server with one time zone?
>
>
>> Thanks,
>> George Woodring
>>
>> iGLASS Networks
>> www.iglass.net <http://www.iglass.net;
>>
>> On Mon, Feb 23, 2015 at 10:49 AM, Tom Lane <tgl@sss.pgh.pa.us
>> <mailto:tgl@sss.pgh.pa.us>> wrote:
>>
>> George Woodring <george.woodring@iglass.net
>> <mailto:george.woodring@iglass.net>> writes:
>> > Yes, that is where we think we are heading, the issue is that the
>> code does
>> > not know what it needs to be set back to. We have 90 databases
>> with 5
>> > different time zones. I was just hoping for a more elegant
>> solution than
>> > writing a lookup table that says if you are connecting to db x then
>> set to
>> > timezone y.
>>
>> "RESET timezone" ?
>>
>> regards, tom lane
>>
>>
>>
>
> --
> Adrian Klaver
> adrian.klaver@aklaver.com
>
^ permalink raw reply [nested|flat] 17+ messages in thread
* Re: SQL solution for my JDBC timezone issue
2015-02-23 13:40 SQL solution for my JDBC timezone issue George Woodring <george.woodring@iglass.net>
2015-02-23 14:16 ` Re: SQL solution for my JDBC timezone issue Dave Cramer <pg@fastcrypt.com>
2015-02-23 15:42 ` Re: SQL solution for my JDBC timezone issue George Woodring <george.woodring@iglass.net>
2015-02-23 15:49 ` Re: SQL solution for my JDBC timezone issue Tom Lane <tgl@sss.pgh.pa.us>
2015-02-23 20:15 ` Re: SQL solution for my JDBC timezone issue George Woodring <george.woodring@iglass.net>
2015-02-23 20:29 ` Re: SQL solution for my JDBC timezone issue Adrian Klaver <adrian.klaver@aklaver.com>
2015-02-23 20:32 ` Re: SQL solution for my JDBC timezone issue Dave Cramer <pg@fastcrypt.com>
@ 2015-02-23 21:31 ` Tom Lane <tgl@sss.pgh.pa.us>
2015-02-23 21:33 ` Re: SQL solution for my JDBC timezone issue Dave Cramer <pg@fastcrypt.com>
0 siblings, 1 reply; 17+ messages in thread
From: Tom Lane @ 2015-02-23 21:31 UTC (permalink / raw)
To: Dave Cramer <pg@fastcrypt.com>; +Cc: Adrian Klaver <adrian.klaver@aklaver.com>; George Woodring <george.woodring@iglass.net>; pgsql-general <pgsql-general@postgresql.org>
Dave Cramer <pg@fastcrypt.com> writes:
> Everytime you get a connection the driver will issue set timezone ...
> It does not change the default time zone for the server (AFAICS)
Hmm ... depending on exactly how you issue it, it might become the default
for the session, I think. I seem to recall that parameter settings
included in the startup packet become session-lifespan defaults. If you
issued the SET as a separate command then a RESET ought to undo it.
regards, tom lane
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
^ permalink raw reply [nested|flat] 17+ messages in thread
* Re: SQL solution for my JDBC timezone issue
2015-02-23 13:40 SQL solution for my JDBC timezone issue George Woodring <george.woodring@iglass.net>
2015-02-23 14:16 ` Re: SQL solution for my JDBC timezone issue Dave Cramer <pg@fastcrypt.com>
2015-02-23 15:42 ` Re: SQL solution for my JDBC timezone issue George Woodring <george.woodring@iglass.net>
2015-02-23 15:49 ` Re: SQL solution for my JDBC timezone issue Tom Lane <tgl@sss.pgh.pa.us>
2015-02-23 20:15 ` Re: SQL solution for my JDBC timezone issue George Woodring <george.woodring@iglass.net>
2015-02-23 20:29 ` Re: SQL solution for my JDBC timezone issue Adrian Klaver <adrian.klaver@aklaver.com>
2015-02-23 20:32 ` Re: SQL solution for my JDBC timezone issue Dave Cramer <pg@fastcrypt.com>
2015-02-23 21:31 ` Re: SQL solution for my JDBC timezone issue Tom Lane <tgl@sss.pgh.pa.us>
@ 2015-02-23 21:33 ` Dave Cramer <pg@fastcrypt.com>
0 siblings, 0 replies; 17+ messages in thread
From: Dave Cramer @ 2015-02-23 21:33 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Adrian Klaver <adrian.klaver@aklaver.com>; George Woodring <george.woodring@iglass.net>; pgsql-general <pgsql-general@postgresql.org>
On 23 February 2015 at 16:31, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Dave Cramer <pg@fastcrypt.com> writes:
> > Everytime you get a connection the driver will issue set timezone ...
> > It does not change the default time zone for the server (AFAICS)
>
> Hmm ... depending on exactly how you issue it, it might become the default
> for the session, I think. I seem to recall that parameter settings
> included in the startup packet become session-lifespan defaults. If you
> issued the SET as a separate command then a RESET ought to undo it.
>
That would explain it then as they are issued in the startup command
Dave Cramer
dave.cramer(at)credativ(dot)ca
http://www.credativ.ca
^ permalink raw reply [nested|flat] 17+ messages in thread
* Re: SQL solution for my JDBC timezone issue
2015-02-23 13:40 SQL solution for my JDBC timezone issue George Woodring <george.woodring@iglass.net>
2015-02-23 14:16 ` Re: SQL solution for my JDBC timezone issue Dave Cramer <pg@fastcrypt.com>
2015-02-23 15:42 ` Re: SQL solution for my JDBC timezone issue George Woodring <george.woodring@iglass.net>
2015-02-23 15:49 ` Re: SQL solution for my JDBC timezone issue Tom Lane <tgl@sss.pgh.pa.us>
2015-02-23 20:15 ` Re: SQL solution for my JDBC timezone issue George Woodring <george.woodring@iglass.net>
2015-02-23 20:29 ` Re: SQL solution for my JDBC timezone issue Adrian Klaver <adrian.klaver@aklaver.com>
@ 2015-02-24 14:25 ` George Woodring <george.woodring@iglass.net>
2015-02-24 14:30 ` Re: SQL solution for my JDBC timezone issue Dave Cramer <pg@fastcrypt.com>
2015-02-24 15:29 ` Re: SQL solution for my JDBC timezone issue Adrian Klaver <adrian.klaver@aklaver.com>
1 sibling, 2 replies; 17+ messages in thread
From: George Woodring @ 2015-02-24 14:25 UTC (permalink / raw)
To: Adrian Klaver <adrian.klaver@aklaver.com>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; Dave Cramer <pg@fastcrypt.com>; pgsql-general <pgsql-general@postgresql.org>
-- In your original post you mentioned that access to the databases is
through a Web server.
-- Is there just one Web server with one time zone?
We have 2 web servers that are clustered together. They are both set to
Eastern since that is the timezone they are located in.
iGLASS Networks
www.iglass.net
^ permalink raw reply [nested|flat] 17+ messages in thread
* Re: SQL solution for my JDBC timezone issue
2015-02-23 13:40 SQL solution for my JDBC timezone issue George Woodring <george.woodring@iglass.net>
2015-02-23 14:16 ` Re: SQL solution for my JDBC timezone issue Dave Cramer <pg@fastcrypt.com>
2015-02-23 15:42 ` Re: SQL solution for my JDBC timezone issue George Woodring <george.woodring@iglass.net>
2015-02-23 15:49 ` Re: SQL solution for my JDBC timezone issue Tom Lane <tgl@sss.pgh.pa.us>
2015-02-23 20:15 ` Re: SQL solution for my JDBC timezone issue George Woodring <george.woodring@iglass.net>
2015-02-23 20:29 ` Re: SQL solution for my JDBC timezone issue Adrian Klaver <adrian.klaver@aklaver.com>
2015-02-24 14:25 ` Re: SQL solution for my JDBC timezone issue George Woodring <george.woodring@iglass.net>
@ 2015-02-24 14:30 ` Dave Cramer <pg@fastcrypt.com>
1 sibling, 0 replies; 17+ messages in thread
From: Dave Cramer @ 2015-02-24 14:30 UTC (permalink / raw)
To: George Woodring <george.woodring@iglass.net>; +Cc: Adrian Klaver <adrian.klaver@aklaver.com>; Tom Lane <tgl@sss.pgh.pa.us>; pgsql-general <pgsql-general@postgresql.org>
George,
One solution for you might be to write a C function which gets the OS
timezone and then you can execute set timezone=server_timezone();
Dave Cramer
dave.cramer(at)credativ(dot)ca
http://www.credativ.ca
On 24 February 2015 at 09:25, George Woodring <george.woodring@iglass.net>
wrote:
> -- In your original post you mentioned that access to the databases is
> through a Web server.
>
> -- Is there just one Web server with one time zone?
>
> We have 2 web servers that are clustered together. They are both set to
> Eastern since that is the timezone they are located in.
>
> iGLASS Networks
> www.iglass.net
>
>
>
^ permalink raw reply [nested|flat] 17+ messages in thread
* Re: SQL solution for my JDBC timezone issue
2015-02-23 13:40 SQL solution for my JDBC timezone issue George Woodring <george.woodring@iglass.net>
2015-02-23 14:16 ` Re: SQL solution for my JDBC timezone issue Dave Cramer <pg@fastcrypt.com>
2015-02-23 15:42 ` Re: SQL solution for my JDBC timezone issue George Woodring <george.woodring@iglass.net>
2015-02-23 15:49 ` Re: SQL solution for my JDBC timezone issue Tom Lane <tgl@sss.pgh.pa.us>
2015-02-23 20:15 ` Re: SQL solution for my JDBC timezone issue George Woodring <george.woodring@iglass.net>
2015-02-23 20:29 ` Re: SQL solution for my JDBC timezone issue Adrian Klaver <adrian.klaver@aklaver.com>
2015-02-24 14:25 ` Re: SQL solution for my JDBC timezone issue George Woodring <george.woodring@iglass.net>
@ 2015-02-24 15:29 ` Adrian Klaver <adrian.klaver@aklaver.com>
2015-02-24 15:36 ` Re: SQL solution for my JDBC timezone issue George Woodring <george.woodring@iglass.net>
2015-02-24 19:36 ` Re: SQL solution for my JDBC timezone issue Gavin Flower <GavinFlower@archidevsys.co.nz>
1 sibling, 2 replies; 17+ messages in thread
From: Adrian Klaver @ 2015-02-24 15:29 UTC (permalink / raw)
To: George Woodring <george.woodring@iglass.net>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; Dave Cramer <pg@fastcrypt.com>; pgsql-general <pgsql-general@postgresql.org>
On 02/24/2015 06:25 AM, George Woodring wrote:
> -- In your original post you mentioned that access to the databases is
> through a Web server.
>
> -- Is there just one Web server with one time zone?
>
> We have 2 web servers that are clustered together. They are both set to
> Eastern since that is the timezone they are located in.
>
So:
JDBC Web servers(US/East) <---> 90 database (5 different timezones)
Therefore everything to the end user is passed through the Web servers?
Is there a reason why the databases have different timezones?
Seems to me less complicated to have all the databases share the UTC
timezone. Then you only have one offset, US/East <--> UTC.
> iGLASS Networks
> www.iglass.net <http://www.iglass.net;
>
>
--
Adrian Klaver
adrian.klaver@aklaver.com
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
^ permalink raw reply [nested|flat] 17+ messages in thread
* Re: SQL solution for my JDBC timezone issue
2015-02-23 13:40 SQL solution for my JDBC timezone issue George Woodring <george.woodring@iglass.net>
2015-02-23 14:16 ` Re: SQL solution for my JDBC timezone issue Dave Cramer <pg@fastcrypt.com>
2015-02-23 15:42 ` Re: SQL solution for my JDBC timezone issue George Woodring <george.woodring@iglass.net>
2015-02-23 15:49 ` Re: SQL solution for my JDBC timezone issue Tom Lane <tgl@sss.pgh.pa.us>
2015-02-23 20:15 ` Re: SQL solution for my JDBC timezone issue George Woodring <george.woodring@iglass.net>
2015-02-23 20:29 ` Re: SQL solution for my JDBC timezone issue Adrian Klaver <adrian.klaver@aklaver.com>
2015-02-24 14:25 ` Re: SQL solution for my JDBC timezone issue George Woodring <george.woodring@iglass.net>
2015-02-24 15:29 ` Re: SQL solution for my JDBC timezone issue Adrian Klaver <adrian.klaver@aklaver.com>
@ 2015-02-24 15:36 ` George Woodring <george.woodring@iglass.net>
1 sibling, 0 replies; 17+ messages in thread
From: George Woodring @ 2015-02-24 15:36 UTC (permalink / raw)
To: Adrian Klaver <adrian.klaver@aklaver.com>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; Dave Cramer <pg@fastcrypt.com>; pgsql-general <pgsql-general@postgresql.org>
>
>
>
> So:
>
> JDBC Web servers(US/East) <---> 90 database (5 different timezones)
>
> Therefore everything to the end user is passed through the Web servers?
>
> Is there a reason why the databases have different timezones?
>
> Seems to me less complicated to have all the databases share the UTC
> timezone. Then you only have one offset, US/East <--> UTC.
>
>
We originally did it for simplicity sake, the database is set for our
customer's timezone. So when we grabbed a date from the db, it would in
the correct timezone for the viewer, without the web code having to know
the timezone.
George Woodring
iGLASS Networks
www.iglass.net
^ permalink raw reply [nested|flat] 17+ messages in thread
* Re: SQL solution for my JDBC timezone issue
2015-02-23 13:40 SQL solution for my JDBC timezone issue George Woodring <george.woodring@iglass.net>
2015-02-23 14:16 ` Re: SQL solution for my JDBC timezone issue Dave Cramer <pg@fastcrypt.com>
2015-02-23 15:42 ` Re: SQL solution for my JDBC timezone issue George Woodring <george.woodring@iglass.net>
2015-02-23 15:49 ` Re: SQL solution for my JDBC timezone issue Tom Lane <tgl@sss.pgh.pa.us>
2015-02-23 20:15 ` Re: SQL solution for my JDBC timezone issue George Woodring <george.woodring@iglass.net>
2015-02-23 20:29 ` Re: SQL solution for my JDBC timezone issue Adrian Klaver <adrian.klaver@aklaver.com>
2015-02-24 14:25 ` Re: SQL solution for my JDBC timezone issue George Woodring <george.woodring@iglass.net>
2015-02-24 15:29 ` Re: SQL solution for my JDBC timezone issue Adrian Klaver <adrian.klaver@aklaver.com>
@ 2015-02-24 19:36 ` Gavin Flower <GavinFlower@archidevsys.co.nz>
2015-02-24 19:58 ` Re: SQL solution for my JDBC timezone issue Adrian Klaver <adrian.klaver@aklaver.com>
1 sibling, 1 reply; 17+ messages in thread
From: Gavin Flower @ 2015-02-24 19:36 UTC (permalink / raw)
To: Adrian Klaver <adrian.klaver@aklaver.com>; George Woodring <george.woodring@iglass.net>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; Dave Cramer <pg@fastcrypt.com>; pgsql-general <pgsql-general@postgresql.org>
On 25/02/15 04:29, Adrian Klaver wrote:
> On 02/24/2015 06:25 AM, George Woodring wrote:
>> -- In your original post you mentioned that access to the databases is
>> through a Web server.
>>
>> -- Is there just one Web server with one time zone?
>>
>> We have 2 web servers that are clustered together. They are both set to
>> Eastern since that is the timezone they are located in.
>>
>
>
> So:
>
> JDBC Web servers(US/East) <---> 90 database (5 different timezones)
>
> Therefore everything to the end user is passed through the Web servers?
>
> Is there a reason why the databases have different timezones?
>
> Seems to me less complicated to have all the databases share the UTC
> timezone. Then you only have one offset, US/East <--> UTC.
>
>> iGLASS Networks
>> www.iglass.net <http://www.iglass.net;
>>
>>
>
>
Yes I think it sanest to have servers use GMT*, as then it is simple
enough to convert results to whatever local time zone the client is in.
I live in New Zealand, and we are offset from GMT about 12 hours (depend
on seasonal adjustments). Have no problem getting query results using
my local time zone automatically. - regardless of whether I query from
the database box or another, using psql!
Cheers,
Gavin
*UTC or whatever it is currently fashionable to call it! :-)
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
^ permalink raw reply [nested|flat] 17+ messages in thread
* Re: SQL solution for my JDBC timezone issue
2015-02-23 13:40 SQL solution for my JDBC timezone issue George Woodring <george.woodring@iglass.net>
2015-02-23 14:16 ` Re: SQL solution for my JDBC timezone issue Dave Cramer <pg@fastcrypt.com>
2015-02-23 15:42 ` Re: SQL solution for my JDBC timezone issue George Woodring <george.woodring@iglass.net>
2015-02-23 15:49 ` Re: SQL solution for my JDBC timezone issue Tom Lane <tgl@sss.pgh.pa.us>
2015-02-23 20:15 ` Re: SQL solution for my JDBC timezone issue George Woodring <george.woodring@iglass.net>
2015-02-23 20:29 ` Re: SQL solution for my JDBC timezone issue Adrian Klaver <adrian.klaver@aklaver.com>
2015-02-24 14:25 ` Re: SQL solution for my JDBC timezone issue George Woodring <george.woodring@iglass.net>
2015-02-24 15:29 ` Re: SQL solution for my JDBC timezone issue Adrian Klaver <adrian.klaver@aklaver.com>
2015-02-24 19:36 ` Re: SQL solution for my JDBC timezone issue Gavin Flower <GavinFlower@archidevsys.co.nz>
@ 2015-02-24 19:58 ` Adrian Klaver <adrian.klaver@aklaver.com>
0 siblings, 0 replies; 17+ messages in thread
From: Adrian Klaver @ 2015-02-24 19:58 UTC (permalink / raw)
To: Gavin Flower <GavinFlower@archidevsys.co.nz>; George Woodring <george.woodring@iglass.net>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; Dave Cramer <pg@fastcrypt.com>; pgsql-general <pgsql-general@postgresql.org>
On 02/24/2015 11:36 AM, Gavin Flower wrote:
> On 25/02/15 04:29, Adrian Klaver wrote:
>> On 02/24/2015 06:25 AM, George Woodring wrote:
>>> -- In your original post you mentioned that access to the databases is
>>> through a Web server.
>>>
>>> -- Is there just one Web server with one time zone?
>>>
>>> We have 2 web servers that are clustered together. They are both set to
>>> Eastern since that is the timezone they are located in.
>>>
>>
>>
>> So:
>>
>> JDBC Web servers(US/East) <---> 90 database (5 different timezones)
>>
>> Therefore everything to the end user is passed through the Web servers?
>>
>> Is there a reason why the databases have different timezones?
>>
>> Seems to me less complicated to have all the databases share the UTC
>> timezone. Then you only have one offset, US/East <--> UTC.
>>
>>> iGLASS Networks
>>> www.iglass.net <http://www.iglass.net;
>>>
>>>
>>
>>
> Yes I think it sanest to have servers use GMT*, as then it is simple
> enough to convert results to whatever local time zone the client is in.
>
> I live in New Zealand, and we are offset from GMT about 12 hours (depend
> on seasonal adjustments). Have no problem getting query results using
> my local time zone automatically. - regardless of whether I query from
> the database box or another, using psql!
>
>
> Cheers,
> Gavin
>
>
> *UTC or whatever it is currently fashionable to call it! :-)
Depends on which side of the Channel you want to make happy:)
--
Adrian Klaver
adrian.klaver@aklaver.com
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
^ permalink raw reply [nested|flat] 17+ messages in thread
end of thread, other threads:[~2015-02-24 19:58 UTC | newest]
Thread overview: 17+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2015-02-23 13:40 SQL solution for my JDBC timezone issue George Woodring <george.woodring@iglass.net>
2015-02-23 14:16 ` Dave Cramer <pg@fastcrypt.com>
2015-02-23 15:42 ` George Woodring <george.woodring@iglass.net>
2015-02-23 15:45 ` Dave Cramer <pg@fastcrypt.com>
2015-02-23 15:49 ` Tom Lane <tgl@sss.pgh.pa.us>
2015-02-23 16:57 ` Dave Cramer <pg@fastcrypt.com>
2015-02-23 20:15 ` George Woodring <george.woodring@iglass.net>
2015-02-23 20:29 ` Adrian Klaver <adrian.klaver@aklaver.com>
2015-02-23 20:32 ` Dave Cramer <pg@fastcrypt.com>
2015-02-23 21:31 ` Tom Lane <tgl@sss.pgh.pa.us>
2015-02-23 21:33 ` Dave Cramer <pg@fastcrypt.com>
2015-02-24 14:25 ` George Woodring <george.woodring@iglass.net>
2015-02-24 14:30 ` Dave Cramer <pg@fastcrypt.com>
2015-02-24 15:29 ` Adrian Klaver <adrian.klaver@aklaver.com>
2015-02-24 15:36 ` George Woodring <george.woodring@iglass.net>
2015-02-24 19:36 ` Gavin Flower <GavinFlower@archidevsys.co.nz>
2015-02-24 19:58 ` Adrian Klaver <adrian.klaver@aklaver.com>
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