I'm using C++ and libpq (PostgreSQL C library) with gcc and PostgreSQL 8.2.19 on Linux. I'm using a column of type "timestamp with time zone". libpq returns query results as C-strings. Sometimes (NOT always) i found the string returned shifted one hour forward (but with the same timezone as others: +02 that is CEST). I verified the problem is directly in the string returned by query (a normal SELECT with the name of the column containing "timestamp with time zone" type) and not subsquent conversions and most execution runs exactly. Is this a sort of (known) bug of Linux and/or PostgreSQL?
EDIT: One time the error occured in following conversions so I tried this code on my platform (obviously including libraries) http://codepad.org/HiBbjX0V Actually, even this is not coherent but the error is the opposite: most time time is shifted forward of one hour and only in the second output the hour is still 11:33:52 like in code. I tried Ubuntu with manual hour setting and hour from Internet. There is the error in both cases. I think the error is at system level but I don't what is.
EDIT: I'm not sure anymore the error is from PostgreSQL too because the row with timestamp is updated twice in quick succession and perhaps erorr is due to first update with hour converted to Linux type as I showed in code.