table wizard and postgre

yoandry - June 2, 2009 - 12:04
Project:Table Wizard
Version:6.x-1.0
Component:Code
Category:bug report
Priority:critical
Assigned:mikeryan
Status:closed
Description

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.

#1

mikeryan - June 2, 2009 - 12:57
Component:Miscellaneous» Code

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

yoandry - June 3, 2009 - 12:27

Could be for postgres:

SELECT tt.twtid,tt.tablename,tt.dbconnection,COUNT(*) AS cnt........

#3

yoandry - June 3, 2009 - 12:39

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

mikeryan - June 6, 2009 - 17:15
Assigned to:Anonymous» mikeryan
Status:active» needs review

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

yoandry - June 8, 2009 - 13:00

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

mikeryan - June 13, 2009 - 15:58

OK, some more AS-less SELECTs were introduced, those should be fixed now. Please try the latest CVS.

Thanks.

#7

mikeryan - June 13, 2009 - 16:26
Priority:normal» critical

#8

yoandry - June 16, 2009 - 14:06

OK now works perfectly, thanks and congratulations. Good work.

#9

mikeryan - June 16, 2009 - 14:12
Status:needs review» fixed

Great, thanks! I'm marking this as fixed - if any new Postgres issues come up, please open a new issue.

#10

System Message - June 30, 2009 - 14:20
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.