[Pgpool-general] Support for "group by 1" syntax

David Andersen david at andersen.gs
Fri Dec 28 14:17:54 UTC 2007


Hi,

I am attempting to use pgpool-II with the magnificent data mining tool,
Tableau, from Tableau Software <http://www.tableausoftware.com>.

The next problem is that Tableau issues SQL queries using syntax like the
following:
select id from t group by 1;

It is valid SQL to say group by 1, which means group by the first selected
column.

The problem is however, that pgpool-ii seems not to support this as seen in
this example:
bench_parallel=# select id from egg4 group by 1;
ERROR:  syntax error at or near ")" at character 180
bench_parallel=# select id from egg4 group by id;
 id
----
 11
 14
  2
  1
(4 rows)

Postgres, however, accepts this syntax.

The following line in the pgpool log file shows why the first query fails:
2007-12-28 09:06:27 DEBUG: pid 4289: OneNode_do_command: Query:  SELECT
pool_t$0.pool_c$0 AS id FROM dblink('host=domU-12-31-38-00-2C-42
dbname=bench_parallel port=9999 user=postgres','SELECT
pool_parallel("SELECT  FROM egg4")') AS pool_t$0g ()  GROUP BY 1

Compared to the following line for the second query:
2007-12-28 09:06:31 DEBUG: pid 4289: OneNode_do_command: Query:  SELECT
pool_g$0 AS id FROM dblink('host=domU-12-31-38-00-2C-42
dbname=bench_parallel port=9999 user=postgres','SELECT pool_parallel("SELECT
id FROM egg4 GROUP BY id")') AS pool_t$0g (pool_g$0 integer)  GROUP BY
pool_g$0


Would it be possible to support this syntax in pgpool?

Regards,

David




For reference my initial problem was that Tableau issues the following query
for testing the database:
SELECT *
INTO TEMPORARY TABLE "#Tableau_1_Connect"
FROM (SELECT 1 AS COL) AS CHECKTEMP
LIMIT 1

This query includes the select into ... syntax which is unsupported by
pgpool-ii. For others running into the same problem, I solved this by
turning off parallelization in pgpool.conf, connecting with Tableau and
reloading pgpool with the parallization turned on again.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://pgfoundry.org/pipermail/pgpool-general/attachments/20071228/ee1efb3d/attachment.html 


More information about the Pgpool-general mailing list