Skip to content
Snippets Groups Projects
  1. Nov 23, 2004
    • Tom Lane's avatar
      Further plperl cleanup: be more paranoid about checking the type of · 28e9b26f
      Tom Lane authored
      data returned from Perl.  Consolidate multiple bits of code to convert
      a Perl hash to a tuple, and drive the conversion off the keys present
      in the hash rather than the tuple column names, so we detect error if
      the hash contains keys it shouldn't.  (This means keys not in the hash
      will silently default to NULL, which seems ok to me.)  Fix a bunch of
      reference-count leaks too.
      28e9b26f
  2. Nov 22, 2004
  3. Nov 21, 2004
  4. Nov 20, 2004
  5. Nov 18, 2004
  6. Nov 17, 2004
  7. Nov 16, 2004
  8. Oct 15, 2004
    • Bruce Momjian's avatar
      I have attached 5 patches (split up for ease of review) to plperl.c. · ce1c2024
      Bruce Momjian authored
      1. Two minor cleanups:
      
          - We don't need to call hv_exists+hv_fetch; we should just check the
            return value of hv_fetch.
          - newSVpv("undef",0) is the string "undef", not a real undef.
      
      2. This should fix the bug Andrew Dunstan described in a recent -hackers
         post. It replaces three bogus "eval_pv(key, 0)" calls with newSVpv,
         and eliminates another redundant hv_exists+hv_fetch pair.
      
      3. plperl_build_tuple_argument builds up a string of Perl code to create
         a hash representing the tuple. This patch creates the hash directly.
      
      4. Another minor cleanup: replace a couple of av_store()s with av_push.
      
      5. Analogous to #3 for plperl_trigger_build_args. This patch removes the
         static sv_add_tuple_value function, which does much the same as two
         other utility functions defined later, and merges the functionality
         into plperl_hash_from_tuple.
      
      I have tested the patches to the best of my limited ability, but I would
      appreciate it very much if someone else could review and test them too.
      
      (Thanks to Andrew and David Fetter for their help with some testing.)
      
      Abhijit Menon-Sen
      ce1c2024
  9. Oct 07, 2004
  10. Oct 06, 2004
  11. Sep 13, 2004
    • Tom Lane's avatar
      Redesign query-snapshot timing so that volatile functions in READ COMMITTED · b2c40712
      Tom Lane authored
      mode see a fresh snapshot for each command in the function, rather than
      using the latest interactive command's snapshot.  Also, suppress fresh
      snapshots as well as CommandCounterIncrement inside STABLE and IMMUTABLE
      functions, instead using the snapshot taken for the most closely nested
      regular query.  (This behavior is only sane for read-only functions, so
      the patch also enforces that such functions contain only SELECT commands.)
      As per my proposal of 6-Sep-2004; I note that I floated essentially the
      same proposal on 19-Jun-2002, but that discussion tailed off without any
      action.  Since 8.0 seems like the right place to be taking possibly
      nontrivial backwards compatibility hits, let's get it done now.
      b2c40712
  12. Aug 30, 2004
  13. Aug 29, 2004
  14. Jul 31, 2004
  15. Jul 21, 2004
  16. Jul 12, 2004
    • Bruce Momjian's avatar
      The attached patch, which incorporates the previous one sent and · 96b9dc1a
      Bruce Momjian authored
      currently unapplied regarding spi_internal.c, makes some additional
      fixes relating to return types, and also contains the fix for
      preventing  the use of insecure versions of Safe.pm.
      
      There is one remaing return case that does not appear to work, namely
      return of a composite directly in a select, i.e. if  foo returns some
      composite type, 'select * from foo()' works but 'select foo()' doesn't.
      We will either fix that or document it as a limitation.
      
      The function plperl_func_handler is a mess - I will try to get it
      cleaned up (and split up) in a subsequent patch, time permitting.
      
      Also, reiterating previous advice - this changes slightly the API for
      spi_exec_query - the returned object has either 2 or 3 members: 'status'
      (string) and 'proceesed' (int,- number of rows) and, if rows are
      returned, 'rows' (array of tuple hashes).
      
      Andrew Dunstan
      96b9dc1a
  17. Jul 01, 2004
    • Joe Conway's avatar
      plperl update from Andrew Dunstan, deriving (I believe) from Command Prompt's · 1732cb0d
      Joe Conway authored
      plperlNG. Review and minor cleanup/improvements by Joe Conway.
      
      Summary of new functionality:
      - Shared data space and namespace. There is a new global variable %_SHARED
        that functions can use to store and save data between invocations of a
        function, or between different functions. Also, all trusted plperl function
        now share a common Safe container (this is an optimization, also), which
        they can use for storing non-lexical variables, functions, etc.
      - Triggers are now supported
      - Records can now be returned (as a hash reference)
      - Sets of records can now be returned (as a reference to an array of hash
        references).
      - New function spi_exec_query() provided for performing db functions or
        getting data from db.
      - Optimization for counting hash keys (Abhijit Menon-Sen)
      - Allow return of 'record' and 'setof record'
      1732cb0d
  18. Jun 06, 2004
    • Tom Lane's avatar
      Infrastructure for I/O of composite types: arrange for the I/O routines · c541bb86
      Tom Lane authored
      of a composite type to get that type's OID as their second parameter,
      in place of typelem which is useless.  The actual changes are mostly
      centralized in getTypeInputInfo and siblings, but I had to fix a few
      places that were fetching pg_type.typelem for themselves instead of
      using the lsyscache.c routines.  Also, I renamed all the related variables
      from 'typelem' to 'typioparam' to discourage people from assuming that
      they necessarily contain array element types.
      c541bb86
  19. Apr 01, 2004
    • Tom Lane's avatar
      Replace TupleTableSlot convention for whole-row variables and function · 375369ac
      Tom Lane authored
      results with tuples as ordinary varlena Datums.  This commit does not
      in itself do much for us, except eliminate the horrid memory leak
      associated with evaluation of whole-row variables.  However, it lays the
      groundwork for allowing composite types as table columns, and perhaps
      some other useful features as well.  Per my proposal of a few days ago.
      375369ac
  20. Jan 07, 2004
    • Tom Lane's avatar
      Apply the core parts of Dennis Bjorklund's patch to allow function · a77e32d7
      Tom Lane authored
      parameters to be declared with names.  pg_proc has a column to store
      names, and CREATE FUNCTION can insert data into it, but that's all as
      yet.  I need to do more work on the pg_dump and plpgsql portions of the
      patch before committing those, but I thought I'd get the bulky changes
      in before the tree drifts under me.
      initdb forced due to pg_proc change.
      a77e32d7
  21. Nov 29, 2003
    • PostgreSQL Daemon's avatar
      · 969685ad
      PostgreSQL Daemon authored
      $Header: -> $PostgreSQL Changes ...
      969685ad
  22. Sep 04, 2003
  23. Aug 04, 2003
  24. Jul 31, 2003
  25. Jul 26, 2003
  26. Apr 20, 2003
  27. Sep 21, 2002
    • Tom Lane's avatar
      Provide an upgrade strategy for dump files containing functions declared · eb3adab5
      Tom Lane authored
      with OPAQUE.  CREATE LANGUAGE, CREATE TRIGGER, and CREATE TYPE will all
      accept references to functions declared with OPAQUE --- but they will
      issue a NOTICE, and will modify the function entries in pg_proc to have
      the preferred type-safe argument or result types instead of OPAQUE.
      Per recent pghackers discussions.
      eb3adab5
  28. Sep 05, 2002
  29. Sep 04, 2002
  30. Aug 22, 2002
  31. Jun 15, 2002
  32. May 05, 2002
  33. Mar 06, 2002
  34. Jan 24, 2002
  35. Nov 05, 2001
  36. Oct 25, 2001
  37. Oct 20, 2001
Loading