Closed (fixed)
Project:
Table Wizard
Version:
6.x-1.0
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Reporter:
Created:
2 Jun 2009 at 12:04 UTC
Updated:
30 Jun 2009 at 14:20 UTC
I used table wizard with Mysql and its work perfectly but with postgresql hit me the face with this errors:
* warning: pg_query() [function.pg-query]: Query failed: ERROR: error de sintaxis en o cerca de «cnt» LINE 1: SELECT tt.twtid,tt.tablename,tt.dbconnection,COUNT(*) cnt ^ in /var/www/xxxxxx/includes/database.pgsql.inc on line 139.
* user warning: query: SELECT tt.twtid,tt.tablename,tt.dbconnection,COUNT(*) cnt FROM tw_tables tt INNER JOIN tw_columns tc ON tt.twtid=tc.twtid WHERE tc.primarykey=1 GROUP BY tt.twtid,tt.tablename,tt.dbconnection in /var/www/xxxxxx/sites/all/modules/tw/tw.views_default.inc on line 23.
Someone knows why? Please help me.
Comments
Comment #1
mikeryanCan someone more familiar with Postrgres than I am identify what's wrong with the query
SELECT tt.twtid,tt.tablename,tt.dbconnection,COUNT(*) cnt
FROM tw_tables tt
INNER JOIN tw_columns tc ON tt.twtid=tc.twtid
WHERE tc.primarykey=1
GROUP BY tt.twtid,tt.tablename,tt.dbconnection
Is the COUNT() syntax different in Postgres?
Comment #2
yoandry commentedCould be for postgres:
SELECT tt.twtid,tt.tablename,tt.dbconnection,COUNT(*) AS cnt........
Comment #3
yoandry commentedEureka!!
But now when i try to add tables:
* warning: pg_query() [function.pg-query]: Query failed: ERROR: parámetro de configuración no reconocido: «tables» in /var/www/xxxxx/includes/database.pgsql.inc on line 139.
* user warning: query: SHOW TABLES in /var/www/soporte/sites/all/modules/tw/tw_pages.inc on line 230.
Comment #4
mikeryanOK, I've added explicit AS keywords to queries, and replaced SHOW TABLES with SELECT tablename FROM pg_tables for pgsql. Please try the latest dev version and let me know of any other issues with Postgre.
Thanks.
Comment #5
yoandry commentedNow i can add the tables and aparently work good but throw this errors and warnings:
* warning: pg_query() [function.pg-query]: Query failed: ERROR: error de sintaxis en o cerca de «tbl1» LINE 1: SELECT twt1.tablename tbl1, twc1.colname col1, twt2.tablenam... ^ in /var/www/xxxxx/includes/database.pgsql.inc on line 139.
* user warning: query: SELECT twt1.tablename tbl1, twc1.colname col1, twt2.tablename tbl2, twc2.colname col2 FROM tw_relationships twr INNER JOIN tw_columns twc1 ON twr.leftcol=twc1.twcid INNER JOIN tw_tables twt1 ON twc1.twtid=twt1.twtid INNER JOIN tw_columns twc2 ON twr.rightcol=twc2.twcid INNER JOIN tw_tables twt2 ON twc2.twtid=twt2.twtid ORDER BY tbl1, col1, tbl2, col2 in /var/www/xxxxx/sites/all/modules/tw/tw_tablebuild.inc on line 132.
The same errors and warnings when i try to edit the views associated with the table added.
Thanks for your help and support.
Comment #6
mikeryanOK, some more AS-less SELECTs were introduced, those should be fixed now. Please try the latest CVS.
Thanks.
Comment #7
mikeryanComment #8
yoandry commentedOK now works perfectly, thanks and congratulations. Good work.
Comment #9
mikeryanGreat, thanks! I'm marking this as fixed - if any new Postgres issues come up, please open a new issue.