ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

PostgreSQL and list_fields

July 27, 2009 1:59pm

Subscribe [3]
  • #1 / Jul 27, 2009 1:59pm

    wabu

    96 posts

    CI 1.7.1, PostgreSQL 8.3

    Hello, I’m experiencing a problem with list_fields() and the Postgres driver which I think is identified in this bug report from February:

    http://codeigniter.com/bug_tracker/bug/6665/

    The sequence is:

    drivers/DB_driver.php - list_fields()
    drivers/postgre/postgre_driver.php - _list_columns()
    drivers/DB_driver.php - _protect_identifiers()
    drivers/postgre/postgre_driver.php - _escape_identifiers()

    and the resulting query is:

    SELECT column_name FROM information_schema.columns WHERE table_name =‘“peeps”’

    The double-quoting results in an empty result set, unlike the following which returns the table’s columns as intended:

    SELECT column_name FROM information_schema.columns WHERE table_name =‘peeps’

    I believe I can work around this a few different ways, but I’m also curious about any fix forthcoming for the problem.

    Also are folks here using Postgres with CI successfully in production apps? This is the first issue I’ve encountered but I want to be sure I’m not going against the grain too much with my choice of DBMS. Are there other issues with Postgres I should be aware of (as ultimately my app needs to work with MySQL, PostgreSQL, and others)?

    Thanks!

  • #2 / Jul 28, 2009 5:18am

    MaWoBi

    2 posts

    Hi.

    We’re using PostgreSQL and CI in a productive environment. There is no problem in our application so fare except the one descriped in the bug report. The problem occurred in version 1.7.x of CI. In version 1.6.x everything worked fine. The reason is the protected indentifier stuff.

    Sad, there is no reaction from the CI guys… ;o)

    Our work around:

    In system/database/drivers/postgre_driver.php change Line 35 into

    var $_escape_char = '';

    This works in our case.

    Greetings
    MW

  • #3 / Jul 28, 2009 9:00am

    wabu

    96 posts

    Thanks MW—I made the change yesterday and it’s been working without any adverse effects so far (though I suppose I should write some additional tests focused specifically on this issue).

    I hope this or a similar fix will find its way into the framework.

  • #4 / Jan 27, 2011 10:33am

    thanks, MaWoBi!

    this works for me 😉

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases