OSDN Git Service

pg-rex/syncrep.git
14 years agoReturn NULL instead of 0/0 in pg_last_xlog_receive_location() and
Heikki Linnakangas [Thu, 10 Jun 2010 07:00:27 +0000 (07:00 +0000)]
Return NULL instead of 0/0 in pg_last_xlog_receive_location() and
pg_last_xlog_replay_location(). Per Robert Haas's suggestion, after
Itagaki Takahiro pointed out an issue in the docs. Also, some wording
changes in the docs by me.

14 years agoFix quite-bogus handling of arrays in plpython datum-to-PyObject
Tom Lane [Thu, 10 Jun 2010 04:05:01 +0000 (04:05 +0000)]
Fix quite-bogus handling of arrays in plpython datum-to-PyObject
conversion.  Per bug #5497 from David Gardner.

14 years agoQuote all string values in EXPLAIN (FORMAT YAML) output.
Robert Haas [Thu, 10 Jun 2010 01:26:30 +0000 (01:26 +0000)]
Quote all string values in EXPLAIN (FORMAT YAML) output.

While my previous attempt seems to always produce valid YAML, it
doesn't always produce YAML that means what it appears to mean,
because of tokens like "0xa" and "true", which without quotes will
be interpreted as integer or Boolean literals.  So, instead, just
quote everything that's not known to be a number, as we do for
JSON.

Dean Rasheed, with some changes to the comments by me.

14 years agoRemove stray word from comment.
Robert Haas [Wed, 9 Jun 2010 21:14:28 +0000 (21:14 +0000)]
Remove stray word from comment.

14 years agoUpdate ALTER TABLE docs to account for exclusion and deferrable uniqueness
Alvaro Herrera [Wed, 9 Jun 2010 17:48:10 +0000 (17:48 +0000)]
Update ALTER TABLE docs to account for exclusion and deferrable uniqueness
constraints

Dean Rasheed

14 years agoAdd index entry for ::, per complaint from John Gage.
Alvaro Herrera [Wed, 9 Jun 2010 16:43:47 +0000 (16:43 +0000)]
Add index entry for ::, per complaint from John Gage.

14 years agoIn standby mode, respect checkpoint_segments in addition to
Heikki Linnakangas [Wed, 9 Jun 2010 15:04:07 +0000 (15:04 +0000)]
In standby mode, respect checkpoint_segments in addition to
checkpoint_timeout to trigger restartpoints. We used to deliberately only
do time-based restartpoints, because if checkpoint_segments is small we
would spend time doing restartpoints more often than really necessary.
But now that restartpoints are done in bgwriter, they're not as
disruptive as they used to be. Secondly, because streaming replication
stores the streamed WAL files in pg_xlog, we want to clean it up more
often to avoid running out of disk space when checkpoint_timeout is large
and checkpoint_segments small.

Patch by Fujii Masao, with some minor changes by me.

14 years agoMake the walwriter close it's handle to an old xlog segment if it's no longer
Magnus Hagander [Wed, 9 Jun 2010 10:54:45 +0000 (10:54 +0000)]
Make the walwriter close it's handle to an old xlog segment if it's no longer
the current one. Not doing this would leave the walwriter with a handle to a
deleted file if there was nothing for it to do for a long period of time,
preventing the file from  being completely removed.

Reported by Tollef Fog Heen, and thanks to Heikki for some hand-holding with
the patch.

14 years agoAvoid "identifier will be truncated" warning in dblink
Itagaki Takahiro [Wed, 9 Jun 2010 03:39:26 +0000 (03:39 +0000)]
Avoid "identifier will be truncated" warning in dblink
when connection string is longer than NAMEDATALEN.
The previous fix for long connection name broke the behavior.

14 years agoAttempt to fix EXPLAIN (FORMAT YAML) quoting to behave sanely.
Robert Haas [Wed, 9 Jun 2010 02:39:34 +0000 (02:39 +0000)]
Attempt to fix EXPLAIN (FORMAT YAML) quoting to behave sanely.

The previous code failed to quote in many cases where quoting was necessary -
YAML has loads of special characters, including -:[]{},"'|*& - so quote much
more aggressively, and only refrain from quoting things where it seems fairly
clear that it isn't necessary.

Per report from Dean Rasheed.

14 years agoFix connection leak in dblink when dblink_connect() or dblink_connect_u()
Itagaki Takahiro [Wed, 9 Jun 2010 00:56:02 +0000 (00:56 +0000)]
Fix connection leak in dblink when dblink_connect() or dblink_connect_u()
end with "duplicate connection name" errors.

Backported to release 7.4.

14 years agoFix typo in the header comment. Per request from Masao Fujii.
Tatsuo Ishii [Wed, 9 Jun 2010 00:54:39 +0000 (00:54 +0000)]
Fix typo in the header comment. Per request from Masao Fujii.

14 years agoMake procedural language handler reference C-language function docs.
Robert Haas [Tue, 8 Jun 2010 20:12:59 +0000 (20:12 +0000)]
Make procedural language handler reference C-language function docs.

Based on suggestions from Jonathan Leto and Joshua Tolley.

14 years agoAvoid useless snprintf() call when update_process_title is turned off.
Tom Lane [Mon, 7 Jun 2010 15:49:30 +0000 (15:49 +0000)]
Avoid useless snprintf() call when update_process_title is turned off.
Fujii Masao

14 years agoAdd missed function dblink_connect_u(text[,text]) to uninstall script
Teodor Sigaev [Mon, 7 Jun 2010 15:14:36 +0000 (15:14 +0000)]
Add missed function dblink_connect_u(text[,text]) to uninstall script

14 years agoEnsure default-only storage parameters for TOAST relations
Itagaki Takahiro [Mon, 7 Jun 2010 02:59:02 +0000 (02:59 +0000)]
Ensure default-only storage parameters for TOAST relations
to be initialized with proper values. Affected parameters are
fillfactor, analyze_threshold, and analyze_scale_factor.

Especially uninitialized fillfactor caused inefficient page usage
because we built a StdRdOptions struct in which fillfactor is zero
if any reloption is set for the toast table.

In addition, we disallow toast.autovacuum_analyze_threshold and
toast.autovacuum_analyze_scale_factor because we didn't actually
support them; they are always ignored.

Report by Rumko on pgsql-bugs on 12 May 2010.
Analysis by Tom Lane and Alvaro Herrera. Patch by me.

Backpatch to 8.4.

14 years agoReplace "slave" to "standby" in documentation for consistent terminology.
Itagaki Takahiro [Mon, 7 Jun 2010 02:01:09 +0000 (02:01 +0000)]
Replace "slave" to "standby" in documentation for consistent terminology.
Almost all of the terms in docs and messages were replaced, but still
remains in a few comments and README files in codes.

14 years agoImprove our explanation of the OVERLAPS operator.
Tom Lane [Sat, 5 Jun 2010 14:56:36 +0000 (14:56 +0000)]
Improve our explanation of the OVERLAPS operator.
Per gripe from Frank van Vugt.

14 years agoAdded variable handling for RETURNING clause to ecpg.
Michael Meskes [Fri, 4 Jun 2010 10:09:58 +0000 (10:09 +0000)]
Added variable handling for RETURNING clause to ecpg.

While the values were correctly returned they were not moved into C variables
as they should be.

Closes: #5489

14 years agotag 9.0beta2
Marc G. Fournier [Fri, 4 Jun 2010 07:28:30 +0000 (07:28 +0000)]
tag 9.0beta2

14 years agoAdjust misleading comment in walsender.c. We try to send all WAL data that's
Tom Lane [Thu, 3 Jun 2010 23:00:14 +0000 (23:00 +0000)]
Adjust misleading comment in walsender.c.  We try to send all WAL data that's
been written out from shared memory, but the previous phrasing might be read
to say that we send only what's been fsync'd.

14 years agoAdd current WAL end (as seen by walsender, ie, GetWriteRecPtr() result)
Tom Lane [Thu, 3 Jun 2010 22:17:32 +0000 (22:17 +0000)]
Add current WAL end (as seen by walsender, ie, GetWriteRecPtr() result)
and current server clock time to SR data messages.  These are not currently
used on the slave side but seem likely to be useful in future, and it'd be
better not to change the SR protocol after release.  Per discussion.
Also do some minor code review and cleanup on walsender.c, and improve the
protocol documentation.

14 years agoRemove link that breaks HISTORY file generation.
Tom Lane [Thu, 3 Jun 2010 21:23:02 +0000 (21:23 +0000)]
Remove link that breaks HISTORY file generation.

14 years agoTranslation updates for 9.0beta2
Peter Eisentraut [Thu, 3 Jun 2010 21:12:05 +0000 (21:12 +0000)]
Translation updates for 9.0beta2

14 years agoFix some inconsistent quoting of wal_level values in messages
Peter Eisentraut [Thu, 3 Jun 2010 21:02:12 +0000 (21:02 +0000)]
Fix some inconsistent quoting of wal_level values in messages

When referring to postgresql.conf syntax, then it's without quotes
(wal_level=archive); in narrative it's with double quotes.  But never
single quotes.

14 years agoAdd comments about definitions that may affect PG_CONTROL_VERSION,
Alvaro Herrera [Thu, 3 Jun 2010 20:37:13 +0000 (20:37 +0000)]
Add comments about definitions that may affect PG_CONTROL_VERSION,
per recent unintended-initdb-forcing fiasco

14 years agoFix CREATE TRIGGER release mention, WHERE -> WHEN.
Bruce Momjian [Thu, 3 Jun 2010 19:38:39 +0000 (19:38 +0000)]
Fix CREATE TRIGGER release mention, WHERE -> WHEN.

14 years agoFix reference to nonexistent configure option
Peter Eisentraut [Thu, 3 Jun 2010 19:29:38 +0000 (19:29 +0000)]
Fix reference to nonexistent configure option

--enable-ssl -> --with-openssl

14 years agoUpdate 9.0 release notes to current.
Bruce Momjian [Thu, 3 Jun 2010 16:33:36 +0000 (16:33 +0000)]
Update 9.0 release notes to current.

14 years agoBump PG_CONTROL_VERSION to account for the incompatible change committed earlier.
Tom Lane [Thu, 3 Jun 2010 14:50:30 +0000 (14:50 +0000)]
Bump PG_CONTROL_VERSION to account for the incompatible change committed earlier.

14 years agoMarkup fix.
Bruce Momjian [Thu, 3 Jun 2010 14:41:25 +0000 (14:41 +0000)]
Markup fix.

14 years agoDocument regexp_matches() better and show example of single-row usage.
Bruce Momjian [Thu, 3 Jun 2010 14:40:42 +0000 (14:40 +0000)]
Document regexp_matches() better and show example of single-row usage.

14 years agoDocument use of C++ for extension use.
Bruce Momjian [Thu, 3 Jun 2010 14:39:58 +0000 (14:39 +0000)]
Document use of C++ for extension use.

14 years agoFix dblink to treat connection names longer than NAMEDATALEN-2 (62 bytes).
Itagaki Takahiro [Thu, 3 Jun 2010 09:38:33 +0000 (09:38 +0000)]
Fix dblink to treat connection names longer than NAMEDATALEN-2 (62 bytes).
Now long names are adjusted with truncate_identifier() and NOTICE messages
are raised if names are actually truncated.

Backported to release 8.0.

14 years agoOn clean shutdown during recovery, don't warn about possible corruption.
Robert Haas [Thu, 3 Jun 2010 03:20:00 +0000 (03:20 +0000)]
On clean shutdown during recovery, don't warn about possible corruption.

Fujii Masao.  Review by Heikki Linnakangas and myself.

14 years agoDocument that citext operators must be in the current search path.
Bruce Momjian [Thu, 3 Jun 2010 03:04:55 +0000 (03:04 +0000)]
Document that citext operators must be in the current search path.

14 years agoClarify array generate_subscripts() documentation example.
Bruce Momjian [Thu, 3 Jun 2010 02:06:10 +0000 (02:06 +0000)]
Clarify array generate_subscripts() documentation example.

Tim Landscheidt

14 years agoDocument that && geometric operator is true even if only a point
Bruce Momjian [Thu, 3 Jun 2010 01:34:02 +0000 (01:34 +0000)]
Document that && geometric operator is true even if only a point
overlaps.

David Fetter

14 years agoFix obsolete comments that I neglected to update in a previous patch.
Heikki Linnakangas [Wed, 2 Jun 2010 09:28:44 +0000 (09:28 +0000)]
Fix obsolete comments that I neglected to update in a previous patch.

Fujii Masao

14 years agoUpdate C++ release note item wording.
Bruce Momjian [Tue, 1 Jun 2010 13:43:39 +0000 (13:43 +0000)]
Update C++ release note item wording.

14 years agoComment out C++ docs for later user. Tone down C++ compatibility in 9.0
Bruce Momjian [Tue, 1 Jun 2010 03:19:36 +0000 (03:19 +0000)]
Comment out C++ docs for later user.  Tone down C++ compatibility in 9.0
release notes.

14 years agoMention palloc/pfree for C++ memory allocation in docs.
Bruce Momjian [Tue, 1 Jun 2010 02:54:37 +0000 (02:54 +0000)]
Mention palloc/pfree for C++ memory allocation in docs.

14 years agoFix SGML markup for tag title.
Bruce Momjian [Tue, 1 Jun 2010 02:35:37 +0000 (02:35 +0000)]
Fix SGML markup for tag title.

14 years agoAdd documentation section "Using C++ for Extensibility".
Bruce Momjian [Tue, 1 Jun 2010 02:31:36 +0000 (02:31 +0000)]
Add documentation section "Using C++ for Extensibility".

Craig Ringer

14 years agoShow schema name for REINDEX.
Bruce Momjian [Tue, 1 Jun 2010 00:33:23 +0000 (00:33 +0000)]
Show schema name for REINDEX.

Greg Sabino Mullane

14 years agoOverflow box is on page after listed page number, per Alvaro.
Bruce Momjian [Mon, 31 May 2010 22:42:59 +0000 (22:42 +0000)]
Overflow box is on page after listed page number, per Alvaro.

14 years agoUpdate TeX overflow documentation page pattern mask, in docs.
Bruce Momjian [Mon, 31 May 2010 22:15:25 +0000 (22:15 +0000)]
Update TeX overflow documentation page pattern mask, in docs.

14 years agoDocument how to find TeX overflow boxes in our documentation build, per
Bruce Momjian [Mon, 31 May 2010 22:14:20 +0000 (22:14 +0000)]
Document how to find TeX overflow boxes in our documentation build, per
details from Alvaro Herrera.

14 years agoAdd error hint that PL/pgSQL "EXECUTE of SELECT ... INTO" can be
Bruce Momjian [Mon, 31 May 2010 20:02:30 +0000 (20:02 +0000)]
Add error hint that PL/pgSQL "EXECUTE of SELECT ... INTO" can be
performed by "EXECUTE ... INTO".

Jaime Casanova

14 years agoAdd note about database ownership to REASSIGN OWNED command documentation,
Alvaro Herrera [Mon, 31 May 2010 18:47:35 +0000 (18:47 +0000)]
Add note about database ownership to REASSIGN OWNED command documentation,
per Josh Berkus.  Add ALTER DATABASE to the "see also" section, too.

14 years agoReword fsync and full_page_writes docs to be clearer about when to turn
Bruce Momjian [Mon, 31 May 2010 15:50:48 +0000 (15:50 +0000)]
Reword fsync and full_page_writes docs to be clearer about when to turn
them off.

Josh Berkus, with slight wording changes by me.

14 years agoSend all outstanding WAL before exiting when smart shutdown is requested.
Heikki Linnakangas [Mon, 31 May 2010 10:44:37 +0000 (10:44 +0000)]
Send all outstanding WAL before exiting when smart shutdown is requested.
This was broken by my previous patch to send WAL in smaller batches.

Patch by Fujii Masao.

14 years agoFix misuse of Lossy Counting (LC) algorithm in compute_tsvector_stats().
Tom Lane [Sun, 30 May 2010 21:59:02 +0000 (21:59 +0000)]
Fix misuse of Lossy Counting (LC) algorithm in compute_tsvector_stats().

We must filter out hashtable entries with frequencies less than those
specified by the algorithm, else we risk emitting junk entries whose
actual frequency is much less than other lexemes that did not get
tabulated.  This is bad enough by itself, but even worse is that
tsquerysel() believes that the minimum frequency seen in pg_statistic is a
hard upper bound for lexemes not included, and was thus underestimating
the frequency of non-MCEs.

Also, set the threshold frequency to something with a little bit of theory
behind it, to wit assume that the input distribution is approximately
Zipfian.  This might need adjustment in future, but some preliminary
experiments suggest that it's not too unreasonable.

Back-patch to 8.4, where this code was introduced.

Jan Urbanski, with some editorialization by Tom

14 years agoChange the notation for calling functions with named parameters from
Tom Lane [Sun, 30 May 2010 18:10:41 +0000 (18:10 +0000)]
Change the notation for calling functions with named parameters from
"val AS name" to "name := val", as per recent discussion.

This patch catches everything in the original named-parameters patch,
but I'm not certain that no other dependencies snuck in later (grepping
the source tree for all uses of AS soon proved unworkable).

In passing I note that we've dropped the ball at least once on keeping
ecpg's lexer (as opposed to parser) in sync with the backend.  It would
be a good idea to go through all of pgc.l and see if it's in sync now.
I didn't attempt that at the moment.

14 years agoClarify the meaning of "trusted language" in the documentation.
Bruce Momjian [Sun, 30 May 2010 02:23:09 +0000 (02:23 +0000)]
Clarify the meaning of "trusted language" in the documentation.

14 years agoAdd text to "Populating a Database" pointing out that bulk data load into a
Tom Lane [Sat, 29 May 2010 21:08:04 +0000 (21:08 +0000)]
Add text to "Populating a Database" pointing out that bulk data load into a
table with foreign key constraints eats memory.  Per off-line discussion of
bug #5480 with its reporter.  Also do some minor wordsmithing elsewhere in
the same section.

14 years agoDocument that NOT NULL domain constraints are not always honored.
Bruce Momjian [Sat, 29 May 2010 19:06:16 +0000 (19:06 +0000)]
Document that NOT NULL domain constraints are not always honored.

14 years agoFix typos in recent doc patch. Fujii Masao
Heikki Linnakangas [Sat, 29 May 2010 09:01:10 +0000 (09:01 +0000)]
Fix typos in recent doc patch. Fujii Masao

14 years agoAdd C comment that we will have to remove an exclusion constraint check
Bruce Momjian [Sat, 29 May 2010 02:32:08 +0000 (02:32 +0000)]
Add C comment that we will have to remove an exclusion constraint check
if we ever implement '<>' index opclasses.

Jeff Davis

14 years agoAbort a FETCH_COUNT-controlled query if we observe any I/O error on the
Tom Lane [Fri, 28 May 2010 20:02:32 +0000 (20:02 +0000)]
Abort a FETCH_COUNT-controlled query if we observe any I/O error on the
output stream.  This typically indicates that the user quit out of $PAGER,
or that we are writing to a file and ran out of disk space.  In either case
we shouldn't bother to continue fetching data.

Stephen Frost

14 years agoFix oversight in the previous patch that made LIKE throw error for \ at the
Tom Lane [Fri, 28 May 2010 18:18:19 +0000 (18:18 +0000)]
Fix oversight in the previous patch that made LIKE throw error for \ at the
end of the pattern: the code path that handles \ just after % should throw
error too.  As in the previous patch, not back-patching for fear of breaking
apps that worked before.

14 years agoDocument use of VPATH builds.
Bruce Momjian [Fri, 28 May 2010 18:04:36 +0000 (18:04 +0000)]
Document use of VPATH builds.

David Fetter

14 years agoRewrite LIKE's %-followed-by-_ optimization so it really works (this time
Tom Lane [Fri, 28 May 2010 17:35:23 +0000 (17:35 +0000)]
Rewrite LIKE's %-followed-by-_ optimization so it really works (this time
for sure ;-)).  It now also optimizes more cases, such as %_%_.  Improve
comments too.  Per bug #5478.

In passing, also rename the TCHAR macro to GETCHAR, because pgindent is
messing with the formatting of the former (apparently it now thinks TCHAR
is a typedef name).

Back-patch to 8.3, where the bug was introduced.

14 years agoPGDLLEXPORT is __declspec (dllexport) only on MSVC,
Itagaki Takahiro [Fri, 28 May 2010 16:34:15 +0000 (16:34 +0000)]
PGDLLEXPORT is __declspec (dllexport) only on MSVC,
but is __declspec (dllimport) on other compilers
because cygwin and mingw don't like dllexport.

14 years agoUpdate High Availability docs. Clarify terms master/primary standby/slave,
Heikki Linnakangas [Fri, 28 May 2010 14:03:31 +0000 (14:03 +0000)]
Update High Availability docs. Clarify terms master/primary standby/slave,
move two paragraphs that apply to log shipping in general from the
"Alternative method for log shipping" section to the earlier sections.
Add varname tags where missing. Some small wording changes.

14 years agoRejigger mergejoin logic so that a tuple with a null in the first merge column
Tom Lane [Fri, 28 May 2010 01:14:03 +0000 (01:14 +0000)]
Rejigger mergejoin logic so that a tuple with a null in the first merge column
is treated like end-of-input, if nulls sort last in that column and we are not
doing outer-join filling for that input.  In such a case, the tuple cannot
join to anything from the other input (because we assume mergejoinable
operators are strict), and neither can any tuple following it in the sort
order.  If we're not interested in doing outer-join filling we can just
pretend the tuple and its successors aren't there at all.  This can save a
great deal of time in situations where there are many nulls in the join
column, as in a recent example from Scott Marlowe.  Also, since the planner
tends to not count nulls in its mergejoin scan selectivity estimates, this
is an important fix to make the runtime behavior more like the estimate.

I regard this as an omission in the patch I wrote years ago to teach mergejoin
that tuples containing nulls aren't joinable, so I'm back-patching it.  But
only to 8.3 --- in older versions, we didn't have a solid notion of whether
nulls sort high or low, so attempting to apply this optimization could break
things.

14 years agoChange ps_status.c to explicitly track the current logical length of ps_buffer.
Tom Lane [Thu, 27 May 2010 19:19:38 +0000 (19:19 +0000)]
Change ps_status.c to explicitly track the current logical length of ps_buffer.
This saves cycles in get_ps_display() on many popular platforms, and more
importantly ensures that get_ps_display() will correctly return an empty
string if init_ps_display() hasn't been called yet.  Per trouble report
from Ray Stell, in which log_line_prefix %i produced junk early in backend
startup.

Back-patch to 8.0.  7.4 doesn't have %i and its version of get_ps_display()
makes no pretense of avoiding pad junk anyhow.

14 years agoSmall correction/clarification in discussion of Unicode literals
Peter Eisentraut [Thu, 27 May 2010 18:23:47 +0000 (18:23 +0000)]
Small correction/clarification in discussion of Unicode literals

14 years agoFix the volatility marking of textanycat() and anytextcat(): they were marked
Tom Lane [Thu, 27 May 2010 16:20:11 +0000 (16:20 +0000)]
Fix the volatility marking of textanycat() and anytextcat(): they were marked
immutable, but that is wrong in general because the cast from the polymorphic
argument to text could be stable or even volatile.  Mark them volatile for
safety.  In the typical case where the cast isn't volatile, the planner will
deduce the correct expression volatility after inlining the function, so
performance is not lost.  The just-committed fix in CREATE INDEX also ensures
this won't break any indexing cases that ought to be allowed.

Per discussion, I'm not bumping catversion for this change, as it doesn't
seem critical enough to force an initdb on beta testers.

14 years agoMake CREATE INDEX run expression preprocessing on a proposed index expression
Tom Lane [Thu, 27 May 2010 15:59:10 +0000 (15:59 +0000)]
Make CREATE INDEX run expression preprocessing on a proposed index expression
before it checks whether the expression is immutable.  This covers two cases
that were previously handled poorly:

1. SQL function inlining could reduce the apparent volatility of the
expression, allowing an expression to be accepted where it previously would
not have been.  As an example, polymorphic functions must be marked with the
worst-case volatility they have for any argument type, but for specific
argument types they might not be so volatile, so indexing could be allowed.
(Since the planner will refuse to inline functions in cases where the
apparent volatility of the expression would increase, this won't break
any cases that were accepted before.)

2. A nominally immutable function could have default arguments that are
volatile expressions.  In such a case insertion of the defaults will increase
both the apparent and actual volatility of the expression, so it is
*necessary* to check this before allowing the expression to be indexed.

Back-patch to 8.4, where default arguments were introduced.

14 years agoMark PG_MODULE_MAGIC and PG_FUNCTION_INFO_V1 with PGDLLEXPORT
Itagaki Takahiro [Thu, 27 May 2010 07:59:48 +0000 (07:59 +0000)]
Mark PG_MODULE_MAGIC and PG_FUNCTION_INFO_V1 with PGDLLEXPORT
independently from BUILDING_DLL. It is always __declspec(dllexport).

14 years agoMake it more clear that you need to release savepoint with
Heikki Linnakangas [Thu, 27 May 2010 06:25:32 +0000 (06:25 +0000)]
Make it more clear that you need to release savepoint with
RELEASE SAVEPOINT to make an older savepoint with the same name
accessible. It's also possible to implicitly release the savepoint by
rolling back to an earlier savepoint, but mentioning that too would make
the note just more verbose and confusing.

14 years agoAvoid starting walreceiver in states where it shouldn't be running.
Robert Haas [Thu, 27 May 2010 02:01:37 +0000 (02:01 +0000)]
Avoid starting walreceiver in states where it shouldn't be running.

In particular, it's bad to start walreceiver when in state
PM_WAIT_BACKENDS, because we have no provision to kill walreceiver
when in that state.

Fujii Masao

14 years agoAdjust comment to reflect that we now have Hot Standby. Pointed out by
Heikki Linnakangas [Thu, 27 May 2010 00:38:39 +0000 (00:38 +0000)]
Adjust comment to reflect that we now have Hot Standby. Pointed out by
Robert Haas.

14 years agoFix SGML markup
Bruce Momjian [Wed, 26 May 2010 23:55:51 +0000 (23:55 +0000)]
Fix SGML markup

14 years agoImprove SSL-related documentation. Explain how to deal with certificate
Tom Lane [Wed, 26 May 2010 23:49:19 +0000 (23:49 +0000)]
Improve SSL-related documentation.  Explain how to deal with certificate
chains, do assorted wordsmithing.

14 years agoDocument pgFouine and check_postgres as log analysis options.
Bruce Momjian [Wed, 26 May 2010 23:29:45 +0000 (23:29 +0000)]
Document pgFouine and check_postgres as log analysis options.

14 years agoThinko in previous commit: ensure that MAX_SEND_SIZE is always greater
Heikki Linnakangas [Wed, 26 May 2010 22:34:49 +0000 (22:34 +0000)]
Thinko in previous commit: ensure that MAX_SEND_SIZE is always greater
than XLOG_BLCKSZ, by defining it as 16 * XLOG_BLCKSZ rather than directly
as 128k bytes.

14 years agoIn walsender, don't sleep if there's outstanding WAL waiting to be sent,
Heikki Linnakangas [Wed, 26 May 2010 22:21:33 +0000 (22:21 +0000)]
In walsender, don't sleep if there's outstanding WAL waiting to be sent,
otherwise we effectively rate-limit the streaming as pointed out by
Simon Riggs. Also, send the WAL in smaller chunks, to respond to signals
more promptly.

14 years agoRearrange libpq's SSL initialization to simplify it and make it handle some
Tom Lane [Wed, 26 May 2010 21:39:27 +0000 (21:39 +0000)]
Rearrange libpq's SSL initialization to simplify it and make it handle some
additional cases correctly.  The original coding failed to load additional
(chain) certificates from the client cert file, meaning that indirectly signed
client certificates didn't work unless one hacked the server's root.crt file
to include intermediate CAs (not the desired approach).  Another problem was
that everything got loaded into the shared SSL_context object, which meant
that concurrent connections trying to use different sslcert settings could
well fail due to conflicting over the single available slot for a keyed
certificate.

To fix, get rid of the use of SSL_CTX_set_client_cert_cb(), which is
deprecated anyway in the OpenSSL documentation, and instead just
unconditionally load the client cert and private key during connection
initialization.  This lets us use SSL_CTX_use_certificate_chain_file(),
which does the right thing with additional certs, and is lots simpler than
the previous hacking about with BIO-level access.  A small disadvantage is
that we have to load the primary client cert a second time with
SSL_use_certificate_file, so that that one ends up in the correct slot
within the connection's SSL object where it can get paired with the key.
Given the other overhead of making an SSL connection, that doesn't seem
worth worrying about.

Per discussion ensuing from bug #5468.

14 years agoFix bogus error message for SSL-cert authentication, due to lack of
Tom Lane [Wed, 26 May 2010 20:47:13 +0000 (20:47 +0000)]
Fix bogus error message for SSL-cert authentication, due to lack of
a uaCert entry in auth_failed().  Put the switch entries into a sane
order, namely the one the enum is declared in.

14 years agoHS Defer buffer pin deadlock check until deadlock_timeout has expired.
Simon Riggs [Wed, 26 May 2010 19:52:52 +0000 (19:52 +0000)]
HS Defer buffer pin deadlock check until deadlock_timeout has expired.
During Hot Standby we need to check for buffer pin deadlocks when the
Startup process begins to wait, in case it never wakes up again. We
previously made the deadlock check immediately on the basis it was
cheap, though clearer thinking and prima facie evidence shows that
was too simple. Refactor existing code to make it easy to add in
deferral of deadlock check until deadlock_timeout allowing a good
reduction in deadlock checks since far few buffer pins are held for
that duration. It's worth doing anyway, though major goal is to
prevent further reports of context switching with high numbers of
users on occasional tests.

14 years agoFix psql help: \da+ is same as \da, but \daS is not.
Robert Haas [Wed, 26 May 2010 19:29:22 +0000 (19:29 +0000)]
Fix psql help: \da+ is same as \da, but \daS is not.

Noted by Stephen Frost.

14 years agoThe message style police pay a visit to hba.c.
Tom Lane [Wed, 26 May 2010 16:43:13 +0000 (16:43 +0000)]
The message style police pay a visit to hba.c.

14 years agoMinor editorialization for be-secure.c: fix comments and some formatting
Tom Lane [Wed, 26 May 2010 16:15:57 +0000 (16:15 +0000)]
Minor editorialization for be-secure.c: fix comments and some formatting
infelicities.

14 years agoTell openssl to include the names of the root certs the server trusts in
Tom Lane [Wed, 26 May 2010 15:52:37 +0000 (15:52 +0000)]
Tell openssl to include the names of the root certs the server trusts in
requests for client certs.  This lets a client with a keystore select the
appropriate client certificate to send.  In particular, this is necessary
to get Java clients to work in all but the most trivial configurations.
Per discussion of bug #5468.

Craig Ringer

14 years agoMore fixes for shutdown during recovery.
Robert Haas [Wed, 26 May 2010 12:32:41 +0000 (12:32 +0000)]
More fixes for shutdown during recovery.

1. If we receive a fast shutdown request while in the PM_STARTUP state,
process it just as we would in PM_RECOVERY, PM_HOT_STANDBY, or PM_RUN.
Without this change, an early fast shutdown followed by Hot Standby causes
the database to get stuck in a state where a shutdown is pending (so no new
connections are allowed) but the shutdown request is never processed unless
we end Hot Standby and enter normal running.

2. Avoid removing the backup label file when a smart or fast shutdown occurs
during recovery.  It makes sense to do this once we've reached normal running,
since we must be taking a backup which now won't be valid.  But during
recovery we must be recovering from a previously taken backup, and any backup
label file is needed to restart recovery from the right place.

Fujii Masao and Robert Haas

14 years agoAdd missing newlines to some SSL-related error messages. Noted while testing.
Tom Lane [Tue, 25 May 2010 22:03:27 +0000 (22:03 +0000)]
Add missing newlines to some SSL-related error messages.  Noted while testing.

14 years agoFix oversight in construction of sort/unique plans for UniquePaths.
Tom Lane [Tue, 25 May 2010 17:44:41 +0000 (17:44 +0000)]
Fix oversight in construction of sort/unique plans for UniquePaths.
If the original IN operator is cross-type, for example int8 = int4,
we need to use int4 < int4 to sort the inner data and int4 = int4
to unique-ify it.  We got the first part of that right, but tried to
use the original IN operator for the equality checks.  Per bug #5472
from Vlad Romascanu.

Backpatch to 8.4, where the bug was introduced by the patch that unified
SortClause and GroupClause.  I was able to take out a whole lot of on-the-fly
calls of get_equality_op_for_ordering_op(), but failed to realize that
I needed to put one back in right here :-(

14 years agoReplace self written 'long long int' configure test by standard 'AC_TYPE_LONG_LONG_IN...
Michael Meskes [Tue, 25 May 2010 17:28:20 +0000 (17:28 +0000)]
Replace self written 'long long int' configure test by standard 'AC_TYPE_LONG_LONG_INT' macro call.

14 years agoRemove IMPLEMENTATION.jp file from pg_upgrade docs; still in pgFoundry
Bruce Momjian [Tue, 25 May 2010 16:53:24 +0000 (16:53 +0000)]
Remove IMPLEMENTATION.jp file from pg_upgrade docs;  still in pgFoundry
for pg_migrator, per suggestion from Magnus.

14 years agoUpdate pg_upgrade IMPLEMENTATION doc file to match current 9.0 behavior.
Bruce Momjian [Tue, 25 May 2010 16:09:29 +0000 (16:09 +0000)]
Update pg_upgrade IMPLEMENTATION doc file to match current 9.0 behavior.

14 years agoModify pg_standby, pgbench, and pg_upgrade manual pages to be consistent
Bruce Momjian [Tue, 25 May 2010 15:55:28 +0000 (15:55 +0000)]
Modify pg_standby, pgbench, and pg_upgrade manual pages to be consistent
in their display of command-line options with other client applications.

14 years agoAdd pg_upgrade docs about binary compatibility, per Robert Haas.
Bruce Momjian [Tue, 25 May 2010 14:50:56 +0000 (14:50 +0000)]
Add pg_upgrade docs about binary compatibility, per Robert Haas.

14 years agoAdded a configure test for "long long" datatypes. So far this is only used in ecpg...
Michael Meskes [Tue, 25 May 2010 14:32:55 +0000 (14:32 +0000)]
Added a configure test for "long long" datatypes. So far this is only used in ecpg and replaces the old test that was kind of hackish.

14 years agoAdd Japanese Implementation file to CVS.
Bruce Momjian [Tue, 25 May 2010 02:56:36 +0000 (02:56 +0000)]
Add Japanese Implementation file to CVS.

14 years agoRe-order pg_upgrade 'help' options to be alphabetical.
Bruce Momjian [Tue, 25 May 2010 02:55:58 +0000 (02:55 +0000)]
Re-order pg_upgrade 'help' options to be alphabetical.

14 years agoIn pg_upgrade, test for datallowconn instead of hardcoding template0.
Bruce Momjian [Mon, 24 May 2010 19:52:33 +0000 (19:52 +0000)]
In pg_upgrade, test for datallowconn instead of hardcoding template0.

14 years agoUpdate pg_upgrade docs to show options in alphabetical order, and
Bruce Momjian [Mon, 24 May 2010 17:43:39 +0000 (17:43 +0000)]
Update pg_upgrade docs to show options in alphabetical order, and
improve 8.3 doc limitations paragraph.

14 years agoSplit apart pg_upgrade user lookup and root check so '--help' shows
Bruce Momjian [Mon, 24 May 2010 16:34:35 +0000 (16:34 +0000)]
Split apart pg_upgrade user lookup and root check so '--help' shows
proper default username.