summaryrefslogtreecommitdiff
path: root/contrib
AgeCommit message (Collapse)Author
2012-09-05In pg_upgrade, try a few times to open a log file.Andrew Dunstan
If we call pg_ctl stop, the server might continue and thus hold a log file for a short time after it has deleted its pid file, (which is when pg_ctl will exit), and so a subsequent attempt to open the log file might fail. We therefore try to open it a few times, sleeping one second between tries, to give the server time to exit. This corrects an error that was observed on the buildfarm. Backpatched to 9.2,
2012-09-05Fix pg_upgrade test script's line end handling on Windows.Andrew Dunstan
Call pg_dumpall using -f switch instead of redirection, to avoid writing the output in text mode and generating spurious carriage returns. Remove to carriage return ignoring hack introduced by commit e442b0f0c6fd26738bafdeb5222511b586dfe4b9. Backpatch to 9.2.
2012-09-05Fix line end mishandling in pg_upgrade on Windows.Andrew Dunstan
pg_upgrade opened the output from pg_dumpall in text mode and wrote the split files in text mode. This caused unwanted eating of intended carriage returns on input and production of spurious carriage returns on output. To avoid this, open all these files in binary mode. On non-Windows platforms, this change has no effect. Backpatch to 9.0. On 9.0 and 9.1, we also switch from redirecting pg_dumpall's output to using pg_dumpall's -f switch, for the same reason.
2012-09-05Silence -Wunused-result warning in contrib/pg_upgrade.Tom Lane
This is just neatnik-ism, but since we do it for comparable code in elog.c, we may as well do it here.
2012-09-05In pg_upgrade, document why we can't issue \n\n in the command logfileBruce Momjian
on Windows. Slightly cleanup log output on Windows given this restriction. Backpatch to 9.2.
2012-09-04Fix transcription error.Andrew Dunstan
2012-09-04Fix command echoing in pg_upgade's analyze script for Windows.Andrew Dunstan
2012-09-03Indent fix_path_separator() header properly.Andrew Dunstan
2012-09-03Allow pg_upgrade "make check" to run on Windows/MSys.Andrew Dunstan
Backpatch to 9.2.
2012-09-03In pg_upgrade, pull the port number from postmaster.pid, like we do forBruce Momjian
socket location. Also, prevent putting the socket in the current directory for pre-9.1 servers in live check and non-live check mode, because pre-9.1 pg_ctl -w can't handle it. Backpatch to 9.2.
2012-09-03Use correct path separator for Windows builtin commands.Andrew Dunstan
pg_upgrade produces a platform-specific script to remove the old directory, but on Windows it has not been making sure that the paths it writes as arguments for rmdir and del use the backslash path separator, which will cause these scripts to fail. The fix is backpatched to Release 9.0.
2012-09-03Fix bugs in exec.c that prevented pg_upgrade working in Windows.Andrew Dunstan
Backpatch to 9.2 - code before that is quite different and should not have these defects.
2012-09-03Back-patch recent pg_upgrade fixes into 9.2.Tom Lane
This syncs contrib/pg_upgrade in the 9.2 branch with HEAD, except for the HEAD changes related to converting XLogRecPtr to 64-bit int. It includes back-patching these commits: 666d494d19dbd5dc7a177709a2f7069913f8ab89 pg_upgrade: abstract out copying of files from old cluster to new 7afa8bed65ea925208f128048f3a528a64e1319a pg_upgrade: Run the created scripts in the test suite ab577e63faf792593ca728625a8ef0b1dfaf7500 Remove analyze_new_cluster.sh on make clean, too 34c02044ed7e7defde5a853b26dcd806c872d974 Fix thinko in comment 088c065ce8e405fafbfa966937184ece9defcf20 pg_upgrade: Fix exec_prog API to be less flaky f763b77193b04eba03a1f4ce46df34dc0348419e Fix pg_upgrade to cope with non-default unix_socket_directory scenarios.
2012-08-20Fix bugs in contrib/pg_trgm's LIKE pattern analysis code.Tom Lane
Extraction of trigrams did not process LIKE escape sequences properly, leading to possible misidentification of trigrams near escapes, resulting in incorrect index search results. Fujii Masao
2012-08-14Prevent access to external files/URLs via contrib/xml2's xslt_process().Tom Lane
libxslt offers the ability to read and write both files and URLs through stylesheet commands, thus allowing unprivileged database users to both read and write data with the privileges of the database server. Disable that through proper use of libxslt's security options. Also, remove xslt_process()'s ability to fetch documents and stylesheets from external files/URLs. While this was a documented "feature", it was long regarded as a terrible idea. The fix for CVE-2012-3489 broke that capability, and rather than expend effort on trying to fix it, we're just going to summarily remove it. While the ability to write as well as read makes this security hole considerably worse than CVE-2012-3489, the problem is mitigated by the fact that xslt_process() is not available unless contrib/xml2 is installed, and the longstanding warnings about security risks from that should have discouraged prudent DBAs from installing it in security-exposed databases. Reported and fixed by Peter Eisentraut. Security: CVE-2012-3488
2012-08-10Prevent pg_upgrade from crashing if it can't write to the currentBruce Momjian
directory. Backpatch to 9.2.
2012-08-07Fix pg_upgrade file share violation on Windows created by the commitBruce Momjian
4741e9afb93f0d769655b2d18c2b73b86f281010. This was done by adding an optional second log file parameter to exec_prog(), and closing and reopening the log file between system() calls. Backpatch to 9.2.
2012-08-03In pg_upgrade, use pg_log() instead of prep_status() forBruce Momjian
newline-terminated messages, per suggestion from Tom. Backpatch to 9.2.
2012-08-02Replace libpq's "row processor" API with a "single row" mode.Tom Lane
After taking awhile to digest the row-processor feature that was added to libpq in commit 92785dac2ee7026948962cd61c4cd84a2d052772, we've concluded it is over-complicated and too hard to use. Leave the core infrastructure changes in place (that is, there's still a row processor function inside libpq), but remove the exposed API pieces, and instead provide a "single row" mode switch that causes PQgetResult to return one row at a time in separate PGresult objects. This approach incurs more overhead than proper use of a row processor callback would, since construction of a PGresult per row adds extra cycles. However, it is far easier to use and harder to break. The single-row mode still affords applications the primary benefit that the row processor API was meant to provide, namely not having to accumulate large result sets in memory before processing them. Preliminary testing suggests that we can probably buy back most of the extra cycles by micro-optimizing construction of the extra results, but that task will be left for another day. Marko Kreen
2012-07-26Simplify pg_upgrade's handling when returning directory listings.Bruce Momjian
Backpatch to 9.2.
2012-07-18Get rid of useless global variable in pg_upgrade.Tom Lane
Since the scandir() emulation was taken out of pg_upgrade, there's no longer any need for scandir_file_pattern to exist as a global variable. Replace it with a local in the one remaining function that was making use of it.
2012-07-18Improve pg_upgrade's load_directory() function.Tom Lane
Error out on out-of-memory, rather than returning -1, which the sole existing caller wasn't checking for anyway. There doesn't seem to be any use-case for making the caller check for failure here. Detect failure return from readdir(). Use a less platform-dependent method of calculating the entrysize. It's possible, but not yet confirmed, that this explains bug #6733, in which Mike Wilson reports a pg_upgrade crash that did not occur in 9.1. (Note that load_directory is effectively new code in 9.2, at least on platforms that have scandir().) Fix up comments, avoid uselessly using two counters, reduce the number of realloc calls to something sane.
2012-07-06Update pg_upgrade comments for recent configpath fix.Bruce Momjian
2012-07-05Fix PGDATAOLD and PGDATANEW to properly set pgconfig location, perBruce Momjian
report from Tom. Backpatch to 9.2.
2012-07-04Run newly-configured perltidy script on Perl files.Bruce Momjian
Run on HEAD and 9.2.
2012-06-29Make the pg_upgrade log files contain actual commandsAlvaro Herrera
Now the log file not only contains the output from commands executed by system(), but also what command it was in the first place. This arrangement makes debugging a lot simpler.
2012-06-18Make documentation of --help and --version options more consistentPeter Eisentraut
Before, some places didn't document the short options (-? and -V), some documented both, some documented nothing, and they were listed in various orders. Now this is hopefully more consistent and complete.
2012-06-15Improve pg_upgrade wording for pg_ctl start failure; could beBruce Momjian
connection failure. Backpatch to 9.2. Per report from Evan D. Hoffman
2012-06-13Support Linux's oom_score_adj API as well as the older oom_adj API.Tom Lane
The simplest way to handle this is just to copy-and-paste the relevant code block in fork_process.c, so that's what I did. (It's possible that something more complicated would be useful to packagers who want to work with either the old or the new API; but at this point the number of such people is rapidly approaching zero, so let's just get the minimal thing done.) Update relevant documentation as well.
2012-06-13In pg_upgrade, verify that the install user has the same oid on bothBruce Momjian
clusters, and make sure the new cluster has no additional users. Backpatch to 9.1.
2012-06-10Run pgindent on 9.2 source tree in preparation for first 9.3Bruce Momjian
commit-fest.
2012-06-04Fix some more bugs in contrib/xml2's xslt_process().Tom Lane
It failed to check for error return from xsltApplyStylesheet(), as reported by Peter Gagarinov. (So far as I can tell, libxslt provides no convenient way to get a useful error message in failure cases. There might be some inconvenient way, but considering that this code is deprecated it's hard to get enthusiastic about putting lots of work into it. So I just made it say "failed to apply stylesheet", in line with the existing error checks.) While looking at the code I also noticed that the string returned by xsltSaveResultToString was never freed, resulting in a session-lifespan memory leak. Back-patch to all supported versions.
2012-06-01In pg_upgrade, report pre-PG 8.1 plpython helper functions left in theBruce Momjian
public schema that no longer point to valid shared object libraries, and suggest a solution.
2012-05-30Fix incorrect password transformation in contrib/pgcrypto's DES crypt().Tom Lane
Overly tight coding caused the password transformation loop to stop examining input once it had processed a byte equal to 0x80. Thus, if the given password string contained such a byte (which is possible though not highly likely in UTF8, and perhaps also in other non-ASCII encodings), all subsequent characters would not contribute to the hash, making the password much weaker than it appears on the surface. This would only affect cases where applications used DES crypt() to encode passwords before storing them in the database. If a weak password has been created in this fashion, the hash will stop matching after this update has been applied, so it will be easy to tell if any passwords were unexpectedly weak. Changing to a different password would be a good idea in such a case. (Since DES has been considered inadequately secure for some time, changing to a different encryption algorithm can also be recommended.) This code, and the bug, are shared with at least PHP, FreeBSD, and OpenBSD. Since the other projects have already published their fixes, there is no point in trying to keep this commit private. This bug has been assigned CVE-2012-2143, and credit for its discovery goes to Rubin Xu and Joseph Bonneau.
2012-05-27Improve pg_upgrade C comment.Bruce Momjian
2012-05-27Add C comment explaining why we can't exclude checking functions in theBruce Momjian
pg_catalog schema, even though they are not explicitly dumped (they are implicitly dumped, e.g. create language plperl).
2012-05-27Add pg_update C comment about problems with plpython_call_handler().Bruce Momjian
2012-05-27Fix handling of pg_stat_statements.stat temporary fileMagnus Hagander
Write the file to a temporary name and then rename() it into the permanent name, to ensure it can't end up half-written and corrupt in case of a crash during shutdown. Unlink the file after it has been read so it's removed from the data directory and not included in base backups going to replication slaves.
2012-05-25Have pg_upgrade only use one extra log file for Win32, not two.Bruce Momjian
2012-05-24On Windows, have pg_upgrade use different two files to log pg_ctlBruce Momjian
start/stop output, to fix file share error reported by Edmund Horner
2012-05-23Adjust pg_upgrade to output a separate log file for pg_ctl output onBruce Momjian
Windows, to avoid opening a file by multiple processes.
2012-05-23pg_standby: Remove tabs from string literalsPeter Eisentraut
And align a bit better with the rest of the debug output.
2012-05-22Fix error message for COMMENT/SECURITY LABEL ON COLUMN xxx IS 'yyy'Robert Haas
When the column name is an unqualified name, rather than table.column, the error message complains about too many dotted names, which is wrong. Report by Peter Eisentraut based on examination of the sepgsql regression test output, but the problem also affects COMMENT. New wording as suggested by Tom Lane.
2012-05-20Small cleanups of contrib --help outputPeter Eisentraut
2012-05-17file_fdw: Improve error messagePeter Eisentraut
The hint looked a bit confusing when there were no valid options to hint about.
2012-05-15Remove whitespace from end of linesPeter Eisentraut
pgindent and perltidy should clean up the rest.
2012-05-11Fix contrib/citext's upgrade script to handle array and domain cases.Tom Lane
We previously recognized that citext wouldn't get marked as collatable during pg_upgrade from a pre-9.1 installation, and hacked its create-from-unpackaged script to manually perform the necessary catalog adjustments. However, we overlooked the fact that domains over citext, as well as the citext[] array type, need the same adjustments. Extend the script to handle those cases. Also, the documentation suggested that this was only an issue in pg_upgrade scenarios, which is quite wrong; loading any dump containing citext from a pre-9.1 server will also result in the type being wrongly marked. I approached the documentation problem by changing the 9.1.2 release note paragraphs about this issue, which is historically inaccurate. But it seems better than having the information scattered in multiple places, and leaving incorrect info in the 9.1.2 notes would be bad anyway. We'll still need to mention the issue again in the 9.1.4 notes, but perhaps they can just reference 9.1.2 for fix instructions. Per report from Evan Carroll. Back-patch into 9.1.
2012-05-08Tweak contrib --help output to match common stylePeter Eisentraut
Placeholders such as OPTION are typically kept in singular.
2012-05-08Fix misleading commentsPeter Eisentraut
Josh Kupershmidt
2012-05-02Even more duplicate word removal, in the spirit of the seasonPeter Eisentraut