title: Check if column exists when there are multiple tables with same name in different schemas (PSQL 8.2)
body: <p>In order to check if a column exists I can easily use something similar to this:</p>
  
  <pre><code>SELECT attname FROM pg_attribute 
  WHERE attrelid = (SELECT oid FROM pg_class WHERE relname = 'YOURTABLENAME') 
  AND attname = 'YOURCOLUMNNAME';
  </code></pre>
  
  <p>However, I run into problems with </p>
  
  <pre><code>SELECT oid FROM pg_class WHERE relname = 'YOURTABLENAME'
  </code></pre>
  
  <p>When there are several tables with the same name spread out over different schemas as it returns the OID's of all the tables with that name. How do I check if a table within a specific schema contains the column I am after? I'm using Postgres 8.2.</p>