2

I am trying to migrate from mysql to postgres in codeigniter. I have updated my database.php file

$db['default']['hostname'] = 'pgsql:host=localhost;dbname=mydb';

$db['default']['username'] = 'postgres';

$db['default']['password'] = 'myPass23';

$db['default']['database'] = 'mydb';



$db['default']['dbdriver'] = 'pdo';

I am getting a blank page whenever db call is being made after the migration. No error/No logs are being shown. Do I need to make the changes anywhere else too. Any help will be highly appreciated.

3
  • you have missed $ in first line. Is it copy paste mistake?? Commented Nov 4, 2015 at 9:07
  • yes thats a copy paste mistake sorry, Commented Nov 4, 2015 at 10:42
  • have you enabled error reporting?? Commented Nov 4, 2015 at 10:46

1 Answer 1

1

Add these settings with postgres

$db['default']['hostname'] = 'localhost';
$db['default']['username'] = 'postgres'; # Mysql name
$db['default']['password'] = 'myPass23'; # Mysql password
$db['default']['database'] = 'mydb'; # databse name
$db['default']['dbdriver'] = 'postgre'; # chnage this

Some Useful link

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.