INSERT
with temp_01 as (
insert into user_signup(user_id, nickname)
values (nextval('seq_user_map_id'), 'daily code')
returning *
)
insert into user_info(user_id, nickname, signup_time)
select temp_01.user_id, temp_01.nickname, now()
from temp_01
DELETE
with temp_01 as (
delete from user_info a
where a.user_id = 123
returning *
)
delete from user_signup t1
where t1.user_id in (select user_id from temp_01)
UPDATE
with temp_01 as (
update user_info
set nickname = 'changed', modfied_time = now()
where user_id = 123
returning *
)
update user_profile a
set nickname = 'changed', modfied_time = now()
from temp_01 b
where a.user_id = b.user_id