postgres=# select b as my_var from tab1 \gset postgres=# \echo :my_var xyz