Features Download
From: David Fetter <david <at> fetter.org>
Subject: == PostgreSQL Weekly News - March 17 2013 ==
Newsgroups: gmane.comp.db.postgresql.announce
Date: Monday 18th March 2013 06:52:06 UTC (over 3 years ago)
== PostgreSQL Weekly News - March 17 2013 ==

Save The Date!
Postgres Open 2013 will be in Chicago, IL, USA, September 16-18.
    Hotel Sax:
    Early Bird registration:

== PostgreSQL Product News ==

E-Maj 1.0.2 released. E-Maj is a PostgreSQL extension that offers the
capability to log updates performed on one or several sets of tables,
and cancel these updates if needed, resettting the table set to a
predefined stable state.

== PostgreSQL Jobs for March ==


== PostgreSQL Local ==

PGDay NYC 2013 will be held on March 22, 2013 in New York City.

PG Day France is the major French-speaking PostgreSQL community event.
The deadline for sending proposals is Saturday, March 24, 2013 at
23:59 CEST.

PostgreSQL Session will be held on March 28th, 2013 in Paris,
France.  The Call for Papers is open.

PGCon 2013 will be held May 23-24 2013, in Ottawa at the University of

The 6th annual "Prague PostgreSQL Developers Day" conference,
organized by CSPUG (Czech and Slovak PostgreSQL Users Group), will be
held on May 30, 2013 at Faculty of Mathematics and Physics, Charles
University (Malostranske namesti 25, Prague).  The CfP is open until
April 14, 2013 .  More information in Czech is at

The Call for Papers for PostgreSQL Brazil, to be held August 15-17,
2013 in Porto Velho, RO, Brazil, is open.  Proposals are due by March
15, 2013.

== 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 [email protected], German language
to [email protected], Italian language to [email protected]  Spanish language
to [email protected]

== Applied Patches ==

Tom Lane pushed:

- Fix thinko in matview patch.  "break" instead of "continue"
  suppressed view expansion for views appearing later in the range
  table.  Per report from Erikjan Rijkers.  While at it, improve the
  associated comment a bit.

- Avoid generating bad remote SQL for INSERT ... DEFAULT VALUES.
  "INSERT INTO foo() VALUES ()" is invalid syntax, so don't do that.

- Fix postgres_fdw's issues with inconsistent interpretation of data
  values.  For datatypes whose output formatting depends on one or
  more GUC settings, we have to worry about whether the other server
  will interpret the value the same way it was meant.  pg_dump has
  been aware of this hazard for a long time, but postgres_fdw needs to
  deal with it too.  To fix data retrieval from the remote server, set
  the necessary remote GUC settings at connection startup.  (We were
  already assuming that settings made then would persist throughout
  the remote session.)  To fix data transmission to the remote server,
  temporarily force the relevant GUCs to the right values when we're
  about to convert any data values to text for transmission.  This is
  all pretty grotty, and not very cheap either.  It's tempting to
  think of defining one uber-GUC that would override any settings that
  might render printed data values unportable.  But of course, older
  remote servers wouldn't know any such thing and would still need
  this logic.  While at it, revert commit
  f7951eef89be78c50ea2241f593d76dfefe176c9, since this provides a real
  fix.  (The timestamptz given in the error message returned from the
  "remote" server will now reliably be shown in UTC.)

- Avoid row-processing-order dependency in postgres_fdw regression
  test.  A test intended to provoke an error on the remote side was
  coded in such a way that multiple rows should be updated, so the
  output would vary depending on which one was processed first.  Per

- Allow default expressions to be attached to columns of foreign
  tables.  There's still some discussion about exactly how
  postgres_fdw ought to handle this case, but there seems no debate
  that we want to allow defaults to be used for inserts into foreign
  tables.  So remove the core-code restrictions that prevented it.
  While at it, get rid of the special grammar productions for CREATE
  FOREIGN TABLE, and instead add explicit FEATURE_NOT_SUPPORTED error
  checks for the disallowed cases.  This makes the grammar a shade
  smaller, and more importantly results in much more intelligible
  error messages for unsupported cases.  It's also one less thing to
  fix if we ever start supporting constraints on foreign tables.

- Fix contrib/postgres_fdw's handling of column defaults.  Adopt the
  position that only locally-defined defaults matter.  Any defaults
  defined in the remote database do not affect insertions performed
  through a foreign table (unless they are for columns not known to
  the foreign table).  While it'd arguably be more useful to permit
  remote defaults to be used, making that work in a consistent fashion
  requires far more work than seems possible for 9.3.

- Fix documentation oversight.  Mention that PlanForeignModify's
  result must be copiable by copyObject.

- Introduce less-bogus handling of collations in contrib/postgres_fdw.
  Treat expressions as being remotely executable only if all
  collations used in them are determined by Vars of the foreign table.
  This means that, if the foreign server gets different answers than
  we do, it's the user's fault for not having marked the foreign table
  columns with collations equivalent to the remote table's.  This rule
  allows most simple expressions such as "var < 'constant'" to be sent
  to the remote side, because the constant isn't determining the
  collation (the Var's collation would win).  There's still room for
  improvement, but it's hard to see how to do it without a lot more
  knowledge and/or assumptions about what the remote side will do.

- Avoid inserting Result nodes that only compute identity projections.
  The planner sometimes inserts Result nodes to perform column
  projections (ie, arbitrary scalar calculations) above plan nodes
  that lack projection logic of their own.  However, we did that even
  if the lower plan node was in fact producing the required column set
  already; which is a pretty common case given the popularity of
  "SELECT * FROM ...".  Measurements show that the useless plan node
  adds non-negligible overhead, especially when there are many columns
  in the result.  So add a check to avoid inserting a Result node
  unless there's something useful for it to do.  There are a couple of
  remaining places where unnecessary Result nodes could get inserted,
  but they are (a) much less performance-critical, and (b) coded in
  such a way that it's hard to avoid inserting a Result, because the
  desired tlist is changed on-the-fly in subsequent logic.  We'll
  leave those alone for now.  Kyotaro Horiguchi; reviewed and further
  hacked on by Amit Kapila and Tom Lane.

- Minor fixes for hstore_to_json_loose().  Fix unportable use of
  isdigit(), get rid of useless calculations.

- Avoid inserting no-op Limit plan nodes.  This was discussed in
  connection with the patch to avoid inserting no-op Result nodes, but
  not actually implemented therein.

- Extend format() to handle field width and left/right alignment.
  This change adds some more standard sprintf() functionality to
  format().  Pavel Stehule, reviewed by Dean Rasheed and Kyotaro

- Improve error reporting in code that checks for buffer refcount
  leaks.  Formerly we just Assert'ed that each refcount was zero,
  which was quick and easy but failed to provide a good overview of
  what was wrong.  Change the code so that we'll call
  PrintBufferLeakWarning() for each buffer with a nonzero refcount,
  and then Assert at the end of the loop.  This costs nothing in
  runtime and might ease diagnosis of some bugs.  Greg Smith, reviewed
  by Satoshi Nagayasu, further tweaked by me

- Improve the documentation about commit_delay.  Clarify the docs
  explaining what commit_delay does, and add a recommendation about a
  useful value for it, namely half of the single-page fsync time
  reported by pg_test_fsync.  This is informed by testing of the
  new-in-9.3 implementation of commit_delay; in prior versions it was
  far harder to arrive at a useful setting.  In passing, do some
  wordsmithing and markup-fixing in the same general area.  Also,
  change pg_test_fsync's default time-per-test from 2 seconds to 5.
  The old value was about the minimum at which the results could be
  taken seriously at all, and so seems a tad optimistic as a default.
  Peter Geoghegan, reviewed by Noah Misch; some additional editing by

- Add lock_timeout configuration parameter.  This GUC allows limiting
  the time spent waiting to acquire any one heavyweight lock.  In
  support of this, improve the recently-added timeout infrastructure
  to permit efficiently enabling or disabling multiple timeouts at
  once.  That reduces the performance hit from turning on
  lock_timeout, though it's still not zero.  Zoltán Böszörményi,
  reviewed by Tom Lane, Stephen Frost, and Hari Babu

- Move pqsignal() to libpgport.  We had two copies of this function in
  the backend and libpq, which was already pretty bogus, but it turns
  out that we need it in some other programs that don't use libpq
  (such as pg_test_fsync).  So put it where it probably should have
  been all along.  The signal-mask-initialization support in
  src/backend/libpq/pqsignal.c stays where it is, though, since we
  only need that in the backend.

- Fix inclusions in pg_receivexlog.c.  Apparently this was depending
  on pqsignal.h for .  Not sure why I didn't see the failure
  on my other machine.

- Fix inclusions in pgbench.c.  Apparently this was depending on
  pqsignal.h for .  Not sure why I didn't see the failure on
  my other machine.

- Re-include pqsignal() in libpq.  We need this in
  non-ENABLE_THREAD_SAFETY builds, and also to satisfy the exports.txt
  entry; while it might be a good idea to remove the latter, I'm
  hesitant to do so except in the context of an intentional ABI break.
  At least we don't have a separately maintained source file for it

- initdb needs pqsignal() even on Windows.  I had thought we weren't
  using this version of pqsignal() at all on Windows, but that's wrong
  --- initdb is using it (and coping with the POSIX-ish semantics of
  bare signal() :-().  So allow the file to be built in WIN32+FRONTEND
  case, and add it to the MSVC build logic.

- Use pqsignal() in contrib programs rather than calling signal(2)
  directly.  The semantics of signal(2) are more variable than one
  could wish; in particular, on strict-POSIX platforms the signal
  handler will be reset to SIG_DFL when the signal is delivered.  This
  demonstrably breaks pg_test_fsync's use of SIGALRM.  The other
  changes I made are not absolutely necessary today, because the
  called handlers all exit the program anyway.  But it seems like a
  good general practice to use pqsignal() exclusively in Postgres
  code, now that we have it available everywhere.

- Improve signal-handler lockout mechanism in timeout.c.  Rather than
  doing a fairly-expensive setitimer() call to prevent interrupts from
  happening, let's just invent a simple boolean flag that the signal
  handler is required to check.  This is not only faster but
  considerably more robust than before, since the previous code
  effectively assumed that only ITIMER_REAL events would ever fire the
  SIGALRM handler, which is obviously something that can be broken
  easily by third-party code.  Zoltán Böszörményi and Tom Lane

- Increase timeout delays in new timeouts isolation test.  Buildfarm
  member friarbird doesn't like this test as-committed, evidently
  because it's so slow that the test framework doesn't reliably notice
  that the backend is waiting before the timeout goes off.  (This is
  not totally surprising, since friarbird builds with
  -DCLOBBER_CACHE_ALWAYS.) Increase the timeout delay from 1 second to
  2 in hopes of resolving that problem.

Alvaro Herrera pushed:

- Fix orthotypographical mistake.  Apparently I lost some of the edits
  I had done on this page for commit 0ac5ad5134.  Per note from Etsuro
  Fujita, although I didn't use his patch.  Make some of the wording
  in the affected section a bit more complete, too.

Kevin Grittner pushed:

- Fix bug in dumping prior releases due to MV REFRESH dependency
  checking.  Reports and suggested patches from Fujii Masao and Andrew
  Dunstan.  Andrew Dunstan

- Add regression test for MV join to view.  This would have caught a
  bug in the initial patch, and seems like a good thing to test going
  forward.  Per bug report by Erik Rijkers and fix by Tom Lane

- Revert unnecessary change in MV call to checkRuleResultList().  Due
  to a misreading of the function's comment block, there was an
  unneeded change to a call in rewriteDefine.c.  There is, in fact no
  reason to pass false for a MV; it should be true just like a view.
  Fixes issue pointed out by Tom Lane

Peter Eisentraut pushed:

- Add regression tests for XML mapping of domains.  Pavel Stěhule

- pg_controldata: Undo message spelling change

- pg_resetxlog: Capitalize placeholder in --help output

Heikki Linnakangas pushed:

- Add cost estimation of range @> and <@ operators.  The estimates are
  based on the existing lower bound histogram, and a new histogram of
  range lengths.  Bump catversion, because the range length histogram
  now needs to be present in statistic slot kind 6, or you get an
  error on @> and <@ queries. (A re-ANALYZE would be enough to fix
  that, though) Alexander Korotkov, with some refactoring by me.

- Change the way UESCAPE is lexed, to reduce the size of the flex
  tables.  The error rule used to avoid backtracking with the U&'...'
  UESCAPE 'x' syntax bloated the flex tables, so refactor that. This
  patch makes the error rule shorter, by introducing a new exclusive
  flex state that's entered after parsing U&'...'. This shrinks the
  postgres binary by about 220kB.

- Also update psqlscan.l with the UESCAPE error rule changes.  Even
  though this patch had no user-visible difference, better keep the
  code in psqlscan.l sync with the backend lexer. And of course it's
  nice to shrink the psql binary, too. Ecpg's version of the lexer
  doesn't have the error rule, it doesn't try to avoid backing up, so
  it doesn't need to be modified.  As reminded by Tom Lane

Robert Haas pushed:

- Extend object-access hook machinery to support post-alter events.
  This also slightly widens the scope of what we support in terms of
  post-create events.  KaiGai Kohei, with a few changes, mostly to the
  comments, by me

== Rejected Patches (for now) ==

No one was disappointed this week :-)

== Pending Patches ==

robins sent in three revisions of a patch to test sequences in the
regression tests.

Jeff Davis and Ants Aasma traded patches to add page checksums.

Michael Paquier sent in another revision of a patch to overhaul

Amit Kapila sent in another revision of a patch to micro-optimize

Michael Paquier sent in two more revisions of a patch to add REINDEX

Joe Conway sent in a patch to ensure that an extension's tables' data
is only dumped in the extension's absence if named explicitly in

Michael Paquier sent in a patch to fix an assertion failure during
promotion of a replica to master.

Zoltan Boszormenyi and Amit Kapila traded patches to allow
postgresql.conf values to be changed via SQL.

Pavel Stehule sent in a patch to detect orphaned locks.

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

Alvaro Herrera sent in another revision of a patch to add in-catalog
Extension Scripts and Control parameters.

Kevin Grittner sent in two revisions of a patch to fix an assertion
failure in materialized views.

Hadi Moshayedi sent in a patch to improve the performance of NUMERIC's

Marti Raudsepp sent in a patch to fix the fact that version() mixes
host and target architectures in cross-compiles.

Sent via pgsql-announce mailing list ([email protected])
To make changes to your subscription:
CD: 3ms