Commit Graph

30621 Commits

Author SHA1 Message Date
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
Tom Lane
6f664c1af4 Re-allow input of Julian dates prior to 0001-01-01 AD.
This was unintentionally broken in 8.4 while tightening up checking of
ordinary non-Julian date inputs to forbid references to "year zero".
Per bug #5672 from Benjamin Gigot.
2010-09-22 23:48:14 -04:00
Tom Lane
e482ebdf0b More fixes for libpq's .gitignore file.
The previous patches failed to cover a lot of symlinks that are only
added in platform-specific cases.  Make the lists match what's in the
Makefile for each branch.
2010-09-22 22:32:19 -04:00
Tom Lane
535c611f76 Do some copy-editing on the Git usage docs. 2010-09-22 20:22:35 -04:00
Tom Lane
5074f68848 Fix remaining stray references to CVS.
These are just cosmetic and don't seem worth back-patching far.
I put them into 9.0 just because it was trivial to do so.
2010-09-22 19:51:46 -04:00
Tom Lane
f3a838bb76 Add assorted other documentation build targets to documentation gitignore. 2010-09-22 18:08:53 -04:00
Tom Lane
8d0b5d8971 Some more gitignore cleanups: cover contrib and PL regression test outputs.
Also do some further work in the back branches, where quite a bit wasn't
covered by Magnus' original back-patch.
2010-09-22 17:22:53 -04:00
Magnus Hagander
f23bc1e8a4 Add gitignore files for ecpg regression tests.
Backpatch to 8.2 as that's how far the structure looks the same.
2010-09-22 21:49:07 +02:00
Magnus Hagander
bbf84ac000 Remove anonymous cvs instructions, and replace them with instructions
for git. Change other references from cvs to git as well.
2010-09-22 20:10:29 +02:00
Magnus Hagander
a692359411 Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:06 +02:00
Tom Lane
dcd9dcdeeb Fix a missed explanation of auto-analyze threshold, per Joe Miller. 2010-09-21 16:40:50 -04:00
Tom Lane
829f5b3571 Back-patch replacement of README.CVS with README.git.
In older branches, also git-ify the "make distdir" rule.
2010-09-21 14:42:58 -04:00
Robert Haas
c6f6db5fdf Move pg_db_role_setting docs to correct place in alphabetical order. 2010-09-17 18:50:22 +00:00
Marc G. Fournier
861861edcc tag v9.0.0 ... the big day approaches 2010-09-17 01:18:41 +00:00
Magnus Hagander
ec6fca101e Treat exit code 128 (ERROR_WAIT_NO_CHILDREN) as non-fatal on Win32,
since it can happen when a process fails to start when the system
is under high load.

Per several bug reports and many peoples investigation.

Back-patch to 8.4, which is as far back as the "deadman-switch"
for shared memory access exists.
2010-09-16 20:37:18 +00:00
Peter Eisentraut
765b69ddb1 Translation updates for 9.0.0 2010-09-16 19:09:39 +00:00
Tom Lane
57d115c449 Stamp 9.0 release notes with expected release date; also some last-minute
copy-editing.
2010-09-16 18:15:28 +00:00
Tom Lane
a59eaf28cc Fix bad grammar. 2010-09-16 14:31:26 +00:00
Tom Lane
c5ed269164 Fix two new-in-9.0 bugs in hstore.
There was an incorrect Assert in hstoreValidOldFormat(), which would cause
immediate core dumps when attempting to work with pre-9.0 hstore data,
but of course only in an assert-enabled build.

Also, ghstore_decompress() incorrectly applied DatumGetHStoreP() to a datum
that wasn't actually an hstore, but rather a ghstore (ie, a gist signature
bitstring).  That used to be harmless, but could now result in misbehavior
if the hstore format conversion code happened to trigger.  In reality,
since ghstore is not marked toastable (and doesn't need to be), this
function is useless anyway; we can lobotomize it down to returning the
passed-in pointer.

Both bugs found by Andrew Gierth, though this isn't exactly his proposed
patch.
2010-09-16 02:54:07 +00:00
Tom Lane
e3171be674 Add a compatibility note about plpgsql's treatment of SELECT INTO rec.fld
when fld is of composite type.  Per discussion of bug #5644 from Valentine
Gogichashvili.
2010-09-15 17:46:02 +00:00
Tom Lane
bab9f1d585 Fix join-removal logic for pseudoconstant and outerjoin-delayed quals.
In these cases a qual can get marked with the removable rel in its
required_relids, but this is just to schedule its evaluation correctly, not
because it really depends on the rel.  We were assuming that, in effect,
we could throw away *all* quals so marked, which is nonsense.  Tighten up
the logic to be a little more paranoid about which quals belong to the
outer join being considered for removal, and arrange for all quals that
don't belong to be updated so they will still get evaluated correctly.

Also fix another problem that happened to be exposed by this test case,
which was that make_join_rel() was failing to notice some cases where
a constant-false qual could be used to prove a join relation empty.  If it's
a pushed-down constant false, then the relation is empty even if it's an
outer join, because the qual applies after the outer join expansion.

Per report from Nathan Grange.  Back-patch into 9.0.
2010-09-14 23:15:37 +00:00
Heikki Linnakangas
105faeb356 Don't warn about an in-progress online backup, when we're recovering from
an online backup instead of performing one. pg_ctl can detect that by
checking if recovery.conf exists.

Backup label file is renamed away early in recovery, so the window where
backup label exists during recovery is normally very small, but you can run
into it e.g if restore_command is set incorrectly and the startup process
never finds even the first WAL segment containing the checkpoint record to
start recovery from.

Fujii Masao with comments by me.
2010-09-14 08:05:54 +00:00