summaryrefslogtreecommitdiff
path: root/contrib
AgeCommit message (Collapse)Author
2012-11-06In pg_upgrade, set synchronous_commit=off for the new cluster, toBruce Momjian
improve performance when restoring the schema from the old cluster. Backpatch to 9.2.
2012-10-23Add context info to OAT_POST_CREATE security hookAlvaro Herrera
... and have sepgsql use it to determine whether to check permissions during certain operations. Indexes that are being created as a result of REINDEX, for instance, do not need to have their permissions checked; they were already checked when the index was created. Author: KaiGai Kohei, slightly revised by me
2012-10-20Prevent overflow in pgbench's percent-done display.Tom Lane
Per Thom Brown.
2012-10-18Use a more portable platform test.Andrew Dunstan
2012-10-12In our source code, make a copy of getopt's 'optarg' string arguments,Bruce Momjian
rather than just storing a pointer.
2012-10-12Fix unportable format string.Tom Lane
Per compiler warning.
2012-10-11Refactor flex and bison make rulesPeter Eisentraut
Numerous flex and bison make rules have appeared in the source tree over time, and they are all virtually identical, so we can replace them by pattern rules with some variables for customization. Users of pgxs will also be able to benefit from this.
2012-10-10Remove configure-option-dependent test cases from dblink tests.Tom Lane
The HINTs generated for these error cases vary across builds. We could try to work around that, but the test cases aren't really useful enough to justify taking any trouble. Per buildfarm.
2012-10-10Create an improved FDW option validator function for contrib/dblink.Tom Lane
dblink now has its own validator function dblink_fdw_validator(), which is better than the core function postgresql_fdw_validator() because it gets the list of legal options from libpq instead of having a hard-wired list. Make the dblink extension module provide a standard foreign data wrapper dblink_fdw that encapsulates use of this validator, and recommend use of that wrapper instead of making up wrappers on the fly. Unfortunately, because ad-hoc wrappers *were* recommended practice previously, it's not clear when we can get rid of postgresql_fdw_validator without causing upgrade problems. But this is a step in the right direction. Shigeru Hanada, reviewed by KaiGai Kohei
2012-10-10In pg_upgrade, issue proper error message when we can't open PG_VERSION.Bruce Momjian
Backpatch to 9.2.
2012-10-09Add microsecs/op display to pg_test_fsync utilitySimon Riggs
e.g. fsync 2103.613 ops/sec ( 475 microsecs/op) Peter Geoghegan
2012-10-03Add --sampling-rate option to pgbench.Heikki Linnakangas
This allows logging only some fraction of transactions, greatly reducing the amount of log generated. Tomas Vondra, reviewed by Robert Haas and Jeff Janes.
2012-10-02In pg_upgrade, use full path name for analyze_new_cluster.sh script.Bruce Momjian
Backpatch to 9.2.
2012-10-02Work around unportable behavior of malloc(0) and realloc(NULL, 0).Tom Lane
On some platforms these functions return NULL, rather than the more common practice of returning a pointer to a zero-sized block of memory. Hack our various wrapper functions to hide the difference by substituting a size request of 1. This is probably not so important for the callers, who should never touch the block anyway if they asked for size 0 --- but it's important for the wrapper functions themselves, which mistakenly treated the NULL result as an out-of-memory failure. This broke at least pg_dump for the case of no user-defined aggregates, as per report from Matthew Carrington. Back-patch to 9.2 to fix the pg_dump issue. Given the lack of previous complaints, it seems likely that there is no live bug in previous releases, even though some of these functions were in place before that.
2012-10-02Standardize naming of malloc/realloc/strdup wrapper functions.Tom Lane
We had a number of variants on the theme of "malloc or die", with the majority named like "pg_malloc", but by no means all. Standardize on the names pg_malloc, pg_malloc0, pg_realloc, pg_strdup. Get rid of pg_calloc entirely in favor of using pg_malloc0. This is an essentially cosmetic change, so no back-patch. (I did find a couple of places where psql and pg_dump were using plain malloc or strdup instead of the pg_ versions, but they don't look significant enough to bother back-patching.)
2012-10-02In pg_upgrade, improve error reporting when the number of relationBruce Momjian
objects does not match between the old and new clusters. Backpatch to 9.2.
2012-10-02Adjust pg_upgrade query so toast tables related to system catalog schemaBruce Momjian
entries are not dumped. This fixes an error caused by droping/recreating the information_schema, but other failures were also possible. Backpatch to 9.2.
2012-10-02In pg_upgrade, try to convert the locale names to canonical form beforeBruce Momjian
comparison; also report the old/new values if they don't match. Backpatch to 9.2.
2012-09-30Provide some static-assertion functionality on all compilers.Tom Lane
On reflection (especially after noticing how many buildfarm critters have __builtin_types_compatible_p but not _Static_assert), it seems like we ought to try a bit harder to make these macros do something everywhere. The initial cut at it would have been no help to code that is compiled only on platforms without _Static_assert, for instance; and in any case not all our contributors do their initial coding on the latest gcc version. Some googling about static assertions turns up quite a bit of prior art for making it work in compilers that lack _Static_assert. The method that seems closest to our needs involves defining a struct with a bit-field that has negative width if the assertion condition fails. There seems no reliable way to get the error message string to be output, but throwing a compile error with a confusing message is better than missing the problem altogether. In the same spirit, if we don't have __builtin_types_compatible_p we can at least insist that the variable have the same width as the type. This won't catch errors such as "wrong pointer type", but it's far better than nothing. In addition to changing the macro definitions, adjust a compile-time-constant Assert in contrib/hstore to use StaticAssertStmt, so we can get some buildfarm coverage on whether that macro behaves sanely or not. There's surely more places that could be converted, but this is the first one I came across.
2012-09-26pg_upgrade test: Disable fsync in initdb and postgres callsPeter Eisentraut
This mirrors the behavior of pg_regress and makes the test run much faster.
2012-09-18pg_upgrade: Remove check for pg_configPeter Eisentraut
It is no longer used, but was still being checked for. bug #7548 from Reinhard Max
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-05pgbench: Show better progress when loading tuplesPeter Eisentraut
Show target number of tuples and percentage in addition to current number.
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-05sepgsql cleanups.Robert Haas
This is needed to match recent changes elsewhere. Along the way, some renaming for clarity. KaiGai Kohei
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-03Fix pg_upgrade to cope with non-default unix_socket_directory scenarios.Tom Lane
When starting either an old or new postmaster, force it to place its Unix socket in the current directory. This makes it even harder for accidental connections to occur during pg_upgrade, and also works around some scenarios where the default socket location isn't usable. (For example, if the default location is something other than "/tmp", it might not exist during "make check".) When checking an already-running old postmaster, find out its actual socket directory location from postmaster.pid, if possible. This dodges problems with an old postmaster having a configured location different from the default built into pg_upgrade's libpq. We can't find that out if the old postmaster is pre-9.1, so also document how to cope with such scenarios manually. In support of this, centralize handling of the connection-related command line options passed to pg_upgrade's subsidiary programs, such as pg_dump. This should make future changes easier. Bruce Momjian and Tom Lane
2012-08-30Split tuple struct defs from htup.h to htup_details.hAlvaro Herrera
This reduces unnecessary exposure of other headers through htup.h, which is very widely included by many files. I have chosen to move the function prototypes to the new file as well, because that means htup.h no longer needs to include tupdesc.h. In itself this doesn't have much effect in indirect inclusion of tupdesc.h throughout the tree, because it's also required by execnodes.h; but it's something to explore in the future, and it seemed best to do the htup.h change now while I'm busy with it.
2012-08-28Fix assorted compilation failures in contribAlvaro Herrera
Evidently I failed to test a compile after my earlier header shuffling.
2012-08-28Remove pg_stat_statements--1.0.sql, too.Tom Lane
Per Peter Geoghegan.
2012-08-28Remove hstore--1.0.sql.Tom Lane
Since we're not installing this file anymore, it has no reason to exist, other than as historical reference; but we have an SCM for that.
2012-08-28Adjust pg_test_timing to show shortest test durations first, placeBruce Momjian
percentage column before count column. Docs updated.
2012-08-27pg_upgrade: Fix exec_prog API to be less flakyAlvaro Herrera
The previous signature made it very easy to pass something other than the printf-format specifier in the corresponding position, without any warning from the compiler. While at it, move some of the escaping, redirecting and quoting responsibilities from the callers into exec_prog() itself. This makes the callsites cleaner.
2012-08-27Fix thinko in commentAlvaro Herrera
It was confusing symlinks with hard links.
2012-08-27Remove analyze_new_cluster.sh on make clean, tooAlvaro Herrera
2012-08-23pg_upgrade: Run the created scripts in the test suitePeter Eisentraut
Just to check that they actually work.
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.