Database operation "0or1row" failed (exception NSDB, "Query was not a statement returning rows.")
         while executing
     "ns_pg_bind 0or1row nsdb0 {
         select case when count(*) = 0 then 0 else 1 end from apm_package_db_types}"
Well, this is weird.  Are you sure you have the latest driver?
On the surface, the message is particulary weird because of course it returned no rows - and it is a 0or1row query so shouldn't fail!
Any more information you can provide, the better.  I hate to say this, but my first response when this kind of thing happens on my machine is to seek a virgin environment, even if it means deleting a lot of stuff...