In general I found the treatment of variables in Postgres much confusing compared to typical programming languages, and then I came to this one, which essentially boils down to