Commit Graph

31140 Commits

Author SHA1 Message Date
Heikki Linnakangas 997b48ed96 Support multiple concurrent pg_basebackup backups.
With this patch, pg_basebackup doesn't write a backup_label file in the
data directory, so it doesn't interfere with a pg_start/stop_backup() based
backup anymore. backup_label is still included in the backup, but it is
injected directly into the tar stream.

Heikki Linnakangas, reviewed by Fujii Masao and Magnus Hagander.
2011-01-31 18:25:39 +02:00
Andrew Dunstan 48c9de8028 Fix typo 2011-01-30 20:34:05 -05:00
Andrew Dunstan 91812df4ed Enable building with the Mingw64 compiler.
This can be used to build 64 bit Windows binaries, not only on 64 bit
Windows but on supported cross-compiling hosts including 32 bit Windows,
Cygwin, Darwin and Linux.
2011-01-30 19:56:46 -05:00
Tom Lane 9688c4e6f1 Make reduce_outer_joins() smarter about semijoins.
reduce_outer_joins() mistakenly treated a semijoin like a left join for
purposes of deciding whether not-null constraints created by the join's
quals could be passed down into the join's left-hand side (possibly
resulting in outer-join simplification there).  Actually, semijoin works
like inner join for this purpose, ie, we do not need to see any rows that
can't possibly satisfy the quals.  Hence, two-line fix to treat semi and
inner joins alike.  Per observation by Andres Freund about a performance
gripe from Yazan Suleiman.

Back-patch to 8.4, since this oversight has been there since the current
handling of semijoins was implemented.
2011-01-30 17:04:31 -05:00
Magnus Hagander 507069de6d Add option to include WAL in base backup
When included, this makes the base backup a complete working
"clone" of the initial database, ready to have a postmaster
started against it without the need to set up any log archiving
or similar.

Magnus Hagander, reviewed by Fujii Masao and Heikki Linnakangas
2011-01-30 21:30:09 +01:00
Bruce Momjian 5d5678d7c3 Properly capitalize documentation headings; some only had initial-word
capitalization.
2011-01-29 13:01:48 -05:00
Tom Lane 6f489dca65 Make installation.sgml build standalone again.
We must not try to link to sections that aren't part of the standalone
"make INSTALL" build.  Corrects build failure introduced in commit
159e3d8629.
2011-01-29 12:51:44 -05:00
Magnus Hagander 4ea1a273fb Use GSSAPI library for SSPI auth, when native SSPI is not available
This allows non-Windows clients to connect to a Windows
server with SSPI authentication.

Christian Ullrich, largely modified by me
2011-01-29 17:06:55 +01:00
Robert Haas 7f242d880b Try to avoid running with a full fsync request queue.
When we need to insert a new entry and the queue is full, compact the
entire queue in the hopes of making room for the new entry.  Doing this
on every insertion might worsen contention on BgWriterCommLock, but
when the queue it's full, it's far better than allowing the backend to
perform its own fsync, per testing by Greg Smith as reported in
http://archives.postgresql.org/pgsql-hackers/2011-01/msg02665.php

Original idea from Greg Smith.  Patch by me.  Review by Chris Browne
and Greg Smith
2011-01-29 08:08:41 -05:00
Tom Lane b2826ad52d Copy-edit a paragraph in the contrib/seg documentation.
Although this improves the style, an ulterior motive is to keep the two
table links from breaking across lines in PDF output, per complaint from
Josh Kupershmidt.
2011-01-28 14:34:42 -05:00
Tom Lane 20a0f97273 Rephrase pg_conversion description to avoid splitting link across page.
The link to the CREATE CONVERSION manual page was split across a page
boundary in the PDF output, leading to "\pdfendlink ended up in different
nesting level than \pdfstartlink" error while building PDFs.

It wouldn't be worth changing text that's undergoing active editing to
avoid this, since other editing might result in moving the link away from
the page end anyway.  But this paragraph has been static for a long time,
so might as well fix it to prevent it from being an issue in future.
2011-01-27 18:42:12 -05:00
Tom Lane 4305462497 Update release notes.
Security: CVE-2010-4015
2011-01-27 17:47:10 -05:00
Tom Lane 7ccb6dc2d3 Prevent buffer overrun while parsing an integer in a "query_int" value.
contrib/intarray's gettoken() uses a fixed-size buffer to collect an
integer's digits, and did not guard against overrunning the buffer.
This is at least a backend crash risk, and in principle might allow
arbitrary code execution.  The code didn't check for overflow of the
integer value either, which while not presenting a crash risk was still
bad.

Thanks to Apple Inc's security team for reporting this issue and supplying
the fix.

Security: CVE-2010-4015
2011-01-27 17:42:39 -05:00
Tom Lane 0ac8c8df85 Don't include <asm/ia64regs.h> unnecessarily.
We only need that header when compiling with icc, since the gcc variant of
ia64_get_bsp() uses in-line assembly code.  Per report from Frank Brendel,
the header doesn't exist on all IA64 platforms; so don't include it unless
we need it.
2011-01-27 16:27:27 -05:00
Tom Lane 29d442199a Update release notes for releases 9.0.3, 8.4.7, 8.3.14, and 8.2.20. 2011-01-27 16:09:39 -05:00
Heikki Linnakangas 1e4baa5c96 Update psql's \copyright to match the text we have in the COPYRIGHT file. 2011-01-27 20:20:49 +02:00
Tom Lane 85f345bec2 Improve grammar and spelling in durability discussion. 2011-01-27 12:48:57 -05:00
Bruce Momjian b34ee30115 Update non-durable docs about non-synchronous-commit allowing
transaction loss for a _database_ crash.
2011-01-27 12:06:56 -05:00
Robert Haas a40b1e0bf3 Restore ALTER TABLE .. ADD COLUMN w/DEFAULT restriction.
This reverts commit a06e41deeb of 2011-01-26.
Per discussion, this behavior is not wanted, as it would need to change if
we ever made composite types support DEFAULT.
2011-01-27 08:35:34 -05:00
Bruce Momjian 81c48aeaa8 Restructure streaming docs so streaming seems more integrated in the
paragraphs, per suggestion from Dan Birken.
2011-01-26 19:54:41 -05:00
Tom Lane 7ab6f2da23 Change inv_truncate() to not repeat its systable_getnext_ordered() scan.
In the case where the initial call of systable_getnext_ordered() returned
NULL, this function would nonetheless call it again.  That's undefined
behavior that only by chance failed to not give visibly incorrect results.
Put an if-test around the final loop to prevent that, and in passing
improve some comments.  No back-patch since there's no actual failure.

Per report from YAMAMOTO Takashi.
2011-01-26 19:33:50 -05:00
Peter Eisentraut 8b6f5f2510 Use -Wformat-security when available 2011-01-27 01:23:48 +02:00
Peter Eisentraut 6fe5e4e63e autoreconf
Synchronize pg_config.h.in with configure.in (someone must have
forgotten to run autoheader or autoreconf), and clean up some spurious
change in configure introduced by the last commit there.
2011-01-27 01:19:45 +02:00
Peter Eisentraut 5829738868 Do not prefix error messages with the string "PL/Python: "
It is redundant, given the error context.

Jan Urbański
2011-01-27 01:00:58 +02:00
Peter Eisentraut 582b5ac62e Improve exception usage in PL/Python
Use the built-in TypeError, not SPIError, for errors having to do with
argument counts or types.  Use SPIError, not simply plpy.Error, for
errors in PLy_spi_execute_plan.  Finally, do not set a Python
exception if PyArg_ParseTuple failed, as it already sets the correct
exception.

Jan Urbański
2011-01-27 00:47:14 +02:00
Peter Eisentraut 418df3a5dd Also save the error detail in SPIError
The temporarily broken plpython_unicode test shows a case where this
is used.

Do remaining fix-ups on the expected files at the same time.
2011-01-27 00:35:28 +02:00
Peter Eisentraut ddf8c16822 Fix compiler warnings
Older versions of GCC appear to report these with the current standard
option set, newer versions need -Wformat-security.
2011-01-27 00:19:15 +02:00
Bruce Momjian 4fec63f94e Per Peter E, use 'kB' for kilobyte, not 'K'. 2011-01-26 16:21:19 -05:00
Bruce Momjian 00869024cb In pg_test_fsync, use K(1024) rather than k(1000) for write size units. 2011-01-26 11:02:52 -05:00
Bruce Momjian 159e3d8629 Update contrib documention mentions to point to actual documentation
sections, rather than just calling it "/contrib/module_name".

Also update pg_test_fsync build instructions now that it is in /contrib.
2011-01-26 09:22:21 -05:00
Bruce Momjian e84730a916 Update sync commit performance documentation to be consistent with other
non-durable items, per Robert Haas.
2011-01-26 09:15:52 -05:00
Itagaki Takahiro 69039ea8b5 Make 'on' uppercase in a sql example. 2011-01-26 22:35:01 +09:00
Robert Haas 5c2a7c6e97 Add a comment explaining why we force physical removal of OIDs.
Noah Misch, slightly revised.
2011-01-26 06:42:51 -05:00
Robert Haas a06e41deeb Remove arbitrary ALTER TABLE .. ADD COLUMN restriction.
The previous coding prevented ALTER TABLE .. ADD COLUMN from being used
with a non-NULL default in situations where the table's rowtype was being
used elsewhere.  But this is a completely arbitrary restriction since
you could do the same operation in multiple steps (add the column, add
the default, update the table).

Inspired by a patch from Noah Misch, though I didn't use his code.
2011-01-26 06:37:08 -05:00
Bruce Momjian 64bc872761 Adjust pg_test_fsync to always do XLOG_BLCKSZ-sized writes, rather than
always 8k writes, per suggestion from Tom.  Also adjust open_sync output
layout.
2011-01-25 22:18:24 -05:00
Bruce Momjian a91c950658 Update warning about synchronous-commit durability, per suggestion from
Robvert Haas.
2011-01-25 20:32:26 -05:00
Robert Haas 2b2b2ae2aa Correct ALTER TYPE -> SET DATA TYPE in ALTER TABLE documentation.
The latter is the correct name of the operation to change the data type
of a column.

Noah Misch
2011-01-25 18:52:49 -05:00
Tom Lane 5042d16d12 Remove old claim that ExclusiveLock is sometimes taken on system catalogs.
We used to do that on pg_listener, but pg_listener is no more.

Also add a bit more documentation for ShareRowExclusive mode.
2011-01-25 18:39:01 -05:00
Robert Haas 558d1c95ae Fix thinko in ALTER FOREIGN TABLE documentation.
Noah Misch
2011-01-25 17:56:22 -05:00
Tom Lane bd1ad1b019 Replace pg_class.relhasexclusion with pg_index.indisexclusion.
There isn't any need to track this state on a table-wide basis, and trying
to do so introduces undesirable semantic fuzziness.  Move the flag to
pg_index, where it clearly describes just a single index and can be
immutable after index creation.
2011-01-25 17:51:59 -05:00
Tom Lane 88452d5ba6 Implement ALTER TABLE ADD UNIQUE/PRIMARY KEY USING INDEX.
This feature allows a unique or pkey constraint to be created using an
already-existing unique index.  While the constraint isn't very
functionally different from the bare index, it's nice to be able to do that
for documentation purposes.  The main advantage over just issuing a plain
ALTER TABLE ADD UNIQUE/PRIMARY KEY is that the index can be created with
CREATE INDEX CONCURRENTLY, so that there is not a long interval where the
table is locked against updates.

On the way, refactor some of the code in DefineIndex() and index_create()
so that we don't have to pass through those functions in order to create
the index constraint's catalog entries.  Also, in parse_utilcmd.c, pass
around the ParseState pointer in struct CreateStmtContext to save on
notation, and add error location pointers to some error reports that didn't
have one before.

Gurjeet Singh, reviewed by Steve Singer and Tom Lane
2011-01-25 15:43:05 -05:00
Magnus Hagander 966d4f52c2 Typo fix for MemSet size.
Fujii Masao
2011-01-25 10:50:04 +01:00
Bruce Momjian d7a714828f Use consistent spacing for PGAPPICON Makefile option. 2011-01-24 20:46:30 -05:00
Bruce Momjian 9dd7933937 Use XLOG_BLCKSZ in pg_test_fsync, rather than our own define, but verify
it is 8k as expected.
2011-01-24 20:07:05 -05:00
Bruce Momjian 9fc0192283 In test_open_sync(), writes kilobytes as intended, not by bytes. 2011-01-24 19:42:32 -05:00
Peter Eisentraut 77ff840835 Document the "S" option for psql's \dn command in the psql help
This option was recently introduced, but the documentation in help.c
was not updated.
2011-01-25 01:51:35 +02:00
Peter Eisentraut 88dcdf9007 Call PLy_spi_execute_fetch_result inside the try/catch block
This way errors from fetching tuples are correctly reported as errors
in the SPI call.  While at it, avoid palloc(0).

Jan Urbański
2011-01-25 00:43:25 +02:00
Peter Eisentraut 52713d02c7 Refactor PLy_spi_prepare to save two levels of indentation
Instead of checking whether the arglist is NULL and then if its length
is 0, do it in one step, and outside of the try/catch block.

Jan Urbański
2011-01-24 22:13:06 +02:00
Robert Haas ea2c2641f9 More documentation cleanup for sepgsql.
Thom Brown and Robert Haas
2011-01-24 08:42:44 -05:00
Heikki Linnakangas 74be35b07c Fix typo in the psql \d query handling, so that we use the correct query
against 9.0 servers.
2011-01-24 14:34:15 +02:00