== PostgreSQL Weekly News - June 15 2014 ==

From: David Fetter <david(at)fetter(dot)org>
To: PostgreSQL Announce <pgsql-announce(at)postgresql(dot)org>
Subject: == PostgreSQL Weekly News - June 15 2014 ==
Date: 2014-06-16 02:49:45
Message-ID: 20140616024945.GB29714@fetter.org
Views: Raw Message | Whole Thread | Download mbox
Lists: pgsql-announce

== PostgreSQL Weekly News - June 15 2014 ==

PgDay Portland, Oregon 2014 will be held Saturday September 6, 2014.

== PostgreSQL Jobs for June ==


== PostgreSQL Local ==

The first Swiss Postgres Conference will be on June 24th, 2014 at the
HSR Hochschule für Technik Rapperswil.

Char(14) and PGday UK will be held July 8 and 9, 2014.

The sixth PGDay Cubano be held on 13 and 14 October 2014 in Habana.

Postgres Open 2014 will be in Chicago, IL, USA, September 17-19. The
CfP is open!

PostgreSQL Conference Europe 2014 will be held on October 21-24 in
Madrid, Spain, at the Hotel Miguel Angel.

== 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 david(at)fetter(dot)org, German language
to pwn(at)pgug(dot)de, Italian language to pwn(at)itpug(dot)org(dot) Spanish language
to pwn(at)arpug(dot)com(dot)ar(dot)

== Applied Patches ==

Alvaro Herrera pushed:

- Wrap multixact/members correctly during extension, take 2. In
a50d97625497b7 I already changed this, but got it wrong for the case
where the number of members is larger than the number of entries
that fit in the last page of the last segment. As reported by Serge
Negodyuck in a followup to bug #8673.

- Fix typos

Tom Lane pushed:

- Fix infinite loop when splitting inner tuples in SPGiST text
indexes. Previously, the code used a node label of zero both for
strings that contain no bytes beyond the inner tuple's prefix, and
for cases where an "allTheSame" inner tuple has to be split to allow
a string with a different next byte to be inserted into it. Failing
to distinguish these cases meant that if a string ending with the
current prefix needed to be inserted into an allTheSame tuple, we
got into an infinite loop, because after splitting the tuple we'd
descend into the child allTheSame tuple and then find we need to
split again. To fix, instead use -1 and -2 as the node labels for
these two cases. This requires widening the node label type from
"char" to int2, but fortunately SPGiST stores all pass-by-value node
label types in their Datum representation, which means that this
change is transparently upward compatible so far as the on-disk
representation goes. We continue to recognize zero as a dummy node
label for reading purposes, but will not attempt to push new index
entries down into such a label, so that the loop won't occur even
when dealing with an existing index. Per report from Teodor Sigaev.
Back-patch to 9.2 where the faulty code was introduced.

- Forward-port regression test for bug #10587 into 9.3 and HEAD.
Although this bug is already fixed in post-9.2 branches, the case
triggering it is quite different from what was under consideration
at the time. It seems worth memorializing this example in HEAD just
to make sure it doesn't get broken again in future. Extracted from
commit 187ae17300776f48b2bd9d0737923b1bf70f606e.

- Stamp HEAD as 9.5devel. Let the hacking begin ...

- Stamp shared-library minor version numbers for 9.5.

- Fix ancient encoding error in hungarian.stop. When we grabbed this
file off the Snowball project's website, we mistakenly supposed that
it was in LATIN1 encoding, but evidently it was actually in LATIN2.
This resulted in ő (o-double-acute, U+0151, which is code 0xF5 in
LATIN2) being misconverted into õ (o-tilde, U+00F5), as complained
of in bug #10589 from Zoltán Sörös. We'd have messed up
u-double-acute too, but there aren't any of those in the file.
Other characters used in the file have the same codes in LATIN1 and
LATIN2, which no doubt helped hide the problem for so long. The
error is not only ours: the Snowball project also was confused about
which encoding is required for Hungarian. But dealing with that
will require source-code changes that I'm not at all sure we'll wish
to back-patch. Fixing the stopword file seems reasonably safe to
back-patch however.

- Remove unnecessary output expressions from unflattened subqueries.
If a sub-select-in-FROM gets flattened into the upper query, then we
naturally get rid of any output columns that are defined in the
sub-select text but not actually used in the upper query. However,
this doesn't happen when it's not possible to flatten the subquery,
for example because it contains GROUP BY, LIMIT, etc. Allowing the
subquery to compute useless output columns is often fairly harmless,
but sometimes it has significant performance cost: the unused output
might be an expensive expression, or it might be a Var from a
relation that we could remove entirely (via the join-removal logic)
if only we realized that we didn't really need that Var. Situations
like this are common when expanding views, so it seems worth taking
the trouble to detect and remove unused outputs. Because the upper
query's Var numbering for subquery references depends on positions
in the subquery targetlist, we don't want to renumber the items we
leave behind. Instead, we can implement "removal" by replacing the
unwanted expressions with simple NULL constants. This wastes a few
cycles at runtime, but not enough to justify more work in the

- Rename lo_create(oid, bytea) to lo_from_bytea(). The previous
naming broke the query that libpq's lo_initialize() uses to collect
the OIDs of the server-side functions it requires, because that
query effectively assumes that there is only one function named
lo_create in the pg_catalog schema (and likewise only one lo_open,
etc). While we should certainly make libpq more robust about this,
the naive query will remain in use in the field for the foreseeable
future, so it seems the only workable choice is to use a different
name for the new function. lo_from_bytea() won a small straw poll.
Back-patch into 9.4 where the new function was introduced.

- Add regression test to prevent future breakage of legacy query in
libpq. Memorialize the expected output of the query that libpq has
been using for many years to get the OIDs of large-object support
functions. Although we really ought to change the way libpq does
this, we must expect that this query will remain in use in the field
for the foreseeable future, so until we're ready to break
compatibility with old libpq versions we'd better check the results
stay the same. See the recent lo_create() fiasco.

- Remove inadvertent copyright violation in largeobject regression
test. Robert Frost is no longer with us, but his copyrights still
are, so let's stop using "Stopping by Woods on a Snowy Evening" as
test data before somebody decides to sue us. Wordsworth is more
safely dead.

- Preserve exposed type of subquery outputs when substituting NULLs.
I thought I could get away with hardcoded int4 here, but the
buildfarm says differently.

- Adjust largeobject regression test to leave a couple of LOs behind.
Since we commonly test pg_dump/pg_restore by seeing whether they can
dump and restore the regression test database, it behooves us to
include some large objects in that test scenario. I tried to
include a comment on one of these large objects to improve the test
scenario further ... but it turns out that pg_upgrade fails to
preserve comments on large objects, and its regression test notices
the discrepancy. So uncommenting that COMMENT is a TODO for later.

- Improve tuplestore's error messages for I/O failures. We should
report the errno when we get a failure from functions like
BufFileWrite. "ERROR: write failed" is unreasonably taciturn for a
case that's well within the realm of possibility; I've seen it a
couple times in the buildfarm recently, in situations that were
probably out-of-disk-space, but it'd be good to see the errno to
confirm it. I think this code was originally written without
assuming that the buffile.c functions would return useful errno; but
most other callers *are* assuming that, and a quick look at the
buffile code gives no reason to suppose otherwise. Also, a couple
of the old messages were phrased on the assumption that a short read
might indicate a logic bug in tuplestore itself; but that code's
pretty well tested by now, so a filesystem-level problem seems much
more likely.

- Fix pg_restore's processing of old-style BLOB COMMENTS data. Prior
to 9.0, pg_dump handled comments on large objects by dumping a bunch
of COMMENT commands into a single BLOB COMMENTS archive object.
With sufficiently many such comments, some of the commands would
likely get split across bufferloads when restoring, causing failures
in direct-to-database restores (though no problem would be evident
in text output). This is the same type of issue we have with table
data dumped as INSERT commands, and it can be fixed in the same way,
by using a mini SQL lexer to figure out where the command boundaries
are. Fortunately, the COMMENT commands are no more complex to lex
than INSERTs, so we can just re-use the existing lexer for INSERTs.
Per bug #10611 from Jacek Zalewski. Back-patch to all active

- Improve predtest.c's ability to reason about operator expressions.
We have for a long time been able to prove implications and
refutations between clauses structured like "expr op const" with the
same subexpression and btree-related operators; for example that "x
< 4" implies "x <= 5". The implication machinery is needed to
detect usability of partial indexes, and the refutation machinery is
needed to implement constraint exclusion. This patch extends that
machinery to make proofs for operator expressions involving the same
two immutable-but-not-necessarily-just-Const input expressions, ie
does "expr1 op1 expr2" prove or refute "expr1 op2 expr2" or "expr2
op2 expr1"? An important example is that we can now prove "x = y"
given "y = x", which formerly the code could not deduce unless x or
y was a constant. We can make use of the system's knowledge of
operator commutator and negator pairs, and can also make use of
btree opclass relationships, for example "x < y" implies "x <= y"
and refutes "x > y" (notice that neither of these could be proven
just from commutator or negator links). Inspired by a gripe from
Brian Dunavant. This seems more like a new feature than a bug fix,
though, so no back-patch.

Fujii Masao pushed:

- Fix typos in comments.

Noah Misch pushed:

- Consistently define BUILDING_DLL during builds of src/port for
Windows. The MSVC build process already did so; this fixes the
principal build process to match. Both processes already did
likewise for src/common. This lets server builds of src/port
reference postgres.exe data symbols.

- Fix typos in comments.

- Have configuration templates augment, not replace, LDFLAGS. This
preserves user-specified LDFLAGS; we already kept user-specified
CFLAGS and CPPFLAGS. Given the shortage of complaints and the fact
that any problem caused is likely to appear at build time, no
back-patch. Dag-Erling Smørgrav and Noah Misch

- Harden pg_filenode_relation test against concurrent DROP TABLE. Per
buildfarm member prairiedog. Back-patch to 9.4, where the test was
introduced. Reviewed by Tom Lane.

- Adjust 9.4 release notes. Back-patch to 9.4.

- emacs.samples: Reliably override ".dir-locals.el". Back-patch to
9.4, where .dir-locals.el was introduced.

- Add mkdtemp() to libpgport. This function is pervasive on free
software operating systems; import NetBSD's implementation.
Back-patch to 8.4, like the commit that will harness it.

Andres Freund pushed:

- Consistency improvements for slot and decoding code. Change the
order of checks in similar functions to be the same; remove a
parameter that's not needed anymore; rename a memory context and
expand a couple of comments. Per review comments from Amit Kapila

Heikki Linnakangas pushed:

- Change the signature of rm_desc so that it's passed a XLogRecord.
Just feels more natural, and is more consistent with rm_redo.

== Rejected Patches (for now) ==

No one was disappointed this week :-)

== Pending Patches ==

Ian Lawrence Barwick sent in a patch to add RETURNING PRIMARY KEY
syntax for DML.

MauMau sent in two revisions of a patch to fix a memory leak in

Furuya Osamu sent in another revision of a patch to add a synchronous
mode to pg_receivexlog.

Gurjeet Singh sent in two revisions of a patch to add a GUC to control
a child backend's oom_score_adj.

Heikki Linnakangas sent in a patch to invent a new internal API for
interfacing with SSL, which allows a non-OpenSSL implementation, and
another patch to implement same with Windows SChannel.

Fabrízio de Royes Mello sent in a patch to implement ALTER TABLE ...

Sergey Muraviov sent in another revision of a patch to fix wrapping in
extended mode in the default pager for psql.

Fujii Masao sent in a patch to add a log_replication_command GUC,
which causes replication commands to be logged.

David Johnston sent in a doc patch for setting configuration

Christoph Berg sent in a patch to fix some lacunae in DSM.

SAWADA Masahiko sent in a patch to add line number as prompt option to

Noah Misch sent in a patch to fix an issue which arises when
conflicting LDAP libraries have been loaded.

Jaime Casanova sent in a patch to move the reloptions of views into
its own structure.

Noah Misch sent in a patch to add a check for that mapping relation
oids to filenodes and back is done correctly.

Amit Kapila sent in another revision of a patch to prohibit ALTER
SYSTEM from setting the data directory, which could result in a
recursive definition.

Kyotaro HORIGUCHI sent in a patch to make PG to use index for longer
pathkeys than index columns when all of the following conditions hold:
the index is a unique index; all index columns are NOT NULL, and the
index column list is a subset of query_pathkeys.

Michael Paquier sent in a patch to add a buffer capture facility to
check the consistency of WAL replay.

Abhijit Menon-Sen sent in a patch to introduce a function

Heikki Linnakangas sent in another revision of a patch to implement
CSN-based snapshots.

Kyotaro HORIGUCHI sent in a patch to add the function to clear backup
location information to pg_resetxlog.

Rahila Syed sent in a patch to do compression of full-page writes in
the WAL using the pglz, lz4 and snappy algorithms.

Quan Zongliang sent in a patch to extend PL/pgSQL to define multi
variables once, assigning only the last if an assignment is included.

Fujii Masao sent in a patch to make log_disconnections PGC_SUSET
rather than PGC_BACKEND.

Alvaro Herrera sent in a patch to enable replicating DROP commands
across servers in logical replication.

Alvaro Herrera sent in a patch to make ALTER TABLESPACE MOVE a
separate command tag.

Petr (PJMODOS) Jelinek sent in a patch to implement a function called
varwidth_bucket which does binning with variable bucket width.

Petr (PJMODOS) Jelinek sent in a patch to make it possible to change
the system identifier of the cluster in pg_control.

Kaigai Kouhei sent in another revision of a patch to implement a
custom plan API.

Alvaro Herrera sent in another revision of a patch to add CREATE
support to event triggers.

Gurjeet Singh sent in another revision of a patch to implement

Heikki Linnakangas sent in two more revisions of a patch to change the
WAL format and API.

Alvaro Herrera sent in a patch to fix a crash which happens when
assertions are disabled and WAL_DEBUG turned on.

Alvaro Herrera sent in another revision of a patch to implement
min_max indexes.

Kevin Grittner sent in a patch to add delta relations in AFTER

Browse pgsql-announce by date

  From Date Subject
Next Message Howard Rolph 2014-06-18 12:30:53 CHAR(14)
Previous Message David Fetter 2014-06-09 04:41:44 == PostgreSQL Weekly News - June 08 2014 ==