1. 22 11月, 2004 1 次提交
    • T
      Fix plperl and pltcl error handling per my previous proposal. SPI · 35f49941
      Tom Lane 提交于
      operations are now run as subtransactions, so that errors in them
      can be reported as ordinary Perl or Tcl errors and caught by the
      normal error handling convention of those languages.  Also do some
      minor code cleanup in pltcl.c: extract a large chunk of duplicated
      code in pltcl_SPI_execute and pltcl_SPI_execute_plan into a shared
      subroutine.
      35f49941
  2. 21 11月, 2004 1 次提交
  3. 19 11月, 2004 1 次提交
  4. 18 11月, 2004 1 次提交
  5. 17 11月, 2004 1 次提交
  6. 16 10月, 2004 1 次提交
    • B
      I have attached 5 patches (split up for ease of review) to plperl.c. · ce1c2024
      Bruce Momjian 提交于
      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
  7. 08 10月, 2004 1 次提交
  8. 07 10月, 2004 2 次提交
  9. 14 9月, 2004 1 次提交
    • T
      Redesign query-snapshot timing so that volatile functions in READ COMMITTED · b2c40712
      Tom Lane 提交于
      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
  10. 30 8月, 2004 1 次提交
  11. 29 8月, 2004 1 次提交
  12. 31 7月, 2004 1 次提交
  13. 22 7月, 2004 1 次提交
  14. 12 7月, 2004 1 次提交
    • B
      The attached patch, which incorporates the previous one sent and · 96b9dc1a
      Bruce Momjian 提交于
      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
  15. 02 7月, 2004 1 次提交
    • J
      plperl update from Andrew Dunstan, deriving (I believe) from Command Prompt's · 1732cb0d
      Joe Conway 提交于
      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
  16. 06 6月, 2004 1 次提交
    • T
      Infrastructure for I/O of composite types: arrange for the I/O routines · c541bb86
      Tom Lane 提交于
      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
  17. 02 4月, 2004 1 次提交
    • T
      Replace TupleTableSlot convention for whole-row variables and function · 375369ac
      Tom Lane 提交于
      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
  18. 07 1月, 2004 1 次提交
    • T
      Apply the core parts of Dennis Bjorklund's patch to allow function · a77e32d7
      Tom Lane 提交于
      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
  19. 30 11月, 2003 1 次提交
    • P
      · 969685ad
      PostgreSQL Daemon 提交于
      $Header: -> $PostgreSQL Changes ...
      969685ad
  20. 04 9月, 2003 1 次提交
  21. 04 8月, 2003 1 次提交
  22. 01 8月, 2003 1 次提交
  23. 26 7月, 2003 1 次提交
  24. 21 4月, 2003 1 次提交
  25. 22 9月, 2002 1 次提交
    • T
      Provide an upgrade strategy for dump files containing functions declared · eb3adab5
      Tom Lane 提交于
      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
  26. 05 9月, 2002 2 次提交
  27. 22 8月, 2002 1 次提交
  28. 16 6月, 2002 1 次提交
    • B
      This patch wraps all accesses to t_xmin, t_cmin, t_xmax, and t_cmax in · 3c35face
      Bruce Momjian 提交于
      HeapTupleHeaderData in setter and getter macros called
      HeapTupleHeaderGetXmin, HeapTupleHeaderSetXmin etc.
      
      It also introduces a "virtual" field xvac by defining
      HeapTupleHeaderGetXvac and HeapTupleHeaderSetXvac.  Xvac is used by
      VACUUM, in fact it is stored in t_cmin.
      
      Manfred Koizar
      3c35face
  29. 05 5月, 2002 1 次提交
  30. 07 3月, 2002 1 次提交
  31. 25 1月, 2002 2 次提交
  32. 06 11月, 2001 1 次提交
  33. 25 10月, 2001 1 次提交
  34. 20 10月, 2001 1 次提交
  35. 07 10月, 2001 1 次提交
    • T
      Rearrange fmgr.c and relcache so that it's possible to keep FmgrInfo · 85801a4d
      Tom Lane 提交于
      lookup info in the relcache for index access method support functions.
      This makes a huge difference for dynamically loaded support functions,
      and should save a few cycles even for built-in ones.  Also tweak dfmgr.c
      so that load_external_function is called only once, not twice, when
      doing fmgr_info for a dynamically loaded function.  All per performance
      gripe from Teodor Sigaev, 5-Oct-01.
      85801a4d
  36. 19 6月, 2001 1 次提交
    • B
      Well, after persuading cvsup and cvs that it _is_ possible to have local · 0ed7864d
      Bruce Momjian 提交于
      modifiable repositories, I have a clean untrusted plperl patch to offer
      you :)
      
      Highlights:
      * There's one perl interpreter used for both trusted and untrusted
      procedures. I do think its unnecessary to keep two perl
      interpreters around. If someone can break out from trusted "Safe" perl
      mode, well, they can do what they want already. If someone disagrees, I
      can change this.
      
      * Opcode is not statically loaded anymore. Instead, we load Dynaloader,
      which then can grab Opcode (and anything else you can 'use') on its own.
      
      * Checked to work on FreeBSD 4.3 + perl 5.5.3 , OpenBSD 2.8 + perl5.6.1,
      RedHat 6.2 + perl 5.5.3
      
      * Uses ExtUtils::Embed to find what options are necessary to link with
      perl shared libraries
      
      * createlang is also updated, it can create untrusted perl using 'plperlu'
      
      * Example script (assuming you have Mail::Sendmail installed):
      create function foo() returns text as '
               use Mail::Sendmail;
      
               %mail = ( To      => q(you@yourname.com),
                         From    => q(me@here.com),
                         Message => "This is a very short message"
                        );
               sendmail(%mail) or die $Mail::Sendmail::error;
      return          "OK. Log says:\n", $Mail::Sendmail::log;
      ' language 'plperlu';
      
      Alex Pilosov
      0ed7864d
  37. 09 6月, 2001 1 次提交