diff --git a/org/postgresql/jdbc3/AbstractJdbc3Connection.java b/org/postgresql/jdbc3/AbstractJdbc3Connection.java
index <HASH>..<HASH> 100644
--- a/org/postgresql/jdbc3/AbstractJdbc3Connection.java
+++ b/org/postgresql/jdbc3/AbstractJdbc3Connection.java
@@ -3,7 +3,7 @@
 * Copyright (c) 2004-2008, PostgreSQL Global Development Group
 *
 * IDENTIFICATION
-*   $PostgreSQL: pgjdbc/org/postgresql/jdbc3/AbstractJdbc3Connection.java,v 1.18 2008/01/08 06:56:29 jurka Exp $
+*   $PostgreSQL: pgjdbc/org/postgresql/jdbc3/AbstractJdbc3Connection.java,v 1.19 2009/01/28 09:50:21 jurka Exp $
 *
 *-------------------------------------------------------------------------
 */
@@ -402,7 +402,7 @@ public abstract class AbstractJdbc3Connection extends org.postgresql.jdbc2.Abstr
     public PreparedStatement prepareStatement(String sql, int columnIndexes[])
     throws SQLException
     {
-        if (columnIndexes == null && columnIndexes.length == 0)
+        if (columnIndexes == null || columnIndexes.length == 0)
             return prepareStatement(sql);
         
         throw new PSQLException(GT.tr("Returning autogenerated keys is not supported."), PSQLState.NOT_IMPLEMENTED);
Fix a logic error when determining when we can support generated
keys.

Jesper Pedersen