Commit Graph

9938 Commits

Author SHA1 Message Date
Peter Eisentraut f2a4278330 Propagate ALTER TYPE operations to typed tables
This adds RESTRICT/CASCADE flags to ALTER TYPE ... ADD/DROP/ALTER/
RENAME ATTRIBUTE to control whether to alter typed tables as well.
2010-11-23 22:50:17 +02:00
Peter Eisentraut fc946c39ae Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
Robert Haas 7504870778 Add new SQL function, format(text).
Currently, three conversion format specifiers are supported: %s for a
string, %L for an SQL literal, and %I for an SQL identifier.  The latter
two are deliberately designed not to overlap with what sprintf() already
supports, in case we want to add more of sprintf()'s functionality here
later.

Patch by Pavel Stehule, heavily revised by me.  Reviewed by Jeff Janes
and, in earlier versions, by Itagaki Takahiro and Tom Lane.
2010-11-20 22:33:27 -05:00
Alvaro Herrera 6cc2deb86e Add pg_describe_object function
This function is useful to obtain textual descriptions of objects as
stored in pg_depend.
2010-11-18 17:06:19 -03:00
Robert Haas 1fc2d60d8c Minor corrections to dummy_seclabel documentation.
Problems noted by Thom Brown.
2010-11-18 10:30:24 -05:00
Robert Haas 45768d10e3 Document the dummy_seclabel contrib module.
KaiGai Kohei, with editing and markup fixes by me.
2010-11-17 20:50:51 -05:00
Tom Lane 511e902b51 Make TRUNCATE ... RESTART IDENTITY restart sequences transactionally.
In the previous coding, we simply issued ALTER SEQUENCE RESTART commands,
which do not roll back on error.  This meant that an error between
truncating and committing left the sequences out of sync with the table
contents, with potentially bad consequences as were noted in a Warning on
the TRUNCATE man page.

To fix, create a new storage file (relfilenode) for a sequence that is to
be reset due to RESTART IDENTITY.  If the transaction aborts, we'll
automatically revert to the old storage file.  This acts just like a
rewriting ALTER TABLE operation.  A penalty is that we have to take
exclusive lock on the sequence, but since we've already got exclusive lock
on its owning table, that seems unlikely to be much of a problem.

The interaction of this with usual nontransactional behaviors of sequence
operations is a bit weird, but it's hard to see what would be completely
consistent.  Our choice is to discard cached-but-unissued sequence values
both when the RESTART is executed, and at rollback if any; but to not touch
the currval() state either time.

In passing, move the sequence reset operations to happen before not after
any AFTER TRUNCATE triggers are fired.  The previous ordering was not
logically sensible, but was forced by the need to minimize inconsistency
if the triggers caused an error.  Transactional rollback is a much better
solution to that.

Patch by Steve Singer, rather heavily adjusted by me.
2010-11-17 16:42:18 -05:00
Andrew Dunstan b7fcf68e86 Require VALUE keyword when extending an enum type. Based on a patch from Alvaro Herrera. 2010-11-16 22:18:33 -05:00
Robert Haas 3134d8863e Add new buffers_backend_fsync field to pg_stat_bgwriter.
This new field counts the number of times that a backend which writes a
buffer out to the OS must also fsync() it.  This happens when the
bgwriter fsync request queue is full, and is generally detrimental to
performance, so it's good to know when it's happening.  Along the way,
log a new message at level DEBUG1 whenever we fail to hand off an fsync,
so that the problem can also be seen in examination of log files
(if the logging level is cranked up high enough).

Greg Smith, with minor tweaks by me.
2010-11-15 12:42:59 -05:00
Peter Eisentraut 19e231bbda Improved parallel make support
Replace for loops in makefiles with proper dependencies.  Parallel
make can now span across directories.  Also, make -k and make -q work
properly.

GNU make 3.80 or newer is now required.
2010-11-12 22:15:16 +02:00
Peter Eisentraut d6754f67b0 docs -> documentation 2010-11-12 21:25:57 +02:00
Bruce Momjian 8f742d1cda Mention that pg_upgrade requires compatible 32/64-bit binaries. 2010-11-10 14:08:43 +00:00
Robert Haas 7ba6e4f0e0 Add monitoring function pg_last_xact_replay_timestamp.
Fujii Masao, with a little wordsmithing by me.
2010-11-09 22:52:19 -05:00
Alvaro Herrera b47953f9c6 Merge docs for CREATE CONSTRAINT TRIGGER and CREATE TRIGGER 2010-11-09 16:52:46 -03:00
Tom Lane 0de92fd13c Improve pg_ctl's man page.
Explicitly document that the -o options of pg_ctl init mode are meant
for initdb, not postgres (Euler Taveira de Oliveira).  Assorted other
copy-editing (Tom).
2010-11-09 14:05:11 -05:00
Alvaro Herrera 73bc5218df plpython has plpy.Error instead of plpy.ERROR
Author: Marti Raudsepp <marti@juffo.org>
2010-11-09 11:02:17 -03:00
Tom Lane 543d22fc74 Prevent invoking I/O conversion casts via functional/attribute notation.
PG 8.4 added a built-in feature for casting pretty much any data type to
string types (text, varchar, etc).  We allowed this to work in any of the
historically-allowed syntaxes: CAST(x AS text), x::text, text(x), or
x.text.  However, multiple complaints have shown that it's too easy to
invoke such casts unintentionally in the latter two styles, particularly
field selection.  To cure the problem with the narrowest possible change
of behavior, disallow use of I/O conversion casts from composite types to
string types via functional/attribute syntax.  The new functionality is
still available via cast syntax.

In passing, document the equivalence of functional and attribute syntax
in a more visible place.
2010-11-07 13:03:19 -05:00
Tom Lane e43fb604d6 Implement an "S" option for psql's \dn command.
\dn without "S" now hides all pg_XXX schemas as well as information_schema.
Thus, in a bare database you'll only see "public".  ("public" is considered
a user schema, not a system schema, mainly because it's droppable.)
Per discussion back in late September.
2010-11-06 21:41:14 -04:00
Tom Lane 5e8b7b0b73 Allow moddatetime's target column to be of type timestamptz.
Dirk Heinrichs
2010-11-04 16:34:47 -04:00
Peter Eisentraut bd1ff97133 Change version number in release notes to 9.1alpha2 2010-10-30 23:37:36 +03:00
Peter Eisentraut 71165685b2 Last-minute updates to 9.1alpha2 release notes 2010-10-30 22:34:20 +03:00
Peter Eisentraut e9eb4f4013 Release notes for 9.1alpha2 2010-10-28 17:42:58 +03:00
Peter Eisentraut 18d6437885 Remove obsolete release-alpha.sgml
This was only used while the final release notes for 9.0 were being prepared.
The alpha release notes are now in release-9.1.sgml.
2010-10-28 17:40:56 +03:00
Peter Eisentraut 2999f4ef35 Remove tabs from SGML 2010-10-28 17:40:27 +03:00
Robert Haas 2cae0aeb9c Revert "Correct WAL space calculation formula in docs."
This reverts commit 915116bc62.

Per discussion, the previous formula was in fact correct.

http://archives.postgresql.org/pgsql-docs/2010-10/msg00038.php
2010-10-27 21:24:02 -04:00
Robert Haas 0d5deebe11 Reorganize OS-specific details about write caching into a list.
Along the way, clarify that sdparm can be used on Linux as well as FreeBSD.
2010-10-27 21:20:58 -04:00
Robert Haas 5a12c808cf Note that effective_io_concurrency only affects bitmap heap scans.
Josh Kupershmidt
2010-10-26 21:44:14 -04:00
Heikki Linnakangas 5c38782cc8 Note explicitly that hash indexes are also not replicated because they're not
WAL-logged. Make the notice about the lack of WAL-logging more visible by
making it a <caution>. Also remove the false statement from hot standby
caveats section that hash indexes are not used during hot standby.
2010-10-26 22:53:41 +03:00
Tom Lane 84c123be1d Allow new values to be added to an existing enum type.
After much expenditure of effort, we've got this to the point where the
performance penalty is pretty minimal in typical cases.

Andrew Dunstan, reviewed by Brendan Jurd, Dean Rasheed, and Tom Lane
2010-10-24 23:05:41 -04:00
Peter Eisentraut 24b29ca8f9 Support suffix matching of host names in pg_hba.conf
A name starting with a dot can be used to match a suffix of the actual
host name (e.g., .example.com matches foo.example.com).
2010-10-24 15:54:00 +03:00
Heikki Linnakangas 57b80b4c46 Add semicolon, missed in previous patch. And update the keyword list in
the docs to reflect that OFF is now unreserved. Spotted by Tom Lane.
2010-10-22 18:38:31 +03:00
Bruce Momjian 71be8db5df Mention limited usefulness of .pgpass database field. 2010-10-21 22:00:11 +00:00
Tom Lane 529cb267a6 Improve handling of domains over arrays.
This patch eliminates various bizarre behaviors caused by sloppy thinking
about the difference between a domain type and its underlying array type.
In particular, the operation of updating one element of such an array
has to be considered as yielding a value of the underlying array type,
*not* a value of the domain, because there's no assurance that the
domain's CHECK constraints are still satisfied.  If we're intending to
store the result back into a domain column, we have to re-cast to the
domain type so that constraints are re-checked.

For similar reasons, such a domain can't be blindly matched to an ANYARRAY
polymorphic parameter, because the polymorphic function is likely to apply
array-ish operations that could invalidate the domain constraints.  For the
moment, we just forbid such matching.  We might later wish to insert an
automatic downcast to the underlying array type, but such a change should
also change matching of domains to ANYELEMENT for consistency.

To ensure that all such logic is rechecked, this patch removes the original
hack of setting a domain's pg_type.typelem field to match its base type;
the typelem will always be zero instead.  In those places where it's really
okay to look through the domain type with no other logic changes, use the
newly added get_base_element_type function in place of get_element_type.
catversion bumped due to change in pg_type contents.

Per bug #5717 from Richard Huxton and subsequent discussion.
2010-10-21 16:07:17 -04:00
Robert Haas 4b6623a7e8 Add some caveats to the contrib/isn docs. 2010-10-19 22:48:19 -04:00
Tom Lane c33bfb8b9b Update storage.sgml to describe the 9.0 tablespace directory layout. 2010-10-19 21:53:26 -04:00
Bruce Momjian f75d6a1b19 Add mention of using tools/fsync to test fsync methods. Restructure
recent wal_sync_method doc paragraph to be clearer.
2010-10-19 14:56:53 +00:00
Robert Haas 604ab08145 Add levenshtein_less_equal, optimized version for small distances.
Alexander Korotkov, heavily revised by me.
2010-10-19 09:51:06 -04:00
Peter Eisentraut bc8624b15d Support key word 'all' in host column of pg_hba.conf 2010-10-18 22:15:44 +03:00
Bruce Momjian 433c7a6545 Document the tablespace directory "should" be empty, rather than "must"
be empty.  Because of binary migration usage, it might not be empty.
2010-10-18 18:15:58 +00:00
Robert Haas 9c73e20f38 Change example pg_hba.conf in docs to match altered pg_hba.conf.sample
Peter Eisentraut's recent patch to allow host names in pg_hba.conf
changed the contents of pg_hba.conf.sample

Fujii Masao
2010-10-18 12:18:45 -04:00
Alvaro Herrera 33ae03f400 Document that translate() removes characters in "from" that don't have
a corresponding "to" character.

Author: Josh Kupershmidt
2010-10-16 01:15:10 -03:00
Tom Lane 07f1264dda Allow WITH clauses to be attached to INSERT, UPDATE, DELETE statements.
This is not the hoped-for facility of using INSERT/UPDATE/DELETE inside
a WITH, but rather the other way around.  It seems useful in its own
right anyway.

Note: catversion bumped because, although the contents of stored rules
might look compatible, there's actually a subtle semantic change.
A single Query containing a WITH and INSERT...VALUES now represents
writing the WITH before the INSERT, not before the VALUES.  While it's
not clear that that matters to anyone, it seems like a good idea to
have it cited in the git history for catversion.h.

Original patch by Marko Tiikkaja, with updating and cleanup by
Hitoshi Harada.
2010-10-15 19:55:25 -04:00
Peter Eisentraut 6ab42ae367 Support host names in pg_hba.conf
Peter Eisentraut, reviewed by KaiGai Kohei and Tom Lane
2010-10-15 22:56:18 +03:00
Tom Lane 71d24466fb Document the DISTINCT noise word in the UNION/INTERSECT/EXCEPT constructs.
I also rearranged the order of the sections to match the logical order
of processing steps: the distinct-elimination implied by SELECT DISTINCT
happens before, not after, any UNION/INTERSECT/EXCEPT combination.

Per a suggestion from Hitoshi Harada.
2010-10-15 15:48:45 -04:00
Alvaro Herrera 0c9b166db5 Allow pg_ctl to register the service in either AUTO or DEMAND start type
Author: Quan Zongliang
Documentation updates by David Fetter
2010-10-15 14:30:03 -03:00
Simon Riggs 915116bc62 Correct WAL space calculation formula in docs.
Error pointed out by Fujii Masao, though not his patch.
2010-10-15 10:17:12 +01:00
Robert Haas e468213358 Add pg_user_mappings to the table of system views. 2010-10-14 19:13:01 -04:00
Peter Eisentraut 402e11913f Remove reference.ced
This is a parsed DocBook DTD for the PSGML Emacs mode, but it hasn't
been updated since we switched to DocBook 4.2 about seven years ago.
Also, PSGML has deprecated this method of DTD parsing.
2010-10-14 23:16:46 +03:00
Peter Eisentraut 9f2d7f6e2d Complete the documentation of the USAGE privilege for foreign servers
The GRANT reference page failed to mention that the USAGE privilege
allows modifying associated user mappings, although this was already
documented on the CREATE/ALTER/DROP USER MAPPING pages.
2010-10-14 23:16:46 +03:00
Peter Eisentraut 80ada4c0db Document (compositeval).* field selection syntax 2010-10-14 23:16:46 +03:00