Commit Graph

8989 Commits

Author SHA1 Message Date
Peter Eisentraut 732740e7d4 XSLT stylesheet: Add slash to directory name
Some versions of the XSLT stylesheets don't handle the missing slash
correctly (they concatenate directory and file name without the slash).
This might never have worked correctly.
2012-11-08 23:55:36 -05:00
Heikki Linnakangas a9dad56441 Teach pg_basebackup and pg_receivexlog to reply to server keepalives.
Without this, the connection will be killed after timeout if
wal_sender_timeout is set in the server.

Original patch by Amit Kapila, modified by me to fit recent changes in the
code.
2012-11-08 10:28:52 +02:00
Bruce Momjian c90dcd6d2c In pg_upgrade docs, mention using base backup as part of rsync for
logical replication upgrades.

Backpatch to 9.2.
2012-11-07 13:36:12 -05:00
Heikki Linnakangas add6c3179a Make the streaming replication protocol messages architecture-independent.
We used to send structs wrapped in CopyData messages, which works as long as
the client and server agree on things like endianess, timestamp format and
alignment. That's good enough for running a standby server, which has to run
on the same platform anyway, but it's useful for tools like pg_receivexlog
to work across platforms.

This breaks protocol compatibility of streaming replication, but we never
promised that to be compatible across versions, anyway.
2012-11-07 19:09:13 +02:00
Peter Eisentraut 4bb106ef4f Fix typo 2012-11-01 22:58:36 -04:00
Tom Lane e774b7649c Document that TCP keepalive settings read as 0 on Unix-socket connections.
Per bug #7631 from Rob Johnson.  The code is operating as designed, but the
docs didn't explain it.
2012-10-31 14:26:20 -04:00
Tom Lane 5a39114fe7 In pg_dump, dump SEQUENCE SET items in the data not pre-data section.
Represent a sequence's current value as a separate TableDataInfo dumpable
object, so that it can be dumped within the data section of the archive
rather than in pre-data.  This fixes an undesirable inconsistency between
the meanings of "--data-only" and "--section=data", and also fixes dumping
of sequences that are marked as extension configuration tables, as per a
report from Marko Kreen back in July.  The main cost is that we do one more
SQL query per sequence, but that's probably not very meaningful in most
databases.

Back-patch to 9.1, since it has the extension configuration issue even
though not the --section switch.
2012-10-26 12:12:42 -04:00
Alvaro Herrera f4c4335a4a Add context info to OAT_POST_CREATE security hook
... and have sepgsql use it to determine whether to check permissions
during certain operations.  Indexes that are being created as a result
of REINDEX, for instance, do not need to have their permissions checked;
they were already checked when the index was created.

Author: KaiGai Kohei, slightly revised by me
2012-10-23 18:24:24 -03:00
Tom Lane edef20f6e1 Fix pg_dump's handling of DROP DATABASE commands in --clean mode.
In commit 4317e0246c, I accidentally broke
this behavior while rearranging code to ensure that --create wouldn't
affect whether a DATABASE entry gets put into archive-format output.
Thus, 9.2 would issue a DROP DATABASE command in --clean mode, which is
either useless or dangerous depending on the usage scenario.
It should not do that, and no longer does.

A bright spot is that this refactoring makes it easy to allow the
combination of --clean and --create to work sensibly, ie, emit DROP
DATABASE then CREATE DATABASE before reconnecting.  Ordinarily we'd
consider that a feature addition and not back-patch it, but it seems
silly to not include the extra couple of lines required in the 9.2
version of the code.

Per report from Guillaume Lelarge, though this is slightly more extensive
than his proposed patch.
2012-10-20 16:58:32 -04:00
Simon Riggs f862a326ef Fix typo in previous commit 2012-10-17 10:29:30 +01:00
Simon Riggs 9f9695a0cd Clarify hash index caution and copy to CREATE INDEX docs 2012-10-17 08:14:29 +01:00
Heikki Linnakangas 6f60fdd701 Improve replication connection timeouts.
Rename replication_timeout to wal_sender_timeout, and add a new setting
called wal_receiver_timeout that does the same at the walreceiver side.
There was previously no timeout in walreceiver, so if the network went down,
for example, the walreceiver could take a long time to notice that the
connection was lost. Now with the two settings, both sides of a replication
connection will detect a broken connection similarly.

It is no longer necessary to manually set wal_receiver_status_interval to
a value smaller than the timeout. Both wal sender and receiver now
automatically send a "ping" message if more than 1/2 of the configured
timeout has elapsed, and it hasn't received any messages from the other end.

Amit Kapila, heavily edited by me.
2012-10-11 17:48:08 +03:00
Tom Lane 8255566f9d Create an improved FDW option validator function for contrib/dblink.
dblink now has its own validator function dblink_fdw_validator(), which is
better than the core function postgresql_fdw_validator() because it gets
the list of legal options from libpq instead of having a hard-wired list.

Make the dblink extension module provide a standard foreign data wrapper
dblink_fdw that encapsulates use of this validator, and recommend use of
that wrapper instead of making up wrappers on the fly.

Unfortunately, because ad-hoc wrappers *were* recommended practice
previously, it's not clear when we can get rid of postgresql_fdw_validator
without causing upgrade problems.  But this is a step in the right
direction.

Shigeru Hanada, reviewed by KaiGai Kohei
2012-10-10 16:53:08 -04:00
Tom Lane 392b2e5010 Update obsolete text in fdwhandler.sgml.
Etsuro Fujita, with some wording adjustment by me.
2012-10-10 13:55:21 -04:00
Simon Riggs 2190377113 Use tablespace_option consistently on doc page
Fujii Masao
2012-10-09 08:29:37 +01:00
Simon Riggs 82e429794b Add microsecs/op display to pg_test_fsync utility
e.g. fsync  2103.613 ops/sec (   475 microsecs/op)

Peter Geoghegan
2012-10-09 08:15:23 +01:00
Tom Lane 0e924c007d Fix lo_read, lo_write, lo_truncate to cope with "size_t" length parameters.
libpq defines these functions as accepting "size_t" lengths ... but the
underlying backend functions expect signed int32 length parameters, and so
will misinterpret any value exceeding INT_MAX.  Fix the libpq side to throw
error rather than possibly doing something unexpected.

This is a bug of long standing, but I doubt it's worth back-patching.  The
problem is really pretty academic anyway with lo_read/lo_write, since any
caller expecting sane behavior would have to have provided a multi-gigabyte
buffer.  It's slightly more pressing with lo_truncate, but still we haven't
supported large objects over 2GB until now.
2012-10-08 21:19:53 -04:00
Tom Lane 1503333f8f Improve documentation about large-object functions.
Copy-editing for previous patch, plus fixing some longstanding markup
issues and oversights (like not mentioning that failures will set the
PQerrorMessage string).
2012-10-07 19:16:53 -04:00
Tatsuo Ishii 461ef73f09 Add API for 64-bit large object access. Now users can access up to
4TB large objects (standard 8KB BLCKSZ case).  For this purpose new
libpq API lo_lseek64, lo_tell64 and lo_truncate64 are added.  Also
corresponding new backend functions lo_lseek64, lo_tell64 and
lo_truncate64 are added. inv_api.c is changed to handle 64-bit
offsets.

Patch contributed by Nozomi Anzai (backend side) and Yugo Nagata
(frontend side, docs, regression tests and example program). Reviewed
by Kohei Kaigai. Committed by Tatsuo Ishii with minor editings.
2012-10-07 08:36:48 +09:00
Peter Eisentraut ae835c7d6e Improve LDAP authentication documentation
Use the terms "simple bind" and "search+bind" consistently do
distinguish the two modes (better than first mode and second mode in
any case).  They were already used in some places, now it's just more
prominent.

Split up the list of options into one for common options and one for
each mode, for clarity.

Add configuration examples for either mode.
2012-10-05 21:20:06 -04:00
Michael Meskes 1045af95e7 Removed sentence about not being able to retrieve more than one row at a time,
because it is not correct.
2012-10-05 17:49:24 +02:00
Tom Lane 7e389f73d1 Fix permissions explanations in CREATE DATABASE and CREATE SCHEMA docs.
These reference pages still claimed that you have to be superuser to create
a database or schema owned by a different role.  That was true before 8.1,
but it was changed in commits aa1110624c and
f91370cd2f to allow assignment of ownership
to any role you are a member of.  However, at the time we were thinking of
that primarily as a change to the ALTER OWNER rules, so the need to touch
these two CREATE ref pages got missed.
2012-10-04 13:41:01 -04:00
Tom Lane fb34e94d21 Support CREATE SCHEMA IF NOT EXISTS.
Per discussion, schema-element subcommands are not allowed together with
this option, since it's not very obvious what should happen to the element
objects.

Fabrízio de Royes Mello
2012-10-03 19:47:11 -04:00
Heikki Linnakangas e1be1df51f Add --sampling-rate option to pgbench.
This allows logging only some fraction of transactions, greatly reducing
the amount of log generated.

Tomas Vondra, reviewed by Robert Haas and Jeff Janes.
2012-10-03 15:37:42 +03:00
Heikki Linnakangas 7ae1815961 Return the number of rows processed when COPY is executed through SPI.
You can now get the number of rows processed by a COPY statement in a
PL/pgSQL function with "GET DIAGNOSTICS x = ROW_COUNT".

Pavel Stehule, reviewed by Amit Kapila, with some editing by me.
2012-10-03 14:38:22 +03:00
Heikki Linnakangas 2ad881f054 The max shared_buffers value that initdb will choose was raised, update docs.
Jeff Janes
2012-10-01 09:23:06 +03:00
Peter Eisentraut db0af74af2 PL/Python: Convert oid to long/int
oid is a numeric type, so transform it to the appropriate Python
numeric type like the other ones.
2012-09-29 12:41:00 -04:00
Tom Lane 05b555d12b Fix tar files emitted by pg_dump and pg_basebackup to be POSIX conformant.
Both programs got the "magic" string wrong, causing standard-conforming tar
implementations to believe the output was just legacy tar format without
any POSIX extensions.  This doesn't actually matter that much, especially
since pg_dump failed to fill the POSIX fields anyway, but still there is
little point in emitting tar format if we can't be compliant with the
standard.  In addition, pg_dump failed to write the EOF marker correctly
(there should be 2 blocks of zeroes not just one), pg_basebackup put the
numeric group ID in the wrong place, and both programs had a pretty
brain-dead idea of how to compute the checksum.  Fix all that and improve
the comments a bit.

pg_restore is modified to accept either the correct POSIX-compliant "magic"
string or the previous value.  This part of the change will need to be
back-patched to avoid an unnecessary compatibility break when a previous
version tries to read tar-format output from 9.3 pg_dump.

Brian Weaver and Tom Lane
2012-09-28 15:19:15 -04:00
Tom Lane 7d8cbeb0c3 Fix examples of how to use "su" while starting the server.
The syntax "su -c 'command' username" is not accepted by all versions of
su, for example not OpenBSD's.  More portable is "su username -c
'command'".  So change runtime.sgml to recommend that syntax.  Also,
add a -D switch to the OpenBSD example script, for consistency with other
examples.  Per Denis Lapshin and Gábor Hidvégi.
2012-09-25 13:52:53 -04:00
Heikki Linnakangas 2a0c81a12c Add support for include_dir in config file.
This allows easily splitting configuration into many files, deployed in a
directory.

Magnus Hagander, Greg Smith, Selena Deckelmann, reviewed by Noah Misch.
2012-09-24 18:07:53 +03:00
Tom Lane 31510194cc Minor corrections for ALTER TYPE ADD VALUE IF NOT EXISTS patch.
Produce a NOTICE when the label already exists, for consistency with other
CREATE IF NOT EXISTS commands.  Also, fix the code so it produces something
more user-friendly than an index violation when the label already exists.
This not incidentally enables making a regression test that the previous
patch didn't make for fear of exposing an unpredictable OID in the results.
Also some wordsmithing on the documentation.
2012-09-22 18:35:22 -04:00
Andrew Dunstan fcc1576687 Fix docs typo 2012-09-22 13:57:40 -04:00
Andrew Dunstan 6d12b68cd7 Allow IF NOT EXISTS when add a new enum label.
If the label is already in the enum the statement becomes a no-op.
This will reduce the pain that comes from our not allowing this
operation inside a transaction block.

Andrew Dunstan, reviewed by Tom Lane and Magnus Hagander.
2012-09-22 12:53:31 -04:00
Tom Lane 4394fe3dcb Update release notes for 9.2.1, 9.1.6, 9.0.10, 8.4.14, 8.3.21. 2012-09-19 17:39:31 -04:00
Tom Lane 3c64342c86 Provide adequate documentation of the "table_name *" notation.
Somewhere along the line, somebody decided to remove all trace of this
notation from the documentation text.  It was still in the command syntax
synopses, or at least some of them, but with no indication what it meant.
This will not do, as evidenced by the confusion apparent in bug #7543;
even if the notation is now unnecessary, people will find it in legacy
SQL code and need to know what it does.
2012-09-17 14:59:31 -04:00
Kevin Grittner 327542645e Fix documentation reference to maximum allowed for autovacuum_freeze_max_age.
The documentation mentioned setting autovacuum_freeze_max_age to
"its maximum allowed value of a little less than two billion".
This led to a post asking about the exact maximum allowed value,
which is precisely two billion, not "a little less".

Based on question by Radovan Jablonovsky.  Backpatch to 8.3.
2012-09-16 11:59:50 -05:00
Andrew Dunstan 7c328a9b04 Fix catalog docs to reflect connoinherit change in 09ff76f.
Backpatch to 9.2.
2012-09-12 14:23:50 -04:00
Kevin Grittner 4bc0d2e2cf Fix typo: lexemes misspelled in full text search docs.
Dan Scott
2012-09-11 19:46:17 -05:00
Robert Haas dda589c96b Update syntax shown for \copy to match new syntax for COPY.
Etsuro Fujita
2012-09-06 17:00:03 -04:00
Tom Lane 25f4fe4e46 Fix typo in information_schema documentation.
Shigeru Hanada
2012-09-05 23:37:42 -04:00
Tom Lane 185b744ee6 Make one last copy-editing pass over the 9.2 release notes.
Also, set the release date to 2012-09-10, since we're pretty well
committed to that now.
2012-09-05 21:28:23 -04:00
Bruce Momjian 00a8eb61a2 Document that pg_upgrade requires PGHOST be set for any pre-9.1 servers
with a socket directory mismatch with the new server.

Backpatch to 9.2.
2012-09-04 09:17:30 -04:00
Magnus Hagander 4effe7a589 Mention basebackup-from-slave next to cascading replication 2012-09-04 14:37:14 +02:00
Tom Lane f763b77193 Fix pg_upgrade to cope with non-default unix_socket_directory scenarios.
When starting either an old or new postmaster, force it to place its Unix
socket in the current directory.  This makes it even harder for accidental
connections to occur during pg_upgrade, and also works around some
scenarios where the default socket location isn't usable.  (For example,
if the default location is something other than "/tmp", it might not exist
during "make check".)

When checking an already-running old postmaster, find out its actual socket
directory location from postmaster.pid, if possible.  This dodges problems
with an old postmaster having a configured location different from the
default built into pg_upgrade's libpq.  We can't find that out if the old
postmaster is pre-9.1, so also document how to cope with such scenarios
manually.

In support of this, centralize handling of the connection-related command
line options passed to pg_upgrade's subsidiary programs, such as pg_dump.
This should make future changes easier.

Bruce Momjian and Tom Lane
2012-09-03 13:52:40 -04:00
Bruce Momjian 7682c5947d Update URLs that pointed to sun.com; either repoint them or remove
them.
2012-09-02 09:16:26 -04:00
Bruce Momjian 6c82a86c6f Add small doc mention that libpq is named after POSTQUEL. 2012-09-02 08:42:03 -04:00
Bruce Momjian 53fa0c6db8 Revert doc patch 305557984d as the values
are sometimes signed, sometimes unsigned.
2012-09-01 12:05:01 -04:00
Tom Lane b8a4093b58 Fix broken link in installation.sgml.
Linking to other parts of the manual doesn't work when building the
standalone INSTALL document.
2012-09-01 10:43:50 -04:00
Robert Haas e8d6c98c2f Cross-link to doc build requirements from install requirements.
Jeff Janes
2012-09-01 06:27:52 -04:00
Tom Lane 06310178ef More documentation updates for LATERAL.
Extend xfunc.sgml's discussion of set-returning functions to show an
example of using LATERAL, and recommend that over putting SRFs in the
targetlist.

In passing, reword func.sgml's section on set-returning functions so
that it doesn't claim that the functions listed therein are all the
built-in set-returning functions.  That hasn't been true for a long
time, and trying to make it so doesn't seem like it would be an
improvement.  (Perhaps we should rename that section?)

Both per suggestions from Merlin Moncure.
2012-09-01 00:40:25 -04:00