CREATE OR REPLACE FUNCTION update_album_key (old_album_key TEXT, new_album_key TEXT) RETURNS void AS $$
BEGIN
  UPDATE listens
  SET album_key = new_album_key
  WHERE album_key = old_album_key;
END;
$$ LANGUAGE plpgsql;
