Commit Graph

28548 Commits

Author SHA1 Message Date
Peter Eisentraut 84f2f5c023 Fix to use the same format specifiers in both branches of a ngettext().
Zdenek Kotala
2009-05-27 20:47:55 +00:00
Tom Lane 6ec0753146 Ignore RECHECK in CREATE OPERATOR CLASS, just throwing a NOTICE, instead of
throwing an error as 8.4 had been doing.  The error interfered with porting
old database definitions (particularly for pg_migrator) without really buying
any safety.  Per bug #4817 and subsequent discussion.
2009-05-27 20:42:29 +00:00
Peter Eisentraut 9873db6646 Fix compiler warnings on Sun Studio of the sort
"tsquery_op.c", line 193: warning: syntax error:  empty declaration

Zdenek Kotala
2009-05-27 19:41:58 +00:00
Michael Meskes e7f4923d3b Reverting patch just in case a compiler treats this enum as signed. 2009-05-27 14:16:51 +00:00
Bruce Momjian fa89e18f09 Remove tabs from SGML file. 2009-05-27 12:28:55 +00:00
Tom Lane 253ff58a1d Improve documentation about function volatility: mention the snapshot
visibility effects in a couple of places where people are likely to look
for it.  Per discussion of recent question from Karl Nack.
2009-05-27 01:18:06 +00:00
Tom Lane 48938ab506 Allow the second argument of pg_get_expr() to be just zero when deparsing
an expression that's not supposed to contain variables.  Per discussion
with Gevik Babakhani, this eliminates the need for an ugly kluge (namely,
specifying some unrelated relation name).  Remove one such kluge from
pg_dump.
2009-05-26 17:36:05 +00:00
Tom Lane 99bf328237 Remove the useless and rather inconsistent return values of EncodeDateOnly,
EncodeTimeOnly, EncodeDateTime, EncodeInterval.  These don't have any good
reason to fail, and their callers were mostly not checking anyway.
2009-05-26 02:17:50 +00:00
Tom Lane 8af641ac1f Remove unused declarations of EncodeTimeOnly and DecodeTimeOnly. 2009-05-26 01:39:49 +00:00
Tom Lane dd96d13a77 Add range checks to time_recv() and timetz_recv(), to prevent binary input
of time values that would not be accepted via textual input.
Per gripe from Andrew McNamara.

This is potentially a back-patchable bug fix, but for the moment it doesn't
seem sufficiently high impact to justify doing that.
2009-05-26 01:29:09 +00:00
Tom Lane c3707a4fcd Use more-portable coding for the check on handing out the last available
relopt_kind value in add_reloption_kind().  Per Zdenek Kotala.
2009-05-24 22:22:44 +00:00
Tom Lane fc2660fc25 Fix LIKE's special-case code for % followed by _. I'm not entirely sure that
this case is worth a special code path, but a special code path that gets
the boundary condition wrong is definitely no good.  Per bug #4821 from
Andrew Gierth.

In passing, clean up some minor code formatting issues (excess parentheses
and blank lines in odd places).

Back-patch to 8.3, where the bug was introduced.
2009-05-24 18:10:38 +00:00
Teodor Sigaev c6c458e24d Resort tsvector's lexemes in tsvectorrecv instead of emmiting an error.
Basically, it's needed to support binary dump from 8.3 because ordering rule
was changed.

Per discussion with Bruce.
2009-05-21 20:09:36 +00:00
Michael Meskes ab9981ccc6 Removed comparison of unsigned expression < 0. 2009-05-21 12:54:27 +00:00
Peter Eisentraut c697337c76 Convert some messages to use ngettext().
Author: Euler Taveira de Oliveira <euler@timbira.com>
2009-05-21 01:08:43 +00:00
Peter Eisentraut 65ffbbf1a5 Fix sgml-mode example. thanks Andrew Dunstan 2009-05-20 23:51:24 +00:00
Michael Meskes 14f29f640a Removed unsigned/signed mismatches. 2009-05-20 16:49:23 +00:00
Michael Meskes 11a497f99a More variables gcc moans about 2009-05-20 16:39:56 +00:00
Michael Meskes 0754b391f3 Removed some unneeded variables and comparisons 2009-05-20 16:13:18 +00:00
Heikki Linnakangas 7340793f31 Silence a gcc compiler warning about non-literal format string with no args
when compiling with -Wformat-security. Fujii Masao.
2009-05-20 08:48:10 +00:00
Peter Eisentraut 5e4c8aee1f Add documentation string for LDFLAGS_SL in configure --help output. 2009-05-19 22:32:41 +00:00
Heikki Linnakangas 9ca99cda21 Update relpages and reltuples estimates in stand-alone ANALYZE, even if
there's no analyzable attributes or indexes. We also used to report 0 live
and dead tuples for such tables, which messed with autovacuum threshold
calculations.

This fixes bug #4812 reported by George Su. Backpatch back to 8.1.
2009-05-19 08:30:00 +00:00
Tom Lane 7280fab717 Fix bug #4814 (wrong subscript in consistent-function call), and add some
minimal regression test coverage for matchPartialInPendingList().
2009-05-19 02:48:26 +00:00
Tom Lane 2c39ab12f3 Make pwdfMatchesString() a little more careful about matching * fields. 2009-05-18 16:15:22 +00:00
Peter Eisentraut 939a40b0af Add some instructions on how to customize emacs for working on the SGML
sources.
2009-05-18 12:47:44 +00:00
Peter Eisentraut 5581f226c8 Update SQL conformance entries for window functions functionality 2009-05-18 12:04:59 +00:00
Peter Eisentraut 9c4c70321d Refer to tables by id, not by "the following table", because tables are in
theory floating elements.
2009-05-18 11:08:24 +00:00
Peter Eisentraut 263144140f Some documentation cleanup for the addition of the KOI8U encoding. Change
all (remaining) mentions of KOI8 to the new canonical form KOI8R.  Add
information about the available conversions for KOI8U.
2009-05-18 08:59:29 +00:00
Tom Lane 606f5d1763 Minor copy-editing for description of partial-table vacuuming. 2009-05-16 22:51:24 +00:00
Tom Lane 03a5ff0d1a Minor editorialization on storage.sgml's documentation of free space
maps.
2009-05-16 22:03:53 +00:00
Tom Lane 2d6e2323a4 Make an editorial pass over the Client Authentication material. 2009-05-16 21:17:21 +00:00
Tom Lane 3626043229 Improve comments in pg_ident.conf.sample. 2009-05-16 20:43:46 +00:00
Tom Lane 4616d57dad Fix all the server-side SIGQUIT handlers (grumble ... why so many identical
copies?) to ensure they really don't run proc_exit/shmem_exit callbacks,
as was intended.  I broke this behavior recently by installing atexit
callbacks without thinking about the one case where we truly don't want
to run those callback functions.  Noted in an example from Dave Page.
2009-05-15 15:56:39 +00:00
Marc G. Fournier abc924519a commit for BETA2 2009-05-15 02:18:27 +00:00
Tom Lane bfab3f19e3 Include recovery_end_command in recovery.conf.sample.
Per suggestion of Jaime Casanova.
2009-05-14 22:22:01 +00:00
Tom Lane 1b6f549de5 Update release notes to today. 2009-05-14 22:17:28 +00:00
Tom Lane a6df05356e Clean up overly hasty docs patch for pg_standby. 2009-05-14 21:59:22 +00:00
Alvaro Herrera f97017068f Translation updates 2009-05-14 21:41:53 +00:00
Tom Lane 284e12c398 Improve a couple of comments. 2009-05-14 21:28:35 +00:00
Heikki Linnakangas b3aac077c3 Add a note to release notes about the smart failover mode in pg_standby. 2009-05-14 21:01:49 +00:00
Heikki Linnakangas 9e403c2587 Add recovery_end_command option to recovery.conf. recovery_end_command
is run at the end of archive recovery, providing a chance to do external
cleanup. Modify pg_standby so that it no longer removes the trigger file,
that is to be done using the recovery_end_command now.

Provide a "smart" failover mode in pg_standby, where we don't fail over
immediately, but only after recovering all unapplied WAL from the archive.
That gives you zero data loss assuming all WAL was archived before
failover, which is what most users of pg_standby actually want.

recovery_end_command by Simon Riggs, pg_standby changes by Fujii Masao and
myself.
2009-05-14 20:31:09 +00:00
Tom Lane a710713644 Add checks to DefineQueryRewrite() to prohibit attaching rules to relations
that aren't RELKIND_RELATION or RELKIND_VIEW, and to disallow attaching rules
to system relations unless allowSystemTableMods is on.  This is to make the
behavior of CREATE RULE more like CREATE TRIGGER, which disallows the
comparable cases.  Per discussion of bug #4808.
2009-05-13 22:32:55 +00:00
Tom Lane 1958603145 Remove a useless backslash from a pattern-match example. Michael Toews 2009-05-13 21:53:41 +00:00
Tom Lane 23543c732b Rewrite xml.c's memory management (yet again). Give up on the idea of
redirecting libxml's allocations into a Postgres context.  Instead, just let
it use malloc directly, and add PG_TRY blocks as needed to be sure we release
libxml data structures in error recovery code paths.  This is ugly but seems
much more likely to play nicely with third-party uses of libxml, as seen in
recent trouble reports about using Perl XML facilities in pl/perl and bug
#4774 about contrib/xml2.

I left the code for allocation redirection in place, but it's only
built/used if you #define USE_LIBXMLCONTEXT.  This is because I found it
useful to corral libxml's allocations in a palloc context when hunting
for libxml memory leaks, and we're surely going to have more of those
in the future with this type of approach.  But we don't want it turned on
in a normal build because it breaks exactly what we need to fix.

I have not re-indented most of the code sections that are now wrapped
by PG_TRY(); that's for ease of review.  pg_indent will fix it.

This is a pre-existing bug in 8.3, but I don't dare back-patch this change
until it's gotten a reasonable amount of field testing.
2009-05-13 20:27:17 +00:00
Tom Lane db6e0b2db2 Update release notes for changes through 2009-05-11. Also some minor
copy-editing and reordering of items.
2009-05-12 23:43:50 +00:00
Tom Lane 546454f8a3 Fix intratransaction memory leaks in xml_recv, xmlconcat, xmlroot, and
xml_parse, all arising from the same sloppy usage of parse_xml_decl.
The original coding had that function returning its output string
parameters in the libxml context, which is long-lived, and all but one
of its callers neglected to free the strings afterwards.  The easiest
and most bulletproof fix is to return the strings in the local palloc
context instead, since that's short-lived.  This was only costing a
dozen or two bytes per function call, but that adds up fast if the
function is called repeatedly ...

Noted while poking at the more general problem of what to do with our
libxml memory allocation hooks.  Back-patch to 8.3, which has the
identical coding.
2009-05-12 20:17:40 +00:00
Tom Lane f23bdda324 Fix LOCK TABLE to eliminate the race condition that could make it give weird
errors when tables are concurrently dropped.  To do this we must take lock
on each relation before we check its privileges.  The old code was trying
to do that the other way around, which is a bit pointless when there are lots
of other commands that lock relations before checking privileges.  I did keep
it checking each relation's privilege before locking the next relation, which
is a detail that ALTER TABLE isn't too picky about.
2009-05-12 16:43:32 +00:00
Tom Lane d4a363cdf2 Modify find_inheritance_children() and find_all_inheritors() to add the
ability to lock relations as they scan pg_inherits, and to ignore any
relations that have disappeared by the time we get lock on them.  This
makes uses of these functions safe against concurrent DROP operations
on child tables: we will effectively ignore any just-dropped child,
rather than possibly throwing an error as in recent bug report from
Thomas Johansson (and similar past complaints).  The behavior should
not change otherwise, since the code was acquiring those same locks
anyway, just a little bit later.

An exception is LockTableCommand(), which is still behaving unsafely;
but that seems to require some more discussion before we change it.
2009-05-12 03:11:02 +00:00
Tom Lane 0ada559187 Do some minor code refactoring in preparation for changing the APIs of
find_inheritance_children() and find_all_inheritors().  I got annoyed that
these are buried inside the planner but mostly used elsewhere.  So, create
a new file catalog/pg_inherits.c and put them there, along with a couple
of other functions that search pg_inherits.

The code that modifies pg_inherits is (still) in tablecmds.c --- it's
kind of entangled with unrelated code that modifies pg_depend and other
stuff, so pulling it out seemed like a bigger change than I wanted to make
right now.  But this file provides a natural home for it if anyone ever
gets around to that.

This commit just moves code around; it doesn't change anything, except
I succumbed to the temptation to make a couple of trivial optimizations
in typeInheritsFrom().
2009-05-12 00:56:05 +00:00
Tom Lane 6480c143ee Partially revert my patch of 2008-11-12 that installed a limit on the number
of AND/OR clause branches that predtest.c would attempt to deal with.  As
noted in bug #4721, that change disabled proof attempts for sizes of problems
that people are actually expecting it to work for.  The original complaint
it was trying to solve was O(N^2) behavior for long IN-lists, so let's try
applying the limit to just ScalarArrayOpExprs rather than everything.
Another case of "foolish consistency" I fear.

Back-patch to 8.2, same as the previous patch was.
2009-05-11 17:56:08 +00:00