Status: New Owner: ---- Labels: Version Type-Bug Priority-Medium OpSys-Any Dist-Any Arch-Any Desktop-Any GUI-Any
New issue 168 by adamn...@gmail.com: gb.db.postgresql error in main.c http://code.google.com/p/gambas/issues/detail?id=168 1) Describe the problem. Sorry Benoit, I didn't notice this before. One of the tablenames is wrong in the field_info function queries. Result is that tables cannot be loaded in the database browser. In short atthasdef is in the pg_attribute table, not pg_attrdef. 2) GIVE THE FOLLOWING INFORMATIONS (if they are appropriate): Version: TRUNK Revision: r4333 Operating system: Linux Distribution: mine Architecture: x86 GUI component: na Desktop used: LXDE 3) Provide a little project that reproduces the bug or the crash. na 4) If your project needs a database, try to provide it, or part of it. na 5) Explain clearly how to reproduce the bug or the crash. Here's the diff for the 2 corrections Index: main.c =================================================================== --- main.c (revision 4333) +++ main.c (working copy) @@ -2007,7 +2007,7 @@ { const char *query = "select pg_attribute.attname, pg_attribute.atttypid::int, " - "pg_attribute.atttypmod, pg_attribute.attnotnull, pg_attrdef.adsrc, pg_attrdef.atthasdef " + "pg_attribute.atttypmod, pg_attribute.attnotnull, pg_attrdef.adsrc, pg_attribute.atthasdef " "from pg_class, pg_attribute " "left join pg_attrdef on (pg_attrdef.adrelid = pg_attribute.attrelid and pg_attrdef.adnum = pg_attribute.attnum) " "where pg_class.relname = '&1' " @@ -2018,7 +2018,7 @@ const char *query_schema = "select pg_attribute.attname, pg_attribute.atttypid::int, " - "pg_attribute.atttypmod, pg_attribute.attnotnull, pg_attrdef.adsrc, pg_attrdef.atthasdef " + "pg_attribute.atttypmod, pg_attribute.attnotnull, pg_attrdef.adsrc, pg_attribute.atthasdef " "from pg_class, pg_attribute " "left join pg_attrdef on (pg_attrdef.adrelid = pg_attribute.attrelid and pg_attrdef.adnum = pg_attribute.attnum) " "where pg_class.relname = '&1' " 6) By doing that carefully, you have done 50% of the bug fix job! IMPORTANT NOTE: if you encounter several different problems or bugs, (for example, a bug in your project, and an interpreter crash while debugging it), please create distinct issues! ------------------------------------------------------------------------------ Write once. Port to many. Get the SDK and tools to simplify cross-platform app development. Create new or port existing apps to sell to consumers worldwide. Explore the Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join http://p.sf.net/sfu/intel-appdev _______________________________________________ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user