--- dbmail-20020925-clean/pgsql/dbpgsql.c	2002-07-16 04:13:22.000000000 -0600
+++ dbmail-20020925/pgsql/dbpgsql.c	2002-10-30 16:16:48.000000000 -0700
@@ -1361,7 +1360,7 @@
       return -1;
     }
 
-  if (PQntuples>0)
+  if (PQntuples(res)>0)
     {
       row = PQgetvalue (res, 0, 0);
       id = row ? strtoull(row, NULL, 10) : 0;
