PostgreSQL Weekly News – November 07 2010
== PostgreSQL Weekly News – November 07 2010 ==
PostgreSQL 9.1alpha2 released. Get it here:
Here’s how to test it:
BuildFarm client 4.4 released. Please join the buildfarm, especially
if you have an unusual hardware/OS/compiler combination.
FOSDEM is one of the biggest Free and Open Source event held annually
in Brussels, Belgium, on February 5-6, 2011, and attended by around
4000 people. Send in your proposal to fosdem AT postgresql DOT eu.
NYPUG presents Mladen Gogala, who will speak on moving from Oracle to
PostgreSQL Tuesday, November 9. Details below.
Early bird registration for PGDay.IT, December 10, 2010 in Rome,
Italy, is open and the schedule is online.
== PostgreSQL Product News ==
Npgsql 2.0.11, a .NET data provider for PostgreSQL, released.
== PostgreSQL Jobs for November ==
== PostgreSQL Local ==
PostgreSQL Booth and BOF at Usenix LISA, November 10-11, San Jose CA
The German PostgreSQL User Group is running a booth at OpenRheinRuhr
2010 on november 13rd and 14th in Oberhausen, Germany. Andreas
Scherbaum is giving a talk about new features in PostgreSQL 9.0.
The German PostgreSQL User Group is present with a booth, a talk and a
workshop at Brandenburger Linux-Infotag 2010 in Potsdam, Germany on
Registration for PGDay.EU 2010 held on December 6-8 in Stuttgart,
Germany is open.
PgDay.IT 2010 will be in Rome this year December 10th. The Call for
Papers is now open.
PGDay is scheduled at this year’s Southern California Linux Exposition
(SCALE) held in the LAX Hilton Hotel in the city of Los Angeles,
California, on Friday February 25th, 2011. Post your talk submission
to pgday-submissions AT googlegroups DOT com.
== PostgreSQL in the News ==
Planet PostgreSQL: http://planet.postgresql.org/
PostgreSQL Weekly News is brought to you this week by David Fetter
Submit news and announcements by Sunday at 3:00pm Pacific time.
Please send English language ones to firstname.lastname@example.org, German language
to email@example.com, Italian language to firstname.lastname@example.org. Spanish language
== Reviews ==
== Applied Patches ==
Heikki Linnakangas pushed:
– 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
unambiguous, store (latest removed WAL segment + 1) in the global
variable. Per report from Matt Chesler, also reproduced by Greg
– 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
Tom Lane pushed:
– Avoid using a local FunctionCallInfoData struct in
ExecMakeFunctionResult and related routines. We already had a
redundant FunctionCallInfoData struct in FuncExprState, but were
using that copy only in set-returning-function cases, to avoid
keeping function evaluation state in the expression tree for the
benefit of plpgsql’s “simple expression” logic. But of course that
didn’t work anyway. Given the recent fixes in plpgsql there is no
need to have two separate behaviors here. Getting rid of the local
FunctionCallInfoData structs should make things a little faster
(because we don’t need to do InitFunctionCallInfoData each time),
and it also makes for a noticeable reduction in stack space
consumption during recursive calls.
– 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
– Fix buffer overrun in pg_upgrade. Problem reported, and cause
identified, by Hernan Gonzalez.
– 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.
– Use only one hash entry for all instances of a pltcl trigger
function. Like plperl and unlike plpgsql, there isn’t any cached
state that could depend on exactly which relation the trigger is
being fired for. So we can use just one hash entry for all
relations, which might save a little something. Alex Hunsaker.
– Reduce recursion depth in recently-added regression test. Some
buildfarm members fail the test with the original depth of 10
levels, apparently because they are running at the minimum
max_stack_depth setting of 100kB and using ~ 10k per recursion
level. While it might be interesting to try to figure out why
they’re eating so much stack, it isn’t likely that any fix for that
would be back-patchable. So just change the test to recurse only 5
levels. The extra levels don’t prove anything correctness-wise
– Reimplement planner’s handling of MIN/MAX aggregate optimization.
Per my recent proposal, get rid of all the direct inspection of
indexes and manual generation of paths in planagg.c. Instead, set
up EquivalenceClasses for the aggregate argument expressions, and
let the regular path generation logic deal with creating paths that
can satisfy those sort orders. This makes planagg.c a bit more
visible to the rest of the planner than it was originally, but the
approach is basically a lot cleaner than before. A major advantage
of doing it this way is that we get MIN/MAX optimization on
inheritance trees (using MergeAppend of indexscans) practically for
free, whereas in the old way we’d have had to add a whole lot more
duplicative logic. One small disadvantage of this approach is that
MIN/MAX aggregates can no longer exploit partial indexes having an
“x IS NOT NULL” predicate, unless that restriction or something that
implies it is specified in the query. The previous implementation
was able to use the added “x IS NOT NULL” condition as an extra
predicate proof condition, but in this version we rely entirely on
indexes that are considered usable by the main planning process.
That seems a fair tradeoff for the simplicity and functionality
– Use appendStringInfoString() where appropriate in elog.c. The
nominally equivalent call appendStringInfo(buf, “%s”, str) can be
significantly slower when str is large. In particular, the former
usage in EVALUATE_MESSAGE led to O(N2) behavior when collecting a
large number of context lines, as I found out while testing
recursive functions. The other changes are just neatnik-ism and
seem unlikely to save anything meaningful, but a cycle shaved is a
– Allow moddatetime’s target column to be of type timestamptz. Dirk
– Include the current value of max_stack_depth in stack depth
complaints. I’m mainly interested in finding out what it is on
buildfarm machines, but including the active value in the message
seems like good practice in any case. Add the info to the HINT, not
the ERROR string, so as not to change the regression tests’ expected
– Make get_stack_depth_rlimit() handle RLIM_INFINITY more sanely.
Rather than considering this result as meaning “unknown”, report
LONG_MAX. This won’t change what superusers can set max_stack_depth
to, but it will cause InitializeGUCOptions() to set the built-in
default to 2MB not 100kB. The latter seems like a fairly
unreasonable interpretation of “infinity”. Per my investigation of
odd buildfarm results as well as an old complaint from Heikki.
Since this should persuade all the buildfarm animals to use a
reasonable stack depth setting during “make check”, revert previous
patch that dumbed down a recursive regression test to only 5 levels.
– Add support for detecting register-stack overrun on IA64. Per
recent investigation, the register stack can grow faster than the
regular stack depending on compiler and choice of options. To avoid
crashes we must check both stacks in check_stack_depth().
Back-patch to all supported versions.
– 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.
– 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.
Michael Meskes pushed:
– Some cleanup in ecpg code: Use bool as type for booleans instead of
int. Do not implicitely cast size_t to int. Make the compiler stop
complaining about unused variables by adding an empty statement.
Peter Eisentraut pushed:
– Print a make warning when using GNU make older than 3.80. A
proposed patch will require GNU make 3.80 or newer. We will let
this patch run for a while to see how much damage that would do to
== Rejected Patches (for now) ==
No one was disappointed this week 🙂
== Pending Patches ==
Andres Freund sent in two more patches to make COPY more efficient by
creating and using custom integer-to-string conversion routines.
Alex Hunsaker sent in two patches to fix the way PL/Tcl handles
trigger functions analogous to the fix for PL/Perl.
Hitoshi Harada sent in a patch to change sort states to plan states in
some parts of the explain and the executor.
Dimitri Fontaine and Alvaro Herrera traded several revisions of the
patch to add ALTER OBJECT … SET SCHEMA for the objects where this is
not already doable.
Dimitri Fontaine sent a patch to add execute_from_file().
Peter Eisentraut sent in a patch intended to improve support for
Dimitri Fontaine sent in a patch to add pg_dump support for
Alex Hunsaker sent in a patch to fix the way PL/Python handles trigger
functions similar to how he fixed PL/Perl and PL/Tcl.
ITAGAKI Takahiro sent in a patch to change boolean==true to boolean in
the source code.
Alexander Korotkov and Yeb Havinga traded patches to fix the picksplit
function in the seg contrib module.
KaiGai Kohei sent in a contrib module to allow delaying auth.
Fujii Masao sent in a patch to allow tracking the most recently
Marti Raudsepp sent in a patch to revert wal_sync_method to fdatasync
on Linux 2.6.33 or higher because the setting changed as of that
Alvaro Herrera sent in a patch to better document the now-less-dusty
CREATE CONSTRAINT TRIGGER syntax.
Hitoshi Harada sent in a patch to allow sharing the result data of a
separate plan in a single execution. This is infrastructure for
Tom Lane sent in a patch to fix an issue with how UNION ALL was
Gurjeet Singh sent in a patch to allow ALTER TABLE to point to a
UNIQUE index which would then become a constraint, for example, a
PRIMARY KEY constraint.
Comments are closed.