I'm in the middle of upgrading NAV from 4.8 to 5.0.5 and running 'navsyncdb' to alter the database schemas.
(The database is named nynav because this is a test upgrade)
/#navsyncdb Existing namespaces in nynav search path: "$user", public. Adding manage, profiles, logger, arnold, radius. Applying outstanding schema changes sql/changes/sc.04.09.0001.sql: OK sql/changes/sc.04.09.0050.sql: OK sql/changes/sc.04.09.0100.sql: OK sql/changes/sc.04.09.0110.sql: OK sql/changes/sc.04.09.0200.sql: OK sql/changes/sc.05.00.0001.sql: OK sql/changes/sc.05.00.0010.sql: operator is not unique: unknown || integer LINE 29: 'SNMP v' || snmp_version || ' read profile #' || row AS na... ^ HINT: Could not choose a best candidate operator. You might need to add explicit type casts.
Server version Postgresql 9.6.17
Since this is a newly created database with imported data it might be missing some environment variables or something.
--Ingeborg
ingeborg.hellemo@uit.no said:
sql/changes/sc.05.00.0010.sql: operator is not unique: unknown || integer LINE 29: 'SNMP v' || snmp_version || ' read profile #' || row AS na...
Did a check on my operators:
nynav=> \do || List of operators Schema | Name | Left arg type | Right arg type | Result type | Description ------------+------+---------------+----------------+-------------+------------ ------------------------- manage | || | hstore | hstore | hstore | pg_catalog | || | anyarray | anyarray | anyarray | concatenate pg_catalog | || | anyarray | anyelement | anyarray | append element onto end of array pg_catalog | || | anyelement | anyarray | anyarray | prepend element onto front of array pg_catalog | || | anynonarray | text | text | concatenate pg_catalog | || | bit varying | bit varying | bit varying | concatenate pg_catalog | || | bytea | bytea | bytea | concatenate pg_catalog | || | jsonb | jsonb | jsonb | concatenate pg_catalog | || | text | anynonarray | text | concatenate pg_catalog | || | text | text | text | concatenate pg_catalog | || | tsquery | tsquery | tsquery | OR-concatenate pg_catalog | || | tsvector | tsvector | tsvector | concatenate (12 rows)
The commando gives the same output on tromso-vk
--Ingeborg
On Wed, 06 May 2020 15:39:24 +0200 Ingeborg Hellemo ingeborg.hellemo@uit.no wrote:
sql/changes/sc.05.00.0010.sql: operator is not unique: unknown || integer LINE 29: 'SNMP v' || snmp_version || ' read profile #' || row AS na... ^ HINT: Could not choose a best candidate operator. You might need to add explicit type casts.
Server version Postgresql 9.6.17
Since this is a newly created database with imported data it might be missing some environment variables or something.
This has worked successfully on every other installation I've had the pleasure of fiddling with, so I'm not quite sure why it would be a problem on your PostgreSQL server. Our versions are the same, and the catalog of `||` operators is the same.
What puzzles me is that the 'SNMP v' value seems to be listed as an "unknown" type in the error message.
You might want to try to explicitly cast the integers in the concatenation to text, and see if that helps your PostgreSQL select the correct operator from the catalog.
Something like:
'SNMP v' || snmp_version::TEXT || ' read profile #' || row::TEXT AS name,
morten.brekkevold@uninett.no said:
You might want to try to explicitly cast the integers in the concatenation to text, and see if that helps your PostgreSQL select the correct operator from the catalog.
It helped!
--Ingeborg
On Mon, 11 May 2020 11:38:12 +0200 Ingeborg Hellemo ingeborg.hellemo@uit.no wrote:
text, and see if that helps your PostgreSQL select the correct operator from the catalog.
It helped!
Great, then I will probably opt to modify the change script supplied with NAV, just to be on the safe side :)