Commit Graph

31262 Commits

Author SHA1 Message Date
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
Magnus Hagander 9752080942 Exclude sepgsql from MSVC regression testing as well
In passing, change exclusion in the build to follow the
same pattern as other always-excluded modules.
2011-01-24 08:24:31 +01:00
Heikki Linnakangas 56d77c9e56 Silence compiler warning about uninitialized variable, noted by
Itagaki Takahiro
2011-01-24 08:28:35 +02:00
Robert Haas 41611f16e9 PGXS support for contrib/hstore
Joey Adams
2011-01-23 23:07:55 -05:00
Robert Haas c26ac226e4 Blind attempt to exclude sepgsql from MSVC build system. 2011-01-23 22:57:32 -05:00
Robert Haas 194c8f713a First round of cleanup of sepgsql code and documentation.
Robert Haas, with a few suggestions from Thom Brown
2011-01-23 22:48:22 -05:00
Robert Haas 968bc6fac9 sepgsql, an SE-Linux integration for PostgreSQL
This is still pretty rough - among other things, the documentation
needs work, and the messages need a visit from the style police -
but this gets the basic framework in place.

KaiGai Kohei
2011-01-23 20:48:27 -05:00
Magnus Hagander e5487f65fd Make walsender options order-independent
While doing this, also move base backup options into
a struct instead of increasing the number of parameters
to multiple functions for each new option.
2011-01-23 23:39:18 +01:00
Magnus Hagander 39e911e28a Reorder includes to unbreak MSVC 2011-01-23 22:44:07 +01:00
Heikki Linnakangas 7f508f1c6b Add 'directory' format to pg_dump. The new directory format is compatible
with the 'tar' format, in that untarring a tar format archive produces a
valid directory format archive.

Joachim Wieland and Heikki Linnakangas
2011-01-23 23:10:15 +02:00
Tom Lane f36920796e Fix another portability issue in pg_basebackup.
The target of sscanf with a %o format had better be of integer width,
but "mode_t" conceivably isn't that.  Another compiler warning seen
only on some platforms; this one I think is potentially a real bug
and not just a warning.
2011-01-23 14:26:51 -05:00
Tom Lane dd5f0db96b Improve getObjectDescription's display of pg_amop and pg_amproc entries.
Include the lefttype/righttype columns explicitly (instead of assuming
the reader can deduce them from the operator or function description),
and move the operator or function description to the end of the string,
to make it clearer that it's a referenced object and not the amop or
amproc item itself.  Per extensive discussion of Andreas Karlsson's
original patch.

Andreas Karlsson, Tom Lane
2011-01-23 14:13:46 -05:00
Tom Lane de3c2d6e92 Revert "Factor out functions responsible for caching I/O routines".
This reverts commit 740e54ca84, which seems
to have tickled an optimization bug in gcc 4.5.x, as reported upstream at
https://bugzilla.redhat.com/show_bug.cgi?id=671899
Since this patch had no purpose beyond code beautification, it's not
worth expending a lot of effort to look for another workaround.
2011-01-23 13:12:55 -05:00
Tom Lane 10e99f15d4 Add .gitignore file to silence complaints about pg_basebackup. 2011-01-23 13:07:34 -05:00
Tom Lane b3cfcdaad2 Suppress uninitialized-variable warning. 2011-01-23 13:06:38 -05:00
Andrew Dunstan 6c41cf5977 Silence flex warnings about DOS file paths in MSVC builds 2011-01-23 12:24:15 -05:00
Magnus Hagander d13e0975c9 Use pg_strcasecmp instead of strcasecmp for portability
Per buildfarm.
2011-01-23 17:35:02 +01:00
Magnus Hagander f88a638199 Only show pg_stat_replication details to superusers 2011-01-23 17:28:19 +01:00
Magnus Hagander fe12263c9f filemode is parsed on win32 even if never used
Per buildfarm failure.
2011-01-23 14:45:23 +01:00
Magnus Hagander 048d148fe6 Add pg_basebackup tool for streaming base backups
This tool makes it possible to do the pg_start_backup/
copy files/pg_stop_backup step in a single command.

There are still some steps to be done before this is a
complete backup solution, such as the ability to stream
the required WAL logs, but it's still usable, and
could do with some buildfarm coverage.

In passing, make the checkpoint request optionally
fast instead of hardcoding it.

Magnus Hagander, reviewed by Fujii Masao and Dimitri Fontaine
2011-01-23 12:21:23 +01:00
Robert Haas 6f59777c65 Code cleanup for assign_transaction_read_only.
As in commit fb4c5d2798 on 2011-01-21,
this avoids spurious debug messages and allows idempotent changes at
any time.  Along the way, make assign_XactIsoLevel allow idempotent
changes even when not within a subtransaction, to be consistent with
the new coding of assign_transaction_read_only and because there's
no compelling reason to do otherwise.

Kevin Grittner, with some adjustments.
2011-01-22 20:55:50 -05:00
Tom Lane cc73c16050 Quick hack to un-break plpython regression tests.
It's not clear to me what should happen to the other plpython_unicode
variant expected files, but this patch gets things passing on my own
machines and at least some of the buildfarm.
2011-01-22 20:43:54 -05:00
Tom Lane 0f73aae13d Allow the wal_buffers setting to be auto-tuned to a reasonable value.
If wal_buffers is initially set to -1 (which is now the default), it's
replaced by 1/32nd of shared_buffers, with a minimum of 8 (the old default)
and a maximum of the XLOG segment size.  The allowed range for manual
settings is still from 4 up to whatever will fit in shared memory.

Greg Smith, with implementation correction by me.
2011-01-22 20:31:24 -05:00
Tom Lane 518b1e96c0 Suppress "control reaches end of non-void function" warning from gcc 4.5.
Not sure why I'm seeing this on Fedora 14 and not earlier versions.
Seems like a regression that gcc no longer knows that DIE() doesn't return.
Still, adding a dummy return is harmless enough.
2011-01-22 18:01:31 -05:00
Tom Lane e2627258c3 Suppress possibly-uninitialized-variable warnings from gcc 4.5.
It appears that gcc 4.5 can issue such warnings for whole structs, not
just scalar variables as in the past.  Refactor some pg_dump code slightly
so that the OutputContext local variables are always initialized, even
if they won't be used.  It's cheap enough to not be worth worrying about.
2011-01-22 17:56:42 -05:00
Peter Eisentraut 116ce2f4d0 Get rid of the global variable holding the error state
Global error handling led to confusion and was hard to manage.  With
this change, errors from PostgreSQL are immediately reported to Python
as exceptions.  This requires setting a Python exception after
reporting the caught PostgreSQL error as a warning, because PLy_elog
destroys the Python exception state.

Ideally, all places where PostgreSQL errors need to be reported back
to Python should be wrapped in subtransactions, to make going back to
Python from a longjmp safe.  This will be handled in a separate patch.

Jan Urbański
2011-01-22 22:12:32 +02:00
Tom Lane 37eb2cd4ad More pg_test_fsync fixups.
Reduce #includes to minimum actually needed; in particular include
postgres_fe.h not postgres.h, so as to stop build failures on some
platforms.

Use get_progname() instead of hardwired program name; improve error
checking for command line syntax; bring error messages into line with
style guidelines; include strerror result in die() cases.
2011-01-22 15:01:26 -05:00
Tom Lane 3ae28ce8c4 Suppress unused-variables warning when OPEN_SYNC_FLAG isn't defined.
Per buildfarm.
2011-01-22 12:26:44 -05:00
Magnus Hagander f5a0fd2f3b Link libpgport into pg_test_fsync on msvc 2011-01-22 18:18:27 +01:00