aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* Userspace access vector cache for contrib/sepgsql.Robert Haas2011-09-01
| | | | KaiGai Kohei
* Fix "is db labeled test?" in chkselinuxenv script.Robert Haas2011-09-01
| | | | | | Don't test whether the number of labels is numerically equal to zero; count(*) isn't going return zero anyway, and the current coding blows up if it returns an empty string or an error.
* Remove "fmgr.h" include in cube contrib --- caused crash on a GentooBruce Momjian2011-09-01
| | | | builfarm member.
* Fix MinGW build, broken by my previous patch to add a setlocale() wrapperHeikki Linnakangas2011-09-01
| | | | | | | 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.
* setlocale() on Windows doesn't work correctly if the locale name containsHeikki Linnakangas2011-09-01
| | | | | | | | | | | | | | | | | | | | | | 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 Windows bug affects older versions too if you set locale manually to one of the aliases, but given the lack of complaints from the field, I'm hesitent to backpatch.
* Move the line to undefine setlocale() macro on Win32 outside USE_REPL_SNPRINTFHeikki Linnakangas2011-09-01
| | | | | | 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.
* Further repair of eqjoinsel ndistinct-clamping logic.Tom Lane2011-09-01
| | | | | | | | | | | | | | | | | | | | | 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 can affect the estimated size of the join result. I had not clearly understood why the clamping was appropriate, and so mis-extrapolated to conclude that we should clamp ndistinct for the outer side too, as well as for both sides of regular joins. These latter actions were all wrong, and are reverted with this patch. In addition, the clamping logic is now made to affect the behavior of both paths in eqjoinsel_semi, with or without MCV lists to compare. When we have MCVs, we suppose that the most common values are the ones that are most likely to survive the decimation resulting from a lower restriction clause, so we think of the clamping as eliminating non-MCV values, or potentially even the least-common MCVs for the inner relation. Back-patch to 8.4, same as previous fixes in this area.
* Fix pg_upgrade to preserve toast relfrozenxids for old 8.3 servers.Bruce Momjian2011-08-31
| | | | | | | 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.
* Improve eqjoinsel's ndistinct clamping to work for multiple levels of join.Tom Lane2011-08-31
| | | | | | | | | | | | | | | | | 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, look up the sizes of the min_lefthand and min_righthand inputs of the current join, and clamp with those in the same way as for the base relations. Noted while investigating a complaint from Ben Chobot, although this in itself doesn't seem to explain his report. Back-patch to 8.4; previous versions used different estimation methods for which this heuristic isn't relevant.
* The replication status values in pg_stat_replication was changed toHeikki Linnakangas2011-08-31
| | | | | | lowercase earlier, but documentation was not updated. Update the docs. Fujii Masao
* Fix not-backwards-compatible pg_upgrade test for prepared transactions.Tom Lane2011-08-30
| | | | | | 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.
* Fix a missed case in code for "moving average" estimate of reltuples.Tom Lane2011-08-30
| | | | | | | | | | | | | | | | | | | | | | | | 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, but it's particularly bad if the previous state was relpages=reltuples=0, which means "unknown tuple density". We just replaced "unknown" with "zero". ANALYZE would eventually recover from this, but it could take a lot of repetitions of ANALYZE to do so if the relation size is much larger than the maximum number of pages ANALYZE will scan, because of the moving-average behavior introduced by commit b4b6923e03f4d29636a94f6f4cc2f5cf6298b8c8. The only known situation where we could have relpages=reltuples=0 and yet the visibility map asserts everything's visible is immediately following a pg_upgrade. It might be advisable for pg_upgrade to try to preserve the relpages/reltuples statistics; but in any case this code is wrong on its own terms, so fix it. Per report from Sergey Koposov. Back-patch to 8.4, where the visibility map was introduced, same as the previous change.
* Clean up pg_regress --help outputPeter Eisentraut2011-08-30
| | | | | Put options listing in a less random order, fix capitalization, and some typos.
* Some markup cleanup to deconfuse the find_gt_lt toolPeter Eisentraut2011-08-30
| | | | Josh Kupershmidt
* Repair brain fade in previous commit, per Josh Kupershmidt.Robert Haas2011-08-30
|
* Add --if-exists option to dropdb and dropuser.Robert Haas2011-08-30
| | | | Josh Kupershmidt, with some further editing by me.
* Detect out of date flex in MSVC builds.Andrew Dunstan2011-08-30
| | | | | Per recent discussion, following a report from Quan Zongliang. The same logic is used as in pgbison.pl.
* Fix parsing of time string followed by yesterday/today/tomorrow.Robert Haas2011-08-30
| | | | | | | | Previously, 'yesterday 04:00:00'::timestamp didn't do the same thing as '04:00:00 yesterday'::timestamp, and the return value from the latter was midnight rather than the specified time. Dean Rasheed, with some stylistic changes
* Remove some tabs from README file.Robert Haas2011-08-29
| | | | | | | Some of the ASCII art expected 8-space tab stops, and some of it expected 4-space tab stops. Per report from YAMAMOTO Takashi.
* Fix concat_ws() to not insert a separator after leading NULL argument(s).Tom Lane2011-08-29
| | | | | Per bug #6181 from Itagaki Takahiro. Also do some marginal code cleanup and improve error handling.
* Use a non-locking test in TAS_SPIN() on all IA64 platforms.Tom Lane2011-08-29
| | | | | | | | | Per my testing, this works just as well with gcc as it does with HP's compiler; and there is no reason to think that the effect doesn't occur with icc, either. Also, rewrite the header comment about enforcing sequencing around spinlock operations, per Robert's gripe that it was misleading.
* Improve spinlock performance for HP-UX, ia64, non-gcc.Robert Haas2011-08-29
| | | | | | | | | | | | | At least on this architecture, it's very important to spin on a non-atomic instruction and only retry the atomic once it appears that it will succeed. To fix this, split TAS() into two macros: TAS(), for trying to grab the lock the first time, and TAS_SPIN(), for spinning until we get it. TAS_SPIN() defaults to same as TAS(), but we can override it when we know there's a better way. It's likely that some of the other cases in s_lock.h require similar treatment, but this is the only one we've got conclusive evidence for at present.
* Actually, all of parallel restore's limitations should be tested earlier.Tom Lane2011-08-28
| | | | | | | | | 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.
* Be more user-friendly about unsupported cases for parallel pg_restore.Tom Lane2011-08-28
| | | | | | | | | | | 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 to 8.4, where parallel restore was introduced.
* Include $cc_string in the info reported by a configure run.Tom Lane2011-08-28
| | | | | Without this, it's not very easy to tell which compiler version a buildfarm animal is actually using at the moment.
* Modify pgrminclude -v to report include files that can't be compiled onBruce Momjian2011-08-28
| | | | | | | | | their own. Avoid compile problems with defines being redefined after the removal of the #if blocks. Change script to use shell functions for simplicity.
* Don't assume that "E" response to NEGOTIATE_SSL_CODE means pre-7.0 server.Tom Lane2011-08-27
| | | | | | | | | | | | | | | | | | | | | | | | | 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 features the user needs. Hence, it seems best to just eliminate the assumption that backing off to non-SSL/2.0 protocol is the way to recover from an "E" response, and instead treat the server error the same as we would in non-SSL cases. I tested this change against a pre-7.0 server, and found that there was a second logic bug in the "prefer" path: the test to decide whether to make a fallback connection attempt assumed that we must have opened conn->ssl, which in fact does not happen given an "E" response. After fixing that, the code does indeed connect successfully to pre-7.0, as long as you didn't set sslmode=require. (If you did, you get "Unsupported frontend protocol", which isn't completely off base given the server certainly doesn't support SSL.) Since there seems no reason to believe that pre-7.0 servers exist anymore in the wild, back-patch to all supported branches.
* Document minimum required version of DocBook XSL stylesheetsPeter Eisentraut2011-08-27
|
* Ensure we discard unread/unsent data when abandoning a connection attempt.Tom Lane2011-08-27
| | | | | | | | | | | | | | | | | 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 not checked to see whether this is possible in the other cases where we close the socket and retry, but it seems like a matter of good defensive programming to add explicit buffer-flushing code to all of them. This is one of several issues exposed by Daniel Farina's report of misbehavior after a server-side fork failure. This has been wrong since forever, so back-patch to all supported branches.
* Allow more include files to be compiled in their own by adding missingBruce Momjian2011-08-27
| | | | | | include dependencies. Modify pgcompinclude to skip a common fcinfo error.
* Add support for #elif to pgrminclude.Bruce Momjian2011-08-27
|
* Implement the information schema with_hierarchy columnPeter Eisentraut2011-08-27
| | | | | In PostgreSQL, this is included in the SELECT privilege, so show YES or NO depending on whether SELECT is granted.
* Spelling improvementPeter Eisentraut2011-08-27
|
* Add another pgdefine path check, and a cvs-git change.Bruce Momjian2011-08-26
|
* Change references of CVS to .git.Bruce Momjian2011-08-26
|
* Add postgres.h to *.c files for pg_upgrade, ltree, and btree_gist, andBruce Momjian2011-08-26
| | | | | | remove from local *.h files. Per suggestion from Alvaro.
* Fix missing pgdefine detection in pgrminclude.Bruce Momjian2011-08-26
|
* Modify pgrminclude to include all code, even in #if blocks. ProcessBruce Momjian2011-08-26
| | | | | | .h include files before .c files. Mark some includes as needed to be ignored by pgrminclude.
* Cleanup of script.Bruce Momjian2011-08-26
|
* Add missing includes after pgrminclude run.Bruce Momjian2011-08-26
|
* do include files firstBruce Momjian2011-08-26
|
* Add markers.Bruce Momjian2011-08-26
|
* Add another marker.Bruce Momjian2011-08-26
|
* Add markers for skips.Bruce Momjian2011-08-26
|
* Fix #if blocks.Bruce Momjian2011-08-26
|
* Fix potential memory clobber in tsvector_concat().Tom Lane2011-08-26
| | | | | | | | | | | | | | | 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. The fix is to assume that we might add a not-previously-present pad byte for each and every lexeme in the two inputs; which really is conservative, but it doesn't seem worthwhile to try to be more precise. This is an aboriginal bug in tsvector_concat, so back-patch to all versions containing it.
* Improve comments describing tsvector data structure.Tom Lane2011-08-26
|
* Clean up weird corner cases in lexing of psql meta-command arguments.Tom Lane2011-08-26
| | | | | | | | | | | | | | These changes allow backtick command evaluation and psql variable interpolation to happen on substrings of a single meta-command argument. Formerly, no such evaluations happened at all if the backtick or colon wasn't the first character of the argument, and we considered an argument completed as soon as we'd processed one backtick, variable reference, or quoted substring. A string like 'FOO'BAR was thus taken as two arguments not one, not exactly what one would expect. In the new coding, an argument is considered terminated only by unquoted whitespace or backslash. Also, clean up a bunch of omissions, infelicities and outright errors in the psql documentation of variables and metacommand argument syntax.
* Support non-ASCII letters in psql variable names.Tom Lane2011-08-26
| | | | | As in the backend, the implementation actually accepts any non-ASCII character, but we only document that you can use letters.
* Fix pgrminclude regex pattern.Bruce Momjian2011-08-26
|