42.2.3 regression in fn timestampadd(SQL_TSI_MINUTE)

Adam Rauch <[email protected]>
Newsgroups gmane.comp.db.postgresql.jdbc
Message-ID <[email protected]>
Simple Java 8 test case below outputs different results when run against 
the 42.2.2 driver vs. the just released 42.2.3 driver:

PostgreSQL JDBC Driver 42.2.2
PostgreSQL 10.4 database "labkey2"
SQL_TSI_SECOND: 2003-01-01 00:00:03.0
SQL_TSI_MINUTE: 2003-01-01 00:03:00.0
SQL_TSI_HOUR: 2003-01-01 03:00:00.0

PostgreSQL JDBC Driver 42.2.3
PostgreSQL 10.4 database "labkey2"
SQL_TSI_SECOND: 2003-01-01 00:00:03.0
SQL_TSI_MINUTE: 2003-01-01 00:00:03.0
SQL_TSI_HOUR: 2003-01-01 03:00:00.0

SQL_TSI_MINUTE seems to be acting like SQL_TSI_SECOND in 42.2.3.

Thanks,
Adam

import java.sql.*;

public class PGTest
{
     public static void main(String[] args)throws SQLException
     {
         try (Connection conn = (3 == args.length ? DriverManager.getConnection(args[0], args[1], args[2]) : DriverManager.getConnection("jdbc:postgresql://" + args[0] +":" + args[1] +"/" + args[2], args[3], args[4])))
         {
             DatabaseMetaData dmd = conn.getMetaData();
             System.out.println(dmd.getDriverName() +" " + dmd.getDriverVersion());
             System.out.println(dmd.getDatabaseProductName() +" " + dmd.getDatabaseProductVersion() +" database \"" + conn.getCatalog() +"\"");

             testTimestampAdd("SQL_TSI_SECOND", conn);
             testTimestampAdd("SQL_TSI_MINUTE", conn);
             testTimestampAdd("SQL_TSI_HOUR", conn);

             System.out.flush();
             System.out.close();
         }
     }

     private static void testTimestampAdd(String interval, Connection conn)throws SQLException
     {
         String sql ="SELECT {fn timestampadd(" + interval +", 3, CAST('01 Jan 2003' AS TIMESTAMP))} AS ThreeMinutes";
         try (Statement st = conn.createStatement(); ResultSet rs = st.executeQuery(sql))
         {
             while (rs.next())
                 System.out.println(interval +": " + rs.getTimestamp(1));
         }
     }
}
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.