Commit Graph

34122 Commits

Author SHA1 Message Date
Peter Eisentraut 8606e47e11 Normalize some British spellings 2012-08-24 22:50:43 -04:00
Tom Lane 7abaa6b9d3 Fix issues with checks for unsupported transaction states in Hot Standby.
The GUC check hooks for transaction_read_only and transaction_isolation
tried to check RecoveryInProgress(), so as to disallow setting read/write
mode or serializable isolation level (respectively) in hot standby
sessions.  However, GUC check hooks can be called in many situations where
we're not connected to shared memory at all, resulting in a crash in
RecoveryInProgress().  Among other cases, this results in EXEC_BACKEND
builds crashing during child process start if default_transaction_isolation
is serializable, as reported by Heikki Linnakangas.  Protect those calls
by silently allowing any setting when not inside a transaction; which is
okay anyway since these GUCs are always reset at start of transaction.

Also, add a check to GetSerializableTransactionSnapshot() to complain
if we are in hot standby.  We need that check despite the one in
check_XactIsoLevel() because default_transaction_isolation could be
serializable.  We don't want to complain any sooner than this in such
cases, since that would prevent running transactions at all in such a
state; but a transaction can be run, if SET TRANSACTION ISOLATION is done
before setting a snapshot.  Per report some months ago from Robert Haas.

Back-patch to 9.1, since these problems were introduced by the SSI patch.

Kevin Grittner and Tom Lane, with ideas from Heikki Linnakangas
2012-08-24 13:09:04 -04:00
Peter Eisentraut 406473b152 Put options on man page and in help output in slightly better order 2012-08-24 00:06:59 -04:00
Peter Eisentraut 4faf074a53 libpq: Fix memory leak in URI parser
When an invalid query parameter is reported, some memory leaks.

found by Coverity
2012-08-23 22:33:04 -04:00
Tom Lane ec8a0135c3 Fix cascading privilege revoke to notice when privileges are still held.
If we revoke a grant option from some role X, but X still holds the option
via another grant, we should not recursively revoke the privilege from
role(s) Y that X had granted it to.  This was supposedly fixed as one
aspect of commit 4b2dafcc0b, but I must not
have tested it, because in fact that code never worked: it forgot to shift
the grant-option bits back over when masking the bits being revoked.

Per bug #6728 from Daniel German.  Back-patch to all active branches,
since this has been wrong since 8.0.
2012-08-23 17:25:10 -04:00
Heikki Linnakangas 8b6b50a34d Fix typo in example. 2012-08-23 11:58:11 +03:00
Peter Eisentraut 26a6267226 Add instructions for setting up documentation tool chain on Mac OS X 2012-08-23 02:29:21 -04:00
Peter Eisentraut 7afa8bed65 pg_upgrade: Run the created scripts in the test suite
Just to check that they actually work.
2012-08-23 02:29:21 -04:00
Tom Lane 6e2e12c947 Remove overly-pessimistic statement about constraint exclusion.
As of 9.2, constraint exclusion should work okay with prepared statements:
the planner will try custom plans with actual values of the parameters,
and observe that they are a lot cheaper than the generic plan, and thus
never fall back to using the generic plan.  Noted by Tatsuhito Kasahara.
2012-08-22 23:55:34 -04:00
Tom Lane b33f611682 Make a cut at a major-features list for 9.2.
This is open to debate of course, but it's past time we had *something*
here.
2012-08-22 17:58:06 -04:00
Tom Lane 979f8f0431 Make an editorial pass over the 9.2 release notes.
A very large number of small improvements ...
2012-08-22 17:37:02 -04:00
Tom Lane 932a271956 Fix erroneous documentation of synchronous_commit = remote_write.
The docs claimed that this mode only waits for the standby to receive WAL
data, but actually it waits for the data to be written out to the standby's
OS; which is a pretty significant difference because it removes the risk of
crash of the walreceiver process.
2012-08-22 14:04:36 -04:00
Bruce Momjian 03af60c010 Fix typo. 2012-08-22 12:05:25 -04:00
Bruce Momjian 7dff5b8edd Document that pg_reload_conf() is also an easy way to reload the
configuration file.
2012-08-22 12:01:27 -04:00
Peter Eisentraut b748d8f280 Fix install-strip on Mac OS X
There was a hack put into install-sh to call strip with the correct
options on Mac OS X.  But that never worked, because configure
disabled stripping on that platform altogether.  So remove that dead
code, and while we're at it, update install-sh to the latest upstream
source (from Automake).

Instead, set up the right strip options in programs.m4, so this now
actually works the way it was originally intended.
2012-08-21 23:42:43 -04:00
Peter Eisentraut 5c45d2f878 Mark DateTimeParseError() noreturn
This avoids a warning from clang 3.2 about an uninitialized variable
'dtype' in date_in().
2012-08-21 23:32:58 -04:00
Tom Lane 0830cc9fe0 Update 9.2 release notes to reflect commits to date.
I was unable to entirely resist the temptation to copy-edit related
entries, but will save most of that for a separate pass.
2012-08-21 22:56:45 -04:00
Tom Lane 10685ec082 Avoid somewhat-theoretical overflow risks in RecordIsValid().
This improves on commit 51fed14d73 by
eliminating the assumption that we can form <some pointer value> +
<some offset> without overflow.  The entire point of those tests is that
we don't trust the offset value, so coding them in a way that could wrap
around if the buffer happens to be near the top of memory doesn't seem
sound.  Instead, track the remaining space as a size_t variable and
compare offsets against that.

Also, improve comment about why we need the extra early check on
xl_tot_len.
2012-08-21 18:41:52 -04:00
Tom Lane 0f524ea0cf Fix dumping of security_barrier views with circular dependencies.
If a view has circular dependencies, pg_dump splits it into a CREATE TABLE
and a CREATE RULE command to break the dependency loop.  However, if the
view has reloptions, those options cannot be applied in the CREATE TABLE
command, because views and tables have different allowed reloptions so
CREATE TABLE would reject them.  Instead apply the reloptions after the
CREATE RULE, using ALTER VIEW SET.
2012-08-21 15:18:36 -04:00
Robert Haas 4b373e42d1 Improve C comments in GetSnapshotData.
Move discussion of why our algorithm for taking snapshots in recovery
to a more appropriate location in the function, and delete incorrect
mention of taking a lock.
2012-08-21 11:47:10 -04:00
Robert Haas 82ef3d3008 Add a note to the MVCC chapter that some things aren't transactional.
Craig Ringer, slightly edited by me.
2012-08-21 11:10:17 -04:00
Peter Eisentraut 71450d7fd6 Teach compiler that ereport(>=ERROR) does not return
When elevel >= ERROR, we add an abort() call to the ereport() macro to
give the compiler a hint that the ereport() expansion will not return,
but the abort() isn't actually reached because the longjmp happens in
errfinish().

Because the effect of ereport() varies with the elevel, we cannot use
standard compiler attributes such as noreturn for this.
2012-08-21 00:03:32 -04:00
Peter Eisentraut ffdd5a0ee3 Remove external PID file on postmaster exit 2012-08-20 23:47:11 -04:00
Robert Haas 029722ac8e Improved tab completion for CLUSTER VERBOSE.
Jeff Janes
2012-08-20 16:45:44 -04:00
Robert Haas 68386fc15b Tab complete "TABLE whatever DROP CONSTRAINT" with a constraint name.
Jeff Janes
2012-08-20 16:30:08 -04:00
Tom Lane b2a01b9ad1 Fix bugs in contrib/pg_trgm's LIKE pattern analysis code.
Extraction of trigrams did not process LIKE escape sequences properly,
leading to possible misidentification of trigrams near escapes, resulting
in incorrect index search results.

Fujii Masao
2012-08-20 13:25:42 -04:00
Heikki Linnakangas 51fed14d73 Don't get confused if a WAL partial record header has xl_tot_len == 0.
If a WAL record header was split across pages, but xl_tot_len was 0, we
would get confused and conclude that we had already read the whole record,
and proceed to CRC check it. That can lead to a crash in RecordIsValid(),
which isn't careful to not read beyond end-of-record, as defined by
xl_tot_len.

Add an explicit sanity check for xl_tot_len <= SizeOfXlogRecord. Also,
make RecordIsValid() more robust by checking in each step that it doesn't
try to access memory beyond end of record, even if a length field in the
record's or a backup block's header is bogus.

Per report and analysis by Tom Lane.
2012-08-20 19:58:21 +03:00
Tom Lane 9b2a237cee Fix typo in comment. 2012-08-19 22:56:17 -04:00
Tom Lane a91f885f11 Remove obsolete comment. 2012-08-19 15:25:43 -04:00
Tom Lane 092d7ded29 Allow OLD and NEW in multi-row VALUES within rules.
Now that we have LATERAL, it's fairly painless to allow this case, which
was left as a TODO in the original multi-row VALUES implementation.
2012-08-19 14:12:16 -04:00
Tom Lane c246eb5aaf Make use of LATERAL in information_schema.sequences view.
It said "XXX: The following could be improved if we had LATERAL" ...
so let's do that.

No catversion bump since either version of the view works fine.
2012-08-18 16:14:57 -04:00
Tom Lane 084a29c94f Another round of planner fixes for LATERAL.
Formerly, subquery pullup had no need to examine other entries in the range
table, since they could not contain any references to the subquery being
pulled up.  That's no longer true with LATERAL, so now we need to be able
to visit rangetable subexpressions to replace Vars referencing the
pulled-up subquery.  Also, this means that extract_lateral_references must
be unsurprised at encountering lateral PlaceHolderVars, since such might be
created when pulling up a subquery that's underneath an outer join with
respect to the lateral reference.
2012-08-18 14:10:17 -04:00
Tom Lane 18226849ea Copy-editing for recent window-functions documentation rewrite.
Fix grammar, put back some removed information, rearrange for clarity.
2012-08-17 15:40:35 -04:00
Tom Lane 470d0b9789 Check LIBXML_VERSION instead of testing in configure script.
We had put a test for libxml2's xmlStructuredErrorContext variable in
configure, but of course that doesn't work on Windows builds.  The next
best alternative seems to be to test the LIBXML_VERSION symbol provided
by xmlversion.h.

Per report from Talha Bin Rizwan, though this fixes it in a different way
than his proposed patch.
2012-08-17 00:05:26 -04:00
Bruce Momjian 305557984d Update 'int' protocol documentation mention to be "signed", per request
from Dmitriy Igrishin
2012-08-16 22:07:14 -04:00
Bruce Momjian 3325957656 Delete inaccurate C comment about FSM and adding pages, per Robert Haas. 2012-08-16 19:02:58 -04:00
Bruce Momjian 86d0d16f8a Add URL for include file visualization tool. 2012-08-16 18:52:08 -04:00
Bruce Momjian 1037f2f646 Document that tab completation can interfere with some SQL commands. 2012-08-16 18:41:38 -04:00
Bruce Momjian c99016f1d0 Add warning about pg_ctl restart and the use of relative paths on the command-line. 2012-08-16 18:15:58 -04:00
Tom Lane f5983923d8 Allow create_index_paths() to consider multiple join bitmapscan paths.
In the initial cut at the "parameterized paths" feature, I'd simplified
create_index_paths() to the point where it would only generate a single
parameterized bitmap path per relation.  Experimentation with an example
supplied by Josh Berkus convinces me that that's not good enough: we really
need to consider a bitmap path for each possible outer relation.  Otherwise
we have regressions relative to pre-9.2 versions, in which the planner
picks a plain indexscan where it should have used a bitmap scan in queries
involving three or more tables.  Indeed, after fixing this, several queries
in the regression tests show improved plans as a result of using bitmap not
plain indexscans.
2012-08-16 13:03:54 -04:00
Tom Lane 56ba337e6f Suppress possibly-uninitialized-variable warning. 2012-08-16 12:04:07 -04:00
Bruce Momjian c04b9c1f3d Add possible alternate tool for pgrminclude, from Peter Geoghegan 2012-08-16 11:56:00 -04:00
Bruce Momjian c6ce4c1322 In docs, clarify that, without ORDER BY, the window frame is all rows in
the partition.
2012-08-16 11:32:22 -04:00
Bruce Momjian 5c1b2f5daa Revert: In docs, change a few cases of "not important" to
"unimportant".

Per request from Heikki
2012-08-16 11:26:40 -04:00
Bruce Momjian d5816d11af Rewrite window function reference section to more clearly explain
keywords and concepts, based on suggestions by Florian Pflug.
2012-08-16 10:42:42 -04:00
Bruce Momjian 7c97f6a0cb In docs, change a few cases of "not important" to "unimportant". 2012-08-16 10:36:43 -04:00
Heikki Linnakangas 317dd55a9c Add SP-GiST support for range types.
The implementation is a quad-tree, largely copied from the quad-tree
implementation for points. The lower and upper bound of ranges are the 2d
coordinates, with some extra code to handle empty ranges.

I left out the support for adjacent operator, -|-, from the original patch.
Not because there was necessarily anything wrong with it, but it was more
complicated than the other operators, and I only have limited time for
reviewing. That will follow as a separate patch.

Alexander Korotkov, reviewed by Jeff Davis and me.
2012-08-16 14:30:45 +03:00
Heikki Linnakangas 89911b3ab8 Fix GiST buffering build bug, which caused "failed to re-find parent" errors.
We use a hash table to track the parents of inner pages, but when inserting
to a leaf page, the caller of gistbufferinginserttuples() must pass a
correct block number of the leaf's parent page. Before gistProcessItup()
descends to a child page, it checks if the downlink needs to be adjusted to
accommodate the new tuple, and updates the downlink if necessary. However,
updating the downlink might require splitting the page, which might move the
downlink to a page to the right. gistProcessItup() doesn't realize that, so
when it descends to the leaf page, it might pass an out-of-date parent block
number as a result. Fix that by returning the block a tuple was inserted to
from gistbufferinginserttuples().

This fixes the bug reported by Zdeněk Jílovec.
2012-08-16 12:56:24 +03:00
Bruce Momjian de3773d951 Fix SGML markup; missing tag. 2012-08-15 23:57:19 -04:00
Bruce Momjian 077908aed7 Document that PGDATA has to point to the configuration files, rather
than the actual data storage directory.

Per suggestion from Thom Brown
2012-08-15 22:59:37 -04:00