I'm trying to create the following index;
CREATE INDEX idx_concat_paostartno_paostartsuff ON
dmv_os_addbase_residential (concat(pao_start_number || pao_start_suffix));
I get the error;
ERROR: functions in index expression must be marked IMMUTABLE`
I think this is the mixing of types, as pao_start_number
is type bigint
and pao_start_suffix
is varchar
. I've tried to resolve as;
CREATE INDEX idx_concat_paostartno_paostartsuff ON
dmv_os_addbase_residential (concat((pao_start_number :: text) || pao_start_suffix))
but same error.
Am I right in identifying that cause of the error and how can I resolve it? I am using Postgres 9.6
You probably want
This index can only be used for queries like
where
<operator>
is one of=
,<
,<=
,>
or>=
.