You’ve got it correct. In a “SELECT FOR UPDATE” with a JOIN, any rows that contribute to the returned rows will be locked. You can change this behavior by adding an “OF table_a” to the “FOR UPDATE” so that only the rows from table_a will be locked. You can read more about this in the Postgres docs here:
http://www.postgresql.org/docs/9.0/static/sql-select.html#SQL-FOR-UPDATE-SHARE