aboutsummaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAge
...
* Fix qual_is_pushdown_safe to not try to push down quals involving a whole-rowTom Lane2006-02-13
| | | | | | Var referencing the subselect output. While this case could possibly be made to work, it seems not worth expending effort on. Per report from Magnus Naeslund(f).
* Fix bug in SET SESSION AUTHORIZATION that allows unprivileged users to crashTom Lane2006-02-12
| | | | | the server, if it has been compiled with Asserts enabled (CVE-2006-0553). Thanks to Akio Ishida for reporting this problem.
* Stamp releases for 2006-02-14 releaseBruce Momjian2006-02-12
|
* Check that SID is enabled while checking for Windows admin privileges.Tom Lane2006-02-10
| | | | Magnus
* Change search for default operator classes so that it examines all opclassesTom Lane2006-02-10
| | | | | | | | | | regardless of the current schema search path. Since CREATE OPERATOR CLASS only allows one default opclass per datatype regardless of schemas, this should have minimal impact, and it fixes problems with failure to find a desired opclass while restoring dump files. Per discussion at http://archives.postgresql.org/pgsql-hackers/2006-02/msg00284.php. Remove now-redundant-or-unused code in typcache.c and namespace.c, and backpatch as far as 8.0.
* Provide the libpq error message when PQputline or PQendcopy fails.Tom Lane2006-02-09
|
* Reject out-of-range dates in date_in().Tom Lane2006-02-09
| | | | Kris Jurka
* Fix pg_restore to properly discard COPY data when trying to continueTom Lane2006-02-05
| | | | | | | after an error in a COPY statement. Formerly it thought the COPY data was SQL commands, and got quite confused. Stephen Frost
* Fix const cast in get_progname().Bruce Momjian2006-02-01
| | | | Backpatch.
* Set progname early in the postmaster/postgres binary, rather than doingBruce Momjian2006-02-01
| | | | | | | | | | it later. This fixes a problem where EXEC_BACKEND didn't have progname set, causing a segfault if log_min_messages was set below debug2 and our own snprintf.c was being used. Also alway strdup() progname. Backpatch to 8.1.X and 8.0.X.
* Fix ALTER COLUMN TYPE bug: it sometimes tried to drop UNIQUE or PRIMARY KEYTom Lane2006-01-30
| | | | | constraints before FOREIGN KEY constraints that depended on them. Originally reported by Neil Conway on 29-Jun-2005. Patch by Nakano Yoshihisa.
* Undo perl's nasty locale setting on Windows. Since we can't do that asAndrew Dunstan2006-01-28
| | | | | elsewhere by setting the environment appropriately, we make perl do it right after interpreter startup by calling its POSIX::setlocale().
* Fix display of whole-row Var appearing at the top level of a SELECT list.Tom Lane2006-01-26
| | | | | | | | While we normally prefer the notation "foo.*" for a whole-row Var, that does not work at SELECT top level, because in that context the parser will assume that what is wanted is to expand the "*" into a list of separate target columns, yielding behavior different from a whole-row Var. We have to emit just "foo" instead in that context. Per report from Sokolov Yura.
* Repair longstanding bug in slru/clog logic: it is possible for two backendsTom Lane2006-01-21
| | | | | | | | | | to try to create a log segment file concurrently, but the code erroneously specified O_EXCL to open(), resulting in a needless failure. Before 7.4, it was even a PANIC condition :-(. Correct code is actually simpler than what we had, because we can just say O_CREAT to start with and not need a second open() call. I believe this accounts for several recent reports of hard-to-reproduce "could not create file ...: File exists" errors in both pg_clog and pg_subtrans.
* Remove $(DESTDIR) from the pgxs BE_DLLLIBS= -L path for Darwin.Bruce Momjian2006-01-19
|
* Remove $(DESTDIR) from the pgxs BE_DLLLIBS= -L path.Bruce Momjian2006-01-19
|
* Avoid crashing if relcache flush occurs while trying to load data into anTom Lane2006-01-19
| | | | | | | | | | | | | | | index's support-function cache (in index_getprocinfo). Since none of that data can change for an index that's in active use, it seems sufficient to treat all open indexes the same way we were treating "nailed" system indexes --- that is, just re-read the pg_class row and leave the rest of the relcache entry strictly alone. The pg_class re-read might not be strictly necessary either, but since the reltablespace and relfilenode can change in normal operation it seems safest to do it. (We don't support changing any of the other info about an index at all, at the moment.) Back-patch as far as 8.0. It might be possible to adapt the patch to 7.4, but it would take more work than I care to expend for such a low-probability problem. 7.3 is out of luck for sure.
* Fix pgxs -L library path specification for Win32 and Cygwin, was /bin,Bruce Momjian2006-01-19
| | | | now /lib.
* It turns out that TablespaceCreateDbspace fails badly if a relcache flushTom Lane2006-01-19
| | | | | | | | | | | | | | occurs when it tries to heap_open pg_tablespace. When control returns to smgrcreate, that routine will be holding a dangling pointer to a closed SMgrRelation, resulting in mayhem. This is of course a consequence of the violation of proper module layering inherent in having smgr.c call a tablespace command routine, but the simplest fix seems to be to change the locking mechanism. There's no real need for TablespaceCreateDbspace to touch pg_tablespace at all --- it's only opening it as a way of locking against a parallel DROP TABLESPACE command. A much better answer is to create a special-purpose LWLock to interlock these two operations. This drops TablespaceCreateDbspace quite a few layers down the food chain and makes it something reasonably safe for smgr to call.
* Repair problems with the result of lookup_rowtype_tupdesc() possibly beingTom Lane2006-01-17
| | | | | | | discarded by cache flush while still in use. This is a minimal patch that just copies the tupdesc anywhere it could be needed across a flush. Applied to back branches only; Neil Conway is working on a better long-term solution for HEAD.
* When using GCC on AMD64 and PPC, ECPGget_variable() takes a va_list *, notNeil Conway2006-01-15
| | | | | | a va_list. Christof Petig's previous patch made this change, but neglected to update ecpglib/descriptor.c, resulting in a compiler warning (and a likely runtime crash) on AMD64 and PPC.
* Fix pg_ctl crash on "unregister" when a data directory is not specified.Peter Eisentraut2006-01-14
| | | | by Magnus Hagander
* We neglected to apply domain constraints on UNKNOWN parameters toNeil Conway2006-01-12
| | | | prepared statements, per report from David Wheeler.
* Repair "Halloween problem" in EvalPlanQual: a tuple that's been inserted byTom Lane2006-01-12
| | | | | | | | our own command (or more generally, xmin = our xact and cmin >= current command ID) should not be seen as good. Else we may try to update rows we already updated. This error was inserted last August while fixing the even bigger problem that the old coding wouldn't see *any* tuples inserted by our own transaction as good. Per report from Euler Taveira de Oliveira.
* Fix pg_tzset() to ensure that 'lclmem' (the static variable holdingTom Lane2006-01-10
| | | | | | | | | the localtime timezone data) is not overwritten until we know the data is good. tzload() is capable of failing after having begun modifying the struct it's pointed at, and in such cases the static data was left in a corrupt state. Bug does not exist pre-8.0 (since we didn't have this code then) nor post-8.0 (since we already changed the code to tzload into local variables initially). Per report from Nick Martens.
* In PLy_function_build_args(), the code loops repeatedly, constructingNeil Conway2006-01-10
| | | | | | | | | | | | | | | | one argument at a time and then inserting the argument into a Python list via PyList_SetItem(). This "steals" the reference to the argument: that is, the reference to the new list member is now held by the Python list itself. This works fine, except if an elog occurs. This causes the function's PG_CATCH() block to be invoked, which decrements the reference counts on both the current argument and the list of arguments. If the elog happens to occur during the second or subsequent iteration of the loop, the reference count on the current argument will be decremented twice. The fix is simple: set the local pointer to the current argument to NULL immediately after adding it to the argument list. This ensures that the Py_XDECREF() in the PG_CATCH() block doesn't double-decrement.
* Fix pg_dump to add the required OPERATOR() decoration to schema-qualifiedTom Lane2006-01-09
| | | | | | operator names. This is needed when dumping operator definitions that have COMMUTATOR (or similar) links to operators in other schemas. Apparently Daniel Whitter is the first person ever to try this :-(
* Stop perl from hijacking stdio and other stuff on Windows.Andrew Dunstan2006-01-08
|
* Add RelationOpenSmgr() calls to ensure rd_smgr is valid when we try toTom Lane2006-01-07
| | | | | | use it. While it normally has been opened earlier during btree index build, testing shows that it's possible for the link to be closed again if an sinval reset occurs while the index is being built.
* Fix failure to apply domain constraints to a NULL constant that's added toTom Lane2006-01-06
| | | | an INSERT target list during rule rewriting. Per report from John Supplee.
* Fix Windows-only postmaster code to reject a connection request and continue,Tom Lane2006-01-06
| | | | | | | rather than elog(FATAL), when there is no more room in ShmemBackendArray. This is a security issue since too many connection requests arriving close together could cause the postmaster to shut down, resulting in denial of service. Reported by Yoshiyuki Asaba, fixed by Magnus Hagander.
* Convert Assert checking for empty page into a regular test and elog.Tom Lane2006-01-06
| | | | | The consequences of overwriting a non-empty page are bad enough that we should not omit this test in production builds.
* Fix ReadBuffer() to correctly handle the case where it's trying to extendTom Lane2006-01-06
| | | | | | | | | the relation but it finds a pre-existing valid buffer. The buffer does not correspond to any page known to the kernel, so we *must* do smgrextend to ensure that the space becomes allocated. The 7.x branches all do this correctly, but the corner case got lost somewhere during 8.0 bufmgr rewrites. (My fault no doubt :-( ... I think I assumed that such a buffer must be not-BM_VALID, which is not so.)
* Stamp relesae 8.0.6.Bruce Momjian2006-01-05
|
* Arrange to set the LC_XXX environment variables to match our locale setup.Tom Lane2006-01-05
| | | | Back-patch of previous fix in HEAD for plperl-vs-locale issue.
* Fix incorrect treatment of RL_PROMPT_START_IGNORE/RL_PROMPT_END_IGNORE,Tom Lane2006-01-03
| | | | per http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=343616 via Martin Pitt.
* Add checks to verify that a plpgsql function returning a rowtype is actuallyTom Lane2006-01-03
| | | | | returning the rowtype it's supposed to return. Per reports from David Niblett and Michael Fuhr.
* Remove DOS line endings ("\r\n") from several .po files. DOS line endingsNeil Conway2006-01-01
| | | | | are inconsistent with the rest of the .po files, and apparently cause problems for Sun's cc. Per report on IRC from "bitvector2".
* 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
* 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.
* 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.
* 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.
* 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 a *different* problem with whole-row Vars afflicting 8.0 branch.Tom Lane2005-12-14
| | | | This is a back-port of a fix made to markTargetListOrigin() on 2005-04-25.
* Translation updatesREL8_0_5Peter Eisentraut2005-12-09
|
* Stamp 8.0.5.Tom Lane2005-12-09
|
* Fix bgwriter's failure to release buffer pins and open files after anTom Lane2005-12-08
| | | | | error. This probably explains bug #2099 and could also account for mysterious VACUUM hangups.
* In a nestloop inner indexscan, it's OK to use pushed-down baserestrictinfoTom Lane2005-12-06
| | | | | | clauses even if it's an outer join. This is a corner case since such clauses could only arise from weird OUTER JOIN ON conditions, but worth fixing. Per example from Ron at cheapcomplexdevices.com.
* Add regression test to see if the min/max values of int8 convert correctly.Tom Lane2005-12-05
|
* Fix out-of-order inclusion of -L switches from LDFLAGS on AIX and HPUX.Tom Lane2005-12-03
| | | | Per example from Dirk Pirschel.