aboutsummaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAge
...
* Remove "fuzzy comparison" logic in qsort comparison function forTom Lane2006-06-07
| | | | | | | | | | | | choose_bitmap_and(). It was way too fuzzy --- per comment, it was meant to be 1% relative difference, but was actually coded as 0.01 absolute difference, thus causing selectivities of say 0.001 and 0.000000000001 to be treated as equal. I believe this thinko explains Maxim Boguk's recent complaint. While we could change it to a relative test coded like compare_fuzzy_path_costs(), there's a bigger problem here, which is that any fuzziness at all renders the comparison function non-transitive, which could confuse qsort() to the point of delivering completely wrong results. So forget the whole thing and just do an exact comparison.
* Backpatch comment about --sysconfdir.Bruce Momjian2006-06-07
|
* On Win32, return original patch if GetShortPathName() fails (no shortBruce Momjian2006-06-06
| | | | | | name, path does not exist), rather than returning nothing. Backpatch to 8.1.X.
* Have BCC echo output "" using "", rather than \"\" as earlier reported.Bruce Momjian2006-06-06
| | | | Backpatch to 8.1.X.
* Fixed two memory leaks in ecpglib.Michael Meskes2006-06-06
|
* Fix copy-and-pasteo in Russian translation: message complaining aboutTom Lane2006-06-03
| | | | | HAVE_INT64_TIMESTAMP was mentioning PG_CONTROL_VERSION instead. Victor Snezhko
* PostmasterIsAlive test really ought to be in the inner loop for safety.Tom Lane2006-05-30
|
* Remove pqsignalinquire(), which is unused and has portability issues.Tom Lane2006-05-30
|
* Update ppport.h to not cause warnings with newest Perl versions.Tom Lane2006-05-30
| | | | | This is just the minimal necessary change; we might want to adopt later PPPort output instead.
* Move conversion dependency patch to the proper branch, out of 8.1.X,Bruce Momjian2006-05-30
| | | | into HEAD.
* Prevent multiple archivers from starting. Backpatch to 8.1.X.Bruce Momjian2006-05-30
| | | | Simon Riggs
* Add "inline" compile fix for MSVC/BCC:Bruce Momjian2006-05-30
| | | | | | | | #define inline __inline Backpatch to 8.1.X. Hiroshi Saito
* Fix initdb to properly escape quotes and backslashes in the suppliedTom Lane2006-05-27
| | | | | superuser password, and also in the paths of the various files it issues SQL COPY commands for. Per bug #2424.
* Fix pg_restore to process BLOB COMMENT entries correctly; they aren'tTom Lane2006-05-24
| | | | | really tables and shouldn't get DISABLE TRIGGER processing. Per bug #2452 from Robert Treat.
* Modify libpq's string-escaping routines to be aware of encoding considerationsTom Lane2006-05-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and standard_conforming_strings. The encoding changes are needed for proper escaping in multibyte encodings, as per the SQL-injection vulnerabilities noted in CVE-2006-2313 and CVE-2006-2314. Concurrent fixes are being applied to the server to ensure that it rejects queries that may have been corrupted by attempted SQL injection, but this merely guarantees that unpatched clients will fail rather than allow injection. An actual fix requires changing the client-side code. While at it we have also fixed these routines to understand about standard_conforming_strings, so that the upcoming changeover to SQL-spec string syntax can be somewhat transparent to client code. Since the existing API of PQescapeString and PQescapeBytea provides no way to inform them which settings are in use, these functions are now deprecated in favor of new functions PQescapeStringConn and PQescapeByteaConn. The new functions take the PGconn to which the string will be sent as an additional parameter, and look inside the connection structure to determine what to do. So as to provide some functionality for clients using the old functions, libpq stores the latest encoding and standard_conforming_strings values received from the backend in static variables, and the old functions consult these variables. This will work reliably in clients using only one Postgres connection at a time, or even multiple connections if they all use the same encoding and string syntax settings; which should cover many practical scenarios. Clients that use homebrew escaping methods, such as PHP's addslashes() function or even hardwired regexp substitution, will require extra effort to fix :-(. It is strongly recommended that such code be replaced by use of PQescapeStringConn/PQescapeByteaConn if at all feasible.
* Add a new GUC parameter backslash_quote, which determines whether the SQLTom Lane2006-05-21
| | | | | | | | | | | | | | | | | parser will allow "\'" to be used to represent a literal quote mark. The "\'" representation has been deprecated for some time in favor of the SQL-standard representation "''" (two single quote marks), but it has been used often enough that just disallowing it immediately won't do. Hence backslash_quote allows the settings "on", "off", and "safe_encoding", the last meaning to allow "\'" only if client_encoding is a valid server encoding. That is now the default, and the reason is that in encodings such as SJIS that allow 0x5c (ASCII backslash) to be the last byte of a multibyte character, accepting "\'" allows SQL-injection attacks as per CVE-2006-2314 (further details will be published after release). The "on" setting is available for backward compatibility, but it must not be used with clients that are exposed to untrusted input. Thanks to Akio Ishida and Yasuo Ohgaki for identifying this security issue.
* Change the backend to reject strings containing invalidly-encoded multibyteTom Lane2006-05-21
| | | | | | | | | | | | | | | | | | | | characters in all cases. Formerly we mostly just threw warnings for invalid input, and failed to detect it at all if no encoding conversion was required. The tighter check is needed to defend against SQL-injection attacks as per CVE-2006-2313 (further details will be published after release). Embedded zero (null) bytes will be rejected as well. The checks are applied during input to the backend (receipt from client or COPY IN), so it no longer seems necessary to check in textin() and related routines; any string arriving at those functions will already have been validated. Conversion failure reporting (for characters with no equivalent in the destination encoding) has been cleaned up and made consistent while at it. Also, fix a few longstanding errors in little-used encoding conversion routines: win1251_to_iso, win866_to_iso, euc_tw_to_big5, euc_tw_to_mic, mic_to_euc_tw were all broken to varying extents. Patches by Tatsuo Ishii and Tom Lane. Thanks to Akio Ishida and Yasuo Ohgaki for identifying the security issues.
* Have autovacuum report its activities to the stat collector.Alvaro Herrera2006-05-19
|
* Stamp 8.1.4, except configure/configure.in.Bruce Momjian2006-05-19
|
* Fix choose_bitmap_and() so that partial index predicates are considered whenTom Lane2006-05-18
| | | | | | | | | | | deciding whether a potential additional indexscan is redundant or not. As now coded, any use of a partial index that was already used in a previous AND arm will be rejected as redundant. This might be overly restrictive, but not considering the point at all is definitely bad, as per example in bug #2441 from Arjen van der Meijden. In particular, a clauseless scan of a partial index was *never* considered redundant by the previous coding, and that's surely wrong. Being more flexible would also require some consideration of how not to double-count the index predicate's selectivity.
* When a bitmap indexscan is using a partial index, it is necessary to includeTom Lane2006-05-18
| | | | | | | the partial index predicate in the scan's "recheck condition". Otherwise, if the scan becomes lossy for lack of bitmap memory, we would fail to enforce that returned rows satisfy the predicate. Noted while studying bug #2441 from Arjen van der Meijden.
* Fix the sense of the test on DH_check()'s return value. This was preventingTom Lane2006-05-12
| | | | | custom-generated DH parameters from actually being used by the server. Found by Michael Fuhr.
* Remove unnecessary .seg/.section directives, per Alan Stange.Tom Lane2006-05-11
|
* Use SQL standard '' rather than \' for tutorial/sample code.Bruce Momjian2006-05-11
| | | | Backpatch to 8.1.X.
* Build server libpgport with all non-FRONTEND object files. This is toBruce Momjian2006-05-08
| | | | | fix a Win32 bug where pipe.c included a file that used FRONTEND, but it wasn't on the server-build list.
* Fix calculation of plan node extParams to account for the possibility that oneTom Lane2006-05-03
| | | | | | | | | | | | initPlan sets a parameter for another. This could not (I think) happen before 8.1, but it's possible now because the initPlans generated by MIN/MAX optimization might themselves use initPlans. We attach those initPlans as siblings of the MIN/MAX ones, not children, to avoid duplicate computation when multiple MIN/MAX aggregates are present; so this leads to the case of an initPlan needing the result of a sibling initPlan, which is not possible with ordinary query nesting. Hadn't been noticed because in most contexts having too much stuff listed in extParam is fairly harmless. Fixes "plan should not reference subplan's variable" bug reported by Catalin Pitis.
* Avoid assuming that statistics for a parent relation reflect the properties ofTom Lane2006-05-02
| | | | | | | | | | | | | the union of its child relations as well. This might have been a good idea when it was originally coded, but it's a fatally bad idea when inheritance is being used for partitioning. It's better to have no stats at all than completely misleading stats. Per report from Mark Liberman. The bug arguably exists all the way back, but I've only patched HEAD and 8.1 because we weren't particularly trying to support partitioning before 8.1. Eventually we ought to look at deriving union statistics instead of just punting, but for now the drop kick looks good.
* Remove the restriction originally coded into optimize_minmax_aggregates() thatTom Lane2006-04-28
| | | | | | | | | | | | | | | | | | | | | | | | | MIN/MAX not be converted to use an index if the query WHERE clause contains any volatile functions or subplans. I had originally feared that the conversion might alter the behavior of such a query with respect to a volatile function. Well, so it might, but only in the sense that the function would get evaluated at a subset of the table rows rather than all of them --- and we have never made any such guarantee anyway. (For instance, we don't refuse to use an index for an ordinary non-aggregate query when one of the non-indexable filter conditions contains a volatile function.) The prohibition against subplans was because of worry that that case wasn't adequately tested, which it wasn't, but it turns out to be possible to make 8.1 fail anyway: regression=# select o.ten, (select max(unique2) from tenk1 i where ten = o.ten or ten = (select f1 from int4_tbl limit 1)) from tenk1 o; ERROR: direct correlated subquery unsupported as initplan This is due to bogus code in SS_make_initplan_from_plan (it's an initplan, ergo it can't have any parParams). Having fixed that, we might as well allow subplans as well as initplans.
* Fix SELECT INTO and CREATE TABLE AS to create tables in the defaultBruce Momjian2006-04-26
| | | | | | tablespace, not the base directory. Kris Jurka
* Revise large-object access routines to avoid running with CurrentMemoryContextTom Lane2006-04-26
| | | | | | | | | | | | | set to the large object context ("fscxt"), as this is inevitably a source of transaction-duration memory leaks. Not sure why we'd not noticed it before; maybe people weren't touching a whole lot of LOs in the same transaction before the 8.1 pg_dump changes. Per report from Wayne Conrad. Backpatched as far as 8.1, but the problem doubtless goes all the way back. I'm disinclined to spend the time to try to verify that the older branches would still work if patched, seeing that this code was significantly modified for 8.0 and again for 8.1, and that we don't have any trouble reports before 8.1. (Maybe the leaks were smaller before?)
* The 8.1 planner removes WHERE quals from the plan when the quals areTom Lane2006-04-25
| | | | | | | implied by the predicate of a partial index being used to scan a table. However, this optimization is unsafe in an UPDATE, DELETE, or SELECT FOR UPDATE query, because the quals need to be rechecked by EvalPlanQual if there's an update conflict. Per example from Jean-Samuel Reynaud.
* Improve our private implementation of cbrt() to give results of theTom Lane2006-04-24
| | | | | accuracy expected by the regression tests. Per suggestion from Martijn van Oosterhout.
* Fixed memory leak bugs found by Martijn Oosterhout.Michael Meskes2006-04-24
|
* Fixes for BCC 5.5 compile of libpq. Backpatch to 8.1.X.Bruce Momjian2006-04-24
| | | | Mark Morgan Lloyd
* Don't add a shared dependency on the owner of a composite type in pg_class.Alvaro Herrera2006-04-24
| | | | | We track the owner in pg_type instead, as that is the place where the owner is changed on ALTER TYPE ... OWNER TO.
* Fix ancient memory leak in PQprintTuples(); our code no longer uses thisTom Lane2006-04-19
| | | | | routine, but perhaps some applications do. Found by Martijn van Oosterhout using Coverity.
* Document that errors are not output by log_statement (was they were inBruce Momjian2006-04-18
| | | | | | | | | 8.0), and add as suggestion to use log_min_error_statement for this purpose. I also fixed the code so the first EXECUTE has it's prepare, rather than the last which is what was in the current code. Also remove "protocol" prefix for SQL EXECUTE output because it is not accurate. Backpatch to 8.1.X.
* Fix similar_escape() so that SIMILAR TO works properly for patterns involvingTom Lane2006-04-13
| | | | | | | | | | | | | | alternatives ("|" symbol). The original coding allowed the added ^ and $ constraints to be absorbed into the first and last alternatives, producing a pattern that would match more than it should. Per report from Eric Noriega. I also changed the pattern to add an ARE director ("***:"), ensuring that SIMILAR TO patterns do not change behavior if regex_flavor is changed. This is necessary to make the non-capturing parentheses work, and seems like a good idea on general principles. Back-patched as far as 7.4. 7.3 also has the bug, but a fix seems impractical because that version's regex engine doesn't have non-capturing parens.
* Fix pg_restore -n option to do what the man page says it does. TheTom Lane2006-04-12
| | | | | original coding only worked if one of the selTypes restriction options was also given. Per report from Nick Johnson.
* Revert my best_inner_indexscan patch of yesterday, which turns out to haveTom Lane2006-04-09
| | | | | | | 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.
* Fix best_inner_indexscan to actually enforce that an "inner indexscan" useTom Lane2006-04-08
| | | | | | | 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 :-(
* Fix pg_dumpall to do something sane when a pre-8.1 installation hasTom Lane2006-04-07
| | | | | | 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.
* Fix make_restrictinfo_from_bitmapqual() to preserve AND/OR flatness of itsTom Lane2006-04-07
| | | | | | | | | 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.
* Adjust interval-addition test so that it won't fail on DST transition days.Tom Lane2006-04-02
| | | | Strange that we missed this DST dependence while fixing the others.
* 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.