title: PostgreSQL isset function
body: <p>Is there any way, how to check, whether a variable has already been set in my environment?</p>
  
  <p>Example:</p>
  
  <pre><code>\set table_name countries
  \i queries.sql
  </code></pre>
  
  <p>queries.sql:</p>
  
  <pre><code>SELECT * FROM :table_name;
  </code></pre>
  
  <p>I want to make queries.sql to be called independently and use some default table name I would specify.</p>
  
  <p>Is this possible or do I really need to create another SQL file through which I will call the queries (\i)?</p>
  
  <p>My use case is usage of my SQL queries both in pgTAP unit tests (with some sample table names) and independently.</p>