aboutsummaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAge
* Suppress attempts to report dropped tables to the stats collector from aTom Lane2006-03-30
| | | | | | | | startup or recovery process. Since such a process isn't a real backend, pgstat.c gets confused. This accounts for recent reports of strange "invalid server process ID -1" log messages during crash recovery. There isn't any point in attempting to make the report, since we'll discard stats in such scenarios anyhow.
* TablespaceCreateDbspace should function normally even on platforms that do notTom Lane2006-03-29
| | | | | | have symlinks (ie, Windows). Although it'll never be called on to do anything useful during normal operation on such a platform, it's still needed to re-create dropped directories during WAL replay.
* Disable full_page_writes, because turning it off risks causing crash-recoveryTom Lane2006-03-28
| | | | | | | | | | failures even when the hardware and OS did nothing wrong. Per recent analysis of a problem report from Alex Bahdushka. For the moment I've just diked out the test of the parameter, rather than removing the GUC infrastructure and documentation, in case we conclude that there's something salvageable there. There seems no chance of it being resurrected in the 8.1 branch though.
* Repair longstanding error in btree xlog replay: XLogReadBuffer should beTom Lane2006-03-28
| | | | | | | | | | passed extend = true whenever we are reading a page we intend to reinitialize completely, even if we think the page "should exist". This is because it might indeed not exist, if the relation got truncated sometime after the current xlog record was made and before the crash we're trying to recover from. These two thinkos appear to explain both of the old bug reports discussed here: http://archives.postgresql.org/pgsql-hackers/2005-05/msg01369.php
* Comments in IndexBuildHeapScan describe the indexing of recently-deadTom Lane2006-03-24
| | | | | | | | | | tuples as needed "to keep VACUUM from complaining", but actually there is a more compelling reason to do it: failure to do so violates MVCC semantics. This is because a pre-existing serializable transaction might try to use the index after we finish (re)building it, and it might fail to find tuples it should be able to see. We got this mostly right, but not in the case of partial indexes: the code mistakenly discarded recently-dead tuples for partial indexes. Fix that, and adjust the comments.
* Fix plpgsql to pass only one copy of any given plpgsql variable into a SQLTom Lane2006-03-23
| | | | | | | | | command or expression, rather than one copy for each textual occurrence as it did before. This might result in some small performance improvement, but the compelling reason to do it is that not doing so can result in unexpected grouping failures because the main SQL parser won't see different parameter numbers as equivalent. Add a regression test for the failure case. Per report from Robert Davidson.
* Improve performance of our private version of qsort. Per recent testing,Tom Lane2006-03-21
| | | | | | | | | | | | the logic it contained to switch to insertion sort for near-sorted input was in fact a big loss, because it could fairly easily be fooled into applying insertion sort to large subfiles that weren't all that well ordered. Remove that, and instead add a simple check for already-perfectly-sorted input, as per suggestion from Dann Corbit. This adds at worst O(N*lgN) overhead, and usually far less, while sometimes allowing a subfile sort to finish in O(N) time. Preliminary testing says this is an improvement over the basic Bentley & McIlroy code for many nonrandom inputs, and it costs almost nothing when the input is random.
* Fixed bug 2330: Wrong error code in case of a duplicate keyMichael Meskes2006-03-19
|
* Adjust join_1.out to match Windows behavior for new mergejoin regressionTom Lane2006-03-19
| | | | | test, per Dave Page and buildfarm. Perhaps we will need a join_2 instead, but for the moment assume that this test tracks the other diffs.
* The call to DNSServiceRegistrationCreate in postmaster.c does incorrectNeil Conway2006-03-18
| | | | | | | | | byte-swapping on the port number which causes the call to fail on Intel Macs. This patch uses htons() instead of htonl() and fixes this bug. Ashley Clark
* Fix bug introduced into mergejoin logic by performance improvement patch ofTom Lane2006-03-17
| | | | | | | | | | | | | | 2005-05-13. When we find that a new inner tuple can't possibly match any outer tuple (because it contains a NULL), we can't immediately skip the tuple when we are in NEXTINNER state. Doing so can lead to emitting multiple copies of the tuple in FillInner mode, because we may rescan the tuple after returning to a previous marked tuple. Instead, proceed to NEXTOUTER state the same as we used to do. After we've found that there's no need to return to the marked position, we can go to SKIPINNER_ADVANCE state instead of SKIP_TEST when the inner tuple is unmatchable; this preserves the performance improvement. Per bug report from Bruce. I also made a couple of cosmetic code rearrangements and added a regression test for the problem.
* Add a CHECK_FOR_INTERRUPTS() in _bt_buildadd(). This fixes problemTom Lane2006-03-10
| | | | | with not responding to query cancel during the last stage of btree index creation.
* Add a CHECK_FOR_INTERRUPTS() to the loop in ExecMakeTableFunctionResult.Tom Lane2006-03-10
| | | | Otherwise you can't cancel queries like select ... from generate_series(1,1000000).
* * Stephen Frost (sfrost@snowman.net) wrote:Bruce Momjian2006-03-06
| | | | | | | | | | | | | | | | | | | | | | | | | > I've now tested this patch at home w/ 8.2HEAD and it seems to fix the > bug. I plan on testing it under 8.1.2 at work tommorow with > mod_auth_krb5, etc, and expect it'll work there. Assuming all goes > well and unless someone objects I'll forward the patch to -patches. > It'd be great to have this fixed as it'll allow us to use Kerberos to > authenticate to phppgadmin and other web-based tools which use > Postgres. While playing with this patch under 8.1.2 at home I discovered a mistake in how I manually applied one of the hunks to fe-auth.c. Basically, the base code had changed and so the patch needed to be modified slightly. This is because the code no longer either has a freeable pointer under 'name' or has 'name' as NULL. The attached patch correctly frees the string from pg_krb5_authname (where it had been strdup'd) if and only if pg_krb5_authname returned a string (as opposed to falling through and having name be set using name = pw->name;). Also added a comment to this effect. Backpatch to 8.1.X. Stephen Frost
* Check for "msys" so it doesn't use 'con' by checking for an evironmentBruce Momjian2006-03-05
| | | | variable.
* Prevent lazy_space_alloc from making requests that exceed MaxAllocSize,Tom Lane2006-03-04
| | | | per report from Stefan Kaltenbrunner.
* Tighten up SJIS byte sequence check. Now we reject invalid SJIS byteTatsuo Ishii2006-03-04
| | | | sequence such as "0x95 0x27". Patches from Akio Ishida.
* Use DEVTTY as 'con' on Win32 as a replacement for /dev/tty.Bruce Momjian2006-03-04
|
* Avoid trying to open /dev/tty on Win32. Some Win32 systems haveBruce Momjian2006-03-03
| | | | | | | | | | | /dev/tty, but it isn't a device file and doesn't work as expected. This fixes a known bug where psql does not prompt for a password on some Win32 systems. Backpatch to 8.1.X. Robert Kinberg
* Update ipcclean to use try 'id' first for root check.Bruce Momjian2006-03-03
|
* In ipcclean, check LOGNAME only if USER is not set.Bruce Momjian2006-03-03
| | | | Fixes problem with 'su' on some platforms.
* Fix ancient error in large objects usage example: overwrite() subroutineTom Lane2006-03-02
| | | | | was opening with INV_READ flag and then writing. Prior to 8.1 the backend did not reject this, but now it does.
* Repair oidvectorrecv and int2vectorrecv, which I broke while changingTom Lane2006-03-02
| | | | them to use array_recv :-(. Per report from Tim Kordas.
* Backpatch to 8.1.X. Already applied to CVS HEAD.Bruce Momjian2006-03-02
| | | | | | | | | | | | | | | | | | | | | | | | --------------------------------------------------------------------------- > True, but they're not being used where you'd expect. This seems to be > something to do with the fact that it's not pg_authid which is being > accessed, but rather the view pg_roles. I looked into this and it seems the problem is that the view doesn't get flattened into the main query because of the has_nullable_targetlist limitation in prepjointree.c. That's triggered because pg_roles has '********'::text AS rolpassword which isn't nullable, meaning it would produce wrong behavior if referenced above the outer join. Ultimately, the reason this is a problem is that the planner deals only in simple Vars while processing joins; it doesn't want to think about expressions. I'm starting to think that it may be time to fix this, because I've run into several related restrictions lately, but it seems like a nontrivial project. In the meantime, reducing the LEFT JOIN to pg_roles to a JOIN as per Peter's suggestion seems like the best short-term workaround.
* Fix possible crash at transaction end when a plpgsql function is used andTom Lane2006-03-02
| | | | | | | | | then modified within the same transaction. The code was using a linked list of active PLpgSQL_expr structs, which was OK when it was written because plpgsql never released any parse data structures for the life of the backend. But since Neil fixed plpgsql's memory management, elements of the linked list could be freed, leading to crash when the list is chased. Per report and test case from Kris Jurka.
* 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.