CodeIgniter Forums
not connecting to PostgreSQL db ?! - 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: not connecting to PostgreSQL db ?! (/showthread.php?tid=14884)



not connecting to PostgreSQL db ?! - El Forum - 01-19-2009

[eluser]yesov[/eluser]
Hi!

my problem:
after change connection settings in config/database.php to correct for my posgresql database(and enter port too), i see white page ?!
no errors, no warnings, only white page!

what's wrong ?!

p.s. : connection data(login, pass etc) correct, because i use this data to connect with pgadmin


not connecting to PostgreSQL db ?! - El Forum - 01-20-2009

[eluser]kea13[/eluser]
Hi yesov,

is the machine running pgadmin the same that you are using with CodeIgniter?
If not you should look after PostgreSQL's access permissions in pg_hba.conf

Cheers,
Roman


not connecting to PostgreSQL db ?! - El Forum - 01-20-2009

[eluser]yesov[/eluser]
ok, in this time everything work, and ...
pgadmin excelent work with this posgresql db, but codeigniter and my custom class don't work, and don't print any errors, i see only white page.

but after "real" hosting codeigniter work excelent.


sorry all, for my bad english Wink


not connecting to PostgreSQL db ?! - El Forum - 01-20-2009

[eluser]kea13[/eluser]
Hi yesov,

sorry, but I'm having a hard time understanding you. Nonetheless, let's (for the moment) safely assume that your access control is configured correctly - do you use Active Record or hand-crafted SQL statements to query the database?
In the latter case, inserting a log_message() of the SQL query might turn up the culprit.
If the code is the same on your development machine as on the hosters server, I'd like to re-iterate my hint towards pg_hba.conf

Cheers,
Roman


not connecting to PostgreSQL db ?! - El Forum - 01-21-2009

[eluser]yesov[/eluser]
hello kea13,
i use Active Record, and it works without any errors, but in this time i use simple query such as simple select and insert.

next ... i don't edit pg_hba.conf because i don't permissions for this, and after i copy ci from my local machine to server i see that all works.


not connecting to PostgreSQL db ?! - El Forum - 01-21-2009

[eluser]kea13[/eluser]
Hi yesov,

ok, let's gather the facts:
- on your development machine you usually do your queries through Active Record which works as intended ™
So this obviously rules out access problems on PostgreSQL's side (at least concerning pg_hba.conf)
- this time you're using hand-crafted SQL statements and your applications burns and implodes
This leaves me with two candidates: the first being a malformed SQL-query (maybe a typo somewhere? PostgreSQL is for example pretty picky when it comes to numbers not being enclosed in ticks) or a permission problem on the table or schema itself.

The thing that I still don't get is the issue with the hosters server ... do you imply that the application that crashes on your development machine just plain works as soon as it is stored on the hosters server?

Cheers,
Roman


not connecting to PostgreSQL db ?! - El Forum - 01-23-2009

[eluser]lukeinjax[/eluser]
Make sure you are loading the driver for postgres in your php.ini file. This is likely the culprit and would explain why the code works on one machine but not the other.


not connecting to PostgreSQL db ?! - El Forum - 01-23-2009

[eluser]kea13[/eluser]
yes, that sure would explain it ... but yesov said - if i understood him right - that active record queries work, whereas handcrafted sql doesn't. And that led me to the assumption that he does have PostgreSQL support activated in his php install

Cheers,
Roman


not connecting to PostgreSQL db ?! - El Forum - 01-26-2009

[eluser]yesov[/eluser]
hello,
in my case, problem was: PostgreSQL connection permission for local machine
because and posgresql extension for php was install and connection for other posgre server was succes.

p.s. kea13 write, active record queries(simple) work ))