We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

How can I set in config.php for connecting postgresql with " options='--client_encoding=UTF8;--application_name=pcstu;' "

just like this in orignal php:

<?php $dbh = new PDO("pgsql:dbname=test; host=localhost; user=postgres; password=123456; options='--client_encoding=UTF8;--application_name=pcstu;' "); ?>



43.9k

Hi,

maybe with this: passing aditionnal options to the database connection constructor: https://docs.phalcon.io/en/3.3/db-layer#options

edited Oct '19

Was this ever solved?

Edit: I just solved it now.

You do not need to use additional options, just add 'application_name' => 'name' to your config array.