The for col in target_columns is invalid here - a inline foreign key reference can target only single column, see: http://www.postgresql.org/docs/9.1/static/ddl-constraints.html section 5.3.5.