Delete temporary variable. Add test for return Boolean Value. Changed
queries for pgsql support