title: Is it possibile to create aliases for postgresql queries?
body: <p>I would like to create something like a query that gets called everytime I write an alias. So something like :</p>
  <p>myalias = select codes from codetables where validity=current_date ;</p>
  <p>then use it like :</p>
  <p>select * from mainregistry where code in (myalias) ;</p>
  <p>the &quot;myalias&quot; should be available everywhere everytime, so there should be a way of having it &quot;default&quot; in all my dbs.</p>