From dec7482c1b0391db285441dd9bda1c18b97fbcc8 Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Fri, 1 May 2009 16:48:38 +0000 Subject: [PATCH] Using Timestamp as a primary key? omg cray-z. --- src/java/com/samskivert/depot/impl/PostgreSQL4Builder.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/java/com/samskivert/depot/impl/PostgreSQL4Builder.java b/src/java/com/samskivert/depot/impl/PostgreSQL4Builder.java index 5250967..38b75cb 100644 --- a/src/java/com/samskivert/depot/impl/PostgreSQL4Builder.java +++ b/src/java/com/samskivert/depot/impl/PostgreSQL4Builder.java @@ -24,6 +24,7 @@ import java.sql.Array; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.SQLException; +import java.sql.Timestamp; import com.samskivert.depot.ByteEnum; import com.samskivert.depot.DatabaseException; @@ -67,7 +68,9 @@ public class PostgreSQL4Builder extends PostgreSQLBuilder bytes[ii] = ((ByteEnum) values[ii]).toByte(); } values = bytes; - type = "smallint"; // tinyint is in the spec, but PG doesn't recognize? + type = "smallint"; // tinyint is in the spec, but PG doesn't recognize? + } else if (testValue instanceof Timestamp) { + type = "timestamp"; } else { throw new DatabaseException( "Don't know how to make Postgres array for " + testValue.getClass());