]> granicus.if.org Git - postgresql/log
postgresql
12 years agoFix a whitespace issue with the man pages
Peter Eisentraut [Tue, 15 May 2012 19:55:13 +0000 (22:55 +0300)]
Fix a whitespace issue with the man pages

See 6ef24487967692604b07a4a54e71821a60fb729a for an explanation.  This
is the same for the new man pages.

12 years agoRemove whitespace from end of lines
Peter Eisentraut [Tue, 15 May 2012 19:19:04 +0000 (22:19 +0300)]
Remove whitespace from end of lines

pgindent and perltidy should clean up the rest.

12 years agoMake xrefs to tables instead of assuming they appear below
Peter Eisentraut [Tue, 15 May 2012 18:53:07 +0000 (21:53 +0300)]
Make xrefs to tables instead of assuming they appear below

12 years agoRemove stray nbsp character
Peter Eisentraut [Tue, 15 May 2012 18:38:59 +0000 (21:38 +0300)]
Remove stray nbsp character

12 years agoFix bug in to_tsquery().
Heikki Linnakangas [Tue, 15 May 2012 16:22:56 +0000 (19:22 +0300)]
Fix bug in to_tsquery().

We were using memcpy() to copy to a possibly overlapping memory region,
which is a no-no. Use memmove() instead.

12 years agoIn pgstat.c, use a timeout in WaitLatchOrSocket only on Windows.
Tom Lane [Tue, 15 May 2012 03:51:34 +0000 (23:51 -0400)]
In pgstat.c, use a timeout in WaitLatchOrSocket only on Windows.

We have no need for a timeout here really, but some broken products from
Redmond seem to lose FD_READ events occasionally, and waking up and
retrying the recv() is the only known way to work around that.  Perhaps
somebody will be motivated to figure out a better answer here; but not I.

12 years agoRevert "Add some temporary instrumentation to pgstat.c."
Tom Lane [Tue, 15 May 2012 03:08:10 +0000 (23:08 -0400)]
Revert "Add some temporary instrumentation to pgstat.c."

This reverts commit 7d88bb73f755f7fb5d847ef2319c21076054fb0e.
That instrumentation has served its purpose.

12 years agoPut back AC_REQUIRE([AC_STRUCT_TM]).
Tom Lane [Tue, 15 May 2012 03:06:48 +0000 (23:06 -0400)]
Put back AC_REQUIRE([AC_STRUCT_TM]).

The BSD-ish members of the buildfarm all seem to think removing this
was a bad idea.  It looks to me like it resulted in omitting the system
header inclusion necessary to detect the fields of struct tm correctly.

12 years agoAssert that WaitLatchOrSocket callers cannot wait only for writability.
Tom Lane [Mon, 14 May 2012 20:11:59 +0000 (16:11 -0400)]
Assert that WaitLatchOrSocket callers cannot wait only for writability.

Since we have chosen to report socket EOF and error conditions via the
WL_SOCKET_READABLE flag bit, it's unsafe to wait only for
WL_SOCKET_WRITEABLE; the caller would never be notified of the socket
condition, and in some of these implementations WaitLatchOrSocket would
busy-wait until something else happens.  Add this restriction to the API
specification, and add Asserts to check that callers don't try to do that.

At some point we might want to consider adjusting the API to relax this
restriction, but until we have an actual use case for waiting on a
write-only socket, it seems premature to design a solution.

12 years agoRemove unused AC_DEFINE symbols
Peter Eisentraut [Mon, 14 May 2012 19:51:21 +0000 (22:51 +0300)]
Remove unused AC_DEFINE symbols

ENABLE_DTRACE            unused as of a7b7b07af340c73adee9959edf260695591a9496
HAVE_ERR_SET_MARK        unused as of 4ed4b6c54e5fab24ab2624d80e26f7546edc88ad
HAVE_FCVT                unused as of 4553e1d80f824291932cfde30aa24a76dd8f1941
HAVE_STRUCT_SOCKADDR_UN  unused as of b4cea00a1fc9d2270bfe9aeeee44915378d5f733
HAVE_SYSCONF             unused as of f83356c7f574bc69969f29dc7b430b286a0cd9f4
TM_IN_SYS_TIME           never used, obsolescent per Autoconf documentation

12 years agoFor testing purposes, reinsert a timeout in pgstat.c's wait call.
Tom Lane [Mon, 14 May 2012 19:03:14 +0000 (15:03 -0400)]
For testing purposes, reinsert a timeout in pgstat.c's wait call.

Test results from buildfarm members mastodon/narwhal (Windows Server 2003)
make it look like that platform just plain loses FD_READ events
occasionally, and the only reason our previous coding seemed to work was
that it timed out every couple of seconds and retried the whole operation.
Try to verify this by reinserting a finite timeout into the pgstat loop.
This isn't meant to be a permanent patch either, just to confirm or
disprove a theory.

12 years agoForce pgwin32_recv into nonblock mode when called from pgstat.c.
Tom Lane [Mon, 14 May 2012 14:57:07 +0000 (10:57 -0400)]
Force pgwin32_recv into nonblock mode when called from pgstat.c.

This should get rid of the usage of pgwin32_waitforsinglesocket entirely,
and perhaps thereby remove the race condition that's evidently still
present on some versions of Windows.  The previous arrangement was a bit
unsafe anyway, since waiting at the recv() would not allow pgstat to notice
postmaster death.

12 years agoRemove unnecessary pg_verifymbstr() calls from tsvector/query in functions.
Heikki Linnakangas [Mon, 14 May 2012 11:30:32 +0000 (14:30 +0300)]
Remove unnecessary pg_verifymbstr() calls from tsvector/query in functions.

The input should've been validated well before it hits the input function.
Doing so again is a waste of cycles.

12 years agoUpdate comments that became out-of-date with the PGXACT struct.
Heikki Linnakangas [Mon, 14 May 2012 07:22:44 +0000 (10:22 +0300)]
Update comments that became out-of-date with the PGXACT struct.

When the "hot" members of PGPROC were split off to separate PGXACT structs,
many PGPROC fields referred to in comments were moved to PGXACT, but the
comments were neglected in the commit. Mostly this is just a search/replace
of PGPROC with PGXACT, but the way the dummy PGPROC entries are created for
prepared transactions changed more, making some of the comments totally
bogus.

Noah Misch

12 years agoRemove leftovers of BeOS port
Peter Eisentraut [Mon, 14 May 2012 01:47:48 +0000 (04:47 +0300)]
Remove leftovers of BeOS port

These should have been removed when the BeOS port was removed in
44f90212236bfb6fc1279e95dc8fa315104d964e.

12 years agoSmall punctuation editing of postgresql.conf.sample
Peter Eisentraut [Mon, 14 May 2012 01:14:35 +0000 (04:14 +0300)]
Small punctuation editing of postgresql.conf.sample

12 years agopg_ctl: Improve --help output
Peter Eisentraut [Mon, 14 May 2012 00:54:17 +0000 (03:54 +0300)]
pg_ctl: Improve --help output

All other --help output has = signs between long options and their
arguments, so do it here as well.

12 years agoAdd some temporary instrumentation to pgstat.c.
Tom Lane [Mon, 14 May 2012 01:11:31 +0000 (21:11 -0400)]
Add some temporary instrumentation to pgstat.c.

Log main-loop blocking events and the results of inquiry messages.
This is to get some clarity as to what's happening on those Windows
buildfarm members that still don't like the latch-ified stats collector.
This bulks up the postmaster log a tad, so I won't leave it in place for
long.

12 years agoFix DROP TABLESPACE to unlink symlink when directory is not there.
Tom Lane [Sun, 13 May 2012 22:06:52 +0000 (18:06 -0400)]
Fix DROP TABLESPACE to unlink symlink when directory is not there.

If the tablespace directory is missing entirely, we allow DROP TABLESPACE
to go through, on the grounds that it should be possible to clean up the
catalog entry in such a situation.  However, we forgot that the pg_tblspc
symlink might still be there.  We should try to remove the symlink too
(but not fail if it's no longer there), since not doing so can lead to
weird behavior subsequently, as per report from Michael Nolan.

There was some discussion of adding dependency links to prevent DROP
TABLESPACE when the catalogs still contain references to the tablespace.
That might be worth doing too, but it's an orthogonal question, and in
any case wouldn't be back-patchable.

Back-patch to 9.0, which is as far back as the logic looks like this.
We could possibly do something similar in 8.x, but given the lack of
reports I'm not sure it's worth the trouble, and anyway the case could
not arise in the form the logic is meant to cover (namely, a post-DROP
transaction rollback having resurrected the pg_tablespace entry after
some or all of the filesystem infrastructure is gone).

12 years agoRe-revert stats collector latch changes.
Tom Lane [Sun, 13 May 2012 18:44:39 +0000 (14:44 -0400)]
Re-revert stats collector latch changes.

This reverts commit cb2f2873d6b81ad7f0a9733ba738bfac0746fb7b, restoring
the latch-ified stats collector logic.  We'll soon see if this works any
better on the Windows buildfarm machines.

12 years agoAttempt to fix some issues in our Windows socket code.
Tom Lane [Sun, 13 May 2012 18:35:40 +0000 (14:35 -0400)]
Attempt to fix some issues in our Windows socket code.

Make sure WaitLatchOrSocket regards FD_CLOSE as a read-ready condition.
We might want to tweak this further, but it was surely wrong as-is.

Make pgwin32_waitforsinglesocket detach its private event object from the
passed socket before returning.  I suspect that failure to do so leads
to race conditions when other code (such as WaitLatchOrSocket) attaches
a different event object to the same socket.  Moreover, the existing
coding meant that repeated calls to pgwin32_waitforsinglesocket would
perform ResetEvent on an event actively connected to a socket, which
is rumored to be an unsafe practice; the WSAEventSelect documentation
appears to recommend against this, though it does not say not to do it
in so many words.

Also, uniformly use the coding pattern "WSAEventSelect(s, NULL, 0)" to
detach events from sockets, rather than passing the event in the second
parameter.  The WSAEventSelect documentation says that the second parameter
is ignored if the third is 0, so theoretically this should make no
difference.  However, elsewhere on the same reference page the use of NULL
in this context is recommended, and I have found suggestions on the net
that some versions of Windows have bugs with a non-NULL second parameter
in this usage.

Some other mostly-cosmetic cleanup, such as using the right one of
WSAGetLastError and GetLastError for reporting errors from these functions.

12 years agoFix bogus declaration of local variable.
Tom Lane [Sun, 13 May 2012 04:30:32 +0000 (00:30 -0400)]
Fix bogus declaration of local variable.

rc should be an int here, not a pgsocket.  Fairly harmless as long as
pgsocket is an integer type, but nonetheless wrong.  Error introduced
in commit 87091cb1f1ed914e2ddca424fa28f94fdf8461d2.

12 years agoAvoid unnecessary process wakeups in the log collector.
Tom Lane [Sat, 12 May 2012 23:21:54 +0000 (19:21 -0400)]
Avoid unnecessary process wakeups in the log collector.

syslogger was coded to wake up once per second whether there was anything
useful to do or not.  As part of our campaign to reduce the server's idle
power consumption, change it to use a latch for waiting.  Now, in the
absence of any data to log or any signals to service, it will only wake up
at the programmed logfile rotation times (if any).

12 years agoRemove unused AC_SUBST variables
Peter Eisentraut [Sat, 12 May 2012 20:29:07 +0000 (23:29 +0300)]
Remove unused AC_SUBST variables

These were apparently never used.  The AC_SUBST was probably just
added in a copy-and-paste manner.  (The shell variables continue to be
used inside configure.  The change is just that we don't need them
outside of configure.)

12 years agoFix WaitLatchOrSocket to handle EOF on socket correctly.
Tom Lane [Sat, 12 May 2012 20:36:47 +0000 (16:36 -0400)]
Fix WaitLatchOrSocket to handle EOF on socket correctly.

When using poll(), EOF on a socket is reported with the POLLHUP not
POLLIN flag (at least on Linux).  WaitLatchOrSocket failed to check
this bit, causing it to go into a busy-wait loop if EOF occurs.
We earlier fixed the same mistake in the test for the state of the
postmaster_alive socket, but missed it for the caller-supplied socket.
Fortunately, this error is new in 9.2, since 9.1 only had a select()
based code path not a poll() based one.

12 years agoUpdate group commit release note item.
Bruce Momjian [Sat, 12 May 2012 12:55:07 +0000 (08:55 -0400)]
Update group commit release note item.

12 years agoEnsure backwards compatibility for GetStableLatestTransactionId()
Simon Riggs [Sat, 12 May 2012 12:26:10 +0000 (13:26 +0100)]
Ensure backwards compatibility for GetStableLatestTransactionId()

12 years agoFix obsolescent C declaration syntax
Peter Eisentraut [Sat, 12 May 2012 09:52:02 +0000 (12:52 +0300)]
Fix obsolescent C declaration syntax

gcc -Wextra/-Wold-style-declaration thinks that "inline" should go
before the function return type.

12 years agoExplain compatibility item about language names a bit more.
Tom Lane [Fri, 11 May 2012 22:53:12 +0000 (18:53 -0400)]
Explain compatibility item about language names a bit more.

Since we've got an "open items" list item about this, apparently some
people are pretty worried about it.

In passing remove a lot of trailing whitespace.

12 years agoUpdate example of process titles shown by "ps".
Tom Lane [Fri, 11 May 2012 22:33:39 +0000 (18:33 -0400)]
Update example of process titles shown by "ps".

This example was quite old: it lacked the WAL writer and autovac launcher
as well as the more recently added checkpointer.  Linux "ps" seems to show
slightly different stuff now too.

12 years agoCosmetic adjustments for postmaster's handling of checkpointer.
Tom Lane [Fri, 11 May 2012 21:46:08 +0000 (17:46 -0400)]
Cosmetic adjustments for postmaster's handling of checkpointer.

Correct some comments, order some operations a bit more consistently.
No functional changes.

12 years agoPL/Python: Adjust the regression tests for Python 3.3
Peter Eisentraut [Fri, 11 May 2012 20:01:15 +0000 (23:01 +0300)]
PL/Python: Adjust the regression tests for Python 3.3

The string representation of ImportError changed.  Remove printing
that; it's not necessary for the test.

The order in which members of a dict are printed changed.  But this
was always implementation-dependent, so we have just been lucky for a
long time.  Do the printing the hard way to ensure sorted order.

12 years agoFix contrib/citext's upgrade script to handle array and domain cases.
Tom Lane [Fri, 11 May 2012 19:22:30 +0000 (15:22 -0400)]
Fix contrib/citext's upgrade script to handle array and domain cases.

We previously recognized that citext wouldn't get marked as collatable
during pg_upgrade from a pre-9.1 installation, and hacked its
create-from-unpackaged script to manually perform the necessary catalog
adjustments.  However, we overlooked the fact that domains over citext,
as well as the citext[] array type, need the same adjustments.  Extend
the script to handle those cases.

Also, the documentation suggested that this was only an issue in pg_upgrade
scenarios, which is quite wrong; loading any dump containing citext from a
pre-9.1 server will also result in the type being wrongly marked.

I approached the documentation problem by changing the 9.1.2 release note
paragraphs about this issue, which is historically inaccurate.  But it
seems better than having the information scattered in multiple places, and
leaving incorrect info in the 9.1.2 notes would be bad anyway.  We'll still
need to mention the issue again in the 9.1.4 notes, but perhaps they can
just reference 9.1.2 for fix instructions.

Per report from Evan Carroll.  Back-patch into 9.1.

12 years agoPrevent loss of init fork when truncating an unlogged table.
Robert Haas [Fri, 11 May 2012 13:46:42 +0000 (09:46 -0400)]
Prevent loss of init fork when truncating an unlogged table.

Fixes bug #6635, reported by Akira Kurosawa.

12 years agoRemove extraneous #include "storage/proc.h"
Simon Riggs [Fri, 11 May 2012 13:46:46 +0000 (14:46 +0100)]
Remove extraneous #include "storage/proc.h"

12 years agoEnsure age() returns a stable value rather than the latest value
Simon Riggs [Fri, 11 May 2012 13:36:24 +0000 (14:36 +0100)]
Ensure age() returns a stable value rather than the latest value

12 years agoOn GiST page split, release the locks on child pages before recursing up.
Heikki Linnakangas [Fri, 11 May 2012 09:35:28 +0000 (12:35 +0300)]
On GiST page split, release the locks on child pages before recursing up.

When inserting the downlinks for a split gist page, we used hold the locks
on the child pages until the insertion into the parent - and recursively its
parent if it had to be split too - were all completed. Change that so that
the locks on child pages are released after the insertion in the immediate
parent is done, before recursing further up the tree.

This reduces the number of lwlocks that are held simultaneously. Holding
many locks is bad for concurrency, and in extreme cases you can even hit
the limit of 100 simultaneously held lwlocks in a backend. If you're really
unlucky, you can hit the limit while in a critical section, which brings
down the whole system.

This fixes bug #6629 reported by Tom Forbes. Backpatch to 9.1. The page
splitting code was rewritten in 9.1, and the old code did not have this
problem.

12 years agoImprove discussion of setting server parameters.
Tom Lane [Fri, 11 May 2012 03:01:28 +0000 (23:01 -0400)]
Improve discussion of setting server parameters.

Rewrite description of "include_if_exists" for clarity.  Add subsection
headings to make the structure of the page a little clearer.  A couple
other minor improvements too.

Josh Kupershmidt and Tom Lane

12 years agoRevert catalog bump; was post-beta1, and unnecessary.
Bruce Momjian [Thu, 10 May 2012 22:44:47 +0000 (18:44 -0400)]
Revert catalog bump;  was post-beta1, and unnecessary.

12 years agoUpdate comment for 'name' data type to say 63 "bytes".
Bruce Momjian [Thu, 10 May 2012 22:40:40 +0000 (18:40 -0400)]
Update comment for 'name' data type to say 63 "bytes".

Catalog version bump so everyone has the same comment for beta1.

12 years agoStamp 9.2beta1. REL9_2_BETA1
Tom Lane [Thu, 10 May 2012 22:35:09 +0000 (18:35 -0400)]
Stamp 9.2beta1.

12 years agoTweak documentation wording to avoid "pdfendlink" failure.
Tom Lane [Thu, 10 May 2012 22:02:37 +0000 (18:02 -0400)]
Tweak documentation wording to avoid "pdfendlink" failure.

HEAD documentation was failing to build as US PDF for me, because a link
to "CREATE CAST" was getting split across pages.  Adjust wording to
remove this rather gratuitous cross-reference.

12 years agoTemporarily revert stats collector latch changes so we can ship beta1.
Tom Lane [Thu, 10 May 2012 21:26:08 +0000 (17:26 -0400)]
Temporarily revert stats collector latch changes so we can ship beta1.

This patch reverts commit 49340037ee3ab46cb24144a86705e35f272c24d5 and some
follow-on tweaking in pgstat.c.  While the basic scheme of latch-ifying the
stats collector seems sound enough, it's failing on most Windows buildfarm
members for unknown reasons, and there's no time left to debug that before
9.2beta1.  Better to ship a beta version without this improvement.  I hope
to re-revert this once beta1 is out, though.

12 years agoMerge visibility map crash-safety into index-only scan release note
Bruce Momjian [Thu, 10 May 2012 20:50:34 +0000 (16:50 -0400)]
Merge visibility map crash-safety into index-only scan release note
item, per Robert Haas.

12 years agoMake WaitLatch's WL_POSTMASTER_DEATH result trustworthy; simplify callers.
Tom Lane [Thu, 10 May 2012 18:34:22 +0000 (14:34 -0400)]
Make WaitLatch's WL_POSTMASTER_DEATH result trustworthy; simplify callers.

Per a suggestion from Peter Geoghegan, make WaitLatch responsible for
verifying that the WL_POSTMASTER_DEATH bit it returns is truthful (by
testing PostmasterIsAlive).  Then simplify its callers, who no longer
need to do that for themselves.  Remove weasel wording about falsely-set
result bits from WaitLatch's API contract.

12 years agoProperly capitalize the TimeZone parameter
Peter Eisentraut [Thu, 10 May 2012 17:55:49 +0000 (20:55 +0300)]
Properly capitalize the TimeZone parameter

For better or worse, it is implemented in mixed case, so document it
as such, at least in the main listing, like DateStyle.

Josh Kupershmidt

12 years agoAdd comma after "Previously" as suggested by Josh Kupershmidt
Bruce Momjian [Thu, 10 May 2012 17:47:49 +0000 (13:47 -0400)]
Add comma after "Previously" as suggested by Josh Kupershmidt

12 years agoPL/Python: Fix slicing support for result objects for Python 3
Peter Eisentraut [Thu, 10 May 2012 17:38:17 +0000 (20:38 +0300)]
PL/Python: Fix slicing support for result objects for Python 3

The old way of implementing slicing support by implementing
PySequenceMethods.sq_slice no longer works in Python 3.  You now have
to implement PyMappingMethods.mp_subscript.  Do this by simply
proxying the call to the wrapped list of result dictionaries.
Consolidate some of the subscripting regression tests.

Jan UrbaÅ„ski

12 years agoPL/Python: Update incorrect comment
Peter Eisentraut [Thu, 10 May 2012 17:07:56 +0000 (20:07 +0300)]
PL/Python: Update incorrect comment

Jan UrbaÅ„ski

12 years ago9.2 release note updates from Peter Geoghegan
Bruce Momjian [Thu, 10 May 2012 17:38:05 +0000 (13:38 -0400)]
9.2 release note updates from Peter Geoghegan

12 years agoFix Windows implementation of PGSemaphoreLock.
Tom Lane [Thu, 10 May 2012 17:36:14 +0000 (13:36 -0400)]
Fix Windows implementation of PGSemaphoreLock.

The original coding failed to reset ImmediateInterruptOK before returning,
which would potentially allow a subsequent query-cancel interrupt to be
accepted at an unsafe point.  This is a really nasty bug since it's so hard
to predict the consequences, but they could be unpleasant.

Also, ensure that signal handlers are serviced before this function
returns, even if the semaphore is already set.  This should make the
behavior more like Unix.

Back-patch to all supported versions.

12 years agoImprove Windows implementation of WaitLatch/WaitLatchOrSocket.
Tom Lane [Thu, 10 May 2012 17:26:47 +0000 (13:26 -0400)]
Improve Windows implementation of WaitLatch/WaitLatchOrSocket.

Ensure that signal handlers are serviced before this function returns.
This should make the behavior more like Unix.  Also, add some more
error checking, and make some other cosmetic improvements.

No back-patch since it's not clear whether this is fixing any live bug
that would affect 9.1.  I'm more concerned about 9.2 anyway given our
considerable recent expansions in the usage of WaitLatch.

12 years agoNew 9.2 SSL parameters are GUC, not libpq, per Magnus's observation.
Bruce Momjian [Thu, 10 May 2012 17:16:10 +0000 (13:16 -0400)]
New 9.2 SSL parameters are GUC, not libpq, per Magnus's observation.

12 years agoAdd 9.2 release note suggestions from Heikki,
Bruce Momjian [Thu, 10 May 2012 17:13:05 +0000 (13:13 -0400)]
Add 9.2 release note suggestions from Heikki,

12 years agoPython 2.2 is no longer supported
Peter Eisentraut [Thu, 10 May 2012 16:58:35 +0000 (19:58 +0300)]
Python 2.2 is no longer supported

It was already on its last legs, and it turns out that it was
accidentally broken in commit 89e850e6fda9e4e441712012abe971fe938d595a
and no one cared.  So remove the rest the support for it and update
the documentation to indicate that Python 2.3 is now required.

12 years agoWhitespace cleanup
Peter Eisentraut [Thu, 10 May 2012 16:53:41 +0000 (19:53 +0300)]
Whitespace cleanup

12 years ago9.2 release note adjustments from Robert Haas.
Bruce Momjian [Thu, 10 May 2012 17:00:18 +0000 (13:00 -0400)]
9.2 release note adjustments from Robert Haas.

12 years agoAnother doc fix for HTML entities.
Bruce Momjian [Thu, 10 May 2012 16:54:39 +0000 (12:54 -0400)]
Another doc fix for HTML entities.

12 years agoUpdate entitiy escapes docs; must be Latin1.
Bruce Momjian [Thu, 10 May 2012 16:53:21 +0000 (12:53 -0400)]
Update entitiy escapes docs;  must be Latin1.

12 years agoRemove URL that suggested numeric HTML entities.
Bruce Momjian [Thu, 10 May 2012 16:33:54 +0000 (12:33 -0400)]
Remove URL that suggested numeric HTML entities.

12 years agoRemove unportable use of SGML character-code entity.
Tom Lane [Thu, 10 May 2012 16:22:22 +0000 (12:22 -0400)]
Remove unportable use of SGML character-code entity.

It'd be nice to be able to spell Jan Urbanski's name with the correct
accent marks, but we haven't yet found a way that works in everybody's
docs toolchain.  This way definitely doesn't.

12 years agoRelease notes adjustments from Erik Rijkers
Bruce Momjian [Thu, 10 May 2012 15:21:13 +0000 (11:21 -0400)]
Release notes adjustments from Erik Rijkers

12 years agoImprove two 9.2 release note items.
Bruce Momjian [Thu, 10 May 2012 14:29:49 +0000 (10:29 -0400)]
Improve two 9.2 release note items.

12 years agoFix a couple of typos in 9.2 release notes.
Heikki Linnakangas [Thu, 10 May 2012 12:41:31 +0000 (15:41 +0300)]
Fix a couple of typos in 9.2 release notes.

Thom Brown

12 years agoCopy-editing 9.2 release notes.
Heikki Linnakangas [Thu, 10 May 2012 07:44:31 +0000 (10:44 +0300)]
Copy-editing 9.2 release notes.

Fix a couple of typos, add missing filename tags, and add a link to the doc
section on timezone guc.

12 years agoOnly attempt to show collations on servers >= 9.1.
Magnus Hagander [Thu, 10 May 2012 07:11:38 +0000 (09:11 +0200)]
Only attempt to show collations on servers >= 9.1.

Show a proper error message instead of a SQL error.

Josh Kupershmidt

12 years agoFix outdated comment.
Heikki Linnakangas [Thu, 10 May 2012 06:55:48 +0000 (09:55 +0300)]
Fix outdated comment.

Multi-insert records observe XLOG_HEAP_INIT_PAGE flag too, as Andres Freund
pointed out.

12 years agoPL/pgSQL RETURN NEXT was leaking converted tuples, causing
Joe Conway [Thu, 10 May 2012 05:57:19 +0000 (22:57 -0700)]
PL/pgSQL RETURN NEXT was leaking converted tuples, causing
out of memory when looping through large numbers of rows.
Flag the converted tuples to be freed. Complaint and patch
by Joe.

12 years agoImprove tests for postmaster death in auxiliary processes.
Tom Lane [Thu, 10 May 2012 04:54:32 +0000 (00:54 -0400)]
Improve tests for postmaster death in auxiliary processes.

In checkpointer and walwriter, avoid calling PostmasterIsAlive unless
WaitLatch has reported WL_POSTMASTER_DEATH.  This saves a kernel call per
iteration of the process's outer loop, which is not all that much, but a
cycle shaved is a cycle earned.  I had already removed the unconditional
PostmasterIsAlive calls in bgwriter and pgstat in previous patches, but
forgot that WL_POSTMASTER_DEATH is supposed to be treated as untrustworthy
(per comment in unix_latch.c); so adjust those two cases to match.

There are a few other places where the same idea might be applied, but only
after substantial code rearrangement, so I didn't bother.

12 years agoUpdate 9.2 SSL release note links.
Bruce Momjian [Thu, 10 May 2012 04:32:08 +0000 (00:32 -0400)]
Update 9.2 SSL release note links.

12 years agoFurther tweaking of nomenclature in checkpointer.c.
Tom Lane [Thu, 10 May 2012 04:01:10 +0000 (00:01 -0400)]
Further tweaking of nomenclature in checkpointer.c.

Get rid of some more naming choices that only make sense if you know that
this code used to be in the bgwriter, as well as some stray comments
referencing the bgwriter.

12 years agoImprove control logic for bgwriter hibernation mode.
Tom Lane [Thu, 10 May 2012 03:36:01 +0000 (23:36 -0400)]
Improve control logic for bgwriter hibernation mode.

Commit 6d90eaaa89a007e0d365f49d6436f35d2392cfeb added a hibernation mode
to the bgwriter to reduce the server's idle-power consumption.  However,
its interaction with the detailed behavior of BgBufferSync's feedback
control loop wasn't very well thought out.  That control loop depends
primarily on the rate of buffer allocation, not the rate of buffer
dirtying, so the hibernation mode has to be designed to operate only when
no new buffer allocations are happening.  Also, the check for whether the
system is effectively idle was not quite right and would fail to detect
a constant low level of activity, thus allowing the bgwriter to go into
hibernation mode in a way that would let the cycle time vary quite a bit,
possibly further confusing the feedback loop.  To fix, move the wakeup
support from MarkBufferDirty and SetBufferCommitInfoNeedsSave into
StrategyGetBuffer, and prevent the bgwriter from entering hibernation mode
unless no buffer allocations have happened recently.

In addition, fix the delaying logic to remove the problem of possibly not
responding to signals promptly, which was basically caused by trying to use
the process latch's is_set flag for multiple purposes.  I can't prove it
but I'm suspicious that that hack was responsible for the intermittent
"postmaster does not shut down" failures we've been seeing in the buildfarm
lately.  In any case it did nothing to improve the readability or
robustness of the code.

In passing, express the hibernation sleep time as a multiplier on
BgWriterDelay, not a constant.  I'm not sure whether there's any value in
exposing the longer sleep time as an independently configurable setting,
but we can at least make it act like this for little extra code.

12 years agoPublish draft version of Postgres 9.2 release notes.
Bruce Momjian [Thu, 10 May 2012 02:25:43 +0000 (22:25 -0400)]
Publish draft version of Postgres 9.2 release notes.

12 years agoAdd make dependency so that postgres.bki is rebuilt in major version change
Peter Eisentraut [Wed, 9 May 2012 17:45:56 +0000 (20:45 +0300)]
Add make dependency so that postgres.bki is rebuilt in major version change

Every time since the current rule for postgres.bki was put in place
when we change the major version, people complain that their tests
fail in strange ways.  This is because the version number in
postgres.bki is not updated, because it has no dependency for that.
And you can't even force the rebuild manually if you don't happen to
know which file has the problem.  Fix that now before it will happen
again.

The only remaining problem with switching major versions, as far as
the regression tests are concerned, is that contrib needs to be
rebuilt.  But that's easily invoked, and in any case the failure modes
are more friendly if you forget that.

12 years agoSplit contrib documentation into extensions and programs
Peter Eisentraut [Wed, 9 May 2012 17:39:53 +0000 (20:39 +0300)]
Split contrib documentation into extensions and programs

Create separate appendixes for contrib extensions and other server
plugins on the one hand, and utility programs on the other.  Recast
the documentation of the latter as refentries, so that man pages are
generated.

12 years agoUpdate documentation to say that gmake check in contrib is supported
Peter Eisentraut [Wed, 9 May 2012 17:37:09 +0000 (20:37 +0300)]
Update documentation to say that gmake check in contrib is supported

12 years agoRename BgWriterShmem/Request to CheckpointerShmem/Request
Simon Riggs [Wed, 9 May 2012 13:23:45 +0000 (14:23 +0100)]
Rename BgWriterShmem/Request to CheckpointerShmem/Request

12 years agoRename BgWriterCommLock to CheckpointerCommLock
Simon Riggs [Wed, 9 May 2012 13:11:48 +0000 (14:11 +0100)]
Rename BgWriterCommLock to CheckpointerCommLock

12 years agoAvoid xid error from age() function when run on Hot Standby
Simon Riggs [Wed, 9 May 2012 12:56:24 +0000 (13:56 +0100)]
Avoid xid error from age() function when run on Hot Standby

12 years agoAdd another URL for HTML entity codes.
Bruce Momjian [Wed, 9 May 2012 03:17:43 +0000 (23:17 -0400)]
Add another URL for HTML entity codes.

12 years agoFix an issue in recent walwriter hibernation patch.
Tom Lane [Wed, 9 May 2012 03:05:58 +0000 (23:05 -0400)]
Fix an issue in recent walwriter hibernation patch.

Users of asynchronous-commit mode expect there to be a guaranteed maximum
delay before an async commit's WAL records get flushed to disk.  The
original version of the walwriter hibernation patch broke that.  Add an
extra shared-memory flag to allow async commits to kick the walwriter out
of hibernation mode, without adding any noticeable overhead in cases where
no action is needed.

12 years agoDocument how to find non-ASCII characters in the release notes.
Bruce Momjian [Wed, 9 May 2012 02:51:17 +0000 (22:51 -0400)]
Document how to find non-ASCII characters in the release notes.

12 years agoReduce idle power consumption of stats collector process.
Tom Lane [Wed, 9 May 2012 01:26:46 +0000 (21:26 -0400)]
Reduce idle power consumption of stats collector process.

Latch-ify the stats collector, so that it does not need an arbitrary wakeup
cycle to check for postmaster death.  The incremental savings in idle power
is pretty marginal, since we only had it waking every two seconds; but I
believe that this patch may also improve the collector's performance under
load, by reducing the number of kernel calls made per message when messages
are arriving constantly (we now avoid a select/poll call except when we
need to sleep).  The change also reduces the time needed for a normal
database shutdown on platforms where signals don't interrupt select().

12 years agoReduce idle power consumption of walwriter and checkpointer processes.
Tom Lane [Wed, 9 May 2012 00:03:26 +0000 (20:03 -0400)]
Reduce idle power consumption of walwriter and checkpointer processes.

This patch modifies the walwriter process so that, when it has not found
anything useful to do for many consecutive wakeup cycles, it extends its
sleep time to reduce the server's idle power consumption.  It reverts to
normal as soon as it's done any successful flushes.  It's still true that
during any async commit, backends check for completed, unflushed pages of
WAL and signal the walwriter if there are any; so that in practice the
walwriter can get awakened and returned to normal operation sooner than the
sleep time might suggest.

Also, improve the checkpointer so that it uses a latch and a computed delay
time to not wake up at all except when it has something to do, replacing a
previous hardcoded 0.5 sec wakeup cycle.  This also is primarily useful for
reducing the server's power consumption when idle.

In passing, get rid of the dedicated latch for signaling the walwriter in
favor of using its procLatch, since that comports better with possible
generic signal handlers using that latch.  Also, fix a pre-existing bug
with failure to save/restore errno in walwriter's signal handlers.

Peter Geoghegan, somewhat simplified by Tom

12 years agoTweak contrib --help output to match common style
Peter Eisentraut [Tue, 8 May 2012 18:55:05 +0000 (21:55 +0300)]
Tweak contrib --help output to match common style

Placeholders such as OPTION are typically kept in singular.

12 years agopsql: Add variable to control keyword case in tab completion
Peter Eisentraut [Tue, 8 May 2012 18:03:45 +0000 (21:03 +0300)]
psql: Add variable to control keyword case in tab completion

This adds the variable COMP_KEYWORD_CASE, which controls in what case
keywords are completed.  This is partially to let users configure the
change from commit 69f4f1c3576abc535871c6cfa95539e32a36120f, but it
also offers more behaviors than were available before.

12 years agoUpdate config.guess and config.sub
Peter Eisentraut [Tue, 8 May 2012 17:46:13 +0000 (20:46 +0300)]
Update config.guess and config.sub

12 years agoFix dependency tracking for src/port/%_srv.o files
Peter Eisentraut [Tue, 8 May 2012 17:08:53 +0000 (20:08 +0300)]
Fix dependency tracking for src/port/%_srv.o files

Because they use their own compilation rule, they don't use the
dependency tracking logic from Makefile.global.  To make sure that
dependency tracking works anyway for the *_srv.o files, depend on
their *.o siblings as well, which do have proper dependencies.  It's a
hack that might fail someday if there is a *_srv.o without a
corresponding *.o, but it works for now (and those would probably go
into src/backend/port/ anyway).

12 years agoFix misleading comments
Peter Eisentraut [Tue, 8 May 2012 16:35:22 +0000 (19:35 +0300)]
Fix misleading comments

Josh Kupershmidt

12 years agoRemove strdup, strtol, strtoul from libpgport
Peter Eisentraut [Mon, 7 May 2012 20:10:28 +0000 (23:10 +0300)]
Remove strdup, strtol, strtoul from libpgport

These should not be needed anymore, at least after the recent port
removals.  So let's see whether we can do without them.

12 years agoFix pg_config.h make rule
Peter Eisentraut [Mon, 7 May 2012 18:28:38 +0000 (21:28 +0300)]
Fix pg_config.h make rule

According to the Autoconf documentation, there should be a make rule

pg_config.h: stamp-h

so that with the right setup around this, a change in pg_config.h.in
will trigger a rebuild of everything that depends on pg_config.h.  But
this doesn't always work, sometimes you need to run make twice to get
everything up to date after a change of pg_config.h.in.

The fix is to write the rule as

pg_config.h: stamp-h ;

instead (with an empty command instead of no command).  This is what
Automake-generated makefiles effectively do, so it seems safe to be on
this side.

It's not actually clear why this is (apparently) more correct.  It's
been posted to
<http://lists.gnu.org/archive/html/help-make/2012-04/msg00058.html>
without response so far.

12 years agoMake "unexpected EOF" messages DEBUG1 unless in an open transaction
Magnus Hagander [Mon, 7 May 2012 16:39:37 +0000 (18:39 +0200)]
Make "unexpected EOF" messages DEBUG1 unless in an open transaction

"Unexpected EOF on client connection" without an open transaction
is mostly noise, so turn it into DEBUG1. With an open transaction it's
still indicating a problem, so keep those as ERROR, and change the message
to indicate that it happened in a transaction.

12 years agoDocument that it is the pgsql version we are matching for psqlrc
Bruce Momjian [Mon, 7 May 2012 01:43:55 +0000 (21:43 -0400)]
Document that it is the pgsql version we are matching for psqlrc
version-specific files, not the server version.

12 years agoRevert typo fix 768c3affd44d1dcb4e43e2e006c642524714c2a4; I was wrong.
Bruce Momjian [Sun, 6 May 2012 12:10:55 +0000 (08:10 -0400)]
Revert typo fix 768c3affd44d1dcb4e43e2e006c642524714c2a4;  I was wrong.

12 years agoFix psql doc typo.
Bruce Momjian [Sat, 5 May 2012 15:59:53 +0000 (11:59 -0400)]
Fix psql doc typo.

12 years agoOverdue code review for transaction-level advisory locks patch.
Tom Lane [Fri, 4 May 2012 21:43:27 +0000 (17:43 -0400)]
Overdue code review for transaction-level advisory locks patch.

Commit 62c7bd31c8878dd45c9b9b2429ab7a12103f3590 had assorted problems, most
visibly that it broke PREPARE TRANSACTION in the presence of session-level
advisory locks (which should be ignored by PREPARE), as per a recent
complaint from Stephen Rees.  More abstractly, the patch made the
LockMethodData.transactional flag not merely useless but outright
dangerous, because in point of fact that flag no longer tells you anything
at all about whether a lock is held transactionally.  This fix therefore
removes that flag altogether.  We now rely entirely on the convention
already in use in lock.c that transactional lock holds must be owned by
some ResourceOwner, while session holds are never so owned.  Setting the
locallock struct's owner link to NULL thus denotes a session hold, and
there is no redundant marker for that.

PREPARE TRANSACTION now works again when there are session-level advisory
locks, and it is also able to transfer transactional advisory locks to the
prepared transaction, but for implementation reasons it throws an error if
we hold both types of lock on a single lockable object.  Perhaps it will be
worth improving that someday.

Assorted other minor cleanup and documentation editing, as well.

Back-patch to 9.1, except that in the 9.1 branch I did not remove the
LockMethodData.transactional flag for fear of causing an ABI break for
any external code that might be examining those structs.

12 years agodoc: Fix for too many brackets in command synopses on man pages
Peter Eisentraut [Thu, 3 May 2012 19:50:04 +0000 (22:50 +0300)]
doc: Fix for too many brackets in command synopses on man pages

The default for the choice attribute of the <arg> element is "opt",
which would normally put the argument inside brackets.  But the DSSSL
stylesheets contain a hack that treats <arg> directly inside <group>
specially, so that <group><arg>-x</arg><arg>-y</arg></group> comes out
as [ -x | -y ] rather than [ [-x] | [-y] ], which it would technically
be.  But when building man pages, this doesn't work, and so the
command synopses on the man pages contain lots of extra brackets.

By putting choice="opt" or choice="plain" explicitly on every <arg>
and <group> element, we avoid any toolchain dependencies like that,
and it also makes it clearer in the source code what is meant.

In passing, make some small corrections in the documentation about
which arguments are really optional or not.

12 years agoRemove BSD/OS (BSDi) port. There are no known users upgrading to
Bruce Momjian [Thu, 3 May 2012 14:58:44 +0000 (10:58 -0400)]
Remove BSD/OS (BSDi) port.  There are no known users upgrading to
Postgres 9.2, and perhaps no existing users either.

12 years agoMark git_changelog examples with the proper executable names.
Bruce Momjian [Thu, 3 May 2012 00:42:21 +0000 (20:42 -0400)]
Mark git_changelog examples with the proper executable names.

12 years agoAdd missing parenthesis in comment.
Robert Haas [Wed, 2 May 2012 18:30:58 +0000 (14:30 -0400)]
Add missing parenthesis in comment.