1. 03 Jan, 2006 2 commits
  2. 02 Jan, 2006 5 commits
  3. 01 Jan, 2006 3 commits
  4. 31 Dec, 2005 4 commits
  5. 30 Dec, 2005 6 commits
  6. 29 Dec, 2005 6 commits
    • Neil Conway's avatar
      Index: src/pl/plpython/plpython.c · edafb4f0
      Neil Conway authored
      ===================================================================
      RCS file: /Users/neilc/postgres/cvs_root/pgsql/src/pl/plpython/plpython.c,v
      retrieving revision 1.67
      diff -c -r1.67 plpython.c
      *** src/pl/plpython/plpython.c	26 Dec 2005 04:28:48 -0000	1.67
      --- src/pl/plpython/plpython.c	29 Dec 2005 16:54:57 -0000
      ***************
      *** 2,8 ****
         * plpython.c - python as a procedural language for PostgreSQL
         *
         * This software is copyright by Andrew Bosma
      !  * but is really shameless cribbed from pltcl.c by Jan Weick, and
         * plperl.c by Mark Hollomon.
         *
         * The author hereby grants permission to use, copy, modify,
      --- 2,8 ----
         * plpython.c - python as a procedural language for PostgreSQL
         *
         * This software is copyright by Andrew Bosma
      !  * but is really shamelessly cribbed from pltcl.c by Jan Wieck, and
         * plperl.c by Mark Hollomon.
         *
         * The author hereby grants permission to use, copy, modify,
      ***************
      *** 1996,2002 ****
        	int			i,
        				rv;
        	PLyPlanObject *plan;
      - 	char	   *nulls;
        	MemoryContext oldcontext;
      
        	if (list != NULL)
      --- 1996,2001 ----
      ***************
      *** 2018,2024 ****
        	if (nargs != plan->nargs)
        	{
        		char	   *sv;
      -
        		PyObject   *so = PyObject_Str(list);
      
        		if (!so)
      --- 2017,2022 ----
      ***************
      *** 2036,2048 ****
        	oldcontext = CurrentMemoryContext;
        	PG_TRY();
        	{
      ! 		nulls = palloc(nargs * sizeof(char));
      
        		for (i = 0; i < nargs; i++)
        		{
        			PyObject   *elem,
        					   *so;
      - 			char	   *sv;
      
        			elem = PySequence_GetItem(list, i);
        			if (elem != Py_None)
      --- 2034,2045 ----
        	oldcontext = CurrentMemoryContext;
        	PG_TRY();
        	{
      ! 		char	   *nulls = palloc(nargs * sizeof(char));
      
        		for (i = 0; i < nargs; i++)
        		{
        			PyObject   *elem,
        					   *so;
      
        			elem = PySequence_GetItem(list, i);
        			if (elem != Py_None)
      ***************
      *** 2051,2070 ****
        				if (!so)
        					PLy_elog(ERROR, "function \"%s\" could not execute plan",
        							 PLy_procedure_name(PLy_curr_procedure));
      ! 				sv = PyString_AsString(so);
      
      ! 				/*
      ! 				 * FIXME -- if this elogs, we have Python reference leak
      ! 				 */
      ! 				plan->values[i] =
      ! 					FunctionCall3(&(plan->args[i].out.d.typfunc),
      ! 								  CStringGetDatum(sv),
      ! 							ObjectIdGetDatum(plan->args[i].out.d.typioparam),
      ! 								  Int32GetDatum(-1));
      
      ! 				Py_DECREF(so);
      ! 				Py_DECREF(elem);
      
        				nulls[i] = ' ';
        			}
        			else
      --- 2048,2073 ----
        				if (!so)
        					PLy_elog(ERROR, "function \"%s\" could not execute plan",
        							 PLy_procedure_name(PLy_curr_procedure));
      ! 				Py_DECREF(elem);
      
      ! 				PG_TRY();
      ! 				{
      ! 					char *sv = PyString_AsString(so);
      
      ! 					plan->values[i] =
      ! 						FunctionCall3(&(plan->args[i].out.d.typfunc),
      ! 									  CStringGetDatum(sv),
      ! 								ObjectIdGetDatum(plan->args[i].out.d.typioparam),
      ! 									  Int32GetDatum(-1));
      ! 				}
      ! 				PG_CATCH();
      ! 				{
      ! 					Py_DECREF(so);
      ! 					PG_RE_THROW();
      ! 				}
      ! 				PG_END_TRY();
      
      + 				Py_DECREF(so);
        				nulls[i] = ' ';
        			}
        			else
      edafb4f0
    • Tom Lane's avatar
      Get rid of the SpinLockAcquire/SpinLockAcquire_NoHoldoff distinction · 195f1642
      Tom Lane authored
      in favor of having just one set of macros that don't do HOLD/RESUME_INTERRUPTS
      (hence, these correspond to the old SpinLockAcquire_NoHoldoff case).
      Given our coding rules for spinlock use, there is no reason to allow
      CHECK_FOR_INTERRUPTS to be done while holding a spinlock, and also there
      is no situation where ImmediateInterruptOK will be true while holding a
      spinlock.  Therefore doing HOLD/RESUME_INTERRUPTS while taking/releasing a
      spinlock is just a waste of cycles.  Qingqing Zhou and Tom Lane.
      195f1642
    • Bruce Momjian's avatar
      Update: · e135d963
      Bruce Momjian authored
      < * Add missing rtree optimizer selectivity
      > * Improve selectivity functions for geometric operators
      e135d963
    • Andrew Dunstan's avatar
      · eb29d89f
      Andrew Dunstan authored
      Move declaration of check_function_bodies to where the perl headers
      haven't had a chance to mangle the definition of DLLIMPORT (thanks again, perl guys).
      eb29d89f
    • Neil Conway's avatar
      Revert some careless search-and-replace: "ADD" in comment text should · 12119188
      Neil Conway authored
      not be replaced with "ADD_P".
      12119188
    • Bruce Momjian's avatar
      Remove a space that incorrectly precedes a comma in the PL/pgSQL · be6187e1
      Bruce Momjian authored
      documentation.
      
      Michael Fuhr
      be6187e1
  7. 28 Dec, 2005 12 commits
  8. 27 Dec, 2005 2 commits
    • Andrew Dunstan's avatar
      · a37422e0
      Andrew Dunstan authored
      Increase amount of shared buffers initdb tries to allocate to 4000,
      and add logic to try max_fsm_pages up to 200000, plus accompanying minor
      docs changes.
      a37422e0
    • Bruce Momjian's avatar
      Our code had: · a598385f
      Bruce Momjian authored
                      if (c == '\\' && cstate->line_buf.len == 0)
      
      The problem with that is the because of the input and _output_
      buffering, cstate->line_buf.len could be zero even if we are not on the
      first character of a line.  In fact, for a typical line, it is zero for
      all characters on the line.  The proper solution is to introduce a
      boolean, first_char_in_line, that we set as we enter the loop and clear
      once we process a character.
      
      I have restructured the line-reading code in copy.c by:
      
              o  merging the CSV/non-CSV functions into a single function
              o  used macros to centralize and clarify the buffering code
              o  updated comments
              o  renamed client_encoding_only to encoding_embeds_ascii
              o  added a high-bit test to the encoding_embeds_ascii test for
                 performance
              o  in CSV mode, allow a backslash followed by a non-period to
                 continue being processed as a data value
      
      There should be no performance impact from this patch because it is
      functionally equivalent.  If you apply the patch you will see copy.c is
      much clearer in this area now and might suggest additional
      optimizations.
      
      I have also attached a 8.1-only patch to fix the CSV \. handling bug
      with no code restructuring.
      a598385f