Commit Graph

21758 Commits

Author SHA1 Message Date
Bruce Momjian 44f9021223 Remove BEOS port. 2006-01-05 03:01:38 +00:00
Bruce Momjian 6f84b2da75 Remove QNX file. 2006-01-05 02:43:38 +00:00
Bruce Momjian a1675649e4 Remove QNX port. 2006-01-05 01:56:30 +00:00
Tom Lane 349f40b2c2 Rearrange backend startup sequence so that ShmemIndexLock can become
an LWLock instead of a spinlock.  This hardly matters on Unix machines
but should improve startup performance on Windows (or any port using
EXEC_BACKEND).  Per previous discussion.
2006-01-04 21:06:32 +00:00
Tom Lane e0078ea22d Fix another case in which autovacuum would fail while analyzing
expressional indexes.  Per report from Brian Hirt.
2006-01-04 19:16:24 +00:00
Tom Lane 507e07e277 There is a signedness bug in Openwall gen_salt code that pgcrypto uses.
This makes the salt space for md5 and xdes algorithms a lot smaller than
it should be.

Marko Kreen
2006-01-03 23:46:24 +00:00
Joe Conway 925952603d When the remote query result has a different number of columns
than the local query specifies (e.g. in the FROM clause),
throw an ERROR (instead of crashing). Fix for bug #2129 reported
by Akio Iwaasa.
2006-01-03 23:45:52 +00:00
Tom Lane 71ad8e2077 Fix incorrect treatment of RL_PROMPT_START_IGNORE/RL_PROMPT_END_IGNORE,
per http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=343616 via Martin Pitt.
2006-01-03 23:32:30 +00:00
Tom Lane 41ec930d7c Add checks to verify that a plpgsql function returning a rowtype is actually
returning the rowtype it's supposed to return.  Per reports from David Niblett
and Michael Fuhr.
2006-01-03 22:48:10 +00:00
Bruce Momjian 75bb2b611d Assume select() might modify struct timeout, so remove previous
optimization.
2006-01-03 19:54:08 +00:00
Bruce Momjian 447450df71 Use setitimer() for stats file write, rather than do a gettimeofday()
call for every stats packet read to adjust select() timeout.  Other
stylistic improvements.
2006-01-03 16:42:17 +00:00
Tom Lane fd924b2988 Don't assume that LC_MESSAGES is always available on WIN32. Per Magnus. 2006-01-02 20:25:45 +00:00
Tom Lane 499f4d5e1e Reset flex state in a way that works for both flex 2.5.4 and 2.5.31. 2006-01-02 19:55:25 +00:00
Andrew Dunstan 14d6c9fe6f Remove the nexus between trial_buffs and trial_conns, and don't test shared buffers lower than or equal to a value we already know is good, but use that value instead. This will make it easier to adjust the trial values and/or formulae in future if necessary. 2006-01-02 16:45:12 +00:00
Bruce Momjian bb1bba8eca Remove unnecessary assignment, per Tom. 2006-01-02 03:30:41 +00:00
Bruce Momjian 9625b18493 Change if (!(x || y)) construct with if (!x && !y), for clarity. 2006-01-02 00:58:00 +00:00
Tom Lane fc6da31ae1 Rewrite ProcessConfigFile() to avoid misbehavior at EOF, as per report
from Andrus Moor.  The former state-machine-style coding wasn't actually
doing much except obscuring the control flow, and it didn't extend
readily to fix this case, so I just took it out.  Also, add a
YY_FLUSH_BUFFER call to ensure the lexer is reset correctly if the
previous scan failed partway through the file.
2006-01-01 19:52:40 +00:00
Neil Conway 0898033b1e Remove DOS line endings ("\r\n") from several .po files. DOS line endings
are inconsistent with the rest of the .po files, and apparently cause
problems for Sun's cc. Per report on IRC from "bitvector2".
2006-01-01 10:13:56 +00:00
Neil Conway c20a9f25af Trim an obsolete comment: it is no longer relevant that "SELECT" was
formerly "RETRIEVE", and so forth.
2006-01-01 01:41:42 +00:00
Tom Lane bcb26d74cb Clean up initdb's code for selecting max_connections and shared_buffers
a little bit, and set the minimum buffers-per-connection ratio to 10 not
5.  I folded the two test routines into one to counteract the illusion
that the tests can be twiddled independently, and added some documentation
pointing out the necessary connection between the sets of values tested.
Fixes strange choices of parameters that I noticed CVS tip making on
Darwin with Apple's undersized default SHMMAX.
2005-12-31 23:50:59 +00:00
Bruce Momjian dbf53e6345 Rename variable to cmd_str. 2005-12-31 19:39:11 +00:00
Bruce Momjian ba3e1cb8c2 Rename variable 'what' to 'stat_msg'. 2005-12-31 17:46:19 +00:00
Bruce Momjian 206499d2fb Prefix client-side prepare with '[protocol]' rather than '[client]'. 2005-12-31 16:50:44 +00:00
Bruce Momjian a8a93f72c5 Rename send_rfq to send_ready_for_query. 2005-12-30 23:49:48 +00:00
Bruce Momjian c86be11ddc Mmark client-side prepare/bind/execute statements with "[client]" so
they can be easily distinguished from SQL commands.
2005-12-30 22:55:20 +00:00
Bruce Momjian 12af9cdff4 Add support for Solaris x86_64 using Sun's compiler.
Pierre Girard
2005-12-30 21:43:41 +00:00
Tom Lane c876d965f5 Repair EXPLAIN failure when trying to display a plan condition that involves
selection of a field from the result of a function returning RECORD.
I believe this case is new in 8.1; it's due to the addition of OUT parameters.
Per example from Michael Fuhr.
2005-12-30 18:34:22 +00:00
Bruce Momjian 7211ff7d32 Add:
> * Make CLUSTER preserve recently-dead tuples per MVCC requirements
2005-12-30 03:24:58 +00:00
Peter Eisentraut 810530020f Disallow setting ssl = on if SSL is not compiled in. 2005-12-30 00:13:50 +00:00
Neil Conway edafb4f037 Index: src/pl/plpython/plpython.c
===================================================================
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
2005-12-29 21:47:32 +00:00
Tom Lane 195f164228 Get rid of the SpinLockAcquire/SpinLockAcquire_NoHoldoff distinction
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.
2005-12-29 18:08:05 +00:00
Bruce Momjian e135d9631b Update:
< * Add missing rtree optimizer selectivity
> * Improve selectivity functions for geometric operators
2005-12-29 16:45:11 +00:00
Andrew Dunstan eb29d89ffd 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).
2005-12-29 14:28:31 +00:00
Neil Conway 12119188fe Revert some careless search-and-replace: "ADD" in comment text should
not be replaced with "ADD_P".
2005-12-29 04:53:18 +00:00
Bruce Momjian be6187e1c2 Remove a space that incorrectly precedes a comma in the PL/pgSQL
documentation.

Michael Fuhr
2005-12-29 04:02:32 +00:00
Tom Lane ab51bbaa06 Arrange to set the LC_XXX environment variables to match our locale
setup.  This protects against undesired changes in locale behavior
if someone carelessly does setlocale(LC_ALL, "") (and we know who
you are, perl guys).
2005-12-28 23:22:51 +00:00
Bruce Momjian b6c881ce62 Update regression tests for new referential integrity error message
wording ("table" added).
2005-12-28 23:17:09 +00:00
Tom Lane c104cd2038 Fix plperl validator to honor check_function_bodies: when that is OFF,
we want it to check the argument/result data types and no more.  In
particular, libperl shouldn't get initialized in this case.
2005-12-28 18:34:16 +00:00
Tom Lane 15093bf2d8 Move plpgsql's fetchArgInfo() into funcapi.c, and rename to
get_func_arg_info() for consistency with other names there.
This code will probably be useful to other PLs when they start to
support OUT parameters, so better to have it in the main backend.
Also, fix plpgsql validator to detect bogus OUT parameters even when
check_function_bodies is off.
2005-12-28 18:11:25 +00:00
Bruce Momjian 776d63f975 Mention "table" in "violates foreign key constraint" message that was
lacking it.  Perhaps it was suppressed because of line length
considerations, but "table" should appear.
2005-12-28 16:47:21 +00:00
Tom Lane a4e5169994 Remove silly use of DLLIMPORT. 2005-12-28 16:38:38 +00:00
Bruce Momjian 54e5caa440 Add COPY CSV test that tests CSV output of \. 2005-12-28 15:07:02 +00:00
Bruce Momjian 9c72df4e86 Update COPY CSV \. wording for externally created files. 2005-12-28 14:38:32 +00:00
Bruce Momjian 6fa335721a Update:
< * Add missing optimizer selectivities for date, r-tree, etc
> * Add missing rtree optimizer selectivity
2005-12-28 03:59:39 +00:00
Bruce Momjian 87289ff35c Add regression tests for CSV and \., and add automatic quoting of a
single column dump that has a \. value, so the load works properly.  I
also added documentation describing this issue.
2005-12-28 03:25:32 +00:00
Bruce Momjian 1b184c990f Done:
< * %Make row-wise comparisons work per SQL spec
> * -Make row-wise comparisons work per SQL spec
2005-12-28 02:12:25 +00:00
Tom Lane 6e07709760 Implement SQL-compliant treatment of row comparisons for < <= > >= cases
(previously we only did = and <> correctly).  Also, allow row comparisons
with any operators that are in btree opclasses, not only those with these
specific names.  This gets rid of a whole lot of indefensible assumptions
about the behavior of particular operators based on their names ... though
it's still true that IN and NOT IN expand to "= ANY".  The patch adds a
RowCompareExpr expression node type, and makes some changes in the
representation of ANY/ALL/ROWCOMPARE SubLinks so that they can share code
with RowCompareExpr.

I have not yet done anything about making RowCompareExpr an indexable
operator, but will look at that soon.

initdb forced due to changes in stored rules.
2005-12-28 01:30:02 +00:00
Andrew Dunstan a37422e042 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.
2005-12-27 23:54:01 +00:00
Bruce Momjian a598385f3b Our code had:
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.
2005-12-27 18:10:48 +00:00
Bruce Momjian a4a4b8bb02 Protect ADD and HEADER symbols from conflicting with MIPS includes. 2005-12-27 04:00:08 +00:00