title: Can data be changed during multi-select request?
body: <p>I have a request with multiple SELECT from one table (FileInstance) and these SELECTs use MAX function. 
  Is it any gaurantee that during this INSERT statement <code>SELECT MAX(Sequence) FROM FileInstance</code> will give the same result?
  Is it possible that a record can be added between these SELECTs and I will catch different values?</p>
  
  <pre><code>INSERT INTO
      FileInstance (Data, Size, FileID, ChangesetID)
  VALUES
  (
      (SELECT Data FROM FileInstance WHERE FileID=%1 AND Sequence=(SELECT MAX(Sequence) FROM FileInstance WHERE FileID=%1)),
      (SELECT Size FROM FileInstance WHERE FileID=%1 AND Sequence=(SELECT MAX(Sequence) FROM FileInstance WHERE FileID=%1)),
      %1,
      NULL
  );
  </code></pre>
  
  <p>Of cource, I think that two calls SELECT MAX(Sequence) FROM FileInstance WHERE FileID=%1 will be converted to one call, but I just want to be sure.</p>
  
  <p>I use postgresql 9.2.
  Thanks!</p>