This patch is not necessary any more. It turned out that my PostgreSQL
driver was stale (not by more than a few weeks, though!)
-- Bill
----- Original Message -----
From: "John McNally" <[EMAIL PROTECTED]>
To: "Turbine Torque Developers List" <[EMAIL PROTECTED]>
Sent: Monday, May 20, 2002 2:30 PM
Subject: Re: Fw: [PATCH] Postgresql date constraints
> So was it decided that postgresql does support ts escapes? Or is this
> patch still necessary?
>
> john mcnally
>
> On Tue, 2002-04-09 at 13:01, Bill Schneider wrote:
> > This is a patch I submitted a while ago to fix date constraints in
> > PostgreSQL and I'm resubmitting it, now with thread-safe use of
> > DateFormatters. This is necessary because PostgreSQL's driver doesn't
> > support JDBC {ts ...} escapes.
> >
> > -- Bill
> >
> > Index: src/java/org/apache/torque/adapter/DBPostgres.java
> > ===================================================================
> > RCS file:
> >
/home/cvspublic/jakarta-turbine-torque/src/java/org/apache/torque/adapter/DB
> > Postgres.java,v
> > retrieving revision 1.6
> > diff -u -r1.6 DBPostgres.java
> > --- src/java/org/apache/torque/adapter/DBPostgres.java 15 Mar 2002
> > 21:47:45 -0000 1.6
> > +++ src/java/org/apache/torque/adapter/DBPostgres.java 9 Apr 2002
> > 19:41:38 -0000
> > @@ -56,6 +56,8 @@
> >
> > import java.sql.Connection;
> > import java.sql.SQLException;
> > +import java.util.Date;
> > +import java.text.SimpleDateFormat;
> >
> > /**
> > * This is used to connect to PostgresQL databases.
> > @@ -68,6 +70,9 @@
> > public class DBPostgres
> > extends DB
> > {
> > + private static final String DATE_FORMAT_STRING =
> > + "yyyy-MM-dd HH:mm:ss";
> > +
> > /**
> > * Empty constructor.
> > */
> > @@ -192,5 +197,21 @@
> > public int getLimitStyle()
> > {
> > return DB.LIMIT_STYLE_POSTGRES;
> > + }
> > +
> > + /**
> > + * This method is used to format any date string.
> > + * Database can use different default date formats.
> > + *
> > + * @return The proper date formatted String.
> > + */
> > + public String getDateString(Date date)
> > + {
> > + return "TO_TIMESTAMP('" + formatDate(date) +
> > + "', 'yyyy-mm-dd hh24:mi:ss' )";
> > + }
> > +
> > + private String formatDate(Date date) {
> > + return new SimpleDateFormat(DATE_FORMAT_STRING).format(date);
> > }
> > }
> >
> >
> >
> > --
> > To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
> >
>
>
>
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>