[8.3.1] 1. Repair corner-case bugs in VACUUM FULL (Tom) A potential deadlock between concurrent VACUUM FULL operations on different system catalogs was introduced in 8.2. This has now been corrected. 8.3 made this worse because the deadlock could occur within a critical code section, making it a PANIC rather than just ERROR condition. Also, a VACUUM FULL that failed partway through vacuuming a system catalog could result in cache corruption in concurrent database sessions. Another VACUUM FULL bug introduced in 8.3 could result in a crash or out-of-memory report when dealing with pages containing no live tuples. 2. Fix misbehavior of foreign key checks involving character or bit columns (Tom) If the referencing column were of a different but compatible type (for instance varchar), the constraint was enforced incorrectly. 3. Avoid needless deadlock failures in no-op foreign-key checks (Stephan Szabo, Tom) 4. Fix possible core dump when re-planning a prepared query (Tom) This bug affected only protocol-level prepare operations, not SQL PREPARE, and so tended to be seen only with JDBC, DBI, and other client-side drivers that use prepared statements heavily. 5. Fix possible failure when re-planning a query that calls an SPI-using function (Tom) 6. Fix failure in row-wise comparisons involving columns of different datatypes (Tom) 7. Fix incorrect comparison of tsquery values (Teodor) 8. Fix incorrect behavior of LIKE with non-ASCII characters in single-byte encodings (Rolf Jentsch) 9. Disable xmlvalidate (Tom) This function should have been removed before 8.3 release, but was inadvertently left in the source code. It poses a small security risk since unprivileged users could use it to read the first few characters of any file accessible to the server. 10. Make encode(bytea, 'escape') convert all high-bit-set byte values into \nnn octal escape sequences (Tom) This is necessary to avoid encoding problems when the database encoding is multi-byte. This change could pose compatibility issues for applications that are expecting specific results from encode. 11. Avoid tablespace permissions errors in CREATE TABLE LIKE INCLUDING INDEXES (Tom) 12. Fix ecpg problems with arrays (Michael) [8.3.2] 1. Fix incorrect archive truncation point calculation for the %r macro in recovery_command parameters (Simon) This could lead to data loss if a warm-standby script relied on %r to decide when to throw away WAL segment files. 2. Fix REASSIGN OWNED so that it works on procedural languages too (Alvaro) 3. Fix problems with SELECT FOR UPDATE/SHARE occurring as a subquery in a query with a non-SELECT top-level operation (Tom) 4. Restore the pre-8.3 behavior that an out-of-range block number in a TID being used in a TidScan plan results in silently not matching any rows (Tom) 8.3.0 and 8.3.1 threw an error instead. 5. Fix broken GiST comparison function for tsquery (Teodor) 6. Fix tsvector_update_trigger() and ts_stat() to accept domains over the types they expect to work with (Tom) 7. Fix failure to support enum data types as foreign keys (Tom) 8. Fix race conditions between delayed unlinks and DROP DATABASE (Heikki) In the worst case this could result in deleting a newly created table in a new database that happened to get the same OID as the recently-dropped one; but of course that is an extremely low-probability scenario. 9. Fix possible crash due to incorrect plan generated for an x IN (SELECT y FROM ...) clause when x and y have different data types; and make sure the behavior is semantically correct when the conversion from y's type to x's type is lossy (Tom) 10. Fix oversight that prevented the planner from substituting known Param values as if they were constants (Tom) This mistake partially disabled optimization of unnamed extended-Query statements in 8.3.0 and 8.3.1: in particular the LIKE-to-indexscan optimization would never be applied if the LIKE pattern was passed as a parameter, and constraint exclusion depending on a parameter value didn't work either. 11. Fix planner failure when an indexable MIN or MAX aggregate is used with DISTINCT or ORDER BY (Tom) 12. Fix planner to ensure it never uses a "physical tlist" for a plan node that is feeding a Sort node (Tom) This led to the sort having to push around more data than it really needed to, since unused column values were included in the sorted data. 13. Avoid unnecessary copying of query strings (Tom) This fixes a performance problem introduced in 8.3.0 when a very large number of commands are submitted as a single query string. 14. Make TransactionIdIsCurrentTransactionId() use binary search instead of linear search when checking child-transaction XIDs (Heikki) This fixes some cases in which 8.3.0 was significantly slower than earlier releases. 15. Prevent cancellation of an auto-vacuum that was launched to prevent XID wraparound (Alvaro) 16. Improve ANALYZE's handling of in-doubt tuples (those inserted or deleted by a not-yet-committed transaction) so that the counts it reports to the stats collector are more likely to be correct (Pavan Deolasee) 17. Fix initdb to reject a relative path for its --xlogdir (-X) option (Tom) 18. Make psql print tab characters as an appropriate number of spaces, rather than \x09 as was done in 8.3.0 and 8.3.1 (Bruce) 19. Fix handling of continuation line markers in ecpg (Michael) 20. Fix contrib/xml2's makefile to not override CFLAGS, and make it auto-configure properly for libxslt present or not (Tom) [8.3.3] [8.3.4] 1. Fix potential use of wrong cutoff XID for HOT page pruning (Alvaro) This error created a risk of corruption in system catalogs that are consulted by VACUUM: dead tuple versions might be removed too soon. The impact of this on actual database operations would be minimal, since the system doesn't follow MVCC rules while examining catalogs, but it might result in transiently wrong output from pg_dump or other client programs. 2. Fix incorrect HOT updates after pg_class is reindexed (Tom) Corruption of pg_class could occur if REINDEX TABLE pg_class was followed in the same session by an ALTER TABLE RENAME or ALTER TABLE SET SCHEMA command. 3. Fix missed "combo cid" case (Karl Schnaitter) This error made rows incorrectly invisible to a transaction in which they had been deleted by multiple subtransactions that all aborted. 4. Prevent autovacuum from crashing if the table it's currently checking is deleted at just the wrong time (Alvaro) 5. Regenerate foreign key checking queries from scratch when either table is modified (Tom) Previously, 8.3 would attempt to replan the query, but would work from previously generated query text. This led to failures if a table or column was renamed. 6. Fix several memory leaks in XML operations (Kris Jurka, Tom) 7. Fix xmlserialize() to raise error properly for unacceptable target data type (Tom) 8. Fix a couple of places that mis-handled multibyte characters in text search configuration file parsing (Tom) Certain characters occurring in configuration files would always cause "invalid byte sequence for encoding" failures. 9. Fix planner bug that could improperly push down IS NULL tests below an outer join (Tom) This was triggered by occurrence of IS NULL tests for the same relation in all arms of an upper OR clause. 10. Fix ecpg to handle variables properly in SET commands (Michael) 11. Fix erroneous WAL file cutoff point calculation in pg_standby (Simon) [8.3.5] 1. Fix possible crash in bytea-to-XML mapping (Michael McMaster) 2. Fix Assert failure during rescan of an IS NULL search of a GiST index (Teodor) 3. Force a checkpoint before CREATE DATABASE starts to copy files (Heikki) This prevents a possible failure if files had recently been deleted in the source database. 4. Fix incorrect text search headline generation when single query item matches first word of text (Sushant Sinha) 5. Make ILIKE compare characters case-insensitively even when they're escaped (Andrew) 6. Ensure DISCARD is handled properly by statement logging (Tom) 7. Fix incorrect logging of last-completed-transaction time during PITR recovery (Tom) 8. Fix small memory leak when using libpq's gsslib parameter (Magnus) The space used by the parameter string was not freed at connection close. 9. Ensure libgssapi is linked into libpq if needed (Markus Schaaf) [8.3.6] 1. Make DISCARD ALL release advisory locks, in addition to everything it already did (Tom) This was decided to be the most appropriate behavior. This could affect existing applications, however. 2. Fix whole-index GiST scans to work correctly (Teodor) This error could cause rows to be lost if a table is clustered on a GiST index. 3. Fix crash of xmlconcat(NULL) (Peter) 4. Fix possible crash in ispell dictionary if high-bit-set characters are used as flags (Teodor) This is known to be done by one widely available Norwegian dictionary, and the same condition may exist in others. 5. Fix misordering of pg_dump output for composite types (Tom) The most likely problem was for user-defined operator classes to be dumped after indexes or views that needed them. 6. Allow functions declared as taking ANYARRAY to work on the pg_statistic columns of that type (Tom) This used to work, but was unintentionally broken in 8.3. 7. Prevent synchronous scan during GIN index build (Tom) Because GIN is optimized for inserting tuples in increasing TID order, choosing to use a synchronous scan could slow the build by a factor of three or more. 8. Fix encoding conversion problems in XML functions when the database encoding isn't UTF-8 (Tom) 9. Fix incorrect behavior of contrib/tsearch2 compatibility trigger when it's fired more than once in a command (Teodor) 10. Fix possible mis-signaling in autovacuum (Heikki) 11. Fix ecpg's handling of varchar structs (Michael) [8.3.7] 1. Disallow CREATE CONVERSION with the wrong encodings for the specified conversion function (Heikki) 2. This prevents one possible scenario for encoding conversion failure. The previous change is a backstop to guard against other kinds of failures in the same area. 2. Fix xpath() to not modify the path expression unless necessary, and to make a saner attempt at it when necessary (Andrew) The SQL standard suggests that xpath should work on data that is a document fragment, but libxml doesn't support that, and indeed it's not clear that this is sensible according to the XPath standard. xpath attempted to work around this mismatch by modifying both the data and the path expression, but the modification was buggy and could cause valid searches to fail. Now, xpath checks whether the data is in fact a well-formed document, and if so invokes libxml with no change to the data or path expression. Otherwise, a different modification method that is somewhat less likely to fail is used. Note: The new modification method is still not 100% satisfactory, and it seems likely that no real solution is possible. This patch should therefore be viewed as a band-aid to keep from breaking existing applications unnecessarily. It is likely that PostgreSQL 8.4 will simply reject use of xpath on data that is not a well-formed document. 3. Fix possible failure in text search when C locale is used with a multi-byte encoding (Teodor) Crashes were possible on platforms where wchar_t is narrower than int; Windows in particular. 4. Fix extreme inefficiency in text search parser's handling of an email-like string containing multiple @ characters (Heikki) 5. Fix planner problem with sub-SELECT in the output list of a larger subquery (Tom) The known symptom of this bug is a "failed to locate grouping columns" error that is dependent on the datatype involved; but there could be other issues as well. 6. Change UNLISTEN to exit quickly if the current session has never executed any LISTEN command (Tom) Most of the time this is not a particularly useful optimization, but since DISCARD ALL invokes UNLISTEN, the previous coding caused a substantial performance problem for applications that made heavy use of DISCARD ALL. [8.3.8] 1. Fix Windows shared-memory allocation code (Tsutomu Yamada, Magnus) This bug led to the often-reported "could not reattach to shared memory" error message. 2. Prevent synchronize_seqscans from changing the results of scrollable and WITH HOLD cursors (Tom) 3. Fix LIKE for case where pattern contains %_ (Tom) 4. Fix memory leaks in XML operations (Tom) 5. Ensure that a "fast shutdown" request will forcibly terminate open sessions, even if a "smart shutdown" was already in progress (Fujii Masao) 6. Improve pg_dump's efficiency when there are many large objects (Tamas Vincze) 7. Use SIGUSR1, not SIGQUIT, as the failover signal for pg_standby (Heikki) 8. Make pg_standby's maxretries option behave as documented (Fujii Masao) [8.3.9] 1. Avoid crash on empty thesaurus dictionary (Tom) 2. Fix memory leak in syslogger process when rotating to a new CSV logfile (Tom) 3. Fix Windows permission-downgrade logic (Jesse Morris) This fixes some cases where the database failed to start on Windows, often with misleading error messages such as "could not locate matching postgres executable". 4. Raise the maximum authentication token (Kerberos ticket) size in GSSAPI and SSPI authentication methods (Ian Turner) While the old 2000-byte limit was more than enough for Unix Kerberos implementations, tickets issued by Windows Domain Controllers can be much larger. 5. Re-enable collection of access statistics for sequences (Akira Kurosawa) This used to work but was broken in 8.3. 6. Fix incorrect handling of WHERE x=x conditions (Tom) In some cases these could get ignored as redundant, but they aren't - they're equivalent to x IS NOT NULL. 7. Make text search parser accept underscores in XML attributes (Peter) 8. Fix encoding handling in xml binary input (Heikki) If the XML header doesn't specify an encoding, we now assume UTF-8 by default; the previous handling was inconsistent. 9. In contrib/pg_standby, disable triggering failover with a signal on Windows (Fujii Masao) This never did anything useful, because Windows doesn't have Unix-style signals, but recent changes made it actually crash. [8.3.10] 1. Fix possible crash due to use of dangling pointer to a cached plan (Tatsuo) 2. Fix assorted crashes in xml processing caused by sloppy memory management (Tom) This is a back-patch of changes first applied in 8.4. The 8.3 code was known buggy, but the new code was sufficiently different to not want to back-patch it until it had gotten some field testing. 3. Fix bug with trying to update a field of an element of a composite-type array column (Tom) 4. Disallow GSSAPI authentication on local connections, since it requires a hostname to function correctly (Magnus) 5. Make ecpg report the proper SQLSTATE if the connection disappears (Michael) 6. Allow zero-dimensional arrays in contrib/ltree operations (Tom) This case was formerly rejected as an error, but it's more convenient to treat it the same as a zero-element array. In particular this avoids unnecessary failures when an ltree operation is applied to the result of ARRAY(SELECT ...) and the sub-select returns no rows. [8.3.11] 1. Apply per-function GUC settings while running the language validator for the function (Itagaki Takahiro) This avoids failures if the function's code is invalid without the setting; an example is that SQL functions may not parse if the search_path is not correct. 2. Ensure the archiver process responds to changes in archive_command as soon as possible (Tom) 3. Fix unnecessary "GIN indexes do not support whole-index scans" errors for unsatisfiable queries using contrib/intarray operators (Tom) [8.3.12] 1. Fix incorrect usage of non-strict OR joinclauses in Append indexscans (Tom Lane) This is a back-patch of an 8.4 fix that was missed in the 8.3 branch. This corrects an error introduced in 8.3.8 that could cause incorrect results for outer joins when the inner relation is an inheritance tree or UNION ALL subquery. 2. Improve merge join's handling of NULLs in the join columns (Tom Lane) A merge join can now stop entirely upon reaching the first NULL, if the sort order is such that NULLs sort high. 3. Avoid holding open old WAL segments in the walwriter process (Magnus Hagander, Heikki Linnakangas) The previous coding would prevent removal of no-longer-needed segments. 4. Fix REASSIGN OWNED to handle operator classes and families (Asko Tiidumaa) 5. Fix possible core dump when comparing two empty tsquery values (Tom Lane) 6. Fix LIKE's handling of patterns containing % followed by _ (Tom Lane) We've fixed this before, but there were still some incorrectly-handled cases. 7. Make psql recognize DISCARD ALL as a command that should not be encased in a transaction block in autocommit-off mode (Itagaki Takahiro) 8. Fix ecpg to process data from RETURNING clauses correctly (Michael Meskes) [8.3.13] 1. Fix persistent slowdown of autovacuum workers when multiple workers remain active for a long time (Tom Lane) The effective vacuum_cost_limit for an autovacuum worker could drop to nearly zero if it processed enough tables, causing it to run extremely slowly. 2. Fix detection of page splits in temporary GiST indexes (Heikki Linnakangas) 7. It is possible to have a "concurrent" page split in a temporary index, if for example there is an open cursor scanning the index when an insertion is done. GiST failed to detect this case and hence could deliver wrong results when execution of the cursor continued. 3. Fix postmaster crash when connection acceptance (accept() or one of the calls made immediately after it) fails, and the postmaster was compiled with GSSAPI support (Alexander Chernikov) [8.3.14] [8.3.15] 1. Disallow including a composite type in itself (Tom Lane) This prevents scenarios wherein the server could recurse infinitely while processing the composite type. While there are some possible uses for such a structure, they don't seem compelling enough to justify the effort required to make sure it always works safely. [8.4.1] 1. Fix WAL page header initialization at the end of archive recovery (Heikki) This could lead to failure to process the WAL in a subsequent archive recovery. 2. Fix "cannot make new WAL entries during recovery" error (Tom) 3. Fix problem that could make expired rows visible after a crash (Tom) This bug involved a page status bit potentially not being set correctly after a server crash. 4. Make window function PARTITION BY and ORDER BY items always be interpreted as simple expressions (Tom) In 8.4.0 these lists were parsed following the rules used for top-level GROUP BY and ORDER BY lists. But this was not correct per the SQL standard, and it led to possible circularity. 5. Fix several errors in planning of semi-joins (Tom) These led to wrong query results in some cases where IN or EXISTS was used together with another join. 6. Fix handling of whole-row references to subqueries that are within an outer join (Tom) An example is SELECT COUNT(ss.*) FROM ... LEFT JOIN (SELECT ...) ss ON .... Here, ss.* would be treated as ROW(NULL,NULL,...) for null-extended join rows, which is not the same as a simple NULL. Now it is treated as a simple NULL. 7. Fix locale handling with plperl (Heikki) This bug could cause the server's locale setting to change when a plperl function is called, leading to data corruption. 8. Fix handling of reloptions to ensure setting one option doesn't force default values for others (Itagaki Takahiro) 9. Avoid memory leak for array_agg() in GROUP BY queries (Tom) 10. Include the fractional part in the result of EXTRACT(second) and EXTRACT(milliseconds) for time and time with time zone inputs (Tom) This has always worked for floating-point datetime configurations, but was broken in the integer datetime code. 11. Fix a typo that disabled commit_delay (Jeff Janes) 12. Output early-startup messages to postmaster.log if the server is started in silent mode (Tom) Previously such error messages were discarded, leading to difficulty in debugging. 13. Fix several errors in pg_dump's --binary-upgrade mode (Bruce, Tom) pg_dump --binary-upgrade is used by pg_migrator. 14. Work around gcc bug that causes "floating-point exception" instead of "division by zero" on some platforms (Tom) [8.4.2] 1. Fix hash index corruption (Tom) The 8.4 change that made hash indexes keep entries sorted by hash value failed to update the bucket splitting and compaction routines to preserve the ordering. So application of either of those operations could lead to permanent corruption of an index, in the sense that searches might fail to find entries that are present. To deal with this, it is recommended to REINDEX any hash indexes you may have after installing this update. 2. Fix crash if a DROP is attempted on an internally-dependent object (Tom) 3. Fix memory leak in postmaster when re-parsing pg_hba.conf (Tom) 4. Make FOR UPDATE/SHARE in the primary query not propagate into WITH queries (Tom) For example, in WITH w AS (SELECT * FROM foo) SELECT * FROM w, bar ... FOR UPDATEthe FOR UPDATE will now affect bar but not foo. This is more useful and consistent than the original 8.4 behavior, which tried to propagate FOR UPDATE into the WITH query but always failed due to assorted implementation restrictions. It also follows the design rule that WITH queries are executed as if independent of the main query. 5. Fix bug with a WITH RECURSIVE query immediately inside another one (Tom) 6. Fix concurrency bug in hash indexes (Tom) Concurrent insertions could cause index scans to transiently report wrong results. 7. Fix wrong search results for a multi-column GIN index with fastupdate enabled (Teodor) 8. Fix bugs in WAL entry creation for GIN indexes (Tom) These bugs were masked when full_page_writes was on, but with it off a WAL replay failure was certain if a crash occurred before the next checkpoint. 9. Ensure that domain constraints are enforced in constructs like ARRAY[...]::domain, where the domain is over an array type (Heikki) 10. Fix foreign-key logic for some cases involving composite-type columns as foreign keys (Tom) 11. Ensure that a cursor's snapshot is not modified after it is created (Alvaro) This could lead to a cursor delivering wrong results if later operations in the same transaction modify the data the cursor is supposed to return. 12. Fix CREATE TABLE to properly merge default expressions coming from different inheritance parent tables (Tom) This used to work but was broken in 8.4. 13. Fix incorrect plan construction when using hash aggregation to implement DISTINCT for textually identical volatile expressions (Tom) 14. Fix Assert failure for a volatile SELECT DISTINCT ON expression (Tom) 15. Fix ts_stat() to not fail on an empty tsvector value (Tom) 16. Fix ecpg problem with comments in DECLARE CURSOR statements (Michael) 17. Fix ecpg to not treat recently-added keywords as reserved words (Tom) This affected the keywords CALLED, CATALOG, DEFINER, ENUM, FOLLOWING, INVOKER, OPTIONS, PARTITION, PRECEDING, RANGE, SECURITY, SERVER, UNBOUNDED, and WRAPPER. 18. Re-allow regular expression special characters in psql's \df function name parameter (Tom) 19. In contrib/fuzzystrmatch, correct the calculation of levenshtein distances with non-default costs (Marcin Mank) 20. Put FREEZE and VERBOSE options in the right order in the VACUUM command that contrib/vacuumdb produces (Heikki) 21. Fix possible leak of connections when contrib/dblink encounters an error (Tatsuhito Kasahara) [8.4.3] 1. Fix possible crash due to overenthusiastic invalidation of cached plan for ROLLBACK (Tom) 2. Fix bug in WAL redo cleanup method for GIN indexes (Heikki) 3. Fix incorrect comparison of scan key in GIN index search (Teodor) 4. Fix bug occurring when trying to inline a SQL function that returns a set of a composite type that contains dropped columns (Tom) 5. Avoid failure when EXPLAIN has to print a FieldStore or assignment ArrayRef expression (Tom) These cases can arise now that EXPLAIN VERBOSE tries to print plan node target lists. 6. Avoid an unnecessary coercion failure in some cases where an undecorated literal string appears in a subquery within UNION/INTERSECT/EXCEPT (Tom) This fixes a regression for some cases that worked before 8.4. 7. Avoid undesirable rowtype compatibility check failures in some cases where a whole-row Var has a rowtype that contains dropped columns (Tom) 8. Always pass the catalog ID to an option validator function specified in CREATE FOREIGN DATA WRAPPER (Martin Pihlak) 9. Add support for doing FULL JOIN ON FALSE (Tom) This prevents a regression from pre-8.4 releases for some queries that can now be simplified to a constant-false join condition. 10. Prevent treating an INOUT cast as representing binary compatibility (Heikki) 11. Include column name in the message when warning about inability to grant or revoke column-level privileges (Stephen Frost) This is more useful than before and helps to prevent confusion when a REVOKE generates multiple messages, which formerly appeared to be duplicates. 12. Protect ecpg against applications freeing strings unexpectedly (Michael) 13. Fix translation of cell contents in psql \d output (Heikki) 14. Fix a small per-query memory leak in psql (Tom) 15. Fix pg_dump's output of permissions for foreign servers (Heikki) 16. Fix possible crash in parallel pg_restore due to out-of-range dependency IDs (Tom) 17. Prevent ExecutorEnd from being run on portals created within a failed transaction or subtransaction (Tom) This is known to cause issues when using contrib/auto_explain. [8.4.4] 1. Fix data corruption during WAL replay of ALTER ... SET TABLESPACE (Tom) When archive_mode is on, ALTER ... SET TABLESPACE generates a WAL record whose replay logic was incorrect. It could write the data to the wrong place, leading to possibly-unrecoverable data corruption. Data corruption would be observed on standby slaves, and could occur on the master as well if a database crash and recovery occurred after committing the ALTER and before the next checkpoint. 2. Do constraint exclusion for inherited UPDATE and DELETE target tables when constraint_exclusion = partition (Tom) Due to an oversight, this setting previously only caused constraint exclusion to be checked in SELECT commands. 3. Fix erroneous handling of %r parameter in recovery_end_command (Heikki) The value always came out zero. 4. Fix pl/pgsql's CASE statement to not fail when the case expression is a query that returns no rows (Tom) 5. Handle empty-string connect parameters properly in ecpg (Michael) 6. Avoid formatting failure in psql when running in a locale context that doesn't match the client_encoding (Tom) [8.4.5] 1. Fix incorrect placement of placeholder evaluation (Tom Lane) This bug could result in query outputs being non-null when they should be null, in cases where the inner side of an outer join is a sub-select with non-strict expressions in its output list. 2. Fix mishandling of whole-row Vars that reference a view or sub-select and appear within a nested sub-select (Tom Lane) 3. Fix mishandling of cross-type IN comparisons (Tom Lane) This could result in failures if the planner tried to implement an IN join with a sort-then-unique-then-plain-join plan. 4. Fix computation of ANALYZE statistics for tsvector columns (Jan Urbanski) The original coding could produce incorrect statistics, leading to poor plan choices later. 5. Improve planner's estimate of memory used by array_agg(), string_agg(), and similar aggregate functions (Hitoshi Harada) The previous drastic underestimate could lead to out-of-memory failures due to inappropriate choice of a hash-aggregation plan. 6. Fix incorrect search logic for partial-match queries with GIN indexes (Tom Lane) Cases involving AND/OR combination of several GIN index conditions didn't always give the right answer, and were sometimes much slower than necessary. 7. Fix possible corruption of pending trigger event lists during subtransaction rollback (Tom Lane) This could lead to a crash or incorrect firing of triggers. 8. Prevent misinterpretation of partially-specified relation options for TOAST tables (Itagaki Takahiro) In particular, fillfactor would be read as zero if any other reloption had been set for the table, leading to serious bloat. 9. Fix inheritance count tracking in ALTER TABLE ... ADD CONSTRAINT (Robert Haas) 10. Improve CREATE INDEX's checking of whether proposed index expressions are immutable (Tom Lane) 11. Re-allow input of Julian dates prior to 0001-01-01 AD (Tom Lane) Input such as 'J100000'::date worked before 8.4, but was unintentionally broken by added error-checking. 12. Fix PL/pgSQL to throw an error, not crash, if a cursor is closed within a FOR loop that is iterating over that cursor (Heikki Linnakangas) 13. In libpq, fix full SSL certificate verification for the case where both host and hostaddr are specified (Tom Lane) 14. Fix some issues in pg_dump's handling of SQL/MED objects (Tom Lane) Notably, pg_dump would always fail if run by a non-superuser, which was not intended. 15. Improve parallel pg_restore's ability to cope with selective restore (-L option) (Tom Lane) The original code tended to fail if the -L file commanded a non-default restore ordering. 16. Fix some memory leaks in ecpg (Zoltan Boszormenyi) [8.4.6] 1. Fix error checking during early connection processing (Tom Lane) The check for too many child processes was skipped in some cases, possibly leading to postmaster crash when attempting to add the new child process to fixed-size arrays. 2. Improve efficiency of window functions (Tom Lane) Certain cases where a large number of tuples needed to be read in advance, but work_mem was large enough to allow them all to be held in memory, were unexpectedly slow. percent_rank(), cume_dist() and ntile() in particular were subject to this problem. 3. Fix incorrect calculation of transaction status in ecpg (Itagaki Takahiro) [8.4.7] [8.4.8] 1. Fix pg_upgrade's handling of TOAST tables (Bruce Momjian) The pg_class.relfrozenxid value for TOAST tables was not correctly copied into the new installation during pg_upgrade. This could later result in pg_clog files being discarded while they were still needed to validate tuples in the TOAST tables, leading to "could not access status of transaction" failures. This error poses a significant risk of data loss for installations that have been upgraded with pg_upgrade. This patch corrects the problem for future uses of pg_upgrade, but does not in itself cure the issue in installations that have been processed with a buggy version of pg_upgrade. 2. Suppress incorrect "PD_ALL_VISIBLE flag was incorrectly set" warning (Heikki Linnakangas) VACUUM would sometimes issue this warning in cases that are actually valid. 3. Prevent crash triggered by constant-false WHERE conditions during GEQO optimization (Tom Lane) 4. Fix selectivity estimation for text search to account for NULLs (Jesper Krogh) 5. Improve PL/pgSQL's ability to handle row types with dropped columns (Pavel Stehule) This is a back-patch of fixes previously made in 9.0. [9.0.1] 1. Improve pg_get_expr() security fix so that the function can still be used on the output of a sub-select (Tom Lane) 2. Fix join removal's handling of placeholder expressions (Tom Lane) 3. Prevent infinite loop in ProcessIncomingNotify() after unlistening (Jeff Davis) [9.0.2] 1. Fix "too many KnownAssignedXids" error during Hot Standby replay (Heikki Linnakangas) 2. Fix race condition in lock acquisition during Hot Standby (Simon Riggs) 3. Avoid unnecessary conflicts during Hot Standby (Simon Riggs) This fixes some cases where replay was considered to conflict with standby queries (causing delay of replay or possibly cancellation of the queries), but there was no real conflict. 4. Fix corner-case bug when streaming replication is enabled immediately after creating the master database cluster (Heikki Linnakangas) 5. Fix long-term memory leak in autovacuum launcher (Alvaro Herrera) 6. Avoid failure when trying to report an impending transaction wraparound condition from outside a transaction (Tom Lane) This oversight prevented recovery after transaction wraparound got too close, because database startup processing would fail. 7. Add missing support in DROP OWNED BY for removing foreign data wrapper/server privileges belonging to a user (Heikki Linnakangas) 8. Fix crash when inline-ing a set-returning function whose argument list contains a reference to an inline-able user function (Tom Lane) 9. Make the OFF keyword unreserved (Heikki Linnakangas) This prevents problems with using off as a variable name in PL/pgSQL. That worked before 9.0, but was now broken because PL/pgSQL now treats all core reserved words as reserved. 10. Fix "could not find pathkey item to sort" planner failure with comparison of whole-row Vars (Tom Lane) 11. Retry after receiving an invalid response packet from a RADIUS authentication server (Magnus Hagander) This fixes a low-risk potential denial of service condition. 12. Fix errors in psql's Unicode-escape support (Tom Lane) 13. Fix PL/pgSQL's error reporting for no-such-column cases (Tom Lane) As of 9.0, it would sometimes report "missing FROM-clause entry for table foo" when "record foo has no field bar" would be more appropriate. 14. Fix PL/Python to honor typmod (i.e., length or precision restrictions) when assigning to tuple fields (Tom Lane) This fixes a regression from 8.4. 15. Fix buffer overrun in contrib/pg_upgrade (Hernan Gonzalez) [9.0.3] 1. Before exiting walreceiver, ensure all the received WAL is fsync'd to disk (Heikki Linnakangas) Otherwise the standby server could replay some un-synced WAL, conceivably leading to data corruption if the system crashes just at that point. 2. Avoid excess fsync activity in walreceiver (Heikki Linnakangas) 3. Make ALTER TABLE revalidate uniqueness and exclusion constraints when needed (Noah Misch) This was broken in 9.0 by a change that was intended to suppress revalidation during VACUUM FULL and CLUSTER, but unintentionally affected ALTER TABLE as well. 4. Fix EvalPlanQual for UPDATE of an inheritance tree in which the tables are not all alike (Tom Lane) Any variation in the table row types (including dropped columns present in only some child tables) would confuse the EvalPlanQual code, leading to misbehavior or even crashes. Since EvalPlanQual is only executed during concurrent updates to the same row, the problem was only seen intermittently. 5. Fix PL/Python crash when an array contains null entries (Alex Hunsaker) 6. Remove ecpg's fixed length limit for constants defining an array dimension (Michael Meskes) [9.0.4] 1. Prevent intermittent hang in interactions of startup process with bgwriter process (Simon Riggs) This affected recovery in non-hot-standby cases. 2. Allow "replication" as a user name in pg_hba.conf (Andrew Dunstan) "replication" is special in the database name column, but it was mistakenly also treated as special in the user name column. 3. Fix handling of SELECT FOR UPDATE in a sub-SELECT (Tom Lane) This bug typically led to "cannot extract system attribute from virtual tuple" errors. 4. Fix get_actual_variable_range() to support hypothetical indexes injected by an index adviser plugin (Gurjeet Singh) 5. Allow libpq's SSL initialization to succeed when user's home directory is unavailable (Tom Lane) If the SSL mode is such that a root certificate file is not required, there is no need to fail. This change restores the behavior to what it was in pre-9.0 releases. 6. Fix libpq to return a useful error message for errors detected in conninfo_array_parse (Joseph Adams) A typo caused the library to return NULL, rather than the PGconn structure containing the error message, to the application. 7. Fix ecpg preprocessor's handling of float constants (Heikki Linnakangas) 8. Fix parallel pg_restore to handle comments on POST_DATA items correctly (Arnd Hannemann) 9. Avoid crash when trying to write to the Windows console very early in process startup (Rushabh Lathia)