aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* Fix a memory leak in tuplestore_end(). Unlikely to be significant duringNeil Conway2007-08-02
| | | | normal operation, but tuplestore_end() ought to do what it claims to do.
* Fix a bug in the original implementation of redundant-join-clause removal:Tom Lane2007-07-31
| | | | | | clauses in which one side or the other references both sides of the join cannot be removed as redundant, because that expression won't have been constrained below the join. Per report from Sergey Burladyan.
* Fix security definer functions with polymorphic arguments. This case hasTom Lane2007-07-31
| | | | | never worked because fmgr_security_definer() neglected to pass the fn_expr information through. Per report from Viatcheslav Kalinin.
* Fix predicate-proving logic to cope with binary-compatibility cases whenTom Lane2007-07-24
| | | | | | checking whether an IS NULL/IS NOT NULL clause is implied or refuted by a strict function. Per example from Dawid Kuroczko. Backpatch to 8.2 since this is arguably a performance bug.
* The correct min buffer size isMagnus Hagander2007-07-23
| | | | | | | INITIAL_EXPBUFFER_SIZE, not PQERRORMSG_LENGTH. Backpatch only, the proper fix in HEAD is to use PQExpBuffers everywhere.
* Fix elog.c to avoid infinite recursion (leading to backend crash) whenTom Lane2007-07-21
| | | | | | | | | | log_min_error_statement is active and there is some problem in logging the current query string; for example, that it's too long to include in the log message without running out of memory. This problem has existed since the log_min_error_statement feature was introduced. No doubt the reason it wasn't detected long ago is that 8.2 is the first release that defaults log_min_error_statement to less than PANIC level. Per report from Bill Moran.
* Fix WAL replay of truncate operations to cope with the possibility that theTom Lane2007-07-20
| | | | | | | | | truncated relation was deleted later in the WAL sequence. Since replay normally auto-creates a relation upon its first reference by a WAL log entry, failure is seen only if the truncate entry happens to be the first reference after the checkpoint we're restarting from; which is a pretty unusual case but of course not impossible. Fix by making truncate entries auto-create like the other ones do. Per report and test case from Dharmendra Goyal.
* Make replace(), split_part(), and string_to_array() behave somewhat sanelyTom Lane2007-07-19
| | | | | | | | | when handed an invalidly-encoded pattern. The previous coding could get into an infinite loop if pg_mb2wchar_with_len() returned a zero-length string after we'd tested for nonempty pattern; which is exactly what it will do if the string consists only of an incomplete multibyte character. This led to either an out-of-memory error or a backend crash depending on platform. Per report from Wiktor Wodecki.
* Only use the pipe chunking protocol if we know the syslogger shouldAndrew Dunstan2007-07-19
| | | | | | | be catching stderr output, and we are not ourselves the syslogger. Otherwise, go directly to stderr. Bug noticed by Tom Lane. Backpatch as far as 8.0.
* Fix an old thinko in SS_make_initplan_from_plan, which is used when optimizingTom Lane2007-07-18
| | | | | | | | a MIN or MAX aggregate call into an indexscan: the initplan is being made at the current query nesting level and so we shouldn't increment query_level. Though usually harmless, this mistake could lead to bogus "plan should not reference subplan's variable" failures on complex queries. Per bug report from David Sanchez i Gregori.
* Fix incorrect optimization of foreign-key checks. When an UPDATE on theTom Lane2007-07-17
| | | | | | | | | | | | | | referencing table does not change the tuple's FK column(s), we don't bother to check the PK table since the constraint was presumably already valid. However, the check is still necessary if the tuple was inserted by our own transaction, since in that case the INSERT trigger will conclude it need not make the check (since its version of the tuple has been deleted). We got this right for simple cases, but not when the insert and update are in different subtransactions of the current top-level transaction; in such cases the FK check would never be made at all. (Hence, problem dates back to 8.0 when subtransactions were added --- it's actually the subtransaction version of a bug fixed in 7.3.5.) Fix, and add regression test cases. Report and fix by Affan Salman.
* Fix outfuncs.c to dump A_Const nodes representing NULLs correctly. This hasTom Lane2007-07-17
| | | | | | been broken since forever, but was not noticed because people seldom look at raw parse trees. AFAIK, no impact on users except that debug_print_parse might fail; but patch it all the way back anyway. Per report from Jeff Ross.
* Fix CHECK_RELATION_BLOCK_RANGE macro, which was not merely producingTom Lane2007-07-15
| | | | a warning but was outright wrong.
* Fix mistaken Assert in adjust_appendrel_attr_needed, per Greg Stark.Tom Lane2007-07-12
|
* Fix freenig of names in Kerberos when using MIT - need to use theMagnus Hagander2007-07-12
| | | | | | free function provided in the Kerberos library. This fixes a very hard to track down heap corruption on windows when using debug runtimes.
* Fix stddev_pop(numeric) and var_pop(numeric), which were incorrectly producingTom Lane2007-07-09
| | | | the same outputs as stddev_samp() and var_samp() respectively.
* Restrict non-superusers to password authenticated connectionsJoe Conway2007-07-09
| | | | | | | to prevent possible escalation of privilege. Provide new SECURITY DEFINER functions with old behavior, but initially REVOKE ALL from public for these functions. Per list discussion and design proposed by Tom Lane.
* Remove the pgstat_drop_relation() call from smgr_internal_unlink(), becauseTom Lane2007-07-08
| | | | | | | | | | we don't know at that point which relation OID to tell pgstat to forget. The code was passing the relfilenode, which is incorrect, and could possibly cause some other relation's stats to be zeroed out. While we could try to clean this up, it seems much simpler and more reliable to let the next invocation of pgstat_vacuum_tabstat() fix things; which indeed is how it worked before I introduced the buggy code into 8.1.3 and later :-(. Problem noticed by Itagaki Takahiro, fix is per subsequent discussion.
* - Fix the -w (wait) option to work in Windows service mode, per bug #3382.Magnus Hagander2007-07-02
| | | | | | | - Prevent the -w option being passed to the postmaster. - Read the postmaster options file when starting as a Windows service. Dave Page
* Fix failure to restart Postgres when Linux kernel returns EIDRM for shmctl().Tom Lane2007-07-02
| | | | | | | | | | | | | This is a Linux kernel bug that apparently exists in every extant kernel version: sometimes shmctl() will fail with EIDRM when EINVAL is correct. We were assuming that EIDRM indicates a possible conflict with pre-existing backends, and refusing to start the postmaster when this happens. Fortunately, there does not seem to be any case where Linux can legitimately return EIDRM (it doesn't track shmem segments in a way that would allow that), so we can get away with just assuming that EIDRM means EINVAL on this platform. Per reports from Michael Fuhr and Jon Lapham --- it's a bit surprising we have not seen more reports, actually.
* Avoid memory leakage when a series of subtransactions invoke AFTER triggersTom Lane2007-07-01
| | | | | | | | | | | | | that are fired at end-of-statement (as is the normal case for foreign keys, for example). In this situation the per-subxact deferred trigger context is always empty when subtransaction exit is reached; so we could free it, but were not doing so, leading to an intratransaction leak of 8K or more per subtransaction. Per off-list example from Viatcheslav Kalinin subsequent to bug #3418 (his original bug report omitted a foreign key constraint needed to cause this leak). Back-patch to 8.2; prior versions were not using per-subxact contexts for deferred triggers, so did not have this leak.
* Fix computation of PG_VERSION_NUM by configure: remove unnecessary andTom Lane2007-06-29
| | | | | | unportable backslashes in awk script (per Patrick Welche), and add brackets to prevent autoconf from mangling sed's regexp (the sed call here never did what was expected).
* Fix a passel of ancient bugs in to_char(), including two distinct bufferTom Lane2007-06-29
| | | | | | | | | | | overruns (neither of which seem likely to be exploitable as security holes, fortunately, since the provoker can't control the data written). One of these is due to choosing to stomp on the output of a called function, which is bad news in any case; make it treat the called functions' results as read-only. Avoid some unnecessary palloc/pfree traffic too; it's not really helpful to free small temporary objects, and again this is presuming more than it ought to about the nature of the results of called functions. Per report from Patrick Welche and additional code-reading by Imad.
* Fix incorrect tests for undef Perl values in some places in plperl.c.Tom Lane2007-06-28
| | | | | | The correct test for defined-ness is SvOK(sv), not anything involving SvTYPE. Per bug #3415 from Matt Taylor. Back-patch as far as 8.0; no apparent problem in 7.x.
* In psql, when running a SELECT query using a cursor, flush the queryNeil Conway2007-06-22
| | | | | | output after each FETCH. This ensures that incremental results are available to clients that are executing long-running SELECT queries via the FETCH_COUNT feature.
* transformColumnDefinition failed to complain aboutTom Lane2007-06-20
| | | | | | create table foo (bar int default null default 3); due to not thinking about the special-case handling of DEFAULT NULL. Problem noticed while investigating bug #3396.
* CREATE DOMAIN ... DEFAULT NULL failed because gram.y special-cases DEFAULTTom Lane2007-06-20
| | | | | NULL and DefineDomain didn't. Bug goes all the way back to original coding of domains. Per bug #3396 from Sergey Burladyan.
* Avoid having autovacuum run multiple ANALYZE commands in a single transaction,Alvaro Herrera2007-06-14
| | | | to prevent possible deadlock problems. Per request from Tom Lane.
* Implement a chunking protocol for writes to the syslogger pipe, with messagesAndrew Dunstan2007-06-14
| | | | | | | | | reassembled in the syslogger before writing to the log file. This prevents partial messages from being written, which mucks up log rotation, and messages from different backends being interleaved, which causes garbled logs. Backport as far as 8.0, where the syslogger was introduced. Tom Lane and Andrew Dunstan
* Fix DecodeDateTime to allow timezone to appear before year. This hadTom Lane2007-06-12
| | | | | | historically worked in some but not all cases, but as of 8.2 it failed for all timezone formats. Fix, and add regression test cases to catch future regressions in this area. Per gripe from Adam Witney.
* Allow numeric_fac() to be interrupted, since it can take quite a while forTom Lane2007-06-09
| | | | | | large inputs. Also cause it to error out immediately if the result will overflow, instead of grinding through a lot of calculation first. Per gripe from Jim Nasby.
* Avoid losing track of data for shared tables in pgstats. Report by MichaelAlvaro Herrera2007-06-07
| | | | Fuhr, patch from Tom Lane after a messier suggestion by me.
* Fix array_dims() example to be consistent with the data previously shown.Tom Lane2007-06-07
| | | | Christian Rossow
* Move call of MarkBufferDirty() before XLogInsert() as required.Teodor Sigaev2007-06-05
| | | | | Many thanks to Heikki Linnakangas <heikki@enterprisedb.com> for his sharp eyes.
* Fix bundle bugs of GIN:Teodor Sigaev2007-06-04
| | | | | | | | | | | | | | | | | - Fix possible deadlock between UPDATE and VACUUM queries. Bug never was observed in 8.2, but it still exist there. HEAD is more sensitive to bug after recent "ring" of buffer improvements. - Fix WAL creation: if parent page is stored as is after split then incomplete split isn't removed during replay. This happens rather rare, only on large tables with a lot of updates/inserts. - Fix WAL replay: there was wrong test of XLR_BKP_BLOCK_* for left page after deletion of page. That causes wrong rightlink field: it pointed to deleted page. - add checking of match of clearing incomplete split - cleanup incomplete split list after proceeding All of this chages doesn't change on-disk storage, so backpatch... But second point may be an issue for replaying logs from previous version.
* On win32, retry reading when WSARecv returns WSAEWOULDBLOCK. There seemMagnus Hagander2007-06-04
| | | | | | | to be cases when at least Windows 2000 can do this even though select just indicated that the socket is readable. Per report and analysis from Cyril VELTER.
* On win32, don't use SO_REUSEADDR for TCP sockets.Magnus Hagander2007-06-04
| | | | Per failure on buildfarm member baiji and subsequent discussion.
* Fix erroneous error reporting for overlength input in text_date(),Tom Lane2007-06-02
| | | | text_time(), and text_timetz(). 7.4-vintage bug found by Greg Stark.
* Remove incorrect semicolon in example. This was previously fixed inNeil Conway2007-06-02
| | | | HEAD only -- backporting to 8.2. Per report from Frank van Vugt.
* Fix aboriginal bug in BufFileDumpBuffer that would cause it to write theTom Lane2007-06-01
| | | | | | | | wrong data when dumping a bufferload that crosses a component-file boundary. This probably has not been seen in the wild because (a) component files are normally 1GB apiece and (b) non-block-aligned buffer usage is relatively rare. But it's fairly easy to reproduce a problem if one reduces RELSEG_SIZE in a test build. Kudos to Kurt Harriman for spotting the bug.
* Fix performance problems in multi-batch hash joins by ensuring that we selectTom Lane2007-06-01
| | | | | | | | | | a well-randomized batch number even when given a poorly-randomized hash value. This is a bit inefficient but seems the only practical solution given the constraint that we can't change the hash functions in released branches. Per report from Joseph Shraibman. Applied to 8.1 and 8.2 only --- HEAD is getting a cleaner fix, and 8.0 and before use different coding that seems less vulnerable.
* Fix overly-strict sanity check in BeginInternalSubTransaction that made itTom Lane2007-05-30
| | | | | | fail when used in a deferred trigger. Bug goes back to 8.0; no doubt the reason it hadn't been noticed is that we've been discouraging use of user-defined constraint triggers. Per report from Frank van Vugt.
* Fix a bug in input processing for the "interval" type. Previously,Neil Conway2007-05-29
| | | | | | | | "microsecond" and "millisecond" units were not considered valid input by themselves, which caused inputs like "1 millisecond" to be rejected erroneously. Update the docs, add regression tests, and backport to 8.2 and 8.1
* Repair planner bug introduced in 8.2 by ability to rearrange outer joins:Tom Lane2007-05-22
| | | | | | | | | | | | | | | | | | | in cases where a sub-SELECT inserts a WHERE clause between two outer joins, that clause may prevent us from re-ordering the two outer joins. The code was considering only the joins' own ON-conditions in determining reordering safety, which is not good enough. Add a "delay_upper_joins" flag to OuterJoinInfo to flag that we have detected such a clause and higher-level outer joins shouldn't be permitted to commute with this one. (This might seem overly coarse, but given the current rules for OJ reordering, it's sufficient AFAICT.) The failure case is actually pretty narrow: it needs a WHERE clause within the RHS of a left join that checks the RHS of a lower left join, but is not strict for that RHS (else we'd have simplified the lower join to a plain join). Even then no failure will be manifest unless the planner chooses to rearrange the join order. Per bug report from Adam Terrey.
* Fix best_inner_indexscan to return both the cheapest-total-cost andTom Lane2007-05-22
| | | | | | | | | | | | cheapest-startup-cost innerjoin indexscans, and make joinpath.c consider both of these (when different) as the inside of a nestloop join. The original design was based on the assumption that indexscan paths always have negligible startup cost, and so total cost is the only important figure of merit; an assumption that's obviously broken by bitmap indexscans. This oversight could lead to choosing poor plans in cases where fast-start behavior is more important than total cost, such as LIMIT and IN queries. 8.1-vintage brain fade exposed by an example from Chuck D.
* Fix spurious German index entryPeter Eisentraut2007-05-21
|
* Removed errant ISODOWMichael Meskes2007-05-21
|
* Backported fix from HEAD that removes superfluous function Vista has a ↵Michael Meskes2007-05-21
| | | | problem with
* Fix inappropriate commentsPeter Eisentraut2007-05-18
|
* Remove redundant logging of send failures when SSL is in use. While pqcomm.cTom Lane2007-05-18
| | | | | | had been taught not to do that ages ago, the SSL code was helpfully bleating anyway. Resolves some recent reports such as bug #3266; however the underlying cause of the related bug #2829 is still unclear.