sql - How to update data for each row using function and data from another table? -
i've got problem updating data each row in acrticles_pl_vector
table using function in set clause , data take table.
for example have pseudocode:
create or replace function updatetsvector () returns status $$ begin each row othertable update acrticles_pl_vector set vector = to_tsvector('polish', othertable.title || othertable.content); id = othertable.id end; $$ language plpgsql
thanks in advance!
create or replace function updatetsvector () returns void $$ update acrticles_pl_vector set locale = 'pl', vector = to_tsvector('polish', ot.title || ot.content othertable ot id = ot.id; $$ language sql;
Comments
Post a Comment