Commit Graph

23983 Commits

Author SHA1 Message Date
Tom Lane
9c1443e66f Remove cost_hashjoin's very ancient hack to discourage (once, entirely forbid)
hash joins with the estimated-larger relation on the inside.  There are
several cases where doing that makes perfect sense, and in cases where it
doesn't, the regular cost computation really ought to be able to figure that
out.  Make some marginal tweaks in said computation to try to get results
approximating reality a bit better.  Per an example from Shane Ambler.

Also, fix an oversight in the original patch to add seq_page_cost: the costs
of spilling a hash join to disk should be scaled by seq_page_cost.
2007-01-08 16:09:31 +00:00
Tom Lane
2054724c08 Fix oversight in handling of row-comparison index keys: if the row comparison
doesn't exactly match the index, we may have to change our initial positioning
strategy.  For example, given an index on (f1,f2,f3) and a WHERE condition
"ROW(f1,f3) > ROW(2,3)", the code extracted the initial-positioning condition
"f1 > 2", which is wrong ... it has to be "f1 >= 2", else some rows matching
the WHERE condition may fail to be returned.

Applying patch to 8.2 only --- I'll fix it in HEAD later as part of the
planned index improvements (reverse-sort and NULLS FIRST/LAST work).
2007-01-07 01:56:24 +00:00
Tom Lane
79a0a57581 Fix filtered_base_yylex() to save and restore base_yylval and base_yylloc
properly when doing a lookahead.  The lack of this was causing various
interesting misbehaviors when one tries to use "with" as a plain identifier.
2007-01-06 19:14:27 +00:00
PostgreSQL Daemon
78c795d4e5 tag configure 2007-01-06 05:02:26 +00:00
Tom Lane
acb01484d6 Minor copy-editing for release note updates. 2007-01-05 22:34:46 +00:00
Bruce Momjian
e82da29033 Update Japanese FAQ. 2007-01-05 20:57:17 +00:00
Bruce Momjian
4290bb4e0f Stamp release 8.2.1. Update FAQs. 2007-01-05 20:55:29 +00:00
Bruce Momjian
d6c8cdcceb Create release notes for release 8.2.1. 2007-01-05 20:05:47 +00:00
Tom Lane
2ca07b0c4a Add missing reference to pg_shdescription. Greg Mullane 2007-01-05 01:19:04 +00:00
Tom Lane
34615ce73d Tweak pg_dumpall to add GRANT CONNECT ON DATABASE ... TO PUBLIC when dumping
database privileges from a pre-8.2 server.  This ensures that the reloaded
database will maintain the same behavior it had in the previous installation,
ie, everybody has connect privilege.  Per gripe from L Bayuk.
2007-01-04 17:49:42 +00:00
Tom Lane
4fe7a6b51e Fix erroneous implementation of -s in postmaster.c (the switch doesn't take
an optarg).  Add some comments noting that code in three different files has
to be kept in sync.  Fix erroneous description of -S switch (it sets work_mem
not silent_mode), and do some light copy-editing elsewhere in postgres-ref.
2007-01-04 00:58:01 +00:00
Tom Lane
f532a22a8f Fix regex_fixed_prefix() to cope reasonably well with regex patterns of the
form '^(foo)$'.  Before, these could never be optimized into indexscans.
The recent changes to make psql and pg_dump generate such patterns (for \d
commands and -t and related switches, respectively) therefore represented
a big performance hit for people with large pg_class catalogs, as seen in
recent gripe from Erik Jones.  While at it, be more paranoid about
case-sensitivity checking in multibyte encodings, and fix some other
corner cases in which a regex might be interpreted too liberally.
2007-01-03 22:39:35 +00:00
Tom Lane
32d029573d Add a defense to prevent core dumps if 8.2 version of rank_cd() is used with
the 8.1 SQL function definition for it.  Per report from Rajesh Kumar Mallah,
such a DBA error doesn't seem at all improbable, and the cost of checking for
it is not very high compared to the cost of running this function.  (It would
have been better to change the C name of the function so it wouldn't be called
by the old SQL definition, but it's too late for that now in the 8.2 branch.)
2006-12-28 01:09:04 +00:00
Tom Lane
46d90d6b52 Revert exports.list change pending closer study. 2006-12-28 00:01:12 +00:00
Tom Lane
37dc08bff0 Use a more backward-compatible syntax for exports.list on Linux.
Per Thorkil Olesen.
2006-12-27 23:53:21 +00:00
Tom Lane
1e78ea0ffe Modify local buffer management to request memory for local buffers in blocks
of increasing size, instead of one at a time.  This reduces the memory
management overhead when num_temp_buffers is large: in the previous coding
we would actually waste 50% of the space used for temp buffers, because aset.c
would round the individual requests up to 16K.  Problem noted while studying
a performance issue reported by Steven Flatt.

Back-patch as far as 8.1 --- older versions used few enough local buffers
that the issue isn't significant for them.
2006-12-27 22:31:59 +00:00
Tom Lane
38b72135c9 Print combining characters (those reported as having zero width by
PQdsplen()) normally, instead of replacing them by \uXXXX sequences.
Assume that they in fact occupy zero screen space for formatting purposes.
Per gripe from Michael Fuhr and ensuing discussion.
2006-12-27 19:45:51 +00:00
Tom Lane
094ccd1ca3 Use FROM clause in example UPDATE commands where appropriate. Also
remove long-obsolete statement that there isn't a check for infinite
recursion in view rules.
2006-12-27 16:07:42 +00:00
Tom Lane
66a7fd2ec1 Fix broken markup. 2006-12-27 16:04:47 +00:00
Tom Lane
4a1bffa066 Fix failure due to accessing an already-freed tuple descriptor in a plan
involving HashAggregate over SubqueryScan (this is the known case, there
may well be more).  The bug is only latent in releases before 8.2 since they
didn't try to access tupletable slots' descriptors during ExecDropTupleTable.
The least bogus fix seems to be to make subqueries share the parent query's
memory context, so that tupdescs they create will have the same lifespan as
those of the parent query.  There are comments in the code envisioning going
even further by not having a separate child EState at all, but that will
require rethinking executor access to range tables, which I don't want to
tackle right now.  Per bug report from Jean-Pierre Pelletier.
2006-12-26 21:37:28 +00:00
Tom Lane
85a373b1f0 Repair bug #2839: the various ExecReScan functions need to reset
ps_TupFromTlist in plan nodes that make use of it.  This was being done
correctly in join nodes and Result nodes but not in any relation-scan nodes.
Bug would lead to bogus results if a set-returning function appeared in the
targetlist of a subquery that could be rescanned after partial execution,
for example a subquery within EXISTS().  Bug has been around forever :-(
... surprising it wasn't reported before.
2006-12-26 19:26:56 +00:00
Tom Lane
b85a4cda83 Repair bug #2836: SPI_execute_plan returned zero if none of the querytrees
were marked canSetTag.  While it's certainly correct to return the result
of the last one that is marked canSetTag, it's less clear what to do when
none of them are.  Since plpgsql will complain if zero is returned, the
8.2.0 behavior isn't good.  I've fixed it to restore the prior behavior of
returning the physically last query's result code when there are no
canSetTag queries.
2006-12-26 16:56:22 +00:00
Teodor Sigaev
5ceb508422 Fix memory reallocation condition 2006-12-26 14:55:00 +00:00
Tom Lane
3b1645d119 Make HISTCONTROL=ignoredups work again (broken by misordering of
operations during recent code refactoring).  Per bug #2840 from Ned Crigler.
2006-12-24 19:14:41 +00:00
Teodor Sigaev
593d020ff6 Fix convertion for 'PFX flag N num' 2006-12-21 17:35:44 +00:00
Bruce Momjian
d686dccdb8 Remove completed TODO item about xid wrap-around from 8.2.X. 2006-12-19 21:58:43 +00:00
Tom Lane
14bdb023cc Fix some planner bugs exposed by reports from Arjen van der Meijden. These
are all in new-in-8.2 logic associated with indexability of ScalarArrayOpExpr
(IN-clauses) or amortization of indexscan costs across repeated indexscans
on the inside of a nestloop.  In particular:

Fix some logic errors in the estimation for multiple scans induced by a
ScalarArrayOpExpr indexqual.

Include a small cost component in bitmap index scans to reflect the costs of
manipulating the bitmap itself; this is mainly to prevent a bitmap scan from
appearing to have the same cost as a plain indexscan for fetching a single
tuple.

Also add a per-index-scan-startup CPU cost component; while prior releases
were clearly too pessimistic about the cost of repeated indexscans, the
original 8.2 coding allowed the cost of an indexscan to effectively go to zero
if repeated often enough, which is overly optimistic.

Pay some attention to index correlation when estimating costs for a nestloop
inner indexscan: this is significant when the plan fetches multiple heap
tuples per iteration, since high correlation means those tuples are probably
on the same or adjacent heap pages.
2006-12-15 18:42:35 +00:00
Tom Lane
4f554024a8 Put JST back into the default set of timezone abbreviations;
was removed in an unexplainable moment of brain fade.
2006-12-15 16:54:56 +00:00
Bruce Momjian
880dae5f2b Back out double-run of PDF/PS output. Requires building bookindex.sgml
properly.

Remove SGML docs about openjade performance patch, and instead add
comment in style sheet where indenting code is commented out.

Backpatch to 8.2.X.
2006-12-15 16:50:10 +00:00
Peter Eisentraut
6d3985b46e Drop indentation of verbatim environments in print output. This increased
the build time by what seemed like infinity.
2006-12-15 14:54:48 +00:00
Bruce Momjian
169f9f4cb6 Document patch needed to get PDF and PS output in a reasonable amount of
time.
2006-12-15 02:44:33 +00:00
Bruce Momjian
87047e4ca5 Run Jade twice when outputting Postscript and PDF so the index is
correct, add comments about other multiple runs in the Makefile.

Backpatch to 8.2.X.
2006-12-15 01:21:08 +00:00
Tom Lane
8867ffc519 Make --with-ldap build on Unixware, per Olivier Prenant. 2006-12-14 21:50:07 +00:00
Tom Lane
bef92dadb0 Fix planner to do the right thing when a degenerate outer join (one whose
joinclause doesn't use any outer-side vars) requires a "bushy" plan to be
created.  The normal heuristic to avoid joins with no joinclause has to be
overridden in that case.  Problem is new in 8.2; before that we forced the
outer join order anyway.  Per example from Teodor.
2006-12-12 21:31:09 +00:00
Bruce Momjian
e1b09b59de Document that log_line_prefix %t does not print timezone on Win32. 2006-12-12 21:30:41 +00:00
Peter Eisentraut
9178874f34 Collect the bits of wisdom about dtrace installation in the installation
chapter rather than scattering them across several incomplete fragments.

(This makes the documentation consistent with the backported FAQ_Solaris.)
2006-12-12 16:07:42 +00:00
Bruce Momjian
d94fa4183f Backpatch FAQ entry for null concatenation. 2006-12-11 22:48:08 +00:00
Tom Lane
3647ff3b3a Avoid double free of _SPI_current->tuptable. AtEOSubXact_SPI() now tries to
release it in a subtransaction abort, but this neglects possibility that
someone outside SPI already did.  Fix is for spi.c to forget about a tuptable
as soon as it's handed it back to the caller.
Per bug #2817 from Michael Andreen.
2006-12-08 00:40:33 +00:00
Tom Lane
373bd34e73 Repair incorrect placement of WHERE clauses when there are multiple,
rearrangeable outer joins and the WHERE clause is non-strict and mentions
only nullable-side relations.  New bug in 8.2, caused by new logic to allow
rearranging outer joins.  Per bug #2807 from Ross Cohen; thanks to Jeff
Davis for producing a usable test case.
2006-12-07 19:33:48 +00:00
Tom Lane
f07f11efde Fix planning of SubLinks to ensure that Vars generated from transformation of
a sublink's test expression have the correct vartypmod, rather than defaulting
to -1.  There's at least one place where this is important because we're
expecting these Vars to be exactly equal() to those appearing in the subplan
itself.  This is a pretty klugy solution --- it would likely be cleaner to
change Param nodes to include a typmod field --- but we can't do that in the
already-released 8.2 branch.
Per bug report from Hubert Fongarnand.
2006-12-06 19:40:08 +00:00
Bruce Momjian
a7fb173fa4 Clean up psql -c documentation that uses \\. 2006-12-06 15:40:32 +00:00
Bruce Momjian
1acc2e23f4 Fix documentation example of using psql \x with a SELECT command, per
Simon Riggs.  Backpatch to 8.2.X.
2006-12-05 17:41:02 +00:00
Bruce Momjian
dfd4259e94 Fix pg_dump linking on Win32 with MSVS win32.mak:
The module link is insufficient.:-(

---- Sorry, japanese message change to xxx ---
link.exe @C:\DOCUME~1\hi-saito\LOCALS~1\Temp\nmk03360.
common.obj : error LNK2001: xxxxxx "_pg_qsort" xxxxxx
pg_dump_sort.obj : error LNK2001: xxxxx "_pg_qsort" xxxxx
.\Release\pg_dump.exe : fatal error LNK1120: xxxxxxx
NMAKE : fatal error U1077: 'link.exe' : xxxxx '0x460'
Stop.

Hiroshi Saito
2006-12-04 22:26:46 +00:00
Bruce Momjian
e1bfa1869f Patch of Win32 Encoding problem for server messages using
FormatMessage() (This should have been in 8.2.0, patched to 8.2.X and
HEAD):

I think this problem to be complex....
http://archives.postgresql.org/pgsql-hackers/2006-11/msg00042.php

FormatMessage of windows cannot consider the encoding of the database.
However, I should try the solution now. It is necessary to clear the
problem.

Multi character-code exists together in message and log. It doesn't
consider
the data base encoding that the user intended....

The user in multi-byte country can try this.
http://inet.winpg.jp/~saito/pg_bug/MessageCheck.c

That is, it is likely to become it in this manner.(Japanese)
http://inet.winpg.jp/~saito/pg_bug/FormatMessage998.png

Hiroshi Saito
2006-12-04 22:24:04 +00:00
Teodor Sigaev
e72ef41d72 Fix core dump of ispell for case of non-successfull initialization.
Previous versions aren't affected.

Fix synonym dictionary init: string should be malloc'ed, not palloc'ed. Bug
introduced recently while fixing lowerstr().
2006-12-04 09:27:45 +00:00
Tom Lane
7f676624f6 Fix LIMIT/OFFSET for null limit values. This worked before 8.2 but was broken
by the change to make limit values int8 instead of int4.  (Specifically, you
can do DatumGetInt32 safely on a null value, but not DatumGetInt64.)  Per
bug #2803 from Greg Johnson.
2006-12-03 21:40:13 +00:00
Bruce Momjian
dca4d77798 Update 8.2.X release to say 8.2.0 instead of just 8.2. 2006-12-03 16:43:05 +00:00
PostgreSQL Daemon
2f52d7260c v8.2.0 is now released ... 2006-12-02 08:36:41 +00:00
Bruce Momjian
f8660e309d Stamp 8.2, except configure.in. 2006-12-02 04:12:39 +00:00
Bruce Momjian
73500fd8b5 Update for release 8.2. 2006-12-02 04:12:11 +00:00