read_conf_file ignores include_if_exists in config file

Bug #1098986 reported by Myle Ott
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
postgresql-common (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

The read_conf_file function in PgCommon.pm (~line 108) will process external config files that are included with "include" but not those included with "include_if_exists" (a new feature added to PostgreSQL 9.2).

Versions:
Ubuntu 12.04.1
PostgreSQL 9.2.2-0ppa1~precise
postgresql-common 139~precise

Revision history for this message
Myle Ott (myleott) wrote :

Here is a fix that's working for me:

- add "(_if_exists)?" to the regex.
- set $path = $2 (previously $path = $1)

Here is the result of the change, with line numbers in PgCommon.pm:

108 } elsif (/^\s*include(_if_exists)?\s+'([^']+)'\s*$/i) {
109 my ($k, $v, $path, %include_conf);
110 $path = $2;

description: updated
Revision history for this message
Martin Pitt (pitti) wrote :
Changed in postgresql-common (Ubuntu):
status: New → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package postgresql-common - 140

---------------
postgresql-common (140) experimental; urgency=low

  [ Martin Pitt ]
  * t/001_packages.t: Also check that -contrib is installed.
  * debian/backport-ppa: Backport -common for Ubuntu 12.10.
  * PgCommon.pm: Recognize "include_if_exists" directive. (LP: #1098986)
  * pg_ctlcluster: Recreate a missing /var/log/postgresql/ if needed.
    (LP: #1009989)
  * debian/postgresql-client-common.links: Wrap pgbench with pg_wrapper.
    (LP: #1068194)

  [ Christoph Berg ]
  * testsuite: The default list of umasks to test (022 077) can be overridden
    by setting the environment variable PG_UMASKS.
  * t/003_package_checks.t: Ensure psql is linked against libedit.
  * t/005_PgCommon.t: Increase sleep time after netcat launch to 200ms.
  * t/020_create_sql_remove.t: Test process title update.
  * pg_createcluster: Allow passing of initdb arguments on the command line.
    If --auth parameters are passed, skip updating the generated pg_hba.conf
    file.
  * pg_virtualenv: Allow passing initdb arguments to pg_createcluster.
  * pg_upgradecluster: Print a helpful message when invoked on the target
    version. Problem seen on #postgresql.
  * t/030_errors.t: Adjust testsuite for this.
  * debian/supported-versions: Handle unset variables from /etc/os-release
    gracefully. Spotted by x4rlos on #postgresql.
  * pg_buildext: Set USE_PGXS=1, and srcdir (needed by plr).

 -- Christoph Berg <email address hidden> Thu, 31 Jan 2013 10:36:41 +0100

Changed in postgresql-common (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.