While trying to upgrade to NAV 5.16.1, navsyncdb throws this error:
sql/changes/sc.05.16.0001.sql: operator is not unique: unknown || integer LINE 1: new_token_str := 'token #' || token_rec.id || ' (' || trunca... ^ HINT: Could not choose a best candidate operator. You might need to add explicit type casts. QUERY: new_token_str := 'token #' || token_rec.id || ' (' || truncated_comment || ')' CONTEXT: PL/pgSQL function inline_code_block line 22 at assignment
PostgreSQL version 14.21 (both client and server) on FreeBSD
The solution is to explicitly cast the two places where it is missing:
28c28 < new_token_str := 'token #' || token_rec.id || ' (' || truncated_comment || ')'; ---
new_token_str := 'token #' || token_rec.id::TEXT || ' (' || truncated_comment || ')';
30c30 < new_token_str := 'token #' || token_rec.id; ---
new_token_str := 'token #' || token_rec.id::TEXT;
--Ingeborg
On Wed 25 Feb 2026 at 15:06, Ingeborg Hellemo via Nav-users nav-users@lister.sikt.no wrote:
While trying to upgrade to NAV 5.16.1, navsyncdb throws this error:
sql/changes/sc.05.16.0001.sql: operator is not unique: unknown || integer LINE 1: new_token_str := 'token #' || token_rec.id || ' (' || trunca... ^ HINT: Could not choose a best candidate operator. You might need to add explicit type casts. QUERY: new_token_str := 'token #' || token_rec.id || ' (' || truncated_comment || ')' CONTEXT: PL/pgSQL function inline_code_block line 22 at assignment
PostgreSQL version 14.21 (both client and server) on FreeBSD
The solution is to explicitly cast the two places where it is missing:
You are indeed correct. It seems this syntax is ambiguous specifically on PostgreSQL 14, but not on PostgreSQL 13 (which we test on), or 15 (which we use in production).
PostgreSQL 13 was EOL over two months ago, so I guess we should also move NAV's requirement to 14 by now.
See https://github.com/Uninett/nav/issues/3806