aboutsummaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAge
* make initdb -U username work as advertised; back out bogus patch at rev 1.42Andrew Dunstan2006-02-24
| | | | and supply real fix for problem it tried to address.
* Fix old pg_dump oversight: default values for domains really need to be dumpedTom Lane2006-02-21
| | | | | | | | | | | | by decompiling the typdefaultbin expression, not just printing the typdefault text which may be out-of-date or assume the wrong schema search path. (It's the same hazard as for adbin vs adsrc in column defaults.) The catalogs.sgml spec for pg_type implies that the correct procedure is to look to typdefaultbin first and consider typdefault only if typdefaultbin is NULL. I made dumping of both domains and base types do that, even though in the current backend code typdefaultbin is always correct for domains and typdefault for base types --- might as well try to future-proof it a little. Per bug report from Alexander Galler.
* Adjust probe for getaddrinfo to cope with macro-ized definitions, suchTom Lane2006-02-21
| | | | as Tru64's. Per previous discussion.
* Fix three Python reference leaks in PLy_traceback(). This would resultNeil Conway2006-02-20
| | | | | | | | | | in leaking memory when invoking a PL/Python procedure that raises an exception. Unfortunately this still leaks memory, but at least the largest leak has been plugged. This patch also fixes a reference counting mistake in PLy_modify_tuple() for 8.0, 8.1 and HEAD: we don't actually own a reference to `platt', so we shouldn't Py_DECREF() it.
* Move btbulkdelete's vacuum_delay_point() call to a place in the loop whereTom Lane2006-02-14
| | | | | | | | we are not holding a buffer content lock; where it was, InterruptHoldoffCount is positive and so we'd not respond to cancel signals as intended. Also add missing vacuum_delay_point() call in btvacuumcleanup. This should fix complaint from Evgeny Gridasov about failure to respond to SIGINT/SIGTERM in a timely fashion (bug #2257).
* Add some missing vacuum_delay_point calls in GIST vacuuming.Tom Lane2006-02-14
|
* 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 that allowed any logged-in user to SET ROLE to any other database userTom Lane2006-02-12
| | | | | | | | id (CVE-2006-0553). Also fix related bug in SET SESSION AUTHORIZATION that allows unprivileged users to crash the server, if it has been compiled with Asserts enabled. The escalation-of-privilege risk exists only in 8.1.0-8.1.2. However, the Assert-crash risk exists in all releases back to 7.3. Thanks to Akio Ishida for reporting this problem.
* Stamp 8.1.3, but exclude configure.in/configure change.Bruce 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 HTML alignment in PQprint.Bruce Momjian2006-02-07
| | | | Christoph Zwerschke
* Fix PQprint HTML tag, "centre" -> "center".Bruce Momjian2006-02-06
|
* 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.
* Allow %TYPE to be used with SETOF, per gripe from Murat Tasan.Tom Lane2006-01-31
|
* 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.
* When building a bitmap scan, must copy the bitmapqualorig expression treeTom Lane2006-01-29
| | | | | | | | to avoid sharing substructure with the lower-level indexquals. This is currently only an issue if there are SubPlans in the indexquals, which is uncommon but not impossible --- see bug #2218 reported by Nicholas Vinen. We use the same kluge for indexqual vs indexqualorig in the index scans themselves ... would be nice to clean this up someday.
* Fix code that checks to see if an index can be considered to match the query'sTom Lane2006-01-29
| | | | | | | | | requested sort order. It was assuming that build_index_pathkeys always generates a pathkey per index column, which was not true if implied equality deduction had determined that two index columns were effectively equated to each other. Simplest fix seems to be to install an option that causes build_index_pathkeys to support this behavior as well as the original one. Per report from Brian Hirt.
* 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().
* Per a bug report from Theo Schlossnagle, plperl_return_next() leaksNeil Conway2006-01-28
| | | | | | | | | | | | | | | | | | | | | | | | | memory in the executor's per-query memory context. It also inefficient: it invokes get_call_result_type() and TupleDescGetAttInMetadata() for every call to return_next, rather than invoking them once (per PL/Perl function call) and memoizing the result. This patch makes the following changes: - refactor the code to include all the "per PL/Perl function call" data inside a single struct, "current_call_data". This means we don't need to save and restore N pointers for every recursive call into PL/Perl, we can just save and restore one. - lookup the return type metadata needed by plperl_return_next() once, and then stash it in "current_call_data", so as to avoid doing the lookup for every call to return_next. - create a temporary memory context in which to evaluate the return type's input functions. This memory context is reset for each call to return_next. The patch appears to fix the memory leak, and substantially reduces the overhead imposed by return_next.
* 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.
* Remove unnecessary PQconsumeInput call from PQputCopyData; it's redundantTom Lane2006-01-25
| | | | | | | because pqSendSome will absorb input data anytime it'd be forced to block. Avoiding a kernel call per PQputCopyData call helps COPY speed materially. Alon Goldshuv
* Fix unportable usage of socklen_t: should use ACCEPT_TYPE_ARG3 macroTom Lane2006-01-24
| | | | provided by configure, instead. Per bug #2205.
* 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.
* Fix thinko in autovacuum's test to skip temp tables: want to skip anyTom Lane2006-01-20
| | | | | | temp table not only our own process' tables. It's not real important since vacuum.c will skip temp tables anyway, but might as well make the code do what it claims to do.
* Add some test scaffolding to allow cache-flush stress testing (and I doTom Lane2006-01-19
| | | | mean stress ... system is orders of magnitude slower with this enabled).
* Remove $(DESTDIR) from the pgxs BE_DLLLIBS= -L path for AIX and 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.
* Fix a tiny memory leak (one List header) in RelationCacheInvalidate().Tom Lane2006-01-19
| | | | | | | This is utterly insignificant in normal operation, but it becomes a problem during cache inval stress testing. The original coding in fact had no leak --- the 8.0 List rewrite created the issue. I wonder whether list_concat should pfree the discarded header?
* Modify pgstats code to reduce performance penalties from oversized stats dataTom Lane2006-01-18
| | | | | | | | | | | | | files: avoid creating stats hashtable entries for tables that aren't being touched except by vacuum/analyze, ensure that entries for dropped tables are removed promptly, and tweak the data layout to avoid storing useless struct padding. Also improve the performance of pgstat_vacuum_tabstat(), and make sure that autovacuum invokes it exactly once per autovac cycle rather than multiple times or not at all. This should cure recent complaints about 8.1 showing much higher stats I/O volume than was seen in 8.0. It'd still be a good idea to revisit the design with an eye to not re-writing the entire stats dataset every half second ... but that would be too much to backpatch, I fear.
* Fix fsync code to test whether F_FULLFSYNC is available, instead ofTom Lane2006-01-17
| | | | assuming it always is on Darwin. Per report from Neil Brandt.
* 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.
* Improve error messages for missing-FROM-entry cases, as per recent discussion.Tom Lane2006-01-10
|
* 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.
* During CatCacheRemoveCList, we must now remove any members that areTom Lane2006-01-07
| | | | | | | | | dead and have become unreferenced. Before 8.1, such members were left for AtEOXact_CatCache() to clean up, but now AtEOXact_CatCache isn't supposed to have anything to do. In an assert-enabled build this bug leads to an assertion failure at transaction end, but in a non-assert build the dead member is effectively just a small memory leak. Per report from Jeremy Drake.
* 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.