In a REPEATABLE READ serialization level, the selected data from foo
would be locked (but you could still append to foo
, or alter lines that were not selected). If you only insert into bar
, I do not believe any locks would happen on the existing rows in the table.
Also, do you have a reason not to use an insert-select ?
insert into bar (...) select ... from foo;