Q:

Postgres change number format

in Postgres I use this query:
UPDATE managers SET phone_number = replace(phone_number, '\m86', '3706');

unfortunately the field is long and query fails. I need to change all numbers beginning with 86 to start with 3706...
I tried many Postgres functions, but it is not obvious do they have the fumction I need.
the error is:
ERROR:  function replace(bigint, unknown, unknown) does not exist
LINE 1: UPDATE managers SET phone_number = replace(phone_number, '\m...
                                       ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.

table definition:
CREATE TABLE public.managers(
  phone_number bigint,
  email_report boolean,
)

A:

As was pointed out in the comments, if you use a regex replace it becomes much easier to articulate what a number is which starts with 86.  The pattern for that is just ^86 and the replacement is 3706.  Consider the following query:
UPDATE managers
SET phone_number = REGEXP_REPLACE(phone_number::text, '^86', '3706')::int

