1. 10 Jul, 2019 4 commits
  2. 09 Jul, 2019 5 commits
  3. 08 Jul, 2019 5 commits
  4. 07 Jul, 2019 2 commits
  5. 06 Jul, 2019 5 commits
  6. 05 Jul, 2019 8 commits
  7. 04 Jul, 2019 10 commits
  8. 03 Jul, 2019 1 commit
    • Tom Lane's avatar
      Ensure plpgsql result tuples have the right composite type marking. · 5683b349
      Tom Lane authored
      A function that is declared to return a named composite type must
      return tuple datums that are physically marked as having that type.
      The plpgsql code path that allowed directly returning an expanded-record
      datum forgot to check that, so that an expanded record marked as type
      RECORDOID could be returned if it had a physically-compatible tupdesc.
      This'd be harmless, I think, if the record value never escaped the
      current session --- but it's possible for it to get stored into a table,
      and then subsequent sessions can't interpret the anonymous record type.
      
      Fix by flattening the record into a tuple datum and overwriting its
      type/typmod fields, if its declared type doesn't match the function's
      declared type.  (In principle it might be possible to just change the
      expanded record's stored type ID info, but there are enough tricky
      consequences that I didn't want to mess with that, especially not in
      a back-patched bug fix.)
      
      Per bug report from Steve Rogerson.  Back-patch to v11 where the bug
      was introduced.
      
      Discussion: https://postgr.es/m/cbaecae6-7b87-584e-45f6-4d047b92ca2a@yewtc.demon.co.uk
      5683b349