Re: [GENERAL] SQL solution for my JDBC timezone issue

2015-02-24 Thread Gavin Flower
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

Re: [GENERAL] SQL solution for my JDBC timezone issue

2015-02-24 Thread Adrian Klaver
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

Re: [GENERAL] SQL solution for my JDBC timezone issue

2015-02-24 Thread Adrian Klaver
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

Re: [GENERAL] SQL solution for my JDBC timezone issue

2015-02-24 Thread George Woodring
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

Re: [GENERAL] SQL solution for my JDBC timezone issue

2015-02-24 Thread Dave Cramer
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.woodr...@iglass.net wrote:

Re: [GENERAL] SQL solution for my JDBC timezone issue

2015-02-24 Thread George Woodring
-- 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

Re: [GENERAL] SQL solution for my JDBC timezone issue

2015-02-23 Thread Dave Cramer
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.woodr...@iglass.net wrote: Anyone have a suggestion for

[GENERAL] SQL solution for my JDBC timezone issue

2015-02-23 Thread George Woodring
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

Re: [GENERAL] SQL solution for my JDBC timezone issue

2015-02-23 Thread George Woodring
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

Re: [GENERAL] SQL solution for my JDBC timezone issue

2015-02-23 Thread Dave Cramer
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

Re: [GENERAL] SQL solution for my JDBC timezone issue

2015-02-23 Thread Tom Lane
George Woodring george.woodr...@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

Re: [GENERAL] SQL solution for my JDBC timezone issue

2015-02-23 Thread Dave Cramer
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 t...@sss.pgh.pa.us wrote:

Re: [GENERAL] SQL solution for my JDBC timezone issue

2015-02-23 Thread Dave Cramer
On 23 February 2015 at 16:31, Tom Lane t...@sss.pgh.pa.us wrote: Dave Cramer p...@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

Re: [GENERAL] SQL solution for my JDBC timezone issue

2015-02-23 Thread Tom Lane
Dave Cramer p...@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

Re: [GENERAL] SQL solution for my JDBC timezone issue

2015-02-23 Thread George Woodring
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

Re: [GENERAL] SQL solution for my JDBC timezone issue

2015-02-23 Thread Adrian Klaver
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

Re: [GENERAL] SQL solution for my JDBC timezone issue

2015-02-23 Thread Dave Cramer
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.kla...@aklaver.com wrote: On