I have in post a column I need to generate, which follows a naming pattern. The pattern is unique for each table, but will always include some sort of suffix or prefix, and the current row value of the some of it columns.
-- Create table_registration
ALTER TABLE public.person
DROP COLUMN IF EXISTS entry_name,
ADD COLUMN entry_name TEXT generated ALWAYS as (concat_ws(' ', hobby)) stored;
This sometimes trigger an error like
Npgsql.PostgresException: '42P17: generation expression is not immutable'
I then became aware of this might not be what I would like to to do, since it basically the same as a new column and takes up space - from basically do logic operation.
Is there someway I can generate this - and modify this without taking of space, and if that is not possible why I am not able to drop the columns once it has been added?