- if cols = [] then [] else begin
- let q = "select " ^ pg_cols ^ " from " ^ table ^ pg_where ^
- " order by " ^ List.hd cols ^ " asc" in
- prerr_endline q;
- P.exec q end
-
+ if cols = [] then
+ let r = exec ("select count (source) from " ^ table ^ pg_where) in
+ match r with
+ | [[s]] when int_of_string s > 0 -> [[]]
+ | _ -> []
+ else
+ exec ("select " ^ pg_cols ^ " from " ^ table ^ pg_where ^
+ " order by " ^ List.hd cols ^ " asc")
+
+(* Galax backend ***********************************************************)
+
+let gx_query h table cols ct cfl = not_supported "Galax"
+
+(* Common functions ********************************************************)
+