import asyncpg
...
await conn.execute('''
DO $$
BEGIN
IF NOT EXISTS (SELECT name FROM users WHERE name = $1) THEN
INSERT INTO users (name, dob) VALUES ($1, $2);
END IF;
END;
$$
''', name, datetime.date(1984, 3, 1))
asyncpg.exceptions._base.InterfaceError: the server expects 0 arguments for this query, 2 were passed