Use postgres DB for package


I want to connect a package which is able to add and list some events (meaning dates) to a postgres database.
My setup:
I have a MAMPstack from bitnami extended by the postgres-module. I installed the newest ( concrete5 version and everything is fine. I can use the package with MySQL without any issues, but I want to save the data from this package on postgres.
So here is what I have within the
return array(
    'default-connection' => 'concrete',
    'drivers' => array(
        'pdo_pgsql' => 'Doctrine\DBAL\Driver\PDOPgSql\Driver'
    'connections' => array(
        'concrete' => array(
            'driver' => 'c5_pdo_mysql',
            'server' => 'localhost',
            'database' => 'concrete5',
            'username' => 'username',
            'password' => 'password',
            'charset' => 'utf8',

But now I don't know where to add the stuff with the connection. I already red the article about "Advanced: Using dependency injection" here:
But still have no idea.
My package controller looks like this:
namespace Concrete\Package\CookbookEvents;
use Concrete\Core\Database\Connection\Connection;
use Package;
use BlockType;
use SinglePage;
defined('C5_EXECUTE') or die(_("Access Denied."));
class Controller extends Package
    protected $pkgHandle = 'cookbook_events';
    protected $appVersionRequired = '';
    protected $pkgVersion = '1.0.0';
    protected $connection;
    public function __construct()

And I tried to add a constructor with the connection stuff mentioned in the article above, but everytime I install the package the table is created within the mysql database and not within postgres.

Same problem if I try to add the connection stuff within a constructor in my Model which looks like this:
namespace Concrete\Package\CookbookEvents\Src;
use \Concrete\Core\Legacy\Model;
defined('C5_EXECUTE') or die(_("Access Denied."));
class CookbookEvent extends Model
    protected $_table = 'CookbookEvents';
    public function getDate()
        return utf8_encode(strftime('%d. %b %Y', strtotime($this->event_date)));
    public function getTitle()
        return $this->title;

Where is my mistake or misunderstanding?

Thanks for your help in advance.

Best, Michael

View Replies: