Branches

rowexpr91

View source
rowexpr91
  • Contributors
    1. Loading...
Author Commit Message Labels Comments Date
250+ commits behind jsonapi.
Andrew Dunstan
Backport 9.2devel RowExpr changed to 9.1.
Michael Meskes
Do not use the variable name when defining a varchar structure in ecpg. With a unique counter being added anyway, there is no need anymore to have the variable name listed, too.
Andrew Dunstan
Fix auto-explain JSON output to be valid JSON. Problem reported by Peter Eisentraut. Backpatched to release 9.0.
Tom Lane
Fix I/O-conversion-related memory leaks in plpgsql. Datatype I/O functions are allowed to leak memory in CurrentMemoryContext, since they are generally called in short-lived contexts. However, plpgsql calls such functions for purposes of type conversion, and was calling them in its procedure context. Therefore, any leaked memory would not be recovered until the end of the plpgsql function. If such a conversion was done within a loop, quite a bit…
Tom Lane
Fix oversight in pg_dump's handling of extension configuration tables. If an extension has not been selected to be dumped (perhaps because of a --schema or --table switch), the contents of its configuration tables surely should not get dumped either. Per gripe from Hubert Depesz Lubaczewski.
Tom Lane
Fix brain fade in previous pg_dump patch. In pre-7.3 databases, pg_attribute.attislocal doesn't exist. The easiest way to make sure the new inheritance logic behaves sanely is to assume it's TRUE, not FALSE. This will result in printing child columns even when they're not really needed. We could work harder at trying to reconstruct a value for attislocal, but there is little evidence that anyone still cares about dumping from such old …
Tom Lane
Fix pg_dump for better handling of inherited columns. Revise pg_dump's handling of inherited columns, which was last looked at seriously in 2001, to eliminate several misbehaviors associated with inherited default expressions and NOT NULL flags. In particular make sure that a column is printed in a child table's CREATE TABLE command if and only if it has attislocal = true; the former behavior would sometimes cause a column to become marked attisloca…
Tom Lane
Throw error sooner for unlogged GiST indexes. Throwing an error only after we've built the main index fork is pretty unfriendly when the table already contains data. Per gripe from Jay Levitt.
Tom Lane
Fix postmaster to attempt restart after a hot-standby crash. The postmaster was coded to treat any unexpected exit of the startup process (i.e., the WAL replay process) as a catastrophic crash, and not try to restart it. This was OK so long as the startup process could not have any sibling postmaster children. However, if a hot-standby backend crashes, we SIGQUIT the startup process along with everything else, and the resulting exit is hardly "unexpected".…
Tom Lane
Avoid throwing ERROR during WAL replay of DROP TABLESPACE. Although we will not even issue an XLOG_TBLSPC_DROP WAL record unless removal of the tablespace's directories succeeds, that does not guarantee that the same operation will succeed during WAL replay. Foreseeable reasons for it to fail include temp files created in the tablespace by Hot Standby backends, wrong directory permissions on a standby server, etc etc. The original coding threw ERROR if r…
Tom Lane
Avoid problems with OID wraparound during WAL replay. Fix a longstanding thinko in replay of NEXTOID and checkpoint records: we tried to advance nextOid only if it was behind the value in the WAL record, but the comparison would draw the wrong conclusion if OID wraparound had occurred since the previous value. Better to just unconditionally assign the new value, since OID assignment shouldn't be happening during replay anyway. The consequences of a…
Alvaro Herrera
fe-misc.c depends on pg_config_paths.h Declare this in Makefile to avoid failures in parallel compiles. Author: Lionel Elie Mamane
Tom Lane
Fix transient clobbering of shared buffers during WAL replay. RestoreBkpBlocks was in the habit of zeroing and refilling the target buffer; which was perfectly safe when the code was written, but is unsafe during Hot Standby operation. The reason is that we have coding rules that allow backends to continue accessing a tuple in a heap relation while holding only a pin on its buffer. Such a backend could see transiently zeroed data, if WAL replay had occasio…
Simon Riggs
Resolve timing issue with logging locks for Hot Standby. We log AccessExclusiveLocks for replay onto standby nodes, but because of timing issues on ProcArray it is possible to log a lock that is still held by a just committed transaction that is very soon to be removed. To avoid any timing issue we avoid applying locks made by transactions with InvalidXid. Simon Riggs, bug report Tom Lane, diagnosis Pavan Deolasee
Heikki Linnakangas
Accept a non-existent value in "ALTER USER/DATABASE SET ..." command. When default_text_search_config, default_tablespace, or temp_tablespaces setting is set per-user or per-database, with an "ALTER USER/DATABASE SET ..." statement, don't throw an error if the text search configuration or tablespace does not exist. In case of text search configuration, even if it doesn't exist in the current database, it might exist in another database, where the setting is intended…
Tom Lane
Fix pushing of index-expression qualifications through UNION ALL. In commit 57664ed25e5dea117158a2e663c29e60b3546e1c, I made the planner wrap non-simple-variable outputs of appendrel children (IOW, child SELECTs of UNION ALL subqueries) inside PlaceHolderVars, in order to solve some issues with EquivalenceClass processing. However, this means that any upper-level WHERE clauses mentioning such outputs will now contain PlaceHolderVars after they're pushed down in…
Tom Lane
Update statement about sorting of character-string data. The sort order is no longer fixed at database creation time, but can be controlled via COLLATE. Noted by Thomas Kellerer.
Tom Lane
Fix handling of init_plans list in inheritance_planner(). Formerly we passed an empty list to each per-child-table invocation of grouping_planner, and then merged the results into the global list. However, that fails if there's a CTE attached to the statement, because create_ctescan_plan uses the list to find the plan referenced by a CTE reference; so it was unable to find any CTEs attached to the outer UPDATE or DELETE. But there's no real reason not t…
Tom Lane
Fix handling of data-modifying CTE subplans in EvalPlanQual. We can't just skip initializing such subplans, because the referencing CTE node will expect to find the subplan available when it initializes. That in turn means that ExecInitModifyTable must allow the case (which actually it needed to do anyway, since there's no guarantee that ModifyTable is exactly at the top of the CTE plan tree). So move the complaint about not being allowed in EvalPlanQual …
Tom Lane
Fix error detection in contrib/pgcrypto's encrypt_iv() and decrypt_iv(). Due to oversights, the encrypt_iv() and decrypt_iv() functions failed to report certain types of invalid-input errors, and would instead return random garbage values. Marko Kreen, per report from Stefan Kaltenbrunner
Magnus Hagander
Fix wording, per Peter Geoghegan
Bruce Momjian
Now that the shared library name can be adjusted in the library test, have pg_upgrade allocate a maximum fixed size buffer for testing the library file name, rather than base the allocation on the library name. Backpatch to 9.1.
Bruce Momjian
In pg_upgrade, when checking for the plpython library, we must check for "plpython2" when upgrading from pre-PG 9.1. Patch to head and 9.1. Per report from Peter.
Bruce Momjian
Remove tab in 9.1 SGML file.
Heikki Linnakangas
Fix corner case in cleanup of transactions using SSI. When the only remaining active transactions are READ ONLY, we do a "partial cleanup" of committed transactions because certain types of conflicts aren't possible anymore. For committed r/w transactions, we release the SIREAD locks but keep the SERIALIZABLEXACT. However, for committed r/o transactions, we can go further and release the SERIALIZABLEXACT too. The problem was with the latter case: we …
Andrew Dunstan
Improve efficiency of recent changes to plperl's sv2cstr(). Along the way, add a missing dependency in the GNUmakefile. Alex Hunsaker, with a slight adjustment by me.
Tom Lane
Fix CLUSTER/VACUUM FULL for toast values owned by recently-updated rows. In commit 7b0d0e9356963d5c3e4d329a917f5fbb82a2ef05, I made CLUSTER and VACUUM FULL try to preserve toast value OIDs from the original toast table to the new one. However, if we have to copy both live and recently-dead versions of a row that has a toasted column, those versions may well reference the same toast value with the same OID. The patch then led to duplicate-key failures as we tried to i…
Tom Lane
Fix one-byte buffer overrun in contrib/test_parser. The original coding examined the next character before verifying that there *is* a next character. In the worst case with the input buffer right up against the end of memory, this would result in a segfault. Problem spotted by Paul Guyot; this commit extends his patch to fix an additional case. In addition, make the code a tad more readable by not overloading the usage of *tlen.
Tom Lane
Use __sync_lock_test_and_set() for spinlocks on ARM, if available. Historically we've used the SWPB instruction for TAS() on ARM, but this is deprecated and not available on ARMv6 and later. Instead, make use of a GCC builtin if available. We'll still fall back to SWPB if not, so as not to break existing ports using older GCC versions. Eventually we might want to try using __sync_lock_test_and_set() on some other architectures too, but for now that seems to pr…
Tom Lane
Fix typo, pg_types_date.h => pgtypes_date.h. Spotted by Koizumi Satoru.
Tom Lane
Fix pg_restore's direct-to-database mode for INSERT-style table data. In commit 6545a901aaf84cb05212bb6a7674059908f527c3, I removed the mini SQL lexer that was in pg_backup_db.c, thinking that it had no real purpose beyond separating COPY data from SQL commands, which purpose had been obsoleted by long-ago fixes in pg_dump's archive file format. Unfortunately this was in error: that code was also used to identify command boundaries in INSERT-style table data, which …
Robert Haas
Fix variable confusion in BufferSync(). As noted by Heikki Linnakangas, the previous coding confused the "flags" variable with the "mask" variable. The affect of this appears to be that unlogged buffers would get written out at every checkpoint rather than only at shutdown time. Although that's arguably an acceptable failure mode, I'm back-patching this change, since it seems like a poor idea to rely on this happening to work.
Andrew Dunstan
Fix breakage from earlier plperl fix. Apparently the perl garbage collector was a bit too eager, so here we control when the new SV is garbage collected.
Andrew Dunstan
Work around perl bug in SvPVutf8(). Certain things like typeglobs or readonly things like $^V cause perl's SvPVutf8() to die nastily and crash the backend. To avoid that bug we make a copy of the object, which will subsequently be garbage collected. Back patched to 9.1 where we first started using SvPVutf8(). Per -hackers discussion. Original problem reported by David Wheeler.
Tom Lane
Make executor's SELECT INTO code save and restore original tuple receiver. As previously coded, the QueryDesc's dest pointer was left dangling (pointing at an already-freed receiver object) after ExecutorEnd. It's a bit astonishing that it took us this long to notice, and I'm not sure that the known problem case with SQL functions is the only one. Fix it by saving and restoring the original receiver pointer, which seems the most bulletproof way of ensuring any related …
Tom Lane
Fix coerce_to_target_type for coerce_type's klugy handling of COLLATE. Because coerce_type recurses into the argument of a CollateExpr, coerce_to_target_type's longstanding code for detecting whether coerce_type had actually done anything (to wit, returned a different node than it passed in) was broken in 9.1. This resulted in unexpected failures in hide_coercion_node; which was not the latter's fault, since it's critical that we never call it on anything that wasn'…
Tom Lane
Update per-column ACLs, not only per-table ACL, when changing table owner. We forgot to modify column ACLs, so privileges were still shown as having been granted by the old owner. This meant that neither the new owner nor a superuser could revoke the now-untraceable-to-table-owner permissions. Per bug #6350 from Marc Balmer. This has been wrong since column ACLs were added, so back-patch to 8.4.
Tom Lane
Fix gincostestimate to handle ScalarArrayOpExpr reasonably. The original coding of this function overlooked the possibility that it could be passed anything except simple OpExpr indexquals. But ScalarArrayOpExpr is possible too, and the code would probably crash (and surely give ridiculous answers) in such a case. Add logic to try to estimate sanely for such cases. In passing, fix the treatment of inner-indexscan cost estimation: it was failing to scale…
Tom Lane
Avoid crashing when we have problems unlinking files post-commit. smgrdounlink takes care to not throw an ERROR if it fails to unlink something, but that caution was rendered useless by commit 3396000684b41e7e9467d1abc67152b39e697035, which put an smgrexists call in front of it; smgrexists *does* throw error if anything looks funny, such as getting a permissions error from trying to open the file. If that happens post-commit, you get a PANIC, and what's worse t…
Michael Meskes
In ecpg removed old leftover check for given connection name. Ever since we introduced real prepared statements this should work for different connections. The old solution just emulating prepared statements, though, wasn't able to handle this. Closes: #6309
Heikki Linnakangas
Fix reference to "verify-ca" and "verify-full" in a note in the docs.
Andrew Dunstan
Disable excessive FP optimization by recent versions of gcc. Suggested solution from Tom Lane. Problem discovered, probably not for the first time, while testing the mingw-w64 32 bit compiler. Backpatched to all live branches.
Heikki Linnakangas
Revert the behavior of inet/cidr functions to not unpack the arguments. I forgot to change the functions to use the PG_GETARG_INET_PP() macro, when I changed DatumGetInetP() to unpack the datum, like Datum*P macros usually do. Also, I screwed up the definition of the PG_GETARG_INET_PP() macro, and didn't notice because it wasn't used. This fixes the memory leak when sorting inet values, as reported by Jochen Erwied and debugged by Andres Freund. Backpatch to 8.3, lik…
Heikki Linnakangas
Don't set reachedMinRecoveryPoint during crash recovery. In crash recovery, we don't reach consistency before replaying all of the WAL. Rename the variable to reachedConsistency, to make its intention clearer. In master, that was an active bug because of the recent patch to immediately PANIC if a reference to a missing page is found in WAL after reaching consistency, as Tom Lane's test case demonstrated. In 9.1 and 9.0, the only consequence was a misleading "consistent recovery state reached at %X/%X" message in the log at the beginning of crash recovery (the database is not consistent at that point yet…
Tom Lane
Fix corner cases in readlink() usage. Make sure all calls are protected by HAVE_READLINK, and get the buffer overflow tests right. Be a bit more paranoid about string length in _tarWriteHeader(), too.
Magnus Hagander
Avoid using readlink() on platforms that don't support it We don't have any such platforms now, but might in the future. Also, detect cases when a tablespace symlink points to a path that is longer than we can handle, and give a warning.
Magnus Hagander
Add missing documentation for function pg_stat_get_wal_senders() Euler Taveira de Oliveira
Bruce Momjian
In pg_upgrade, allow tables using regclass to be upgraded because we preserve pg_class oids since PG 9.0.
Michael Meskes
Applied another patch by Zoltan to fix memory alignement issues in ecpg's sqlda code.
Magnus Hagander
Treat ENOTDIR as ENOENT when looking for client certificate file This makes it possible to use a libpq app with home directory set to /dev/null, for example - treating it the same as if the file doesn't exist (which it doesn't). Per bug #6302, reported by Diego Elio Petteno
Tom Lane
Add some weasel wording about threaded usage of PGresults. PGresults used to be read-only from the application's viewpoint, but now that we've exposed various functions that allow modification of a PGresult, that sweeping statement is no longer accurate. Noted by Dmitriy Igrishin.
Tom Lane
Stamp 9.1.2.
Tom Lane
Clarify documentation about SQL:2008 variant of LIMIT/OFFSET syntax. The point that you need parentheses for non-constant expressions apparently needs to be brought out a bit more clearly, per bug #6315.
Peter Eisentraut
Translation updates
Tom Lane
Fix getTypeIOParam to support type record[]. Since record[] uses array_in, it needs to have its element type passed as typioparam. In HEAD and 9.1, this fix essentially reverts commit 9bc933b2125a5358722490acbc50889887bf7680, which was a hack that is no longer needed since domains don't set their typelem anymore. Before that, adjust the logic so that only domains are excluded from being treated like arrays, rather than assuming that only b…
Tom Lane
Update information about configuring SysV IPC parameters on NetBSD. Per Emmanuel Kasper, sysctl works fine as of NetBSD 5.0.
Tom Lane
Draft release notes for 9.1.2, 9.0.6, 8.4.10, 8.3.17, 8.2.23.
Tom Lane
Update time zone data files to tzdata release 2011n. DST law changes in Brazil, Cuba, Fiji, Palestine, Russia, Samoa. Historical corrections for Alaska and British East Africa.
Tom Lane
Tweak previous patch to ensure edata->filename always gets initialized. On a platform that isn't supplying __FILE__, previous coding would either crash or give a stale result for the filename string. Not sure how likely that is, but the original code catered for it, so let's keep doing so.
Peter Eisentraut
Strip file names reported in error messages in vpath builds In vpath builds, the __FILE__ macro that is used in verbose error reports contains the full absolute file name, which makes the error messages excessively verbose. So keep only the base name, thus matching the behavior of non-vpath builds.
Tom Lane
Prevent autovacuum transactions from running in serializable mode. Force the transaction isolation level to READ COMMITTED in autovacuum worker and launcher processes. There is no benefit to using a higher isolation level, and doing so could result in delaying foreground transactions (or maybe even causing unnecessary serialization failures?). Noted by Dan Ports. Also, make sure we disable zero_damaged_pages and statement_timeout in the autovac launcher, not on…
Peter Eisentraut
pg_dump: Add gettext plural support to error message
Tom Lane
Disallow deletion of CurrentExtensionObject while running extension script. While the deletion in itself wouldn't break things, any further creation of objects in the script would result in dangling pg_depend entries being added by recordDependencyOnCurrentExtension(). An example from Phil Sorber convinced me that this is just barely likely enough to be worth expending a couple lines of code to defend against. The resulting error message might be confusing, but it's bet…
Tom Lane
Remove erroneous claim about use of pg_locks.objid for advisory locks. The correct information appears in the text, so just remove the statement in the table, where it did not fit nicely anyway. (Curiously, the correct info has been there much longer than the erroneous table entry.) Resolves problem noted by Daniele Varrazzo. In HEAD and 9.1, also do a bit of wordsmithing on other text on the page.
Tom Lane
Fix some bogosities in pg_dump's foreign-table support. The server name for a foreign table was not quoted at need, as per report from Ronan Dunklau. Also, queries related to FDW options were inadequately schema-qualified in places where the search path isn't just pg_catalog, and were inconsistently formatted everywhere, and we didn't always check that we got the expected number of rows from them.
Tom Lane
Ensure that whole-row junk Vars are always of composite type. The EvalPlanQual machinery assumes that whole-row Vars generated for the outputs of non-table RTEs will be of composite types. However, for the case where the RTE is a function call returning a scalar type, we were doing the wrong thing, as a result of sharing code with a parser case where the function's scalar output is wanted. (Or at least, that's what that case has done historically; it does …
Andrew Dunstan
Fix MSVC builds broken by xsubpp change
Andrew Dunstan
Use the right interpreter for encoding test.
Andrew Dunstan
Use the preferred version of xsubpp, not necessarily the one that came with the distro version of perl. David Wheeler and Alex Hunsaker. Backpatch to 9.1 where it applies cleanly. A simple workaround is available for earlier branches, and further effort doesn't seem warranted.
Tom Lane
Fix overly-aggressive and inconsistent quoting in OS X start script. Sidar Lopez, per bug #6310, with some additional improvements by me. Back-patch to 9.0, where the issue was introduced.
Andrew Dunstan
Ensure plperl strings are always correctly UTF8 encoded. Amit Khandekar and Alex Hunsaker. Backpatched to 9.1 where the problem first occurred.
Bruce Momjian
Allow pg_upgrade to upgrade clusters that use exclusion contraints by fixing pg_dump to properly preserve such indexes. Backpatch to 9.1 and 9.0 (where the bug was introduced).
Tom Lane
Fix erroneous replay of GIN_UPDATE_META_PAGE WAL records. A simple thinko in ginRedoUpdateMetapage, namely failing to increment a loop counter, led to inserting records into the last pending-list page in the wrong order (the opposite of that intended). So far as I can tell, this would not upset the code that eventually flushes pending items into the main part of the GIN index. But it did break the code that searched the pending list for matches, result…
Heikki Linnakangas
Preserve SQLSTATE when an SPI error is propagated through PL/python exception handler. This was a regression in 9.1, when the capability to catch specific SPI errors was added, so backpatch to 9.1. Mika Eloranta, with some editing by Jan Urbański.
Tom Lane
Fix citext upgrade script to update derived copies of pg_type.typcollation. If the existing citext type has not merely been created, but used in any tables, then the upgrade script wasn't doing enough. We have to update attcollation for each citext table column, and indcollation for each citext index column, as well. Per report from Rudolf van der Leeden.
Tom Lane
Avoid floating-point underflow while tracking buffer allocation rate. When the system is idle for awhile after activity, the "smoothed_alloc" state variable in BgBufferSync converges slowly to zero. With standard IEEE float arithmetic this results in several iterations with denormalized values, which causes kernel traps and annoying log messages on some poorly-designed platforms. There's no real need to track such small values of smoothed_alloc, so we can prevent …
Bruce Momjian
Fix pg_upgrade's pg_scandir_internal() the right way. Backpatch to 9.1.
Bruce Momjian
Fix pg_upgrade's pg_scandir_internal() to properly handle a NULL pattern, which is used on PG 9.1 and HEAD (but not pre-9.1). Fixes crash on Windows. Backpatched to 9.1. Reported by Mark Dilger
Michael Meskes
Applied Zoltan's patch to correctly align interval and timestamp data in ecpg's sqlda.
Robert Haas
Don't elide blank lines when accumulating psql command history. This can change the meaning of queries, if the blank line happens to occur in the middle of a quoted literal, as per complaint from Tomas Vondra. Back-patch to all supported branches.
Michael Meskes
Applied patch by Zoltan to fix copy&paste bug in ecpg's sqlda handling.
Tom Lane
In plpgsql, allow foreign tables to define row types. This seems to have been just an oversight in previous foreign-table work. A quick grep didn't turn up any other places where RELKIND_FOREIGN_TABLE was obviously omitted. One change noted by Alexander Soudakov, the other by me. Back-patch to 9.1.
Tom Lane
Throw nice error if server is too old to support psql's \ef or \sf command. Previously, you'd get "function pg_catalog.pg_get_functiondef(integer) does not exist", which is at best rather unprofessional-looking. Back-patch to 8.4 where \ef was introduced. Josh Kupershmidt
Robert Haas
Correct documentation for trace_userlocks.
Tom Lane
Avoid platform-dependent infinite loop in pg_dump. If malloc(0) returns NULL, the binary search in findSecLabels() will probably go into an infinite loop when there are no security labels, because NULL-1 is greater than NULL after wraparound. (We've seen this pathology before ... I wonder whether there's a way to detect the class of bugs automatically?) Diagnosis and patch by Steve Singer, cosmetic adjustments by me
Peter Eisentraut
Fix server header file installation with vpath builds Several server header files would not be installed in vpath builds because they live in the build directory.
Bruce Momjian
Document that PQexec() can handle a NULL res pointer just fine. Backpatch to 9.1. Mark Hills
Peter Eisentraut
Only install the extension files for the current Python major version
Tom Lane
Fix random discrepancies between parallel_schedule and serial_schedule. In particular, my previous patch expected the create_index test to run before the inherit test; but this was only true in the serial schedule. Rearrange this portion of the schedules to be more consistent. Per buildfarm results.
Tom Lane
Wrap appendrel member outputs in PlaceHolderVars in additional cases. Add PlaceHolderVar wrappers as needed to make UNION ALL sub-select output expressions appear non-constant and distinct from each other. This makes the world safe for add_child_rel_equivalences to do what it does. Before, it was possible for that function to add identical expressions to different EquivalenceClasses, which logically should imply merging such ECs, which would be wrong; or to improp…
Heikki Linnakangas
Make DatumGetInetP() unpack inet datums with a 1-byte header, and add a new macro, DatumGetInetPP(), that does not. This brings these macros in line with other DatumGet*P() macros. Backpatch to 8.3, where 1-byte header varlenas were introduced.
Peter Eisentraut
-DLINUX_OOM_ADJ=0 should be in CPPFLAGS, not CFLAGS
Tom Lane
Fix assorted bugs in contrib/unaccent's configuration file parsing. Make it use t_isspace() to identify whitespace, rather than relying on sscanf which is known to get it wrong on some platform/locale combinations. Get rid of fixed-size buffers. Make it actually continue to parse the file after ignoring a line with untranslatable characters, as was obviously intended. The first of these issues is per gripe from J Smith, though not exactly either of his proposed …
Tom Lane
Don't assume that a tuple's header size is unchanged during toasting. This assumption can be wrong when the toaster is passed a raw on-disk tuple, because the tuple might pre-date an ALTER TABLE ADD COLUMN operation that added columns without rewriting the table. In such a case the tuple's natts value is smaller than what we expect from the tuple descriptor, and so its t_hoff value could be smaller too. In fact, the tuple might not have a null bitmap at all, and y…
Peter Eisentraut
Fix archive_command example The given archive_command example didn't use %p or %f, which wouldn't really work in practice.
Tom Lane
Fix bogus code in contrib/ tsearch dictionary examples. Both dict_int and dict_xsyn were blithely assuming that whatever memory palloc gives back will be pre-zeroed. This would typically work for just about long enough to run their regression tests, and no longer :-(. The pre-9.0 code in dict_xsyn was even lamer than that, as it would happily give back a pointer to the result of palloc(0), encouraging its caller to access off the end of memory. Agai…
Tom Lane
Fix inline_set_returning_function() to allow multiple OUT parameters. inline_set_returning_function failed to distinguish functions returning generic RECORD (which require a column list in the RTE, as well as run-time type checking) from those with multiple OUT parameters (which do not). This prevented inlining from happening. Per complaint from Jay Levitt. Back-patch to 8.4 where this capability was introduced.
Tom Lane
Fix handling of PlaceHolderVars in nestloop parameter management. If we use a PlaceHolderVar from the outer relation in an inner indexscan, we need to reference the PlaceHolderVar as such as the value to be passed in from the outer relation. The previous code effectively tried to reconstruct the PHV from its component expression, which doesn't work since (a) the Vars therein aren't necessarily bubbled up far enough, and (b) it would be the wrong semantics anywa…
Tom Lane
Revert "Stop btree indexscans upon reaching nulls in either direction." This reverts commit 048fffed55ff1d6d346130e4a6b7be434e81e82c. As pointed out by Naoya Anzai, we need to do more work to make that idea handle end-of-index cases, and it is looking like too much risk for a back-patch. So bug #6278 is only going to be fixed in HEAD.
Simon Riggs
Derive oldestActiveXid at correct time for Hot Standby. There was a timing window between when oldestActiveXid was derived and when it should have been derived that only shows itself under heavy load. Move code around to ensure correct timing of derivation. No change to StartupSUBTRANS() code, which is where this failed. Bug report by Chris Redekop
Simon Riggs
Start Hot Standby faster when initial snapshot is incomplete. If the initial snapshot had overflowed then we can start whenever the latest snapshot is empty, not overflowed or as we did already, start when the xmin on primary was higher than xmax of our starting snapshot, which proves we have full snapshot data. Bug report by Chris Redekop
Simon Riggs
Fix timing of Startup CLOG and MultiXact during Hot Standby Patch by me, bug report by Chris Redekop, analysis by Florian Pflug
Tom Lane
Fix race condition with toast table access from a stale syscache entry. If a tuple in a syscache contains an out-of-line toasted field, and we try to fetch that field shortly after some other transaction has committed an update or deletion of the tuple, there is a race condition: vacuum could come along and remove the toast tuples before we can fetch them. This leads to transient failures like "missing chunk number 0 for toast value NNNNN in pg_toast_2619", as seen in…
Magnus Hagander
Document that multiple LDAP servers can be specified
Tom Lane
Stop btree indexscans upon reaching nulls in either direction. The existing scan-direction-sensitive tests were overly complex, and failed to stop the scan in cases where it's perfectly legitimate to do so. Per bug #6278 from Maksym Boguk. Back-patch to 8.3, which is as far back as the patch applies easily. Doesn't seem worth sweating over a relatively minor performance issue in 8.2 at this late date. (But note that this was a performance regression from 8.…
Tom Lane
Fix assorted bogosities in cash_in() and cash_out(). cash_out failed to handle multiple-byte thousands separators, as per bug #6277 from Alexander Law. In addition, cash_in didn't handle that either, nor could it handle multiple-byte positive_sign. Both routines failed to support multiple-byte mon_decimal_point, which I did not think was worth changing, but at least now they check for the possibility and fall back to using '.' rather than emitting…
Robert Haas
Clarify that ORDER BY/FOR UPDATE can't malfunction at higher iso levels. Kevin Grittner
Robert Haas
Change "and and" to "and". Report by Vik Reykja, patch by Kevin Grittner.
Tom Lane
Update docs to point to the timezone library's new home at IANA. The recent unpleasantness with copyrights has accelerated a move that was already in planning.
Tom Lane
Typo fixes. expect -> except, noted by Andrew Dunstan. Also, "cannot" seems more readable here than "can not", per David Wheeler.
Tom Lane
Change FK trigger creation order to better support self-referential FKs. When a foreign-key constraint references another column of the same table, row updates will queue both the PK's ON UPDATE action and the FK's CHECK action in the same event. The ON UPDATE action must execute first, else the CHECK will check a non-final state of the row and possibly throw an inappropriate error, as seen in bug #6268 from Roman Lytovchenko. Now, the firing order of multiple trigge…
Magnus Hagander
Fix typo
Tom Lane
Don't trust deferred-unique indexes for join removal. The uniqueness condition might fail to hold intra-transaction, and assuming it does can give incorrect query results. Per report from Marti Raudsepp, though this is not his proposed patch. Back-patch to 9.0, where both these features were introduced. In the released branches, add the new IndexOptInfo field to the end of the struct, to try to minimize ABI breakage for third-party code that may b…
Heikki Linnakangas
Fix overly-complicated usage of errcode_for_file_access(). No need to do "errcode(errcode_for_file_access())", just "errcode_for_file_access()" is enough. The extra errcode() call is useless but harmless, so there's no user-visible bug here. Nevertheless, backpatch to 9.1 where this code were added.
Tom Lane
More cleanup after failed reduced-lock-levels-for-DDL feature. Turns out that use of ShareUpdateExclusiveLock or ShareRowExclusiveLock to protect DDL changes had gotten copied into several places that were not touched by either of Simon's original patches for the feature, and thus neither he nor I thought to revert them. (Indeed, it appears that two of these uses were committed *after* the reversion, which just goes to show that git merging is no panacea.) …
Robert Haas
Fix DROP OPERATOR FAMILY IF EXISTS. Essentially, the "IF EXISTS" portion was being ignored, and an error thrown anyway if the opfamily did not exist. I broke this in commit fd1843ff8979c0461fb3f1a9eab61140c977e32d; so backpatch to 9.1.X. Report and diagnosis by KaiGai Kohei.
Tom Lane
Simplify and improve ProcessStandbyHSFeedbackMessage logic. There's no need to clamp the standby's xmin to be greater than GetOldestXmin's result; if there were any such need this logic would be hopelessly inadequate anyway, because it fails to account for within-database versus cluster-wide values of GetOldestXmin. So get rid of that, and just rely on sanity-checking that the xmin is not wrapped around relative to the nextXid counter. Also, don't reset …
Tom Lane
Fix memory leak in tab completion. This was introduced in commit e49ad77ff958b380ea6fa08c72e2dce97ac56c6b. Fixed in another, more future-proof way in HEAD.
Robert Haas
Document that postmaster.opts is excluded from base backups Fujii Masao
Tom Lane
Fix pg_dump to dump casts between auto-generated types. The heuristic for when to dump a cast failed for a cast between table rowtypes, as reported by Frédéric Rejol. Fix it by setting the "dump" flag for such a type the same way as the flag is set for the underlying table or base type. This won't result in the auto-generated type appearing in the output, since setting its objType to DO_DUMMY_TYPE unconditionally suppresses that. But it will result …
Magnus Hagander
Exclude postmaster.opts from base backups Noted by Fujii Masao
Tom Lane
Fix collate.linux.utf8 expected output for recent error message change. Noted by Jeff Davis.
Tom Lane
Fix bugs in information_schema.referential_constraints view. This view was being insufficiently careful about matching the FK constraint to the depended-on primary or unique key constraint. That could result in failure to show an FK constraint at all, or showing it multiple times, or claiming that it depended on a different constraint than the one it really does. Fix by joining via pg_depend to ensure that we find only the correct dependency. Back-patch,…
Tom Lane
Fix up Perl-to-Postgres datatype conversions in pl/perl. This patch restores the pre-9.1 behavior that pl/perl functions returning VOID ignore the result value of their last Perl statement. 9.1.0 unintentionally threw an error if the last statement returned a reference, as reported by Amit Khandekar. Also, make sure it works to return a string value for a composite type, so long as the string meets the type's input format. We already allowed the equi…
Bruce Momjian
Update documentation about ts_rank().
Tom Lane
Fix typo in dummy_seclabel documentation. dummy_label -> dummy_seclabel Thom Brown
Tom Lane
Don't mark auto-generated types as extension members. Relation rowtypes and automatically-generated array types do not need to have their own extension membership dependency entries. If we create such then it becomes more difficult to remove items from an extension, and it's also harder for an extension upgrade script to make sure it duplicates the dependencies created by the extension's regular installation script. I changed the code in such a way…
Tom Lane
Throw a useful error message if an extension script file is fed to psql. We have seen one too many reports of people trying to use 9.1 extension files in the old-fashioned way of sourcing them in psql. Not only does that usually not work (due to failure to substitute for MODULE_PATHNAME and/or @extschema@), but if it did work they'd get a collection of loose objects not an extension. To prevent this, insert an \echo ... \quit line that prints a suitable error message…
Bruce Momjian
Modify up/home macro to match standard parameter list; fixes doc build.
Tom Lane
Improve documentation of psql's \q command. The documentation neglected to explain its behavior in a script file (it only ends execution of the script, not psql as a whole), and failed to mention the long form \quit either.
Bruce Momjian
Add Up/Home link to the top of the HTML doc output. Backpatch to 9.0.X and 9.1.X.
Bruce Momjian
Document that not backing up postmaster.pid and postmaster.opts might help prevent pg_ctl from getting confused. Backpatch to 9.1.
Robert Haas
Improve documentation of how to fiddle with SCSI drives on FreeBSD. Per suggestions from Achilleas Mantzios and Greg Smith.
Robert Haas
Fix typo in docs for libpq keepalives_count option. Shigehiro Honda
Robert Haas
Revert accidental change to pg_config_manual.h. This was broken in commit 53dbc27c62d8e1b6c5253feba04a5094cb8fe046, which introduced unlogged tables. Fortunately, as debugging tools go, this one is pretty cheap, which is probably why it took nine months for someone to notice, but it's not intended to be enabled by default, so revert. Noted by Fujii Masao.
Heikki Linnakangas
Don't let transform_null_equals=on affect CASE foo WHEN NULL ... constructs. transform_null_equals is only supposed to affect "foo = NULL" expressions given directly by the user, not the internal "foo = NULL" expression generated from CASE-WHEN. This fixes bug #6242, reported by Sergey. Backpatch to all supported branches.
Robert Haas
Add missing space. Dickson S. Guedes
Magnus Hagander
Ensure walsenders can be SIGTERMed while in non-walsender code In oder to exit on SIGTERM when in non-walsender code, such as do_pg_stop_backup(), we need to set the interrupt variables that are used there, and not just the walsender local ones.
Robert Haas
Make pgstatindex respond to cancel interrupts. A similar problem for pgstattuple() was fixed in April of 2010 by commit 33065ef8bc52253ae855bc959576e52d8a28ba06, but pgstatindex() seems to have been overlooked. Back-patch all the way, as with that commit, though not to 7.4 through 8.1, since those are now EOL.
Tom Lane
Improve and simplify CREATE EXTENSION's management of GUC variables. CREATE EXTENSION needs to transiently set search_path, as well as client_min_messages and log_min_messages. We were doing this by the expedient of saving the current string value of each variable, doing a SET LOCAL, and then doing another SET LOCAL with the previous value at the end of the command. This is a bit expensive though, and it also fails badly if there is anything funny about the exist…
Tom Lane
Add sourcefile/sourceline data to EXEC_BACKEND GUC transmission files. This oversight meant that on Windows, the pg_settings view would not display source file or line number information for values coming from postgresql.conf, unless the backend had received a SIGHUP since starting. In passing, also make the error detection in read_nondefault_variables a tad more thorough, and fix it to not lose precision on float GUCs (these changes are already in HEAD as of my pre…
Tom Lane
ProcedureCreate neglected to record dependencies on default expressions. Thus, an object referenced in a default expression could be dropped while the function remained present. This was unaccountably missed in the original patch to add default parameters for functions. Reported by Pavel Stehule.
Bruce Momjian
Fix pg_upgrade for EXEC_BACKEND builds (e.g. Windows) by properly passing the -b/binary-upgrade flag. Backpatch to 9.1.X.
Tom Lane
Fix index matching for operators with mixed collatable/noncollatable inputs. If an indexable operator for a non-collatable indexed datatype has a collatable right-hand input type, any OpExpr for it will be marked with a nonzero inputcollid (since having one collatable input is sufficient to make that happen). However, an index on a non-collatable column certainly doesn't have any collation. This caused us to fail to match such operators to their indexes, because indxpath…
Bruce Momjian
In pg_upgrade, because toast table names can be mismatched with the heap oid on 8.4, modify the toast name comparison test to only apply to old 9.0+ servers. (The test was previously 8.4+.)
Tom Lane
Take sepgsql regression tests out of the regular regression test mechanism. Back-port the new "test_sepgsql" script into 9.1 to provide a substitute test mechanism.
Tom Lane
Fix window functions that sort by expressions involving aggregates. In commit c1d9579dd8bf3c921ca6bc2b62c40da6d25372e5, I changed things so that the output of the Agg node that feeds the window functions would not list any ungrouped Vars directly. Formerly, for example, the Agg tlist might have included both "x" and "sum(x)", which is not really valid if "x" isn't a grouping column. If we then had a window function ordering on something like "sum(x) + 1", prepar…
Tom Lane
Un-break compression of plain-text output format in pg_dump. pg_dump has historically understood -Z with no -F switch to mean that it should emit a gzip-compressed version of its plain text output. This got broken through a misunderstanding in the 9.1 patch that added directory output format. Restore the former behavior. Per complaint from Roger Niederland and diagnosis by Adrian Klaver.
Magnus Hagander
Fix typo
Magnus Hagander
Note that sslmode=require verifies the CA if root cert is present This mode still exists for backwards compatibility, making sslmode=require the same as sslmode=verify-ca when the file is present, but not causing an error when it isn't. Per bug 6189, reported by Srinivas Aji
Tom Lane
Fix our mapping of Windows timezones for Central America. We were mapping "Central America Standard Time" to "CST6CDT", which seems entirely wrong, because according to the Olson timezone database noplace in Central America observes daylight savings time on any regular basis --- and certainly not according to the USA DST rules that are implied by "CST6CDT". (Mexico is an exception, but they can be disregarded since they have a separate timezone name in …
Simon Riggs
synchronous_commit is an enum not a boolean. Jaime Casanova
Tom Lane
Stamp 9.1.1.
Tom Lane
Update release notes for 9.1.1, 9.0.5, 8.4.9, 8.3.16, 8.2.22. Man, we fixed a lotta bugs since April.
Peter Eisentraut
Translation updates
Robert Haas
Fix another bit of unlogged-table-induced breakage. Per bug #6205, reported by Abel Abraham Camarillo Ojeda. This isn't a particularly elegant fix, but I'm trying to minimize the chances of causing yet another round of breakage. Adjust regression tests to exercise this case.
Tom Lane
Suppress "unused function" warning when not HAVE_LOCALE_T. Forgot to consider this case ...
Tom Lane
Improve reporting of newlocale() failures in CREATE COLLATION. The standardized errno code for "no such locale" failures is ENOENT, which we were just reporting at face value, viz "No such file or directory". Per gripe from Thom Brown, this might confuse users, so add an errdetail message to clarify what it means. Also, report newlocale() failures as ERRCODE_INVALID_PARAMETER_VALUE rather than using errcode_for_file_access(), since newlocale()'s errno values…
Tom Lane
Avoid unnecessary page-level SSI lock check in heap_insert(). As observed by Heikki, we need not conflict on heap page locks during an insert; heap page locks are only aggregated tuple locks, they don't imply locking "gaps" as index page locks do. So we can avoid some unnecessary conflicts, and also do the SSI check while not holding exclusive lock on the target buffer. Kevin Grittner, reviewed by Jeff Davis. Back-patch to 9.1.
Tom Lane
gistendscan() forgot to free so->giststate. This oversight led to a massive memory leak --- upwards of 10KB per tuple --- during creation-time verification of an exclusion constraint based on a GIST index. In most other scenarios it'd just be a leak of 10KB that would be recovered at end of query, so not too significant; though perhaps the leak would be noticeable in a situation where a GIST index was being used in a nestloop inner indexsc…
Heikki Linnakangas
Teach the makefile used to build stand-alone libpq on Windows that libpq needs win32setlocale.c now. The cygwin and MSVC build scripts were changed earlier, but this was neglected. This should fix bug report #6203 by Steve.
Heikki Linnakangas
In the manual section on primary_conninfo, recommend using a role with REPLICATION privileges, not SUPERUSER. Fujii Masao
Tom Lane
deflist_to_tuplestore dumped core on an option with no value. Make it return NULL for the option_value, instead. Per report from Frank van Vugt. Back-patch to 8.4 where this code was added.
Tom Lane
Stamp 9.1.0.
Peter Eisentraut
Translation updates for 9.1.0
Peter Eisentraut
Add missing format argument to ecpg_log() call
Tom Lane
One last round of copy-editing for the 9.1 release notes. Also set the documented release date to 2011-09-12.
Tom Lane
Fix corner case bug in numeric to_char(). Trailing-zero stripping applied by the FM specifier could strip zeroes to the left of the decimal point, for a format with no digit positions after the decimal point (such as "FM999."). Reported and diagnosed by Marti Raudsepp, though I didn't use his patch.
Bruce Momjian
Allow bcc32 and win32 batch files to compile libpq. Backpatch to 9.1. By Hiroshi Saito
Bruce Momjian
In pg_upgrade, disallow migration of 8.3 clusters using contrib/ltree because its internal format was changed in 8.4. Backpatch to 9.0 and 9.1. Report by depesz, diagnosis by Tom.
Tom Lane
Fix typo in error message. Per Euler Taveira de Oliveira.
Tom Lane
Fix get_name_for_var_field() to deal with RECORD Params. With 9.1's use of Params to pass down values from NestLoop join nodes to their inner plans, it is possible for a Param to have type RECORD, in which case the set of fields comprising the value isn't determinable by inspection of the Param alone. However, just as with a Var of type RECORD, we can find out what we need to know if we can locate the expression that the Param represents. We already k…
Bruce Momjian
Revert documentation patch about NEW/OLD and triggers. Backpatch to 9.0 and 9.1. Patch from Josh Kupershmidt.
Bruce Momjian
Properly document the existance of OLD/NEW trigger pl/pgsql trigger fields. Backpatch to 9.0 and 9.1. Report from Pavel Stehule, patch from Josh Kupershmidt
Bruce Momjian
Fix spelling mistake in pgpass documentation change. Per Peter.
Bruce Momjian
Add documentation suggestion about adding a comment to the top of pgpass. Backpatch to 9.1.
Bruce Momjian
Fix plpgsql "PERFORM" markup. Backpatch to 9.0 and 9.1.
Tom Lane
Avoid possibly accessing off the end of memory in SJIS2004 conversion. The code in shift_jis_20042euc_jis_2004() would fetch two bytes even when only one remained in the string. Since conversion functions aren't supposed to assume null-terminated input, this poses a small risk of fetching past the end of memory and incurring SIGSEGV. No such crash has been identified in the field, but we've certainly seen the equivalent happen in other code paths, so patch this one…
Tom Lane
Avoid possibly accessing off the end of memory in examine_attribute(). Since the last couple of columns of pg_type are often NULL, sizeof(FormData_pg_type) can be an overestimate of the actual size of the tuple data part. Therefore memcpy'ing that much out of the catalog cache, as analyze.c was doing, poses a small risk of copying past the end of memory and incurring SIGSEGV. No such crash has been identified in the field, but we've certainly seen the equivalent ha…
Bruce Momjian
Document PERFORM limitation when using WITH queries. Backpatch to 9.0 and 9.1. Report from depstein@alliedtesting.com.
Tom Lane
Add an "incompatibility" entry to 9.1 release notes about CREATE EXTENSION. We've now seen more than one gripe from somebody who didn't get the memo about how to install contrib modules in 9.1. Try to make it a little more prominent that you aren't supposed to call the scripts directly anymore.
Tom Lane
Update type-conversion documentation for long-ago changes. This example wasn't updated when we changed the behavior of bpcharlen() in 8.0, nor when we changed the number of parameters taken by the bpchar() cast function in 7.3. Per report from lsliang.
Bruce Momjian
Properly document semphore requirements by accounting for worker processes. Backpatch to 9.1 and 9.0. Submitted by Anton Yuzhaninov, confirmed by Robert Haas
Bruce Momjian
Add documentation link to strftime supported options.
Alvaro Herrera
Adjust translator comment format to xgettext expectations
Alvaro Herrera
Mark some untranslatable messages with errmsg_internal
Bruce Momjian
Add mention that UTC really means UT1. Backpatch to 9.1.
Tom Lane
Update time zone data files to tzdata release 2011i. DST law changes in Canada, Egypt, Russia, Samoa, South Sudan.
Bruce Momjian
Document that contrib/pgtrgm only processes ASCII alphanumeric characters. Backpatch to 9.0 and 9.1.
Tom Lane
Guard against using plperl's Makefile without specifying --with-perl. The $(PERL) macro will be set by configure if it finds perl at all, but $(perl_privlibexp) isn't configured unless you said --with-perl. This results in confusing error messages if someone cd's into src/pl/plperl and tries to build there despite the configure omission, as reported by Tomas Vondra in bug #6198. Add simple checks to provide a more useful report, while not disabling other use of the…
Tom Lane
Fix #include problems in 9.1 branch. Remove unnecessary and circular #include of syncrep.h from proc.h. Add htup.h to tablecmds.h so it will compile without prerequisites.
Tom Lane
Fix typo in pg_srand48 (srand48 in older branches). ">" should be ">>". This typo results in failure to use all of the bits of the provided seed. This might rise to the level of a security bug if we were relying on srand48 for any security-critical purposes, but we are not --- in fact, it's not used at all unless the platform lacks srandom(), which is improbable. Even on such a platform the exposure seems minimal. Reported privately by Andres F…
Michael Meskes
Fix brace indentation of commit 5ad0e899f08136a00f56bf224a6b9729b2f4c69f to fit PostgreSQL style.
Heikki Linnakangas
Remove spurious comma. Spotted by Tom.
Heikki Linnakangas
libpq compiles various pgport files like ecpg does, and needs similar Makefile changes for the win32 setlocale() wrapper I put into ecpg, to make it compile on MinGW.
Michael Meskes
In ecpglib restore LC_NUMERIC in case of an error.
Heikki Linnakangas
Fix MinGW build, broken by my previous patch to add a setlocale() wrapper on Windows. ecpglib doesn't link with libpgport, but picks and compiles the .c files it needs individually. To cope with that, move the setlocale() wrapper from chklocale.c to a separate setlocale.c file, and include that in ecpglib.
Heikki Linnakangas
setlocale() on Windows doesn't work correctly if the locale name contains dots. I previously worked around this in initdb, mapping the known problematic locale names to aliases that work, but Hiroshi Inoue pointed out that that's not enough because even if you use one of the aliases, like "Chinese_HKG", setlocale(LC_CTYPE, NULL) returns back the long form, ie. "Chinese_Hong Kong S.A.R.". When we try to restore an old locale value by passing that value back to setlocale(), it fails. Note that you are affected by this bug also if you use one of those short-form names manually, so just reverting the hack in initdb won't fix it. To work around that, move the locale name mapping from initdb to a wrapper around setlocale(), so that the mapping is invoked on every setlocale() call. Also, add a few checks for failed setlocale() calls in the backend. These calls shouldn't fail, and if they do there isn't much we can do about it, but at least you'll get a warning. Backpatch to 9.1, where the initdb hack was introduced. The Wi…
Heikki Linnakangas
Move the line to undefine setlocale() macro on Win32 outside USE_REPL_SNPRINTF ifdef block. It has nothing to do with whether the replacement snprintf function is used. It caused no live bug, because the replacement snprintf function is always used on Win32, but it was nevertheless misplaced.
Tom Lane
Further repair of eqjoinsel ndistinct-clamping logic. Examination of examples provided by Mark Kirkwood and others has convinced me that actually commit 7f3eba30c9d622d1981b1368f2d79ba0999cdff2 was quite a few bricks shy of a load. The useful part of that patch was clamping ndistinct for the inner side of a semi or anti join, and the reason why that's needed is that it's the only way that restriction clauses eliminating rows from the inner relation …
Bruce Momjian
Fix pg_upgrade to preserve toast relfrozenxids for old 8.3 servers. This fixes a pg_upgrade bug that could lead to query errors when clog files are improperly removed. Backpatch to 8.4, 9.0, 9.1.
Tom Lane
Improve eqjoinsel's ndistinct clamping to work for multiple levels of join. This patch fixes an oversight in my commit 7f3eba30c9d622d1981b1368f2d79ba0999cdff2 of 2008-10-23. That patch accounted for baserel restriction clauses that reduced the number of rows coming out of a table (and hence the number of possibly-distinct values of a join variable), but not for join restriction clauses that might have been applied at a lower level of join. To account for the latter, lo…
Heikki Linnakangas
The replication status values in pg_stat_replication was changed to lowercase earlier, but documentation was not updated. Update the docs. Fujii Masao
Tom Lane
Fix not-backwards-compatible pg_upgrade test for prepared transactions. There's no reason for this test to use the undocumented pg_prepared_xact() function, when it can use the stable API pg_prepared_xacts instead. Fixes breakage against 8.3, as reported by Justin Arnold.
Tom Lane
Fix a missed case in code for "moving average" estimate of reltuples. It is possible for VACUUM to scan no pages at all, if the visibility map shows that all pages are all-visible. In this situation VACUUM has no new information to report about the relation's tuple density, so it wasn't changing pg_class.reltuples ... but it updated pg_class.relpages anyway. That's wrong in general, since there is no evidence to justify changing the density ratio reltuples/relpages…
Tom Lane
Fix concat_ws() to not insert a separator after leading NULL argument(s). Per bug #6181 from Itagaki Takahiro. Also do some marginal code cleanup and improve error handling.
Tom Lane
Actually, all of parallel restore's limitations should be tested earlier. On closer inspection, whining in restore_toc_entries_parallel is really much too late for any user-facing error case. The right place to do it is at the start of RestoreArchive(), before we've done anything interesting (suh as trying to DROP all the targets ...) Back-patch to 8.4, where parallel restore was introduced.
Tom Lane
Be more user-friendly about unsupported cases for parallel pg_restore. If we are unable to do a parallel restore because the input file is stdin or is otherwise unseekable, we should complain and fail immediately, not after having done some of the restore. Complaining once per thread isn't so cool either, and the messages should be worded to make it clear this is an unsupported case not some weird race-condition bug. Per complaint from Lonni Friedman. Back-patch t…
Tom Lane
Don't assume that "E" response to NEGOTIATE_SSL_CODE means pre-7.0 server. These days, such a response is far more likely to signify a server-side problem, such as fork failure. Reporting "server does not support SSL" (in sslmode=require) could be quite misleading. But the results could be even worse in sslmode=prefer: if the problem was transient and the next connection attempt succeeds, we'll have silently fallen back to protocol version 2.0, possibly disabling featu…
Tom Lane
Ensure we discard unread/unsent data when abandoning a connection attempt. There are assorted situations wherein PQconnectPoll() will abandon a connection attempt and try again with different parameters (eg, SSL versus not SSL). However, the code forgot to discard any pending data in libpq's I/O buffers when doing this. In at least one case (server returns E message during SSL negotiation), there is unread input data which bollixes the next connection attempt. I have …
Peter Eisentraut
Spelling improvement
Tom Lane
Fix potential memory clobber in tsvector_concat(). tsvector_concat() allocated its result workspace using the "conservative" estimate of the sum of the two input tsvectors' sizes. Unfortunately that wasn't so conservative as all that, because it supposed that the number of pad bytes required could not grow. Which it can, as per test case from Jesper Krogh, if there's a mix of lexemes with positions and lexemes without them in the input data. Th…
Bruce Momjian
In pg_upgrade, limit schema name filter to include toast tables. Bug introduced recently when trying to filter out temp tables. Backpatch to 9.0 and 9.1.
Alvaro Herrera
Add expected isolationtester output when prepared xacts are disabled This was deemed unnecessary initially but in later discussion it was agreed otherwise. Original file from Kevin Grittner, allegedly from Dan Ports. I had to clean up whitespace a bit per changes from Heikki.
Tom Lane
Fix psql lexer to avoid use of backtracking. Per previous experimentation, backtracking slows down lexing performance significantly (by about a third). It's usually pretty easy to avoid, just need to have rules that accept an incomplete construct and do whatever the lexer would have done otherwise. The backtracking was introduced by the patch that added quoted variable substitution. Back-patch to 9.0 where that was added.
Robert Haas
Properly quote SQL/MED generic options in pg_dump output. Shigeru Hanada
Robert Haas
Revert "Tweak postgresql.conf.sample's comments on listen_addresess." This reverts commit 1bde67c0b9adce8b7ed2a2d1fcb2788cf96cea64, which should have been done only on the master branch.
Robert Haas
Tweak postgresql.conf.sample's comments on listen_addresess. This makes it slightly more clear that '*' is not part of the default value, in case that wasn't obvious. As requested by Dougal Sutherland.
Robert Haas
Adjust CREATE DOMAIN example for standard_conforming_strings=on. Noted by Hitoshi Harada.
Tom Lane
Fix pgstatindex() to give consistent results for empty indexes. For an empty index, the pgstatindex() function would compute 0.0/0.0 for its avg_leaf_density and leaf_fragmentation outputs. On machines that follow the IEEE float arithmetic standard with any care, that results in a NaN. However, per report from Rushabh Lathia, Microsoft couldn't manage to get this right, so you'd get a bizarre error on Windows. Fix by forcing the results to be NaN explicitly…
Tom Lane
Fix pgxs.mk to always add --dbname=$(CONTRIB_TESTDB) to REGRESS_OPTS. The previous coding resulted in contrib modules unintentionally overriding the use of CONTRIB_TESTDB. There seems no particularly good reason to allow that (after all, the makefile can set CONTRIB_TESTDB if that's really what it intends). In passing, document REGRESS_OPTS where the other pgxs.mk options are documented. Back-patch to 9.1 --- in prior versions, there were no cases of contrib modu…
Peter Eisentraut
Build src/ before contrib/ in make world This fixes failures under parallel make when contrib modules use a generated backend header file (such as errcodes.h).
Tom Lane
Avoid locale dependency in expected output. We'll have to settle for just listing the extensions' data types, since function arguments seem to sort differently in different locales. Per buildfarm results.
Tom Lane
Fix multiple bugs in extension dropping. When we implemented extensions, we made findDependentObjects() treat EXTENSION dependency links similarly to INTERNAL links. However, that logic contained an implicit assumption that an object could have at most one INTERNAL dependency, so it did not work correctly for objects having both INTERNAL and DEPENDENCY links. This led to failure to drop some extension member objects when dropping the e…
Tom Lane
Make CREATE EXTENSION check schema creation permissions. When creating a new schema for a non-relocatable extension, we neglected to check whether the calling user has permission to create schemas. That didn't matter in the original coding, since we had already checked superuserness, but in the new dispensation where users need not be superusers, we should check it. Use CreateSchemaCommand() rather than calling NamespaceCreate() directly, so that we al…
Tom Lane
Fix overoptimistic assumptions in column width estimation for subqueries. set_append_rel_pathlist supposed that, while computing per-column width estimates for the appendrel, it could ignore child rels for which the translated reltargetlist entry wasn't a Var. This gave rise to completely silly estimates in some common cases, such as constant outputs from some or all of the arms of a UNION ALL. Instead, fall back on get_typavgwidth to estimate from the value's datatyp…
Heikki Linnakangas
Add recovery.conf to the index in the user manual. Fujii Masao
Tom Lane
Fix handling of extension membership when filling in a shell operator. The previous coding would result in deleting and not re-creating the extension membership pg_depend rows, since there was no CommandCounterIncrement that would allow recordDependencyOnCurrentExtension to see that the deletion had happened. Make it work like the shell type case, ie, keep the existing entries (and then throw an error if they're for the wrong extension). Per bug #6172 from Hitoshi …
Tom Lane
Fix trigger WHEN conditions when both BEFORE and AFTER triggers exist. Due to tuple-slot mismanagement, evaluation of WHEN conditions for AFTER ROW UPDATE triggers could crash if there had been a BEFORE ROW trigger fired for the same update. Fix by not trying to overload the use of estate->es_trig_tuple_slot. Per report from Yoran Heling. Back-patch to 9.0, when trigger WHEN conditions were introduced.
Tom Lane
Fix performance problem when building a lossy tidbitmap. As pointed out by Sergey Koposov, repeated invocations of tbm_lossify can make building a large tidbitmap into an O(N^2) operation. To fix, make sure we remove more than the minimum amount of information per call, and add a fallback path to behave sanely if we're unable to fit the bitmap within the requested amount of memory. This has been wrong since the tidbitmap code was written, so back-patc…
Robert Haas
Fix contrib/sepgsql and contrib/xml2 to always link required libraries. contrib/xml2 can get by without libxslt; the relevant features just won't work. But if doesn't have libxml2, or if sepgsql doesn't have libselinux, the link succeeds but the module then fails to work at load time. To avoid that, link the require libraries unconditionally, so that it will be clear at link-time that there is a problem. Per discussion with Tom Lane and KaiGai Kohei.
Robert Haas
Allow sepgsql regression tests to be run from a user homedir. KaiGai Kohei, with some changes by me.
Tom Lane
Tag 9.1rc1.
Tom Lane
Explain max_prepared_transactions requirement in isolation tests' README. Now that we have a test that requires nondefault settings to pass, it seems like we'd better mention that detail in the directions about how to run the tests. Also do some very minor copy-editing.
Heikki Linnakangas
Report libpq errors correctly if session setup or teardown steps fail in isolation regression tests. Alvaro committed these fixes to master branch on Tue Jul 29th, as part of Noah Misch's patch. The rest of that patch is not needed on 9.1, but this part should be backpatched.
Heikki Linnakangas
Add an SSI regression test that tests all interesting permutations in the order of begin, prepare, and commit of three concurrent transactions that have conflicts between them. The test runs for a quite long time, and the expected output file is huge, but this test caught some serious bugs during development, so seems worthwhile to keep. The test uses prepared transactions, so it fails if the server has max_prepared_transactions=0. Because of that, it's marked as "ignore" in the schedule file. Dan Ports
Heikki Linnakangas
Strip whitespace from SQL blocks in the isolation test suite. This is purely cosmetic, it removes a lot of IMHO ugly whitespace from the expected output.
Peter Eisentraut
Improve detection of Python 3.2 installations Because of ABI tagging, the library version number might no longer be exactly the Python version number, so do extra lookups. This affects installations without a shared library, such as ActiveState's installer. Also update the way to detect the location of the 'config' directory, which can also be versioned. Ashesh Vashi
Peter Eisentraut
Change PyInit_plpy to external linkage Module initialization functions in Python 3 must have external linkage, because PyMODINIT_FUNC does dllexport on Windows-like platforms. Without this change, the build with Python 3 fails on Windows.
Tom Lane
Update 9.1 release notes to reflect commits through today. Also do another pass of copy-editing.
Tom Lane
Fix two issues in plpython's handling of composite results. Dropped columns within a composite type were not handled correctly. Also, we did not check for whether a composite result type had changed since we cached the information about it. Jan Urbański, per a bug report from Jean-Baptiste Quenot
Andrew Dunstan
Properly handle empty arrays returned from plperl functions. Bug reported by David Wheeler, fix by Alex Hunsaker. # Please enter the commit message for your changes. Lines starting # with '#' will be ignored, and an empty message aborts the commit. # On branch master # Changes to be committed: # (use "git reset HEAD <file>..." to unstage) # # modified: src/pl/plperl/plperl.c # # Untracked files: # (use "git add <file>..." to include in what will be co…
Peter Eisentraut
Translation updates
Magnus Hagander
Adjust wording now that estimated size can increase Per comment form Fujii Masao.
Heikki Linnakangas
If backup-end record is not seen, and we reach end of recovery from a streamed backup, throw an error and refuse to start up. The restore has not finished correctly in that case and the data directory is possibly corrupt. We already errored out in case of archive recovery, but could not during crash recovery because we couldn't distinguish between the case that pg_start_backup() was called and the database then crashed (must not error, data is OK), and the case that we're restoring from a backup and not all the needed WAL was replayed (data can be corrupt). To distinguish those cases, add a line to backup_label to indicate whether the backup was taken with pg_start/stop_backup(), or by streaming (ie. pg_basebackup). This is a different implementation than what I committed to 9.2 a week ago. That implementation was not back-patchable because it required re-initdb. Fujii Masao
Peter Eisentraut
Move \r out of translatable strings The translation tools are very unhappy about seeing \r in translatable strings, so move it to a separate fprintf call.
Peter Eisentraut
MacOS -> Mac OS Josh Kupershmidt
Tom Lane
Forget about targeting catalog cache invalidations by tuple TID. The TID isn't stable enough: we might queue an sinval event before a VACUUM FULL, and then process it afterwards, when the target tuple no longer has the same TID. So we must invalidate entries on the basis of hash value only. The old coding can be shown to result in various bizarre, hard-to-reproduce errors in the presence of concurrent VACUUM FULLs on system catalogs, and could easily result i…
Tom Lane
Fix incorrect order of operations during sinval reset processing. We have to be sure that we have revalidated each nailed-in-cache relcache entry before we try to use it to load data for some other relcache entry. The introduction of "mapped relations" in 9.0 broke this, because although we updated the state kept in relmapper.c early enough, we failed to propagate that information into relcache entries soon enough; in particular, we could try to fetch pg_class r…
Tom Lane
Preserve toast value OIDs in toast-swap-by-content for CLUSTER/VACUUM FULL. This works around the problem that a catalog cache entry might contain a toast pointer that we try to dereference just as a VACUUM FULL completes on that catalog. We will see the sinval message on the cache entry when we acquire lock on the toast table, but by that point we've already told tuptoaster.c "here's the pointer to fetch", so it's difficult from a code structural standpoint to update th…
171 commits not shown.