Skip to content
Snippets Groups Projects
  1. Jan 26, 2011
    • Peter Eisentraut's avatar
      Fix compiler warnings · ddf8c168
      Peter Eisentraut authored
      Older versions of GCC appear to report these with the current standard
      option set, newer versions need -Wformat-security.
      ddf8c168
  2. Jan 24, 2011
  3. Jan 23, 2011
  4. Jan 22, 2011
    • Peter Eisentraut's avatar
      Get rid of the global variable holding the error state · 116ce2f4
      Peter Eisentraut authored
      Global error handling led to confusion and was hard to manage.  With
      this change, errors from PostgreSQL are immediately reported to Python
      as exceptions.  This requires setting a Python exception after
      reporting the caught PostgreSQL error as a warning, because PLy_elog
      destroys the Python exception state.
      
      Ideally, all places where PostgreSQL errors need to be reported back
      to Python should be wrapped in subtransactions, to make going back to
      Python from a longjmp safe.  This will be handled in a separate patch.
      
      Jan Urbański
      116ce2f4
  5. Jan 21, 2011
    • Peter Eisentraut's avatar
      Correctly add exceptions to the plpy module for Python 3 · 4609caf3
      Peter Eisentraut authored
      The way the exception types where added to the module was wrong for
      Python 3.  Exception classes were not actually available from plpy.
      Fix that by factoring out code that is responsible for defining new
      Python exceptions and make it work with Python 3.  New regression test
      makes sure the plpy module has the expected contents.
      
      Jan Urbanśki, slightly revised by me
      4609caf3
  6. Jan 20, 2011
  7. Jan 19, 2011
  8. Jan 18, 2011
  9. Jan 17, 2011
    • Peter Eisentraut's avatar
      Use HTABs instead of Python dictionary objects to cache procedures · 46211da1
      Peter Eisentraut authored
      Two separate hash tables are used for regular procedures and for
      trigger procedures, since the way trigger procedures work is quite
      different from normal stored procedures.  Change the signatures of
      PLy_procedure_{get,create} to accept the function OID and a Boolean
      flag indicating whether it's a trigger.  This should make implementing
      a PL/Python validator easier.
      
      Using HTABs instead of Python dictionaries makes error recovery
      easier, and allows for procedures to be cached based on their OIDs,
      not their names.  It also allows getting rid of the PyCObject field
      that used to hold a pointer to PLyProcedure, since PyCObjects are
      deprecated in Python 2.7 and replaced by Capsules in Python 3.
      
      Jan Urbański
      46211da1
    • Alvaro Herrera's avatar
      Increment Py_None refcount for NULL array elements · 978445be
      Alvaro Herrera authored
      Per bug #5835 by Julien Demoor
      Author: Alex Hunsaker
      978445be
  10. Nov 15, 2010
    • Tom Lane's avatar
      Fix aboriginal mistake in plpython's set-returning-function support. · add0ea88
      Tom Lane authored
      We must stay in the function's SPI context until done calling the iterator
      that returns the set result.  Otherwise, any attempt to invoke SPI features
      in the python code called by the iterator will malfunction.  Diagnosis and
      patch by Jan Urbanski, per bug report from Jean-Baptiste Quenot.
      
      Back-patch to 8.2; there was no support for SRFs in previous versions of
      plpython.
      add0ea88
  11. Oct 12, 2010
  12. Oct 10, 2010
    • Tom Lane's avatar
      Support triggers on views. · 2ec993a7
      Tom Lane authored
      This patch adds the SQL-standard concept of an INSTEAD OF trigger, which
      is fired instead of performing a physical insert/update/delete.  The
      trigger function is passed the entire old and/or new rows of the view,
      and must figure out what to do to the underlying tables to implement
      the update.  So this feature can be used to implement updatable views
      using trigger programming style rather than rule hacking.
      
      In passing, this patch corrects the names of some columns in the
      information_schema.triggers view.  It seems the SQL committee renamed
      them somewhere between SQL:99 and SQL:2003.
      
      Dean Rasheed, reviewed by Bernd Helmle; some additional hacking by me.
      2ec993a7
  13. Oct 08, 2010
    • Tom Lane's avatar
      Fix sloppy usage of TRIGGER_FIRED_BEFORE/TRIGGER_FIRED_AFTER. · caaf2e84
      Tom Lane authored
      Various places were testing TRIGGER_FIRED_BEFORE() where what they really
      meant was !TRIGGER_FIRED_AFTER(), or vice versa.  This needs to be cleaned
      up because there are about to be more than two possible states.
      
      We might want to note this in the 9.1 release notes as something for
      trigger authors to double-check.
      
      For consistency's sake I also changed some places that assumed that
      TRIGGER_FIRED_FOR_ROW and TRIGGER_FIRED_FOR_STATEMENT are necessarily
      mutually exclusive; that's not in immediate danger of breaking, but
      it's still sloppier than it should be.
      
      Extracted from Dean Rasheed's patch for triggers on views.  I'm committing
      this separately since it's an identifiable separate issue, and is the
      only reason for the patch to touch most of these particular files.
      caaf2e84
  14. Sep 20, 2010
  15. Aug 25, 2010
  16. Jul 08, 2010
  17. Jul 06, 2010
  18. Jun 29, 2010
  19. Jun 10, 2010
  20. May 01, 2010
  21. Apr 30, 2010
    • Tom Lane's avatar
      Fix multiple memory leaks in PLy_spi_execute_fetch_result: it would leak · b1bc2f04
      Tom Lane authored
      memory if the result had zero rows, and also if there was any sort of error
      while converting the result tuples into Python data.  Reported and partially
      fixed by Andres Freund.
      
      Back-patch to all supported versions.  Note: I haven't tested the 7.4 fix.
      7.4's configure check for python is so obsolete it doesn't work on my
      current machines :-(.  The logic change is pretty straightforward though.
      b1bc2f04
  22. Mar 18, 2010
  23. Feb 26, 2010
  24. Feb 19, 2010
  25. Feb 14, 2010
    • Robert Haas's avatar
      Wrap calls to SearchSysCache and related functions using macros. · e26c539e
      Robert Haas authored
      The purpose of this change is to eliminate the need for every caller
      of SearchSysCache, SearchSysCacheCopy, SearchSysCacheExists,
      GetSysCacheOid, and SearchSysCacheList to know the maximum number
      of allowable keys for a syscache entry (currently 4).  This will
      make it far easier to increase the maximum number of keys in a
      future release should we choose to do so, and it makes the code
      shorter, too.
      
      Design and review by Tom Lane.
      e26c539e
  26. Jan 22, 2010
    • Peter Eisentraut's avatar
      PL/Python DO handler · adb77640
      Peter Eisentraut authored
      Also cleaned up some redundancies between the primary error messages and the
      error context in PL/Python.
      
      Hannu Valtonen
      adb77640
  27. Jan 16, 2010
    • Peter Eisentraut's avatar
      Improved printing of Python exceptions in PL/Python · 44e03742
      Peter Eisentraut authored
      Mimic the Python interpreter's own logic for printing exceptions instead
      of just using the straight str() call, so that
      you get
      
          plpy.SPIError
      
      instead of
      
          <class 'plpy.SPIError'>
      
      and for built-in exceptions merely
      
          UnicodeEncodeError
      
      Besides looking better this cuts down on the endless version differences
      in the regression test expected files.
      44e03742
  28. Dec 15, 2009
    • Peter Eisentraut's avatar
      Python 3 support in PL/Python · dd4cd55c
      Peter Eisentraut authored
      Behaves more or less unchanged compared to Python 2, but the new language
      variant is called plpython3u.  Documentation describing the naming scheme
      is included.
      dd4cd55c
  29. Dec 10, 2009
Loading