OSDN Git Service

pg-rex/syncrep.git
13 years agoFix adjust_semi_join to be more cautious about clauseless joins.
Tom Lane [Tue, 2 Nov 2010 22:45:44 +0000 (18:45 -0400)]
Fix adjust_semi_join to be more cautious about clauseless joins.

It was reporting that these were fully indexed (hence cheap), when of
course they're the exact opposite of that.  I'm not certain if the case
would arise in practice, since a clauseless semijoin is hard to produce
in SQL, but if it did happen we'd make some dumb decisions.

13 years agoFix buffer overrun in pg_upgrade.
Tom Lane [Tue, 2 Nov 2010 21:31:54 +0000 (17:31 -0400)]
Fix buffer overrun in pg_upgrade.

Problem reported, and cause identified, by Hernan Gonzalez.

13 years agoEnsure an index that uses a whole-row Var still depends on its table.
Tom Lane [Tue, 2 Nov 2010 21:15:13 +0000 (17:15 -0400)]
Ensure an index that uses a whole-row Var still depends on its table.

We failed to record any dependency on the underlying table for an index
declared like "create index i on t (foo(t.*))".  This would create trouble
if the table were dropped without previously dropping the index.  To fix,
simplify some overly-cute code in index_create(), accepting the possibility
that sometimes the whole-table dependency will be redundant.  Also document
this hazard in dependency.c.  Per report from Kevin Grittner.

In passing, prevent a core dump in pg_get_indexdef() if the index's table
can't be found.  I came across this while experimenting with Kevin's
example.  Not sure it's a real issue when the catalogs aren't corrupt, but
might as well be cautious.

Back-patch to all supported versions.

13 years agoBootstrap WAL to begin at segment logid=0 logseg=1 (000000010000000000000001)
Heikki Linnakangas [Tue, 2 Nov 2010 09:23:43 +0000 (11:23 +0200)]
Bootstrap WAL to begin at segment logid=0 logseg=1 (000000010000000000000001)
rather than 0/0, so that we can safely use 0/0 as an invalid value. This is a
more future-proof fix for the corner-case bug in streaming replication that
was fixed yesterday. We had a similar corner-case bug with log/seg 0/0 back in
February as well. Avoiding 0/0 as a valid value should prevent bugs like that
in the future. Per Tom Lane's idea.

Back-patch to 9.0. Since this only affects bootstrapping, it makes no
difference to existing installations. We don't need to worry about the
bug in existing installations, because if you've managed to get past the
initial base backup already, you won't hit the bug in the future either.

13 years agoFix corner-case bug in tracking of latest removed WAL segment during
Heikki Linnakangas [Mon, 1 Nov 2010 07:56:45 +0000 (09:56 +0200)]
Fix corner-case bug in tracking of latest removed WAL segment during
streaming replication. We used log/seg 0/0 to indicate that no WAL segments
have been removed since startup, but 0/0 is a valid value for the very first
WAL segment after initdb. To make that disambiguous, store
(latest removed WAL segment + 1) in the global variable.

Per report from Matt Chesler, also reproduced by Greg Smith.

13 years agoFix plpgsql's handling of "simple" expression evaluation.
Tom Lane [Thu, 28 Oct 2010 17:01:01 +0000 (13:01 -0400)]
Fix plpgsql's handling of "simple" expression evaluation.

In general, expression execution state trees aren't re-entrantly usable,
since functions can store private state information in them.
For efficiency reasons, plpgsql tries to cache and reuse state trees for
"simple" expressions.  It can get away with that most of the time, but it
can fail if the state tree is dirty from a previous failed execution (as
in an example from Alvaro) or is being used recursively (as noted by me).

Fix by tracking whether a state tree is in use, and falling back to the
"non-simple" code path if so.  This results in a pretty considerable speed
hit when the non-simple path is taken, but the available alternatives seem
even more unpleasant because they add overhead in the simple path.  Per
idea from Heikki.

Back-patch to all supported branches.

13 years agoFix long-standing segfault when accept() or one of the calls made right
Heikki Linnakangas [Wed, 27 Oct 2010 17:03:00 +0000 (20:03 +0300)]
Fix long-standing segfault when accept() or one of the calls made right
after accepting a connection fails, and the server is compiled with GSSAPI
support. Report and patch by Alexander V. Chernikov, bug #5731.

13 years agoFix up some oversights in psql's Unicode-escape support.
Tom Lane [Wed, 27 Oct 2010 02:23:16 +0000 (22:23 -0400)]
Fix up some oversights in psql's Unicode-escape support.

Original patch failed to include new exclusive states in a switch that
needed to include them; and also was guilty of very fuzzy thinking
about how to handle error cases.  Per bug #5729 from Alan Choi.

13 years agoNote explicitly that hash indexes are also not replicated because they're not
Heikki Linnakangas [Tue, 26 Oct 2010 19:50:31 +0000 (22:50 +0300)]
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.

13 years agoBefore removing backup_label and irrevocably changing pg_control file, check
Heikki Linnakangas [Tue, 26 Oct 2010 18:15:42 +0000 (21:15 +0300)]
Before removing backup_label and irrevocably changing pg_control file, check
that WAL file containing the checkpoint redo-location can be found. This
avoids making the cluster irrecoverable if the redo location is in an earlie
WAL file than the checkpoint record.

Report, analysis and patch by Jeff Davis, with small changes by me.

13 years agoFix inline_set_returning_function() to preserve the invalItems list properly.
Tom Lane [Mon, 25 Oct 2010 17:04:42 +0000 (13:04 -0400)]
Fix inline_set_returning_function() to preserve the invalItems list properly.

This avoids a possible crash when inlining a SRF whose argument list
contains a reference to an inline-able user function.  The crash is quite
reproducible with CLOBBER_FREED_MEMORY enabled, but would be less certain
in a production build.  Problem introduced in 9.0 by the named-arguments
patch, which requires invoking eval_const_expressions() before we can try
to inline a SRF.  Per report from Brendan Jurd.

13 years agoAdd semicolon, missed in previous patch. And update the keyword list in
Heikki Linnakangas [Fri, 22 Oct 2010 15:38:31 +0000 (18:38 +0300)]
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.

13 years agoMake OFF keyword unreserved. It's not hard to imagine wanting to use 'off'
Heikki Linnakangas [Fri, 22 Oct 2010 14:37:38 +0000 (17:37 +0300)]
Make OFF keyword unreserved. It's not hard to imagine wanting to use 'off'
as a variable or column name, and it's not reserved in recent versions of
the SQL spec either. This became particularly annoying in 9.0, before that
PL/pgSQL replaced variable names in queries with parameter markers, so
it was possible to use OFF and many other backend parser keywords as
variable names. Because of that, backpatch to 9.0.

13 years agoRemove obsolete comment, per Josh Kupershmidt.
Tom Lane [Wed, 20 Oct 2010 21:05:15 +0000 (17:05 -0400)]
Remove obsolete comment, per Josh Kupershmidt.

13 years agoIf pk is NULL, the backend would segfault when accessing ->algo and the
Heikki Linnakangas [Wed, 20 Oct 2010 19:20:33 +0000 (22:20 +0300)]
If pk is NULL, the backend would segfault when accessing ->algo and the
following NULL check was never reached.

This problem was found by Coccinelle (null_ref.cocci from coccicheck).

Marti Raudsepp

13 years agoDon't try to fetch database name when SetTransactionIdLimit() is executed
Tom Lane [Wed, 20 Oct 2010 16:48:57 +0000 (12:48 -0400)]
Don't try to fetch database name when SetTransactionIdLimit() is executed
outside a transaction.

This repairs brain fade in my patch of 2009-08-30: the reason we had been
storing oldest-database name, not OID, in ShmemVariableCache was of course
to avoid having to do a catalog lookup at times when it might be unsafe.

This error explains why Aleksandr Dushein is having trouble getting out of
an XID wraparound state in bug #5718, though not how he got into that state
in the first place.  I suspect pg_upgrade is at fault there.

13 years agoFix ecpg test building process to not generate *.dSYM junk on Macs.
Tom Lane [Wed, 20 Oct 2010 04:55:03 +0000 (00:55 -0400)]
Fix ecpg test building process to not generate *.dSYM junk on Macs.

The trick is to not try to build executables directly from .c files,
but to always build the intermediate .o files.  For obscure reasons,
Darwin's version of gcc will leave debug cruft behind in the first
case but not the second.  Per complaint from Robert Haas.

13 years agoUpdate storage.sgml to describe the 9.0 tablespace directory layout.
Tom Lane [Wed, 20 Oct 2010 01:53:08 +0000 (21:53 -0400)]
Update storage.sgml to describe the 9.0 tablespace directory layout.

13 years agoFix incorrect generation of whole-row variables in planner.
Tom Lane [Tue, 19 Oct 2010 19:08:47 +0000 (15:08 -0400)]
Fix incorrect generation of whole-row variables in planner.

A couple of places in the planner need to generate whole-row Vars, and were
cutting corners by setting vartype = RECORDOID in the Vars, even in cases
where there's an identifiable named composite type for the RTE being
referenced.  While we mostly got away with this, it failed when there was
also a parser-generated whole-row reference to the same RTE, because the
two Vars weren't equal() due to the difference in vartype.  Fix by
providing a subroutine the planner can call to generate whole-row Vars
the same way the parser does.

Per bug #5716 from Andrew Tipton.  Back-patch to 9.0 where one of the bogus
calls was introduced (the other one is new in HEAD).

13 years agoAdd removal of PG_VERSION to optional old cluster deletion script.
Bruce Momjian [Tue, 19 Oct 2010 15:52:44 +0000 (15:52 +0000)]
Add removal of PG_VERSION to optional old cluster deletion script.
Backpatch to 9.0.X.

13 years agoAdd mention of using tools/fsync to test fsync methods. Restructure
Bruce Momjian [Tue, 19 Oct 2010 14:58:03 +0000 (14:58 +0000)]
Add mention of using tools/fsync to test fsync methods. Restructure
recent wal_sync_method doc paragraph to be clearer.

13 years agoIn pg_upgrade, rename macro EXEC_EXT to SHELL_EXT for clarity.
Bruce Momjian [Tue, 19 Oct 2010 02:55:58 +0000 (02:55 +0000)]
In pg_upgrade, rename macro EXEC_EXT to SHELL_EXT for clarity.

Backpatch to 9.0.X.

13 years agoRemove tab from SGML.
Bruce Momjian [Mon, 18 Oct 2010 18:51:28 +0000 (18:51 +0000)]
Remove tab from SGML.

13 years agoDocument the tablespace directory "should" be empty, rather than "must"
Bruce Momjian [Mon, 18 Oct 2010 18:16:45 +0000 (18:16 +0000)]
Document the tablespace directory "should" be empty, rather than "must"
be empty.  Because of binary migration usage, it might not be empty.

13 years agoFix msvc build for localized versions of Visual C++
Magnus Hagander [Sun, 17 Oct 2010 14:36:54 +0000 (16:36 +0200)]
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.

13 years agoFix low-risk potential denial of service against RADIUS login.
Magnus Hagander [Fri, 15 Oct 2010 14:59:12 +0000 (16:59 +0200)]
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.

13 years agoCorrect WAL space calculation formula in docs.
Simon Riggs [Fri, 15 Oct 2010 09:19:10 +0000 (10:19 +0100)]
Correct WAL space calculation formula in docs.

Error pointed out by Fujii Masao, though not his patch.

13 years agoAdd pg_user_mappings to the table of system views.
Robert Haas [Thu, 14 Oct 2010 23:12:24 +0000 (19:12 -0400)]
Add pg_user_mappings to the table of system views.

13 years agoImprovements to docs about pg_archive_cleanup and use of archives
Simon Riggs [Thu, 14 Oct 2010 22:23:26 +0000 (23:23 +0100)]
Improvements to docs about pg_archive_cleanup and use of archives

Brendan Jurd

13 years agoComplete the documentation of the USAGE privilege for foreign servers
Peter Eisentraut [Thu, 14 Oct 2010 17:36:42 +0000 (20:36 +0300)]
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.

13 years agoFix bug in comment of timeline history file.
Simon Riggs [Thu, 14 Oct 2010 18:13:09 +0000 (19:13 +0100)]
Fix bug in comment of timeline history file.

Fujii Masao

13 years agoApplied patch by Itagaki Takahiro to fix incorrect status calculation in
Michael Meskes [Thu, 14 Oct 2010 15:49:01 +0000 (17:49 +0200)]
Applied patch by Itagaki Takahiro to fix incorrect status calculation in
ecpglib. Instead of parsing the statement just as ask the database server.

13 years agoMake title capitalization consistent with surroundings
Peter Eisentraut [Wed, 13 Oct 2010 17:05:16 +0000 (20:05 +0300)]
Make title capitalization consistent with surroundings

13 years agoFix plpython so that it again honors typmod while assigning to tuple fields.
Tom Lane [Tue, 12 Oct 2010 02:16:46 +0000 (22:16 -0400)]
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.

13 years agoFix assorted bugs in GIN's WAL replay logic.
Tom Lane [Mon, 11 Oct 2010 23:04:44 +0000 (19:04 -0400)]
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.

13 years agoAdjust EXPLAIN documentation, so that it's not unreasonably wide.
Robert Haas [Sat, 9 Oct 2010 02:59:48 +0000 (22:59 -0400)]
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.

13 years agoWarn that views can be safely used to hide columns, but not rows.
Robert Haas [Fri, 8 Oct 2010 13:15:17 +0000 (09:15 -0400)]
Warn that views can be safely used to hide columns, but not rows.

13 years agoImprove WAL reliability documentation, and add more cross-references to it.
Robert Haas [Thu, 7 Oct 2010 16:19:03 +0000 (12:19 -0400)]
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.

13 years agoCorrect docs for behaviour of ALTER DATABASE .. RENAME during Hot Standby.
Simon Riggs [Tue, 5 Oct 2010 23:20:54 +0000 (00:20 +0100)]
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

13 years agoUndo some poorly-thought-out "proofreading improvements".
Tom Lane [Tue, 5 Oct 2010 22:48:20 +0000 (18:48 -0400)]
Undo some poorly-thought-out "proofreading improvements".
Per Tatsuhito Kasahara.

13 years agoBehave correctly if INSERT ... VALUES is decorated with additional clauses.
Tom Lane [Sun, 3 Oct 2010 00:02:33 +0000 (20:02 -0400)]
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.

13 years agoRemove excess argument to open(2).
Tom Lane [Sat, 2 Oct 2010 22:40:28 +0000 (18:40 -0400)]
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

13 years agoThrow an appropriate error if ALTER COLUMN TYPE finds a dependent trigger.
Tom Lane [Sat, 2 Oct 2010 22:21:41 +0000 (18:21 -0400)]
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.

13 years agoFix back-branch breakage from ill-advised last-minute commit. REL9_0_1
Tom Lane [Fri, 1 Oct 2010 14:25:44 +0000 (10:25 -0400)]
Fix back-branch breakage from ill-advised last-minute commit.

13 years agoTag 9.0.1
Marc G. Fournier [Fri, 1 Oct 2010 13:28:42 +0000 (10:28 -0300)]
Tag 9.0.1

13 years agoUse a separate interpreter for each calling SQL userid in plperl and pltcl.
Tom Lane [Thu, 30 Sep 2010 21:19:44 +0000 (17:19 -0400)]
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

13 years agoAdjust pg_archivecleanup docs to match message changes made 2010-06-17.
Robert Haas [Thu, 30 Sep 2010 21:05:15 +0000 (17:05 -0400)]
Adjust pg_archivecleanup docs to match message changes made 2010-06-17.

Erik Rijkers

13 years agoTranslation updates for 9.0.1
Peter Eisentraut [Thu, 30 Sep 2010 20:46:16 +0000 (23:46 +0300)]
Translation updates for 9.0.1

13 years agoUpdate release notes for releases 9.0.1, 8.4.5, 8.3.12, 8.2.18, 8.1.22,
Tom Lane [Thu, 30 Sep 2010 18:27:28 +0000 (14:27 -0400)]
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.

13 years agoHave pg_upgrade use strtoul(), not strtol().
Bruce Momjian [Wed, 29 Sep 2010 02:40:26 +0000 (02:40 +0000)]
Have pg_upgrade use strtoul(), not strtol().

13 years agoUse macro atooid() for conversion of strings to oids, per suggestion
Bruce Momjian [Tue, 28 Sep 2010 22:11:21 +0000 (22:11 +0000)]
Use macro atooid() for conversion of strings to oids, per suggestion
from Tom.

13 years agoIn pg_upgrade, properly handle oids > 2^31 by using strtoul() internally
Bruce Momjian [Tue, 28 Sep 2010 21:41:03 +0000 (21:41 +0000)]
In pg_upgrade, properly handle oids > 2^31 by using strtoul() internally
rather than atol().

Per report from Brian Hirt

13 years agoFix leak patch that was using fclose() instead of close().
Bruce Momjian [Tue, 28 Sep 2010 21:37:14 +0000 (21:37 +0000)]
Fix leak patch that was using fclose() instead of close().

13 years agoProperly close files after read file failure to prevent potential
Bruce Momjian [Tue, 28 Sep 2010 19:25:13 +0000 (19:25 +0000)]
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.

13 years agoFix another small oversight in command_no_begin patch.
Tom Lane [Tue, 28 Sep 2010 18:47:25 +0000 (14:47 -0400)]
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.

13 years agoMention that pg_upgrade requires write permission in the current
Bruce Momjian [Tue, 28 Sep 2010 18:43:01 +0000 (18:43 +0000)]
Mention that pg_upgrade requires write permission in the current
directory.

Per report from Harald Armin Massa.

13 years agoMention in pg_upgrade docs that the proper Win32 service name should be used.
Bruce Momjian [Tue, 28 Sep 2010 18:32:07 +0000 (18:32 +0000)]
Mention in pg_upgrade docs that the proper Win32 service name should be used.

Per report from Harald Armin Massa

13 years agoFix PlaceHolderVar mechanism's interaction with outer joins.
Tom Lane [Tue, 28 Sep 2010 16:08:56 +0000 (12:08 -0400)]
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.

13 years agoAdd mention of installing pg_upgrade_support in pg_upgrade doc section
Bruce Momjian [Tue, 28 Sep 2010 17:25:21 +0000 (17:25 +0000)]
Add mention of installing pg_upgrade_support in pg_upgrade doc section
title, per suggestion from Ian Barwick.

13 years agoOnly DISCARD ALL should be in the command_no_begin list.
Itagaki Takahiro [Tue, 28 Sep 2010 06:56:46 +0000 (15:56 +0900)]
Only DISCARD ALL should be in the command_no_begin list.
We allowes DISCARD PLANS and TEMP in a transaction.

13 years agoAdd DISCARD to the command_no_begin list for AUTOCOMMIT=off.
Itagaki Takahiro [Tue, 28 Sep 2010 05:24:02 +0000 (14:24 +0900)]
Add DISCARD to the command_no_begin list for AUTOCOMMIT=off.
Backpatch to 8.3.

Reported by Sergey Burladyan.

13 years agoAdd "(change requires restart)" note to some postgresql.conf parameters.
Robert Haas [Mon, 27 Sep 2010 13:14:14 +0000 (09:14 -0400)]
Add "(change requires restart)" note to some postgresql.conf parameters.

Devrim GÜNDÜZ

13 years agoFix another join removal bug: the check on PlaceHolderVars was wrong.
Tom Lane [Sat, 25 Sep 2010 23:04:02 +0000 (19:04 -0400)]
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.

13 years agoFurther fixes to the pg_get_expr() security fix in back branches.
Tom Lane [Sat, 25 Sep 2010 19:57:05 +0000 (15:57 -0400)]
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.

13 years agoFix man page markup for <cmdsynopsis> with multiple variants
Peter Eisentraut [Sat, 25 Sep 2010 06:57:09 +0000 (09:57 +0300)]
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

13 years agoStill more .gitignore cleanup.
Tom Lane [Fri, 24 Sep 2010 17:48:20 +0000 (13:48 -0400)]
Still more .gitignore cleanup.

Fix overly-enthusiastic ignores, as identified by
git ls-files -i --exclude-standard

13 years agoAdd contrib/xml2/pgxml.sql to .gitignore
Robert Haas [Fri, 24 Sep 2010 02:00:26 +0000 (22:00 -0400)]
Add contrib/xml2/pgxml.sql to .gitignore

Kevin Grittner

13 years agoProcessIncomingNotify *must* reset notifyInterruptOccurred when called.
Tom Lane [Thu, 23 Sep 2010 21:17:02 +0000 (17:17 -0400)]
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.

13 years agoPrevent show_session_authorization from crashing when session_authorization
Tom Lane [Thu, 23 Sep 2010 20:53:22 +0000 (16:53 -0400)]
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.

13 years agoAvoid sharing subpath list structure when flattening nested AppendRels.
Tom Lane [Thu, 23 Sep 2010 23:34:56 +0000 (19:34 -0400)]
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.

13 years agoInitialize tableoid field correctly when dumping foreign data wrappers and
Heikki Linnakangas [Thu, 23 Sep 2010 11:49:00 +0000 (14:49 +0300)]
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.

13 years agoRe-allow input of Julian dates prior to 0001-01-01 AD.
Tom Lane [Thu, 23 Sep 2010 03:48:14 +0000 (23:48 -0400)]
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.

13 years agoMore fixes for libpq's .gitignore file.
Tom Lane [Thu, 23 Sep 2010 02:32:19 +0000 (22:32 -0400)]
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.

13 years agoDo some copy-editing on the Git usage docs.
Tom Lane [Thu, 23 Sep 2010 00:22:35 +0000 (20:22 -0400)]
Do some copy-editing on the Git usage docs.

13 years agoFix remaining stray references to CVS.
Tom Lane [Wed, 22 Sep 2010 23:51:46 +0000 (19:51 -0400)]
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.

13 years agoAdd assorted other documentation build targets to documentation gitignore.
Tom Lane [Wed, 22 Sep 2010 22:08:53 +0000 (18:08 -0400)]
Add assorted other documentation build targets to documentation gitignore.

13 years agoSome more gitignore cleanups: cover contrib and PL regression test outputs.
Tom Lane [Wed, 22 Sep 2010 21:21:58 +0000 (17:21 -0400)]
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.

13 years agoAdd gitignore files for ecpg regression tests.
Magnus Hagander [Wed, 22 Sep 2010 19:49:07 +0000 (21:49 +0200)]
Add gitignore files for ecpg regression tests.

Backpatch to 8.2 as that's how far the structure looks the same.

13 years agoRemove anonymous cvs instructions, and replace them with instructions
Magnus Hagander [Wed, 22 Sep 2010 18:10:29 +0000 (20:10 +0200)]
Remove anonymous cvs instructions, and replace them with instructions
for git. Change other references from cvs to git as well.

13 years agoConvert cvsignore to gitignore, and add .gitignore for build targets.
Magnus Hagander [Wed, 22 Sep 2010 10:57:06 +0000 (12:57 +0200)]
Convert cvsignore to gitignore, and add .gitignore for build targets.

13 years agoFix a missed explanation of auto-analyze threshold, per Joe Miller.
Tom Lane [Tue, 21 Sep 2010 20:40:50 +0000 (16:40 -0400)]
Fix a missed explanation of auto-analyze threshold, per Joe Miller.

13 years agoBack-patch replacement of README.CVS with README.git.
Tom Lane [Tue, 21 Sep 2010 18:42:58 +0000 (14:42 -0400)]
Back-patch replacement of README.CVS with README.git.

In older branches, also git-ify the "make distdir" rule.

13 years agoMove pg_db_role_setting docs to correct place in alphabetical order.
Robert Haas [Fri, 17 Sep 2010 18:50:22 +0000 (18:50 +0000)]
Move pg_db_role_setting docs to correct place in alphabetical order.

13 years agotag v9.0.0 ... the big day approaches REL9_0_0
Marc G. Fournier [Fri, 17 Sep 2010 01:18:41 +0000 (01:18 +0000)]
tag v9.0.0 ... the big day approaches

13 years agoTreat exit code 128 (ERROR_WAIT_NO_CHILDREN) as non-fatal on Win32,
Magnus Hagander [Thu, 16 Sep 2010 20:37:18 +0000 (20:37 +0000)]
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.

13 years agoTranslation updates for 9.0.0
Peter Eisentraut [Thu, 16 Sep 2010 19:09:39 +0000 (19:09 +0000)]
Translation updates for 9.0.0

13 years agoStamp 9.0 release notes with expected release date; also some last-minute
Tom Lane [Thu, 16 Sep 2010 18:15:28 +0000 (18:15 +0000)]
Stamp 9.0 release notes with expected release date; also some last-minute
copy-editing.

13 years agoFix bad grammar.
Tom Lane [Thu, 16 Sep 2010 14:31:26 +0000 (14:31 +0000)]
Fix bad grammar.

13 years agoFix two new-in-9.0 bugs in hstore.
Tom Lane [Thu, 16 Sep 2010 02:54:07 +0000 (02:54 +0000)]
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.

13 years agoAdd a compatibility note about plpgsql's treatment of SELECT INTO rec.fld
Tom Lane [Wed, 15 Sep 2010 17:46:02 +0000 (17:46 +0000)]
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.

13 years agoFix join-removal logic for pseudoconstant and outerjoin-delayed quals.
Tom Lane [Tue, 14 Sep 2010 23:15:37 +0000 (23:15 +0000)]
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.

13 years agoDon't warn about an in-progress online backup, when we're recovering from
Heikki Linnakangas [Tue, 14 Sep 2010 08:05:54 +0000 (08:05 +0000)]
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.

13 years agoElaborate on what gets stored in pg_authid.rolpasswd.
Robert Haas [Mon, 13 Sep 2010 17:03:23 +0000 (17:03 +0000)]
Elaborate on what gets stored in pg_authid.rolpasswd.

Also, add cross-reference from pg_shadow.passwd to pg_authid.rolpasswd and
fix a bit of markup I muffed in my previous commit.

Per discussion with Josh Kupershmidt.

13 years agoRemove prototype for non-existent function from walreceiver.h. Tidy up by
Heikki Linnakangas [Mon, 13 Sep 2010 10:14:30 +0000 (10:14 +0000)]
Remove prototype for non-existent function from walreceiver.h. Tidy up by
separating prototypes for functions in walreceiver.c and walreceiverfuncs.c
with comments.

13 years agoProcess options from the startup packed in walsender. Only few options
Heikki Linnakangas [Mon, 13 Sep 2010 09:00:35 +0000 (09:00 +0000)]
Process options from the startup packed in walsender. Only few options
make sense for walsender, but for example application_name and client_encoding
do. We still don't apply per-role settings from pg_db_role_setting, because
that would require connecting to a database to read the table.

Fujii Masao

13 years agoDon't try aligning comments for new archive_command Win32 doc example;
Bruce Momjian [Mon, 13 Sep 2010 01:35:54 +0000 (01:35 +0000)]
Don't try aligning comments for new archive_command Win32 doc example;
it doesn't work.

Backpatch to 9.0.X.

13 years agoLink from pg_shadow docs to pg_authid docs.
Robert Haas [Mon, 13 Sep 2010 01:25:12 +0000 (01:25 +0000)]
Link from pg_shadow docs to pg_authid docs.

Per discussion with Josh Kupershmidt.

13 years agoRe-add documentation for Win32 copy syntax for archive_command.
Bruce Momjian [Sun, 12 Sep 2010 13:47:19 +0000 (13:47 +0000)]
Re-add documentation for Win32 copy syntax for archive_command.

Backpatch to 9.0.X.

13 years agoRemove obsolete claim that gzip is needed while installing PG's documentation.
Tom Lane [Thu, 9 Sep 2010 17:19:46 +0000 (17:19 +0000)]
Remove obsolete claim that gzip is needed while installing PG's documentation.
It isn't, now that we ship the docs as loose files rather than a sub-tarball.

Also adjust the wording in a couple of places to make the lists of required
software read more consistently.

13 years agoDoc fixes:
Bruce Momjian [Thu, 9 Sep 2010 00:48:29 +0000 (00:48 +0000)]
Doc fixes:

- remove excessive table cells
- moving function parameters into function tags rather than having
  them being considered separate
- add return type column on XML2 contrib module functions list and
  removing return types from function
- add table header to XML2 contrib parameter table

Thom Brown

Backpatch to 9.0.X.