Commit Graph

30592 Commits

Author SHA1 Message Date
Bruce Momjian
fc8470ed4d In pg_upgrade, rename macro EXEC_EXT to SHELL_EXT for clarity.
Backpatch to 9.0.X.
2010-10-19 02:55:58 +00:00
Bruce Momjian
377e6e97eb Remove tab from SGML. 2010-10-18 18:51:28 +00:00
Bruce Momjian
02b1f04770 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:16:45 +00:00
Magnus Hagander
eed33cdd83 Fix msvc build for localized versions of Visual C++
Look only at the non-localized part of the output from "vcbuild /?",
which is used to determine the version of Visual Studio in use. Different
languages seem to localize different amounts of the string, but we assume
the part "Microsoft Visual C++" won't be modified.
2010-10-17 16:38:54 +02:00
Magnus Hagander
24d446b569 Fix low-risk potential denial of service against RADIUS login.
Corrupt RADIUS responses were treated as errors and not ignored
(which the RFC2865 states they should be). This meant that a
user with unfiltered access to the network of the PostgreSQL
or RADIUS server could send a spoofed RADIUS response
to the PostgreSQL server causing it to reject a valid login,
provided the attacker could also guess (or brute-force) the
correct port number.

Fix is to simply retry the receive in a loop until the timeout
has expired or a valid (signed by the correct RADIUS server)
packet arrives.

Reported by Alan DeKok in bug #5687.
2010-10-15 16:59:12 +02:00
Simon Riggs
4bc8d9dc90 Correct WAL space calculation formula in docs.
Error pointed out by Fujii Masao, though not his patch.
2010-10-15 10:19:10 +01:00
Robert Haas
fb9bb9f4cf Add pg_user_mappings to the table of system views. 2010-10-14 19:12:24 -04:00
Simon Riggs
d609ff3ced Improvements to docs about pg_archive_cleanup and use of archives
Brendan Jurd
2010-10-14 23:23:26 +01:00
Peter Eisentraut
071f810c98 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:23 +03:00
Simon Riggs
392e01a03a Fix bug in comment of timeline history file.
Fujii Masao
2010-10-14 19:13:09 +01:00
Michael Meskes
86d4cc4a2a Applied patch by Itagaki Takahiro to fix incorrect status calculation in
ecpglib. Instead of parsing the statement just as ask the database server.
2010-10-14 17:49:01 +02:00
Peter Eisentraut
ef76230c27 Make title capitalization consistent with surroundings 2010-10-13 20:06:10 +03:00
Tom Lane
67120d35e2 Fix plpython so that it again honors typmod while assigning to tuple fields.
This was broken in 9.0 while improving plpython's conversion behavior for
bytea and boolean.  Per bug report from maizi.
2010-10-11 22:16:46 -04:00
Tom Lane
3b6eb752d9 Fix assorted bugs in GIN's WAL replay logic.
The original coding was quite sloppy about handling the case where
XLogReadBuffer fails (because the page has since been deleted).  This
would result in either "bad buffer id: 0" or an Assert failure during
replay, if indeed the page were no longer there.  In a couple of places
it also neglected to check whether the change had already been applied,
which would probably result in corrupted index contents.  I believe that
bug #5703 is an instance of the first problem.  These issues could show up
without replication, but only if you were unfortunate enough to crash
between modification of a GIN index and the next checkpoint.

Back-patch to 8.2, which is as far back as GIN has WAL support.
2010-10-11 19:04:44 -04:00
Robert Haas
ffeca98cec Adjust EXPLAIN documentation, so that it's not unreasonably wide.
The new formatting matches what we do for COPY.

Per a complaint from Bruce Momjian.
2010-10-08 23:00:39 -04:00
Robert Haas
57f475271d Warn that views can be safely used to hide columns, but not rows. 2010-10-08 09:16:08 -04:00
Robert Haas
c1db529642 Improve WAL reliability documentation, and add more cross-references to it.
In particular, we are now more explicit about the fact that you may need
wal_sync_method=fsync_writethrough for crash-safety on some platforms,
including MaxOS X.  There's also now an explicit caution against assuming
that the default setting of wal_sync_method is either crash-safe or best
for performance.
2010-10-07 12:22:04 -04:00
Simon Riggs
7887db612c Correct docs for behaviour of ALTER DATABASE .. RENAME during Hot Standby.
Actual behaviour did not match documented behaviour and we have agreed
that it should be the docs that change.

Spotted by Bernd Helmle
2010-10-06 00:20:54 +01:00
Tom Lane
6f1e6b9ccd Undo some poorly-thought-out "proofreading improvements".
Per Tatsuhito Kasahara.
2010-10-05 18:48:20 -04:00
Tom Lane
abcea94ee3 Behave correctly if INSERT ... VALUES is decorated with additional clauses.
In versions 8.2 and up, the grammar allows attaching ORDER BY, LIMIT,
FOR UPDATE, or WITH to VALUES, and hence to INSERT ... VALUES.  But the
special-case code for VALUES in transformInsertStmt() wasn't expecting any
of those, and just ignored them, leading to unexpected results.  Rather
than complicate the special-case path, just ensure that the presence of any
of those clauses makes us treat the query as if it had a general SELECT.
Per report from Hitoshi Harada.
2010-10-02 20:02:33 -04:00
Tom Lane
060f576d0b Remove excess argument to open(2).
Many compilers don't complain about this, but some do, and it's certainly
wrong.  Back-patch to 8.4 where the error was introduced.

Mark Kirkwood
2010-10-02 18:40:48 -04:00
Tom Lane
8178d9480a Throw an appropriate error if ALTER COLUMN TYPE finds a dependent trigger.
Actually making this case work, if the column is used in the trigger's
WHEN condition, will take some new code that probably isn't appropriate
to back-patch.  For now, just throw a FEATURE_NOT_SUPPORTED error rather
than allowing control to reach the "unexpected object" case.  Per bug #5688
from Daniel Grace.  Back-patch to 9.0 where the possibility of such a
dependency was introduced.
2010-10-02 18:22:08 -04:00
Tom Lane
a0ccae7ed4 Fix back-branch breakage from ill-advised last-minute commit. 2010-10-01 10:25:44 -04:00
Marc G. Fournier
fd51c16ce9 Tag 9.0.1 2010-10-01 10:28:42 -03:00
Tom Lane
0d1f3d7bb2 Use a separate interpreter for each calling SQL userid in plperl and pltcl.
There are numerous methods by which a Perl or Tcl function can subvert
the behavior of another such function executed later; for example, by
redefining standard functions or operators called by the target function.
If the target function is SECURITY DEFINER, or is called by such a
function, this means that any ordinary SQL user with Perl or Tcl language
usage rights can do essentially anything with the privileges of the target
function's owner.

To close this security hole, create a separate Perl or Tcl interpreter for
each SQL userid under which plperl or pltcl functions are executed within
a session.  However, all plperlu or pltclu functions run within a session
still share a single interpreter, since they all execute at the trust
level of a database superuser anyway.

Note: this change results in a functionality loss when libperl has been
built without the "multiplicity" option: it's no longer possible to call
plperl functions under different userids in one session, since such a
libperl can't support multiple interpreters in one process.  However, such
a libperl already failed to support concurrent use of plperl and plperlu,
so it's likely that few people use such versions with Postgres.

Security: CVE-2010-3433
2010-09-30 17:19:44 -04:00
Robert Haas
f5f945f9f1 Adjust pg_archivecleanup docs to match message changes made 2010-06-17.
Erik Rijkers
2010-09-30 17:11:11 -04:00
Peter Eisentraut
9103b311a4 Translation updates for 9.0.1 2010-09-30 23:46:16 +03:00
Tom Lane
9caf5a841b Update release notes for releases 9.0.1, 8.4.5, 8.3.12, 8.2.18, 8.1.22,
8.0.26, and 7.4.30.
2010-09-30 14:27:28 -04:00
Bruce Momjian
3689583d5a Have pg_upgrade use strtoul(), not strtol(). 2010-09-29 02:40:26 +00:00
Bruce Momjian
b757f18f2f Use macro atooid() for conversion of strings to oids, per suggestion
from Tom.
2010-09-28 22:11:21 +00:00
Bruce Momjian
ddfa48776c In pg_upgrade, properly handle oids > 2^31 by using strtoul() internally
rather than atol().

Per report from Brian Hirt
2010-09-28 21:41:03 +00:00
Bruce Momjian
0364ab8b26 Fix leak patch that was using fclose() instead of close(). 2010-09-28 21:37:14 +00:00
Bruce Momjian
c767c3bd36 Properly close files after read file failure to prevent potential
resource leak.  Of course, any such failure aborts pg_upgrade, but might
as well be clean about it.

Per patch from Grzegorz Ja?kiewicz.
2010-09-28 19:25:13 +00:00
Tom Lane
3fe9f0e5c7 Fix another small oversight in command_no_begin patch.
Need a "return false" to prevent tests from continuing after we've moved
the "query" pointer.  As it stood, it'd accept "DROP DISCARD ALL" as a
match.
2010-09-28 14:51:04 -04:00
Bruce Momjian
798cbc015b Mention that pg_upgrade requires write permission in the current
directory.

Per report from Harald Armin Massa.
2010-09-28 18:43:01 +00:00
Bruce Momjian
946de44b3d Mention in pg_upgrade docs that the proper Win32 service name should be used.
Per report from Harald Armin Massa
2010-09-28 18:32:07 +00:00
Tom Lane
4ec15077b2 Fix PlaceHolderVar mechanism's interaction with outer joins.
The point of a PlaceHolderVar is to allow a non-strict expression to be
evaluated below an outer join, after which its value bubbles up like a Var
and can be forced to NULL when the outer join's semantics require that.
However, there was a serious design oversight in that, namely that we
didn't ensure that there was actually a correct place in the plan tree
to evaluate the placeholder :-(.  It may be necessary to delay evaluation
of an outer join to ensure that a placeholder that should be evaluated
below the join can be evaluated there.  Per recent bug report from Kirill
Simonov.

Back-patch to 8.4 where the PlaceHolderVar mechanism was introduced.
2010-09-28 14:18:22 -04:00
Bruce Momjian
cd1454cdc3 Add mention of installing pg_upgrade_support in pg_upgrade doc section
title, per suggestion from Ian Barwick.
2010-09-28 17:25:21 +00:00
Itagaki Takahiro
279ab82791 Only DISCARD ALL should be in the command_no_begin list.
We allowes DISCARD PLANS and TEMP in a transaction.
2010-09-28 15:56:46 +09:00
Itagaki Takahiro
60da196636 Add DISCARD to the command_no_begin list for AUTOCOMMIT=off.
Backpatch to 8.3.

Reported by Sergey Burladyan.
2010-09-28 14:24:02 +09:00
Robert Haas
e701e91218 Add "(change requires restart)" note to some postgresql.conf parameters.
Devrim GÜNDÜZ
2010-09-27 09:45:02 -04:00
Tom Lane
7fc8db8491 Fix another join removal bug: the check on PlaceHolderVars was wrong.
The previous coding would decide that join removal was unsafe upon finding
a PlaceHolderVar that needed to be evaluated at the inner rel and then used
above the join.  However, this fails to cover the case of PlaceHolderVars
that refer to both the inner rel and some other rels.  Per bug report from
Andrus.
2010-09-25 19:04:02 -04:00
Tom Lane
3613d0893f Further fixes to the pg_get_expr() security fix in back branches.
It now emerges that the JDBC driver expects to be able to use pg_get_expr()
on an output of a sub-SELECT.  So extend the check logic to be able to recurse
into a sub-SELECT to see if the argument is ultimately coming from an
appropriate column.  Per report from Thomas Kellerer.
2010-09-25 15:57:05 -04:00
Peter Eisentraut
f27860dba3 Fix man page markup for <cmdsynopsis> with multiple variants
Command synopses using <cmdsynopsis> with multiple variants previously used
<sbr> to break lines between variants.  The new man page toolchain introduced
in 9.0 makes a mess out of that, and that markup was probably wrong all along,
because <sbr> is supposed to break lines within a synopsis, not between them.
So fix that by using multiple <cmdsynopsis> elements inside <refsynopsisdiv>.

backpatched to 9.0
2010-09-25 16:47:58 +03:00
Tom Lane
4afd557901 Still more .gitignore cleanup.
Fix overly-enthusiastic ignores, as identified by
git ls-files -i --exclude-standard
2010-09-24 13:48:20 -04:00
Robert Haas
7ffb4d6c53 Add contrib/xml2/pgxml.sql to .gitignore
Kevin Grittner
2010-09-23 22:08:25 -04:00
Tom Lane
c825a15700 ProcessIncomingNotify *must* reset notifyInterruptOccurred when called.
This was broken in 9.0 by careless addition of an early-exit path.
Bug report and diagnosis by Jeff Davis.
2010-09-23 17:17:02 -04:00
Tom Lane
f73ccedcf8 Prevent show_session_authorization from crashing when session_authorization
hasn't been set.

The only known case where this can happen is when show_session_authorization
is invoked in an autovacuum process, which is possible if an index function
calls it, as for example in bug #5669 from Andrew Geery.  We could perhaps
try to return a sensible value, such as the name of the cluster-owning
superuser; but that seems like much more trouble than the case is worth,
and in any case it could create new possible failure modes.  Simply
returning an empty string seems like the most appropriate fix.

Back-patch to all supported versions, even those before autovacuum, just
in case there's another way to provoke this crash.
2010-09-23 16:53:22 -04:00
Tom Lane
b74ecb9194 Avoid sharing subpath list structure when flattening nested AppendRels.
In some situations the original coding led to corrupting the child AppendRel's
subpaths list, effectively adding other members of the parent's list to it.
This was usually masked because we never made any further use of the child's
list, but given the right combination of circumstances, we could do so.  The
visible symptom would be a relation getting scanned twice, as in bug #5673
from David Schmitt.

Backpatch to 8.2, which is as far back as the risky coding appears.  The
example submitted by David only fails in 8.4 and later, but I'm not convinced
that there aren't any even-more-obscure cases where 8.2 and 8.3 would fail.
2010-09-23 15:37:27 -04:00
Heikki Linnakangas
0e6519e115 Initialize tableoid field correctly when dumping foreign data wrappers and
servers. AFAICT it's harmless at the moment because nothing can depend on
either, but as soon as we introduce an object type with such dependencies,
tableoid needs to be set or pg_dump will fail to interpret the dependencies
correctly. In theory, I guess the uninitialized garbage in tableoid could
cause the object to be mistaken for some other object with same OID as well.
2010-09-23 15:00:04 +03:00