Re: BUG #1611: reading a date-field by "ResultSet.getTimestamp()" method analized dayligth flag

From: Ingolf Knopf <iknopf(at)csc-dd(dot)de>
To: Oliver Jowett <oliver(at)opencloud(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #1611: reading a date-field by "ResultSet.getTimestamp()" method analized dayligth flag
Date: 2005-04-22 08:33:48
Message-ID: 200504221033.48642.iknopf@csc-dd.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Am Donnerstag, 21. April 2005 23:49 schrieben Sie:
> Ingolf Knopf wrote:
> > The following bug has been logged online:
> >
> > Bug reference: 1611
> > Logged by: Ingolf Knopf
> > Email address: iknopf(at)csc-dd(dot)de
> > PostgreSQL version: 8.0.1
> > Operating system: JDBC
> > Description: reading a date-field by "ResultSet.getTimestamp()"
> > method analized dayligth flag
> > Details:
> >
> > Retrieving data by "java.sql.ResultSet" I read a data from a column which
> > has type DATE. I read content of this column by method
> > "ResultSet.getTimestamp( int )".
> > I get a "java.sql.Timestamp"-object, where Calendar.HOUR_OF_DAY==1. I
> > suppose, this is daylight flag.
> >
> > Maybe this behavior of your JDBC driver is compatible with SQL standard,
> > but it is completely other than the behavior of "Oracle" or "Ingres".
>
> Can you provide a compilable test case please?
>
> What is the behaviour of Oracle/Ingres with the same test case?
>
> -O

See attached file. The problem you can find in method 'run( void )'. Output
of my program is:

DBMS==PostgreSQL: problem!
dCal==java.util.GregorianCalendar[time=1114120800000,areFieldsSet=true,areAllFieldsSet=true,lenient=true,zone=sun.util.calendar.ZoneInfo[id="Europe/Berlin",offset=3600000,dstSavings=3600000,useDaylight=true,transitions=143,lastRule=java.util.SimpleTimeZone[id=Europe/Berlin,offset=3600000,dstSavings=3600000,useDaylight=true,startYear=0,startMode=2,startMonth=2,startDay=-1,startDayOfWeek=1,startTime=3600000,startTimeMode=2,endMode=2,endMonth=9,endDay=-1,endDayOfWeek=1,endTime=3600000,endTimeMode=2]],firstDayOfWeek=2,minimalDaysInFirstWeek=4,ERA=1,YEAR=2005,MONTH=3,WEEK_OF_YEAR=16,WEEK_OF_MONTH=3,DAY_OF_MONTH=22,DAY_OF_YEAR=112,DAY_OF_WEEK=6,DAY_OF_WEEK_IN_MONTH=4,AM_PM=0,HOUR=0,HOUR_OF_DAY=0,MINUTE=0,SECOND=0,MILLISECOND=0,ZONE_OFFSET=3600000,DST_OFFSET=3600000]
tCal==java.util.GregorianCalendar[time=1114124400000,areFieldsSet=true,areAllFieldsSet=true,lenient=true,zone=sun.util.calendar.ZoneInfo[id="Europe/Berlin",offset=3600000,dstSavings=3600000,useDaylight=true,transitions=143,lastRule=java.util.SimpleTimeZone[id=Europe/Berlin,offset=3600000,dstSavings=3600000,useDaylight=true,startYear=0,startMode=2,startMonth=2,startDay=-1,startDayOfWeek=1,startTime=3600000,startTimeMode=2,endMode=2,endMonth=9,endDay=-1,endDayOfWeek=1,endTime=3600000,endTimeMode=2]],firstDayOfWeek=2,minimalDaysInFirstWeek=4,ERA=1,YEAR=2005,MONTH=3,WEEK_OF_YEAR=16,WEEK_OF_MONTH=3,DAY_OF_MONTH=22,DAY_OF_YEAR=112,DAY_OF_WEEK=6,DAY_OF_WEEK_IN_MONTH=4,AM_PM=0,HOUR=1,HOUR_OF_DAY=1,MINUTE=0,SECOND=0,MILLISECOND=0,ZONE_OFFSET=3600000,DST_OFFSET=3600000]
DBMS==Oracle: no problem!
dCal==java.util.GregorianCalendar[time=1114120800000,areFieldsSet=true,areAllFieldsSet=true,lenient=true,zone=sun.util.calendar.ZoneInfo[id="Europe/Berlin",offset=3600000,dstSavings=3600000,useDaylight=true,transitions=143,lastRule=java.util.SimpleTimeZone[id=Europe/Berlin,offset=3600000,dstSavings=3600000,useDaylight=true,startYear=0,startMode=2,startMonth=2,startDay=-1,startDayOfWeek=1,startTime=3600000,startTimeMode=2,endMode=2,endMonth=9,endDay=-1,endDayOfWeek=1,endTime=3600000,endTimeMode=2]],firstDayOfWeek=2,minimalDaysInFirstWeek=4,ERA=1,YEAR=2005,MONTH=3,WEEK_OF_YEAR=16,WEEK_OF_MONTH=3,DAY_OF_MONTH=22,DAY_OF_YEAR=112,DAY_OF_WEEK=6,DAY_OF_WEEK_IN_MONTH=4,AM_PM=0,HOUR=0,HOUR_OF_DAY=0,MINUTE=0,SECOND=0,MILLISECOND=0,ZONE_OFFSET=3600000,DST_OFFSET=3600000]
DBMS==Ingres: no problem!
dCal==java.util.GregorianCalendar[time=1114120800000,areFieldsSet=true,areAllFieldsSet=true,lenient=true,zone=sun.util.calendar.ZoneInfo[id="Europe/Berlin",offset=3600000,dstSavings=3600000,useDaylight=true,transitions=143,lastRule=java.util.SimpleTimeZone[id=Europe/Berlin,offset=3600000,dstSavings=3600000,useDaylight=true,startYear=0,startMode=2,startMonth=2,startDay=-1,startDayOfWeek=1,startTime=3600000,startTimeMode=2,endMode=2,endMonth=9,endDay=-1,endDayOfWeek=1,endTime=3600000,endTimeMode=2]],firstDayOfWeek=2,minimalDaysInFirstWeek=4,ERA=1,YEAR=2005,MONTH=3,WEEK_OF_YEAR=16,WEEK_OF_MONTH=3,DAY_OF_MONTH=22,DAY_OF_YEAR=112,DAY_OF_WEEK=6,DAY_OF_WEEK_IN_MONTH=4,AM_PM=0,HOUR=0,HOUR_OF_DAY=0,MINUTE=0,SECOND=0,MILLISECOND=0,ZONE_OFFSET=3600000,DST_OFFSET=3600000]

Attachment Content-Type Size
RsetDemo.java text/x-java 4.4 KB

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Sebastien Montagne 2005-04-22 09:00:02 pg_dump: schema with OID 17262722 does not exist
Previous Message Richard Huxton 2005-04-22 08:03:17 Rules and Permissions docs change (was Re: BUG #1610: rewrite rule and sequence)