title: Selecting Columns From a Record Variable (PostgreSQL 8.4)
body: <p>I'm trying to select a column from a record variable in a function I'm calling from an Update rule and am getting the following error:</p>
  
  <p>'could not identify column "name" in record data type'</p>
  
  <p>The following is what I'm doing to produce the error:</p>
  
  <p>From within an Update rule:</p>
  
  <pre><code>SELECT * INTO TEMPORARY TABLE TempTable FROM NEW;
  SELECT MyFunction();
  </code></pre>
  
  <p>From within MyFunction()</p>
  
  <pre><code>DECLARE RecordVar Record;
  SELECT * INTO STRICT RecordVar FROM TempTable;
  EXECUTE 'UPDATE AnotherTable SET column = $1.name' USING RecordVar;
  </code></pre>
  
  <p>Note: I realise that there are easier ways to achieve what the above code is achieving but I've simplified the actual implementation to focus on the problem I'm having, which has opened up other possible solutions but I'd really like to get the above code working if possible.</p>