Commit Graph

248 Commits

Author SHA1 Message Date
Simon Riggs 296578feb4 Revoke augmentation of WAL records for btree delete, per discussion. 2010-02-01 13:40:28 +00:00
Simon Riggs 6d2bc0a6cf Augment WAL records for btree delete with GetOldestXmin() to reduce
false positives during Hot Standby conflict processing. Simple
patch to enhance conflict processing, following previous discussions.
Controlled by parameter minimize_standby_conflicts = on | off, with
default off allows measurement of performance impact to see whether
it should be set on all the time.
2010-01-29 18:39:05 +00:00
Tom Lane d879697cd2 Remove the default_do_language parameter, instead making DO use a hardwired
default of "plpgsql".  This is more reasonable than it was when the DO patch
was written, because we have since decided that plpgsql should be installed
by default.  Per discussion, having a parameter for this doesn't seem useful
enough to justify the risk of application breakage if the value is changed
unexpectedly.
2010-01-26 16:33:40 +00:00
Simon Riggs 959ac58c04 In HS, Startup process sets SIGALRM when waiting for buffer pin. If
woken by alarm we send SIGUSR1 to all backends requesting that they
check to see if they are blocking Startup process. If so, they throw
ERROR/FATAL as for other conflict resolutions. Deadlock stop gap
removed. max_standby_delay = -1 option removed to prevent deadlock.
2010-01-23 16:37:12 +00:00
Heikki Linnakangas 40f908bdcd Introduce Streaming Replication.
This includes two new kinds of postmaster processes, walsenders and
walreceiver. Walreceiver is responsible for connecting to the primary server
and streaming WAL to disk, while walsender runs in the primary server and
streams WAL from disk to the client.

Documentation still needs work, but the basics are there. We will probably
pull the replication section to a new chapter later on, as well as the
sections describing file-based replication. But let's do that as a separate
patch, so that it's easier to see what has been added/changed. This patch
also adds a new section to the chapter about FE/BE protocol, documenting the
protocol used by walsender/walreceivxer.

Bump catalog version because of two new functions,
pg_last_xlog_receive_location() and pg_last_xlog_replay_location(), for
monitoring the progress of replication.

Fujii Masao, with additional hacking by me
2010-01-15 09:19:10 +00:00
Bruce Momjian 8cdb85b512 Remove tabs in SGML.
Move OIDCHARS to proper include file.
2010-01-06 02:41:37 +00:00
Robert Haas d86d51a958 Support ALTER TABLESPACE name SET/RESET ( tablespace_options ).
This patch only supports seq_page_cost and random_page_cost as parameters,
but it provides the infrastructure to scalably support many more.
In particular, we may want to add support for effective_io_concurrency,
but I'm leaving that as future work for now.

Thanks to Tom Lane for design help and Alvaro Herrera for the review.
2010-01-05 21:54:00 +00:00
Robert Haas 666c845c75 Add missing <indexterm><primary>...</primary>...</indexterm> tags for a couple
of HS-related parameters.

Fujii Masao
2009-12-25 01:09:31 +00:00
Bruce Momjian 7ba1f8fcb5 Convert tabs to spaces in SGML. 2009-12-19 17:49:50 +00:00
Simon Riggs efc16ea520 Allow read only connections during recovery, known as Hot Standby.
Enabled by recovery_connections = on (default) and forcing archive recovery using a recovery.conf. Recovery processing now emulates the original transactions as they are replayed, providing full locking and MVCC behaviour for read only queries. Recovery must enter consistent state before connections are allowed, so there is a delay, typically short, before connections succeed. Replay of recovering transactions can conflict and in some cases deadlock with queries during recovery; these result in query cancellation after max_standby_delay seconds have expired. Infrastructure changes have minor effects on normal running, though introduce four new types of WAL record.

New test mode "make standbycheck" allows regression tests of static command behaviour on a standby server while in recovery. Typical and extreme dynamic behaviours have been checked via code inspection and manual testing. Few port specific behaviours have been utilised, though primary testing has been on Linux only so far.

This commit is the basic patch. Additional changes will follow in this release to enhance some aspects of behaviour, notably improved handling of conflicts, deadlock detection and query cancellation. Changes to VACUUM FULL are also required.

Simon Riggs, with significant and lengthy review by Heikki Linnakangas, including streamlined redesign of snapshot creation and two-phase commit.

Important contributions from Florian Pflug, Mark Kirkwood, Merlin Moncure, Greg Stark, Gianni Ciolli, Gabriele Bartolini, Hannu Krosing, Robert Haas, Tatsuo Ishii, Hiroyuki Yamada plus support and feedback from many other community members.
2009-12-19 01:32:45 +00:00
Robert Haas f5fd651e1b Improve documentation for pg_largeobject changes.
Rewrite the documentation in more idiomatic English, and in the process make
it somewhat more succinct.  Move the discussion of specific large object
privileges out of the "server-side functions" section, where it certainly
doesn't belong, and into "implementation features".  That might not be
exactly right either, but it doesn't seem worth creating a new section for
this amount of information. Fix a few spelling and layout problems, too.
2009-12-17 14:36:16 +00:00
Itagaki Takahiro f1325ce213 Add large object access control.
A new system catalog pg_largeobject_metadata manages
ownership and access privileges of large objects.

KaiGai Kohei, reviewed by Jaime Casanova.
2009-12-11 03:34:57 +00:00
Peter Eisentraut a37b001b80 Add init[db] option to pg_ctl
pg_ctl gets a new mode that runs initdb.  Adjust the documentation a bit to
not assume that initdb is the only way to run database cluster initialization.
But don't replace initdb as the canonical way.

Author: Zdenek Kotala <Zdenek.Kotala@Sun.COM>
2009-12-10 06:32:28 +00:00
Tom Lane 8217cfbd99 Add support for an application_name parameter, which is displayed in
pg_stat_activity and recorded in log entries.

Dave Page, reviewed by Andres Freund
2009-11-28 23:38:08 +00:00
Bruce Momjian cb98f61538 fsync test tools
Add link to exteran fsync testing script and our fsync test tool.
2009-11-28 16:21:31 +00:00
Tom Lane 6317609986 Add control knobs for plpgsql's variable resolution behavior, and make the
default be "throw error on conflict", as per discussions.  The GUC variable
is plpgsql.variable_conflict, with values "error", "use_variable",
"use_column".  The behavior can also be specified per-function by inserting
one of
	#variable_conflict error
	#variable_conflict use_variable
	#variable_conflict use_column
at the start of the function body.

The 8.5 release notes will need to mention using "use_variable" to retain
backward-compatible behavior, although we should encourage people to migrate
to the much less mistake-prone "error" setting.

Update the plpgsql documentation to match this and other recent changes.
2009-11-13 22:43:42 +00:00
Tom Lane ab61df9e52 Remove regex_flavor GUC, so that regular expressions are always "advanced"
style by default.  Per discussion, there seems to be hardly anything that
really relies on being able to change the regex flavor, so the ability to
select it via embedded options ought to be enough for any stragglers.
Also, if we didn't remove the GUC, we'd really be morally obligated to
mark the regex functions non-immutable, which'd possibly create performance
issues.
2009-10-21 20:38:58 +00:00
Tom Lane 289e2905c8 Remove add_missing_from GUC and associated parser support for "implicit RTEs".
Per recent discussion, add_missing_from has been deprecated for long enough to
consider removing, and it's getting in the way of planned parser refactoring.
The system now always behaves as though add_missing_from were OFF.
2009-10-21 20:22:38 +00:00
Bruce Momjian 41f89e3bbc Document the purpose of the GUC listen_addresses. 2009-10-03 23:10:47 +00:00
Tom Lane 9048b73184 Implement the DO statement to support execution of PL code without having
to create a function for it.

Procedural languages now have an additional entry point, namely a function
to execute an inline code block.  This seemed a better design than trying
to hide the transient-ness of the code from the PL.  As of this patch, only
plpgsql has an inline handler, but probably people will soon write handlers
for the other standard PLs.

In passing, remove the long-dead LANCOMPILER option of CREATE LANGUAGE.

Petr Jelinek
2009-09-22 23:43:43 +00:00
Peter Eisentraut 6689ce3e6a Document that autovacuum_max_workers can only be set at server start
per Joshua Tolley
2009-09-13 19:52:29 +00:00
Tom Lane 8c5463a511 Increase the maximum value of extra_float_digits to 3, and have pg_dump
use that value when the backend is new enough to allow it.  This responds
to bug report from Keh-Cheng Chu pointing out that although 2 extra digits
should be sufficient to dump and restore float8 exactly, it is possible to
need 3 extra digits for float4 values.
2009-09-11 19:17:04 +00:00
Alvaro Herrera 19fd0c2e56 Add note that the logging collector can block backends in high load situations. 2009-09-10 15:02:46 +00:00
Tom Lane eeb6cb143a Add a boolean GUC parameter "bonjour" to control whether a Bonjour-enabled
build actually attempts to advertise itself via Bonjour.  Formerly it always
did so, which meant that packagers had to decide for their users whether
this behavior was wanted or not.  The default is "off" to be on the safe
side, though this represents a change in the default behavior of a
Bonjour-enabled build.  Per discussion.
2009-09-08 17:08:36 +00:00
Tom Lane 8bed238c87 Try to make silent_mode behave somewhat reasonably.
Instead of sending stdout/stderr to /dev/null after forking away from the
terminal, send them to postmaster.log within the data directory.  Since
this opens the door to indefinite logfile bloat, recommend even more
strongly that log output be redirected when using silent_mode.

Move the postmaster's initial calls of load_hba() and load_ident() down
to after we have started the log collector, if we are going to.  This
is so that errors reported by them will appear in the "usual" place.

Reclassify silent_mode as a LOGGING_WHERE, not LOGGING_WHEN, parameter,
since it's got absolutely nothing to do with the latter category.

In passing, fix some obsolete references to -S ... this option hasn't
had that switch letter for a long time.

Back-patch to 8.4, since as of 8.4 load_hba() and load_ident() are more
picky (and thus more likely to fail) than they used to be.  This entire
change was driven by a complaint about those errors disappearing into
the bit bucket.
2009-08-24 20:08:32 +00:00
Tom Lane a2a8c7a662 Support hex-string input and output for type BYTEA.
Both hex format and the traditional "escape" format are automatically
handled on input.  The output format is selected by the new GUC variable
bytea_output.

As committed, bytea_output defaults to HEX, which is an *incompatible
change*.  We will keep it this way for awhile for testing purposes, but
should consider whether to switch to the more backwards-compatible
default of ESCAPE before 8.5 is released.

Peter Eisentraut
2009-08-04 16:08:37 +00:00
Tom Lane f5bc74192d Make GEQO's planning deterministic by having it start from a predictable
random number seed each time.  This is how it used to work years ago, but
we got rid of the seed reset because it was resetting the main random()
sequence and thus having undesirable effects on the rest of the system.
To fix, establish a private random number state for each execution of
geqo(), and initialize the state using the new GUC variable geqo_seed.
People who want to experiment with different random searches can do so
by changing geqo_seed, but you'll always get the same plan for the same
value of geqo_seed (if holding all other planner inputs constant, of course).

The new state is kept in PlannerInfo by adding a "void *" field reserved
for use by join_search hooks.  Most of the rather bulky code changes in
this commit are just arranging to pass PlannerInfo around to all the GEQO
functions (many of which formerly didn't receive it).

Andres Freund, with some editorialization by Tom
2009-07-16 20:55:44 +00:00
Peter Eisentraut f39df967e9 Add log_line_prefix placeholder %e to contain the current SQL state
Author: Guillaume Smet <guillaume.smet@gmail.com>
2009-07-03 19:14:25 +00:00
Tom Lane c30446b9c9 Proofreading for Bruce's recent round of documentation proofreading.
Most of those changes were good, but some not so good ...
2009-06-17 21:58:49 +00:00
Bruce Momjian 5d682cab65 Wording improvement for recent sesssion identifier SQL query. 2009-06-03 20:34:29 +00:00
Bruce Momjian 44ead23384 Add example of how to generate the session identifier from pg_stat_activity. 2009-06-03 00:38:34 +00:00
Tom Lane ade91586ea Remove the old advice to keep from_collapse_limit less than geqo_threshold,
instead just pointing out that a larger value may trigger use of GEQO.
Per Robert Haas.

In passing, do a bit of wordsmithing on the Genetic Query Optimizer section.
2009-06-02 17:37:55 +00:00
Bruce Momjian ba36c48e39 Proofreading adjustments for first two parts of documentation (Tutorial
and SQL).
2009-04-27 16:27:36 +00:00
Tom Lane 8d4f2ecd41 Change the default value of max_prepared_transactions to zero, and add
documentation warnings against setting it nonzero unless active use of
prepared transactions is intended and a suitable transaction manager has been
installed.  This should help to prevent the type of scenario we've seen
several times now where a prepared transaction is forgotten and eventually
causes severe maintenance problems (or even anti-wraparound shutdown).

The only real reason we had the default be nonzero in the first place was to
support regression testing of the feature.  To still be able to do that,
tweak pg_regress to force a nonzero value during "make check".  Since we
cannot force a nonzero value in "make installcheck", add a variant regression
test "expected" file that shows the results that will be obtained when
max_prepared_transactions is zero.

Also, extend the HINT messages for transaction wraparound warnings to mention
the possibility that old prepared transactions are causing the problem.

All per today's discussion.
2009-04-23 00:23:46 +00:00
Bruce Momjian d0b599012f Document that Solaris can't use effective_io_concurrency because of an
ineffective posix_fadvise().
2009-04-02 22:44:10 +00:00
Tom Lane 845693f70f Fix a couple of places that still claimed LC_COLLATE and LC_CTYPE can't
be changed after initdb.
2009-03-26 20:55:49 +00:00
Bruce Momjian 5c617f4e56 Update constraint_exclusion docs because parameter is now 3-valued, not
just enable/disable.
2009-03-23 15:14:14 +00:00
Tom Lane 640796ff41 Reduce the maximum value of vacuum_cost_delay and autovacuum_vacuum_cost_delay
to 100ms (from 1000).  This still seems to be comfortably larger than the
useful range of the parameter, and it should help discourage people from
picking uselessly large values.  Tweak the documentation to recommend small
values, too.  Per discussion of a couple weeks ago.
2009-02-28 00:10:52 +00:00
Peter Eisentraut 7380b6384b Don't append epoch to log_filename if no format specifier is given.
Robert Haas
2009-02-24 12:09:09 +00:00
Tom Lane 451a15f95c Add note that inlined SQL functions aren't tracked by track_functions. 2009-02-22 23:50:30 +00:00
Tom Lane 57b5984d24 Minor wordsmithing. 2009-02-15 18:28:48 +00:00
Alvaro Herrera 834a6da4f7 Update autovacuum to use reloptions instead of a system catalog, for
per-table overrides of parameters.

This removes a whole class of problems related to misusing the catalog,
and perhaps more importantly, gives us pg_dump support for the parameters.

Based on a patch by Euler Taveira de Oliveira, heavily reworked by me.
2009-02-09 20:57:59 +00:00
Heikki Linnakangas 6587818542 Add vacuum_freeze_table_age GUC option, to control when VACUUM should
ignore the visibility map and scan the whole table, to advance
relfrozenxid.
2009-01-16 13:27:24 +00:00
Tom Lane b7b8f0b609 Implement prefetching via posix_fadvise() for bitmap index scans. A new
GUC variable effective_io_concurrency controls how many concurrent block
prefetch requests will be issued.

(The best way to handle this for plain index scans is still under debate,
so that part is not applied yet --- tgl)

Greg Stark
2009-01-12 05:10:45 +00:00
Magnus Hagander 1b4e729eaa Make krb_realm and krb_server_hostname be pg_hba options only, and remove
their GUCs.

In passing, noted that the pg_hba options for krb5 authentication weren't
listed at all - so add this.
2009-01-09 10:13:19 +00:00
Tom Lane 445ce15702 Create a third option named "partition" for constraint_exclusion, and make it
the default.  This setting enables constraint exclusion checks only for
appendrel members (ie, inheritance children and UNION ALL arms), which are
the cases in which constraint exclusion is most likely to be useful.  Avoiding
the overhead for simple queries that are unlikely to benefit should bring
the cost down to the point where this is a reasonable default setting.
Per today's discussion.
2009-01-07 22:40:49 +00:00
Magnus Hagander af26089841 Add appropriate text for SIGHUP parameters instead of just removing it
like previous patch did.

Per note from Tom Lane
2009-01-07 12:21:47 +00:00
Magnus Hagander a27addbc87 Make it possible to change Kerberos/GSSAPI parameters without restarting
the postmaster. They are only used in backend processes, so it's just
a matter of re-labeling the GUCs.
2009-01-02 10:33:20 +00:00
Tom Lane 65e3ea7641 Increase the default value of default_statistics_target from 10 to 100,
and its maximum value from 1000 to 10000.  ALTER TABLE SET STATISTICS
similarly now allows a value up to 10000.  Per discussion.
2008-12-13 19:13:44 +00:00
Magnus Hagander bd33aca36e Add note that autovacuum can use up several times maintenance_work_mem,
with warning against setting it too high.
2008-12-08 15:11:39 +00:00