I found OpenJump a real nice tool with its ability to render results of ad hoc SQL queries like PostGIS ones (among other things).
However, I also found that not everything that runs in (say) pgAdmin can be executed in OpenJump (
File > Run Datastore Query). For example:
If I run a query that does not return result,
CREATE TABLE t AS SELECT * FROM tbl;
I get an error (as of Version 1.10 release rev.5336) about
No results were returned by the query. Invalid query .... (Yet if I run the above again, it says
Error: relation t already exists. Seems that the query is executed anyways.) Similarly problem happens with
CREATE FUNCTION etc. The error happens even if there is a second query that does return a relation.
If I run the same query twice,
SELECT * FROM tbl; SELECT * FROM tbl;
I get an Error
Multiple ResultSets were returned by the query. Invalid query....
From trial and error, it seems that the only things found to work so far is a single
SELECT statement or equivalent (CTE etc.).
I am wondering if there is any documentation on this. In particular,
What kind of queries are valid?
How many queries can be performed in one run of data store query?
(Wouldn't it be nice if OpenJump just returns the result of the last query?)