postgresql7.1 insert into adv_groups (group_key, pretty_name, rotation_method) select :group_key, :pretty_name, :rotation_method where not exists (select 1 from adv_groups where group_key = :group_key)