1. 15 10月, 2005 1 次提交
  2. 25 8月, 2005 2 次提交
  3. 21 8月, 2005 1 次提交
  4. 13 8月, 2005 3 次提交
  5. 13 7月, 2005 1 次提交
  6. 12 7月, 2005 1 次提交
  7. 11 7月, 2005 1 次提交
  8. 10 7月, 2005 2 次提交
    • B
      Following up a previous thought I had, yesterday I realised how to · b135508c
      Bruce Momjian 提交于
      return arays nicely without having to make the plperl programmer aware
      of anything. The attached patch allows plperl to return an arrayref
      where the function returns an array type. It silently calls a perl
      function to stringify the array before passing it to the pg array
      parser. Non-array returns are handled as before (i.e. passed through
      this process) so it is backwards compatible. I will presently submit
      regression tests and docs.
      
      example:
      
      andrew=# create or replace function blah() returns text[][] language
      plperl as $$ return [['a"b','c,d'],['e\\f','g']]; $$;
      CREATE FUNCTION
      andrew=# select blah();
                  blah
      -----------------------------
       {{"a\"b","c,d"},{"e\\f",g}}
      
      
      This would complete half of the TODO item:
      
        . Pass arrays natively instead of as text between plperl and postgres
      
      (The other half is translating pg array arguments to perl arrays - that
      will have to wait for 8.1).
      
      Some of this patch is adapted from a previously submitted patch from
      Sergej Sergeev. Both he and Abhijit Menon-Sen have looked it over
      briefly and tentatively said it looks ok.
      
      Andrew Dunstan
      b135508c
    • B
      The attached patch implements spi_query() and spi_fetchrow() functions · 6d92f210
      Bruce Momjian 提交于
      for PL/Perl, to avoid loading the entire result set into memory as the
      existing spi_exec_query() function does.
      
      Here's how one might use the new functions:
      
          $x = spi_query("select ...");
          while (defined ($y = spi_fetchrow($x))) {
              ...
              return_next(...);
          }
      
      The changes do not affect the spi_exec_query() interface in any way.
      
      Abhijit Menon-Sen
      6d92f210
  9. 07 7月, 2005 2 次提交
  10. 04 7月, 2005 1 次提交
  11. 23 6月, 2005 1 次提交
  12. 15 6月, 2005 1 次提交
    • B
      > Here's a patch I added against plperl, originally against beta5, now · d0925244
      Bruce Momjian 提交于
      > against rc1. It simply checks with GetDatabaseEncoding() if the current
      > database is in UTF-8, and if so, sets the UTF-8 flag on the arguments
      > that are passed to perl. This means that it isn't necessary to
      > utf8::upgrade() every string, as perl has no way of knowing offhand
      > that a string is UTF-8 -- but postgres does, because the database
      > encoding is specified, so it makes sense to turn the flag on. You
      > should also be able to properly manipulate UTF-8 strings now from
      > plperl as opposed to plperlu, because otherwise you'd have to use
      > encoding 'utf8' which was not allowed. It could also eliminate some
      > unexpected bugs if you assume that perl knows the string is unicode.
      It
      > is enabled only for perl 5.6 and higher, so earlier versions will not
      > be affected.
      >
      > I have been assured by crab that the patch is quite harmless and will
      > not break anything. It would be great to see it in 8 final! :-)
      
      David Kamholz
      d0925244
  13. 05 6月, 2005 2 次提交
    • B
      Here's a patch to do the following: · bebe7c56
      Bruce Momjian 提交于
      1. Rename spi_return_next to return_next.
      2. Add a new test for return_next.
      3. Update the expected output.
      4. Update the documentation.
      
      Abhijit Menon-Sen
      bebe7c56
    • B
      At 2005-05-21 20:18:50 +0530, ams@oryx.com wrote: · d995014f
      Bruce Momjian 提交于
      >
      > > The second issue is where plperl returns a large result set.
      
      I have attached the following seven patches to address this problem:
      
      1. Trivial. Replaces some errant spaces with tabs.
      
      2. Trivial. Fixes the spelling of Jan's name, and gets rid of many
         inane, useless, annoying, and often misleading comments. Here's
         a sample: "plperl_init_all() - Initialize all".
      
         (I have tried to add some useful comments here and there, and will
         continue to do so now and again.)
      
      3. Trivial. Splits up some long lines.
      
      4. Converts SRFs in PL/Perl to use a Tuplestore and SFRM_Materialize
         to return the result set, based on the PL/PgSQL model.
      
         There are two major consequences: result sets will spill to disk when
         they can no longer fit in work_mem; and "select foo_srf()" no longer
         works. (I didn't lose sleep over the latter, since that form is not
         valid in PL/PgSQL, and it's not documented in PL/Perl.)
      
      5. Trivial, but important. Fixes use of "undef" instead of undef. This
         would cause empty functions to fail in bizarre ways. I suspect that
         there's still another (old) bug here. I'll investigate further.
      
      6. Moves the majority of (4) out into a new plperl_return_next()
         function, to make it possible to expose the functionality to
         Perl; cleans up some of the code besides.
      
      7. Add an spi_return_next function for use in Perl code.
      
      If you want to apply the patches and try them out, 8-composite.diff is
      what you should use. (Note: my patches depend upon Andrew's use-strict
      and %_SHARED patches being applied.)
      
      Here's something to try:
      
          create or replace function foo() returns setof record as $$
          $i = 0;
          for ("World", "PostgreSQL", "PL/Perl") {
              spi_return_next({f1=>++$i, f2=>'Hello', f3=>$_});
          }
          return;
          $$ language plperl;
          select * from foo() as (f1 integer, f2 text, f3 text);
      
      (Many thanks to Andrews Dunstan and Supernews for their help.)
      
      Abhijit Menon-Sen
      d995014f
  14. 23 5月, 2005 1 次提交
  15. 07 5月, 2005 1 次提交
  16. 02 5月, 2005 1 次提交
    • T
      Change CREATE TYPE to require datatype output and send functions to have · 6c412f06
      Tom Lane 提交于
      only one argument.  (Per recent discussion, the option to accept multiple
      arguments is pretty useless for user-defined types, and would be a likely
      source of security holes if it was used.)  Simplify call sites of
      output/send functions to not bother passing more than one argument.
      6c412f06
  17. 02 4月, 2005 1 次提交
  18. 29 3月, 2005 1 次提交
    • T
      Convert oidvector and int2vector into variable-length arrays. This · 70c9763d
      Tom Lane 提交于
      change saves a great deal of space in pg_proc and its primary index,
      and it eliminates the former requirement that INDEX_MAX_KEYS and
      FUNC_MAX_ARGS have the same value.  INDEX_MAX_KEYS is still embedded
      in the on-disk representation (because it affects index tuple header
      size), but FUNC_MAX_ARGS is not.  I believe it would now be possible
      to increase FUNC_MAX_ARGS at little cost, but haven't experimented yet.
      There are still a lot of vestigial references to FUNC_MAX_ARGS, which
      I will clean up in a separate pass.  However, getting rid of it
      altogether would require changing the FunctionCallInfoData struct,
      and I'm not sure I want to buy into that.
      70c9763d
  19. 23 2月, 2005 1 次提交
  20. 22 2月, 2005 1 次提交
  21. 15 1月, 2005 1 次提交
  22. 11 1月, 2005 1 次提交
  23. 30 11月, 2004 1 次提交
  24. 25 11月, 2004 1 次提交
  25. 23 11月, 2004 2 次提交
  26. 22 11月, 2004 2 次提交
  27. 21 11月, 2004 1 次提交
  28. 19 11月, 2004 1 次提交
  29. 18 11月, 2004 1 次提交
  30. 17 11月, 2004 1 次提交
  31. 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
  32. 08 10月, 2004 1 次提交