Skip to content
Snippets Groups Projects
Select Git revision
  • benchmark-tools
  • postgres-lambda
  • master default
  • REL9_4_25
  • REL9_5_20
  • REL9_6_16
  • REL_10_11
  • REL_11_6
  • REL_12_1
  • REL_12_0
  • REL_12_RC1
  • REL_12_BETA4
  • REL9_4_24
  • REL9_5_19
  • REL9_6_15
  • REL_10_10
  • REL_11_5
  • REL_12_BETA3
  • REL9_4_23
  • REL9_5_18
  • REL9_6_14
  • REL_10_9
  • REL_11_4
23 results

plperl.c

Blame
    • Tom Lane's avatar
      0d444608
      Use heap_modify_tuple not SPI_modifytuple in pl/perl triggers. · 0d444608
      Tom Lane authored
      The code here would need some change anyway given planned change in
      SPI_modifytuple semantics, since this executes after we've exited the
      SPI environment.  But really it's better to just use heap_modify_tuple.
      The code's actually shorter this way, and this avoids depending on some
      rather indirect reasoning about why the temporary arrays can't be overrun.
      (I think the old code is safe, as long as Perl hashes can't contain
      duplicate keys; but with this way we don't need that assumption, only
      the assumption that SPI_fnumber doesn't return an out-of-range attnum.)
      
      While at it, normalize use of SPI_fnumber: make error messages distinguish
      no-such-column from can't-set-system-column, and remove test for deleted
      column which is going to migrate into SPI_fnumber.
      0d444608
      History
      Use heap_modify_tuple not SPI_modifytuple in pl/perl triggers.
      Tom Lane authored
      The code here would need some change anyway given planned change in
      SPI_modifytuple semantics, since this executes after we've exited the
      SPI environment.  But really it's better to just use heap_modify_tuple.
      The code's actually shorter this way, and this avoids depending on some
      rather indirect reasoning about why the temporary arrays can't be overrun.
      (I think the old code is safe, as long as Perl hashes can't contain
      duplicate keys; but with this way we don't need that assumption, only
      the assumption that SPI_fnumber doesn't return an out-of-range attnum.)
      
      While at it, normalize use of SPI_fnumber: make error messages distinguish
      no-such-column from can't-set-system-column, and remove test for deleted
      column which is going to migrate into SPI_fnumber.