The whole point of timestamp with time zone
(as opposed to its counterpart timestamp without time zone
) is that the value is dynamically rotated depending on the timezone of the client running the query.
Since you insist that you're connected to the same database, as if it would imply that both clients should retrieve the same value, maybe you don't understand that it's normal that they retrieve different values.
To illustrate, here's a reproducible example with your values:
create table ttz(t timestamptz);
insert into ttz values('9999-12-30 18:30:00+00');
- When my timezone is the default 'localtime' which is in fact 'Europe/Paris', which at this future date if our world still exists, is supposed to be one hour ahead of UTC, here's what I get:
=> select * from ttz;
t
------------------------
9999-12-30 19:30:00+01
- Now let's switch to a timezone in India:
=> set timezone to 'Asia/Calcutta';
=> select * from ttz;
t
---------------------------
9999-12-31 00:00:00+05:30
So if I pretend to be in India, it outputs the same value than your session in India. This is the expected result.
- About the result in the US
US has several time zones so you should first check which one is used by your server.
The strange thing is that in order to get your result of 9999-12-30 00:00:00
from the UTC 9999-12-30 18:30
, you'd need to have an offset of +18:30 that doesn't exist in practice although it would coincide with India if going west instead of east from UTC.
=> set timezone to 'UTC+18:30';
=> select * from ttz ;
t
---------------------------
9999-12-30 00:00:00-18:30
(1 row)
Thus it can be suspected that your client session in US just has a badly configured timezone.
See also PostgreSQL 9.1 timezones for the problem of conflicting sign conventions when using offsets from UTC.