Hi, Thanks a lot for the patch! It is now committed and will be included in the next release. I have also added a simple test case and a change log entry, see http://code.google.com/p/h2database/source/list for details.
Regards, Thomas On Fri, Oct 5, 2012 at 10:47 AM, Prashant Bhat <[email protected]>wrote: > Hi, > > We are using H2 Database in our application, but based on requirement of > some users PostgreSQL is used. And we use JPA to be compatible with both > the databases, but some of the reports use native sql queries. One of the > queries that uses EXTRACT(WEEK FROM dateColumn) is not compatible with H2, > as it supports WK and WW which are not supported in Postgresql. > > We've made the following change to Function.java to add this option and > the attached patch also updates help.csv files. I hope this can be > integrated into H2 codebase. > > Thanks & Best Regards, > Prashant > > > Index: src/main/org/h2/expression/Function.java > =================================================================== > --- src/main/org/h2/expression/Function.java (revision 4381) > +++ src/main/org/h2/expression/Function.java (working copy) > @@ -129,6 +129,7 @@ > DATE_PART.put("SQL_TSI_WEEK", Calendar.WEEK_OF_YEAR); > DATE_PART.put("WW", Calendar.WEEK_OF_YEAR); > DATE_PART.put("WK", Calendar.WEEK_OF_YEAR); > + DATE_PART.put("WEEK", Calendar.WEEK_OF_YEAR); > DATE_PART.put("DAY", Calendar.DAY_OF_MONTH); > DATE_PART.put("DD", Calendar.DAY_OF_MONTH); > DATE_PART.put("D", Calendar.DAY_OF_MONTH); > > -- > You received this message because you are subscribed to the Google Groups > "H2 Database" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/h2-database/-/ryzFLKw46TQJ. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/h2-database?hl=en. > -- You received this message because you are subscribed to the Google Groups "H2 Database" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/h2-database?hl=en.
