I was searching for creating a column/variable in postgres and I found out a code that is using hsstore extension to create a column variable.
I found out this code
temp_sql_string:='"'||p_k||'"=>"'||nextval(seq::regclass)||'"';
NEW := NEW #= temp_sql_string :: public.hstore;
from : https://dba.stackexchange.com/questions/82039/assign-to-new-by-key-in-a-postgres-trigger
Now, what i want is to get rid of the hstore extension and I want to use json. I've tried using this but doesn't work.
temp_sql_string:='"'||p_k||'":"'||nextval(seq::regclass)||'"';
NEW := NEW #= temp_sql_string::json;
any idea ?