Postgres \set variable
Within psql, you can \set variables and reference them with :'var-name'. For example:    \set query '...
Tags: postgres, vim