Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 26 Apr 2011 11:44:23 -0400 (EDT)
From:      Mark Stosberg <mark@summersault.com>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/156662: postgresql90-server port install fails due to misuse of PGUSER environment variable
Message-ID:  <201104261544.p3QFiNR7048217@sap.summersault.com>
Resent-Message-ID: <201104261600.p3QG0Lv2094407@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         156662
>Category:       ports
>Synopsis:       postgresql90-server port install fails due to misuse of PGUSER environment variable
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Apr 26 16:00:21 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator:     Mark Stosberg
>Release:        FreeBSD 8.1-RELEASE i386
>Organization:
Summersault
>Environment:
System: FreeBSD sap.summersault.com 8.1-RELEASE FreeBSD 8.1-RELEASE #0: Fri Feb 18 04:03:40 EST 2011 root@:/usr/obj/usr/src/sys/SAP i386

>Description:
I have done multiple point upgrades of the PostgreSQL 9.0.x port series, but the latest one failed inbetween "make deinstall" and "make reinstall", creating some downtime. Fortunately, it was a dev machine.

The issue is that the "PGUSER" environment variable (and perhaps others) are being mis-used. 

Variables like this are documented by PostgreSQL to be "default connection parameters". However, the
installation process assumes that if they are defined, they are the values used for the "pgsql super-user".

For anyone who has these set for a different default connection, the installation will fail with a cryptic error, shown
below. 


>How-To-Repeat:
You can see the issue in this "screenshot". Notice the last line, which refers to attempting to add a "dev_limited" user, which should not be involved in the process at all.

root@dev# make reinstall
===>  Installing for postgresql-server-9.0.4_1
===>   postgresql-server-9.0.4_1 depends on shared library: pq.5 - found
===>   Generating temporary packing list
===>  Checking if databases/postgresql90-server already installed


  =========== BACKUP YOUR DATA! =============
  As always, backup your data before
  upgrading. If the upgrade leads to a higher
  minor revision (e.g. 7.3.x -> 7.4), a dump
  and restore of all databases is
  required. This is *NOT* done by the port!

  Press ctrl-C *now* if you need to pg_dump.
  ===========================================

pgsql:*:70:
You already have a group "pgsql", so I will use it.
pw: uid `70' has already been allocated
Adding user "dev_limited" failed...

>Fix:

The recommended solution is to use a new, specific environment variable for defining a custom "psql super-user" value for those who wish to set one. 

>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201104261544.p3QFiNR7048217>