Fix bugs for apache_postgre