summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2006-04-09Revert my best_inner_indexscan patch of yesterday, which turns out to haveTom Lane
had a bad side-effect: it stopped finding plans that involved BitmapAnd combinations of indexscans using both join and non-join conditions. Instead, make choose_bitmap_and more aggressive about detecting redundancies between BitmapOr subplans.
2006-04-08Fix best_inner_indexscan to actually enforce that an "inner indexscan" useTom Lane
at least one join condition as an indexqual. Before bitmap indexscans, this oversight didn't really cost much except for redundantly considering the same join paths twice; but as of 8.1 it could result in silly bitmap scans that would do the same BitmapOr twice and then BitmapAnd these together :-(
2006-04-07Fix pg_dumpall to do something sane when a pre-8.1 installation hasTom Lane
identically named user and group: we merge these into a single entity with LOGIN permission. Also, add ORDER BY commands to ensure consistent dump ordering, for ease of comparing outputs from different installations.
2006-04-07Fix make_restrictinfo_from_bitmapqual() to preserve AND/OR flatness of itsTom Lane
output, ie, no OR immediately below an OR. Otherwise we get Asserts or wrong answers for cases such as select * from tenk1 a, tenk1 b where (a.ten = b.ten and (a.unique1 = 100 or a.unique1 = 101)) or (a.hundred = b.hundred and a.unique1 = 42); Per report from Rafael Martinez Guerrero.
2006-04-02Adjust interval-addition test so that it won't fail on DST transition days.Tom Lane
Strange that we missed this DST dependence while fixing the others.
2006-03-30Suppress attempts to report dropped tables to the stats collector from aTom Lane
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.
2006-03-29TablespaceCreateDbspace should function normally even on platforms that do notTom Lane
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.
2006-03-28Disable full_page_writes, because turning it off risks causing crash-recoveryTom Lane
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.
2006-03-28Repair longstanding error in btree xlog replay: XLogReadBuffer should beTom Lane
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
2006-03-24Comments in IndexBuildHeapScan describe the indexing of recently-deadTom Lane
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.
2006-03-23Fix plpgsql to pass only one copy of any given plpgsql variable into a SQLTom Lane
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.
2006-03-21Improve performance of our private version of qsort. Per recent testing,Tom Lane
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.
2006-03-19Fixed bug 2330: Wrong error code in case of a duplicate keyMichael Meskes
2006-03-19Adjust join_1.out to match Windows behavior for new mergejoin regressionTom Lane
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.
2006-03-18The call to DNSServiceRegistrationCreate in postmaster.c does incorrectNeil Conway
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
2006-03-17Fix bug introduced into mergejoin logic by performance improvement patch ofTom Lane
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.
2006-03-10Add a CHECK_FOR_INTERRUPTS() in _bt_buildadd(). This fixes problemTom Lane
with not responding to query cancel during the last stage of btree index creation.
2006-03-10Add a CHECK_FOR_INTERRUPTS() to the loop in ExecMakeTableFunctionResult.Tom Lane
Otherwise you can't cancel queries like select ... from generate_series(1,1000000).
2006-03-06* Stephen Frost (sfrost@snowman.net) wrote:Bruce Momjian
> 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
2006-03-05Check for "msys" so it doesn't use 'con' by checking for an evironmentBruce Momjian
variable.
2006-03-04Prevent lazy_space_alloc from making requests that exceed MaxAllocSize,Tom Lane
per report from Stefan Kaltenbrunner.
2006-03-04Tighten up SJIS byte sequence check. Now we reject invalid SJIS byteTatsuo Ishii
sequence such as "0x95 0x27". Patches from Akio Ishida.
2006-03-04Use DEVTTY as 'con' on Win32 as a replacement for /dev/tty.Bruce Momjian
2006-03-03Avoid trying to open /dev/tty on Win32. Some Win32 systems haveBruce Momjian
/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
2006-03-03Update ipcclean to use try 'id' first for root check.Bruce Momjian
2006-03-03In ipcclean, check LOGNAME only if USER is not set.Bruce Momjian
Fixes problem with 'su' on some platforms.
2006-03-02Fix ancient error in large objects usage example: overwrite() subroutineTom Lane
was opening with INV_READ flag and then writing. Prior to 8.1 the backend did not reject this, but now it does.
2006-03-02Repair oidvectorrecv and int2vectorrecv, which I broke while changingTom Lane
them to use array_recv :-(. Per report from Tim Kordas.
2006-03-02Backpatch to 8.1.X. Already applied to CVS HEAD.Bruce Momjian
--------------------------------------------------------------------------- > 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.
2006-03-02Fix possible crash at transaction end when a plpgsql function is used andTom Lane
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.
2006-02-24make initdb -U username work as advertised; back out bogus patch at rev 1.42Andrew Dunstan
and supply real fix for problem it tried to address.
2006-02-21Fix old pg_dump oversight: default values for domains really need to be dumpedTom Lane
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.
2006-02-21Adjust probe for getaddrinfo to cope with macro-ized definitions, suchTom Lane
as Tru64's. Per previous discussion.
2006-02-20Fix three Python reference leaks in PLy_traceback(). This would resultNeil Conway
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.
2006-02-14Move btbulkdelete's vacuum_delay_point() call to a place in the loop whereTom Lane
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).
2006-02-14Add some missing vacuum_delay_point calls in GIST vacuuming.Tom Lane
2006-02-13Fix qual_is_pushdown_safe to not try to push down quals involving a whole-rowTom Lane
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).
2006-02-12Fix bug that allowed any logged-in user to SET ROLE to any other database userTom Lane
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.
2006-02-12Stamp 8.1.3, but exclude configure.in/configure change.Bruce Momjian
2006-02-10Check that SID is enabled while checking for Windows admin privileges.Tom Lane
Magnus
2006-02-10Change search for default operator classes so that it examines all opclassesTom Lane
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.
2006-02-09Provide the libpq error message when PQputline or PQendcopy fails.Tom Lane
2006-02-09Reject out-of-range dates in date_in().Tom Lane
Kris Jurka
2006-02-07Fix HTML alignment in PQprint.Bruce Momjian
Christoph Zwerschke
2006-02-06Fix PQprint HTML tag, "centre" -> "center".Bruce Momjian
2006-02-05Fix pg_restore to properly discard COPY data when trying to continueTom Lane
after an error in a COPY statement. Formerly it thought the COPY data was SQL commands, and got quite confused. Stephen Frost
2006-02-01Fix const cast in get_progname().Bruce Momjian
Backpatch.
2006-02-01Set progname early in the postmaster/postgres binary, rather than doingBruce Momjian
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.
2006-01-31Allow %TYPE to be used with SETOF, per gripe from Murat Tasan.Tom Lane
2006-01-30Fix ALTER COLUMN TYPE bug: it sometimes tried to drop UNIQUE or PRIMARY KEYTom Lane
constraints before FOREIGN KEY constraints that depended on them. Originally reported by Neil Conway on 29-Jun-2005. Patch by Nakano Yoshihisa.