Posted by yoandry on June 2, 2009 at 12:04pm
Jump to:
| Project: | Table Wizard |
| Version: | 6.x-1.0 |
| Component: | Code |
| Category: | bug report |
| Priority: | critical |
| Assigned: | mikeryan |
| Status: | closed (fixed) |
Issue Summary
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
#1
Can 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?
#2
Could be for postgres:
SELECT tt.twtid,tt.tablename,tt.dbconnection,COUNT(*) AS cnt........
#3
Eureka!!
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.
#4
OK, 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.
#5
Now 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.
#6
OK, some more AS-less SELECTs were introduced, those should be fixed now. Please try the latest CVS.
Thanks.
#7
#8
OK now works perfectly, thanks and congratulations. Good work.
#9
Great, thanks! I'm marking this as fixed - if any new Postgres issues come up, please open a new issue.
#10
Automatically closed -- issue fixed for 2 weeks with no activity.