Bug in session_write function
The pgsql_session_write function has a flaw -- it relies on pgsql_session_read to INSERT the database row.
While pgsql_session_read() is called before pgsql_session_write() 99.9% of the time, there's one case in which this doesn't happen -- when session_regenerate_id() is called. PEAR_Auth calls this function, rendering it incompatible with this package.
Fortunately, the fix is simple:
add a call to pgsql_session_read($key) to pgsql_session_write().