Commit Graph

25639 Commits

Author SHA1 Message Date
Tom Lane 48c16e14f5 Make initdb's selection of default text search configuration depend
only on the 'language' part of the locale name, ignoring the country code.
We may need to be smarter later when there are more built-in configurations,
but for now this is good enough and avoids having to bloat the table.
2007-10-25 20:22:53 +00:00
Alvaro Herrera dd7444cfe2 Fix memory management for new variables -- they must actually survive
transaction end, in case we decide to do a vacuum analyze (which is done in two
xacts).
2007-10-25 19:13:37 +00:00
Tom Lane 9ddfe034c7 Fix ALTER SEQUENCE so that it does not affect the value of currval() for
the sequence.  Also, make setval() with is_called = false not affect the
currval state, either.  Per report from Kris Jurka that an implicit
ALTER SEQUENCE OWNED BY unexpectedly caused currval() to become valid.
Since this isn't 100% backwards compatible, it will go into HEAD only;
I'll put a more limited patch into 8.2.
2007-10-25 18:54:03 +00:00
Alvaro Herrera dbe48765cd Extract catalog info for error reporting before an error actually happens.
Also, remove redundant reset of for-wraparound PGPROC flag.

Thanks to Tom Lane for noticing both bogosities.
2007-10-25 14:45:55 +00:00
Tom Lane fcc20bd4ba Tweak new error messages to match the actual syntax of DECLARE CURSOR.
(Last night I copied-and-pasted from the WITH HOLD case, but that's
wrong because of the bizarrely irregular syntax specified by the standard.)
2007-10-25 13:48:57 +00:00
Alvaro Herrera 0e3ddc8dd5 Use more real-world examples in the text search parser documentation. 2007-10-25 13:06:35 +00:00
Alvaro Herrera f8c9ef9069 Add new encoding aliases for Solaris, per Zdenek Kotala. 2007-10-25 12:29:17 +00:00
Bruce Momjian 41f207620a Update release notes to current CVS. 2007-10-25 02:50:26 +00:00
Tom Lane 048efc25e4 Disallow scrolling of FOR UPDATE/FOR SHARE cursors, so as to avoid problems
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.)
2007-10-24 23:27:08 +00:00
Tom Lane 8a35b07e18 Remove obsolete statement that you can't update through a cursor. 2007-10-24 22:55:52 +00:00
Alvaro Herrera 745c1b2c2a Rearrange vacuum-related bits in PGPROC as a bitmask, to better support
having several of them.  Add two more flags: whether the process is
executing an ANALYZE, and whether a vacuum is for Xid wraparound (which
is obviously only set by autovacuum).

Sneakily move the worker's recently-acquired PostAuthDelay to a more useful
place.
2007-10-24 20:55:36 +00:00
Tom Lane 3ef18797b8 Fix an error in make_outerjoininfo introduced by my patch of 30-Aug: the code
neglected to test whether an outer join's join-condition actually refers to
the lower outer join it is looking at.  (The comment correctly described what
was supposed to happen, but the code didn't do it...)  This often resulted in
adding an unnecessary constraint on the join order of the two outer joins,
which was bad enough.  However, it also seems to expose a performance
problem in an older patch (from 15-Feb): once we've decided that there is a
join ordering constraint, we will start trying clauseless joins between every
combination of rels within the constraint, which pointlessly eats up lots of
time and space if there are numerous rels below the outer join.  That probably
needs to be revisited :-(.  Per gripe from Jakub Ouhrabka.
2007-10-24 20:54:27 +00:00
Alvaro Herrera 5c4249c353 Danish_Danmark -> Danish_Denmark 2007-10-24 20:11:00 +00:00
Alvaro Herrera 2627c83561 Minor changes to autovacuum worker: change error handling so that it continues
with the next table on schedule instead of exiting, in all cases instead of
just on query cancel.

Add a errcontext() line indicating the activity of the worker to the error
message when it is cancelled.

Change the WorkerInfo struct to contain a pointer to the worker's PGPROC
instead of just the PID.

Add forgotten post-auth delays, per Simon Riggs.  Also to autovac launcher.
2007-10-24 19:08:25 +00:00
Tom Lane c29a9c37bf Fix UPDATE/DELETE WHERE CURRENT OF to support repeated update and update-
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.
2007-10-24 18:37:09 +00:00
Tom Lane 9226ba817b Keep heap_page_prune from marking the buffer dirty when it didn't
really change anything.  Per report from Itagaki Takahiro.  Fix by
Pavan Deolasee.
2007-10-24 13:05:57 +00:00
Tom Lane 1c92724985 Set read_only = TRUE while evaluating input queries for ts_rewrite()
and ts_stat(), per my recent suggestion.  Also add a possibly-not-needed-
but-can't-hurt check for NULL SPI_tuptable, before we try to dereference
same.
2007-10-24 03:30:03 +00:00
Tom Lane 592c88a0d2 Remove the aggregate form of ts_rewrite(), since it doesn't work as desired
if there are zero rows to aggregate over, and the API seems both conceptually
and notationally ugly anyway.  We should look for something that improves
on the tsquery-and-text-SELECT version (which is also pretty ugly but at
least it works...), but it seems that will take query infrastructure that
doesn't exist today.  (Hm, I wonder if there's anything in or near SQL2003
window functions that would help?)  Per discussion.
2007-10-24 02:24:49 +00:00
Tom Lane 07d0a370c1 Make configure probe for the location of the <uuid.h> header file.
Needed to accommodate different layout on some platforms (Debian for
one).  Heikki Linnakangas
2007-10-23 21:38:16 +00:00
Tom Lane dbaec70c15 Rename and slightly redefine the default text search parser's "word"
categories, as per discussion.  asciiword (formerly lword) is still
ASCII-letters-only, and numword (formerly word) is still the most general
mixed-alpha-and-digits case.  But word (formerly nlword) is now
any-group-of-letters-with-at-least-one-non-ASCII, rather than all-non-ASCII as
before.  This is no worse than before for parsing mixed Russian/English text,
which seems to have been the design center for the original coding; and it
should simplify matters for parsing most European languages.  In particular
it will not be necessary for any language to accept strings containing digits
as being regular "words".  The hyphenated-word categories are adjusted
similarly.
2007-10-23 20:46:12 +00:00
Magnus Hagander 344d0cae64 Use snprintf instead of wsprintf, and use getenv("APPDATA") instead of
SHGetFolderPath.

This removes the direct dependency on shell32.dll and user32.dll, which
eats a lot of "desktop heap" for each backend that's started. The
desktop heap is a very limited resource, causing backends to no
longer start once it's been exhausted.

We still have indirect depdendencies on user32.dll through third party
libraries, but those can't easily be removed.

Dave Page
2007-10-23 17:58:01 +00:00
Tom Lane 12f25e70a6 Fix two-argument form of ts_rewrite() so it actually works for cases where
a later rewrite rule should change a subtree modified by an earlier one.
Per my gripe of a few days ago.
2007-10-23 01:44:40 +00:00
Tom Lane bb36c51fcd Fix several bugs in tsvectorin, including crash due to uninitialized field and
miscomputation of required palloc size.  The crash could only occur if the
input contained lexemes both with and without positions, which is probably not
common in practice.  The miscomputation would definitely result in wasted
space.  Also fix some inconsistent coding around alignment of strings and
positions in a tsvector value; these errors could also lead to crashes given
mixed with/without position data and a machine that's picky about alignment.
And be more careful about checking for overflow of string offsets.

Patch is only against HEAD --- I have not looked to see if same bugs are
in back-branch contrib/tsearch2 code.
2007-10-23 00:51:23 +00:00
Tom Lane f551348417 Clarify example of planner cost computation, per a suggestion from
James Shaw.  Also update a couple of examples to reflect 8.3's improved
plan-printing code.
2007-10-22 21:34:33 +00:00
Tom Lane 3e17ef1cfa Adjust ts_debug's output as per my proposal of yesterday: show the
active dictionary and its output lexemes as separate columns, instead
of smashing them into one text column, and lowercase the column names.
Also, define the output rowtype using OUT parameters instead of a
composite type, to be consistent with the other built-in functions.
2007-10-22 20:13:37 +00:00
Tom Lane 7ec280e117 Be careful to get share lock on each page before computing its free space.
ITAGAKI Takahiro
2007-10-22 17:29:35 +00:00
Tom Lane 88ae1bd3f2 Remove an Assert that's been obsoleted by recent changes in the parsetree
representation of DECLARE CURSOR.  Report and fix by Heikki.
2007-10-22 17:04:35 +00:00
Magnus Hagander f04b8a8e2c Increase FD_SETSIZE on Win32 to allow for more than 54 clients.
Per Greg Stark & Dave Page
2007-10-22 10:40:47 +00:00
Tom Lane 6088bfb8b6 Create a quick-and-dirty list of known migration issues for pre-8.3
users of tsearch.  This isn't meant to be permanent documentation,
but to call out the areas that need either fixing or real documentation.
2007-10-22 03:37:04 +00:00
Tom Lane f1c87830b5 Add a useless return statement to suppress a warning seen with some
versions of gcc (I'm seeing it with Apple's gcc 4.0.1).  I think the
reason we did not see this before was that the assert() macros in the
regex code were all no-ops till recently.
2007-10-22 01:02:22 +00:00
Tom Lane 1ea47dd8cb Fix shared tsvector/tsquery input code so that we don't say "syntax error in
tsvector" when we are really parsing a tsquery.  Report the bogus input,
too.  Make styles of some related error messages more consistent.
2007-10-21 22:29:56 +00:00
Tom Lane dfc6f130b4 Editorial overhaul for text search documentation. Organize the info
more clearly, improve a lot of unclear descriptions, add some missing
material.  We still need a migration guide though.
2007-10-21 20:04:37 +00:00
Bruce Momjian 6cb00e67ef Update Japanese FAQ.
Jun Kuwamura
2007-10-20 23:59:15 +00:00
Bruce Momjian b002af5698 More release note word-smithing. 2007-10-20 23:41:23 +00:00
Tom Lane 531ead8ab4 Adjust error message to agree with documentation. The tsearch documentation
uniformly calls these things weights, not classes.
2007-10-20 21:06:20 +00:00
Bruce Momjian 24f3a77112 Fix release tag spelling typo. 2007-10-20 20:19:06 +00:00
Bruce Momjian 1ba96ef04f More release note wording improvements. 2007-10-20 16:41:09 +00:00
Bruce Momjian 7b98f6be6e Update German FAQ.
Ian Barwick
2007-10-20 15:49:09 +00:00
Tom Lane 41a312a1f6 Add a note pointing out that you can't log to syslog without tweaking
the syslog configuration file (at least not on most known Unixen).
I dunno why we hadn't had that info in the docs all along ...
2007-10-20 04:00:38 +00:00
Tom Lane 638bd34f89 Found another small glitch in tsearch API: the two versions of ts_lexize()
are really redundant, since we invented a regdictionary alias type.
We can have just one function, declared as taking regdictionary, and
it will handle both behaviors.  Noted while working on documentation.
2007-10-19 22:01:45 +00:00
Tom Lane ba6b0bfd63 ts_rewrite() does not return a set, only one row; fix mislabeling in
pg_proc.h.
2007-10-19 19:48:34 +00:00
Bruce Momjian 6fe5885cdf More indenting cleanup for release notes. 2007-10-19 01:56:06 +00:00
Bruce Momjian 35dab98e1b Consistently indent release notes for prior releases. 2007-10-18 23:34:54 +00:00
Bruce Momjian decff24fe2 More release wording adjustments. 2007-10-18 23:05:06 +00:00
Bruce Momjian 52c51a45e6 More indenting cleanup, tag additions. 2007-10-18 16:47:58 +00:00
Bruce Momjian f031610297 Move a few items into migration from the main changes section. Indent
8.3 consistently.
2007-10-18 16:45:05 +00:00
Neil Conway 35342395c0 Minor fixes for the release notes. 2007-10-18 06:07:23 +00:00
Bruce Momjian 403b6fd9a9 Small changes to release note descriptions. 2007-10-18 05:39:06 +00:00
Bruce Momjian 62c99fc289 First pass over release documentation. I trimmed down some of the
entries and removed a few.
2007-10-18 05:15:48 +00:00
Bruce Momjian 6bec963aa5 Re-add FAQ item:
<H3 id="item4.19">4.19) Why do I get "relation with OID #####
    does not exist" errors when accessing temporary tables in PL/PgSQL
    functions?</H3>
2007-10-17 17:34:51 +00:00