summaryrefslogtreecommitdiff
path: root/contrib
AgeCommit message (Collapse)Author
2013-05-24Remove pageinspect--1.0.sqlHeikki Linnakangas
We're not installing it anymore. Michael Paquier
2013-05-15Allow CREATE FOREIGN TABLE to include SERIAL columns.Tom Lane
The behavior is that the required sequence is created locally, which is appropriate because the default expression will be evaluated locally. Per gripe from Brad Nicholson that this case was refused with a confusing error message. We could have improved the error message but it seems better to just allow the case. Also, remove ALTER TABLE's arbitrary prohibition against being applied to foreign tables, which was pretty inconsistent considering we allow it for views, sequences, and other relation types that aren't even called tables. This is needed to avoid breaking pg_dump, which sometimes emits column defaults using separate ALTER TABLE commands. (I think this can happen even when the default is not associated with a sequence, so that was a pre-existing bug once we allowed column defaults for foreign tables.)
2013-05-14pg_upgrade: Replace tabs in output string constants by spacesPeter Eisentraut
2013-05-12pgbench: Fix order of options in --help outputPeter Eisentraut
2013-05-12pg_xlogdump: Improve --help outputPeter Eisentraut
2013-05-11Fix buildfarm incompatibility in updated pg_upgrade test script.Tom Lane
Looks like some versions of the buildfarm script try to set the port via --port in $EXTRA_REGRESS_OPTS. Override that ...
2013-05-11Make pg_upgrade's test script attempt to select a non-conflicting port.Tom Lane
Previously, the port number used in this test script was hard-wired at pg_upgrade's default of 50432; which is not so great because parallel build runs might conflict. Commit 3d53173e20d151341f894f79d556768c845ba3e4 removed this setting for the postmasters started by the script proper (not by pg_upgrade), which didn't do anything to fix that problem and also guaranteed a failure if there was a live postmaster at the build's default port number. Instead, select a non-conflicting temporary port number in the same way that pg_regress.c does. (Its method isn't entirely bulletproof, but given the lack of complaints I'm not going to worry about that today.) In passing, unset MAKEFLAGS and MAKELEVEL to avoid problems with the script's internal invocations of make, for the same reason pg_regress.c does: it could cause problems in a parallel make.
2013-05-10Fix pgp_pub_decrypt() so it works for secret keys with passwords.Tom Lane
Per report from Keith Fiske. Marko Kreen
2013-05-09Use pg_dump's --quote-all-identifiers option in pg_upgrade.Tom Lane
This helps guard against changes in the set of reserved keywords from one version to another. In theory it should only be an issue if we de-reserve a keyword in a newer release, since that can create the type of problem shown in bug #8128. Back-patch to 9.1 where the --quote-all-identifiers option was added.
2013-05-08The data structure used in unaccent is a trie, not suffix tree.Heikki Linnakangas
Fix the term used in variable and struct names, and comments. Alexander Korotkov
2013-05-02pg_test_fsync: update output to show usecs/op clearerBruce Momjian
2013-04-30Fix pg_upgrade for 9.3 with data checksums.Simon Riggs
Previous changes misconstrued pg_upgrade internals causing build farm breakages.
2013-04-30Revert previous temporary patchSimon Riggs
2013-04-30Temporarily silence pg_upgrade's checksums checkSimon Riggs
2013-04-30pg_upgrade: Remove PGPORT handling from test suitePeter Eisentraut
This code was left over from when pg_upgrade paid attention to PGPORT. Now it would only affects the regression test run before the test run of pg_upgrade. You can still set PGPORT for that, but there is no reason to have the test driver default it to 50432.
2013-04-30Revert "pg_ctl: Add idempotent option"Peter Eisentraut
This reverts commit 87306184580c9c49717b00d48a2f9e717f21e0a8. The behavior in certain cases is still being debated, and it's too late to solve this before beta.
2013-04-28Editorialize a bit on new ProcessUtility() API.Tom Lane
Choose a saner ordering of parameters (adding a new input param after the output params seemed a bit random), update the function's header comment to match reality (cmon folks, is this really that hard?), get rid of useless and sloppily-defined distinction between PROCESS_UTILITY_SUBCOMMAND and PROCESS_UTILITY_GENERATED.
2013-04-23Remove prototype for cube(text) function that doesn't exist anymore.Heikki Linnakangas
Adrian Schreyer
2013-04-19Don't try to pass -I switch to postmaster in contrib/start-scripts/linux.Tom Lane
Undo thinko in commit 87306184580c9c49717b00d48a2f9e717f21e0a8. Per bug #8098 from Catherine Devlin.
2013-04-19Fix typo in comment.Robert Haas
Fabrízio de Royes Mello
2013-04-17pg_upgrade: Add checksum C commentBruce Momjian
We might eventually allow checksum to no-checksum upgrades.
2013-04-17sepgsql: Minor improvement to test script, doc fix.Robert Haas
KaiGai Kohei
2013-04-17sepgsql: One more getObjectIdentity in lieu of getObjectDescription.Robert Haas
KaiGai Kohei, based on a suggestion from Álvaro Herrera
2013-04-15Improve GiST index search performance for trigram regex queries.Tom Lane
The initial coding just descended the index if any of the target trigrams were possibly present at the next level down. But actually we can apply trigramsMatchGraph() so as to take advantage of AND requirements when there are some. The input data might contain false positive matches, but that can only result in a false positive result, not false negative, so it's safe to do it this way. Alexander Korotkov
2013-04-14pg_ctl: Add idempotent optionPeter Eisentraut
This changes the behavior of the start and stop actions to exit successfully if the server was already started or stopped. This changes the default behavior of the start action: Before, if the server was already running, it would print a message and succeed. Now, that situation will result in an error. When running in idempotent mode, no message is printed and pg_ctl exits successfully. It was considered to just make the idempotent behavior the default and only option, but pg_upgrade needs the old behavior.
2013-04-12sepgsql: Enforce db_procedure:{execute} permission.Robert Haas
To do this, we add an additional object access hook type, OAT_FUNCTION_EXECUTE. KaiGai Kohei
2013-04-12sepgql: Use getObjectIdentity rather than getObjectDescription.Robert Haas
KaiGai Kohei, based on a suggestion from Álvaro Herrera
2013-04-10Make contrib/pg_trgm also support regex searches with GiST indexes.Tom Lane
This wasn't addressed in the original patch, but it doesn't take very much additional code to cover the case, so let's get it done. Since pg_trgm 1.1 hasn't been released yet, I just changed the definition of what's in it, rather than inventing a 1.2.
2013-04-10Make worker_spi sample code more completeAlvaro Herrera
Make use of some GUC variables, and add SIGHUP handling to reload the config file. Patch submitted by Guillaume Lelarge. Also, report to pg_stat_activity. Per report from Marc Cousin, add setting of statement start time.
2013-04-09Support indexing of regular-expression searches in contrib/pg_trgm.Tom Lane
This works by extracting trigrams from the given regular expression, in generally the same spirit as the previously-existing support for LIKE searches, though of course the details are far more complicated. Currently, only GIN indexes are supported. We might be able to make it work with GiST indexes later. The implementation includes adding API functions to backend/regex/ to provide a view of the search NFA created from a regular expression. These functions are meant to be generic enough to be supportable in a standalone version of the regex library, should that ever happen. Alexander Korotkov, reviewed by Heikki Linnakangas and Tom Lane
2013-04-07Get rid of USE_WIDE_UPPER_LOWER dependency in trigram construction.Tom Lane
contrib/pg_trgm's make_trigrams() was coded to ignore multibyte character boundaries and just make trigrams from bytes if USE_WIDE_UPPER_LOWER wasn't defined. This is a bit odd, since there's no obvious reason why trigram compaction rules should depend on the presence of towlower() and friends. What's more, there was an Assert() that would fail if that code path was fed any multibyte characters. We need to do something about this since the pending regex-indexing patch has an assumption that you get just one "trgm" from any three characters. The best solution seems to be to remove the USE_WIDE_UPPER_LOWER dependency, which shouldn't really have been there in the first place. The second loop in make_trigrams() is now just a fast path and not a potentially incompatible algorithm. If there is anybody still using Postgres on machines without wcstombs() or towlower(), and they have non-ASCII data indexed by pg_trgm, they'll need to REINDEX those indexes after pg_upgrade to 9.3, else searches may fail incorrectly. It seems likely that there are no such installations, though. In passing, rename cnt_trigram to compact_trigram, which seems to better describe its functionality, and improve make_trigrams' test for whether it has to use the slow path or not (per a suggestion from Alexander Korotkov).
2013-04-05sepgsql: Enforce db_schema:search permission.Robert Haas
KaiGai Kohei, with comment and doc wordsmithing by me
2013-03-31pg_upgrade: don't copy/link files for invalid indexesBruce Momjian
Now that pg_dump no longer dumps invalid indexes, per commit 683abc73dff549e94555d4020dae8d02f32ed78b, have pg_upgrade also skip them. Previously pg_upgrade threw an error if invalid indexes existed. Backpatch to 9.2, 9.1, and 9.0 (where pg_upgrade was added to git)
2013-03-30Avoid moving data directory in upgrade testing.Andrew Dunstan
Windows sometimes gets upset if we rename a large directory and then try to use the old name quickly, as seen in occasional buildfarm failures. So we avoid that by building the old version in the intended destination in the first place instead of renaming it, similar to the change made for the same reason in commit b7f8465c.
2013-03-28Allow sepgsql labels to depend on object name.Robert Haas
The main change here is to call security_compute_create_name_raw() rather than security_compute_create_raw(). This ups the minimum requirement for libselinux from 2.0.99 to 2.1.10, but it looks like most distributions will have picked that up before 9.3 is out. KaiGai Kohei
2013-03-27sepgsql: Support for new post-ALTER access hook.Robert Haas
KaiGai Kohei
2013-03-22Document cross-version compatibility issues for contrib/postgres_fdw.Tom Lane
One of the use-cases for postgres_fdw is extracting data from older PG servers, so cross-version compatibility is important. Document what we can do here, and further annotate some of the coding choices that create compatibility constraints. In passing, remove one unnecessary incompatibility with old servers, namely assuming that we didn't need to quote the timezone name 'UTC'.
2013-03-22Fix contrib/dblink to handle inconsistent DateStyle/IntervalStyle safely.Tom Lane
If the remote database's settings of these GUCs are different from ours, ambiguous datetime values may be read incorrectly. To fix, temporarily adopt the remote server's settings while we ingest a query result. This is not a complete fix, since it doesn't do anything about ambiguous values in commands sent to the remote server; but there seems little we can do about that end of it given dblink's entirely textual API for transmitted commands. Back-patch to 9.2. The hazard exists in all versions, but this patch would need more work to apply before 9.2. Given the lack of field complaints about this issue, it doesn't seem worth the effort at present. Daniel Farina and Tom Lane
2013-03-22Allow I/O reliability checks using 16-bit checksumsSimon Riggs
Checksums are set immediately prior to flush out of shared buffers and checked when pages are read in again. Hint bit setting will require full page write when block is dirtied, which causes various infrastructure changes. Extensive comments, docs and README. WARNING message thrown if checksum fails on non-all zeroes page; ERROR thrown but can be disabled with ignore_checksum_failure = on. Feature enabled by an initdb option, since transition from option off to option on is long and complex and has not yet been implemented. Default is not to use checksums. Checksum used is WAL CRC-32 truncated to 16-bits. Simon Riggs, Jeff Davis, Greg Smith Wide input and assistance from many community members. Thank you.
2013-03-22Silence compiler warnings about unused values.Andrew Dunstan
Per gripe from Kevin Grittner.
2013-03-22Avoid retrieving dummy NULL columns in postgres_fdw.Tom Lane
This should provide some marginal overall savings, since it surely takes many more cycles for the remote server to deal with the NULL columns than it takes for postgres_fdw not to emit them. But really the reason is to keep the emitted queries from looking quite so silly ...
2013-03-21Redo postgres_fdw's planner code so it can handle parameterized paths.Tom Lane
I wasn't going to ship this without having at least some example of how to do that. This version isn't terribly bright; in particular it won't consider any combinations of multiple join clauses. Given the cost of executing a remote EXPLAIN, I'm not sure we want to be very aggressive about doing that, anyway. In support of this, refactor generate_implied_equalities_for_indexcol so that it can be used to extract equivalence clauses that aren't necessarily tied to an index.
2013-03-18Add pageinspect--1.0--1.sql for checksum changesSimon Riggs
2013-03-18Add pageinspect--1.1.sql for checksum changesSimon Riggs
2013-03-18Remove PageSetTLI and rename pd_tli to pd_checksumSimon Riggs
Remove use of PageSetTLI() from all page manipulation functions and adjust README to indicate change in the way we make changes to pages. Repurpose those bytes into the pd_checksum field and explain how that works in comments about page header. Refactoring ahead of actual feature patch which would make use of the checksum field, arriving later. Jeff Davis, with comments and doc changes by Simon Riggs Direction suggested by Robert Haas; many others providing review comments.
2013-03-17Use pqsignal() in contrib programs rather than calling signal(2) directly.Tom Lane
The semantics of signal(2) are more variable than one could wish; in particular, on strict-POSIX platforms the signal handler will be reset to SIG_DFL when the signal is delivered. This demonstrably breaks pg_test_fsync's use of SIGALRM. The other changes I made are not absolutely necessary today, because the called handlers all exit the program anyway. But it seems like a good general practice to use pqsignal() exclusively in Postgres code, now that we have it available everywhere.
2013-03-17Fix inclusions in pgbench.c.Tom Lane
Apparently this was depending on pqsignal.h for <signal.h>. Not sure why I didn't see the failure on my other machine.
2013-03-17Move pqsignal() to libpgport.Tom Lane
We had two copies of this function in the backend and libpq, which was already pretty bogus, but it turns out that we need it in some other programs that don't use libpq (such as pg_test_fsync). So put it where it probably should have been all along. The signal-mask-initialization support in src/backend/libpq/pqsignal.c stays where it is, though, since we only need that in the backend.
2013-03-15Improve the documentation about commit_delay.Tom Lane
Clarify the docs explaining what commit_delay does, and add a recommendation about a useful value for it, namely half of the single-page fsync time reported by pg_test_fsync. This is informed by testing of the new-in-9.3 implementation of commit_delay; in prior versions it was far harder to arrive at a useful setting. In passing, do some wordsmithing and markup-fixing in the same general area. Also, change pg_test_fsync's default time-per-test from 2 seconds to 5. The old value was about the minimum at which the results could be taken seriously at all, and so seems a tad optimistic as a default. Peter Geoghegan, reviewed by Noah Misch; some additional editing by me
2013-03-14Minor fixes for hstore_to_json_loose().Tom Lane
Fix unportable use of isdigit(), get rid of useless calculations.