Welcome Guest, Not a member yet? Register   Sign In
PostgreSQL and list_fields
#1

[eluser]wabu[/eluser]
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

[eluser]MaWoBi[/eluser]
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

Code:
var $_escape_char = '';

This works in our case.

Greetings
MW
#3

[eluser]wabu[/eluser]
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

[eluser]Lucas Vasconcelos[/eluser]
thanks, MaWoBi!

this works for me Wink




Theme © iAndrew 2016 - Forum software by © MyBB