title: UPDATE a whole row in PL/pgSQL
body: <p>I have plpgsql function:</p>
  
  <pre><code>CREATE OR REPLACE FUNCTION test() RETURNS VOID AS
  $$
  DECLARE
      my_row my_table%ROWTYPE;
  BEGIN
      SELECT * INTO my_row FROM my_table WHERE id='1';
      my_row.date := now();
  END;
  $$ LANGUAGE plpgsql;
  </code></pre>
  
  <p>I would like to know if it's possible to directly UPDATE <code>my_row</code> record.</p>
  
  <p>The only way I've found to do it now is:</p>
  
  <pre><code>UPDATE my_table SET date=now() WHERE id='1';
  </code></pre>
  
  <p>Note this is only an example function, the real one is far more complex than this.</p>
  
  <p>I'm using PostgreSQL 9.2.</p>
  
  <p>UPDATE:</p>
  
  <p>Sorry for the confusion, what I wanted to say is:</p>
  
  <pre><code>SELECT * INTO my_row FROM my_table INTO my_row WHERE id='1';
  make_lots_of_complicated_modifications_to(my_row, other_complex_parameters);
  UPDATE my_row;
  </code></pre>
  
  <p>I.e. Use my_<code>row</code> to persist information in the underlying table. I have lots of parameters to update.</p>