1. 10 Jul, 2019 2 commits
    • David Rowley's avatar
      Fix missing calls to table_finish_bulk_insert during COPY, take 2 · f7c830f1
      David Rowley authored
      86b85044 abstracted calls to heap functions in COPY FROM to support a
      generic table AM.  However, when performing a copy into a partitioned
      table, this commit neglected to call table_finish_bulk_insert for each
      partition.  Before 86b85044, when we always called the heap functions,
      there was no need to call heapam_finish_bulk_insert for partitions since
      it only did any work when performing a copy without WAL.  For partitioned
      tables, this was unsupported anyway, so there was no issue.  With
      pluggable storage, we can't make any assumptions about what the table AM
      might want to do in its equivalent function, so we'd better ensure we
      always call table_finish_bulk_insert each partition that's received a row.
      
      For now, we make the table_finish_bulk_insert call whenever we evict a
      CopyMultiInsertBuffer out of the CopyMultiInsertInfo.  This does mean
      that it's possible that we call table_finish_bulk_insert multiple times
      per partition, which is not a problem other than being an inefficiency.
      Improving this requires a more invasive patch, so let's leave that for
      another day.
      
      This also changes things so that we no longer needlessly call
      table_finish_bulk_insert when performing a COPY FROM for a non-partitioned
      table when not using multi-inserts.
      
      Reported-by: Robert Haas
      Backpatch-through: 12
      Discussion: https://postgr.es/m/CA+TgmoYK=6BpxiJ0tN-p9wtH0BTAfbdxzHhwou0mdud4+BkYuQ@mail.gmail.com
      f7c830f1
    • Amit Kapila's avatar
      Fix few typos and minor wordsmithing in tableam comments. · bd56cd75
      Amit Kapila authored
      Reported-by: Ashwin Agrawal
      Author: Ashwin Agrawal
      Reviewed-by: Amit Kapila
      Backpatch-through: 12, where it was introduced
      Discussion: https://postgr.es/m/CALfoeisgdZhYDrJOukaBzvXfJOK2FQ0szVMK7dzmcy6w93iDUA@mail.gmail.com
      bd56cd75
  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 3 commits
    • 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
    • Tom Lane's avatar
      Doc: document table persistence display in \dt+. · 03e7b302
      Tom Lane authored
      Forgotten in commit 9a2ea618.
      03e7b302
    • Tom Lane's avatar
      Show table persistence in psql's \dt+ and related commands. · 9a2ea618
      Tom Lane authored
      In verbose mode, listTables() now emits a "Persistence" column
      showing whether the table/index/view/etc is permanent, temporary,
      or unlogged.
      
      David Fetter, reviewed by Fabien Coelho and Rafia Sabih
      
      Discussion: https://postgr.es/m/20190423005642.GZ28936@fetter.org
      9a2ea618