How do I create a function which takes indefinite parameters? And then finds all `game_id`s in a table where *each* parameter matches a different row (but same `game_id`)?

### Example

Table:

```
create table tags (
    tag_id    serial primary key,
    game_id   int, -- references games(game_id),
    tag_name  text,
    tag_value text
)

```

Sample data:

```
 tag_id | game_id | tag_name  |      tag_value
--------+---------+-----------+----------------------
     55 |       6 | Event     | EUR-ASIA Rapid Match
     58 |       6 | Round     | 5
    400 |      38 | Event     | EUR-ASIA Rapid Match
    403 |      38 | Round     | 4

```

Example request: Let's say I want all `game_id`s where

```
Event (a tag_name) = 'EUR-ASIA Rapid Match' (a tag_value)
AND
Round (a tag_name) = '5' (a tag_value)

```

A hardcoded solution for that exact scenario only might look like this:

```
with m1 as (
  select game_id from tags
    where tag_name = 'Event'
    and tag_value = 'EUR-ASIA Rapid Match'
), m2 as (
  select game_id from tags
    where tag_name = 'Round'
    and tag_value = '5'
) select * from m1 intersect select * from m2;

```

**Except** I want an indefinite number of tag matches. Can I create a function that takes an arbitrary number of tag names/values and returns a set of `game_id` matching all? The call might look this (pseudo-code):

```
select * from get_games_by_tags('{Event,EUR-ASIA Rapid Match}', ...)

```