CodeIgniter Forums
PostgreSQL application_name - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: Installation & Setup (https://forum.codeigniter.com/forumdisplay.php?fid=9)
+--- Thread: PostgreSQL application_name (/showthread.php?tid=65985)



PostgreSQL application_name - clebersoncs - 08-19-2016

PostgreSQL allows you to name the connections to the application_name. Thus, the database log can I know which application ran that query. In config/database.php does not have this parameter, there some other way that I can use to set this parameter?

https://www.postgresql.org/docs/9.2/static/runtime-config-logging.html#GUC-APPLICATION-NAME


RE: PostgreSQL application_name - byrallier - 03-24-2024

this is a bit old topic without discussion but also I was looking for this, is anyone figure out how to handle application name? I have multiple services run over CI framework I want to assign their hostnames as app name


RE: PostgreSQL application_name - kenjis - 03-24-2024

Try:
PHP Code:
    public array $default = [
        'DSN'=> "host=localhost port=5432 user=postgres password='postgres' dbname=test options='--application_name=CI4'",
        // ...
    ]; 



RE: PostgreSQL application_name - byrallier - 05-04-2024

mr: https://github.com/codeigniter4/CodeIgniter4/pull/8852


RE: PostgreSQL application_name - Bosborne - 05-04-2024

(05-04-2024, 12:16 PM)byrallier Wrote: mr: https://github.com/codeigniter4/CodeIgniter4/pull/8852

Wouldn’t you need to get php PDO to support this first? The php manual does not show that as a DSN element for PostgresQL

https://www.php.net/manual/en/ref.pdo-pgsql.connection.php