question: protected boolean tableExists ( Table t ) throws SQLException { String sql = "SELECT * FROM pg_tables WHERE " + ( t . isTemporary ( ) ? "" : ( "schemaname='" + t . getSchema ( ) + "' AND " ) ) + "tablename='" + ( t . isTemporary ( ) ? ( t . getSchema ( ) + "_" ) : "" ) + t . getName ( ) + "'" ; Statement stmt = dbConn . createStatement ( ) ; try { ResultSet rs = stmt . executeQuery ( sql ) ; return rs . next ( ) ; } finally { if ( stmt != null ) { try { stmt . close ( ) ; } catch ( SQLException e ) { } } } }
target:  Checks whether the given table exists in the currently connected database. Check is made against "pg_tables".