Welcome Guest, Not a member yet? Register   Sign In
problem connecting to postgres
#1

Hello!

I am trying connect to postgres, but doesn't work. In my database.php I have something like

$db['default']['hostname'] = '192.168.0.207';
$db['default']['username'] = 'postgres';
$db['default']['password'] = 'rontur';
$db['default']['database'] = 'stand';
$db['default']['dbdriver'] = 'postgre';
$db['default']['port'] = '5432';
$db['default']['dbprefix'] = '';
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
.........................................

Now, if I try connect using odbc, it works!,

$db['default']['hostname'] = 'DRIVER={PostgreSQL ANSI};SERVER=192.168.0.207;DATABASE=stand';
$db['default']['username'] = 'postgres';
$db['default']['password'] = 'rontur';
$db['default']['database'] = 'stand';
$db['default']['dbdriver'] = 'odbc';

any idea?

Best Regards
Fernando
Reply
#2

Do you get an error message?
Reply
#3

(11-18-2014, 04:00 PM)newphpprogrammer Wrote: Hello!

I am trying connect to postgres, but doesn't work. In my database.php I have something like

$db['default']['hostname'] = '192.168.0.207';
$db['default']['username'] = 'postgres';
$db['default']['password'] = 'rontur';
$db['default']['database'] = 'stand';
$db['default']['dbdriver'] = 'postgre';
$db['default']['port']     = '5432';
$db['default']['dbprefix'] = '';
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
.........................................

Now, if I try connect using odbc, it works!,

$db['default']['hostname'] = 'DRIVER={PostgreSQL ANSI};SERVER=192.168.0.207;DATABASE=stand';
$db['default']['username'] = 'postgres';
$db['default']['password'] = 'rontur';
$db['default']['database'] = 'stand';
$db['default']['dbdriver'] = 'odbc';

any idea?

Best Regards
Fernando

Which version of CI you are on?
Reply
#4

(11-18-2014, 04:00 PM)newphpprogrammer Wrote: Hello!

I am trying connect to postgres, but doesn't work. In my database.php I have something like

$db['default']['hostname'] = '192.168.0.207';
$db['default']['username'] = 'postgres';
$db['default']['password'] = 'rontur';
$db['default']['database'] = 'stand';
$db['default']['dbdriver'] = 'postgre';
$db['default']['port']     = '5432';
$db['default']['dbprefix'] = '';
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
.........................................

Now, if I try connect using odbc, it works!,

$db['default']['hostname'] = 'DRIVER={PostgreSQL ANSI};SERVER=192.168.0.207;DATABASE=stand';
$db['default']['username'] = 'postgres';
$db['default']['password'] = 'rontur';
$db['default']['database'] = 'stand';
$db['default']['dbdriver'] = 'odbc';

any idea?

Best Regards
Fernando

Probably you don't have Postgres in PHP (php.ini)?


Best regards

blagi
Reply
#5

Oh sorry, You had reason, I forgot change php.ini.
Now works!
Thanks a lots!
Reply




Theme © iAndrew 2016 - Forum software by © MyBB