aboutsummaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAge
* Rename send_rfq to send_ready_for_query.Bruce Momjian2005-12-30
|
* Mmark client-side prepare/bind/execute statements with "[client]" soBruce Momjian2005-12-30
| | | | they can be easily distinguished from SQL commands.
* Add support for Solaris x86_64 using Sun's compiler.Bruce Momjian2005-12-30
| | | | Pierre Girard
* Repair EXPLAIN failure when trying to display a plan condition that involvesTom Lane2005-12-30
| | | | | | 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.
* Disallow setting ssl = on if SSL is not compiled in.Peter Eisentraut2005-12-30
|
* Index: src/pl/plpython/plpython.cNeil Conway2005-12-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | =================================================================== 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
* Get rid of the SpinLockAcquire/SpinLockAcquire_NoHoldoff distinctionTom Lane2005-12-29
| | | | | | | | | | 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.
* Move declaration of check_function_bodies to where the perl headersAndrew Dunstan2005-12-29
| | | | haven't had a chance to mangle the definition of DLLIMPORT (thanks again, perl guys).
* Revert some careless search-and-replace: "ADD" in comment text shouldNeil Conway2005-12-29
| | | | not be replaced with "ADD_P".
* Arrange to set the LC_XXX environment variables to match our localeTom Lane2005-12-28
| | | | | | setup. This protects against undesired changes in locale behavior if someone carelessly does setlocale(LC_ALL, "") (and we know who you are, perl guys).
* Update regression tests for new referential integrity error messageBruce Momjian2005-12-28
| | | | wording ("table" added).
* Fix plperl validator to honor check_function_bodies: when that is OFF,Tom Lane2005-12-28
| | | | | we want it to check the argument/result data types and no more. In particular, libperl shouldn't get initialized in this case.
* Move plpgsql's fetchArgInfo() into funcapi.c, and rename toTom Lane2005-12-28
| | | | | | | | 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.
* Mention "table" in "violates foreign key constraint" message that wasBruce Momjian2005-12-28
| | | | | lacking it. Perhaps it was suppressed because of line length considerations, but "table" should appear.
* Remove silly use of DLLIMPORT.Tom Lane2005-12-28
|
* Add COPY CSV test that tests CSV output of \.Bruce Momjian2005-12-28
|
* Add regression tests for CSV and \., and add automatic quoting of aBruce Momjian2005-12-28
| | | | | single column dump that has a \. value, so the load works properly. I also added documentation describing this issue.
* Implement SQL-compliant treatment of row comparisons for < <= > >= casesTom Lane2005-12-28
| | | | | | | | | | | | | | | | (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.
* Increase amount of shared buffers initdb tries to allocate to 4000,Andrew Dunstan2005-12-27
| | | | | and add logic to try max_fsm_pages up to 200000, plus accompanying minor docs changes.
* Our code had:Bruce Momjian2005-12-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Protect ADD and HEADER symbols from conflicting with MIPS includes.Bruce Momjian2005-12-27
|
* More uses of IS_HIGHBIT_SET() macro.Bruce Momjian2005-12-26
|
* Rename pg_make_encrypted_password to PQencryptPassword.Peter Eisentraut2005-12-26
|
* Various cosmetic code cleanup for PL/Python:Neil Conway2005-12-26
| | | | | | | | | | | | - use "bool" rather than "int" for boolean variables - use "PLy_malloc" rather than "malloc" in two places - define "PLy_strdup", and use it rather than malloc() + strcpy() in two places (which should have been memcpy(), anyway). - remove a bunch of redundant parentheses from expressions that do not need the parentheses for code clarity
* I have added these macros to c.h:Bruce Momjian2005-12-25
| | | | | | | | | #define HIGHBIT (0x80) #define IS_HIGHBIT_SET(ch) ((unsigned char)(ch) & HIGHBIT) and removed CSIGNBIT and mapped it uses to HIGHBIT. I have also added uses for IS_HIGHBIT_SET where appropriate. This change is purely for code clarity.
* Previous commit message should have been:Bruce Momjian2005-12-24
| | | | Add comment marker for PG_ENCODING_BE_LAST.
* AddBruce Momjian2005-12-24
|
* Alignment cleanup.Bruce Momjian2005-12-24
|
* Formatting cleanups.Bruce Momjian2005-12-24
|
* Formatting cleanup.Bruce Momjian2005-12-24
|
* Fix long standing Asian multibyte charsets bug.Tatsuo Ishii2005-12-24
| | | | | | | | | | | See: Subject: [HACKERS] bugs with certain Asian multibyte charsets From: Tatsuo Ishii <ishii@sraoss.co.jp> To: pgsql-hackers@postgresql.org Date: Sat, 24 Dec 2005 18:25:33 +0900 (JST) for more details/
* Wups, fat-fingered the calculation the first time. Update comment inTom Lane2005-12-23
| | | | postgresql.conf.sample too.
* Fix make_relative_path() to support cases where target_path and bin_pathTom Lane2005-12-23
| | | | | | | | | | | differ by more than the last directory component. Instead of insisting that they match up to the last component, accept whatever common prefix they have, and try to replace the non-matching part of bin_path with the non-matching part of target_path in the actual executable's path. In one way this is tighter than the old code, because it insists on a match to the part of bin_path we want to substitute for, rather than blindly stripping one directory component from the executable's path. Per gripe from Martin Pitt and subsequent discussion.
* Allow CREATE/ALTER ROLE PASSWORD NULL to allow restoring the default statePeter Eisentraut2005-12-23
| | | | of having no password.
* Fix for rearranging encoding id ISO-8859-5 to ISO-8859-8.Tatsuo Ishii2005-12-23
| | | | | | | | | Also make the code more robust by searching for target encoding in the internal charset map. Problem reported by Sagi Bashari on 2005/12/21. See "[BUGS] BUG #2120: Crash when doing UTF8<->ISO_8859_8 encoding conversion" on pgsql-bugs list for more details.
* Add an officially exported libpq function to encrypt passwords, andTom Lane2005-12-23
| | | | | modify the previous \password patch to use it instead of depending on a not-officially-exported function. Per discussion.
* Add quotes around search_path "$user" so that SHOW output can be used inBruce Momjian2005-12-23
| | | | SET.
* Adjust string comparison so that only bitwise-equal strings are consideredTom Lane2005-12-22
| | | | | | | | | | | | equal: if strcoll claims two strings are equal, check it with strcmp, and sort according to strcmp if not identical. This fixes inconsistent behavior under glibc's hu_HU locale, and probably under some other locales as well. Also, take advantage of the now-well-defined behavior to speed up texteq, textne, bpchareq, bpcharne: they may as well just do a bitwise comparison and not bother with strcoll at all. NOTE: affected databases may need to REINDEX indexes on text columns to be sure they are self-consistent.
* Teach planner how to rearrange join order for some classes of OUTER JOIN.Tom Lane2005-12-20
| | | | | | Per my recent proposal. I ended up basing the implementation on the existing mechanism for enforcing valid join orders of IN joins --- the rules for valid outer-join orders are somewhat similar.
* Add new psql command \password for changing role password with client-sidePeter Eisentraut2005-12-18
| | | | password encryption. Also alter createuser command to the same effect.
* Fix typo.Bruce Momjian2005-12-17
|
* Update s_lock.c comments.Bruce Momjian2005-12-17
|
* Update ASM comments.Bruce Momjian2005-12-17
|
* Add a note to Win32 gettimeofday() emulation, per Qingqing Zhou.Alvaro Herrera2005-12-16
|
* Rethink prior patch to filter out dead backend entries from the pgstatsTom Lane2005-12-16
| | | | | | | | file. The original code probed the PGPROC array separately for each PID, which was not good for large numbers of backends: not only is the runtime O(N^2) but most of it is spent holding ProcArrayLock. Instead, take the lock just once and copy the active PIDs into an array, then use qsort and bsearch so that the lookup time is more like O(N log N).
* Defend against crash while processing Describe Statement or Describe PortalTom Lane2005-12-14
| | | | | | messages, when client attempts to execute these outside a transaction (start one) or in a failed transaction (reject message, except for COMMIT/ROLLBACK statements which we can handle). Per report from Francisco Figueiredo Jr.
* Fix problem with whole-row Vars referencing sub-select outputs, perTom Lane2005-12-14
| | | | | example from Jim Dew. Add some simple regression tests, since this is an area we seem to break regularly :-(
* Use a proper enum for tri-valued variables.Bruce Momjian2005-12-12
|
* Document tri-valued variables in createdb, +1, -1, 0.Bruce Momjian2005-12-12
|
* Divide the lock manager's shared state into 'partitions', so as toTom Lane2005-12-11
| | | | | | | reduce contention for the former single LockMgrLock. Per my recent proposal. I set it up for 16 partitions, but on a pgbench test this gives only a marginal further improvement over 4 partitions --- we need to test more scenarios to choose the number of partitions.