PostgreSQL Weekly News – June 19 2011

== PostgreSQL Weekly News – June 19 2011 ==

The first Commitfest of the 9.2 cycle has begun. Review a patch!
http://commitfest.postgresql.org/

PostgreSQL 9.1 beta 2 is out. Test!
http://www.postgresql.org/developer/beta

== PostgreSQL Product News ==

pgbouncer 1.4.2, a lightweight connection pooler for PostgreSQL, released.
http://pgfoundry.org/projects/pgbouncer/

== PostgreSQL Jobs for June ==

http://archives.postgresql.org/pgsql-jobs/2011-06/threads.php

== PostgreSQL Local ==

NYCPUG presents “Data Storage at foursqare” June 22, 2011 6:30PM at
Spotify. RSVP and details below.
http://www.nycpug.org/events/21300271/

PG Session 2, on PostGIS, will be held on June 23rd in Paris. The CfP
is open!
http://www.postgresql-sessions.org/en/2/

CHAR(11), the PostgreSQL Conference on Clustering, High Availability
and Replication is now open for online registration and bookings.
July 11-12 2011 in Cambridge, UK.
http://www.char11.org/

PostgreSQL Conference China 2011 will be held in Guangzhou July
15-16, 2011.
http://wiki.postgresql.org/wiki/Pgconchina2011

PDXPUG is hosting PgDay on Sunday, July 24, 2011, one day before
OSCON, in Portland, Oregon, USA. Details here:
http://pugs.postgresql.org/node/1663

Postgres Open 2011, a conference focused on disruption of the database
industry through PostgreSQL, will take place September 14-16, 2011 in
Chicago, Illinois at the Westin Michigan Avenue hotel.
http://postgresopen.org

PG-Day Denver 2011 will be held on Saturday, September 17th, 2011 at
the Auraria Campus near downtown Denver, Colorado.
http://pgday.consistentstate.com/

PostgreSQL Conference West (#PgWest) will be held September 27th-30th,
2011 at the San Jose Convention center in San Jose, California, USA.
http://www.postgresqlconference.org

PostgreSQL Conference Europe 2011 will be held on October 18-21 in
Amsterdam.
http://2011.pgconf.eu/

pgbr will be in Sao Paulo, Brazil November 3-4, 2011.
http://pgbr.postgresql.org.br/

PGConf.DE 2011 is the German-speaking PostgreSQL Conference and will
take place on November 11th in the Rheinisches Industriemuseum in
Oberhausen, Germany. Call for Papers is open.
http://2011.pgconf.de/

== 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@fetter.org, German language
to pwn@pgug.de, Italian language to pwn@itpug.org. Spanish language
to pwn@arpug.com.ar.

== Reviews ==

Robert Haas reviewed KaiGai Kohei’s patch to rework DROP by making
‘missing_ok’ support get_object_address.

== Applied Patches ==

Robert Haas pushed:

– More foreign table documentation improvements. Shigeru Hanada, with
some additional wordsmithing by me
http://git.postgresql.org/pg/commitdiff/43ea23a346cd32d5ae2ca1d465db6f3beb65bf13

– Markup fix. Fujii Masao
http://git.postgresql.org/pg/commitdiff/9052e285b53e26727a28ac376b1418c0202533d1

– In ALTER EXTENSION docs, document left_type/right_type. Noted by
Daniele Varrazzo.
http://git.postgresql.org/pg/commitdiff/d4c7e934dfe1ecb4cb4139e4a5e6bfd88c94df66

– Document GUC context for synchronous_standby_names/hot_standby_feedback.
Fujii Masao.
http://git.postgresql.org/pg/commitdiff/dfe8ec3ab9a39cd50774036632f9f645b567eea3

– Add doc cross-reference to search_path discussion of
current_schemas(). Brendan Jurd
http://git.postgresql.org/pg/commitdiff/2a890421424da5cca4226ee8afd562c356205815

– Clarify that NATURAL without matching columns is like CROSS JOIN.
As suggested by Grzegorz Szpetkowski.
http://git.postgresql.org/pg/commitdiff/6b02ed66e2856abb1d5eef64747badd4fc78cef9

– Remove parentheses from mention of current_schemas function. This
is more consistent with what we do elsewhere, and hopefully avoids
creating the perception that current_schemas takes no arguments. As
suggested by Brendan Jurd
http://git.postgresql.org/pg/commitdiff/2202891669735242a24299f85a788a3aa0461404

– Improve accuracy of ON_ERROR_STOP documentation. Per a gripe from
Tom Lane.
http://git.postgresql.org/pg/commitdiff/c3ad1e8dbd6cf1ff6d29bd2edb2da2c35187e768

– Fix typo. Per Josh Kupershmidt and Tom Lane.
http://git.postgresql.org/pg/commitdiff/d61ec7c7a7ec822862880467a5722ccfb0dd9b82

– Fix minor thinko in ProcGlobalShmemSize(). There’s no need to add
space for startupBufferPinWaitBufId, because it’s part of the
PROC_HDR object for which this function already allocates space.
This has been wrong for a while, but the only consequence is that
our shared memory allocation is increased by 4 bytes, so no
back-patch.
http://git.postgresql.org/pg/commitdiff/c573486ce9752afb9a8431089762d6845cf1429d

– Fix crash in CREATE UNLOGGED TABLE. The code that created the init
fork neglected to make sure that the relation was open at the smgr
level before attempting to invoke smgr. This didn’t happen every
time; only when the relcache entry was rebuilt along the way. Per
report from Garick Hamlin.
http://git.postgresql.org/pg/commitdiff/bf347c60bdd7e05800f0c06d03e2ad87aeaa5e09

– Add overflow checks to int4 and int8 versions of generate_series().
The previous code went into an infinite loop after overflow. In
fact, an overflow is not really an error; it just means that the
current value is the last one we need to return. So, just arrange
to stop immediately when overflow is detected. Back-patch all the
way.
http://git.postgresql.org/pg/commitdiff/062780ec35f9db630e784b27a54440017df77531

Alvaro Herrera pushed:

– Expand warnings on locks acquired by CREATE INDEX CONCURRENTLY. The
previous wording wasn’t explicit enough, which could misled readers
into thinking that the locks acquired are more restricted in nature
than they really are. The resulting optimism can be damaging to
morale when confronted with reality, as has been observed in the
field. Greg Smith
http://git.postgresql.org/pg/commitdiff/a03feb9354bda5084f19cc952bc52ba7be89f372

– Fix aboriginal copy-paste mistake in error message. Spotted by
Jaime Casanova
http://git.postgresql.org/pg/commitdiff/8f59e023ef05d4f45e1c10a8bbc96bf8b4a96a89

– Mention DROP TABLE as well as ALTER TABLE NO INHERIT … when
talking about how good they are in replacement of bulk DELETE in
partitioned setups. The original wording was a bit confusing. Per
an observation from David Wheeler.
http://git.postgresql.org/pg/commitdiff/fc7e99872cb3595638fc00ab96cf433bfa77fb14

– Fix grammatical mistake introduced by previous commit. Per note
from Tom Lane
http://git.postgresql.org/pg/commitdiff/8cfd59dd65fe992fda0358a4bdca9e610c624a3c

– Fix typo
http://git.postgresql.org/pg/commitdiff/f3008c31f02948290f2edde9c39dc83371acbab9

Bruce Momjian pushed:

– Document that bits to the right of the CIDR mask “should” be zero,
not “must”.
http://git.postgresql.org/pg/commitdiff/2fccc881a9184879deeb9580bc25e7c420c580f8

– In pg_upgrade, check there are no prepared transactions.
http://git.postgresql.org/pg/commitdiff/07d17a73ec9485d6fa096d29d26647459fb9cbb7

– In pg_upgrade, document that link mode has to have data directories
on the same file system, and that authentication should lock out
normal users. Per suggestsion from #postgresql irc channel.
Backpatch to 9.1.
http://git.postgresql.org/pg/commitdiff/776fa183594f6e7184183ab632c87996e96f7cf6

– In pg_upgrade, clean up code layout in validateDirectoryOption().
http://git.postgresql.org/pg/commitdiff/e3df3572f66aa099d337f013dceef7d519ef8398

Peter Eisentraut pushed:

– Move parse2.pl to parse.pl. We have a SCM, so we don’t need to keep
old versions of files around.
http://git.postgresql.org/pg/commitdiff/030a2831a8df7829d606a873e28330ea2310fd64

– Remove unused variable. The variable became obsolete in commit
68739ba856c52e6721d6cffec21f1bf0327a9a7b, but only gcc 4.6 shows the
warning.
http://git.postgresql.org/pg/commitdiff/90132f62a2847fb2bc93a7c2366a139fe12bf365

– Add comment that attributes.is_nullable was removed from SQL
standard. We don’t have to remove the column if no one is bothered,
but it’s useful to comment on it in case someone looks for it in
newer standards versions.
http://git.postgresql.org/pg/commitdiff/efb224a4392326fd6ae3eabdc170a246978d3f09

– Allow psql d tab completion to complete all relation kinds. This
matches what d actually accepts.
http://git.postgresql.org/pg/commitdiff/707195c8f487a39c34ea4d965140465594eb5c21

– Document that psql’s d also works with composite types. This has
always been true, it was just never documented.
http://git.postgresql.org/pg/commitdiff/da023acd1aec18e715789540f150c77b919c65a0

– Start using flexible array members. Flexible array members are a
C99 feature that avoids “cheating” in the declaration of
variable-length arrays at the end of structs. With Autoconf
support, this should be transparent for older compilers. We start
with one use in gist.h because gcc 4.6 started to raise a warning
there. Over time, it can be expanded to other places in the source,
but they will likely need some review of sizeof and offsetof usage.
The current change in gist.h appears to be safe in this regard.
http://git.postgresql.org/pg/commitdiff/dbbba5279f66f95805c1e084e6f646d174931e56

– Avoid compiler warnings due to possibly unused variables. gcc 4.6
complains about these because of the new option
-Wunused-but-set-variable which comes in with -Wall, so cast them to
void, which avoids the warning.
http://git.postgresql.org/pg/commitdiff/7357558fc8866e3a449aa9473c419b593d67b5b6

– Make external_pid_file world readable
http://git.postgresql.org/pg/commitdiff/223d14a984e677823bd4f865ff22e14dd3fe9b76

– Capitalization fixes
http://git.postgresql.org/pg/commitdiff/8a8fbe7e799cfc0d8dc5ffef5640df6dac8acd6c

Heikki Linnakangas pushed:

– Renumber 2PC resource managers so that compared to 9.0, predicate
lock rmgr is added to the end, and existing resource managers keep
their old ids. We’re not going to guarantee on-disk compatibility
for 2PC state files over major releases, but it seems better to
avoid changing the ids them anyway. It will help anyone who might
want to write external tools to inspect the state files to work with
files from different versions, if nothing else. Per complaint from
Tom Lane.
http://git.postgresql.org/pg/commitdiff/b81831acbc671445061ed41a55fb1cc21d8e2979

– Oops, forgot to change the order of entries in 2PC callback arrays
when I renumbered the resource managers. This should fix the
buildfarm..
http://git.postgresql.org/pg/commitdiff/85ea93384ae21ff59f5e5b292884a86f9c10b852

– Make non-MVCC snapshots exempt from predicate locking. Scans with
non-MVCC snapshots, like in REINDEX, are basically non-transactional
operations. The DDL operation itself might participate in SSI, but
there’s separate functions for that. Kevin Grittner and Dan Ports,
with some changes by me.
http://git.postgresql.org/pg/commitdiff/0a0e2b52a5a53b8747c165ff5c976f27df05a2e1

– The rolled-back flag on serializable xacts was pointless and
redundant with the marked-for-death flag. It was only set for a
fleeting moment while a transaction was being cleaned up at
rollback. All the places that checked for the rolled-back flag
should also check the marked-for-death flag, as both flags mean that
the transaction will roll back. I also renamed the marked-for-death
into “doomed”, which is a lot shorter name.
http://git.postgresql.org/pg/commitdiff/264a6b127a918800d9f8bac80b5f4a8a8799d0f1

– pgindent run of recent SSI changes. Also, remove an unnecessary
#include. Kevin Grittner
http://git.postgresql.org/pg/commitdiff/cb94db91b257c6375f597d9e9df2f48d5326a967

– Update README-SSI. Add a section to describe the “dangerous
structure” that SSI is based on, as well as the optimizations about
relative commit times and read-only transactions. Plus a bunch of
other misc fixes and improvements. Dan Ports
http://git.postgresql.org/pg/commitdiff/78475b0ecac4e7793366d2dba0cb875a8fde6bb0

Tom Lane pushed:

– Fix assorted issues with build and install paths containing spaces.
Apparently there is no buildfarm critter exercising this case after
all, because it fails in several places. With this patch, build,
install, check-world, and installcheck-world pass for me on OS X.
http://git.postgresql.org/pg/commitdiff/a61b6b7d184dc7aa2475eb4d293990404be5fedd

– Suppress -arch switches in the output of ExtUtils::Embed. We
previously found out that OS X’s standard perl installation tries to
put -arch switches into Perl link commands, evidently in hopes of
building universal binaries. But it doesn’t work to add such
switches in plperl’s link step if they weren’t being used earlier,
so this is basically unworkable. When using gcc the result is only
some warnings; but LLVM fails entirely, so this issue isn’t as
cosmetic as we originally thought. Hence, back-patch commit
d69a419e682c2d39c2355105a7e5e2b90357c8f0 into pre-9.0 branches.
http://git.postgresql.org/pg/commitdiff/212567ad3ee23c7ff630e41034c48814b3f18cc9

– Fix oversights in pg_basebackup’s -z (compression) option. The
short-form -z switch didn’t work, for lack of telling getopt_long
about it; and even if specified long-form, it failed to do anything,
because the various tests elsewhere in the file would take
Z_DEFAULT_COMPRESSION (which is -1) as meaning “don’t compress”.
Per bug #6060 from Shigehiro Honda, though I editorialized on his
patch a bit.
http://git.postgresql.org/pg/commitdiff/31156ce8b95c5e9fa8cb01f08de008c3289c1086

– Fix failure to account for memory used by tuplestore_putvalues().
This oversight could result in a tuplestore using much more than the
intended amount of memory. It would only happen in a code path that
loaded a tuplestore via tuplestore_putvalues(), and many of those
won’t emit huge amounts of data; but cases such as holdable cursors
and plpgsql’s RETURN NEXT command could have the problem. The fix
ensures that the tuplestore will switch to write-to-disk mode when
it overruns work_mem. The potential overrun was finite, because we
would still count the space used by the tuple pointer array, so the
tuplestore code would eventually flip into write-to-disk mode
anyway. When storing wide tuples we would go far past the expected
work_mem usage before that happened; but this may account for the
lack of prior reports. Back-patch to 8.4, where
tuplestore_putvalues was introduced. Per bug #6061 from Yann
Delorme.
http://git.postgresql.org/pg/commitdiff/10db3de66eb226e9aed32e789abd532c41f0f471

– Rework parsing of ConstraintAttributeSpec to improve NOT VALID
handling. The initial commit of the ALTER TABLE ADD FOREIGN KEY NOT
VALID feature failed to support labeling such constraints as
deferrable. The best fix for this seems to be to fold NOT VALID
into ConstraintAttributeSpec. That’s a bit more general than the
documented syntax, but it allows better-targeted syntax error
messages. In addition, do some mostly-but-not-entirely-cosmetic
code review for the whole NOT VALID patch.
http://git.postgresql.org/pg/commitdiff/e1ccaff6eea1b48f4b9b28cabaf0f990119b0d19

– Use single quotes in preference to double quotes for protecting
pathnames. Per recommendation from Peter Eisentraut. Neither
choice is bulletproof, but this is the existing style and it does
help prevent unexpected environment variable substitution.
http://git.postgresql.org/pg/commitdiff/1568fa75bcf393977425ccb73752b98883a9f375

– Remove another no-longer-needed inclusion of predicate.h.
http://git.postgresql.org/pg/commitdiff/307a4c2cbbb8e824163fca354783e79d2892d231

– Index tuple data arrays using Anum_xxx symbolic constants instead of
“i++”. We had already converted most places to this style, but this
patch gets the last few that were still doing it the old way. The
main advantage is that this exposes a greppable name for each target
column, rather than having to rely on comments (which a couple of
places failed to provide anyhow). Richard Hopkins, additional work
by me to clean up update_attstats() too
http://git.postgresql.org/pg/commitdiff/bfcb9328e51eaaa21c92a1f2d7262758afb843e8

– Obtain table locks as soon as practical during pg_dump. For some
reason, when we (I) added table lock acquisition to pg_dump, we
didn’t think about making it happen as soon as possible after the
start of the transaction. What with subsequent additions, there was
actually quite a lot going on before we got around to that; which
sort of defeats the purpose. Rearrange the order of calls in
dumpSchema() to close the risk window as much as we easily can.
Back-patch to all supported branches.
http://git.postgresql.org/pg/commitdiff/68d977a73797a129913179010eea088f30e370b7

– Don’t use “cp -i” in the example WAL archive_command. This is a
dangerous example to provide because on machines with GNU cp, it
will silently do the wrong thing and risk archive corruption.
Worse, during the 9.0 cycle somebody “improved” the discussion by
removing the warning that used to be there about that, and instead
leaving the impression that the command would work as desired on
most Unixen. It doesn’t. Try to rectify the damage by providing an
example that is safe most everywhere, and then noting that you can
try cp -i if you want but you’d better test that. In back-patching
this to all supported branches, I also added an example command for
Windows, which wasn’t provided before 9.0.
http://git.postgresql.org/pg/commitdiff/a2624c687db3a3edcf5995773e47e9fef3e62a8c

Simon Riggs pushed:

– Respect Hot Standby controls while recycling btree index pages.
Btree pages were recycled after VACUUM deletes all records on a page
and then a subsequent VACUUM occurs after the RecentXmin horizon is
reached. Using RecentXmin meant that we did not respond correctly to
the user controls provide to avoid Hot Standby conflicts and so
spurious conflicts could be generated in some workload combinations.
We now reuse pages only when we reach RecentGlobalXmin, which can be
much later in the presence of long running queries and is also
controlled by vacuum_defer_cleanup_age and hot_standby_feedback.
Noah Misch and Simon Riggs.
http://git.postgresql.org/pg/commitdiff/758bd2a433d64bed00ca084203b3e5ccfdea4499

Andrew Dunstan pushed:

– Define FLEXIBLE_ARRAY_MEMBER for MSVC.
http://git.postgresql.org/pg/commitdiff/236a11dc65906cc200bce4e6db26d20b299cd1b0

– Set FLEXIBLE_ARRAY_MEMBER to empty for MSVC. Per gripe from Tom
Lane. I have tested this with VC 2008, and assume it will work with
earlier versions.
http://git.postgresql.org/pg/commitdiff/ddef31c15c663626fc1804467f4c2ce420598796

Magnus Hagander pushed:

– Remove redundant lib*dll.def rules from .gitignore. Since we now
have a global rule in the root .gitignore, there’s no need to keep
directory-specific ones as well. Noted by Peter Eisentraut
http://git.postgresql.org/pg/commitdiff/110c88d35cfcbe63dbb87a88d72f3e2a67a60f65

== Rejected Patches (for now) ==

Florian Pflug’s patch to implement ANY/ALL(array) OP EXPR. The right
way to do this is to provide commutators for the operators that don’t
have them yet.

== Pending Patches ==

Jaime Casanova and David Fetter traded patches which error out when
casting to or from a DOMAIN.

KaiGai Kohei sent in another revision of the patch to allow access to
the user-space access control vector for sepgsql.

Richard Hopkins sent in a patch to clarify the CreateComments
function, in the process removing an unneeded variable from it.

Florian Pflug sent in a patch to throw errors documenting the fact
that ANY/ALL(…) OP EXPR is not yet implemented.

KaiGai Kohei sent in another revision of the patch to add security
label support for shared database objects.

Merlin Moncure sent in another revision of the patch to clean up
psql’s describe.c by making all the SQL emitted by -E (ECHO_HIDDEN)
mode cut-and-pasteable with terminating semicolons. In passing,
remove trailing newlines.

Cedric Villemain sent in a set of experimental patches intended to get
estimates of what’s cached in order to make better execution plans.

Shigeru HANADA sent in two revisions of a patch to add SQL/MED
per-column GENERIC OPTIONs.

Alexander Korotkov sent in another revision of the patch to collect
frequency statistics for arrays.

Kevin Grittner sent in another revision of the patch to get SSI to
play nicer with 2PC.

Fujii Masao sent in another revision of the patch to enable cascading
replication.

Jun Ishiduka sent in a patch intended to help allow making an online
base backup from a hot standby.

Shigeru HANADA sent in a patch to enable per-column generic options
for foreign tables.

KaiGai Kohei sent in three revisions of a patch to rework DROP to
support get_object_address.

KaiGai Kohei sent in a patch to rework DROP by consolidating the
routines to handle DropStmt.

Robert Haas sent in a patch to remove a redundant store by
ProcGlobalShmemSize() of startupBufferPinWaitBufId.

Simon Riggs sent in a patch to create one-shot plans which get
executed immediately, the results discarded and the timing reported
back to the planner.

Bruce Momjian sent in two revisions of a patch to allow only apps with
the name binary-upgrade to connect to the cluster while it is in
binary upgrade mode, i.e. to disallow any apps not so named.

Mark Kirkwood and Cedric Villemain traded new revisions of the patch
to make it possible to constrain backend temporary file space.

Fujii Masao sent in a patch to fix a leak in dblink.

Noah Misch sent in another revision of the patch to avoid index
rebuilds for no-rewrite ALTER TABLE … ALTER TYPE operations.

Simon Riggs sent in three revisions of a patch to allow recycling
index pages in the case of hot standby.

Leonardo Francalanci sent in two more revisions of the patch to use
less space in xl_xact_commit.

Alvaro Herrera sent in three more revisions of the patch to allow
creating CHECK constraints as NOT VALID.

Alexander Korotkov sent in another revision of the patch to do fast
GiST index builds.

Martin Pihlak sent in a WIP patch to fix an infelicity with libpq and
SSL.

Ahmed Shinwari sent in a patch to fix an issue with Windows when
connecting using SSPI auth.

Bernd Helmle and Joseph Adams traded patches to add a JSON type.

Alexander Korotkov and Florian Pflug traded new revisions of a patch
to create a validator for configuration files.

Radoslaw Smogura sent in two revisions of a patch to make debug builds
without optimization.

Radoslaw Smogura sent in a patch intended to provide a general
infrastructure for streaming data in and out of PostgreSQL.

Shigeru HANADA sent in another revision of the patch to handle
deadlock_timeout at times less than PGC_SIGHUP.

Robert Haas sent in three more revisions of a patch to make the
visibility map crash-safe.

Peter Geoghegan sent in two more revisions of a patch to wake when the
postmaster dies, both on win32 and *n*x.

Hitoshi Harada sent in another revision of the patch to optimize
aggregation by parameterzing.

Andrew Tipton sent in another revision of the patch to add GiST
support for BOX @> POINT queries.

Kevin Grittner sent in a doc patch describing SSI tuning points.

Brendan Jurd sent in another revision of a patch to make keywords in
pg_hba.conf field-specific.

Josh Kupershmidt sent in another revision of the patch to enable dd
in psql to show constraint comments.

Radoslaw Smogura sent in another revision of a patch to fix some
infelicities in XPATH evaluation which could cause things to be
evaluated as null rather than empty string in XML context.

Jeff Davis and Robert Haas traded patches to refactor
heap_hot_search_buffer() so that index_getnext() can use it, and
modifies index_getnext() to do so.

Noah Misch sent in another revision of the patch to identify no-op
length coercions and not coerce them.

Kevin Grittner sent in a patch to fix some SSI issues with SLRU.

Comments are closed.