On Mon, 26 Aug 2013 08:00:41 +0200 (CEST) Jostein Berge jostein.berge@karmoy.kommune.no wrote:
Hi
We are having som trouble with the ip/mactracker. Running nav on debian 6.0.7, current nav versjon 3.14.1592653. Suspect the problems came a few versions back.
Hopefully someone has a suggestion on what could be wrong. If we search for a mac we get the follow error :
[snip]
Exception Type: DatabaseError at /machinetracker/mac/ Exception Value: function array_agg(character varying) does not exist LINE 1: SELECT (SELECT array_to_string(array_agg(DISTINCT name),', '... ^ HINT: No function matches the given name and argument types. You might need to add explicit type casts.
Yes, this is a bug, which we have regrettably forgotten/neglected to fix.
NAV 3.14 claims compatibility with PostgreSQL 8.3, but the new netbios scanning feature in 3.14 also introduced an unintended dependency on PostgreSQL 9 in the Machine Tracker UI. We thought we worked around this - but apparently, it will still need PostgreSQL 8.4.
There are two workarounds, one of which we can introduce as a bugfix in the 3.14 series. The bugfix version would be to create the aggregate function that doesn't exist in PostgreSQL 8.3, by running `sudo -u postgres psql nav` and issuing the following SQL:
CREATE AGGREGATE manage.array_agg(anyelement) ( SFUNC=array_append, STYPE=anyarray, INITCOND='{}' );
The workaround version is to simply upgrade to PostgreSQL 8.4 or newer. On that note, one of the coming NAV releases, either in September or December, will require PostgreSQL 9, so you may already start thinking about upgrades.