PostgreSQL Weekly News – November 14 2010

== PostgreSQL Weekly News – November 14 2010 ==

The Commitfest for November 15 through December 15 is beginning.
Start reviewing those patches!

Think reviewing patches is too complex? Think again! You can help!

The PostgreSQLFr Call for Projects has begun. Projects must target
PostgreSQL and the French-speaking community. Mail appel-projets-2010
AT postgresql DOT fr.

HTSQL, a high-level database query language for relational databases
with support for PostgreSQL, released.

New Survey: Which PostgreSQL Event are you most likely to go to in
the next 6 months?

Robert Treat is looking for PostgreSQL users and users-to-be in the
New Orleans area. Contact him at rob AT xzilla DOT net.

PGCon will be May 19-20, 2011 at the University of Ottawa, preceded by
two days of tutorials on May 17-18.

Early bird registration for PGDay.IT, December 10, 2010 in Rome,
Italy, is open and the schedule is online.

== PostgreSQL Product News ==

The open-source Dubsar Dictionary Project, which uses PostgreSQL, has

psycopg2 2.3.0 beta 1, a Python connector for PostgreSQL, released.

PostgreSQL 9.0 RPMs for RHEL 6 and Fedora 14 released.

Skytools 2.1.12, a Python-based replication system, released.

The Skytools source code repository is now at:;a=summary

== PostgreSQL Jobs for November ==

== PostgreSQL Local ==

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
November 6th.

Registration for PGDay.EU 2010 held on December 6-8 in Stuttgart,
Germany is open.

Early bird registration for PGDay.IT, December 10, 2010 in Rome,
Italy, is open and the schedule is online.

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.

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:

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, German language
to, Italian language to Spanish language

== Reviews ==

== Applied Patches ==

Tom Lane pushed:

- Use appendrel planning logic for top-level UNION ALL structures.
Formerly, we could convert a UNION ALL structure inside a
subquery-in-FROM into an appendrel, as a side effect of pulling up
the subquery into its parent; but top-level UNION ALL always caused
use of plan_set_operations(). That didn’t matter too much because
you got an Append-based plan either way. However, now that the
appendrel code can do things with MergeAppend, it’s worthwhile to
hack up the top-level case so it also uses appendrels. This is a
bit of a stopgap; but going much further than this will require a
major rewrite of the planner’s set-operations support, which I’m not
prepared to undertake now. For the moment let’s grab the
low-hanging fruit.;a=commitdiff;h=947d0c862c895618a874344322e7b07c9df05cb2

- Fix error handling in temp-file deletion with log_temp_files active.
The original coding in FileClose() reset the file-is-temp flag
before unlinking the file, so that if control came back through due
to an error, it wouldn’t try to unlink the file twice. This was
correct when written, but when the log_temp_files feature was added,
the logging action was put in between those two steps. An error
occurring during the logging action — such as a query cancel —
would result in the unlink not getting done at all, as in recent
report from Michael Glaesemann. To fix this, make sure that we do
both the stat and the unlink before doing anything that could
conceivably CHECK_FOR_INTERRUPTS. There is a judgment call here,
which is which log message to emit first: if you can see only one,
which should it be? I chose to log unlink failure at the risk of
losing the log_temp_files log message — after all, if the unlink
does fail, the temp file is still there for you to see. Back-patch
to all versions that have log_temp_files. The code was OK before

- Repair memory leakage while ANALYZE-ing complex index expressions.
The general design of memory management in Postgres is that
intermediate results computed by an expression are not freed until
the end of the tuple cycle. For expression indexes, ANALYZE has to
re-evaluate each expression for each of its sample rows, and it
wasn’t bothering to free intermediate results until the end of
processing of that index. This could lead to very substantial
leakage if the intermediate results were large, as in a recent
example from Jakub Ouhrabka. Fix by doing ResetExprContext for each
sample row. This necessitates adding a datumCopy step to ensure
that the final expression value isn’t recycled too. Some quick
testing suggests that this change adds at worst about 10% to the
time needed to analyze a table with an expression index; which is
annoying, but seems a tolerable price to pay to avoid unexpected
out-of-memory problems. Back-patch to all supported branches.;a=commitdiff;h=80fb2c1f4037d10cc259aee95558bca4a5fe4c30

- Improve pg_ctl’s man page. Explicitly document that the -o options
of pg_ctl init mode are meant for initdb, not postgres (Euler
Taveira de Oliveira). Assorted other copy-editing (Tom).;a=commitdiff;h=0de92fd13cc436c76fbbd4759c94e2d3623a6bf1

- Fix line_construct_pm() for the case of “infinite” (DBL_MAX) slope.
This code was just plain wrong: what you got was not a line through
the given point but a line almost indistinguishable from the Y-axis,
although not truly vertical. The only caller that tries to use this
function with m == DBL_MAX is dist_ps_internal for the case where
the lseg is horizontal; it would end up producing the distance from
the given point to the place where the lseg’s line crosses the
Y-axis. That function is used by other operators too, so there are
several operators that could compute wrong distances from a line
segment to something else. Per bug #5745 from jindiax. Back-patch
to all supported branches.;a=commitdiff;h=b0f2d681bdfd6a5b3e90d092f9d924f943b4fc5f

- Fix old oversight in const-simplification of COALESCE() expressions.
Once we have found a non-null constant argument, there is no need to
examine additional arguments of the COALESCE. The previous coding
got it right only if the constant was in the first argument
position; otherwise it tried to simplify following arguments too,
leading to unexpected behavior like this:
regression=# select coalesce(f1, 42, 1/0) from int4_tbl;
ERROR: division by zero
It’s a minor corner case, but a bug is a bug, so back-patch all the

- Add missing outfuncs.c support for struct InhRelation. This is
needed to support debug_print_parse, per report from Jon Nelson.
Cursory testing via the regression tests suggests we aren’t missing
anything else.;a=commitdiff;h=2138c701a397885d4f360c90bf8b95d0d98aecd0

- Work around make 3.80 bug with long expansions of $(eval). 3.80
breaks if the expansion of $(eval) is long enough to require
expansion of its internal variable_buffer. For the purposes of
$(recurse) that means it’ll work so long as no single evaluation of
_create_recursive_target produces more than 195 bytes. We can
manage that by looping over subdirectories outside the call instead
of complicating the generated rule. This coding is simpler and more
readable anyway. Or at least, this works for me. We’ll see if the
buildfarm likes it.;a=commitdiff;h=1bd201214965b3eba23bee2c4ce4c14accde170f

- Fix canAcceptConnections() bugs introduced by replication-related
patches. We must not return any “okay to proceed” result code
without having checked for too many children, else we might fail
later on when trying to add the new child to one of the per-child
state arrays. It’s not clear whether this oversight explains Stefan
Kaltenbrunner’s recent report, but it could certainly produce a
similar symptom. Back-patch to 8.4; the logic was not broken before

- Adjust comments about what’s needed to avoid make 3.80 bug. …
based on further tracing through that code.;a=commitdiff;h=357edc9a9952582c510cff1b08ebc5fd8df81a3b

Alvaro Herrera pushed:

- Fix permanent memory leak in autovacuum launcher. get_database_list
was uselessly allocating its output data, along some created along
the way, in a permanent memory context. This didn’t matter when
autovacuum was a single, short-lived process, but now that the
launcher is permanent, it shows up as a permanent leak. To fix,
make get_database list allocate its output data in the caller’s
context, which is in charge of freeing it when appropriate; and the
memory leaked by heap_beginscan et al is allocated in a throwaway
transaction context.;a=commitdiff;h=854ae8c3a6bab2053f8bdbc453787be878ce8c81

- plpython has plpy.Error instead of plpy.ERROR. Author: Marti
Raudsepp <>;a=commitdiff;h=73bc5218df0330a4beb737f497fa8d7b337c9f90

- Merge docs for CREATE CONSTRAINT TRIGGER and CREATE TRIGGER;a=commitdiff;h=b47953f9c69d48a9261bd643e3170017b93f6337

Heikki Linnakangas pushed:

- In rewriteheap.c (used by VACUUM FULL and CLUSTER), calculate the
tuple length stored in the line pointer the same way it’s calculated
in the normal heap_insert() codepath. As noted by Jeff Davis, the
length stored by raw_heap_insert() included padding but the one
stored by the normal codepath did not. While the mismatch seems to
be harmless, inconsistency isn’t good, and the normal codepath has
received a lot more testing over the years. Backpatch to 8.3 where
the heap rewrite code was introduced.;a=commitdiff;h=000efc3dfdf425136ef9564e86d1800cbe584e75

- Fix bug introduced by the recent patch to check that the checkpoint
redo location read from backup label file can be found: wasShutdown
was set incorrectly when a backup label file was found. Jeff Davis,
with a little tweaking by me.;a=commitdiff;h=542bdb2146327972545630d0a428e1c9367266cb

- Add missing support for removing foreign data wrapper / server
privileges belonging to a user at DROP OWNED BY. Foreign data
wrappers and servers don’t do anything useful yet, which is why
no-one has noticed, but since we have them, seems prudent to fix
this. Per report from Chetan Suttraway. Backpatch to 9.0, 8.4 has
the same problem but this patch didn’t apply there so I’m not going
to bother.;a=commitdiff;h=e356743f3ed45c36dcc4d0dbf6c1e8751b3d70b5

ITAGAKI Takahiro pushed:

- Don’t use __declspec (dllimport) for PGDLLEXPORT to reduce warnings
by gcc version 4 on mingw and cygwin. We don’t use dllexport here
because dllexport and dllwrap don’t work well together.;a=commitdiff;h=844ed5dc97d4374a4056f0f1cc3b0b78347c74c5

Robert Haas pushed:

- Add monitoring function pg_last_xact_replay_timestamp. Fujii Masao,
with a little wordsmithing by me.;a=commitdiff;h=7ba6e4f0e08bd7bdf4d12974ac1e37fb0459c97c

- Move copydir() prototype into its own header file. Having this in
src/include/port.h makes no sense, now that copydir.c lives in
src/backend/strorage rather than src/port. Along the way, remove an
obsolete comment from contrib/pg_upgrade that makes reference to the
old location.;a=commitdiff;h=11e482c350c431fb2f51c6ceb847e5e31ea38911

- Cleanup various comparisons with the constant “true”. Itagaki
Takahiro, with slight modifications.;a=commitdiff;h=5aa446c961a6fdf15ff9c398751efd6ecff0c64a

- Fix bug in cube picksplit algorithm. Alexander Korotkov.;a=commitdiff;h=4fa0a23c70cc346011a3dd8ea902f8d1668644b0

- Correct poor grammar in comment.;a=commitdiff;h=5ccbc3d802d1690b78f887b2310d2a7258eaae94

Bruce Momjian pushed:

- Mention that pg_upgrade requires compatible 32/64-bit binaries.;a=commitdiff;h=8f742d1cdab987ba4624ad0c6aa008ced15cd87c

Peter Eisentraut pushed:

- Improved parallel make support Replace for loops in makefiles with
proper dependencies. Parallel make can now span across directories.
Also, make -k and make -q work properly. GNU make 3.80 or newer is
now required.;a=commitdiff;h=19e231bbdaef792dce22100012b504e2fb72f971

- docs -> documentation;a=commitdiff;h=d6754f67b08ad6a05640fc5d9d97c6f225512ea0

Andrew Dunstan pushed:

- Attempt to fix MSVC builds broken by parallel make changes.;a=commitdiff;h=52e2c12288cdcdcaa46a18937cc051d3322bbc99

== Rejected Patches (for now) ==

No one was disappointed this week :-)

== Pending Patches ==

Shigeru HANADA sent in two more revisions of the patch for SQL/MED.

Heikki Linnakangas sent in two WIP patches to fix some misbehavior in
the interaction between GIN and GiST index splits, and checkpoints.

KaiGai Kohei sent in two revisions of a patch to add security hooks on
object creation.

Peter Eisentraut sent in a patch to add [RESTRICT|CASCADE] to ALTER
TYPE … ADD/ALTER/DROP/RENAME ATTRIBUTE, so that recurses to typed

Bruce Momjian sent in a patch to fix an issue where PostgreSQL appears
stopped when it is actually running.

Bruce Momjian sent in a patch to correct some error messages for
connections to PostgreSQL over ipv6 in libpq.

KaiGai Kohei sent in a patch to allow the security label provider to
switch security label of the client during execution of certain

Robert Haas sent in a set of three patches intended to be
infrastructure for unlogged tables.

Jan Urbanski sent in a patch to fix a bug in plpython’s Python

Greg Smith sent in a rebased and corrected version of the MERGE patch.

Marko (johto) Tiikkaja sent in another revision of the patch to add
writeable CTEs, this time using single-snapshot isolation per

Greg Smith sent in a patch which adds some logging for each individual
fsync call made during a checkpoint, along with a summary at the end.

Greg Smith sent in a patch which adds a new field to pg_stat_bgwriter,
counting the number of times backends execute their own fsync calls.

Greg Smith and Simon Riggs wrote and Greg Smith sent in a patch which
spreads out the individual checkpoint fsync calls over time.

ITAGAKI Takahiro sent in a WIP patch to add support for MULTISET

Joachim Wieland sent in a patch to add a new “directory” format to
pg_dump, which is in part infrastructure for parallel pg_dump.

Joachim Wieland sent in a patch based on the above patch which allows
for parallel pg_dump and pg_restore.

Peter Eisentraut sent in another patch to implement per-column

Gregory Stark sent in another revision of the patch to add getrusage
resource tracking to EXPLAIN ANALYZE.

Comments are closed.