Commit Graph

24017 Commits

Author SHA1 Message Date
Tom Lane 0cbc5b1ed4 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:20 +00:00
Tom Lane 68996463d4 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:46 +00:00
Tom Lane fccf99f0c8 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:18 +00:00
Tom Lane 4a836bad3a Remove incorrect semicolon in example. Joachim Wieland 2006-12-26 16:14:58 +00:00
Teodor Sigaev 49b64d346f Fix memory reallocation condition 2006-12-26 14:54:24 +00:00
Tatsuo Ishii 39def593c5 Call srandom() instead of srand().
pgbench calls random() later, so it should have called srandom().
On most platforms except Windows srandom() is actually identical
to srand(), so the bug only bites Windows users.
per bug report from Akio Ishida.
2006-12-26 01:02:05 +00:00
Tom Lane 506a9893b7 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:28 +00:00
Tom Lane 57f1630cf0 Bring some order and sanity to error handling in the xml patch.
Use a TRY block instead of (inadequate) ad-hoc coding to ensure that
libxml is cleaned up after a failure.  Report the intended SQLCODE
instead of defaulting to XX000.  Avoid risking use of a dangling
pointer by keeping the persistent error buffer in TopMemoryContext.
Be less trusting that error messages don't contain %.

This patch doesn't do anything about changing the way the messages
are put together --- this is just about mechanism.
2006-12-24 18:25:58 +00:00
Tom Lane e9da20ab4d Fix machine-dependent crash in sqlchar_to_unicode(). Get rid of
bletcherous and unsafe manipulation of global encoding setting.
Clean up libxml reporting mechanism a bit (it still looks like a
dangling-pointer crash waiting to happen, though, not to mention
being far less than sane from a localization standpoint).
2006-12-24 00:57:48 +00:00
Tom Lane c957c0bac7 Code review for XML patch. Instill a bit of sanity in the location of
the XmlExpr code in various lists, use a representation that has some hope
of reverse-listing correctly (though it's still a de-escaping function
shy of correctness), generally try to make it look more like Postgres
coding conventions.
2006-12-24 00:29:20 +00:00
Tom Lane 64974613c9 Suppress various compiler warnings in new xml code. 2006-12-23 04:56:50 +00:00
Bruce Momjian 426030eda1 Remove unnecessary parentheses in if() statements. 2006-12-23 02:13:24 +00:00
Bruce Momjian ef5870350a Change a VACUUM manual page word from 'deleted' to 'expired', so DELETE
and UPDATE are clearly covered by the term.
2006-12-23 01:58:40 +00:00
Bruce Momjian 05911de4da Document that CREATE TYPE names should not begin with an underscore,
rather than being disallowed.
2006-12-23 01:28:09 +00:00
Bruce Momjian 27eeca5c5b For GUC values, check for partial string matches on 'on' and 'off', but
require at least two characters for uniqueness.   This now matches the
behavior of other boolean strings we support, per report from Gurjeet
Singh.
2006-12-23 00:52:40 +00:00
Tom Lane a78fcfb512 Restructure operator classes to allow improved handling of cross-data-type
cases.  Operator classes now exist within "operator families".  While most
families are equivalent to a single class, related classes can be grouped
into one family to represent the fact that they are semantically compatible.
Cross-type operators are now naturally adjunct parts of a family, without
having to wedge them into a particular opclass as we had done originally.

This commit restructures the catalogs and cleans up enough of the fallout so
that everything still works at least as well as before, but most of the work
needed to actually improve the planner's behavior will come later.  Also,
there are not yet CREATE/DROP/ALTER OPERATOR FAMILY commands; the only way
to create a new family right now is to allow CREATE OPERATOR CLASS to make
one by default.  I owe some more documentation work, too.  But that can all
be done in smaller pieces once this infrastructure is in place.
2006-12-23 00:43:13 +00:00
Bruce Momjian d31ccb6c3e Add a link to the developer's FAQ for my article about how companies can
work effectively with open source communities.
2006-12-22 22:42:36 +00:00
Bruce Momjian 03d2a1c688 Slight adjustments to xml documentation to reflect functionality just
added.
2006-12-22 22:09:31 +00:00
Peter Eisentraut 2c0efff2a0 Fix expected file. 2006-12-21 19:18:04 +00:00
Peter Eisentraut d030a2bb20 Catalog version bump for SQL/XML changes. 2006-12-21 18:32:56 +00:00
Teodor Sigaev ca5bc1ae51 Fix convertion for 'PFX flag N num' 2006-12-21 17:35:28 +00:00
Peter Eisentraut 8c1de5fb00 Initial SQL/XML support: xml data type and initial set of functions. 2006-12-21 16:05:16 +00:00
Bruce Momjian ed1e9cd501 8.3 release schedule is year 2007, not 2006. 2006-12-20 16:22:14 +00:00
Bruce Momjian 1cacb3a098 Add timeline for next release to developer's FAQ. 2006-12-19 22:37:37 +00:00
Bruce Momjian f528e242fc Item done.
< 	o Improve xid wraparound detection by recording per-table rather
< 	  than per-database
2006-12-19 21:57:10 +00:00
Andrew Dunstan 5133dd786b Interpret a dbName param to PQsetdbLogin as a conninfo string if it contains an = sign. Tom Lane and Andrew Dunstan. 2006-12-19 01:53:36 +00:00
Tom Lane 93b4f0ff77 Set pg_am.amstrategies to zero for index AMs that don't have fixed
operator strategy numbers, ie, GiST and GIN.  This is almost cosmetic
enough to not need a catversion bump, but since the opr_sanity regression
test has to change in sync with the catalog entry, I figured I'd better
do one.
2006-12-18 18:56:29 +00:00
Andrew Dunstan 6b4fe0460c fix thinko in placement of TimeValStruct typedef in Windows case, as reported by Magnus. 2006-12-18 14:17:41 +00:00
Bruce Momjian cdcee16588 Fix typo:
<   While PostgreSQL clients runs fine limited-resource environments, the
>   While PostgreSQL clients runs fine in limited-resource environments, the
2006-12-17 03:57:07 +00:00
Bruce Momjian 6874fb90c0 Move entry into CLUSTER section:
< * Make CLUSTER preserve recently-dead tuples per MVCC requirements
> 	o Make CLUSTER preserve recently-dead tuples per MVCC requirements
2006-12-17 03:55:21 +00:00
Andrew Dunstan 7bdc55cc71 enable \timing oputput for \copy commands 2006-12-16 00:38:43 +00:00
Tom Lane 281f40187f 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:26 +00:00
Tom Lane 782d68e38d Put JST back into the default set of timezone abbreviations;
was removed in an unexplainable moment of brain fade.
2006-12-15 16:54:43 +00:00
Bruce Momjian 421c1ca48d 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:07 +00:00
Bruce Momjian 8186e7ef89 TODO item not wanted:
>
> * Embedded server (not wanted)
>
>   While PostgreSQL clients runs fine limited-resource environments, the
>   server requires multiple processes and a stable pool of resources to
>   run reliabily and efficiently.  Stripping down the PostgreSQL server
>   to run in the same process address space as the client application
>   would add too much complexity and failure cases.
2006-12-15 15:40:52 +00:00
Bruce Momjian 2356c9fc4c Link to summary XML email, rather than thread top:
< * Consider changing documentation from SGML to XML
> * Consider changing documentation format from SGML to XML
<   http://archives.postgresql.org/pgsql-docs/2006-12/msg00033.php
>   http://archives.postgresql.org/pgsql-docs/2006-12/msg00152.php
2006-12-15 13:28:54 +00:00
Bruce Momjian eb838baf49 Document issues for SGML and XML:
>
> * Consider changing documentation from SGML to XML
>
>   http://archives.postgresql.org/pgsql-docs/2006-12/msg00033.php
>
2006-12-15 03:01:20 +00:00
Bruce Momjian c4dfc4137e Document patch needed to get PDF and PS output in a reasonable amount of
time.
2006-12-15 02:44:28 +00:00
Bruce Momjian 9c92007029 Remove unneeded tab in file. 2006-12-15 02:19:21 +00:00
Bruce Momjian 6f84d53110 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:20:59 +00:00
Tom Lane 1f09a857b7 Make --with-ldap build on Unixware, per Olivier Prenant. 2006-12-14 21:49:54 +00:00
Peter Eisentraut 0bc8a5b669 Remove Windows port^W^Wobsolete template file. 2006-12-14 20:53:50 +00:00
Peter Eisentraut e5467d9e24 Activate WIN32_STACK_RLIMIT override only on platforms where this is
necessary.
2006-12-14 20:51:14 +00:00
Tom Lane ec97c55de2 Put back yet another improperly-removed #include, per Mark Kirkwood. 2006-12-13 05:54:48 +00:00
Bruce Momjian 8283cd7663 Update entry:
< * Have EXPLAIN ANALYZE highlight poor optimizer estimates
> * Have EXPLAIN ANALYZE issue NOTICE messages when the estimated and
>   actual row counts differ by a specified percentage
2006-12-12 22:31:19 +00:00
Tom Lane f18c57fdf1 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:02 +00:00
Bruce Momjian 0afabecbfd Document that log_line_prefix %t does not print timezone on Win32. 2006-12-12 21:30:33 +00:00
Bruce Momjian faf69ee4a3 Oops, removed:
< * Allow REINDEX CONCURRENTLY
2006-12-12 20:34:33 +00:00
Bruce Momjian 0f45c0890b Add:
> * Allow REINDEX CONCURRENTLY
2006-12-12 20:33:15 +00:00
Peter Eisentraut 9cf2706742 Allow augmenting CPPFLAGS from the configure command line. This generally
works, but some platform templates overwrote it without asking.
2006-12-12 19:43:19 +00:00