Tom Lane [Thu, 15 Nov 2007 20:36:40 +0000 (20:36 +0000)]
Prevent re-use of a deleted relation's relfilenode until after the next
checkpoint. This guards against an unlikely data-loss scenario in which
we re-use the relfilenode, then crash, then replay the deletion and
recreation of the file. Even then we'd be OK if all insertions into the
new relation had been WAL-logged ... but that's not guaranteed given all
the no-WAL-logging optimizations that have recently been added.
Patch by Heikki Linnakangas, per a discussion last month.
Tom Lane [Wed, 14 Nov 2007 23:43:27 +0000 (23:43 +0000)]
Add a rank/(rank+1) normalization option to ts_rank(). While the usefulness
of this seems a bit marginal, if it's useful enough to be shown in the manual
then we probably ought to support doing it without double evaluation of the
ts_rank function. Per my proposal earlier today.
Tom Lane [Wed, 14 Nov 2007 18:36:37 +0000 (18:36 +0000)]
Add an Accept parameter to "simple" dictionaries. The default of true
gives the old behavior; selecting false allows the dictionary to be used
as a filter ahead of other dictionaries, because it will pass on rather
than accept words that aren't in its stopword list.
Jan Urbanski
Magnus Hagander [Wed, 14 Nov 2007 14:25:55 +0000 (14:25 +0000)]
Add note about deprecating krb5 authentication in favour of GSSAPI,
per discussions (a long time ago). Documentation only, we keep full
support in the code.
Tom Lane [Wed, 14 Nov 2007 03:26:24 +0000 (03:26 +0000)]
Update discussion of tsearch2 migration. I'm not entirely sure about
the division of material between here and the tsearch2 contrib page,
but at least it's not obviously unfinished any more.
Tom Lane [Wed, 14 Nov 2007 02:36:43 +0000 (02:36 +0000)]
Move contrib docs to an appendix (next door to External Projects).
Change title to Additional Supplied Modules. Improve discussion of
how to build and install 'em.
Tom Lane [Tue, 13 Nov 2007 21:02:29 +0000 (21:02 +0000)]
Replace the now-incompatible-with-core contrib/tsearch2 module with a
compatibility package. This supports importing dumps from past versions
using tsearch2, and provides the old names and API for most functions
that were changed. (rewrite(ARRAY[...]) is a glaring omission, though.)
Tom Lane [Tue, 13 Nov 2007 06:29:04 +0000 (06:29 +0000)]
Fix a few contrib regression test scripts that hadn't gotten the word
about best practice for including the module creation scripts: to wit
that you should suppress NOTICE messages. This avoids creating
regression failures by adding or removing comment lines in the module
scripts.
Tom Lane [Tue, 13 Nov 2007 01:55:49 +0000 (01:55 +0000)]
Fix insufficient search-path paranoia in SQL function definitions.
Remove setting of search_path in install/uninstall scripts, since unlike
other contrib modules this one does not want to let you change the
installation schema.
Tom Lane [Tue, 13 Nov 2007 00:13:19 +0000 (00:13 +0000)]
I find that an out-of-the-box installation of OSSP uuid 1.6.0 installs
itself as libuuid, not libossp-uuid which was the only case expected by
our build support. Install a configure test to determine which name
to use (and to check that the library is present at all).
Tom Lane [Sun, 11 Nov 2007 19:22:49 +0000 (19:22 +0000)]
Ensure that typmod decoration on a datatype name is validated in all cases,
even in code paths where we don't pay any subsequent attention to the typmod
value. This seems needed in view of the fact that 8.3's generalized typmod
support will accept a lot of bogus syntax, such as "timestamp(foo)" or
"record(int, 42)" --- if we allow such things to pass without comment,
users will get confused. Per a recent example from Greg Stark.
To implement this in a way that's not very vulnerable to future
bugs-of-omission, refactor the API of parse_type.c's TypeName lookup routines
so that typmod validation is folded into the base lookup operation. Callers
can still choose not to receive the encoded typmod, but we'll check the
decoration anyway if it's present.
Tom Lane [Sat, 10 Nov 2007 20:14:36 +0000 (20:14 +0000)]
Add an example of a SQL function with output parameters returning
multiple rows. I had thought this case was covered, but there was
no example in the obvious section to look in.
Tom Lane [Sat, 10 Nov 2007 19:29:54 +0000 (19:29 +0000)]
Add missing closing / in xsd:restriction, and remove some unnecessary
spaces for consistency. Per bug #3734 from Ben Leslie; fix by
Euler Taveira de Oliveira.
Tom Lane [Sat, 10 Nov 2007 18:51:20 +0000 (18:51 +0000)]
xmlGetUTF8Char()'s second argument is both input and output. Fix
uninitialized value, and avoid invoking the function nine separate
times in the pg_xmlIsNameChar macro. Should resolve buildfarm failures.
Per report from Ben Leslie.
Joe Conway [Sat, 10 Nov 2007 05:00:41 +0000 (05:00 +0000)]
Have crosstab variants treat NULL rowid as a category in its own right,
per suggestion from Tom Lane. This fixes crash-bug reported by Stefan
Schwarzer.
Tom Lane [Fri, 9 Nov 2007 23:58:32 +0000 (23:58 +0000)]
Recognize RETURN QUERY via a textual test, so that QUERY doesn't need to be
a plpgsql keyword. This avoids springing a new reserved word on plpgsql
programmers.
For consistency, handle RETURN NEXT the same way.
Tom Lane [Fri, 9 Nov 2007 22:37:35 +0000 (22:37 +0000)]
Clean up ts_locale.h/.c. Fix broken and not-consistent-across-platforms
behavior of wchar2char/char2wchar; this should resolve bug #3730. Avoid
excess computations of pg_mblen in t_isalpha and friends. Const-ify
APIs where possible.
Tom Lane [Fri, 9 Nov 2007 20:10:02 +0000 (20:10 +0000)]
Second pass at improving LIKE/regex estimation in non-C locales. It turns
out that it's actually quite likely that a string that is an extension of
the given prefix will sort as larger than the "greater" string our previous
code created. To provide some defense against that, do the comparisons
against a modified string instead of just the bare prefix. We tack on
"Z", "z", "y", or "9", whichever is seen as largest in the current locale.
Testing suggests that this is sufficient at least for cases involving
ASCII data.
Magnus Hagander [Fri, 9 Nov 2007 17:31:07 +0000 (17:31 +0000)]
Add parameter krb_realm used by GSSAPI, SSPI and Kerberos
to validate the realm of the connecting user. By default
it's empty meaning no verification, which is the way
Kerberos authentication has traditionally worked in
PostgreSQL.
Tom Lane [Thu, 8 Nov 2007 23:22:54 +0000 (23:22 +0000)]
If an index depends on no columns of its table, give it a dependency on the
whole table instead, to ensure that it goes away when the table is dropped.
Per bug #3723 from Sam Mason.
Backpatch as far as 7.4; AFAICT 7.3 does not have the issue, because it doesn't
have general-purpose expression indexes and so there must be at least one
column referenced by an index.
Tom Lane [Thu, 8 Nov 2007 21:49:48 +0000 (21:49 +0000)]
Fix EquivalenceClass code to handle volatile sort expressions in a more
predictable manner; in particular that if you say ORDER BY output-column-ref,
it will in fact sort by that specific column even if there are multiple
syntactic matches. An example is
SELECT random() AS a, random() AS b FROM ... ORDER BY b, a;
While the use-case for this might be a bit debatable, it worked as expected
in earlier releases, so we should preserve the behavior for 8.3. Per my
recent proposal.
While at it, fix convert_subquery_pathkeys() to handle RelabelType stripping
in both directions; it needs this for the same reasons make_sort_from_pathkeys
does.
Tom Lane [Thu, 8 Nov 2007 19:25:37 +0000 (19:25 +0000)]
Last week's patch for make_sort_from_pathkeys wasn't good enough: it has
to be able to discard top-level RelabelType nodes on *both* sides of the
equivalence-class-to-target-list comparison, since make_pathkey_from_sortinfo
might either add or remove a RelabelType. Also fix the latter to do the
removal case cleanly. Per example from Peter.
Tom Lane [Wed, 7 Nov 2007 22:37:24 +0000 (22:37 +0000)]
Improve the performance of LIKE/regex estimation in non-C locales, by making
make_greater_string() try harder to generate a string that's actually greater
than its input string. Before we just assumed that making a string that was
memcmp-greater was enough, but it is easy to generate examples where this is
not so when the locale is not C. Instead, loop until the relevant comparison
function agrees that the generated string is greater than the input.
Unfortunately this is probably not enough to guarantee that the generated
string is greater than all extensions of the input, so we cannot relax the
restriction to C locale for the LIKE/regex index optimization. But it should
at least improve the odds of getting a useful selectivity estimate in
prefix_selectivity(). Per example from Guillaume Smet.
Backpatch to 8.1, mainly because that's what the complainant is using...
Tom Lane [Wed, 7 Nov 2007 21:00:37 +0000 (21:00 +0000)]
Fix patternsel() and callers to do the right thing for NOT LIKE and the other
negated-match operators. patternsel had been using the supplied operator as
though it were a positive-match operator, and thus obtaining a wrong result,
which was even more wrong after the caller subtracted it from 1. Seems
cleanest to give patternsel an explicit "negate" argument so that it knows
what's going on. Also install the same factorization scheme for pattern
join selectivity estimators; even though they are just stubs at the
moment, this may keep someone from making the same type of mistake when
they get filled out. Per report from Greg Mullane.
Backpatch to 8.2 --- previous releases do not show the problem because
patternsel() doesn't actually use the operator directly.