# Error during PostgreSQL installation



## nharmon (Aug 1, 2012)

I am trying to install databases/postgresql91-server and the installation is failing at the point where it creates the user _pgsql_:


```
server# make install
===>  Installing for postgresql-server-9.1.4
===>   postgresql-server-9.1.4 depends on shared library: xml2.5 - found
===>   postgresql-server-9.1.4 depends on shared library: intl - found
===>   postgresql-server-9.1.4 depends on shared library: pq.5 - found
===>   Generating temporary packing list
===>  Checking if databases/postgresql91-server already installed
===> Creating users and/or groups.
Using existing group `pgsql'.
Creating user `pgsql' with uid `70'.
pw: user 'pgsql' disappeared during update
*** Error code 67

Stop in /usr/ports/databases/postgresql91-server.
*** Error code 1

Stop in /usr/ports/databases/postgresql91-server.
```

If I attempt the install again, I get an error saying the user already exists:


```
pw: user 'pgsql' already exists
*** Error code 74
```

If I try to delete the _pgsql_ user, the system says there is no such user:


```
server# pw user del pgsql
pw: no such user `pgsql'
server# pw user del 70
pw: no such uid `70'
```

If I try to add the `pgsql' user, the system says it already exists, and there are entries in /etc/passwd and /etc/master.passwd for that user. If I delete the entries from those files and run the install again, I get the original error about the user disappearing.

Search results for this problem indicate issues with nscd, which I do not have enabled.

I have submitted this as a bug report, but any suggestions you may have for a work around would be greatly appreciated.


----------



## SirDice (Aug 1, 2012)

NEVER edit /etc/passwd and /etc/master.passwd by hand. It will go horribly wrong one day.

Try removing the user with vipw(8). You may need to use pwd_mkdb(8) to get the database back in sync again.


----------



## nharmon (Aug 1, 2012)

Removing the _pgsql_ user with vipw(8) fixed it.


----------

