Zkuste ponechat příslušné sloupce stejného typu, např. casting instance
na text
měl by stačit:
CREATE TABLE IF NOT EXISTS cdr_event
(
id bigint primary key generated always as identity,
start_time timestamptz NOT NULL DEFAULT now(),
end_time timestamptz NULL,
group_id VARCHAR(10) NOT NULL,
environment VARCHAR(10) NOT NULL,
level VARCHAR(10) NOT NULL,
schema VARCHAR(30) NOT NULL,
instance INTEGER NOT NULL,
hive_instance_db_name VARCHAR(100) GENERATED ALWAYS AS (group_id||'_'||environment||'_'||level||'_'||schema||'_'||instance::text) STORED,
hive_static_db_name VARCHAR(100) GENERATED ALWAYS AS (group_id||'_'||environment||'_'||level||'_'||schema) STORED
);
Zvažte použití text
místo varchar
.
Demo:db<>fiddle