![]() |
PostgreSQL function _list_columns - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: PostgreSQL function _list_columns (/showthread.php?tid=2865) |
PostgreSQL function _list_columns - El Forum - 08-28-2007 [eluser]sergitin[/eluser] i had a problem with this function i was programing a site using mysql and everything was OK but when i change to postgresql, scaffolding had a problem because function <b>_list_columns</b> in mysql list all the columns names in order to creation <b>SELECT columns FROM TABLE</> in postgresql <b>SELECT column_name FROM information_schema.columns WHERE tablename='TABLE'</b> this code return all the columns of TABLE, but first it list the number types columns and later the strings columns, i had a table with 2 columns oh each type i solve this adding <b>ORDER BY ordinal_position</b> at postgresql statement i'd like this count in CI 1.5.5 PostgreSQL function _list_columns - El Forum - 11-06-2008 [eluser]Unknown[/eluser] Hello, Thanks sergitin, I had the same problem with CI 1.7 and your solution solve it. It should be great to be added in CI. Curiously, I also have to add this line before the query : $table = ereg_replace('"',"",$table); PostgreSQL function _list_columns - El Forum - 12-03-2008 [eluser]Chris Bandy[/eluser] fanzila, The text replacement you required is to work around bug #5865 |