Configuration/settings/pg connect: Difference between revisions

From Davical
Jump to navigationJump to search
(create page for pg_connect[] configuration option)
 
m (documented alternate database configuration option)
 
Line 4: Line 4:


The application will attempt to connect to the database, successively applying connection parameters from the array in <code>$c->pg_connect</code>. This ''mandatory'' setting is used by both, the web interface but also the CALDAV server. If no host is specified, "localhost" is assumed.
The application will attempt to connect to the database, successively applying connection parameters from the array in <code>$c->pg_connect</code>. This ''mandatory'' setting is used by both, the web interface but also the CALDAV server. If no host is specified, "localhost" is assumed.
'''Note:''' From version 0.9.9.4 there is an alternate syntax available (though <code>pg_connect</code> will continue to work) which is:
  $c->db_connect[] = array( 'dsn' => 'pgsql:dbname=davical port=5432 host=dbhost', 'dbuser' => 'davical_app', 'dbpass' => 'fred' );
Or, for a local DB on the default port with trustauthentication:
  $c->db_connect[] = array( 'dsn' => 'pgsql:dbname=davical', 'dbuser' => 'davical_app' );


{{AvailableFrom|All versions}}
{{AvailableFrom|All versions}}

Latest revision as of 21:08, 10 December 2015

$c->pg_connect[] = 'dbname=davical user=davical_app port=5433 host=somehost password=mypass';

Default: none

The application will attempt to connect to the database, successively applying connection parameters from the array in $c->pg_connect. This mandatory setting is used by both, the web interface but also the CALDAV server. If no host is specified, "localhost" is assumed.

Note: From version 0.9.9.4 there is an alternate syntax available (though pg_connect will continue to work) which is:

 $c->db_connect[] = array( 'dsn' => 'pgsql:dbname=davical port=5432 host=dbhost', 'dbuser' => 'davical_app', 'dbpass' => 'fred' );

Or, for a local DB on the default port with trustauthentication:

 $c->db_connect[] = array( 'dsn' => 'pgsql:dbname=davical', 'dbuser' => 'davical_app' );

Template:AvailableFrom