# Error upgrading from postgresql83-server to postgresql84-server



## hmallett (Jan 5, 2010)

I just tried upgrading from postgresql 8.3.7 to postgresql 8.4.2, using the example at http://www.freebsddiary.org/postgresql-upgrading.php
Upgrading the client proved no problem, however when it comes to upgrading the server, I get an unknown build error. Now I know I could probably simply make deinstall in postgresql83-server and make install in postgresql84-server, but before I do I'd like to understand what's going wrong here.
Unfortunately I don't know what the next step to take is. Any ideas?


----------



## hmallett (Jan 5, 2010)

It would help if I'd included the error!


```
database# portupgrade -fo databases/postgresql84-server postgresql-server
--->  Upgrading 'postgresql-server-8.3.7' to
'postgresql-server-8.4.2_1' (databases/postgresql84-server)
--->  Building '/usr/ports/databases/postgresql84-server'
===>  Cleaning for postgresql-server-8.4.2_1


   =========== 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.
   ===========================================

** Command failed [exit code 1]: /usr/bin/script -qa /tmp/portupgrade20100105-97842-at6jus-0 env UPGRADE_TOOL=portupgrade
UPGRADE_PORT=postgresql-server-8.3.7 UPGRADE_PORT_VER=8.3.7 make
** Fix the problem and try again.
** Listing the failed packages (-:ignored / *:skipped / !:failed)
         ! databases/postgresql84-server (postgresql-server-8.3.7)      
   (unknown build error)
```


----------



## DutchDaemon (Jan 5, 2010)

Can't really see any build error there. Can you omit the -f flag?


----------



## hmallett (Jan 5, 2010)

I don't have remote access to the site where this is happening, but I tried without the -f and got the exact same thing.
As you say, it's not really a build error, as it's just output the backup message, then straight into an error, not even started the configure yet.


----------



## DutchDaemon (Jan 5, 2010)

Can you cd to /usr/ports/databases/postgresql84-server and run a simple 'make' there? This doesn't install anything, it just builds the port in the work/ subdirectory. Run a 'make clean' first, just to make sure there's nothing hanging around.


----------



## DutchDaemon (Jan 5, 2010)

One of the possible reasons for the failure is that the server port has an explicit CONFLICTS set, whereas the client port doesn't:


```
CONFLICTS?=     ${PORTNAME}-client-7.* \
                ${PORTNAME}${PKGNAMESUFFIX}-7.* \
                ${PORTNAME}-client-8.[0-35-9]* \
                ${PORTNAME}${PKGNAMESUFFIX}-8.[0-35-9]*
```

I forget how portupgrade -o handles the upgrade process, but it may stumble over the CONFLICTS statement when the old version isn't deinstalled first. If the 'make' process in the previous post fails, you may (indeed) have to pkg_delete the old version manually.


----------



## hmallett (Jan 15, 2010)

DutchDaemon said:
			
		

> Can you cd to /usr/ports/databases/postgresql84-server and run a simple 'make' there?


This gives me a message about a conflict:

```
===>  postgresql-server-8.4.2_1 conflicts with installed package(s):
      postgresql-server-8.3.7

      They install files into the same place.
      Please remove them first with pkg_delete(1).
*** Error code 1
```

As you say, it might be that portupgrade isn't handling the conflict well. Looks like a pkg_delete it is then!


----------

