Here is a query result from Postgres:
$ psql ... -c 'select the_date from foo where foo_id in (998,999)'
the_date
------------------------
2012-03-07 09:34:47.98
2012-03-16 11:31:25.336
the_date is "timestamp without time zone".
Here is a Ruby program:
#!/usr/bin/env ruby
require 'sequel'
@DB = Sequel.connect({...})
query = "select the_date from foo where foo_id in (998,999)"
@DB[query].each do |row|
warn row
end
and some output:
{:the_date=>2012-03-07 09:34:47 -0600}
{:the_date=>2012-03-16 11:31:25 -0500}
Where does the -0500 and -0600 come from? That is the "Olson timezone" of the server and the client machines (US/Central), but why does Ruby add it and psql does not?
I've been reading the docs, and I'm thoroughly confused.
The server is Postgres 9.0.4, the client is psql 9.1.4, sequel is 3.33.0.