summaryrefslogtreecommitdiff
path: root/src/test
Commit message (Collapse)AuthorAgeFilesLines
* Replace "amgetmulti" AM functions with "amgetbitmap", in which the wholeTom Lane2008-04-108-13/+194
| | | | | | | | | | | | | | | | | | indexscan always occurs in one call, and the results are returned in a TIDBitmap instead of a limited-size array of TIDs. This should improve speed a little by reducing AM entry/exit overhead, and it is necessary infrastructure if we are ever to support bitmap indexes. In an only slightly related change, add support for TIDBitmaps to preserve (somewhat lossily) the knowledge that particular TIDs reported by an index need to have their quals rechecked when the heap is visited. This facility is not really used yet; we'll need to extend the forced-recheck feature to plain indexscans before it's useful, and that hasn't been coded yet. The intent is to use it to clean up 8.3's horrid @@@ kluge for text search with weighted queries. There might be other uses in future, but that one alone is sufficient reason. Heikki Linnakangas, with some adjustments by me.
* Implement a few changes to how shared libraries and dynamically loadablePeter Eisentraut2008-04-071-10/+3
| | | | | | | | | | | | | | | modules are built. Foremost, it creates a solid distinction between these two types of targets based on what had already been implemented and duplicated in ad hoc ways before. Specifically, - Dynamically loadable modules no longer get a soname. The numbers previously set in the makefiles were dummy numbers anyway, and the presence of a soname upset a few packaging tools, so it is nicer not to have one. - The cumbersome detour taken on installation (build a libfoo.so.0.0.0 and then override the rule to install foo.so instead) is removed. - Lots of duplicated code simplified.
* Make plpgsql support FOR over a query specified by a cursor declaration,Tom Lane2008-04-062-0/+190
| | | | | | for improved compatibility with Oracle. Pavel Stehule, with some fixes by me.
* Improve hash_any() to use word-wide fetches when hashing suitably alignedTom Lane2008-04-062-10/+10
| | | | | | | | | | | | | data. This makes for a significant speedup at the cost that the results now vary between little-endian and big-endian machines; which forces us to add explicit ORDER BYs in a couple of regression tests to preserve machine-independent comparison results. Also, force initdb by bumping catversion, since the contents of hash indexes will change (at least on big-endian machines). Kenneth Marshall and Tom Lane, based on work from Bob Jenkins. This commit does not adopt Bob's new faster mix() algorithm, however, since we still need to convince ourselves that that doesn't degrade the quality of the hashing.
* Re-implement division for numeric values using the traditional "schoolbook"Tom Lane2008-04-042-0/+99
| | | | | | | | | | | | algorithm. This is a good deal slower than our old roundoff-error-prone code for long inputs, so we keep the old code for use in the transcendental functions, where everything is approximate anyway. Also create a user-accessible function div(numeric, numeric) to provide access to the exact result of trunc(x/y) --- since the regular numeric / operator will round off its result, simply computing that expression in SQL doesn't reliably give the desired answer. This fixes bug #3387 and various related corner cases, and improves the usefulness of PG for high-precision integer arithmetic.
* Support EXECUTE USING in plpgsql.Tom Lane2008-04-012-1/+38
| | | | Pavel Stehule, with some improvements by myself.
* Apply my original fix for Taiki Yamaguchi's bug report about DISTINCT MAX().Tom Lane2008-03-312-0/+40
| | | | Add some regression tests for plausible failures in this area.
* Fix a number of places that were making file-type tests infelicitously.Tom Lane2008-03-311-2/+2
| | | | | | | | | | | | | | | | | The places that did, eg, (statbuf.st_mode & S_IFMT) == S_IFDIR were correct, but there is no good reason not to use S_ISDIR() instead, especially when that's what the other 90% of our code does. The places that did, eg, (statbuf.st_mode & S_IFDIR) were flat out *wrong* and would fail in various platform-specific ways, eg a symlink could be mistaken for a regular file on most Unixen. The actual impact of this is probably small, since the problem cases seem to always involve symlinks or sockets, which are unlikely to be found in the directories that PG code might be scanning. But it's clearly trouble waiting to happen, so patch all the way back anyway. (There seem to be no occurrences of the mistake in 7.4.)
* Support statement-level ON TRUNCATE triggers. Simon RiggsTom Lane2008-03-282-0/+131
|
* Simplify and standardize conversions between TEXT datums and ordinary CTom Lane2008-03-251-11/+4
| | | | | | | | | | | | | | | | | | | | strings. This patch introduces four support functions cstring_to_text, cstring_to_text_with_len, text_to_cstring, and text_to_cstring_buffer, and two macros CStringGetTextDatum and TextDatumGetCString. A number of existing macros that provided variants on these themes were removed. Most of the places that need to make such conversions now require just one function or macro call, in place of the multiple notational layers that used to be needed. There are no longer any direct calls of textout or textin, and we got most of the places that were using handmade conversions via memcpy (there may be a few still lurking, though). This commit doesn't make any serious effort to eliminate transient memory leaks caused by detoasting toasted text objects before they reach text_to_cstring. We changed PG_GETARG_TEXT_P to PG_GETARG_TEXT_PP in a few places where it was easy, but much more could be done. Brendan Jurd and Tom Lane
* More README src cleanups.Bruce Momjian2008-03-216-1/+17
|
* Arrange for an explicit cast applied to an ARRAY[] constructor to be appliedTom Lane2008-03-202-0/+11
| | | | | | | | | | directly to all the member expressions, instead of the previous implementation where the ARRAY[] constructor would infer a common element type and then we'd coerce the finished array after the fact. This has a number of benefits, one being that we can allow an empty ARRAY[] construct so long as its element type is specified by such a cast. Brendan Jurd, minor fixes by me.
* Catch all errors in for and while loops in makefiles. Don't ignore anyPeter Eisentraut2008-03-187-32/+12
| | | | | | errors in any commands, including in various clean targets that have so far been handled inconsistently. make -i is available to ignore all errors in a consistent and official way.
* Implement enum type for guc parameters, and convert a couple of existingMagnus Hagander2008-03-101-1/+1
| | | | | | | | | variables to it. More need to be converted, but I wanted to get this in before it conflicts with too much... Other than just centralising the text-to-int conversion for parameters, this allows the pg_settings view to contain a list of available options and allows an error hint to show what values are allowed.
* Use windows DACL fix for pg_regress as well.Magnus Hagander2008-03-041-2/+18
| | | | Dave Page
* Make pg_regress -V consistent with the corresponding code in otherTom Lane2008-02-201-2/+2
| | | | programs: use puts with a compile-time-constant string.
* Update timezone code to track the upstream changes since 2003. In particularTom Lane2008-02-162-0/+32
| | | | | | | | this adds support for 64-bit tzdata files, which is needed to support DST calculations beyond 2038. Add a regression test case to give some minimal confidence that that really works. Heikki Linnakangas
* Allow AS to be omitted when specifying an output column name in SELECTTom Lane2008-02-151-2/+2
| | | | | | (or RETURNING), but only when the output name is not any SQL keyword. This seems as close as we can get to the standard's syntax without a great deal of thrashing. Original patch by Hiroshi Saito, amended by me.
* Make pg_regress clean out the testtablespace directory only on Windows.Tom Lane2008-01-191-6/+16
| | | | | | | | On other platforms it's better to let the Makefile handle it, but we want the regression tests to be invokable without make on Windows. A batch file would be a better solution, but no time for that before 8.3. Per my discovery that this breaks testing under SELinux, and subsequent discussion.
* Fix a regression test that fails if default_text_search_config isn'tTom Lane2008-01-132-2/+2
| | | | 'english'.
* The original implementation of polymorphic aggregates didn't really get theTom Lane2008-01-112-0/+72
| | | | | | checking of argument compatibility right; although the problem is only exposed with multiple-input aggregates in which some arguments are polymorphic and some are not. Per bug #3852 from Sokolov Yura.
* Fix some planner issues found while investigating Kevin Grittner's reportTom Lane2008-01-093-0/+85
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | of poorer planning in 8.3 than 8.2: 1. After pushing a constant across an outer join --- ie, given "a LEFT JOIN b ON (a.x = b.y) WHERE a.x = 42", we can deduce that b.y is sort of equal to 42, in the sense that we needn't fetch any b rows where it isn't 42 --- loop to see if any additional deductions can be made. Previous releases did that by recursing, but I had mistakenly thought that this was no longer necessary given the EquivalenceClass machinery. 2. Allow pushing constants across outer join conditions even if the condition is outerjoin_delayed due to a lower outer join. This is safe as long as the condition is strict and we re-test it at the upper join. 3. Keep the outer-join clause even if we successfully push a constant across it. This is *necessary* in the outerjoin_delayed case, but even in the simple case, it seems better to do this to ensure that the join search order heuristics will consider the join as reasonable to make. Mark such a clause as having selectivity 1.0, though, since it's not going to eliminate very many rows after application of the constant condition. 4. Tweak have_relevant_eclass_joinclause to report that two relations are joinable when they have vars that are equated to the same constant. We won't actually generate any joinclause from such an EquivalenceClass, but again it seems that in such a case it's a good idea to consider the join as worth costing out. 5. Fix a bug in select_mergejoin_clauses that was exposed by these changes: we have to reject candidate mergejoin clauses if either side was equated to a constant, because we can't construct a canonical pathkey list for such a clause. This is an implementation restriction that might be worth fixing someday, but it doesn't seem critical to get it done for 8.3.
* Update copyrights in source tree to 2008.Bruce Momjian2008-01-018-16/+16
|
* Fix attribution for Rime of the Ancient Mariner (obviously it's beenTom Lane2007-12-102-12/+12
| | | | too long since freshman English :-()
* The E. J. Pratt verse used as a tsearch test case is unfortunately stillTom Lane2007-12-092-138/+165
| | | | | under copyright in the US and many other places. Substitute a little something from a poet who's more safely dead. Per gripe from Bjorn Munch.
* Code review for LIKE ... INCLUDING INDEXES patch. Fix failure to propagateTom Lane2007-12-011-0/+2
| | | | | | | | | | constraint status of copied indexes (bug #3774), as well as various other small bugs such as failure to pstrdup when needed. Allow INCLUDING INDEXES indexes to be merged with identical declared indexes (perhaps not real useful, but the code is there and having it not apply to LIKE indexes seems pretty unorthogonal). Avoid useless work in generateClonedIndexStmt(). Undo some poorly chosen API changes, and put a couple of routines in modules that seem to be better places for them.
* Avoid incrementing the CommandCounter when CommandCounterIncrement is calledTom Lane2007-11-302-159/+59
| | | | | | | | | | | | | | | | | | | | but no database changes have been made since the last CommandCounterIncrement. This should result in a significant improvement in the number of "commands" that can typically be performed within a transaction before hitting the 2^32 CommandId size limit. In particular this buys back (and more) the possible adverse consequences of my previous patch to fix plan caching behavior. The implementation requires tracking whether the current CommandCounter value has been "used" to mark any tuples. CommandCounter values stored into snapshots are presumed not to be used for this purpose. This requires some small executor changes, since the executor used to conflate the curcid of the snapshot it was using with the command ID to mark output tuples with. Separating these concepts allows some small simplifications in executor APIs. Something for the TODO list: look into having CommandCounterIncrement not do AcceptInvalidationMessages. It seems fairly bogus to be doing it there, but exactly where to do it instead isn't clear, and I'm disinclined to mess with asynchronous behavior during late beta.
* Repair bug that allowed RevalidateCachedPlan to attempt to rebuild a cachedTom Lane2007-11-302-0/+59
| | | | | | | | | | plan before the effects of DDL executed in an immediately prior SPI operation had been absorbed. Per report from Chris Wood. This patch has an unpleasant side effect of causing the number of CommandCounterIncrement()s done by a typical plpgsql function to approximately double. Amelioration of the consequences of that will be undertaken in a separate patch.
* Fix pg_regress to check the directory it is actually reading files from,Tom Lane2007-11-271-13/+19
| | | | | | not the image that (theoretically) should exist in the current directory. Jørgen Austvik
* Make casts from xml to text independent of the XML option setting, thusPeter Eisentraut2007-11-272-1/+11
| | | | | immutable and indexable. Also fix the volatility settings of some other XML-related functions.
* Fix select_common_type() so that it can select a domain type, if all inputsTom Lane2007-11-262-0/+24
| | | | | | | | | | | | | | | | to a UNION, CASE, or related construct are of the same domain type. The main part of this routine smashes domains to their base types, which seems necessary because the logic involves TypeCategory() and IsPreferredType(), neither of which work usefully on domains. However, we can add a first pass that just detects whether all the inputs are exactly the same type, and if so accept that without question (so long as it's not UNKNOWN). Per recent gripe from Dean Rasheed. In passing, remove some tests for InvalidOid, which have clearly been dead code for quite some time now, because getBaseType() would fail on that input. Also, clarify the manual's not-very-precise description of the existing algorithm's behavior.
* Fix XML tag namespace change inadvertantly missed from previous fix. AddAndrew Dunstan2007-11-252-0/+19
| | | | regression test for XML names and numeric entities.
* Add missed entry for new money regression test.Tom Lane2007-11-241-1/+2
|
* Add regression tests for MONEY type.D'Arcy J.M. Cain2007-11-245-4/+252
|
* Change descriptions of entity and tag objects to "XML entity" and "XML tag".Andrew Dunstan2007-11-201-2/+2
| | | | | | Allow tag and entity names that follow XML rules. Provide for hexadecimal as well as decimal numeric entities. Adjust code names to coincide with new descriptions.
* Fix tsvectorout() and tsqueryout() to escape backslesh, add test of that.Teodor Sigaev2007-11-162-0/+21
| | | | | | Patch by Bruce Momjian <bruce@momjian.us> Backpatch is needed, but it's impossible to apply it directly
* pgindent run for 8.3.Bruce Momjian2007-11-153-173/+191
|
* Have text search thesaurus files use "?" for stop words.Bruce Momjian2007-11-101-3/+3
| | | | | | | | | Throw an error for actual stop words, rather than a warning. This fixes problems with cache reloading causing warning messages. Re-enable stop words in regression tests; was disabled by Tom. Document "?" as API change.
* Reduce error level of ROLLBACK outside a transaction from WARNING toBruce Momjian2007-11-101-1/+1
| | | | NOTICE.
* Add an expected-results file to get regression to pass cleanly in sv_SETom Lane2007-11-091-0/+770
| | | | locale, which sorts a bit differently. Per recent gripe from Magnus.
* Allow XML processing instructions starting with "xml" while prohibitingPeter Eisentraut2007-11-093-4/+37
| | | | those being exactly "xml". Bug #3735 from Ben Leslie
* After conferencing again with Bruce, put in more accurate XML error message.Peter Eisentraut2007-11-081-68/+68
|
* Adjust test results for message changes. Darn.Peter Eisentraut2007-11-081-136/+136
|
* Use "alternative" instead of "alternate" where it is clearer.Peter Eisentraut2007-11-072-2/+2
|
* Mention the index name in 'could not create unique index' errors,Tom Lane2007-10-292-3/+3
| | | | per suggestion from Rene Gollent.
* Remove the hack in the grammar that "optimized away" DEFAULT NULL clauses.Tom Lane2007-10-292-2/+16
| | | | | | | | | | | | | | | Instead put in a test to drop a NULL default at the last moment before storing the catalog entry. This changes the behavior in a couple of ways: * Specifying DEFAULT NULL when creating an inheritance child table will successfully suppress inheritance of any default expression from the parent's column, where formerly it failed to do so. * Specifying DEFAULT NULL for a column of a domain type will correctly override any default belonging to the domain; likewise for a sub-domain. The latter change happens because by the time the clause is checked, it won't be a simple null Const but a CoerceToDomain expression. Personally I think this should be back-patched, but there doesn't seem to be consensus for that on pgsql-hackers, so refraining.
* Change text search parsing rules for hyphenated words so that digit stringsTom Lane2007-10-271-12/+8
| | | | | | | containing decimal points aren't considered part of a hyphenated word. Sync the hyphenated-word lookahead states with the subsequent part-by-part reparsing states so that we don't get different answers about how much text is part of the hyphenated word. Per my gripe of a few days ago.
* Rename default text search parser's "uri" token type to "url_path",Tom Lane2007-10-271-1/+1
| | | | | | per recommendation from Alvaro. This doesn't force initdb since the numeric token type in the catalogs doesn't change; but note that the expected regression test output changed.
* Disallow scrolling of FOR UPDATE/FOR SHARE cursors, so as to avoid problemsTom Lane2007-10-242-23/+12
| | | | | | | | | | | in corner cases such as re-fetching a just-deleted row. We may be able to relax this someday, but let's find out how many people really care before we invest a lot of work in it. Per report from Heikki and subsequent discussion. While in the neighborhood, make the combination of INSENSITIVE and FOR UPDATE throw an error, since they are semantically incompatible. (Up to now we've accepted but just ignored the INSENSITIVE option of DECLARE CURSOR.)
* Fix UPDATE/DELETE WHERE CURRENT OF to support repeated update and update-Tom Lane2007-10-242-0/+173
| | | | | | | | | | | | | | | | then-delete on the current cursor row. The basic fix is that nodeTidscan.c has to apply heap_get_latest_tid() to the current-scan-TID obtained from the cursor query; this ensures we get the latest row version to work with. However, since that only works if the query plan is a TID scan, we also have to hack the planner to make sure only that type of plan will be selected. (Formerly, the planner might decide to apply a seqscan if the table is very small. This change is probably a Good Thing anyway, since it's hard to see how a seqscan could really win.) That means the execQual.c code to support CurrentOfExpr as a regular expression type is dead code, so replace it with just an elog(). Also, add regression tests covering these cases. Note that the added tests expose the fact that re-fetching an updated row misbehaves if the cursor used FOR UPDATE. That's an independent bug that should be fixed later. Per report from Dharmendra Goyal.