PostgreSQL 9.4.0 commit log

Stamp 9.4.0.

commit   : 8ca336f4ac3f08a5f23e76c6e9a5f2c8064f5883    
  
author   : Tom Lane <[email protected]>    
date     : Mon, 15 Dec 2014 20:07:34 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Mon, 15 Dec 2014 20:07:34 -0500    

Click here for diff

M configure
M configure.in
M doc/bug.template
M src/include/pg_config.h.win32

Translation updates

commit   : 84b76f2b62bd34c40533931b9547d7d411a62128    
  
author   : Alvaro Herrera <[email protected]>    
date     : Mon, 15 Dec 2014 19:27:12 -0300    
  
committer: Alvaro Herrera <[email protected]>    
date     : Mon, 15 Dec 2014 19:27:12 -0300    

Click here for diff

M src/backend/po/es.po
M src/backend/po/fr.po
M src/backend/po/pt_BR.po
M src/bin/initdb/po/es.po
M src/bin/initdb/po/pt_BR.po
M src/bin/initdb/po/sv.po
M src/bin/pg_basebackup/po/es.po
M src/bin/pg_basebackup/po/fr.po
M src/bin/pg_basebackup/po/pt_BR.po
M src/bin/pg_config/po/es.po
M src/bin/pg_controldata/po/es.po
M src/bin/pg_ctl/po/es.po
M src/bin/pg_dump/po/es.po
M src/bin/pg_resetxlog/po/es.po
M src/bin/psql/po/es.po
M src/bin/psql/po/fr.po
M src/bin/psql/po/pt_BR.po
M src/bin/scripts/po/es.po
M src/bin/scripts/po/pt_BR.po
M src/interfaces/ecpg/ecpglib/po/es.po
M src/interfaces/ecpg/preproc/po/es.po
M src/interfaces/libpq/po/es.po
M src/pl/plperl/po/es.po
M src/pl/plpgsql/src/po/es.po
M src/pl/plpython/po/es.po
M src/pl/tcl/po/es.po

Translation updates

commit   : 38a8323bdbb7524a96955fbaac90b12c94996b60    
  
author   : Peter Eisentraut <[email protected]>    
date     : Mon, 15 Dec 2014 16:18:13 -0500    
  
committer: Peter Eisentraut <[email protected]>    
date     : Mon, 15 Dec 2014 16:18:13 -0500    

Click here for diff

M src/bin/pg_basebackup/nls.mk
A src/bin/pg_basebackup/po/es.po

add missing newline

commit   : a666dfa99b750e22c9b91c05c0e3492b170a8fb4    
  
author   : Alvaro Herrera <[email protected]>    
date     : Mon, 15 Dec 2014 16:49:41 -0300    
  
committer: Alvaro Herrera <[email protected]>    
date     : Mon, 15 Dec 2014 16:49:41 -0300    

Click here for diff

M src/bin/pg_basebackup/pg_basebackup.c

Translation updates

commit   : e208b51f5491c85e0e967fe9798ace3f041fe0b7    
  
author   : Peter Eisentraut <[email protected]>    
date     : Mon, 15 Dec 2014 00:23:25 -0500    
  
committer: Peter Eisentraut <[email protected]>    
date     : Mon, 15 Dec 2014 00:23:25 -0500    

Click here for diff

M src/backend/nls.mk
M src/backend/po/de.po
M src/backend/po/it.po
M src/backend/po/ru.po
M src/backend/po/zh_CN.po
D src/backend/po/zh_TW.po
M src/bin/initdb/nls.mk
M src/bin/initdb/po/de.po
M src/bin/initdb/po/fr.po
M src/bin/initdb/po/it.po
A src/bin/initdb/po/sv.po
M src/bin/initdb/po/zh_CN.po
M src/bin/pg_basebackup/nls.mk
D src/bin/pg_basebackup/po/cs.po
D src/bin/pg_basebackup/po/es.po
M src/bin/pg_basebackup/po/it.po
D src/bin/pg_basebackup/po/ja.po
M src/bin/pg_basebackup/po/zh_CN.po
M src/bin/pg_config/po/sv.po
M src/bin/pg_controldata/po/fr.po
M src/bin/pg_controldata/po/sv.po
M src/bin/pg_controldata/po/zh_CN.po
M src/bin/pg_ctl/nls.mk
M src/bin/pg_ctl/po/fr.po
M src/bin/pg_ctl/po/it.po
M src/bin/pg_ctl/po/sv.po
M src/bin/pg_ctl/po/zh_CN.po
D src/bin/pg_ctl/po/zh_TW.po
M src/bin/pg_dump/po/fr.po
M src/bin/pg_dump/po/it.po
M src/bin/pg_dump/po/zh_CN.po
M src/bin/pg_resetxlog/nls.mk
M src/bin/pg_resetxlog/po/fr.po
A src/bin/pg_resetxlog/po/sv.po
M src/bin/pg_resetxlog/po/zh_CN.po
M src/bin/psql/po/it.po
M src/bin/psql/po/zh_CN.po
M src/bin/scripts/nls.mk
M src/bin/scripts/po/de.po
M src/bin/scripts/po/fr.po
M src/bin/scripts/po/it.po
A src/bin/scripts/po/sv.po
M src/bin/scripts/po/zh_CN.po
M src/interfaces/ecpg/preproc/po/zh_CN.po
M src/interfaces/libpq/po/zh_CN.po
M src/pl/plperl/nls.mk
A src/pl/plperl/po/sv.po
M src/pl/plpgsql/src/po/fr.po
M src/pl/plpgsql/src/po/zh_CN.po
M src/pl/plpython/nls.mk
D src/pl/plpython/po/ro.po
M src/pl/plpython/po/zh_CN.po

commit   : 93a5b1ff7842d91e1ce32c44660cc1e3e5a55317    
  
author   : Peter Eisentraut <[email protected]>    
date     : Sun, 14 Dec 2014 20:02:04 -0500    
  
committer: Peter Eisentraut <[email protected]>    
date     : Sun, 14 Dec 2014 20:02:04 -0500    

Click here for diff

M doc/src/sgml/ref/initdb.sgml

Improve documentation around parameter-setting and ALTER SYSTEM.

commit   : f4ec02c7cfd755be81dc0fe5dd0ccf2d49c2c30d    
  
author   : Tom Lane <[email protected]>    
date     : Sun, 14 Dec 2014 18:09:55 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Sun, 14 Dec 2014 18:09:55 -0500    

Click here for diff

The ALTER SYSTEM ref page hadn't been held to a very high standard, nor  
was the feature well integrated into section 18.1 (parameter setting).  
Also, though commit 4c4654afe had improved the structure of 18.1, it also  
introduced a lot of poor wording, imprecision, and outright falsehoods.  
Try to clean that up.  

M doc/src/sgml/config.sgml
M doc/src/sgml/ref/alter_system.sgml

Update 9.4 release notes.

commit   : 76547289b5b351799198c8ea6fae3f0e52d576e7    
  
author   : Tom Lane <[email protected]>    
date     : Sun, 14 Dec 2014 14:58:06 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Sun, 14 Dec 2014 14:58:06 -0500    

Click here for diff

Set release date, do a final pass of wordsmithing, improve some other  
new-in-9.4 documentation.  

M doc/src/sgml/datatype.sgml
M doc/src/sgml/plpgsql.sgml
M doc/src/sgml/release-9.4.sgml

Improve recovery target settings documentation.

commit   : 5fc34ba880e1223268ffbbe8be8621342c883151    
  
author   : Tom Lane <[email protected]>    
date     : Sat, 13 Dec 2014 13:46:46 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Sat, 13 Dec 2014 13:46:46 -0500    

Click here for diff

Commit 815d71dee hadn't bothered to update the documentation to match the  
behavioral change, and a lot of other text in this section was badly in  
need of copy-editing.  

M doc/src/sgml/recovery-config.sgml

Repair corner-case bug in array version of percentile_cont().

commit   : 9ccae6360df4a8be845e28b0ab9042ab09e8c397    
  
author   : Tom Lane <[email protected]>    
date     : Sat, 13 Dec 2014 11:49:20 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Sat, 13 Dec 2014 11:49:20 -0500    

Click here for diff

The code for advancing through the input rows overlooked the case that we  
might already be past the first row of the row pair now being considered,  
in case the previous percentile also fell between the same two input rows.  
  
Report and patch by Andrew Gierth; logic rewritten a bit for clarity by me.  

M src/backend/utils/adt/orderedsetaggs.c
M src/test/regress/expected/aggregates.out
M src/test/regress/sql/aggregates.sql

Revert misguided change to postgres_fdw FOR UPDATE/SHARE code.

commit   : 1a1fb46da4ca6ac0385bdd43a33e15b64370dfdd    
  
author   : Tom Lane <[email protected]>    
date     : Fri, 12 Dec 2014 12:41:52 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Fri, 12 Dec 2014 12:41:52 -0500    

Click here for diff

In commit 462bd95705a0c23ba0b0ba60a78d32566a0384c1, I changed postgres_fdw  
to rely on get_plan_rowmark() instead of get_parse_rowmark().  I still  
think that's a good idea in the long run, but as Etsuro Fujita pointed out,  
it doesn't work today because planner.c forces PlanRowMarks to have  
markType = ROW_MARK_COPY for all foreign tables.  There's no urgent reason  
to change this in the back branches, so let's just revert that part of  
yesterday's commit rather than trying to design a better solution under  
time pressure.  
  
Also, add a regression test case showing what postgres_fdw does with FOR  
UPDATE/SHARE.  I'd blithely assumed there was one already, else I'd have  
realized yesterday that this code didn't work.  

M contrib/postgres_fdw/expected/postgres_fdw.out
M contrib/postgres_fdw/postgres_fdw.c
M contrib/postgres_fdw/sql/postgres_fdw.sql

Fix planning of SELECT FOR UPDATE on child table with partial index.

commit   : f2e20542dac2e25bc37440e66fd2769c29f2836b    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 11 Dec 2014 21:02:28 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 11 Dec 2014 21:02:28 -0500    

Click here for diff

Ordinarily we can omit checking of a WHERE condition that matches a partial  
index's condition, when we are using an indexscan on that partial index.  
However, in SELECT FOR UPDATE we must include the "redundant" filter  
condition in the plan so that it gets checked properly in an EvalPlanQual  
recheck.  The planner got this mostly right, but improperly omitted the  
filter condition if the index in question was on an inheritance child  
table.  In READ COMMITTED mode, this could result in incorrectly returning  
just-updated rows that no longer satisfy the filter condition.  
  
The cause of the error is using get_parse_rowmark() when get_plan_rowmark()  
is what should be used during planning.  In 9.3 and up, also fix the same  
mistake in contrib/postgres_fdw.  It's currently harmless there (for lack  
of inheritance support) but wrong is wrong, and the incorrect code might  
get copied to someplace where it's more significant.  
  
Report and fix by Kyotaro Horiguchi.  Back-patch to all supported branches.  

M contrib/postgres_fdw/postgres_fdw.c
M src/backend/optimizer/plan/createplan.c

Fix corner case where SELECT FOR UPDATE could return a row twice.

commit   : 0c12be853a4e0367164dd59437598c7078809e4d    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 11 Dec 2014 19:37:03 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 11 Dec 2014 19:37:03 -0500    

Click here for diff

In READ COMMITTED mode, if a SELECT FOR UPDATE discovers it has to redo  
WHERE-clause checking on rows that have been updated since the SELECT's  
snapshot, it invokes EvalPlanQual processing to do that.  If this first  
occurs within a non-first child table of an inheritance tree, the previous  
coding could accidentally re-return a matching row from an earlier,  
already-scanned child table.  (And, to add insult to injury, I think this  
could make it miss returning a row that should have been returned, if the  
updated row that this happens on should still have passed the WHERE qual.)  
Per report from Kyotaro Horiguchi; the added isolation test is based on his  
test case.  
  
This has been broken for quite awhile, so back-patch to all supported  
branches.  

M src/backend/executor/nodeLockRows.c
M src/test/isolation/expected/eval-plan-qual.out
M src/test/isolation/specs/eval-plan-qual.spec

Fix assorted confusion between Oid and int32.

commit   : 390ed56eb7fb8cc4ba2a7cd6360b41883601908e    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 11 Dec 2014 15:41:20 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 11 Dec 2014 15:41:20 -0500    

Click here for diff

In passing, also make some debugging elog's in pgstat.c a bit more  
consistently worded.  
  
Back-patch as far as applicable (9.3 or 9.4; none of these mistakes are  
really old).  
  
Mark Dilger identified and patched the type violations; the message  
rewordings are mine.  

M src/backend/access/heap/tuptoaster.c
M src/backend/postmaster/pgstat.c
M src/backend/replication/logical/reorderbuffer.c
M src/bin/pg_dump/parallel.c

Fix typo

commit   : d0f8d0ded4e2d9bf77fd638c0cac281f83429c4d    
  
author   : Peter Eisentraut <[email protected]>    
date     : Wed, 10 Dec 2014 20:55:30 -0500    
  
committer: Peter Eisentraut <[email protected]>    
date     : Wed, 10 Dec 2014 20:55:30 -0500    

Click here for diff

Author: Fabrízio de Royes Mello <[email protected]>  

M src/bin/scripts/t/100_vacuumdb.pl

Fix minor thinko in convertToJsonb().

commit   : 49b60a4be7cb8bbfb9d954cc5b81d0dc18b077df    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 10 Dec 2014 19:06:27 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 10 Dec 2014 19:06:27 -0500    

Click here for diff

The amount of space to reserve for the value's varlena header is  
VARHDRSZ, not sizeof(VARHDRSZ).  The latter coding accidentally  
failed to fail because of the way the VARHDRSZ macro is currently  
defined; but if we ever change it to return size_t (as one might  
reasonably expect it to do), convertToJsonb() would have failed.  
  
Spotted by Mark Dilger.  

M src/backend/utils/adt/jsonb_util.c

Give a proper error message if initdb password file is empty.

commit   : eadd80c08ddfc485db84b9af7cca54a0d50ebe6d    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Fri, 5 Dec 2014 14:27:56 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Fri, 5 Dec 2014 14:27:56 +0200    

Click here for diff

Used to say just "could not read password from file "...": Success", which  
isn't very informative.  
  
Mats Erik Andersson. Backpatch to all supported versions.  

M src/bin/initdb/initdb.c

Print wal_log_hints in the rm_desc routing of a parameter-change record.

commit   : 463dde8def8befec1e8f1f3c106c1ce1108ad54f    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Fri, 5 Dec 2014 11:58:24 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Fri, 5 Dec 2014 11:58:24 +0200    

Click here for diff

It was an oversight in the original commit.  
  
Also note in the sample config file that changing wal_log_hints requires a  
restart.  
  
Michael Paquier. Backpatch to 9.4, where wal_log_hints was added.  

M src/backend/access/rmgrdesc/xlogdesc.c
M src/backend/utils/misc/postgresql.conf.sample

Fix PGXS vpath build when PostgreSQL is built with vpath

commit   : f3d7077dad94d6ac864647eaa50f5dd0590a6c8d    
  
author   : Peter Eisentraut <[email protected]>    
date     : Thu, 4 Dec 2014 17:02:02 -0500    
  
committer: Peter Eisentraut <[email protected]>    
date     : Thu, 4 Dec 2014 17:02:02 -0500    

Click here for diff

PGXS computes srcdir from VPATH, PostgreSQL proper computes VPATH from  
srcdir, and doing both results in an error from make.  Conditionalize so  
only one of these takes effect.  

M src/Makefile.global.in

Remove USE_VPATH make variable from PGXS

commit   : e907997f42faada60e5a26b116cc0b79b69309d1    
  
author   : Peter Eisentraut <[email protected]>    
date     : Wed, 19 Nov 2014 21:51:30 -0500    
  
committer: Peter Eisentraut <[email protected]>    
date     : Wed, 19 Nov 2014 21:51:30 -0500    

Click here for diff

The user can just set VPATH directly.  There is no need to invent  
another variable.  

M doc/src/sgml/extend.sgml
M src/makefiles/pgxs.mk

Fix SHLIB_PREREQS use in contrib, allowing PGXS builds

commit   : 4e4b9002498b72c7000a675216470e8918fc0420    
  
author   : Peter Eisentraut <[email protected]>    
date     : Thu, 4 Dec 2014 07:58:12 -0500    
  
committer: Peter Eisentraut <[email protected]>    
date     : Thu, 4 Dec 2014 07:58:12 -0500    

Click here for diff

dblink and postgres_fdw use SHLIB_PREREQS = submake-libpq to build libpq  
first.  This doesn't work in a PGXS build, because there is no libpq to  
build.  So just omit setting SHLIB_PREREQS in this case.  
  
Note that PGXS users can still use SHLIB_PREREQS (although it is not  
documented).  The problem here is only that contrib modules can be built  
in-tree or using PGXS, and the prerequisite is only applicable in the  
former case.  
  
Commit 6697aa2bc25c83b88d6165340348a31328c35de6 previously attempted to  
address this by creating a somewhat fake submake-libpq target in  
Makefile.global.  That was not the right fix, and it was also done in a  
nonportable way, so revert that.  

M contrib/dblink/Makefile
M contrib/postgres_fdw/Makefile
M src/Makefile.global.in

Move PG_AUTOCONF_FILENAME definition

commit   : 3e2dc9703a4835ace14310f82369df0a4e8528f2    
  
author   : Peter Eisentraut <[email protected]>    
date     : Wed, 3 Dec 2014 19:54:01 -0500    
  
committer: Peter Eisentraut <[email protected]>    
date     : Wed, 3 Dec 2014 19:54:01 -0500    

Click here for diff

Since this is not something that a user should change,  
pg_config_manual.h was an inappropriate place for it.  
  
In initdb.c, remove the use of the macro, because utils/guc.h can't be  
included by non-backend code.  But we hardcode all the other  
configuration file names there, so this isn't a disaster.  

M src/bin/initdb/initdb.c
M src/include/pg_config_manual.h
M src/include/utils/guc.h

Fix typos

commit   : 567737822a004dd23a105c5b7129ff98b2805ac7    
  
author   : Alvaro Herrera <[email protected]>    
date     : Wed, 3 Dec 2014 11:52:16 -0300    
  
committer: Alvaro Herrera <[email protected]>    
date     : Wed, 3 Dec 2014 11:52:16 -0300    

Click here for diff

M src/backend/access/transam/clog.c

Improve error messages for malformed array input strings.

commit   : 7a0be6782b5fc050ec93e386aec13f3100f498a7    
  
author   : Tom Lane <[email protected]>    
date     : Tue, 2 Dec 2014 18:23:20 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Tue, 2 Dec 2014 18:23:20 -0500    

Click here for diff

Make the error messages issued by array_in() uniformly follow the style  
	ERROR: malformed array literal: "actual input string"  
	DETAIL: specific complaint here  
and rewrite many of the specific complaints to be clearer.  
  
The immediate motivation for doing this is a complaint from Josh Berkus  
that json_to_record() produced an unintelligible error message when  
dealing with an array item, because it tries to feed the JSON-format  
array value to array_in().  Really it ought to be smart enough to  
perform JSON-to-Postgres array conversion, but that's a future feature  
not a bug fix.  In the meantime, this change is something we agreed  
we could back-patch into 9.4, and it should help de-confuse things a bit.  

M src/backend/utils/adt/arrayfuncs.c
M src/pl/plperl/expected/plperl_array.out
M src/test/regress/expected/arrays.out

Don't skip SQL backends in logical decoding for visibility computation.

commit   : 10f1f93d8ae2d70fcaf350c62972fb6bac42ffc9    
  
author   : Andres Freund <[email protected]>    
date     : Tue, 2 Dec 2014 23:42:26 +0100    
  
committer: Andres Freund <[email protected]>    
date     : Tue, 2 Dec 2014 23:42:26 +0100    

Click here for diff

The logical decoding patchset introduced PROC_IN_LOGICAL_DECODING flag  
PGXACT flag, that allows such backends to be skipped when computing  
the xmin horizon/snapshots. That's fine and sensible for walsenders  
streaming out logical changes, but not at all fine for SQL backends  
doing logical decoding. If the latter set that flag any change they  
have performed outside of logical decoding will not be regarded as  
visible - which e.g. can lead to that change being vacuumed away.  
  
Note that not setting the flag for SQL backends isn't particularly  
bothersome - the SQL backend doesn't do streaming, so it only runs for  
a limited amount of time.  
  
Per buildfarm member 'tick' and Alvaro.  
  
Backpatch to 9.4, where logical decoding was introduced.  

M contrib/test_decoding/expected/decoding_into_rel.out
M contrib/test_decoding/sql/decoding_into_rel.sql
M src/backend/replication/logical/logical.c
M src/include/storage/proc.h

Fix JSON aggregates to work properly when final function is re-executed.

commit   : f0eeba6f83ed16687d8743b34e519de45c3915ec    
  
author   : Tom Lane <[email protected]>    
date     : Tue, 2 Dec 2014 15:02:40 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Tue, 2 Dec 2014 15:02:40 -0500    

Click here for diff

Davide S. reported that json_agg() sometimes produced multiple trailing  
right brackets.  This turns out to be because json_agg_finalfn() attaches  
the final right bracket, and was doing so by modifying the aggregate state  
in-place.  That's verboten, though unfortunately it seems there's no way  
for nodeAgg.c to check for such mistakes.  
  
Fix that back to 9.3 where the broken code was introduced.  In 9.4 and  
HEAD, likewise fix json_object_agg(), which had copied the erroneous logic.  
Make some cosmetic cleanups as well.  

M src/backend/utils/adt/json.c

Guard against bad "dscale" values in numeric_recv().

commit   : ac0aa07e96b3ebf7b8b2bebfc56fc86fb90c14f5    
  
author   : Tom Lane <[email protected]>    
date     : Mon, 1 Dec 2014 15:25:05 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Mon, 1 Dec 2014 15:25:05 -0500    

Click here for diff

We were not checking to see if the supplied dscale was valid for the given  
digit array when receiving binary-format numeric values.  While dscale can  
validly be more than the number of nonzero fractional digits, it shouldn't  
be less; that case causes fractional digits to be hidden on display even  
though they're there and participate in arithmetic.  
  
Bug #12053 from Tommaso Sala indicates that there's at least one broken  
client library out there that sometimes supplies an incorrect dscale value,  
leading to strange behavior.  This suggests that simply throwing an error  
might not be the best response; it would lead to failures in applications  
that might seem to be working fine today.  What seems the least risky fix  
is to truncate away any digits that would be hidden by dscale.  This  
preserves the existing behavior in terms of what will be printed for the  
transmitted value, while preventing subsequent arithmetic from producing  
results inconsistent with that.  
  
In passing, throw a specific error for the case of dscale being outside  
the range that will fit into a numeric's header.  Before you got "value  
overflows numeric format", which is a bit misleading.  
  
Back-patch to all supported branches.  

M src/backend/utils/adt/numeric.c

Fix hstore_to_json_loose's detection of valid JSON number values.

commit   : f82132f4a15e2a02d984b3ba0ef5b10da1f489bd    
  
author   : Andrew Dunstan <[email protected]>    
date     : Mon, 1 Dec 2014 11:28:45 -0500    
  
committer: Andrew Dunstan <[email protected]>    
date     : Mon, 1 Dec 2014 11:28:45 -0500    

Click here for diff

We expose a function IsValidJsonNumber that internally calls the lexer  
for json numbers. That allows us to use the same test everywhere,  
instead of inventing a broken test for hstore conversions. The new  
function is also used in datum_to_json, replacing the code that is now  
moved to the new function.  
  
Backpatch to 9.3 where hstore_to_json_loose was introduced.  

M contrib/hstore/hstore_io.c
M src/backend/utils/adt/json.c
M src/include/utils/jsonapi.h

Fix missing space in documentation

commit   : 76394810f87d3c03f8a135cc6e9801acc6b0ad8d    
  
author   : Magnus Hagander <[email protected]>    
date     : Mon, 1 Dec 2014 12:12:07 +0100    
  
committer: Magnus Hagander <[email protected]>    
date     : Mon, 1 Dec 2014 12:12:07 +0100    

Click here for diff

Ian Barwick  

M doc/src/sgml/wal.sgml

Fix minor bugs in commit 30bf4689a96cd283af33edcdd6b7210df3f20cd8 et al.

commit   : 2e2c8455fa9f9bae80a1e1edd780b78362b82404    
  
author   : Tom Lane <[email protected]>    
date     : Sun, 30 Nov 2014 12:20:47 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Sun, 30 Nov 2014 12:20:47 -0500    

Click here for diff

Coverity complained that the "else" added to fillPGconn() was unreachable,  
which it was.  Remove the dead code.  In passing, rearrange the tests so as  
not to bother trying to fetch values for options that can't be assigned.  
  
Pre-9.3 did not have that issue, but it did have a "return" that should be  
"goto oom_error" to ensure that a suitable error message gets filled in.  

M src/interfaces/libpq/fe-connect.c

Remove PQhostaddr() from 9.4 release notes.

commit   : 6bb6958fa2614a5f18e9ac992f8f9956db59e9d1    
  
author   : Noah Misch <[email protected]>    
date     : Sat, 29 Nov 2014 15:53:05 -0500    
  
committer: Noah Misch <[email protected]>    
date     : Sat, 29 Nov 2014 15:53:05 -0500    

Click here for diff

Back-patch to 9.4, like the feature's removal.  

M doc/src/sgml/release-9.4.sgml

Reimplement 9f80f4835a55a1cbffcda5d23a617917f3286c14 with PQconninfo().

commit   : 36e52479852ee3343b901c1744faa690f5fac242    
  
author   : Noah Misch <[email protected]>    
date     : Sat, 29 Nov 2014 12:31:43 -0500    
  
committer: Noah Misch <[email protected]>    
date     : Sat, 29 Nov 2014 12:31:43 -0500    

Click here for diff

Apart from ignoring "hostaddr" set to the empty string, this behaves  
identically to its predecessor.  Back-patch to 9.4, where the original  
commit first appeared.  
  
Reviewed by Fujii Masao.  

M src/bin/psql/command.c

Revert "Add libpq function PQhostaddr()."

commit   : 27b6f9ce7b12f82599f95f296abe7bb8942a6041    
  
author   : Noah Misch <[email protected]>    
date     : Sat, 29 Nov 2014 12:31:21 -0500    
  
committer: Noah Misch <[email protected]>    
date     : Sat, 29 Nov 2014 12:31:21 -0500    

Click here for diff

This reverts commit 9f80f4835a55a1cbffcda5d23a617917f3286c14.  The  
function returned the raw value of a connection parameter, a task served  
by PQconninfo().  The next commit will reimplement the psql \conninfo  
change that way.  Back-patch to 9.4, where that commit first appeared.  

M doc/src/sgml/libpq.sgml
M src/bin/psql/command.c
M src/interfaces/libpq/exports.txt
M src/interfaces/libpq/fe-connect.c
M src/interfaces/libpq/libpq-fe.h

Update transaction README for persistent multixacts

commit   : 866c6ab456f97478ad7b316a8c9fbf7c9e9a3143    
  
author   : Alvaro Herrera <[email protected]>    
date     : Fri, 28 Nov 2014 18:06:18 -0300    
  
committer: Alvaro Herrera <[email protected]>    
date     : Fri, 28 Nov 2014 18:06:18 -0300    

Click here for diff

Multixacts are now maintained during recovery, but the README didn't get  
the memo.  Backpatch to 9.3, where the divergence was introduced.  

M src/backend/access/transam/README

Add tab-completion for ALTER TABLE ALTER CONSTRAINT in psql.

commit   : 19b1511a48f2ebdce94fe5f85a89dd6c36da1ba5    
  
author   : Fujii Masao <[email protected]>    
date     : Fri, 28 Nov 2014 21:29:45 +0900    
  
committer: Fujii Masao <[email protected]>    
date     : Fri, 28 Nov 2014 21:29:45 +0900    

Click here for diff

Back-patch to 9.4 where ALTER TABLE ALTER CONSTRAINT was added.  
  
Michael Paquier, bug reported by Andrey Lizenko.  

M src/bin/psql/tab-complete.c

Make \watch respect the user's \pset null setting.

commit   : 0ec68a083b0619eaf48f7249a6659216c9fe5e35    
  
author   : Fujii Masao <[email protected]>    
date     : Fri, 28 Nov 2014 02:42:43 +0900    
  
committer: Fujii Masao <[email protected]>    
date     : Fri, 28 Nov 2014 02:42:43 +0900    

Click here for diff

Previously \watch always ignored the user's \pset null setting.  
\pset null setting should be ignored for \d and similar queries.  
For those, the code can reasonably have an opinion about what  
the presentation should be like, since it knows what SQL query  
it's issuing. This argument surely doesn't apply to \watch,  
so this commit makes \watch use the user's \pset null setting.  
  
Back-patch to 9.3 where \watch was added.  

M src/bin/psql/command.c

Mark response messages for translation in pg_isready.

commit   : 6e9d43eb02583ce29ffbbf732ab8f26e2a58e4cf    
  
author   : Fujii Masao <[email protected]>    
date     : Fri, 28 Nov 2014 02:12:45 +0900    
  
committer: Fujii Masao <[email protected]>    
date     : Fri, 28 Nov 2014 02:12:45 +0900    

Click here for diff

Back-patch to 9.3 where pg_isready was added.  
  
Mats Erik Andersson  

M src/bin/scripts/pg_isready.c

Free libxml2/libxslt resources in a safer order.

commit   : e2d0c25917bef8c25bf6e9b1bcf2a75dbf8f07f0    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 27 Nov 2014 11:12:47 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 27 Nov 2014 11:12:47 -0500    

Click here for diff

Mark Simonetti reported that libxslt sometimes crashes for him, and that  
swapping xslt_process's object-freeing calls around to do them in reverse  
order of creation seemed to fix it.  I've not reproduced the crash, but  
valgrind clearly shows a reference to already-freed memory, which is  
consistent with the idea that shutdown of the xsltTransformContext is  
trying to reference the already-freed stylesheet or input document.  
With this patch, valgrind is no longer unhappy.  
  
I have an inquiry in to see if this is a libxslt bug or if we're just  
abusing the library; but even if it's a library bug, we'd want to adjust  
our code so it doesn't fail with unpatched libraries.  
  
Back-patch to all supported branches, because we've been doing this in  
the wrong(?) order for a long time.  

M contrib/xml2/xslt_proc.c

Allow "dbname" from connection string to be overridden in PQconnectDBParams

commit   : 6c1d521af35e496639bbb39764c30115879af47f    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Tue, 25 Nov 2014 17:12:07 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Tue, 25 Nov 2014 17:12:07 +0200    

Click here for diff

If the "dbname" attribute in PQconnectDBParams contained a connection string  
or URI (and expand_dbname = TRUE), the database name from the connection  
string could not be overridden by a subsequent "dbname" keyword in the  
array. That was not intentional; all other options can be overridden.  
Furthermore, any subsequent "dbname" caused the connection string from the  
first dbname value to be processed again, overriding any values for the same  
options that were given between the connection string and the second dbname  
option.  
  
In the passing, clarify in the docs that only the first dbname option in the  
array is parsed as a connection string.  
  
Alex Shulgin. Backpatch to all supported versions.  

M doc/src/sgml/libpq.sgml
M src/interfaces/libpq/fe-connect.c

Check return value of strdup() in libpq connection option parsing.

commit   : 811015ff9aafd2d5e03fbd931f7c6102b3d6516a    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Tue, 25 Nov 2014 12:55:00 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Tue, 25 Nov 2014 12:55:00 +0200    

Click here for diff

An out-of-memory in most of these would lead to strange behavior, like  
connecting to a different database than intended, but some would lead to  
an outright segfault.  
  
Alex Shulgin and me. Backpatch to all supported versions.  

M src/interfaces/libpq/fe-connect.c

Fix mishandling of system columns in FDW queries.

commit   : 3852eaba10bdcd8eafa5e64dbd853dc5c50e134c    
  
author   : Tom Lane <[email protected]>    
date     : Sat, 22 Nov 2014 16:01:08 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Sat, 22 Nov 2014 16:01:08 -0500    

Click here for diff

postgres_fdw would send query conditions involving system columns to the  
remote server, even though it makes no effort to ensure that system  
columns other than CTID match what the remote side thinks.  tableoid,  
in particular, probably won't match and might have some use in queries.  
Hence, prevent sending conditions that include non-CTID system columns.  
  
Also, create_foreignscan_plan neglected to check local restriction  
conditions while determining whether to set fsSystemCol for a foreign  
scan plan node.  This again would bollix the results for queries that  
test a foreign table's tableoid.  
  
Back-patch the first fix to 9.3 where postgres_fdw was introduced.  
Back-patch the second to 9.2.  The code is probably broken in 9.1 as  
well, but the patch doesn't apply cleanly there; given the weak state  
of support for FDWs in 9.1, it doesn't seem worth fixing.  
  
Etsuro Fujita, reviewed by Ashutosh Bapat, and somewhat modified by me  

M contrib/postgres_fdw/deparse.c
M contrib/postgres_fdw/expected/postgres_fdw.out
M contrib/postgres_fdw/sql/postgres_fdw.sql
M src/backend/optimizer/plan/createplan.c

Improve documentation's description of JOIN clauses.

commit   : 0632eff4389a2682c49db7fbe16968bb076060a5    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 19 Nov 2014 16:00:27 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 19 Nov 2014 16:00:27 -0500    

Click here for diff

In bug #12000, Andreas Kunert complained that the documentation was  
misleading in saying "FROM T1 CROSS JOIN T2 is equivalent to FROM T1, T2".  
That's correct as far as it goes, but the equivalence doesn't hold when  
you consider three or more tables, since JOIN binds more tightly than  
comma.  I added a <note> to explain this, and ended up rearranging some  
of the existing text so that the note would make sense in context.  
  
In passing, rewrite the description of JOIN USING, which was unnecessarily  
vague, and hadn't been helped any by somebody's reliance on markup as a  
substitute for clear writing.  (Mostly this involved reintroducing a  
concrete example that was unaccountably removed by commit 032f3b7e166cfa28.)  
  
Back-patch to all supported branches.  

M doc/src/sgml/queries.sgml

Avoid file descriptor leak in pg_test_fsync.

commit   : a9f3280efee0d3c4f697ef33f28cbc8e626f9e86    
  
author   : Robert Haas <[email protected]>    
date     : Wed, 19 Nov 2014 11:57:54 -0500    
  
committer: Robert Haas <[email protected]>    
date     : Wed, 19 Nov 2014 11:57:54 -0500    

Click here for diff

This can cause problems on Windows, where files that are still open  
can't be unlinked.  
  
Jeff Janes  

M contrib/pg_test_fsync/pg_test_fsync.c

Fix bug in the test of file descriptor of current WAL file in pg_receivexlog.

commit   : 78f91f1a888008f329b1a6db673713d25bbd819b    
  
author   : Fujii Masao <[email protected]>    
date     : Wed, 19 Nov 2014 19:11:03 +0900    
  
committer: Fujii Masao <[email protected]>    
date     : Wed, 19 Nov 2014 19:11:03 +0900    

Click here for diff

In pg_receivexlog, in order to check whether the current WAL file is  
being opened or not, its file descriptor has to be checked against -1  
as an invalid value. But, oops, 7900e94 added the incorrect test  
checking the descriptor against 1. This commit fixes that bug.  
  
Back-patch to 9.4 where the bug was added.  
  
Spotted by Magnus Hagander  

M src/bin/pg_basebackup/receivelog.c

Fix pg_receivexlog --slot so that it doesn't prevent the server shutdown.

commit   : 7900e94fbb2d36fe798f2deda56d71071957c0e0    
  
author   : Fujii Masao <[email protected]>    
date     : Wed, 19 Nov 2014 14:11:48 +0900    
  
committer: Fujii Masao <[email protected]>    
date     : Wed, 19 Nov 2014 14:11:48 +0900    

Click here for diff

When pg_receivexlog --slot is connecting to the server, at the shutdown  
of the server, walsender keeps waiting for the last WAL record to be  
replicated and flushed in pg_receivexlog. But previously pg_receivexlog  
issued sync command only when WAL file was switched. So there was  
the case where the last WAL was never flushed and walsender had to  
keep waiting infinitely. This caused the server shutdown to get stuck.  
  
pg_recvlogical handles this problem by calling fsync() when it receives  
the request of immediate reply from the server. That is, at shutdown,  
walsender sends the request, pg_recvlogical receives it, flushes the last  
WAL record, and sends the flush location back to the server. Since  
walsender can see that the last WAL record is successfully flushed, it can  
exit cleanly.  
  
This commit introduces the same logic as pg_recvlogical has,  
to pg_receivexlog.  
  
Back-patch to 9.4 where pg_receivexlog was changed so that it can use  
the replication slot.  
  
Original patch by Michael Paquier, rewritten by me.  
Bug report by Furuya Osamu.  

M src/bin/pg_basebackup/receivelog.c

Don't require bleeding-edge timezone data in timestamptz regression test.

commit   : e1ab2fa823692e13b2302ba2959f297acb4f1758    
  
author   : Tom Lane <[email protected]>    
date     : Tue, 18 Nov 2014 21:36:43 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Tue, 18 Nov 2014 21:36:43 -0500    

Click here for diff

The regression test cases added in commits b2cbced9e et al depended in part  
on the Russian timezone offset changes of Oct 2014.  While this is of no  
particular concern for a default Postgres build, it was possible for a  
build using --with-system-tzdata to fail the tests if the system tzdata  
database wasn't au courant.  Bjorn Munch and Christoph Berg both complained  
about this while packaging 9.4rc1, so we probably shouldn't insist on the  
system tzdata being up-to-date.  Instead, make an equivalent test using a  
zone change that occurred in Venezuela in 2007.  With this patch, the  
regression tests should pass using any tzdata set from 2012 or later.  
(I can't muster much sympathy for somebody using --with-system-tzdata  
on a machine whose system tzdata is more than three years out-of-date.)  

M src/test/regress/expected/timestamptz.out
M src/test/regress/sql/timestamptz.sql

Fix some bogus direct uses of realloc().

commit   : 3aa3ae8e1d959681d3396fe176cd8086e3b26c55    
  
author   : Tom Lane <[email protected]>    
date     : Tue, 18 Nov 2014 13:28:09 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Tue, 18 Nov 2014 13:28:09 -0500    

Click here for diff

pg_dump/parallel.c was using realloc() directly with no error check.  
While the odds of an actual failure here seem pretty low, Coverity  
complains about it, so fix by using pg_realloc() instead.  
  
While looking for other instances, I noticed a couple of places in  
psql that hadn't gotten the memo about the availability of pg_realloc.  
These aren't bugs, since they did have error checks, but verbosely  
inconsistent code is not a good thing.  
  
Back-patch as far as 9.3.  9.2 did not have pg_dump/parallel.c, nor  
did it have pg_realloc available in all frontend code.  

M src/bin/pg_dump/parallel.c
M src/bin/psql/command.c
M src/bin/psql/tab-complete.c

Stamp 9.4rc1.

commit   : d5bea1fbcc24a9880ddc2ede29a6fedb41de9292    
  
author   : Tom Lane <[email protected]>    
date     : Mon, 17 Nov 2014 15:54:40 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Mon, 17 Nov 2014 15:54:40 -0500    

Click here for diff

M configure
M configure.in
M doc/bug.template
M src/include/pg_config.h.win32

Update 9.4 release notes for commits through today.

commit   : c7b412380d5507fbaf1e4ff54844ac9bde9771c5    
  
author   : Tom Lane <[email protected]>    
date     : Mon, 17 Nov 2014 14:47:13 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Mon, 17 Nov 2014 14:47:13 -0500    

Click here for diff

M doc/src/sgml/release-9.4.sgml

Update time zone data files to tzdata release 2014j.

commit   : ddf7db58420375c75e3fb1f5fc6cbb90c5ee9b0c    
  
author   : Tom Lane <[email protected]>    
date     : Mon, 17 Nov 2014 12:08:02 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Mon, 17 Nov 2014 12:08:02 -0500    

Click here for diff

DST law changes in the Turks & Caicos Islands (America/Grand_Turk) and  
in Fiji.  New zone Pacific/Bougainville for portions of Papua New Guinea.  
Historical changes for Korea and Vietnam.  

M src/timezone/data/africa
M src/timezone/data/asia
M src/timezone/data/australasia
M src/timezone/data/backzone
M src/timezone/data/europe
M src/timezone/data/leapseconds
M src/timezone/data/northamerica
M src/timezone/data/southamerica
M src/timezone/data/zone.tab
M src/timezone/data/zone1970.tab
M src/timezone/known_abbrevs.txt
M src/timezone/tznames/Default
M src/timezone/tznames/Europe.txt
M src/timezone/tznames/Pacific.txt

commit   : 8607fdf0337051ca1da493ded5db15c41da08d66    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Mon, 17 Nov 2014 18:42:04 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Mon, 17 Nov 2014 18:42:04 +0200    

Click here for diff

There was some confusion on how to record the case that the operation  
unlinks the last non-leaf page in the branch being deleted.  
_bt_unlink_halfdead_page set the "topdead" field in the WAL record to  
the leaf page, but the redo routine assumed that it would be an invalid  
block number in that case. This commit fixes _bt_unlink_halfdead_page to  
do what the redo routine expected.  
  
This code is new in 9.4, so backpatch there.  

M src/backend/access/nbtree/nbtpage.c

Translation updates

commit   : d8a7cdde585c49037cdfdc624223dd53cd868a30    
  
author   : Peter Eisentraut <[email protected]>    
date     : Sun, 16 Nov 2014 21:31:08 -0500    
  
committer: Peter Eisentraut <[email protected]>    
date     : Sun, 16 Nov 2014 21:31:08 -0500    

Click here for diff

M src/backend/po/de.po
M src/backend/po/pl.po
M src/backend/po/ru.po
M src/bin/initdb/po/pl.po
M src/bin/pg_basebackup/po/de.po
M src/bin/pg_basebackup/po/pl.po
M src/bin/pg_basebackup/po/ru.po
M src/bin/pg_controldata/nls.mk
M src/bin/pg_controldata/po/pl.po
A src/bin/pg_controldata/po/sv.po
M src/bin/pg_ctl/po/pl.po
M src/bin/pg_ctl/po/sv.po
M src/bin/pg_dump/po/de.po
M src/bin/pg_resetxlog/po/pl.po
M src/bin/psql/po/de.po
M src/bin/psql/po/pl.po
M src/bin/psql/po/ru.po
M src/bin/scripts/po/pl.po
M src/interfaces/ecpg/preproc/po/pl.po
M src/pl/plpgsql/src/po/pl.po
M src/pl/plpython/po/pl.po

Mention the TZ environment variable for initdb

commit   : e668b366304b526a354f8ff5a3eed683c818f7a9    
  
author   : Magnus Hagander <[email protected]>    
date     : Sun, 16 Nov 2014 15:48:30 +0100    
  
committer: Magnus Hagander <[email protected]>    
date     : Sun, 16 Nov 2014 15:48:30 +0100    

Click here for diff

Daniel Gustafsson  

M doc/src/sgml/ref/initdb.sgml

Fix duplicated platforms due to copy/paste error

commit   : 6d301af4c023ac5655d88acbe55f7f49036ee50c    
  
author   : Magnus Hagander <[email protected]>    
date     : Sun, 16 Nov 2014 15:47:10 +0100    
  
committer: Magnus Hagander <[email protected]>    
date     : Sun, 16 Nov 2014 15:47:10 +0100    

Click here for diff

Patch from Michael Paquier, mistake spotted by KOIZUMI Satoru  

M doc/src/sgml/installation.sgml

Fix initdb --sync-only to also sync tablespaces.

commit   : f52b3c44632f99d53973be57e5c729cfc3d6430f    
  
author   : Andres Freund <[email protected]>    
date     : Fri, 14 Nov 2014 18:22:12 +0100    
  
committer: Andres Freund <[email protected]>    
date     : Fri, 14 Nov 2014 18:22:12 +0100    

Click here for diff

630cd14426dc added initdb --sync-only, for use by pg_upgrade, by just  
exposing the existing fsync code. That's wrong, because initdb so far  
had absolutely no reason to deal with tablespaces.  
  
Fix --sync-only by additionally explicitly syncing each of the  
tablespaces.  
  
Backpatch to 9.3 where --sync-only was introduced.  
  
Abhijit Menon-Sen and Andres Freund  

M src/bin/initdb/initdb.c

Sync unlogged relations to disk after they have been reset.

commit   : e26a920acb77b953d1034e243d6a8c7294dbd25d    
  
author   : Andres Freund <[email protected]>    
date     : Fri, 14 Nov 2014 18:21:30 +0100    
  
committer: Andres Freund <[email protected]>    
date     : Fri, 14 Nov 2014 18:21:30 +0100    

Click here for diff

Unlogged relations are only reset when performing a unclean  
restart. That means they have to be synced to disk during clean  
shutdowns. During normal processing that's achieved by registering a  
buffer's file to be fsynced at the next checkpoint when flushed. But  
ResetUnloggedRelations() doesn't go through the buffer manager, so  
nothing will force reset relations to disk before the next shutdown  
checkpoint.  
  
So just make ResetUnloggedRelations() fsync the newly created main  
forks to disk.  
  
Discussion: [email protected]  
  
Backpatch to 9.1 where unlogged tables were introduced.  
  
Abhijit Menon-Sen and Andres Freund  

M src/backend/storage/file/reinit.c

Ensure unlogged tables are reset even if crash recovery errors out.

commit   : 1a2cb1ea84a1745247a7b41f1b0188889e815794    
  
author   : Andres Freund <[email protected]>    
date     : Fri, 14 Nov 2014 18:20:59 +0100    
  
committer: Andres Freund <[email protected]>    
date     : Fri, 14 Nov 2014 18:20:59 +0100    

Click here for diff

Unlogged relations are reset at the end of crash recovery as they're  
only synced to disk during a proper shutdown. Unfortunately that and  
later steps can fail, e.g. due to running out of space. This reset  
was, up to now performed after marking the database as having finished  
crash recovery successfully. As out of space errors trigger a crash  
restart that could lead to the situation that not all unlogged  
relations are reset.  
  
Once that happend usage of unlogged relations could yield errors like  
"could not open file "...": No such file or directory". Luckily  
clusters that show the problem can be fixed by performing a immediate  
shutdown, and starting the database again.  
  
To fix, just call ResetUnloggedRelations(UNLOGGED_RELATION_INIT)  
earlier, before marking the database as having successfully recovered.  
  
Discussion: [email protected]  
  
Backpatch to 9.1 where unlogged tables were introduced.  
  
Abhijit Menon-Sen and Andres Freund  

M src/backend/access/transam/xlog.c

Document evaluation-order considerations for aggregate functions.

commit   : df3e23e1b509001ac9336763404406bdcad04dcc    
  
author   : Tom Lane <[email protected]>    
date     : Fri, 14 Nov 2014 17:19:29 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Fri, 14 Nov 2014 17:19:29 -0500    

Click here for diff

The SELECT reference page didn't really address the question of when  
aggregate function evaluation occurs, nor did the "expression evaluation  
rules" documentation mention that CASE can't be used to control whether  
an aggregate gets evaluated or not.  Improve that.  
  
Per discussion of bug #11661.  Original text by Marti Raudsepp and Michael  
Paquier, rewritten significantly by me.  

M doc/src/sgml/ref/select.sgml
M doc/src/sgml/syntax.sgml

Revert change to ALTER TABLESPACE summary.

commit   : 2113f7215d2e13f07c277a86efae900b25d94dc1    
  
author   : Stephen Frost <[email protected]>    
date     : Fri, 14 Nov 2014 15:16:01 -0500    
  
committer: Stephen Frost <[email protected]>    
date     : Fri, 14 Nov 2014 15:16:01 -0500    

Click here for diff

When ALTER TABLESPACE MOVE ALL was changed to be ALTER TABLE ALL IN  
TABLESPACE, the ALTER TABLESPACE summary should have been adjusted back  
to its original definition.  
  
Patch by Thom Brown (thanks!).  

M doc/src/sgml/ref/alter_tablespace.sgml

Allow interrupting GetMultiXactIdMembers

commit   : 137e4da6df75a671d53bcc1e66097533c93c8732    
  
author   : Alvaro Herrera <[email protected]>    
date     : Fri, 14 Nov 2014 15:14:02 -0300    
  
committer: Alvaro Herrera <[email protected]>    
date     : Fri, 14 Nov 2014 15:14:02 -0300    

Click here for diff

This function has a loop which can lead to uninterruptible process  
"stalls" (actually infinite loops) when some bugs are triggered.  Avoid  
that unpleasant situation by adding a check for interrupts in a place  
that shouldn't degrade performance in the normal case.  
  
Backpatch to 9.3.  Older branches have an identical loop here, but the  
aforementioned bugs are only a problem starting in 9.3 so there doesn't  
seem to be any point in backpatching any further.  

M src/backend/access/transam/multixact.c

Improve logical decoding log messages

commit   : 16695d601e73792c3e49f324b48ff25af96c83d9    
  
author   : Peter Eisentraut <[email protected]>    
date     : Thu, 13 Nov 2014 20:43:55 -0500    
  
committer: Peter Eisentraut <[email protected]>    
date     : Thu, 13 Nov 2014 20:43:55 -0500    

Click here for diff

suggestions from Robert Haas  

M src/backend/replication/logical/snapbuild.c

Fix pg_dumpall to restore its ability to dump from ancient servers.

commit   : 2c267e47afa4f9a7cc8f04f43e440dfdf9fd3ed7    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 13 Nov 2014 18:19:28 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 13 Nov 2014 18:19:28 -0500    

Click here for diff

Fix breakage induced by commits d8d3d2a4f37f6df5d0118b7f5211978cca22091a  
and 463f2625a5fb183b6a8925ccde98bb3889f921d9: pg_dumpall has crashed when  
attempting to dump from pre-8.1 servers since then, due to faulty  
construction of the query used for dumping roles from older servers.  
The query was erroneous as of the earlier commit, but it wasn't exposed  
unless you tried to use --binary-upgrade, which you presumably wouldn't  
with a pre-8.1 server.  However commit 463f2625a made it fail always.  
  
In HEAD, also fix additional breakage induced in the same query by  
commit 491c029dbc4206779cf659aa0ff986af7831d2ff, which evidently wasn't  
tested against pre-8.1 servers either.  
  
The bug is only latent in 9.1 because 463f2625a hadn't landed yet, but  
it seems best to back-patch all branches containing the faulty query.  
  
Gilles Darold  

M src/bin/pg_dump/pg_dumpall.c

Fix and improve cache invalidation logic for logical decoding.

commit   : 11868e1704cae36ee13303eaf9f5f5f656870426    
  
author   : Andres Freund <[email protected]>    
date     : Thu, 13 Nov 2014 19:06:43 +0100    
  
committer: Andres Freund <[email protected]>    
date     : Thu, 13 Nov 2014 19:06:43 +0100    

Click here for diff

There are basically three situations in which logical decoding needs  
to perform cache invalidation. During/After replaying a transaction  
with catalog changes, when skipping a uninteresting transaction that  
performed catalog changes and when erroring out while replaying a  
transaction. Unfortunately these three cases were all done slightly  
differently - partially because 8de3e410fa, which greatly simplifies  
matters, got committed in the midst of the development of logical  
decoding.  
  
The actually problematic case was when logical decoding skipped  
transaction commits (and thus processed invalidations). When used via  
the SQL interface cache invalidation could access the catalog - bad,  
because we didn't set up enough state to allow that correctly. It'd  
not be hard to setup sufficient state, but the simpler solution is to  
always perform cache invalidation outside a valid transaction.  
  
Also make the different cache invalidation cases look as similar as  
possible, to ease code review.  
  
This fixes the assertion failure reported by Antonin Houska in  
[email protected]. The presented testcase has been expanded  
into a regression test.  
  
Backpatch to 9.4, where logical decoding was introduced.  

M contrib/test_decoding/Makefile
A contrib/test_decoding/expected/decoding_into_rel.out
A contrib/test_decoding/sql/decoding_into_rel.sql
M src/backend/replication/logical/reorderbuffer.c

Fix xmin/xmax horizon computation during logical decoding initialization.

commit   : da668a5d8f92af33d1f01b20993f4e1cf3735973    
  
author   : Andres Freund <[email protected]>    
date     : Thu, 13 Nov 2014 19:06:43 +0100    
  
committer: Andres Freund <[email protected]>    
date     : Thu, 13 Nov 2014 19:06:43 +0100    

Click here for diff

When building the initial historic catalog snapshot there were  
scenarios where snapbuild.c would use incorrect xmin/xmax values when  
starting from a xl_running_xacts record. The values used were always a  
bit suspect, but happened to be correct in the easy to test  
cases. Notably the values used when the the initial snapshot was  
computed while no other transactions were running were correct.  
  
This is likely to be the cause of the occasional buildfarm failures on  
animals markhor and tick; but it's quite possible to reproduce  
problems without CLOBBER_CACHE_ALWAYS.  
  
Backpatch to 9.4, where logical decoding was introduced.  

M src/backend/replication/logical/snapbuild.c

Fix race condition between hot standby and restoring a full-page image.

commit   : 8fc23a9ed0a040d039431ef79b1bf166395ed180    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Thu, 13 Nov 2014 19:47:44 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Thu, 13 Nov 2014 19:47:44 +0200    

Click here for diff

There was a window in RestoreBackupBlock where a page would be zeroed out,  
but not yet locked. If a backend pinned and locked the page in that window,  
it saw the zeroed page instead of the old page or new page contents, which  
could lead to missing rows in a result set, or errors.  
  
To fix, replace RBM_ZERO with RBM_ZERO_AND_LOCK, which atomically pins,  
zeroes, and locks the page, if it's not in the buffer cache already.  
  
In stable branches, the old RBM_ZERO constant is renamed to RBM_DO_NOT_USE,  
to avoid breaking any 3rd party extensions that might use RBM_ZERO. More  
importantly, this avoids renumbering the other enum values, which would  
cause even bigger confusion in extensions that use ReadBufferExtended, but  
haven't been recompiled.  
  
Backpatch to all supported versions; this has been racy since hot standby  
was introduced.  

M src/backend/access/hash/hashpage.c
M src/backend/access/heap/heapam.c
M src/backend/access/transam/xlog.c
M src/backend/access/transam/xlogutils.c
M src/backend/storage/buffer/bufmgr.c
M src/include/storage/bufmgr.h

Tweak row-level locking documentation

commit   : 955b4ba7f6948359efcef1c47035d382f937e9f3    
  
author   : Alvaro Herrera <[email protected]>    
date     : Thu, 13 Nov 2014 14:45:58 -0300    
  
committer: Alvaro Herrera <[email protected]>    
date     : Thu, 13 Nov 2014 14:45:58 -0300    

Click here for diff

Move the meat of locking levels to mvcc.sgml, leaving only a link to it  
in the SELECT reference page.  
  
Michael Paquier, with some tweaks by Álvaro  

M doc/src/sgml/mvcc.sgml
M doc/src/sgml/ref/select.sgml

doc: Add index entry for "hypothetical-set aggregate"

commit   : a3408059dd66b3b9929e04b3697213b31ccb5253    
  
author   : Peter Eisentraut <[email protected]>    
date     : Thu, 13 Nov 2014 11:57:16 -0500    
  
committer: Peter Eisentraut <[email protected]>    
date     : Thu, 13 Nov 2014 11:57:16 -0500    

Click here for diff

M doc/src/sgml/func.sgml

Explicitly support the case that a plancache's raw_parse_tree is NULL.

commit   : 40b85a3ab11e99096dc4489153cfdd4884cdecd3    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 12 Nov 2014 15:58:40 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 12 Nov 2014 15:58:40 -0500    

Click here for diff

This only happens if a client issues a Parse message with an empty query  
string, which is a bit odd; but since it is explicitly called out as legal  
by our FE/BE protocol spec, we'd probably better continue to allow it.  
  
Fix by adding tests everywhere that the raw_parse_tree field is passed to  
functions that don't or shouldn't accept NULL.  Also make it clear in the  
relevant comments that NULL is an expected case.  
  
This reverts commits a73c9dbab0165b3395dfe8a44a7dfd16166963c4 and  
2e9650cbcff8c8fb0d9ef807c73a44f241822eee, which fixed specific crash  
symptoms by hacking things at what now seems to be the wrong end, ie the  
callee functions.  Making the callees allow NULL is superficially more  
robust, but it's not always true that there is a defensible thing for the  
callee to do in such cases.  The caller has more context and is better  
able to decide what the empty-query case ought to do.  
  
Per followup discussion of bug #11335.  Back-patch to 9.2.  The code  
before that is sufficiently different that it would require development  
of a separate patch, which doesn't seem worthwhile for what is believed  
to be an essentially cosmetic change.  

M src/backend/executor/spi.c
M src/backend/parser/analyze.c
M src/backend/tcop/postgres.c
M src/backend/tcop/utility.c
M src/backend/utils/cache/plancache.c
M src/include/utils/plancache.h

Fix several weaknesses in slot and logical replication on-disk serialization.

commit   : 5005469cb2f2bf8a57344b43f97969292ebebb76    
  
author   : Andres Freund <[email protected]>    
date     : Wed, 12 Nov 2014 18:52:49 +0100    
  
committer: Andres Freund <[email protected]>    
date     : Wed, 12 Nov 2014 18:52:49 +0100    

Click here for diff

Heikki noticed in [email protected] that slot.c and  
snapbuild.c were missing the FIN_CRC32 call when computing/checking  
checksums of on disk files. That doesn't lower the the error detection  
capabilities of the checksum, but is inconsistent with other usages.  
  
In a followup mail Heikki also noticed that, contrary to a comment,  
the 'version' and 'length' struct fields of replication slot's on disk  
data where not covered by the checksum. That's not likely to lead to  
actually missed corruption as those fields are cross checked with the  
expected version and the actual file length. But it's wrong  
nonetheless.  
  
As fixing these issues makes existing on disk files unreadable, bump  
the expected versions of on disk files for both slots and logical  
decoding historic catalog snapshots.  This means that loading old  
files will fail with  
ERROR: "replication slot file ... has unsupported version 1"  
and  
ERROR: "snapbuild state file ... has unsupported version 1 instead of  
2" respectively. Given the low likelihood of anybody already using  
these new features in a production setup that seems acceptable.  
  
Fixing these issues made me notice that there's no regression test  
covering the loading of historic snapshot from disk - so add one.  
  
Backpatch to 9.4 where these features were introduced.  

M contrib/test_decoding/Makefile
A contrib/test_decoding/expected/ondisk_startup.out
A contrib/test_decoding/specs/ondisk_startup.spec
M src/backend/replication/logical/snapbuild.c
M src/backend/replication/slot.c

Add interrupt checks to contrib/pg_prewarm.

commit   : 57b2e1049e7fdb0ca7882c74520e409507462eb2    
  
author   : Andres Freund <[email protected]>    
date     : Wed, 12 Nov 2014 18:52:49 +0100    
  
committer: Andres Freund <[email protected]>    
date     : Wed, 12 Nov 2014 18:52:49 +0100    

Click here for diff

Currently the extension's pg_prewarm() function didn't check  
interrupts once it started "warming" data. Since individual calls can  
take a long while it's important for them to be interruptible.  
  
Backpatch to 9.4 where pg_prewarm was introduced.  

M contrib/pg_prewarm/pg_prewarm.c

Use just one database connection in the "tablespace" test.

commit   : c4d360d18259690442036c1ee07a899cbe4022a0    
  
author   : Noah Misch <[email protected]>    
date     : Wed, 12 Nov 2014 07:33:17 -0500    
  
committer: Noah Misch <[email protected]>    
date     : Wed, 12 Nov 2014 07:33:17 -0500    

Click here for diff

On Windows, DROP TABLESPACE has a race condition when run concurrently  
with other processes having opened files in the tablespace.  This led to  
a rare failure on buildfarm member frogmouth.  Back-patch to 9.4, where  
the reconnection was introduced.  

M src/backend/commands/tablespace.c
M src/test/regress/input/tablespace.source
M src/test/regress/output/tablespace.source

Message improvements

commit   : 8fb4218ef41da0baff4909c5d74f23513bac9950    
  
author   : Peter Eisentraut <[email protected]>    
date     : Tue, 11 Nov 2014 20:00:58 -0500    
  
committer: Peter Eisentraut <[email protected]>    
date     : Tue, 11 Nov 2014 20:00:58 -0500    

Click here for diff

M src/backend/libpq/auth.c
M src/backend/replication/logical/logical.c
M src/backend/replication/logical/reorderbuffer.c
M src/backend/replication/logical/snapbuild.c
M src/backend/replication/slot.c
M src/backend/utils/misc/guc.c

Loop when necessary in contrib/pgcrypto's pktreader_pull().

commit   : 1c73485c695af2dfa7a7f7bec6e1ab8d4eaab7ab    
  
author   : Tom Lane <[email protected]>    
date     : Tue, 11 Nov 2014 17:22:15 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Tue, 11 Nov 2014 17:22:15 -0500    

Click here for diff

This fixes a scenario in which pgp_sym_decrypt() failed with "Wrong key  
or corrupt data" on messages whose length is 6 less than a power of 2.  
  
Per bug #11905 from Connor Penhale.  Fix by Marko Tiikkaja, regression  
test case from Jeff Janes.  

M contrib/pgcrypto/expected/pgp-decrypt.out
M contrib/pgcrypto/pgp-decrypt.c
M contrib/pgcrypto/sql/pgp-decrypt.sql

Fix dependency searching for case where column is visited before table.

commit   : 951c2f6faf00a00ab824699c96376d1d8f5acc57    
  
author   : Tom Lane <[email protected]>    
date     : Tue, 11 Nov 2014 17:00:18 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Tue, 11 Nov 2014 17:00:18 -0500    

Click here for diff

When the recursive search in dependency.c visits a column and then later  
visits the whole table containing the column, it needs to propagate the  
drop-context flags for the table to the existing target-object entry for  
the column.  Otherwise we might refuse the DROP (if not CASCADE) on the  
incorrect grounds that there was no automatic drop pathway to the column.  
Remarkably, this has not been reported before, though it's possible at  
least when an extension creates both a datatype and a table using that  
datatype.  
  
Rather than just marking the column as allowed to be dropped, it might  
seem good to skip the DROP COLUMN step altogether, since the later DROP  
of the table will surely get the job done.  The problem with that is that  
the datatype would then be dropped before the table (since the whole  
situation occurred because we visited the datatype, and then recursed to  
the dependent column, before visiting the table).  That seems pretty risky,  
and the case is rare enough that it doesn't seem worth expending a lot of  
effort or risk to make the drops happen in a safe order.  So we just play  
dumb and delete the column separately according to the existing drop  
ordering rules.  
  
Per report from Petr Jelinek, though this is different from his proposed  
patch.  
  
Back-patch to 9.1, where extensions were introduced.  There's currently  
no evidence that such cases can arise before 9.1, and in any case we would  
also need to back-patch cb5c2ba2d82688d29b5902d86b993a54355cad4d to 9.0  
if we wanted to back-patch this.  

M src/backend/catalog/dependency.c

Ensure that RowExprs and whole-row Vars produce the expected column names.

commit   : f449873623605bc1906f2a5daa56f2343c473e1b    
  
author   : Tom Lane <[email protected]>    
date     : Mon, 10 Nov 2014 15:21:14 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Mon, 10 Nov 2014 15:21:14 -0500    

Click here for diff

At one time it wasn't terribly important what column names were associated  
with the fields of a composite Datum, but since the introduction of  
operations like row_to_json(), it's important that looking up the rowtype  
ID embedded in the Datum returns the column names that users would expect.  
That did not work terribly well before this patch: you could get the column  
names of the underlying table, or column aliases from any level of the  
query, depending on minor details of the plan tree.  You could even get  
totally empty field names, which is disastrous for cases like row_to_json().  
  
To fix this for whole-row Vars, look to the RTE referenced by the Var, and  
make sure its column aliases are applied to the rowtype associated with  
the result Datums.  This is a tad scary because we might have to return  
a transient RECORD type even though the Var is declared as having some  
named rowtype.  In principle it should be all right because the record  
type will still be physically compatible with the named rowtype; but  
I had to weaken one Assert in ExecEvalConvertRowtype, and there might be  
third-party code containing similar assumptions.  
  
Similarly, RowExprs have to be willing to override the column names coming  
from a named composite result type and produce a RECORD when the column  
aliases visible at the site of the RowExpr differ from the underlying  
table's column names.  
  
In passing, revert the decision made in commit 398f70ec070fe601 to add  
an alias-list argument to ExecTypeFromExprList: better to provide that  
functionality in a separate function.  This also reverts most of the code  
changes in d68581483564ec0f, which we don't need because we're no longer  
depending on the tupdesc found in the child plan node's result slot to be  
blessed.  
  
Back-patch to 9.4, but not earlier, since this solution changes the results  
in some cases that users might not have realized were buggy.  We'll apply a  
more restricted form of this patch in older branches.  

M src/backend/executor/execQual.c
M src/backend/executor/execTuples.c
M src/backend/executor/nodeFunctionscan.c
M src/backend/executor/nodeValuesscan.c
M src/include/executor/executor.h
M src/include/nodes/execnodes.h
M src/test/regress/expected/rowtypes.out
M src/test/regress/sql/rowtypes.sql

pg_basebackup: Adjust tests for long file name issues

commit   : ef52e3a7b4fbcddd64afb5b528f945d6bb21aeb1    
  
author   : Peter Eisentraut <[email protected]>    
date     : Fri, 7 Nov 2014 20:47:38 -0500    
  
committer: Peter Eisentraut <[email protected]>    
date     : Fri, 7 Nov 2014 20:47:38 -0500    

Click here for diff

Work around accidental test failures because the working directory path  
is too long by creating a temporary directory in the (hopefully shorter)  
system location, symlinking that to the working directory, and creating  
the tablespaces using the shorter path.  

M src/bin/pg_basebackup/t/010_pg_basebackup.pl

doc: Update pg_receivexlog note

commit   : 342bcee4aa142ce4b119838a4c5d6debd694539f    
  
author   : Peter Eisentraut <[email protected]>    
date     : Fri, 7 Nov 2014 20:15:22 -0500    
  
committer: Peter Eisentraut <[email protected]>    
date     : Fri, 7 Nov 2014 20:15:22 -0500    

Click here for diff

The old note about how to use pg_receivexlog as an alternative to  
archive_command was obsoleted by replication slots.  

M doc/src/sgml/ref/pg_receivexlog.sgml

Fix generation of SP-GiST vacuum WAL records.

commit   : f36f4fbdca3de615acb2fc232f6bc72d6db19bde    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Fri, 7 Nov 2014 21:14:35 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Fri, 7 Nov 2014 21:14:35 +0200    

Click here for diff

I broke these in 8776faa81cb651322b8993422bdd4633f1f6a487. Backpatch to  
9.4, where that was done.  

M src/backend/access/spgist/spgvacuum.c

Cope with more than 64K phrases in a thesaurus dictionary.

commit   : eed245a113c299976e548f018c758617bc20efd0    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 6 Nov 2014 20:52:40 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 6 Nov 2014 20:52:40 -0500    

Click here for diff

dict_thesaurus stored phrase IDs in uint16 fields, so it would get confused  
and even crash if there were more than 64K entries in the configuration  
file.  It turns out to be basically free to widen the phrase IDs to uint32,  
so let's just do so.  
  
This was complained of some time ago by David Boutin (in bug #7793);  
he later submitted an informal patch but it was never acted on.  
We now have another complaint (bug #11901 from Luc Ouellette) so it's  
time to make something happen.  
  
This is basically Boutin's patch, but for future-proofing I also added a  
defense against too many words per phrase.  Note that we don't need any  
explicit defense against overflow of the uint32 counters, since before that  
happens we'd hit array allocation sizes that repalloc rejects.  
  
Back-patch to all supported branches because of the crash risk.  

M src/backend/tsearch/dict_thesaurus.c

Fix normalization of numeric values in JSONB GIN indexes.

commit   : 42020f5deb5d3a3b6593152cc1a95dbfa5250275    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 6 Nov 2014 11:41:06 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 6 Nov 2014 11:41:06 -0500    

Click here for diff

The default JSONB GIN opclass (jsonb_ops) converts numeric data values  
to strings for storage in the index.  It must ensure that numeric values  
that would compare equal (such as 12 and 12.00) produce identical strings,  
else index searches would have behavior different from regular JSONB  
comparisons.  Unfortunately the function charged with doing this was  
completely wrong: it could reduce distinct numeric values to the same  
string, or reduce equivalent numeric values to different strings.  The  
former type of error would only lead to search inefficiency, but the  
latter type of error would cause index entries that should be found by  
a search to not be found.  
  
Repairing this bug therefore means that it will be necessary for 9.4 beta  
testers to reindex GIN jsonb_ops indexes, if they care about getting  
correct results from index searches involving numeric data values within  
the comparison JSONB object.  
  
Per report from Thomas Fanghaenel.  

M src/backend/utils/adt/numeric.c

Prevent the unnecessary creation of .ready file for the timeline history file.

commit   : cc76577873945183352fa6e1e82cc14606c28fd3    
  
author   : Fujii Masao <[email protected]>    
date     : Thu, 6 Nov 2014 21:24:40 +0900    
  
committer: Fujii Masao <[email protected]>    
date     : Thu, 6 Nov 2014 21:24:40 +0900    

Click here for diff

Previously .ready file was created for the timeline history file at the end  
of an archive recovery even when WAL archiving was not enabled.  
This creation is unnecessary and causes .ready file to remain infinitely.  
  
This commit changes an archive recovery so that it creates .ready file for  
the timeline history file only when WAL archiving is enabled.  
  
Backpatch to all supported versions.  

M src/backend/access/transam/timeline.c

Fix volatility markings of some contrib I/O functions.

commit   : 26a95a1e521e4ae1a2ebdcc0db5745ee8d1285cc    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 5 Nov 2014 11:34:13 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 5 Nov 2014 11:34:13 -0500    

Click here for diff

In general, datatype I/O functions are supposed to be immutable or at  
worst stable.  Some contrib I/O functions were, through oversight, not  
marked with any volatility property at all, which made them VOLATILE.  
Since (most of) these functions actually behave immutably, the erroneous  
marking isn't terribly harmful; but it can be user-visible in certain  
circumstances, as per a recent bug report from Joe Van Dyk in which a  
cast to text was disallowed in an expression index definition.  
  
To fix, just adjust the declarations in the extension SQL scripts.  If we  
were being very fussy about this, we'd bump the extension version numbers,  
but that seems like more trouble (for both developers and users) than the  
problem is worth.  
  
A fly in the ointment is that chkpass_in actually is volatile, because  
of its use of random() to generate a fresh salt when presented with a  
not-yet-encrypted password.  This is bad because of the general assumption  
that I/O functions aren't volatile: the consequence is that records or  
arrays containing chkpass elements may have input behavior a bit different  
from a bare chkpass column.  But there seems no way to fix this without  
breaking existing usage patterns for chkpass, and the consequences of the  
inconsistency don't seem bad enough to justify that.  So for the moment,  
just document it in a comment.  
  
Since we're not bumping version numbers, there seems no harm in  
back-patching these fixes; at least future installations will get the  
functions marked correctly.  

M contrib/chkpass/chkpass–1.0.sql
M contrib/ltree/ltree–1.0.sql
M contrib/pg_trgm/pg_trgm–1.1.sql

doc: Move misplaced paragraph

commit   : 63ff971e06461e67b8108cf360c4a6eb03adb160    
  
author   : Peter Eisentraut <[email protected]>    
date     : Tue, 4 Nov 2014 16:10:58 -0500    
  
committer: Peter Eisentraut <[email protected]>    
date     : Tue, 4 Nov 2014 16:10:58 -0500    

Click here for diff

M doc/src/sgml/protocol.sgml

Drop no-longer-needed buffers during ALTER DATABASE SET TABLESPACE.

commit   : a192d5d05dd943d8fde0c52f4a924690696daec1    
  
author   : Tom Lane <[email protected]>    
date     : Tue, 4 Nov 2014 13:24:10 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Tue, 4 Nov 2014 13:24:10 -0500    

Click here for diff

The previous coding assumed that we could just let buffers for the  
database's old tablespace age out of the buffer arena naturally.  
The folly of that is exposed by bug #11867 from Marc Munro: the user could  
later move the database back to its original tablespace, after which any  
still-surviving buffers would match lookups again and appear to contain  
valid data.  But they'd be missing any changes applied while the database  
was in the new tablespace.  
  
This has been broken since ALTER SET TABLESPACE was introduced, so  
back-patch to all supported branches.  

M src/backend/commands/dbcommands.c

Docs: fix incorrect spelling of contrib/pgcrypto option.

commit   : 21495a2bb7599fb7546b146ca33bd7c6157c1472    
  
author   : Tom Lane <[email protected]>    
date     : Mon, 3 Nov 2014 11:11:34 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Mon, 3 Nov 2014 11:11:34 -0500    

Click here for diff

pgp_sym_encrypt's option is spelled "sess-key", not "enable-session-key".  
Spotted by Jeff Janes.  
  
In passing, improve a comment in pgp-pgsql.c to make it clearer that  
the debugging options are intentionally undocumented.  

M contrib/pgcrypto/pgp-pgsql.c
M doc/src/sgml/pgcrypto.sgml

Re-remove dependency on the DLL of pythonxx.def file.

commit   : f229170c75f0ce64b1b9a0a362571d1f19089de4    
  
author   : Noah Misch <[email protected]>    
date     : Sun, 2 Nov 2014 21:43:30 -0500    
  
committer: Noah Misch <[email protected]>    
date     : Sun, 2 Nov 2014 21:43:30 -0500    

Click here for diff

The reasons behind commit 0d147e43adcf5d2bff9caa073608f381a27439bf still  
stand, so this reverts the non-cosmetic portion of commit  
a7983e989d9cafc9cef49becfee054e34b1ed9b4.  Back-patch to 9.4, where the  
latter commit first appeared.  

M src/pl/plpython/Makefile

Make ECPG test programs depend on "ecpg$(X)", not "ecpg".

commit   : 63d2c0c573ff2a9ba0391576dc569260b4de5dd9    
  
author   : Noah Misch <[email protected]>    
date     : Sun, 2 Nov 2014 21:43:25 -0500    
  
committer: Noah Misch <[email protected]>    
date     : Sun, 2 Nov 2014 21:43:25 -0500    

Click here for diff

Cygwin builds require this of dependencies pertaining to pattern rules.  
On Cygwin, stat("foo") in the absence of a file with that exact name can  
locate foo.exe.  While GNU make uses stat() for dependencies of ordinary  
rules, it uses readdir() to assess dependencies of pattern rules.  
Therefore, a pattern rule dependency should match any underlying file  
name exactly.  Back-patch to 9.4, where the dependency was introduced.  

M src/interfaces/ecpg/test/Makefile.regress

commit   : 94c1dec0d9c1da40ab956520ae093cdad478fcd4    
  
author   : Noah Misch <[email protected]>    
date     : Sun, 2 Nov 2014 21:43:20 -0500    
  
committer: Noah Misch <[email protected]>    
date     : Sun, 2 Nov 2014 21:43:20 -0500    

Click here for diff

Back-patch to 9.2, like commit db29620d4d16e08241f965ccd70d0f65883ff0de.  

M src/port/win32setlocale.c

Fix generation of INSTALL file by removing link

commit   : 25ca2a69eab63729ed3195afbe0d175cf0e54d19    
  
author   : Peter Eisentraut <[email protected]>    
date     : Sun, 2 Nov 2014 20:17:32 -0500    
  
committer: Peter Eisentraut <[email protected]>    
date     : Sun, 2 Nov 2014 20:17:32 -0500    

Click here for diff

M doc/src/sgml/installation.sgml

Add configure --enable-tap-tests option

commit   : 16381b2a78e5a3477b5a7ac956b7afc36efdcc58    
  
author   : Peter Eisentraut <[email protected]>    
date     : Sun, 2 Nov 2014 09:14:36 -0500    
  
committer: Peter Eisentraut <[email protected]>    
date     : Sun, 2 Nov 2014 09:14:36 -0500    

Click here for diff

Don't skip the TAP tests anymore when IPC::Run is not found.  This will  
fail normally now.  

M configure
M configure.in
M doc/src/sgml/installation.sgml
M doc/src/sgml/regress.sgml
M src/Makefile.global.in
M src/test/perl/TestLib.pm

PL/Python: Fix example

commit   : 4ffa8806ee5187526b592e1918cd17c1cdde802d    
  
author   : Peter Eisentraut <[email protected]>    
date     : Sat, 1 Nov 2014 11:31:35 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Sat, 1 Nov 2014 11:31:35 -0400    

Click here for diff

Revert "6f6b46c9c0ca3d96acbebc5499c32ee6369e1eec", which was broken.  
  
Reported-by: Jonathan Rogers <[email protected]>  

M doc/src/sgml/plpython.sgml

doc: Fix typos

commit   : f41ed7b66a621134d5c7c39c74458fbfb1214255    
  
author   : Peter Eisentraut <[email protected]>    
date     : Fri, 31 Oct 2014 08:11:06 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Fri, 31 Oct 2014 08:11:06 -0400    

Click here for diff

per Andres Freund  

M doc/src/sgml/logicaldecoding.sgml

doc: Wording and formatting improvements in new logical decoding docs

commit   : 1414868d088cfb6cb85d57946f4a460efa7d31c6    
  
author   : Peter Eisentraut <[email protected]>    
date     : Thu, 30 Oct 2014 22:52:21 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Thu, 30 Oct 2014 22:52:21 -0400    

Click here for diff

M doc/src/sgml/logicaldecoding.sgml
M doc/src/sgml/ref/pg_recvlogical.sgml

doc: Improve CREATE VIEW / WITH documentation

commit   : 7dacab976917c26cd9b6c4b36e53dbbf8261473b    
  
author   : Peter Eisentraut <[email protected]>    
date     : Thu, 30 Oct 2014 22:50:02 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Thu, 30 Oct 2014 22:50:02 -0400    

Click here for diff

Similar to 590eb0c14eebe834f716721a9659b77899cf3084, remove the options  
list from the synopsis and elaborate in the main description.  

M doc/src/sgml/ref/create_view.sgml

Test IsInTransactionChain, not IsTransactionBlock, in vac_update_relstats.

commit   : 7f4ece03d675a2a6cb6cec14f564744b5c01e5a4    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 30 Oct 2014 13:03:25 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 30 Oct 2014 13:03:25 -0400    

Click here for diff

As noted by Noah Misch, my initial cut at fixing bug #11638 didn't cover  
all cases where ANALYZE might be invoked in an unsafe context.  We need to  
test the result of IsInTransactionChain not IsTransactionBlock; which is  
notationally a pain because IsInTransactionChain requires an isTopLevel  
flag, which would have to be passed down through several levels of callers.  
I chose to pass in_outer_xact (ie, the result of IsInTransactionChain)  
rather than isTopLevel per se, as that seemed marginally more apropos  
for the intermediate functions to know about.  

M src/backend/commands/analyze.c
M src/backend/commands/vacuum.c
M src/backend/commands/vacuumlazy.c
M src/include/commands/vacuum.h

"Pin", rather than "keep", dynamic shared memory mappings and segments.

commit   : 1c49dae165bcee69bf3327d6ae20271d82cdf6bf    
  
author   : Robert Haas <[email protected]>    
date     : Thu, 30 Oct 2014 11:35:55 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Thu, 30 Oct 2014 11:35:55 -0400    

Click here for diff

Nobody seemed concerned about this naming when it originally went in,  
but there's a pending patch that implements the opposite of  
dsm_keep_mapping, and the term "unkeep" was judged unpalatable.  
"unpin" has existing precedent in the PostgreSQL code base, and the  
English language, so use this terminology instead.  
  
Per discussion, back-patch to 9.4.  

M src/backend/storage/ipc/dsm.c
M src/backend/storage/ipc/dsm_impl.c
M src/include/storage/dsm.h
M src/include/storage/dsm_impl.h

Remove use of TAP subtests

commit   : ae3eb9b8ef5638610da05038e40229d4f4e5c1fd    
  
author   : Peter Eisentraut <[email protected]>    
date     : Wed, 29 Oct 2014 19:41:19 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Wed, 29 Oct 2014 19:41:19 -0400    

Click here for diff

They turned out to be too much of a portability headache, because they  
need a fairly new version of Test::More to work properly.  

M src/bin/initdb/t/001_initdb.pl
M src/bin/pg_basebackup/t/010_pg_basebackup.pl
M src/bin/pg_basebackup/t/020_pg_receivexlog.pl
M src/bin/pg_config/t/001_pg_config.pl
M src/bin/pg_controldata/t/001_pg_controldata.pl
M src/bin/pg_ctl/t/001_start_stop.pl
M src/bin/scripts/t/010_clusterdb.pl
M src/bin/scripts/t/011_clusterdb_all.pl
M src/bin/scripts/t/020_createdb.pl
M src/bin/scripts/t/030_createlang.pl
M src/bin/scripts/t/040_createuser.pl
M src/bin/scripts/t/050_dropdb.pl
M src/bin/scripts/t/060_droplang.pl
M src/bin/scripts/t/070_dropuser.pl
M src/bin/scripts/t/080_pg_isready.pl
M src/bin/scripts/t/090_reindexdb.pl
M src/bin/scripts/t/091_reindexdb_all.pl
M src/bin/scripts/t/100_vacuumdb.pl
M src/bin/scripts/t/101_vacuumdb_all.pl
M src/bin/scripts/t/102_vacuumdb_stages.pl
M src/test/perl/TestLib.pm

Avoid corrupting tables when ANALYZE inside a transaction is rolled back.

commit   : 22b3003d70a88644f36cd91446631f474dfbfe41    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 29 Oct 2014 18:12:04 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 29 Oct 2014 18:12:04 -0400    

Click here for diff

VACUUM and ANALYZE update the target table's pg_class row in-place, that is  
nontransactionally.  This is OK, more or less, for the statistical columns,  
which are mostly nontransactional anyhow.  It's not so OK for the DDL hint  
flags (relhasindex etc), which might get changed in response to  
transactional changes that could still be rolled back.  This isn't a  
problem for VACUUM, since it can't be run inside a transaction block nor  
in parallel with DDL on the table.  However, we allow ANALYZE inside a  
transaction block, so if the transaction had earlier removed the last  
index, rule, or trigger from the table, and then we roll back the  
transaction after ANALYZE, the table would be left in a corrupted state  
with the hint flags not set though they should be.  
  
To fix, suppress the hint-flag updates if we are InTransactionBlock().  
This is safe enough because it's always OK to postpone hint maintenance  
some more; the worst-case consequence is a few extra searches of pg_index  
et al.  There was discussion of instead using a transactional update,  
but that would change the behavior in ways that are not all desirable:  
in most scenarios we're better off keeping ANALYZE's statistical values  
even if the ANALYZE itself rolls back.  In any case we probably don't want  
to change this behavior in back branches.  
  
Per bug #11638 from Casey Shobe.  This has been broken for a good long  
time, so back-patch to all supported branches.  
  
Tom Lane and Michael Paquier, initial diagnosis by Andres Freund  

M src/backend/commands/vacuum.c
M src/test/regress/expected/alter_table.out
M src/test/regress/sql/alter_table.sql

Reset error message at PQreset()

commit   : fcca871203568a4d34bc026029bee51e8d246ae2    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Wed, 29 Oct 2014 14:32:01 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Wed, 29 Oct 2014 14:32:01 +0200    

Click here for diff

If you call PQreset() repeatedly, and the connection cannot be  
re-established, the error messages from the failed connection attempts  
kept accumulating in the error string.  
  
Fixes bug #11455 reported by Caleb Epstein. Backpatch to all supported  
versions.  

M src/interfaces/libpq/fe-connect.c

Remove obsolete commentary.

commit   : d1f8e7a01501c71db3ee0bcd19aab79b1ddc662e    
  
author   : Tom Lane <[email protected]>    
date     : Tue, 28 Oct 2014 18:36:02 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Tue, 28 Oct 2014 18:36:02 -0400    

Click here for diff

Since we got rid of non-MVCC catalog scans, the fourth reason given for  
using a non-transactional update in index_update_stats() is obsolete.  
The other three are still good, so we're not going to change the code,  
but fix the comment.  

M src/backend/catalog/index.c

Remove unnecessary assignment.

commit   : 3345ba4d0d28435518b5979120618a610dea4e13    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Tue, 28 Oct 2014 20:26:20 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Tue, 28 Oct 2014 20:26:20 +0200    

Click here for diff

Reported by MauMau.  

M src/backend/storage/lmgr/lwlock.c

MinGW: Include .dll extension in .def file LIBRARY commands.

commit   : c68bff644357c743d14065b8085dbb04d1505c72    
  
author   : Noah Misch <[email protected]>    
date     : Mon, 27 Oct 2014 19:59:39 -0400    
  
committer: Noah Misch <[email protected]>    
date     : Mon, 27 Oct 2014 19:59:39 -0400    

Click here for diff

Newer toolchains append the extension implicitly if missing, but  
buildfarm member narwhal (gcc 3.4.2, ld 2.15.91 20040904) does not.  
This affects most core libraries having an exports.txt file, namely  
libpq and the ECPG support libraries.  On Windows Server 2003, Windows  
API functions that load and unload DLLs internally will mistakenly  
unload a libpq whose DLL header reports "LIBPQ" instead of "LIBPQ.dll".  
When, subsequently, control would return to libpq, the backend crashes.  
Back-patch to 9.4, like commit 846e91e0223cf9f2821c3ad4dfffffbb929cb027.  
Before that commit, we used a different linking technique that yielded  
"libpq.dll" in the DLL header.  
  
Commit 53566fc0940cf557416b13252df57350a4511ce4 worked around this by  
eliminating a call to a function that loads and unloads DLLs internally.  
That commit is no longer necessary for correctness, but its improving  
consistency with the MSVC build remains valid.  

M src/Makefile.shlib

Add missing equals signs to pg_recvlogical documentation.

commit   : 89fbe97fcad3cfbc5d09d2a9f66aaf31e3164b94    
  
author   : Robert Haas <[email protected]>    
date     : Mon, 27 Oct 2014 08:53:16 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Mon, 27 Oct 2014 08:53:16 -0400    

Click here for diff

Michael Paquier  

M doc/src/sgml/ref/pg_recvlogical.sgml

Fix two bugs in tsquery @> operator.

commit   : c366e1d169481a780857458f1064ae93007fd140    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Mon, 27 Oct 2014 10:50:41 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Mon, 27 Oct 2014 10:50:41 +0200    

Click here for diff

1. The comparison for matching terms used only the CRC to decide if there's  
a match. Two different terms with the same CRC gave a match.  
  
2. It assumed that if the second operand has more terms than the first, it's  
never a match. That assumption is bogus, because there can be duplicate  
terms in either operand.  
  
Rewrite the implementation in a way that doesn't have those bugs.  
  
Backpatch to all supported versions.  

M src/backend/utils/adt/tsquery_op.c

Fix undersized result buffer in pset_quoted_string().

commit   : c53a82b99d98df393d7ba308bf1586b2201d0d65    
  
author   : Tom Lane <[email protected]>    
date     : Sun, 26 Oct 2014 19:17:57 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Sun, 26 Oct 2014 19:17:57 -0400    

Click here for diff

The malloc request was 1 byte too small for the worst-case output.  
This seems relatively unlikely to cause any problems in practice,  
as the worst case only occurs if the input string contains no  
characters other than single-quote or newline, and even then  
malloc alignment padding would probably save the day.  But it's  
definitely a bug.  
  
David Rowley  

M src/bin/psql/command.c

Improve planning of btree index scans using ScalarArrayOpExpr quals.

commit   : 859e2b9dd4de94ef9a9ad34da3e39572e4f1d66f    
  
author   : Tom Lane <[email protected]>    
date     : Sun, 26 Oct 2014 16:12:26 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Sun, 26 Oct 2014 16:12:26 -0400    

Click here for diff

Since we taught btree to handle ScalarArrayOpExpr quals natively (commit  
9e8da0f75731aaa7605cf4656c21ea09e84d2eb1), the planner has always included  
ScalarArrayOpExpr quals in index conditions if possible.  However, if the  
qual is for a non-first index column, this could result in an inferior plan  
because we can no longer take advantage of index ordering (cf. commit  
807a40c551dd30c8dd5a0b3bd82f5bbb1e7fd285).  It can be better to omit the  
ScalarArrayOpExpr qual from the index condition and let it be done as a  
filter, so that the output doesn't need to get sorted.  Indeed, this is  
true for the query introduced as a test case by the latter commit.  
  
To fix, restructure get_index_paths and build_index_paths so that we  
consider paths both with and without ScalarArrayOpExpr quals in non-first  
index columns.  Redesign the API of build_index_paths so that it reports  
what it found, saving useless second or third calls.  
  
Report and patch by Andrew Gierth (though rather heavily modified by me).  
Back-patch to 9.2 where this code was introduced, since the issue can  
result in significant performance regressions compared to plans produced  
by 9.1 and earlier.  

M src/backend/optimizer/path/indxpath.c
M src/test/regress/expected/create_index.out
M src/test/regress/sql/create_index.sql

Fix TAP tests with Perl 5.12

commit   : 76e190d52225fc1124efc7d77f773643405b263e    
  
author   : Peter Eisentraut <[email protected]>    
date     : Sun, 26 Oct 2014 10:26:36 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Sun, 26 Oct 2014 10:26:36 -0400    

Click here for diff

Perl 5.12 ships with a somewhat broken version of Test::Simple, so skip  
the tests if that is found.  
  
The relevant fix is  
  
    0.98  Wed, 23 Feb 2011 14:38:02 +1100  
        Bug Fixes  
        * subtest() should not fail if $? is non-zero. (Aaron Crane)  

M src/test/perl/TestLib.pm

Fix TAP tests with Perl 5.8

commit   : 6b531cd077eeacce25106f5456876b57ad68a834    
  
author   : Peter Eisentraut <[email protected]>    
date     : Sun, 26 Oct 2014 09:47:01 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Sun, 26 Oct 2014 09:47:01 -0400    

Click here for diff

The prove program included in Perl 5.8 does not support the --ext  
option, so don't use that and use wildcards on the command line instead.  
  
Note that the tests will still all be skipped, because, for instance,  
the version of Test::More is too old, but at least the regular  
mechanisms for handling that will apply, instead of failing to call  
prove altogether.  

M src/Makefile.global.in

Work around Windows locale name with non-ASCII character.

commit   : c3c2d986977b60e3db26601d44ab029ef99156cc    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Fri, 24 Oct 2014 19:56:03 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Fri, 24 Oct 2014 19:56:03 +0300    

Click here for diff

Windows has one a locale whose name contains a non-ASCII character:  
"Norwegian (Bokmål)" (that's an 'a' with a ring on top). That causes  
trouble; when passing it setlocale(), it's not clear what encoding the  
argument should be in. Another problem is that the locale name is stored in  
pg_database catalog table, and the encoding used there depends on what  
server encoding happens to be in use when the database is created. For  
example, if you issue the CREATE DATABASE when connected to a UTF-8  
database, the locale name is stored in pg_database in UTF-8. As long as all  
locale names are pure ASCII, that's not a problem.  
  
To work around that, map the troublesome locale name to a pure-ASCII alias  
of the same locale, "norwegian-bokmal".  
  
Now, this doesn't change the existing values that are already in  
pg_database and in postgresql.conf. Old clusters will need to be fixed  
manually. Instructions for that need to be put in the release notes.  
  
This fixes bug #11431 reported by Alon Siman-Tov. Backpatch to 9.2;  
backpatching further would require more work than seems worth it.  

M src/port/win32setlocale.c

Make the locale comparison in pg_upgrade more lenient

commit   : 4bdf5e57552456d0d12e33ead0dbfc124f4d4b81    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Fri, 24 Oct 2014 19:26:44 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Fri, 24 Oct 2014 19:26:44 +0300    

Click here for diff

If the locale names are not equal, try to canonicalize both of them by  
passing them to setlocale(). Before, we only canonicalized the old cluster's  
locale if upgrading from a 8.4-9.2 server, but we also need to canonicalize  
when upgrading from a pre-8.4 server. That was an oversight in the code. But  
we should also canonicalize on newer server versions, so that we cope if the  
canonical form changes from one release to another. I'm about to do just  
that to fix bug #11431, by mapping a locale name that contains non-ASCII  
characters to a pure-ASCII alias of the same locale.  
  
This is partial backpatch of commit 33755e8edf149dabfc0ed9b697a84f70b0cca0de  
in master. Apply to 9.2, 9.3 and 9.4. The canonicalization code didn't exist  
before 9.2. In 9.2 and 9.3, this effectively also back-patches the changes  
from commit 58274728fb8e087049df67c0eee903d9743fdeda, to be more lax about  
the spelling of the encoding in the locale names.  

M contrib/pg_upgrade/check.c

Improve ispell dictionary's defenses against bad affix files.

commit   : 1cf54b00ba2100083390223a8244430643c1ec07    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 23 Oct 2014 13:11:31 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 23 Oct 2014 13:11:31 -0400    

Click here for diff

Don't crash if an ispell dictionary definition contains flags but not  
any compound affixes.  (This isn't a security issue since only superusers  
can install affix files, but still it's a bad thing.)  
  
Also, be more careful about detecting whether an affix-file FLAG command  
is old-format (ispell) or new-format (myspell/hunspell).  And change the  
error message about mixed old-format and new-format commands into something  
intelligible.  
  
Per bug #11770 from Emre Hasegeli.  Back-patch to all supported branches.  

M src/backend/tsearch/spell.c

Prevent the already-archived WAL file from being archived again.

commit   : 6d12cc1f01c867fd7317ac5580b02c04f313d9ce    
  
author   : Fujii Masao <[email protected]>    
date     : Thu, 23 Oct 2014 16:21:27 +0900    
  
committer: Fujii Masao <[email protected]>    
date     : Thu, 23 Oct 2014 16:21:27 +0900    

Click here for diff

Previously the archive recovery always created .ready file for  
the last WAL file of the old timeline at the end of recovery even when  
it's restored from the archive and has .done file. That is, there was  
the case where the WAL file had both .ready and .done files.  
This caused the already-archived WAL file to be archived again.  
  
This commit prevents the archive recovery from creating .ready file  
for the last WAL file if it has .done file, in order to prevent it from  
being archived again.  
  
This bug was added when cascading replication feature was introduced,  
i.e., the commit 5286105800c7d5902f98f32e11b209c471c0c69c.  
So, back-patch to 9.2, where cascading replication was added.  
  
Reviewed by Michael Paquier  

M src/backend/access/transam/xlog.c

Ensure libpq reports a suitable error message on unexpected socket EOF.

commit   : b53942e59644d79c2df7951523a50dc4d2d97668    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 22 Oct 2014 18:41:47 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 22 Oct 2014 18:41:47 -0400    

Click here for diff

The EOF-detection logic in pqReadData was a bit confused about who should  
set up the error message in case the kernel gives us read-ready-but-no-data  
rather than ECONNRESET or some other explicit error condition.  Since the  
whole point of this situation is that the lower-level functions don't know  
there's anything wrong, pqReadData itself must set up the message.  But  
keep the assumption that if an errno was reported, a message was set up at  
lower levels.  
  
Per bug #11712 from Marko Tiikkaja.  It's been like this for a very long  
time, so back-patch to all supported branches.  

M src/interfaces/libpq/fe-misc.c

MinGW: Use -static-libgcc when linking a DLL.

commit   : 2f51f424bb362dadeb4fabf03845961e563da4ba    
  
author   : Noah Misch <[email protected]>    
date     : Tue, 21 Oct 2014 22:55:47 -0400    
  
committer: Noah Misch <[email protected]>    
date     : Tue, 21 Oct 2014 22:55:47 -0400    

Click here for diff

When commit 846e91e0223cf9f2821c3ad4dfffffbb929cb027 switched the linker  
driver from dlltool/dllwrap to gcc, it became possible for linking to  
choose shared libgcc.  Backends having loaded a module dynamically  
linked to libgcc can exit abnormally, which the postmaster treats like a  
crash.  Resume use of static libgcc exclusively, like 9.3 and earlier.  
Back-patch to 9.4.  

M src/Makefile.shlib
M src/makefiles/Makefile.win32

commit   : 9e02e20ab6df093e1ab751157dfb5c51a420187b    
  
author   : Noah Misch <[email protected]>    
date     : Tue, 21 Oct 2014 22:55:43 -0400    
  
committer: Noah Misch <[email protected]>    
date     : Tue, 21 Oct 2014 22:55:43 -0400    

Click here for diff

This improves consistency with the MSVC build.  On buildfarm member  
narwhal, since commit 846e91e0223cf9f2821c3ad4dfffffbb929cb027,  
shfolder.dll:SHGetFolderPath() crashes when dblink calls it by way of  
pqGetHomeDirectory().  Back-patch to 9.4, where that commit first  
appeared.  How it caused this regression remains a mystery.  This is a  
partial revert of commit 889f03812916b146ae504c0fad5afdc7bf2e8a2a, which  
adopted shfolder.dll for Windows NT 4.0 compatibility.  PostgreSQL 8.2  
dropped support for that operating system.  

M src/Makefile.global.in
M src/interfaces/ecpg/ecpglib/Makefile
M src/interfaces/libpq/Makefile
M src/interfaces/libpq/win32.mak
M src/port/path.c

Update expected/sequence_1.out.

commit   : 7a14edb83e1c5c3c683cf0c8a90870e3bda9d22c    
  
author   : Tom Lane <[email protected]>    
date     : Tue, 21 Oct 2014 18:26:01 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Tue, 21 Oct 2014 18:26:01 -0400    

Click here for diff

The last three updates to the sequence regression test have all forgotten  
to touch the alternate expected-output file.  Sigh.  
  
Michael Paquier  

M src/test/regress/expected/sequence_1.out

Flush unlogged table's buffers when copying or moving databases.

commit   : 5607e996f4ba93a4c56ea94f10d1fcc876b4bf42    
  
author   : Andres Freund <[email protected]>    
date     : Mon, 20 Oct 2014 23:43:46 +0200    
  
committer: Andres Freund <[email protected]>    
date     : Mon, 20 Oct 2014 23:43:46 +0200    

Click here for diff

CREATE DATABASE and ALTER DATABASE .. SET TABLESPACE copy the source  
database directory on the filesystem level. To ensure the on disk  
state is consistent they block out users of the affected database and  
force a checkpoint to flush out all data to disk. Unfortunately, up to  
now, that checkpoint didn't flush out dirty buffers from unlogged  
relations.  
  
That bug means there could be leftover dirty buffers in either the  
template database, or the database in its old location. Leading to  
problems when accessing relations in an inconsistent state; and to  
possible problems during shutdown in the SET TABLESPACE case because  
buffers belonging files that don't exist anymore are flushed.  
  
This was reported in bug #10675 by Maxim Boguk.  
  
Fix by Pavan Deolasee, modified somewhat by me. Reviewed by MauMau and  
Fujii Masao.  
  
Backpatch to 9.1 where unlogged tables were introduced.  

M src/backend/access/transam/xlog.c
M src/backend/commands/dbcommands.c
M src/backend/storage/buffer/bufmgr.c
M src/include/access/xlog.h

Correct volatility markings of a few json functions.

commit   : 6e0a053a963024698de8ba315eed7455520d1a92    
  
author   : Andrew Dunstan <[email protected]>    
date     : Mon, 20 Oct 2014 14:55:35 -0400    
  
committer: Andrew Dunstan <[email protected]>    
date     : Mon, 20 Oct 2014 14:55:35 -0400    

Click here for diff

json_agg and json_object_agg and their associated transition functions  
should have been marked as stable rather than immutable, as they call IO  
functions indirectly. Changing this probably isn't going to make much  
difference, as you can't use an aggregate function in an index  
expression, but we should be correct nevertheless.  
  
json_object, on the other hand, should be marked immutable rather than  
stable, as it does not call IO functions.  
  
As discussed on -hackers, this change is being made without bumping the  
catalog version, as we don't want to do that at this stage of the  cycle,  
and  the changes are very unlikely to affect anyone.  

M src/include/catalog/pg_proc.h

Fix mishandling of FieldSelect-on-whole-row-Var in nested lateral queries.

commit   : 33343b862ce17ff51699789625684d0cccd60ede    
  
author   : Tom Lane <[email protected]>    
date     : Mon, 20 Oct 2014 12:23:44 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Mon, 20 Oct 2014 12:23:44 -0400    

Click here for diff

If an inline-able SQL function taking a composite argument is used in a  
LATERAL subselect, and the composite argument is a lateral reference,  
the planner could fail with "variable not found in subplan target list",  
as seen in bug #11703 from Karl Bartel.  (The outer function call used in  
the bug report and in the committed regression test is not really necessary  
to provoke the bug --- you can get it if you manually expand the outer  
function into "LATERAL (SELECT inner_function(outer_relation))", too.)  
  
The cause of this is that we generate the reltargetlist for the referenced  
relation before doing eval_const_expressions() on the lateral sub-select's  
expressions (cf find_lateral_references()), so what's scheduled to be  
emitted by the referenced relation is a whole-row Var, not the simplified  
single-column Var produced by optimizing the function's FieldSelect on the  
whole-row Var.  Then setrefs.c fails to match up that lateral reference to  
what's available from the outer scan.  
  
Preserving the FieldSelect optimization in such cases would require either  
major planner restructuring (to recursively do expression simplification  
on sub-selects much earlier) or some amazingly ugly kluge to change the  
reltargetlist of a possibly-already-planned relation.  It seems better  
just to skip the optimization when the Var is from an upper query level;  
the case is not so common that it's likely anyone will notice a few  
wasted cycles.  
  
AFAICT this problem only occurs for uplevel LATERAL references, so  
back-patch to 9.3 where LATERAL was added.  

M src/backend/optimizer/util/clauses.c
M src/test/regress/expected/rangefuncs.out
M src/test/regress/sql/rangefuncs.sql

psql: Improve \pset without arguments

commit   : 48b2d88c10746257c77a8c4c2f645ccfc6bb0afe    
  
author   : Peter Eisentraut <[email protected]>    
date     : Sat, 18 Oct 2014 21:58:17 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Sat, 18 Oct 2014 21:58:17 -0400    

Click here for diff

Revert the output of the individual backslash commands that change print  
settings back to the 9.3 way (not showing the command name in  
parentheses).  Implement \pset without arguments separately, showing all  
settings with values in a table form.  

M src/bin/psql/command.c
M src/test/regress/expected/psql.out

doc: Clean up pg_recvlogical reference page

commit   : 5c8758e6ed54ff9e2c5ec72af619bbd52578659c    
  
author   : Peter Eisentraut <[email protected]>    
date     : Sat, 18 Oct 2014 09:10:12 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Sat, 18 Oct 2014 09:10:12 -0400    

Click here for diff

This needed a general cleanup of wording, typos, outdated terminology,  
formatting, and hard-to-understand and borderline incorrect information.  
  
Also tweak the pg_receivexlog page a bit to make the two more  
consistent.  

M doc/src/sgml/ref/pg_receivexlog.sgml
M doc/src/sgml/ref/pg_recvlogical.sgml

Declare mkdtemp() only if we're providing it.

commit   : b45f048ed899502c982f249d90608ca09b7939e7    
  
author   : Tom Lane <[email protected]>    
date     : Fri, 17 Oct 2014 22:55:23 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Fri, 17 Oct 2014 22:55:23 -0400    

Click here for diff

Follow our usual style of providing an "extern" for a standard library  
function only when we're also providing the implementation.  This avoids  
issues when the system headers declare the function slightly differently  
than we do, as noted by Caleb Welton.  
  
We might have to go to the extent of probing to see if the system headers  
declare the function, but let's not do that until it's demonstrated to be  
necessary.  
  
Oversight in commit 9e6b1bf258170e62dac555fc82ff0536dfe01d29.  Back-patch  
to all supported branches, as that was.  

M src/include/port.h

Avoid core dump in _outPathInfo() for Path without a parent RelOptInfo.

commit   : 16bbe5a3cc937096a4ad0dab050360eb87e0c813    
  
author   : Tom Lane <[email protected]>    
date     : Fri, 17 Oct 2014 22:33:04 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Fri, 17 Oct 2014 22:33:04 -0400    

Click here for diff

Nearly all Paths have parents, but a ResultPath representing an empty FROM  
clause does not.  Avoid a core dump in such cases.  I believe this is only  
a hazard for debugging usage, not for production, else we'd have heard  
about it before.  Nonetheless, back-patch to 9.1 where the troublesome code  
was introduced.  Noted while poking at bug #11703.  

M src/backend/nodes/outfuncs.c

Fix core dump in pg_dump --binary-upgrade on zero-column composite type.

commit   : 3205b30bb7a82c8228230a15308a56b302603521    
  
author   : Tom Lane <[email protected]>    
date     : Fri, 17 Oct 2014 12:49:03 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Fri, 17 Oct 2014 12:49:03 -0400    

Click here for diff

This reverts nearly all of commit 28f6cab61ab8958b1a7dfb019724687d92722538  
in favor of just using the typrelid we already have in pg_dump's TypeInfo  
struct for the composite type.  As coded, it'd crash if the composite type  
had no attributes, since then the query would return no rows.  
  
Back-patch to all supported versions.  It seems to not really be a problem  
in 9.0 because that version rejects the syntax "create type t as ()", but  
we might as well keep the logic similar in all affected branches.  
  
Report and fix by Rushabh Lathia.  

M src/bin/pg_dump/pg_dump.c

Support timezone abbreviations that sometimes change.

commit   : 4b3b44b141a0163ca15fd3eb38589a5aefc499bd    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 16 Oct 2014 15:22:13 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 16 Oct 2014 15:22:13 -0400    

Click here for diff

Up to now, PG has assumed that any given timezone abbreviation (such as  
"EDT") represents a constant GMT offset in the usage of any particular  
region; we had a way to configure what that offset was, but not for it  
to be changeable over time.  But, as with most things horological, this  
view of the world is too simplistic: there are numerous regions that have  
at one time or another switched to a different GMT offset but kept using  
the same timezone abbreviation.  Almost the entire Russian Federation did  
that a few years ago, and later this month they're going to do it again.  
And there are similar examples all over the world.  
  
To cope with this, invent the notion of a "dynamic timezone abbreviation",  
which is one that is referenced to a particular underlying timezone  
(as defined in the IANA timezone database) and means whatever it currently  
means in that zone.  For zones that use or have used daylight-savings time,  
the standard and DST abbreviations continue to have the property that you  
can specify standard or DST time and get that time offset whether or not  
DST was theoretically in effect at the time.  However, the abbreviations  
mean what they meant at the time in question (or most recently before that  
time) rather than being absolutely fixed.  
  
The standard abbreviation-list files have been changed to use this behavior  
for abbreviations that have actually varied in meaning since 1970.  The  
old simple-numeric definitions are kept for abbreviations that have not  
changed, since they are a bit faster to resolve.  
  
While this is clearly a new feature, it seems necessary to back-patch it  
into all active branches, because otherwise use of Russian zone  
abbreviations is going to become even more problematic than it already was.  
This change supersedes the changes in commit 513d06ded et al to modify the  
fixed meanings of the Russian abbreviations; since we've not shipped that  
yet, this will avoid an undesirably incompatible (not to mention incorrect)  
change in behavior for timestamps between 2011 and 2014.  
  
This patch makes some cosmetic changes in ecpglib to keep its usage of  
datetime lookup tables as similar as possible to the backend code, but  
doesn't do anything about the increasingly obsolete set of timezone  
abbreviation definitions that are hard-wired into ecpglib.  Whatever we  
do about that will likely not be appropriate material for back-patching.  
Also, a potential free() of a garbage pointer after an out-of-memory  
failure in ecpglib has been fixed.  
  
This patch also fixes pre-existing bugs in DetermineTimeZoneOffset() that  
caused it to produce unexpected results near a timezone transition, if  
both the "before" and "after" states are marked as standard time.  We'd  
only ever thought about or tested transitions between standard and DST  
time, but that's not what's happening when a zone simply redefines their  
base GMT offset.  
  
In passing, update the SGML documentation to refer to the Olson/zoneinfo/  
zic timezone database as the "IANA" database, since it's now being  
maintained under the auspices of IANA.  

M contrib/btree_gist/btree_ts.c
M doc/src/sgml/config.sgml
M doc/src/sgml/datatype.sgml
M doc/src/sgml/datetime.sgml
M doc/src/sgml/installation.sgml
M src/backend/utils/adt/date.c
M src/backend/utils/adt/datetime.c
M src/backend/utils/adt/timestamp.c
M src/backend/utils/misc/tzparser.c
M src/include/pgtime.h
M src/include/utils/datetime.h
M src/include/utils/tzparser.h
M src/interfaces/ecpg/pgtypeslib/dt.h
M src/interfaces/ecpg/pgtypeslib/dt_common.c
M src/test/regress/expected/timestamptz.out
M src/test/regress/sql/timestamptz.sql
M src/timezone/known_abbrevs.txt
M src/timezone/localtime.c
M src/timezone/tznames/America.txt
M src/timezone/tznames/Antarctica.txt
M src/timezone/tznames/Asia.txt
M src/timezone/tznames/Atlantic.txt
M src/timezone/tznames/Australia.txt
M src/timezone/tznames/Default
M src/timezone/tznames/Europe.txt
M src/timezone/tznames/Indian.txt
M src/timezone/tznames/Pacific.txt
M src/timezone/tznames/README
M src/timezone/zic.c

Print planning time only in EXPLAIN ANALYZE, not plain EXPLAIN.

commit   : 9bb6b7c5ed617b34edf1a962c9405359822418d3    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 15 Oct 2014 18:50:16 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 15 Oct 2014 18:50:16 -0400    

Click here for diff

We've gotten enough push-back on that change to make it clear that it  
wasn't an especially good idea to do it like that.  Revert plain EXPLAIN  
to its previous behavior, but keep the extra output in EXPLAIN ANALYZE.  
Per discussion.  
  
Internally, I set this up as a separate flag ExplainState.summary that  
controls printing of planning time and execution time.  For now it's  
just copied from the ANALYZE option, but we could consider exposing it  
to users.  

M contrib/auto_explain/auto_explain.c
M doc/src/sgml/perform.sgml
M doc/src/sgml/ref/explain.sgml
M src/backend/commands/explain.c
M src/include/commands/explain.h

Don't let protected variable access to be reordered after spinlock release.

commit   : 4971c36b46c63c0b36a38df6a4b6ad9f303e4620    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Tue, 14 Oct 2014 10:01:00 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Tue, 14 Oct 2014 10:01:00 +0300    

Click here for diff

LWLockAcquireWithVar needs to set the protected variable while holding  
the spinlock. Need to use a volatile pointer to make sure it doesn't get  
reordered by the compiler. The other functions that accessed the protected  
variable already got this right.  
  
9.4 only. Earlier releases didn't have this code, and in master, spinlock  
release acts as a compiler barrier.  

M src/backend/storage/lmgr/lwlock.c

Fix deadlock with LWLockAcquireWithVar and LWLockWaitForVar.

commit   : 4dbc7606cfc8188646a2e302ef5e6a5ec3c962af    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Tue, 14 Oct 2014 09:55:26 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Tue, 14 Oct 2014 09:55:26 +0300    

Click here for diff

LWLockRelease should release all backends waiting with LWLockWaitForVar,  
even when another backend has already been woken up to acquire the lock,  
i.e. when releaseOK is false. LWLockWaitForVar can return as soon as the  
protected value changes, even if the other backend will acquire the lock.  
Fix that by resetting releaseOK to true in LWLockWaitForVar, whenever  
adding itself to the wait queue.  
  
This should fix the bug reported by MauMau, where the system occasionally  
hangs when there is a lot of concurrent WAL activity and a checkpoint.  
Backpatch to 9.4, where this code was added.  

M src/backend/storage/lmgr/lwlock.c

Fix typo in docs.

commit   : 79ec6e399f1377a56633c0e4b4c8ed768c230ec2    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Tue, 14 Oct 2014 09:45:00 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Tue, 14 Oct 2014 09:45:00 +0300    

Click here for diff

Shigeru Hanada  

M doc/src/sgml/bgworker.sgml

doc: Improve ALTER VIEW / SET documentation

commit   : 590eb0c14eebe834f716721a9659b77899cf3084    
  
author   : Peter Eisentraut <[email protected]>    
date     : Mon, 13 Oct 2014 22:17:34 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Mon, 13 Oct 2014 22:17:34 -0400    

Click here for diff

The way the ALTER VIEW / SET options were listed in the synopsis was  
very confusing.  Move the list to the main description, similar to how  
the ALTER TABLE reference page does it.  

M doc/src/sgml/ref/alter_view.sgml

doc: Fix copy-and-paste mistakes

commit   : 44992e68375a27410089ad43a706ffa80f311783    
  
author   : Peter Eisentraut <[email protected]>    
date     : Mon, 13 Oct 2014 22:10:01 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Mon, 13 Oct 2014 22:10:01 -0400    

Click here for diff

M doc/src/sgml/ref/create_aggregate.sgml

psql: Fix \? output alignment

commit   : ec757c2735fdc6e845fd9edd8da65db35d9c4836    
  
author   : Peter Eisentraut <[email protected]>    
date     : Mon, 13 Oct 2014 22:07:30 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Mon, 13 Oct 2014 22:07:30 -0400    

Click here for diff

This was inadvertently changed in commit c64e68fd.  

M src/bin/psql/help.c

Fix quoting in the add_to_path Makefile macro.

commit   : 4b9d7ccab3fc180ca9830a92688c1b560a01b720    
  
author   : Noah Misch <[email protected]>    
date     : Sun, 12 Oct 2014 23:33:37 -0400    
  
committer: Noah Misch <[email protected]>    
date     : Sun, 12 Oct 2014 23:33:37 -0400    

Click here for diff

The previous quoting caused "make -C src/bin check" to ignore, rather  
than add to, any LD_LIBRARY_PATH content from the environment.  
Back-patch to 9.4, where the macro was introduced.  

M src/Makefile.global.in

Suppress dead, unportable src/port/crypt.c code.

commit   : 62698dae6b4fd066f8d4e4a4f0a41c3155769d3d    
  
author   : Noah Misch <[email protected]>    
date     : Sun, 12 Oct 2014 23:27:06 -0400    
  
committer: Noah Misch <[email protected]>    
date     : Sun, 12 Oct 2014 23:27:06 -0400    

Click here for diff

This file used __int64, which is specific to native Windows, rather than  
int64.  Suppress the long-unused union field of this type.  Noticed on  
Cygwin x86_64 with -lcrypt not installed.  Back-patch to 9.0 (all  
supported versions).  

M src/port/crypt.c

pg_recvlogical: Improve --help output

commit   : 1b031ae62e7cdf2f99848cd35cdb2166babdaa87    
  
author   : Peter Eisentraut <[email protected]>    
date     : Sun, 12 Oct 2014 01:45:25 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Sun, 12 Oct 2014 01:45:25 -0400    

Click here for diff

List the actions first, as they are the most important options.  Group  
the other options more sensibly, consistent with the man page.  Correct  
a few typographical errors, clarify some things.  
  
Also update the pg_receivexlog --help output to make it a bit more  
consistent with that of pg_recvlogical.  

M src/bin/pg_basebackup/pg_receivexlog.c
M src/bin/pg_basebackup/pg_recvlogical.c

Message improvements

commit   : 7ce2a45aeb12d3d32a5b5e334f99a67264613fc1    
  
author   : Peter Eisentraut <[email protected]>    
date     : Sun, 12 Oct 2014 01:02:56 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Sun, 12 Oct 2014 01:02:56 -0400    

Click here for diff

M src/backend/access/nbtree/nbtpage.c
M src/backend/access/transam/xlog.c
M src/backend/commands/dbcommands.c
M src/backend/commands/matview.c
M src/backend/commands/tablecmds.c
M src/backend/commands/view.c
M src/backend/libpq/be-secure.c
M src/test/regress/expected/matview.out

Improve documentation about JSONB array containment behavior.

commit   : 308ab77b89ec1662f24b5ab4013ff0d1bd4153a1    
  
author   : Tom Lane <[email protected]>    
date     : Sat, 11 Oct 2014 14:29:51 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Sat, 11 Oct 2014 14:29:51 -0400    

Click here for diff

Per gripe from Josh Berkus.  

M doc/src/sgml/json.sgml

Fix bogus optimization in JSONB containment tests.

commit   : 86b889494a71bd6c9574de04d6612d367bc5a423    
  
author   : Tom Lane <[email protected]>    
date     : Sat, 11 Oct 2014 14:13:54 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Sat, 11 Oct 2014 14:13:54 -0400    

Click here for diff

When determining whether one JSONB object contains another, it's okay to  
make a quick exit if the first object has fewer pairs than the second:  
because we de-duplicate keys within objects, it is impossible that the  
first object has all the keys the second does.  However, the code was  
applying this rule to JSONB arrays as well, where it does *not* hold  
because arrays can contain duplicate entries.  The test was really in  
the wrong place anyway; we should do it within JsonbDeepContains, where  
it can be applied to nested objects not only top-level ones.  
  
Report and test cases by Alexander Korotkov; fix by Peter Geoghegan and  
Tom Lane.  

M src/backend/utils/adt/jsonb_op.c
M src/backend/utils/adt/jsonb_util.c
M src/test/regress/expected/jsonb.out
M src/test/regress/expected/jsonb_1.out
M src/test/regress/sql/jsonb.sql

Fix broken example in PL/pgSQL document.

commit   : a0c58b55220f190e8be9cfe0cadb4d478e13fac2    
  
author   : Fujii Masao <[email protected]>    
date     : Fri, 10 Oct 2014 03:18:01 +0900    
  
committer: Fujii Masao <[email protected]>    
date     : Fri, 10 Oct 2014 03:18:01 +0900    

Click here for diff

Back-patch to all supported branches.  
  
Marti Raudsepp, per a report from Marko Tiikkaja  

M doc/src/sgml/plpgsql.sgml

Fix array overrun in ecpg's version of ParseDateTime().

commit   : 80ddb590b6729fb398cad00b0774f2d10e954b0d    
  
author   : Tom Lane <[email protected]>    
date     : Mon, 6 Oct 2014 21:23:20 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Mon, 6 Oct 2014 21:23:20 -0400    

Click here for diff

The code wrote a value into the caller's field[] array before checking  
to see if there was room, which of course is backwards.  Per report from  
Michael Paquier.  
  
I fixed the equivalent bug in the backend's version of this code way back  
in 630684d3a130bb93, but failed to think about ecpg's copy.  Fortunately  
this doesn't look like it would be exploitable for anything worse than a  
core dump: an external attacker would have no control over the single word  
that gets written.  

M src/interfaces/ecpg/pgtypeslib/dt_common.c

Stamp 9.4beta3.

commit   : abc1a8e509180a96dab45538643abeb25a955190    
  
author   : Tom Lane <[email protected]>    
date     : Mon, 6 Oct 2014 14:32:17 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Mon, 6 Oct 2014 14:32:17 -0400    

Click here for diff

M configure
M configure.in
M doc/bug.template
M src/include/pg_config.h.win32

Rename pg_recvlogical's --create/--drop to --create-slot/--drop-slot.

commit   : 0cd700477466d260ed9c61d0af87df18f7cbfd1a    
  
author   : Andres Freund <[email protected]>    
date     : Mon, 6 Oct 2014 12:11:52 +0200    
  
committer: Andres Freund <[email protected]>    
date     : Mon, 6 Oct 2014 12:11:52 +0200    

Click here for diff

A future patch (9.5 only) adds slot management to pg_receivexlog. The  
verbs create/drop don't seem descriptive enough there. It seems better  
to rename pg_recvlogical's commands now, in beta, than live with the  
inconsistency forever.  
  
The old form (e.g. --drop) will still be accepted by virtue of most  
getopt_long() options accepting abbreviations for long commands.  
  
Backpatch to 9.4 where pg_recvlogical was introduced.  
  
Author: Michael Paquier and Andres Freund  
Discussion: CAB7nPqQtt79U6FmhwvgqJmNyWcVCbbV-nS72j_jyPEopERg9rg@mail.gmail.com  

M doc/src/sgml/logicaldecoding.sgml
M doc/src/sgml/ref/pg_recvlogical.sgml
M src/bin/pg_basebackup/pg_recvlogical.c

Translation updates

commit   : 6af3a67235ba6d31819bc7e4a2dae151721dc257    
  
author   : Peter Eisentraut <[email protected]>    
date     : Sun, 5 Oct 2014 23:22:24 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Sun, 5 Oct 2014 23:22:24 -0400    

Click here for diff

M src/backend/po/de.po
M src/backend/po/it.po
M src/backend/po/ja.po
M src/backend/po/pt_BR.po
M src/backend/po/ru.po
M src/bin/initdb/po/de.po
M src/bin/initdb/po/it.po
M src/bin/initdb/po/ja.po
M src/bin/initdb/po/pt_BR.po
M src/bin/initdb/po/ru.po
M src/bin/pg_basebackup/po/it.po
M src/bin/pg_basebackup/po/pt_BR.po
M src/bin/pg_basebackup/po/ru.po
M src/bin/pg_config/po/ru.po
M src/bin/pg_controldata/po/de.po
M src/bin/pg_controldata/po/it.po
M src/bin/pg_controldata/po/pt_BR.po
M src/bin/pg_controldata/po/ru.po
M src/bin/pg_ctl/po/de.po
M src/bin/pg_ctl/po/it.po
M src/bin/pg_ctl/po/ja.po
M src/bin/pg_ctl/po/pt_BR.po
M src/bin/pg_ctl/po/ru.po
M src/bin/pg_dump/po/de.po
M src/bin/pg_dump/po/it.po
M src/bin/pg_dump/po/ja.po
M src/bin/pg_dump/po/pt_BR.po
M src/bin/pg_dump/po/ru.po
M src/bin/pg_resetxlog/po/de.po
M src/bin/pg_resetxlog/po/it.po
M src/bin/pg_resetxlog/po/pt_BR.po
M src/bin/pg_resetxlog/po/ru.po
M src/bin/psql/po/de.po
M src/bin/psql/po/fr.po
M src/bin/psql/po/it.po
M src/bin/psql/po/ja.po
M src/bin/psql/po/pt_BR.po
M src/bin/psql/po/ru.po
M src/bin/scripts/po/de.po
M src/bin/scripts/po/it.po
M src/bin/scripts/po/pt_BR.po
M src/bin/scripts/po/ru.po
M src/interfaces/ecpg/preproc/po/it.po
M src/interfaces/ecpg/preproc/po/ru.po
M src/interfaces/libpq/po/it.po
M src/interfaces/libpq/po/ja.po
M src/interfaces/libpq/po/ru.po
M src/pl/plpgsql/src/po/de.po
M src/pl/plpgsql/src/po/it.po
M src/pl/plpgsql/src/po/pt_BR.po
M src/pl/plpgsql/src/po/ru.po
M src/pl/plpython/po/it.po
M src/pl/plpython/po/ru.po

Update 9.4 release notes for commits through today.

commit   : 0e7cb5fbd2f4fcdadfe697d5ed92b9b82e3529ef    
  
author   : Tom Lane <[email protected]>    
date     : Sun, 5 Oct 2014 14:14:07 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Sun, 5 Oct 2014 14:14:07 -0400    

Click here for diff

Add entries for recent changes, including noting the JSONB format change  
and the recent timezone data changes.  We should remove those two items  
before 9.4 final: the JSONB change will be of no interest in the long  
run, and it's not normally our habit to mention timezone updates in  
major-release notes.  But it seems important to document them temporarily  
for beta testers.  
  
I failed to resist the temptation to wordsmith a couple of existing  
entries, too.  

M doc/src/sgml/release-9.4.sgml

commit   : c6fda5a19f7d43089801f445733d48ba2a7229d4    
  
author   : Robert Haas <[email protected]>    
date     : Sat, 4 Oct 2014 21:25:41 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Sat, 4 Oct 2014 21:25:41 -0400    

Click here for diff

Teach sigusr1_handler() to use the same test for whether a worker  
might need to be started as ServerLoop().  Aside from being perhaps  
a bit simpler, this prevents a potentially-unbounded delay when  
starting a background worker.  On some platforms, select() doesn't  
return when interrupted by a signal, but is instead restarted,  
including a reset of the timeout to the originally-requested value.  
If signals arrive often enough, but no connection requests arrive,  
sigusr1_handler() will be executed repeatedly, but the body of  
ServerLoop() won't be reached.  This change ensures that, even in  
that case, background workers will eventually get launched.  
  
This is far from a perfect fix; really, we need select() to return  
control to ServerLoop() after an interrupt, either via the self-pipe  
trick or some other mechanism.  But that's going to require more  
work and discussion, so let's do this for now to at least mitigate  
the damage.  
  
Per investigation of test_shm_mq failures on buildfarm member anole.  

M src/backend/postmaster/postmaster.c

Update time zone data files to tzdata release 2014h.

commit   : bb7c8f99ac829c5fe5d3bd3a20b2642d55abdb62    
  
author   : Tom Lane <[email protected]>    
date     : Sat, 4 Oct 2014 14:18:29 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Sat, 4 Oct 2014 14:18:29 -0400    

Click here for diff

Most zones in the Russian Federation are subtracting one or two hours  
as of 2014-10-26.  Update the meanings of the abbreviations IRKT, KRAT,  
MAGT, MSK, NOVT, OMST, SAKT, VLAT, YAKT, YEKT to match.  
  
The IANA timezone database has adopted abbreviations of the form AxST/AxDT  
for all Australian time zones, reflecting what they believe to be current  
majority practice Down Under.  These names do not conflict with usage  
elsewhere (other than ACST for Acre Summer Time, which has been in disuse  
since 1994).  Accordingly, adopt these names into our "Default" timezone  
abbreviation set.  The "Australia" abbreviation set now contains only  
CST,EAST,EST,SAST,SAT,WST, all of which are thought to be mostly historical  
usage.  Note that SAST has also been changed to be South Africa Standard  
Time in the "Default" abbreviation set.  
  
Add zone abbreviations SRET (Asia/Srednekolymsk) and XJT (Asia/Urumqi),  
and use WSST/WSDT for western Samoa.  
  
Also a DST law change in the Turks & Caicos Islands (America/Grand_Turk),  
and numerous corrections for historical time zone data.  

M src/backend/utils/misc/postgresql.conf.sample
M src/timezone/data/africa
M src/timezone/data/antarctica
M src/timezone/data/asia
M src/timezone/data/australasia
M src/timezone/data/backward
A src/timezone/data/backzone
M src/timezone/data/etcetera
M src/timezone/data/europe
M src/timezone/data/factory
M src/timezone/data/iso3166.tab
M src/timezone/data/leapseconds
M src/timezone/data/northamerica
M src/timezone/data/pacificnew
M src/timezone/data/southamerica
M src/timezone/data/systemv
M src/timezone/data/yearistype.sh
M src/timezone/data/zone.tab
A src/timezone/data/zone1970.tab
M src/timezone/known_abbrevs.txt
M src/timezone/tznames/Africa.txt
M src/timezone/tznames/America.txt
M src/timezone/tznames/Antarctica.txt
M src/timezone/tznames/Asia.txt
M src/timezone/tznames/Australia
M src/timezone/tznames/Australia.txt
M src/timezone/tznames/Default
M src/timezone/tznames/Europe.txt
M src/timezone/tznames/Pacific.txt

Update time zone abbreviations lists.

commit   : d13913c820c2b6ea418d51106c199d01c50eb14b    
  
author   : Tom Lane <[email protected]>    
date     : Fri, 3 Oct 2014 17:44:38 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Fri, 3 Oct 2014 17:44:38 -0400    

Click here for diff

This updates known_abbrevs.txt to be what it should have been already,  
were my -P patch not broken; and updates some tznames/ entries that  
missed getting any love in previous timezone data updates because zic  
failed to flag the change of abbreviation.  
  
The non-cosmetic updates:  
  
* Remove references to "ADT" as "Arabia Daylight Time", an abbreviation  
that's been out of use since 2007; therefore, claiming there is a conflict  
with "Atlantic Daylight Time" doesn't seem especially helpful.  (We have  
left obsolete entries in the files when they didn't conflict with anything,  
but that seems like a different situation.)  
  
* Fix entirely incorrect GMT offsets for CKT (Cook Islands), FJT, FJST  
(Fiji); we didn't even have them on the proper side of the date line.  
(Seems to have been aboriginal errors in our tznames data; there's no  
evidence anything actually changed recently.)  
  
* FKST (Falkland Islands Summer Time) is now used all year round, so  
don't mark it as a DST abbreviation.  
  
* Update SAKT (Sakhalin) to mean GMT+11 not GMT+10.  
  
In cosmetic changes, I fixed a bunch of wrong (or at least obsolete)  
claims about abbreviations not being present in the zic files, and  
tried to be consistent about how obsolete abbreviations are labeled.  
  
Note the underlying timezone/data files are still at release 2014e;  
this is just trying to get us in sync with what those files actually  
say before we go to the next update.  

M src/timezone/known_abbrevs.txt
M src/timezone/tznames/America.txt
M src/timezone/tznames/Asia.txt
M src/timezone/tznames/Atlantic.txt
M src/timezone/tznames/Default
M src/timezone/tznames/Europe.txt
M src/timezone/tznames/Pacific.txt

Fix bogus logic for zic -P option.

commit   : 03163139c9553c6ee4c26a73e21aaef5da22be45    
  
author   : Tom Lane <[email protected]>    
date     : Fri, 3 Oct 2014 14:48:11 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Fri, 3 Oct 2014 14:48:11 -0400    

Click here for diff

The quick hack I added to zic to dump out currently-in-use timezone  
abbreviations turns out to have a nasty bug: within each zone, it was  
printing the last "struct ttinfo" to be *defined*, not necessarily the  
last one in use.  This was mainly a problem in zones that had changed the  
meaning of their zone abbreviation (to another GMT offset value) and later  
changed it back.  
  
As a result of this error, we'd missed out updating the tznames/ files  
for some jurisdictions that have changed their zone abbreviations since  
the tznames/ files were originally created.  I'll address the missing data  
updates in a separate commit.  

M src/timezone/zic.c

Don't balance vacuum cost delay when per-table settings are in effect

commit   : 23a8cae6bcdadb1569336cf911cbeb772fda099b    
  
author   : Alvaro Herrera <[email protected]>    
date     : Fri, 3 Oct 2014 13:01:27 -0300    
  
committer: Alvaro Herrera <[email protected]>    
date     : Fri, 3 Oct 2014 13:01:27 -0300    

Click here for diff

When there are cost-delay-related storage options set for a table,  
trying to make that table participate in the autovacuum cost-limit  
balancing algorithm produces undesirable results: instead of using the  
configured values, the global values are always used,  
as illustrated by Mark Kirkwood in  
http://www.postgresql.org/message-id/[email protected]  
  
Since the mechanism is already complicated, just disable it for those  
cases rather than trying to make it cope.  There are undesirable  
side-effects from this too, namely that the total I/O impact on the  
system will be higher whenever such tables are vacuumed.  However, this  
is seen as less harmful than slowing down vacuum, because that would  
cause bloat to accumulate.  Anyway, in the new system it is possible to  
tweak options to get the precise behavior one wants, whereas with the  
previous system one was simply hosed.  
  
This has been broken forever, so backpatch to all supported branches.  
This might affect systems where cost_limit and cost_delay have been set  
for individual tables.  

M doc/src/sgml/maintenance.sgml
M src/backend/postmaster/autovacuum.c

Check for GiST index tuples that don't fit on a page.

commit   : 925e10dc57cdf0efb7268a65b411f1e58ac5116d    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Fri, 3 Oct 2014 12:07:10 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Fri, 3 Oct 2014 12:07:10 +0300    

Click here for diff

The page splitting code would go into infinite recursion if you try to  
insert an index tuple that doesn't fit even on an empty page.  
  
Per analysis and suggested fix by Andrew Gierth. Fixes bug #11555, reported  
by Bryan Seitz (analysis happened over IRC). Backpatch to all supported  
versions.  

M src/backend/access/gist/gist.c

Fix typo in error message.

commit   : 80f9a368be91d179cddd9666f8cb66132e52727d    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Thu, 2 Oct 2014 15:51:31 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Thu, 2 Oct 2014 15:51:31 +0300    

Click here for diff

M contrib/pgbench/pgbench.c

Fix some more problems with nested append relations.

commit   : 07afbca2e7e8b1699ea2dc7b581d59c99287fff8    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 1 Oct 2014 19:30:27 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 1 Oct 2014 19:30:27 -0400    

Click here for diff

As of commit a87c72915 (which later got backpatched as far as 9.1),  
we're explicitly supporting the notion that append relations can be  
nested; this can occur when UNION ALL constructs are nested, or when  
a UNION ALL contains a table with inheritance children.  
  
Bug #11457 from Nelson Page, as well as an earlier report from Elvis  
Pranskevichus, showed that there were still nasty bugs associated with such  
cases: in particular the EquivalenceClass mechanism could try to generate  
"join" clauses connecting an appendrel child to some grandparent appendrel,  
which would result in assertion failures or bogus plans.  
  
Upon investigation I concluded that all current callers of  
find_childrel_appendrelinfo() need to be fixed to explicitly consider  
multiple levels of parent appendrels.  The most complex fix was in  
processing of "broken" EquivalenceClasses, which are ECs for which we have  
been unable to generate all the derived equality clauses we would like to  
because of missing cross-type equality operators in the underlying btree  
operator family.  That code path is more or less entirely untested by  
the regression tests to date, because no standard opfamilies have such  
holes in them.  So I wrote a new regression test script to try to exercise  
it a bit, which turned out to be quite a worthwhile activity as it exposed  
existing bugs in all supported branches.  
  
The present patch is essentially the same as far back as 9.2, which is  
where parameterized paths were introduced.  In 9.0 and 9.1, we only need  
to back-patch a small fragment of commit 5b7b5518d, which fixes failure to  
propagate out the original WHERE clauses when a broken EC contains constant  
members.  (The regression test case results show that these older branches  
are noticeably stupider than 9.2+ in terms of the quality of the plans  
generated; but we don't really care about plan quality in such cases,  
only that the plan not be outright wrong.  A more invasive fix in the  
older branches would not be a good idea anyway from a plan-stability  
standpoint.)  

M src/backend/optimizer/path/equivclass.c
M src/backend/optimizer/path/indxpath.c
M src/backend/optimizer/prep/prepunion.c
M src/backend/optimizer/util/relnode.c
M src/include/optimizer/pathnode.h
M src/include/optimizer/prep.h
A src/test/regress/expected/equivclass.out
M src/test/regress/parallel_schedule
M src/test/regress/serial_schedule
A src/test/regress/sql/equivclass.sql

Fix damange from wrongly split commit in fdf81c9a6cf94.

commit   : 6d89b0860cba23761db3d08523c28e4da79bcbcd    
  
author   : Andres Freund <[email protected]>    
date     : Wed, 1 Oct 2014 19:24:50 +0200    
  
committer: Andres Freund <[email protected]>    
date     : Wed, 1 Oct 2014 19:24:50 +0200    

Click here for diff

Unfortunately I mistakenly split the commit wrongly into two parts,  
leaving one part of renaming StreamLog to StreamLogicalLog in the  
second commit. Which isn't backported to 9.4...  
Fix it in 9.4 only, as master already is 'fixed' by the subsequent  
commit.  
  
Noticed by Jan Wieck and the buildfarm.  

M src/bin/pg_basebackup/pg_recvlogical.c

pg_recvlogical.c code review.

commit   : 0cadfee37fba0e60a763c62b2d9010b9a2f15b5e    
  
author   : Andres Freund <[email protected]>    
date     : Mon, 29 Sep 2014 15:35:40 +0200    
  
committer: Andres Freund <[email protected]>    
date     : Mon, 29 Sep 2014 15:35:40 +0200    

Click here for diff

Several comments still referred to 'initiating', 'freeing', 'stopping'  
replication slots. These were terms used during different phases of  
the development of logical decoding, but are no long accurate.  
  
Also rename StreamLog() to StreamLogicalLog() and add 'void' to the  
prototype.  
  
Author: Michael Paquier, with some editing by me.  
  
Backpatch to 9.4 where pg_recvlogical was introduced.  

M src/bin/pg_basebackup/pg_recvlogical.c

Remove num_xloginsert_locks GUC, replace with a #define

commit   : fc0acf43878bcd70dc1b701b054521d8553d2088    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Wed, 1 Oct 2014 16:37:15 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Wed, 1 Oct 2014 16:37:15 +0300    

Click here for diff

I left the GUC in place for the beta period, so that people could experiment  
with different values. No-one's come up with any data that a different value  
would be better under some circumstances, so rather than try to document to  
users what the GUC, let's just hard-code the current value, 8.  

M src/backend/access/transam/xlog.c
M src/backend/utils/misc/guc.c
M src/include/access/xlog.h

Block signals while computing the sleep time in postmaster's main loop.

commit   : e14ed8e2f5382185c9cd0215bf88dc90eb1907cb    
  
author   : Andres Freund <[email protected]>    
date     : Wed, 1 Oct 2014 14:23:43 +0200    
  
committer: Andres Freund <[email protected]>    
date     : Wed, 1 Oct 2014 14:23:43 +0200    

Click here for diff

DetermineSleepTime() was previously called without blocked  
signals. That's not good, because it allows signal handlers to  
interrupt its workings.  
  
DetermineSleepTime() was added in 9.3 with the addition of background  
workers (da07a1e856511), where it only read from  
BackgroundWorkerList.  
  
Since 9.4, where dynamic background workers were added (7f7485a0cde),  
the list is also manipulated in DetermineSleepTime(). That's bad  
because the list now can be persistently corrupted if modified by both  
a signal handler and DetermineSleepTime().  
  
This was discovered during the investigation of hangs on buildfarm  
member anole. It's unclear whether this bug is the source of these  
hangs or not, but it's worth fixing either way. I have confirmed that  
it can cause crashes.  
  
It luckily looks like this only can cause problems when bgworkers are  
actively used.  
  
Discussion: [email protected]  
  
Backpatch to 9.3 where background workers were introduced.  

M src/backend/postmaster/postmaster.c

Improve documentation about binary/textual output mode for output plugins.

commit   : ce84b0682cd169738797f74ec8acc1701b9da40c    
  
author   : Andres Freund <[email protected]>    
date     : Wed, 1 Oct 2014 13:13:59 +0200    
  
committer: Andres Freund <[email protected]>    
date     : Wed, 1 Oct 2014 13:13:59 +0200    

Click here for diff

Discussion: CAB7nPqQrqFzjqCjxu4GZzTrD9kpj6HMn9G5aOOMwt1WZ8NfqeA@mail.gmail.com,  
    CAB7nPqQXc_+g95zWnqaa=mVQ4d3BVRs6T41frcEYi2ocUrR3+A@mail.gmail.com  
  
Per discussion between Michael Paquier, Robert Haas and Andres Freund  
  
Backpatch to 9.4 where logical decoding was introduced.  

M contrib/test_decoding/expected/binary.out
M doc/src/sgml/logicaldecoding.sgml
M src/backend/replication/logical/logicalfuncs.c

Rename CACHE_LINE_SIZE to PG_CACHE_LINE_SIZE.

commit   : f78319fec8eb8aed34d6e1e43ca35fb0a9bfe108    
  
author   : Andres Freund <[email protected]>    
date     : Wed, 1 Oct 2014 11:54:05 +0200    
  
committer: Andres Freund <[email protected]>    
date     : Wed, 1 Oct 2014 11:54:05 +0200    

Click here for diff

As noted in http://bugs.debian.org/763098 there is a conflict between  
postgres' definition of CACHE_LINE_SIZE and the definition by various  
*bsd platforms. It's debatable who has the right to define such a  
name, but postgres' use was only introduced in 375d8526f290 (9.4), so  
it seems like a good idea to rename it.  
  
Discussion: [email protected]  
  
Per complaint of Christoph Berg in the above email, although he's not  
the original bug reporter.  
  
Backpatch to 9.4 where the define was introduced.  

M src/backend/access/transam/xlog.c
M src/include/pg_config_manual.h

Correct stdin/stdout usage in COPY .. PROGRAM

commit   : 721a8bb54602624b24d416f8d9b7b8f97701ecbd    
  
author   : Stephen Frost <[email protected]>    
date     : Tue, 30 Sep 2014 15:55:28 -0400    
  
committer: Stephen Frost <[email protected]>    
date     : Tue, 30 Sep 2014 15:55:28 -0400    

Click here for diff

The COPY documentation incorrectly stated, for the PROGRAM case,  
that we read from stdin and wrote to stdout.  Fix that, and improve  
consistency by referring to the 'PostgreSQL' user instead of the  
'postgres' user, as is done in the rest of the COPY documentation.  
  
Pointed out by Peter van Dijk.  
  
Back-patch to 9.3 where COPY .. PROGRAM was introduced.  

M doc/src/sgml/ref/copy.sgml

Fix pg_dump's --if-exists for large objects

commit   : 5f4f66f67184cc4696ffa3babcad868d34fd557a    
  
author   : Alvaro Herrera <[email protected]>    
date     : Tue, 30 Sep 2014 12:06:37 -0300    
  
committer: Alvaro Herrera <[email protected]>    
date     : Tue, 30 Sep 2014 12:06:37 -0300    

Click here for diff

This was born broken in 9067310cc5dd590e36c2c3219dbf3961d7c9f8cb.  
  
Per trouble report from Joachim Wieland.  
  
Pavel Stěhule and Álvaro Herrera  

M src/bin/pg_dump/pg_backup_archiver.c

pg_upgrade: have pg_upgrade fail for old 9.4 JSONB format

commit   : 6f1310024d20bdaf54edb1ab212c1428ebb300d4    
  
author   : Bruce Momjian <[email protected]>    
date     : Mon, 29 Sep 2014 20:19:59 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Mon, 29 Sep 2014 20:19:59 -0400    

Click here for diff

Backpatch through 9.4  

M contrib/pg_upgrade/check.c
M contrib/pg_upgrade/pg_upgrade.h

Change JSONB's on-disk format for improved performance.

commit   : f6b7d4fbbb72cedd53adb3bf10428dab559bb909    
  
author   : Tom Lane <[email protected]>    
date     : Mon, 29 Sep 2014 12:29:24 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Mon, 29 Sep 2014 12:29:24 -0400    

Click here for diff

The original design used an array of offsets into the variable-length  
portion of a JSONB container.  However, such an array is basically  
uncompressible by simple compression techniques such as TOAST's LZ  
compressor.  That's bad enough, but because the offset array is at the  
front, it tended to trigger the give-up-after-1KB heuristic in the TOAST  
code, so that the entire JSONB object was stored uncompressed; which was  
the root cause of bug #11109 from Larry White.  
  
To fix without losing the ability to extract a random array element in O(1)  
time, change this scheme so that most of the JEntry array elements hold  
lengths rather than offsets.  With data that's compressible at all, there  
tend to be fewer distinct element lengths, so that there is scope for  
compression of the JEntry array.  Every N'th entry is still an offset.  
To determine the length or offset of any specific element, we might have  
to examine up to N preceding JEntrys, but that's still O(1) so far as the  
total container size is concerned.  Testing shows that this cost is  
negligible compared to other costs of accessing a JSONB field, and that  
the method does largely fix the incompressible-data problem.  
  
While at it, rearrange the order of elements in a JSONB object so that  
it's "all the keys, then all the values" not alternating keys and values.  
This doesn't really make much difference right at the moment, but it will  
allow providing a fast path for extracting individual object fields from  
large JSONB values stored EXTERNAL (ie, uncompressed), analogously to the  
existing optimization for substring extraction from large EXTERNAL text  
values.  
  
Bump catversion to denote the incompatibility in on-disk format.  
We will need to fix pg_upgrade to disallow upgrading jsonb data stored  
with 9.4 betas 1 and 2.  
  
Heikki Linnakangas and Tom Lane  

M src/backend/utils/adt/jsonb.c
M src/backend/utils/adt/jsonb_util.c
M src/include/catalog/catversion.h
M src/include/utils/jsonb.h

Fix identify_locking_dependencies for schema-only dumps.

commit   : 4e23c47a3bb7a198c87940b6e9ac96edfa53962b    
  
author   : Robert Haas <[email protected]>    
date     : Fri, 26 Sep 2014 11:21:35 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Fri, 26 Sep 2014 11:21:35 -0400    

Click here for diff

Without this fix, parallel restore of a schema-only dump can deadlock,  
because when the dump is schema-only, the dependency will still be  
pointing at the TABLE item rather than the TABLE DATA item.  
  
Robert Haas and Tom Lane  

M src/bin/pg_dump/pg_backup_archiver.c

Remove ill-conceived ban on zero length json object keys.

commit   : d99d0e60eaa8334b698a070cb919202607660a65    
  
author   : Andrew Dunstan <[email protected]>    
date     : Thu, 25 Sep 2014 15:08:42 -0400    
  
committer: Andrew Dunstan <[email protected]>    
date     : Thu, 25 Sep 2014 15:08:42 -0400    

Click here for diff

We removed a similar ban on this in json_object recently, but the ban in  
datum_to_json was left, which generate4d sprutious errors in othee json  
generators, notable json_build_object.  
  
Along the way, add an assertion that datum_to_json is not passed a null  
key. All current callers comply with this rule, but the assertion will  
catch any possible future misbehaviour.  

M src/backend/utils/adt/json.c

Fix VPATH builds of the replication parser from git for some !gcc compilers.

commit   : 2024ead21b8ac64f0d6cd13d0c1c2cb8d596238e    
  
author   : Andres Freund <[email protected]>    
date     : Thu, 25 Sep 2014 15:22:26 +0200    
  
committer: Andres Freund <[email protected]>    
date     : Thu, 25 Sep 2014 15:22:26 +0200    

Click here for diff

Some compilers don't automatically search the current directory for  
included files. 9cc2c182fc2 fixed that for builds from tarballs by  
adding an include to the source directory. But that doesn't work when  
the scanner is generated in the VPATH directory. Use the same search  
path as the other parsers in the tree.  
  
One compiler that definitely was affected is solaris' sun cc.  
  
Backpatch to 9.1 which introduced using an actual parser for  
replication commands.  

M src/backend/replication/Makefile

Return NULL from json_object_agg if it gets no rows.

commit   : bda1d14360404ef58c4647888032158991051b14    
  
author   : Andrew Dunstan <[email protected]>    
date     : Thu, 25 Sep 2014 08:18:18 -0400    
  
committer: Andrew Dunstan <[email protected]>    
date     : Thu, 25 Sep 2014 08:18:18 -0400    

Click here for diff

This makes it consistent with the docs and with all other builtin  
aggregates apart from count().  

M src/backend/utils/adt/json.c

Fix bogus variable-mangling in security_barrier_replace_vars().

commit   : 54b8ed6c24736d7ad55f56dbaa2696ae05c4bded    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 24 Sep 2014 15:59:37 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 24 Sep 2014 15:59:37 -0400    

Click here for diff

This function created new Vars with varno different from varnoold, which  
is a condition that should never prevail before setrefs.c does the final  
variable-renumbering pass.  The created Vars could not be seen as equal()  
to normal Vars, which among other things broke equivalence-class processing  
for them.  The consequences of this were indeed visible in the regression  
tests, in the form of failure to propagate constants as one would expect.  
I stumbled across it while poking at bug #11457 --- after intentionally  
disabling join equivalence processing, the security-barrier regression  
tests started falling over with fun errors like "could not find pathkey  
item to sort", because of failure to match the corrupted Vars to normal  
ones.  

M src/backend/optimizer/prep/prepsecurity.c
M src/test/regress/expected/updatable_views.out

Fix typos in descriptions of json_object functions.

commit   : 2c7946e4b8a623f7972fd87f8a1226e48f74ca7f    
  
author   : Andrew Dunstan <[email protected]>    
date     : Wed, 24 Sep 2014 11:24:42 -0400    
  
committer: Andrew Dunstan <[email protected]>    
date     : Wed, 24 Sep 2014 11:24:42 -0400    

Click here for diff

M src/include/catalog/pg_proc.h

Fix incorrect search for "x?" style matches in creviterdissect().

commit   : 6eaf7e5bea958c93fda306c846997414184d2526    
  
author   : Tom Lane <[email protected]>    
date     : Tue, 23 Sep 2014 20:25:33 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Tue, 23 Sep 2014 20:25:33 -0400    

Click here for diff

When the number of allowed iterations is limited (either a "?" quantifier  
or a bound expression), the last sub-match has to reach to the end of the  
target string.  The previous coding here first tried the shortest possible  
match (one character, usually) and then gave up and back-tracked if that  
didn't work, typically leading to failure to match overall, as shown in  
bug #11478 from Christoph Berg.  The minimum change to fix that would be to  
not decrement k before "goto backtrack"; but that would be a pretty stupid  
solution, because we'd laboriously try each possible sub-match length  
before finally discovering that only ending at the end can work.  Instead,  
force the sub-match endpoint limit up to the end for even the first  
shortest() call if we cannot have any more sub-matches after this one.  
  
Bug introduced in my rewrite that added the iterdissect logic, commit  
173e29aa5deefd9e71c183583ba37805c8102a72.  The shortest-first search code  
was too closely modeled on the longest-first code, which hasn't got this  
issue since it tries a match reaching to the end to start with anyway.  
Back-patch to all affected branches.  

M src/backend/regex/regexec.c
M src/test/regress/expected/regex.out
M src/test/regress/sql/regex.sql

Log ALTER SYSTEM statements as DDL

commit   : fcfd7d26a2f99e99ad5bba6a982963dc3c9b0da0    
  
author   : Stephen Frost <[email protected]>    
date     : Mon, 22 Sep 2014 20:50:17 -0400    
  
committer: Stephen Frost <[email protected]>    
date     : Mon, 22 Sep 2014 20:50:17 -0400    

Click here for diff

Per discussion in bug #11350, log ALTER SYSTEM commands at the  
log_statement=ddl level, rather than at the log_statement=all level.  
  
Pointed out by Tomonari Katsumata.  
  
Back-patch to 9.4 where ALTER SYSTEM was introduced.  

M src/backend/tcop/utility.c

Process withCheckOption exprs in setrefs.c

commit   : c4bee09c0e1fc7fb2281ba1e125ab17c5e9a20e7    
  
author   : Stephen Frost <[email protected]>    
date     : Mon, 22 Sep 2014 20:22:16 -0400    
  
committer: Stephen Frost <[email protected]>    
date     : Mon, 22 Sep 2014 20:22:16 -0400    

Click here for diff

While withCheckOption exprs had been handled in many cases by  
happenstance, they need to be handled during set_plan_references and  
more specifically down in set_plan_refs for ModifyTable plan nodes.  
This is to ensure that the opfuncid's are set for operators referenced  
in the withCheckOption exprs.  
  
Identified as an issue by Thom Brown  
  
Patch by Dean Rasheed  
  
Back-patch to 9.4, where withCheckOption was introduced.  

M src/backend/optimizer/plan/setrefs.c
M src/test/regress/expected/updatable_views.out
M src/test/regress/sql/updatable_views.sql

Fix mishandling of CreateEventTrigStmt's eventname field.

commit   : e3e065d3779d82640e93298c06106c16c1948090    
  
author   : Robert Haas <[email protected]>    
date     : Mon, 22 Sep 2014 16:05:51 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Mon, 22 Sep 2014 16:05:51 -0400    

Click here for diff

It's a string, not a scalar.  
  
Petr Jelinek  

M src/backend/nodes/copyfuncs.c
M src/backend/nodes/equalfuncs.c

Fix failure of contrib/auto_explain to print per-node timing information.

commit   : 47288bd08c0169ecb5eb50742336cc0df813777e    
  
author   : Tom Lane <[email protected]>    
date     : Fri, 19 Sep 2014 13:18:59 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Fri, 19 Sep 2014 13:18:59 -0400    

Click here for diff

This has been broken since commit af7914c6627bcf0b0ca614e9ce95d3f8056602bf,  
which added the EXPLAIN (TIMING) option.  Although that commit included  
updates to auto_explain, they evidently weren't tested very carefully,  
because the code failed to print node timings even when it should, due to  
failure to set es.timing in the ExplainState struct.  Reported off-list by  
Neelakanth Nadgir of Salesforce.  
  
In passing, clean up the documentation for auto_explain's options a  
little bit, including re-ordering them into what seems to me a more  
logical order.  

M contrib/auto_explain/auto_explain.c
M doc/src/sgml/auto-explain.sgml

Mark x86's memory barrier inline assembly as clobbering the cpu flags.

commit   : f9edfc1aa9ea4f0bae87eabcac261d82370c7de4    
  
author   : Andres Freund <[email protected]>    
date     : Fri, 19 Sep 2014 17:04:00 +0200    
  
committer: Andres Freund <[email protected]>    
date     : Fri, 19 Sep 2014 17:04:00 +0200    

Click here for diff

x86's memory barrier assembly was marked as clobbering "memory" but  
not "cc" even though 'addl' sets various flags. As it turns out gcc on  
x86 implicitly assumes "cc" on every inline assembler statement, so  
it's not a bug. But as that's poorly documented and might get copied  
to architectures or compilers where that's not the case, it seems  
better to be precise.  
  
Discussion: [email protected]  
  
To keep the code common, backpatch to 9.2 where explicit memory  
barriers were introduced.  

M src/include/storage/barrier.h

Fix TAP checks when current directory name contains spaces

commit   : 78b488d2e3d884e58a670f052400573b33824e04    
  
author   : Peter Eisentraut <[email protected]>    
date     : Wed, 17 Sep 2014 00:54:12 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Wed, 17 Sep 2014 00:54:12 -0400    

Click here for diff

Add some quotes in the makefile snippet that creates the temporary  
installation, so that it can handle spaces in the directory name and  
possibly some other oddities.  

M src/Makefile.global.in

Fix the return type of GIN triConsistent support functions to "char".

commit   : 4c054ad18ecc4aa7fdc9a6760d029c64eaab1cdd    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Tue, 16 Sep 2014 09:11:49 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Tue, 16 Sep 2014 09:11:49 +0300    

Click here for diff

They were marked to return a boolean, but they actually return a  
GinTernaryValue, which is more like a "char". It makes no practical  
difference, as the triConsistent functions cannot be called directly from  
SQL because they have "internal" arguments, but this nevertheless seems  
more correct.  
  
Also fix the GinTernaryValue name in the documentation. I renamed the enum  
earlier, but neglected the docs.  
  
Alexander Korotkov. This is new in 9.4, so backpatch there.  

M doc/src/sgml/gin.sgml
M src/include/catalog/catversion.h
M src/include/catalog/pg_proc.h

Handle border = 3 in expanded mode

commit   : 1597e6c212d3930edb6f58390a511526cc043377    
  
author   : Stephen Frost <[email protected]>    
date     : Fri, 12 Sep 2014 11:24:09 -0400    
  
committer: Stephen Frost <[email protected]>    
date     : Fri, 12 Sep 2014 11:24:09 -0400    

Click here for diff

In psql, expanded mode was not being displayed correctly when using  
the normal ascii or unicode linestyles and border set to '3'.  Now,  
per the documentation, border '3' is really only sensible for HTML  
and LaTeX formats, however, that's no excuse for ascii/unicode to  
break in that case, and provisions had been made for psql to cleanly  
handle this case (and it did, in non-expanded mode).  
  
This was broken when ascii/unicode was initially added a good five  
years ago because print_aligned_vertical_line wasn't passed in the  
border setting being used by print_aligned_vertical but instead was  
given the whole printTableContent.  There really isn't a good reason  
for vertical_line to have the entire printTableContent structure, so  
just pass in the printTextFormat and border setting (similar to how  
this is handled in horizontal_line).  
  
Pointed out by Pavel Stehule, fix by me.  
  
Back-patch to all currently-supported versions.  

M src/bin/psql/print.c

Support ALTER SYSTEM RESET command.

commit   : 7dfab04a8aad7aa5066d2625a649d407ed6b7a5f    
  
author   : Fujii Masao <[email protected]>    
date     : Tue, 2 Sep 2014 16:06:58 +0900    
  
committer: Fujii Masao <[email protected]>    
date     : Tue, 2 Sep 2014 16:06:58 +0900    

Click here for diff

This patch allows us to execute ALTER SYSTEM RESET command to  
remove the configuration entry from postgresql.auto.conf.  
  
Vik Fearing, reviewed by Amit Kapila and me.  

M doc/src/sgml/ref/alter_system.sgml
M src/backend/parser/gram.y
M src/backend/utils/misc/guc.c
M src/bin/psql/tab-complete.c

Fix GIN data page split ratio calculation.

commit   : 79ee6370ee803b36c2649cfb7655affa2c1007f1    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Fri, 12 Sep 2014 11:23:59 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Fri, 12 Sep 2014 11:23:59 +0300    

Click here for diff

The code that tried to split a page at 75/25 ratio, when appending to the  
end of an index, was buggy in two ways. First, there was a silly typo that  
caused it to just fill the left page as full as possible. But the logic as  
it was intended wasn't correct either, and would actually have given a ratio  
closer to 60/40 than 75/25.  
  
Gaetano Mendola spotted the typo. Backpatch to 9.4, where this code was added.  

M src/backend/access/gin/gindatapage.c

Fix power_var_int() for large integer exponents.

commit   : 1c603198a497173b4947fc669fdeda4706b09eb8    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 11 Sep 2014 23:30:54 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 11 Sep 2014 23:30:54 -0400    

Click here for diff

The code for raising a NUMERIC value to an integer power wasn't very  
careful about large powers.  It got an outright wrong answer for an  
exponent of INT_MIN, due to failure to consider overflow of the Abs(exp)  
operation; which is fixable by using an unsigned rather than signed  
exponent value after that point.  Also, even though the number of  
iterations of the power-computation loop is pretty limited, it's easy for  
the repeated squarings to result in ridiculously enormous intermediate  
values, which can take unreasonable amounts of time/memory to process,  
or even overflow the internal "weight" field and so produce a wrong answer.  
We can forestall misbehaviors of that sort by bailing out as soon as the  
weight value exceeds what will fit in int16, since then the final answer  
must overflow (if exp > 0) or underflow (if exp < 0) the packed numeric  
format.  
  
Per off-list report from Pavel Stehule.  Back-patch to all supported  
branches.  

M src/backend/utils/adt/numeric.c
M src/test/regress/expected/numeric.out
M src/test/regress/sql/numeric.sql

Fix vacuumdb --analyze-in-stages --all order

commit   : 330bf85c4936fa6f0b59d4baad54cd8e1ce11604    
  
author   : Peter Eisentraut <[email protected]>    
date     : Thu, 11 Sep 2014 21:08:59 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Thu, 11 Sep 2014 21:08:59 -0400    

Click here for diff

When running vacuumdb --analyze-in-stages --all, it needs to run the  
first stage across all databases before the second one, instead of  
running all stages in a database before processing the next one.  
  
Also respect the --quiet option with --analyze-in-stages.  

M src/bin/scripts/t/102_vacuumdb_stages.pl
M src/bin/scripts/vacuumdb.c

pg_upgrade: preserve the timestamp epoch

commit   : 022aea346def58d5dd17dd0e012f925e8688d439    
  
author   : Bruce Momjian <[email protected]>    
date     : Thu, 11 Sep 2014 18:39:46 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Thu, 11 Sep 2014 18:39:46 -0400    

Click here for diff

This is useful for replication tools like Slony and Skytools.  This is a  
backpatch of a74a4aa23bb95b590ff01ee564219d2eacea3706.  
  
Report by Sergey Konoplev  
  
Backpatch through 9.3  

M contrib/pg_upgrade/controldata.c
M contrib/pg_upgrade/pg_upgrade.c
M contrib/pg_upgrade/pg_upgrade.h

Remove dead InRecovery check.

commit   : b8b4124011322b7e376f9e21b3d335a85a28f54c    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Thu, 11 Sep 2014 22:43:56 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Thu, 11 Sep 2014 22:43:56 +0300    

Click here for diff

With the new B-tree incomplete split handling in 9.4, _bt_insert_parent is  
never called in recovery.  

M src/backend/access/nbtree/nbtinsert.c

Fix Windows build.

commit   : 06b95334f8d16d975e3a68f2392599249ca99c93    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Thu, 11 Sep 2014 15:15:40 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Thu, 11 Sep 2014 15:15:40 +0300    

Click here for diff

I renamed a variable, but missed an #ifdef WIN32 block.  

M contrib/pgbench/pgbench.c

Simplify calculation of Poisson distributed delays in pgbench --rate mode.

commit   : c8b24991115c967abee06ccc78e11532d02cffde    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Thu, 11 Sep 2014 13:00:48 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Thu, 11 Sep 2014 13:00:48 +0300    

Click here for diff

The previous coding first generated a uniform random value between 0.0 and  
1.0, then converted that to an integer between 1 and 10000, and divided that  
again by 10000. Those conversions are unnecessary; we can use the double  
value that pg_erand48() returns directly. While we're at it, put the logic  
into a helper function, getPoissonRand().  
  
The largest delay generated by the old coding was about 9.2 times the  
average, because of the way the uniformly distributed value used for the  
calculation was truncated to 1/10000 granularity. The new coding doesn't  
have such clamping. With my laptop's DBL_MIN value, the maximum delay with  
the new coding is about 700x the average. That seems acceptable - any  
reasonable pgbench session should last long enough to average that out.  
  
Backpatch to 9.4.  

M contrib/pgbench/pgbench.c

Change the way latency is calculated with pgbench --rate option.

commit   : 8c9dd69fc2638701653c90bbf291884f8ca23d56    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Thu, 11 Sep 2014 12:40:01 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Thu, 11 Sep 2014 12:40:01 +0300    

Click here for diff

The reported latency values now include the "schedule lag" time, that is,  
the time between the transaction's scheduled start time and the time it  
actually started. This relates better to a model where requests arrive at a  
certain rate, and we are interested in the response time to the end user or  
application, rather than the response time of the database itself.  
  
Also, when --rate is used, include the schedule lag time in the log output.  
  
The --rate option is new in 9.4, so backpatch to 9.4. It seems better to  
make this change in 9.4, while we're still in the beta period, than ship a  
9.4 version that calculates the values differently than 9.5.  

M contrib/pgbench/pgbench.c
M doc/src/sgml/pgbench.sgml

Handle old versions of Test::More

commit   : 958a828fea254307d7699aea4310f0654dc48990    
  
author   : Peter Eisentraut <[email protected]>    
date     : Wed, 10 Sep 2014 20:39:28 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Wed, 10 Sep 2014 20:39:28 -0400    

Click here for diff

Really old versions of Test::More don't support subplans, so skip the  
tests in that case.  

M src/test/perl/TestLib.pm

Support older versions of "prove"

commit   : e7903163ff6352cd75dc896cf289e3cccc1fef33    
  
author   : Peter Eisentraut <[email protected]>    
date     : Wed, 10 Sep 2014 20:05:56 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Wed, 10 Sep 2014 20:05:56 -0400    

Click here for diff

Apparently, older versions of "prove" (couldn't identify the exact  
version from the changelog) don't look into the t/ directory for tests  
by default, so specify it explicitly.  

M src/Makefile.global.in

doc: improve configuration management section

commit   : 1e6ba64080d0906e428cc3f58e612f8c237fc755    
  
author   : Bruce Momjian <[email protected]>    
date     : Wed, 10 Sep 2014 20:50:15 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Wed, 10 Sep 2014 20:50:15 -0400    

Click here for diff

Patch by David Johnston  
  
Backpatch through 9.4  

M doc/src/sgml/config.sgml

Preserve AND/OR flatness while extracting restriction OR clauses.

commit   : f003419791f35eeab0150cd097bcf7929622b0fc    
  
author   : Tom Lane <[email protected]>    
date     : Tue, 9 Sep 2014 18:35:17 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Tue, 9 Sep 2014 18:35:17 -0400    

Click here for diff

The code I added in commit f343a880d5555faf1dad0286c5632047c8f599ad was  
careless about preserving AND/OR flatness: it could create a structure with  
an OR node directly underneath another one.  That breaks an assumption  
that's fairly important for planning efficiency, not to mention triggering  
various Asserts (as reported by Benjamin Smith).  Add a trifle more logic  
to handle the case properly.  

M src/backend/optimizer/util/orclauses.c
M src/test/regress/expected/join.out
M src/test/regress/sql/join.sql

Fix typo in solaris spinlock fix.

commit   : 21dcc48dc7ec48bf7b2a40c619e1c96ca4d2477c    
  
author   : Andres Freund <[email protected]>    
date     : Tue, 9 Sep 2014 13:57:38 +0200    
  
committer: Andres Freund <[email protected]>    
date     : Tue, 9 Sep 2014 13:57:38 +0200    

Click here for diff

07968dbfaad03 missed part of the S_UNLOCK define when building for  
sparcv8+.  

M src/include/storage/s_lock.h

Fix spinlock implementation for some !solaris sparc platforms.

commit   : 11687e728d726a8ab3c9e165e4f7d962013f46ab    
  
author   : Andres Freund <[email protected]>    
date     : Tue, 9 Sep 2014 00:47:32 +0200    
  
committer: Andres Freund <[email protected]>    
date     : Tue, 9 Sep 2014 00:47:32 +0200    

Click here for diff

Some Sparc CPUs can be run in various coherence models, ranging from  
RMO (relaxed) over PSO (partial) to TSO (total). Solaris has always  
run CPUs in TSO mode while in userland, but linux didn't use to and  
the various *BSDs still don't. Unfortunately the sparc TAS/S_UNLOCK  
were only correct under TSO. Fix that by adding the necessary memory  
barrier instructions. On sparcv8+, which should be all relevant CPUs,  
these are treated as NOPs if the current consistency model doesn't  
require the barriers.  
  
Discussion: [email protected]  
  
Will be backpatched to all released branches once a few buildfarm  
cycles haven't shown up problems. As I've no access to sparc, this is  
blindly written.  

M src/backend/port/tas/sunstudio_sparc.s
M src/include/storage/s_lock.h

doc: Reflect renaming of Mac OS X to OS X

commit   : 18af7938c1efa1ad18c876fcc471020c0ad9db07    
  
author   : Peter Eisentraut <[email protected]>    
date     : Tue, 9 Sep 2014 13:56:29 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Tue, 9 Sep 2014 13:56:29 -0400    

Click here for diff

bug #10528  

M contrib/start-scripts/osx/PostgreSQL
M doc/src/sgml/client-auth.sgml
M doc/src/sgml/dfunc.sgml
M doc/src/sgml/docguide.sgml
M doc/src/sgml/installation.sgml
M doc/src/sgml/monitoring.sgml
M doc/src/sgml/runtime.sgml
M doc/src/sgml/uuid-ossp.sgml
M doc/src/sgml/wal.sgml

Move ALTER ... ALL IN to ProcessUtilitySlow

commit   : 106e4b29c0b1fdba36193bf38896d77fc28ea940    
  
author   : Stephen Frost <[email protected]>    
date     : Tue, 9 Sep 2014 10:52:10 -0400    
  
committer: Stephen Frost <[email protected]>    
date     : Tue, 9 Sep 2014 10:52:10 -0400    

Click here for diff

Now that ALTER TABLE .. ALL IN TABLESPACE has replaced the previous  
ALTER TABLESPACE approach, it makes sense to move the calls down in  
to ProcessUtilitySlow where the rest of ALTER TABLE is handled.  
  
This also means that event triggers will support ALTER TABLE .. ALL  
(which was the impetus for the original change, though it has other  
good qualities also).  
  
Álvaro Herrera  
  
Back-patch to 9.4 as the original rework was.  

M src/backend/tcop/utility.c

Fix psql \s to work with recent libedit, and add pager support.

commit   : fd66ccf7db638664a7867cc18e253d770c783d33    
  
author   : Tom Lane <[email protected]>    
date     : Mon, 8 Sep 2014 16:09:49 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Mon, 8 Sep 2014 16:09:49 -0400    

Click here for diff

psql's \s (print command history) doesn't work at all with recent libedit  
versions when printing to the terminal, because libedit tries to do an  
fchmod() on the target file which will fail if the target is /dev/tty.  
(We'd already noted this in the context of the target being /dev/null.)  
Even before that, it didn't work pleasantly, because libedit likes to  
encode the command history file (to ensure successful reloading), which  
renders it nigh unreadable, not to mention significantly different-looking  
depending on exactly which libedit version you have.  So let's forget using  
write_history() for this purpose, and instead print the data ourselves,  
using logic similar to that used to iterate over the history for newline  
encoding/decoding purposes.  
  
While we're at it, insert the ability to use the pager when \s is printing  
to the terminal.  This has been an acknowledged shortcoming of \s for many  
years, so while you could argue it's not exactly a back-patchable bug fix  
it still seems like a good improvement.  Anyone who's seriously annoyed  
at this can use "\s /dev/tty" or local equivalent to get the old behavior.  
  
Experimentation with this showed that the history iteration logic was  
actually rather broken when used with libedit.  It turns out that with  
libedit you have to use previous_history() not next_history() to advance  
to more recent history entries.  The easiest and most robust fix for this  
seems to be to make a run-time test to verify which function to call.  
We had not noticed this because libedit doesn't really need the newline  
encoding logic: its own encoding ensures that command entries containing  
newlines are reloaded correctly (unlike libreadline).  So the effective  
behavior with recent libedits was that only the oldest history entry got  
newline-encoded or newline-decoded.  However, because of yet other bugs in  
history_set_pos(), some old versions of libedit allowed the existing loop  
logic to reach entries besides the oldest, which means there may be libedit  
~/.psql_history files out there containing encoded newlines in more than  
just the oldest entry.  To ensure we can reload such files, it seems  
appropriate to back-patch this fix, even though that will result in some  
incompatibility with older psql versions (ie, multiline history entries  
written by a psql with this fix will look corrupted to a psql without it,  
if its libedit is reasonably up to date).  
  
Stepan Rutz and Tom Lane  

M doc/src/sgml/ref/psql-ref.sgml
M src/bin/psql/command.c
M src/bin/psql/input.c
M src/bin/psql/input.h

Documentation fix: sum(float4) returns float4, not float8.

commit   : b1a7c9e387f77b85aa14eb342f0432fcdb6ddc35    
  
author   : Tom Lane <[email protected]>    
date     : Sun, 7 Sep 2014 22:40:41 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Sun, 7 Sep 2014 22:40:41 -0400    

Click here for diff

The old claim is from my commit d06ebdb8d3425185d7e641d15e45908658a0177d of  
2000-07-17, but it seems to have been a plain old thinko; sum(float4) has  
been distinct from sum(float8) since Berkeley days.  Noted by KaiGai Kohei.  
  
While at it, mention the existence of sum(money), which is also of  
embarrassingly ancient vintage.  

M doc/src/sgml/func.sgml

Tab completion for ALTER .. ALL IN TABLESPACE

commit   : 4231599328f75d6549831f65223a22236a43a5c9    
  
author   : Stephen Frost <[email protected]>    
date     : Sun, 7 Sep 2014 08:04:35 -0400    
  
committer: Stephen Frost <[email protected]>    
date     : Sun, 7 Sep 2014 08:04:35 -0400    

Click here for diff

Update the tab completion for the changes made in  
3c4cf080879b386d4ed1814667aca025caafe608, which rework 'MOVE ALL' to be  
'ALTER .. ALL IN TABLESPACE'.  
  
Fujii Masao  
  
Back-patch to 9.4, as the original change was.  

M src/bin/psql/tab-complete.c

docs: Improve pg_isready details about username/dbname

commit   : 31189e8627cdbdb72d16d0314d95b1aea913e616    
  
author   : Bruce Momjian <[email protected]>    
date     : Sat, 6 Sep 2014 12:43:11 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Sat, 6 Sep 2014 12:43:11 -0400    

Click here for diff

Report by Erik Rijkers  
  
Backpatch through 9.4  

M doc/src/sgml/ref/pg_isready.sgml

Properly document that -r is only honored from the command-line.

commit   : f9c0434ee330bdbd07d7dc75ade849a1d01ef42e    
  
author   : Bruce Momjian <[email protected]>    
date     : Sat, 6 Sep 2014 11:10:51 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Sat, 6 Sep 2014 11:10:51 -0400    

Click here for diff

This is for postgres/postmaster options.  
  
Report by Tom Lane  
  
Backpatch through 9.4  

M doc/src/sgml/ref/postgres-ref.sgml

Clarify documentation about "peer" rows in window functions

commit   : a6d9b331aaa1bccd740700954c15bd56727189ad    
  
author   : Bruce Momjian <[email protected]>    
date     : Fri, 5 Sep 2014 19:01:26 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Fri, 5 Sep 2014 19:01:26 -0400    

Click here for diff

Peer rows are matching rows when ORDER BY is specified.  
  
Report by [email protected], David G Johnston  
  
Backpatch through 9.4  

M doc/src/sgml/func.sgml
M doc/src/sgml/ref/select.sgml
M doc/src/sgml/syntax.sgml

Assorted message fixes and improvements

commit   : a6283f97069e6f747bdc2052e9f755a9136a5edc    
  
author   : Peter Eisentraut <[email protected]>    
date     : Fri, 5 Sep 2014 01:20:33 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Fri, 5 Sep 2014 01:20:33 -0400    

Click here for diff

M contrib/test_decoding/expected/ddl.out
M src/backend/access/heap/rewriteheap.c
M src/backend/commands/dbcommands.c
M src/backend/commands/matview.c
M src/backend/commands/tablecmds.c
M src/backend/executor/nodeWindowAgg.c
M src/backend/replication/logical/reorderbuffer.c
M src/backend/replication/logical/snapbuild.c
M src/backend/replication/slot.c
M src/backend/storage/ipc/dsm_impl.c
M src/test/regress/expected/matview.out

Add tab-completion for reloptions like user_catalog_table.

commit   : 7695f9701a8bf46bf385c96bce2e216ee2ccf93e    
  
author   : Fujii Masao <[email protected]>    
date     : Fri, 5 Sep 2014 11:40:08 +0900    
  
committer: Fujii Masao <[email protected]>    
date     : Fri, 5 Sep 2014 11:40:08 +0900    

Click here for diff

Back-patch to 9.4 where user_catalog_table was added.  
  
Review by Michael Paquier  

M src/bin/psql/tab-complete.c

doc: Remove dead link

commit   : ffb16cf29fe127b1105310a70d908b7bba88d0ac    
  
author   : Peter Eisentraut <[email protected]>    
date     : Thu, 4 Sep 2014 14:11:23 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Thu, 4 Sep 2014 14:11:23 -0400    

Click here for diff

The link to the NIST web page about DES standards leads to nowhere, and  
according to archive.org has been forwarded to an unrelated page for  
many years.  Therefore, just remove that link.  More up to date  
information can be found via Wikipedia, for example.  

M doc/src/sgml/pgcrypto.sgml

Fix segmentation fault that an empty prepared statement could cause.

commit   : 6da740e72ebfe22cb2a40bf9ebd775531a2294a6    
  
author   : Fujii Masao <[email protected]>    
date     : Fri, 5 Sep 2014 02:17:57 +0900    
  
committer: Fujii Masao <[email protected]>    
date     : Fri, 5 Sep 2014 02:17:57 +0900    

Click here for diff

Back-patch to all supported branches.  
  
Per bug #11335 from Haruka Takatsuka  

M src/backend/tcop/utility.c

docs: Improve documentation of \pset without arguments.

commit   : 643cad19346bc7d6e16663ee9ff6f7a6ef009d93    
  
author   : Fujii Masao <[email protected]>    
date     : Thu, 4 Sep 2014 13:48:09 +0900    
  
committer: Fujii Masao <[email protected]>    
date     : Thu, 4 Sep 2014 13:48:09 +0900    

Click here for diff

The syntax summary previously failed to clarify that the first  
argument is also optional.  The textual description did mention it,  
but all the way at the bottom.  It fits better with the command  
overview, so move it there, and fix the summary also.  
  
Back-patch to 9.4 where \pset without arguments was supported.  
  
Dilip Kumar, reviewed by Fabien Coelho  

M doc/src/sgml/ref/psql-ref.sgml

Update URL reference material in /contrib/isn docs

commit   : 42c73ef9b7e5eb552b972bc05335746f54e34f98    
  
author   : Bruce Momjian <[email protected]>    
date     : Wed, 3 Sep 2014 17:22:20 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Wed, 3 Sep 2014 17:22:20 -0400    

Click here for diff

Report by Peter Eisentraut  

M doc/src/sgml/isn.sgml

Document use of partial indexes for partial unique constraints

commit   : 646deb603e0846d1efd4da84df412963dda68eec    
  
author   : Bruce Momjian <[email protected]>    
date     : Wed, 3 Sep 2014 14:34:46 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Wed, 3 Sep 2014 14:34:46 -0400    

Click here for diff

Report by Tomáš Greif  
  
Backpatch through 9.4  

M doc/src/sgml/ddl.sgml

Silence warning on new versions of clang.

commit   : 6ea591ed4619a29e57369fef905d2160bd6e5438    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Tue, 2 Sep 2014 14:22:42 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Tue, 2 Sep 2014 14:22:42 +0300    

Click here for diff

Andres Freund  

M src/include/access/gin_private.h

Add skip-empty-xacts option to test_decoding for use in the regression tests.

commit   : cb3d2df90e240680438cb612edcd1598579f4d5c    
  
author   : Andres Freund <[email protected]>    
date     : Mon, 1 Sep 2014 13:42:43 +0200    
  
committer: Andres Freund <[email protected]>    
date     : Mon, 1 Sep 2014 13:42:43 +0200    

Click here for diff

The regression tests for contrib/test_decoding regularly failed on  
postgres instances that were very slow. Either because the hardware  
itself was slow or because very expensive debugging options like  
CLOBBER_CACHE_ALWAYS were used.  
  
The reason they failed was just that some additional transactions were  
decoded. Analyze and vacuum, triggered by autovac.  
  
To fix just add a option to test_decoding to only display transactions  
in which a change was actually displayed. That's not pretty because it  
removes information from the tests; but better than constantly failing  
tests in very likely harmless ways.  
  
Backpatch to 9.4 where logical decoding was introduced.  
  
Discussion: [email protected]  

M contrib/test_decoding/expected/concurrent_ddl_dml.out
M contrib/test_decoding/expected/ddl.out
M contrib/test_decoding/expected/decoding_in_xact.out
M contrib/test_decoding/expected/permissions.out
M contrib/test_decoding/expected/prepared.out
M contrib/test_decoding/expected/rewrite.out
M contrib/test_decoding/expected/toast.out
M contrib/test_decoding/specs/concurrent_ddl_dml.spec
M contrib/test_decoding/sql/ddl.sql
M contrib/test_decoding/sql/decoding_in_xact.sql
M contrib/test_decoding/sql/permissions.sql
M contrib/test_decoding/sql/prepared.sql
M contrib/test_decoding/sql/rewrite.sql
M contrib/test_decoding/sql/toast.sql
M contrib/test_decoding/test_decoding.c

Declare lwlock.c's LWLockAcquireCommon() as a static inline.

commit   : 92b2c136580869fe9286a4d880d592d74f55d5b7    
  
author   : Andres Freund <[email protected]>    
date     : Mon, 1 Sep 2014 00:17:18 +0200    
  
committer: Andres Freund <[email protected]>    
date     : Mon, 1 Sep 2014 00:17:18 +0200    

Click here for diff

68a2e52bbaf98f136 has introduced LWLockAcquireCommon() containing the  
previous contents of LWLockAcquire() plus added functionality. The  
latter then calls it, just like LWLockAcquireWithVar(). Because the  
majority of callers don't need the added functionality, declare the  
common code as inline. The compiler then can optimize away the unused  
code. Doing so is also useful when looking at profiles, to  
differentiate the users.  
  
Backpatch to 9.4, the first branch to contain LWLockAcquireCommon().  

M src/backend/storage/lmgr/lwlock.c

doc: Various typo/grammar fixes

commit   : ae70b9f0ec1f967aa84844274f26f519450b6b49    
  
author   : Kevin Grittner <[email protected]>    
date     : Sat, 30 Aug 2014 11:01:47 -0500    
  
committer: Kevin Grittner <[email protected]>    
date     : Sat, 30 Aug 2014 11:01:47 -0500    

Click here for diff

Errors detected using Topy (https://github.com/intgr/topy), all  
changes verified by hand and some manual tweaks added.  
  
Marti Raudsepp  
  
Individual changes backpatched, where applicable, as far as 9.0.  

M doc/src/sgml/datatype.sgml
M doc/src/sgml/func.sgml
M doc/src/sgml/mvcc.sgml
M doc/src/sgml/pgbench.sgml
M doc/src/sgml/pgcrypto.sgml
M doc/src/sgml/pltcl.sgml
M doc/src/sgml/queries.sgml
M doc/src/sgml/ref/alter_tsdictionary.sgml
M doc/src/sgml/ref/comment.sgml
M doc/src/sgml/ref/select.sgml
M doc/src/sgml/release-7.4.sgml
M doc/src/sgml/release-8.2.sgml
M doc/src/sgml/release-9.4.sgml
M doc/src/sgml/release-old.sgml
M doc/src/sgml/stylesheet.dsl
M doc/src/sgml/textsearch.sgml
M doc/src/sgml/xml2.sgml
M doc/src/sgml/xoper.sgml

pg_is_xlog_replay_paused(): remove super-user-only restriction

commit   : f08b5e7577e70f9aee80d04e94864bb5053f7555    
  
author   : Bruce Momjian <[email protected]>    
date     : Fri, 29 Aug 2014 09:05:35 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Fri, 29 Aug 2014 09:05:35 -0400    

Click here for diff

Also update docs to mention which function are super-user-only.  
  
Report by [email protected]  
  
Backpatch through 9.4  

M doc/src/sgml/func.sgml
M src/backend/access/transam/xlogfuncs.c

Fix bug in compressed GIN data leaf page splitting code.

commit   : 08bff295a7e7ac66a35f42e92e97782b9af64cdc    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Fri, 29 Aug 2014 14:19:34 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Fri, 29 Aug 2014 14:19:34 +0300    

Click here for diff

The list of posting lists it's dealing with can contain placeholders for  
deleted posting lists. The placeholders are kept around so that they can  
be WAL-logged, but we must be careful to not try to access them.  
  
This fixes bug #11280, reported by Mårten Svantesson. Backpatch to 9.4,  
where the compressed data leaf page code was added.  

M src/backend/access/gin/gindatapage.c

Assorted message improvements

commit   : c573e9d7760869a0db6343b2a7353309045e05ab    
  
author   : Peter Eisentraut <[email protected]>    
date     : Fri, 29 Aug 2014 00:01:34 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Fri, 29 Aug 2014 00:01:34 -0400    

Click here for diff

M src/backend/commands/view.c
M src/backend/port/sysv_shmem.c
M src/backend/rewrite/rewriteHandler.c
M src/backend/utils/misc/guc.c
M src/bin/pg_ctl/nls.mk
M src/bin/psql/command.c
M src/bin/psql/copy.c
M src/test/regress/expected/updatable_views.out

doc: Revert ALTER TABLESPACE summary line

commit   : f41381e240f4312017f9f70fea194e59d8cc3a2e    
  
author   : Peter Eisentraut <[email protected]>    
date     : Thu, 28 Aug 2014 23:59:03 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Thu, 28 Aug 2014 23:59:03 -0400    

Click here for diff

It was changed when ALTER TABLESPACE / MOVE was added but then not  
updated when that was moved back out.  

M doc/src/sgml/ref/alter_tablespace.sgml

Fix citext upgrade script for disallowance of oidvector element assignment.

commit   : c45af8fa111ea381b428ab31adcaa5ecd032f06a    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 28 Aug 2014 18:21:11 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 28 Aug 2014 18:21:11 -0400    

Click here for diff

In commit 45e02e3232ac7cc5ffe36f7986159b5e0b1f6fdc, we intentionally  
disallowed updates on individual elements of oidvector columns.  While that  
still seems like a sane idea in the abstract, we (I) forgot that citext's  
"upgrade from unpackaged" script did in fact perform exactly such updates,  
in order to fix the problem that citext indexes should have a collation  
but would not in databases dumped or upgraded from pre-9.1 installations.  
  
Even if we wanted to add casts to allow such updates, there's no practical  
way to do so in the back branches, so the only real alternative is to make  
citext's kluge even klugier.  In this patch, I cast the oidvector to text,  
fix its contents with regexp_replace, and cast back to oidvector.  (Ugh!)  
  
Since the aforementioned commit went into all active branches, we have to  
fix this in all branches that contain the now-broken update script.  
  
Per report from Eric Malm.  

M contrib/citext/citext–unpackaged–1.0.sql

Fix FOR UPDATE NOWAIT on updated tuple chains

commit   : eeab936ba94de70ee5f03e167331f1399914b6db    
  
author   : Alvaro Herrera <[email protected]>    
date     : Wed, 27 Aug 2014 19:15:18 -0400    
  
committer: Alvaro Herrera <[email protected]>    
date     : Wed, 27 Aug 2014 19:15:18 -0400    

Click here for diff

If SELECT FOR UPDATE NOWAIT tries to lock a tuple that is concurrently  
being updated, it might fail to honor its NOWAIT specification and block  
instead of raising an error.  
  
Fix by adding a no-wait flag to EvalPlanQualFetch which it can pass down  
to heap_lock_tuple; also use it in EvalPlanQualFetch itself to avoid  
blocking while waiting for a concurrent transaction.  
  
Authors: Craig Ringer and Thomas Munro, tweaked by Álvaro  
http://www.postgresql.org/message-id/[email protected]  
  
Per Thomas Munro in the course of his SKIP LOCKED feature submission,  
who also provided one of the isolation test specs.  
  
Backpatch to 9.4, because that's as far back as it applies without  
conflicts (although the bug goes all the way back).  To that branch also  
backpatch Thomas Munro's new NOWAIT test cases, committed in master by  
Heikki as commit 9ee16b49f0aac819bd4823d9b94485ef608b34e8 .  

M src/backend/executor/execMain.c
M src/backend/executor/nodeLockRows.c
M src/include/executor/executor.h
A src/test/isolation/expected/nowait-2.out
A src/test/isolation/expected/nowait-3.out
A src/test/isolation/expected/nowait-4.out
A src/test/isolation/expected/nowait-4_1.out
A src/test/isolation/expected/nowait-5.out
A src/test/isolation/expected/nowait.out
M src/test/isolation/isolation_schedule
A src/test/isolation/specs/nowait-2.spec
A src/test/isolation/specs/nowait-3.spec
A src/test/isolation/specs/nowait-4.spec
A src/test/isolation/specs/nowait-5.spec
A src/test/isolation/specs/nowait.spec

Fix Var handling for security barrier views

commit   : d4b8418a04f41dc991dc364a0a6eab64b16f2e83    
  
author   : Stephen Frost <[email protected]>    
date     : Tue, 26 Aug 2014 23:08:41 -0400    
  
committer: Stephen Frost <[email protected]>    
date     : Tue, 26 Aug 2014 23:08:41 -0400    

Click here for diff

In some cases, not all Vars were being correctly marked as having been  
modified for updatable security barrier views, which resulted in invalid  
plans (eg: when security barrier views were created over top of  
inheiritance structures).  
  
In passing, be sure to update both varattno and varonattno, as _equalVar  
won't consider the Vars identical otherwise.  This isn't known to cause  
any issues with updatable security barrier views, but was noticed as  
missing while working on RLS and makes sense to get fixed.  
  
Back-patch to 9.4 where updatable security barrier views were  
introduced.  

M src/backend/optimizer/prep/prepsecurity.c

Fix superuser concurrent refresh of matview owned by another.

commit   : 06414c0f68e9f8039c1de40d009f12fa96c49192    
  
author   : Kevin Grittner <[email protected]>    
date     : Tue, 26 Aug 2014 10:00:42 -0500    
  
committer: Kevin Grittner <[email protected]>    
date     : Tue, 26 Aug 2014 10:00:42 -0500    

Click here for diff

Use SECURITY_LOCAL_USERID_CHANGE while building temporary tables;  
only escalate to SECURITY_RESTRICTED_OPERATION while potentially  
running user-supplied code.  The more secure mode was preventing  
temp table creation.  Add regression tests to cover this problem.  
  
This fixes Bug #11208 reported by Bruno Emanuel de Andrade Silva.  
  
Backpatch to 9.4, where the bug was introduced.  

M src/backend/commands/matview.c
M src/test/regress/expected/matview.out
M src/test/regress/sql/matview.sql

upgrade docs: highlight pg_upgrade, warn about globals preservation

commit   : 3a3d3f9ec01f1f7333e3bbcd5ba9398fd19ad8d9    
  
author   : Bruce Momjian <[email protected]>    
date     : Mon, 25 Aug 2014 15:34:50 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Mon, 25 Aug 2014 15:34:50 -0400    

Click here for diff

Also, remove OID preservation mention, mention non-text dump formats  
  
Backpatch through 9.4  

M doc/src/sgml/backup.sgml
M doc/src/sgml/runtime.sgml

Revert XactLockTableWait context setup in conditional multixact wait

commit   : 34356933f044d5e3fa02a30ef1fe859eca20d605    
  
author   : Alvaro Herrera <[email protected]>    
date     : Mon, 25 Aug 2014 15:33:19 -0400    
  
committer: Alvaro Herrera <[email protected]>    
date     : Mon, 25 Aug 2014 15:33:19 -0400    

Click here for diff

There's no point in setting up a context error callback when doing  
conditional lock acquisition, because we never actually wait and so the  
able wouldn't be able to see it.  
  
Backpatch to 9.4, where this was added.  

M src/backend/access/heap/heapam.c

Fix typos in some error messages thrown by extension scripts when fed to psql.

commit   : 0bfce7618420c6f1eece55577c61ef2a7a12f80b    
  
author   : Andres Freund <[email protected]>    
date     : Mon, 25 Aug 2014 18:30:28 +0200    
  
committer: Andres Freund <[email protected]>    
date     : Mon, 25 Aug 2014 18:30:28 +0200    

Click here for diff

Some of the many error messages introduced in 458857cc missed 'FROM  
unpackaged'. Also e016b724 and 45ffeb7e forgot to quote extension  
version numbers.  
  
Backpatch to 9.1, just like 458857cc which introduced the messages. Do  
so because the error messages thrown when the wrong command is copy &  
pasted aren't easy to understand.  

M contrib/btree_gin/btree_gin–unpackaged–1.0.sql
M contrib/btree_gist/btree_gist–unpackaged–1.0.sql
M contrib/chkpass/chkpass–unpackaged–1.0.sql
M contrib/citext/citext–unpackaged–1.0.sql
M contrib/cube/cube–unpackaged–1.0.sql
M contrib/dblink/dblink–unpackaged–1.0.sql
M contrib/dict_int/dict_int–unpackaged–1.0.sql
M contrib/dict_xsyn/dict_xsyn–unpackaged–1.0.sql
M contrib/earthdistance/earthdistance–unpackaged–1.0.sql
M contrib/fuzzystrmatch/fuzzystrmatch–unpackaged–1.0.sql
M contrib/hstore/hstore–unpackaged–1.0.sql
M contrib/intagg/intagg–unpackaged–1.0.sql
M contrib/intarray/intarray–unpackaged–1.0.sql
M contrib/isn/isn–unpackaged–1.0.sql
M contrib/lo/lo–unpackaged–1.0.sql
M contrib/ltree/ltree–unpackaged–1.0.sql
M contrib/pageinspect/pageinspect–1.0–1.1.sql
M contrib/pageinspect/pageinspect–1.1–1.2.sql
M contrib/pageinspect/pageinspect–unpackaged–1.0.sql
M contrib/pg_buffercache/pg_buffercache–unpackaged–1.0.sql
M contrib/pg_freespacemap/pg_freespacemap–unpackaged–1.0.sql
M contrib/pg_stat_statements/pg_stat_statements–unpackaged–1.0.sql
M contrib/pg_trgm/pg_trgm–unpackaged–1.0.sql
M contrib/pgcrypto/pgcrypto–unpackaged–1.0.sql
M contrib/pgrowlocks/pgrowlocks–unpackaged–1.0.sql
M contrib/pgstattuple/pgstattuple–unpackaged–1.0.sql
M contrib/seg/seg–unpackaged–1.0.sql
M contrib/spi/autoinc–unpackaged–1.0.sql
M contrib/spi/insert_username–unpackaged–1.0.sql
M contrib/spi/moddatetime–unpackaged–1.0.sql
M contrib/spi/refint–unpackaged–1.0.sql
M contrib/spi/timetravel–unpackaged–1.0.sql
M contrib/sslinfo/sslinfo–unpackaged–1.0.sql
M contrib/tablefunc/tablefunc–unpackaged–1.0.sql
M contrib/test_parser/test_parser–unpackaged–1.0.sql
M contrib/tsearch2/tsearch2–unpackaged–1.0.sql
M contrib/unaccent/unaccent–unpackaged–1.0.sql
M contrib/uuid-ossp/uuid-ossp–unpackaged–1.0.sql
M contrib/xml2/xml2–unpackaged–1.0.sql

Don't track DEALLOCATE in pg_stat_statements.

commit   : 642aadff7ff6704e2afee360ca98b78a4fba6629    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Mon, 25 Aug 2014 19:13:24 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Mon, 25 Aug 2014 19:13:24 +0300    

Click here for diff

We also don't track PREPARE, nor do we track planning time in general, so  
let's ignore DEALLOCATE as well for consistency.  
  
Backpatch to 9.4, but not further than that. Although it seems unlikely that  
anyone is relying on the current behavior, this is a behavioral change.  
  
Fabien Coelho  

M contrib/pg_stat_statements/pg_stat_statements.c

doc: Improve pg_restore help output

commit   : 73e47b703b3b5bfc3a76029b0895b1173ae9ad76    
  
author   : Peter Eisentraut <[email protected]>    
date     : Sat, 23 Aug 2014 00:23:34 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Sat, 23 Aug 2014 00:23:34 -0400    

Click here for diff

Add a note that some options can be specified multiple times to select  
multiple objects to restore.  This replaces the somewhat confusing use  
of plurals in the option descriptions themselves.  

M src/bin/pg_dump/pg_restore.c

Fix outdated comment

commit   : 25eda23679433ee35972f9e4411a628e19b8cd57    
  
author   : Alvaro Herrera <[email protected]>    
date     : Fri, 22 Aug 2014 13:55:34 -0400    
  
committer: Alvaro Herrera <[email protected]>    
date     : Fri, 22 Aug 2014 13:55:34 -0400    

Click here for diff

M src/backend/access/heap/heapam.c

Fix corner-case behaviors in JSON/JSONB field extraction operators.

commit   : 15247948cc19e74b20af15020b48bee4aec771e9    
  
author   : Tom Lane <[email protected]>    
date     : Fri, 22 Aug 2014 13:18:00 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Fri, 22 Aug 2014 13:18:00 -0400    

Click here for diff

Cause the path extraction operators to return their lefthand input,  
not NULL, if the path array has no elements.  This seems more consistent  
since the case ought to correspond to applying the simple extraction  
operator (->) zero times.  
  
Cause other corner cases in field/element/path extraction to return NULL  
rather than failing.  This behavior is arguably more useful than throwing  
an error, since it allows an expression index using these operators to be  
built even when not all values in the column are suitable for the  
extraction being indexed.  Moreover, we already had multiple  
inconsistencies between the path extraction operators and the simple  
extraction operators, as well as inconsistencies between the JSON and  
JSONB code paths.  Adopt a uniform rule of returning NULL rather than  
throwing an error when the JSON input does not have a structure that  
permits the request to be satisfied.  
  
Back-patch to 9.4.  Update the release notes to list this as a behavior  
change since 9.3.  

M doc/src/sgml/func.sgml
M doc/src/sgml/json.sgml
M doc/src/sgml/release-9.4.sgml
M src/backend/utils/adt/jsonfuncs.c
M src/test/regress/expected/json.out
M src/test/regress/expected/json_1.out
M src/test/regress/expected/jsonb.out
M src/test/regress/expected/jsonb_1.out
M src/test/regress/sql/json.sql
M src/test/regress/sql/jsonb.sql

Fix comment in pg_basebackup.

commit   : 32d93e8c2da5387a8d5efdd4df1e5fb9bcfa9bb2    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Fri, 22 Aug 2014 13:45:38 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Fri, 22 Aug 2014 13:45:38 +0300    

Click here for diff

The option is called --tablespace-mapping, not --tablespace.  
  
Amit Kapila  

M src/bin/pg_basebackup/pg_basebackup.c

Change the way pg_basebackup's tablespace mapping is implemented.

commit   : 8a22633f52f2399118d6ad3c2c4da6a31f07e907    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Fri, 22 Aug 2014 10:16:26 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Fri, 22 Aug 2014 10:16:26 +0300    

Click here for diff

Previously, we would first create the symlinks the way they are in the  
original system, and at the end replace them with the mapped symlinks.  
That never really made much sense, so now we create the symlink pointing  
to the correct location to begin with, so that there's no need to fix  
them at the end.  
  
The old coding didn't work correctly on Windows, because Windows junction  
points look more like directories than files, and ought to be removed with  
rmdir rather than unlink. Also, it incorrectly used "%d" rather than "%u"  
to print an Oid, but that's gone now.  
  
Report and patch by Amit Kapila, with minor changes by me. Reviewed by  
MauMau. Backpatch to 9.4, where the --tablespace feature was added.  

M src/bin/pg_basebackup/pg_basebackup.c

Rework 'MOVE ALL' to 'ALTER .. ALL IN TABLESPACE'

commit   : d9b2bc45cf75f913490f1b3ce9b9263509b26704    
  
author   : Stephen Frost <[email protected]>    
date     : Thu, 21 Aug 2014 19:06:17 -0400    
  
committer: Stephen Frost <[email protected]>    
date     : Thu, 21 Aug 2014 19:06:17 -0400    

Click here for diff

As 'ALTER TABLESPACE .. MOVE ALL' really didn't change the tablespace  
but instead changed objects inside tablespaces, it made sense to  
rework the syntax and supporting functions to operate under the  
'ALTER (TABLE|INDEX|MATERIALIZED VIEW)' syntax and to be in  
tablecmds.c.  
  
Pointed out by Alvaro, who also suggested the new syntax.  
  
Back-patch to 9.4.  

M doc/src/sgml/ref/alter_index.sgml
M doc/src/sgml/ref/alter_materialized_view.sgml
M doc/src/sgml/ref/alter_table.sgml
M doc/src/sgml/ref/alter_tablespace.sgml
M doc/src/sgml/release-9.4.sgml
M src/backend/commands/tablecmds.c
M src/backend/commands/tablespace.c
M src/backend/nodes/copyfuncs.c
M src/backend/nodes/equalfuncs.c
M src/backend/parser/gram.y
M src/backend/tcop/utility.c
M src/include/commands/tablecmds.h
M src/include/commands/tablespace.h
M src/include/nodes/nodes.h
M src/include/nodes/parsenodes.h
M src/test/regress/input/tablespace.source
M src/test/regress/output/tablespace.source
M src/tools/pgindent/typedefs.list

More regression test cases for json/jsonb extraction operators.

commit   : 9243417801be3f1cfaa3a3c33d5a003f382bd7a4    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 20 Aug 2014 19:05:09 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 20 Aug 2014 19:05:09 -0400    

Click here for diff

Cover some cases I omitted before, such as null and empty-string  
elements in the path array.  This exposes another inconsistency:  
json_extract_path complains about empty path elements but  
jsonb_extract_path does not.  

M src/test/regress/expected/json.out
M src/test/regress/expected/json_1.out
M src/test/regress/expected/jsonb.out
M src/test/regress/expected/jsonb_1.out
M src/test/regress/sql/json.sql
M src/test/regress/sql/jsonb.sql

Fix core dump in jsonb #> operator, and add regression test cases.

commit   : 04db8747840f581177c6622008d2e42d3528f7fe    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 20 Aug 2014 16:48:37 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 20 Aug 2014 16:48:37 -0400    

Click here for diff

jsonb's #> operator segfaulted (dereferencing a null pointer) if the RHS  
was a zero-length array, as reported in bug #11207 from Justin Van Winkle.  
json's #> operator returns NULL in such cases, so for the moment let's  
make jsonb act likewise.  
  
Also add a bunch of regression test queries memorializing the -> and #>  
operators' behavior for this and other corner cases.  
  
There is a good argument for changing some of these behaviors, as they  
are not very consistent with each other, and throwing an error isn't  
necessarily a desirable behavior for operators that are likely to be  
used in indexes.  However, everybody can agree that a core dump is the  
Wrong Thing, and we need test cases even if we decide to change their  
expected output later.  

M src/backend/utils/adt/jsonfuncs.c
M src/test/regress/expected/json.out
M src/test/regress/expected/json_1.out
M src/test/regress/expected/jsonb.out
M src/test/regress/expected/jsonb_1.out
M src/test/regress/sql/json.sql
M src/test/regress/sql/jsonb.sql

Revert "Fix bug in checking of IDENTIFY_SYSTEM result."

commit   : e0d010f64ca2b3b7d41ca961549388cf4fbe8aed    
  
author   : Fujii Masao <[email protected]>    
date     : Tue, 19 Aug 2014 18:30:38 +0900    
  
committer: Fujii Masao <[email protected]>    
date     : Tue, 19 Aug 2014 18:30:38 +0900    

Click here for diff

This reverts commit 083d29c65b7897f90c70e6dc0a4240a5fa75c8f2.  
  
The commit changed the code so that it causes an errors when  
IDENTIFY_SYSTEM returns three columns. But which prevents us  
from using the replication-related utilities against the server  
with older version. This is not what we want. For that  
compatibility, we allow the utilities to receive three columns  
as the result of IDENTIFY_SYSTEM eventhough it actually returns  
four columns in 9.4 or later.  
  
Pointed out by Andres Freund.  

M src/backend/replication/libpqwalreceiver/libpqwalreceiver.c
M src/bin/pg_basebackup/pg_basebackup.c
M src/bin/pg_basebackup/pg_receivexlog.c
M src/bin/pg_basebackup/receivelog.c

Fix bug in checking of IDENTIFY_SYSTEM result.

commit   : c41996b18c0bb1cbf7bdcdf6a01da8e3cbce9fc8    
  
author   : Fujii Masao <[email protected]>    
date     : Tue, 19 Aug 2014 17:26:07 +0900    
  
committer: Fujii Masao <[email protected]>    
date     : Tue, 19 Aug 2014 17:26:07 +0900    

Click here for diff

5a991ef8692ed0d170b44958a81a6bd70e90585 added new column into  
the result of IDENTIFY_SYSTEM command. But it was not reflected into  
several codes checking that result. Specifically though the number of  
columns in the result was increased to 4, it was still compared with 3  
in some replication codes.  
  
Back-patch to 9.4 where the number of columns in IDENTIFY_SYSTEM  
result was increased.  
  
Report from Michael Paquier  

M src/backend/replication/libpqwalreceiver/libpqwalreceiver.c
M src/bin/pg_basebackup/pg_basebackup.c
M src/bin/pg_basebackup/pg_receivexlog.c
M src/bin/pg_basebackup/receivelog.c

Install libpq DLL with $(INSTALL_SHLIB).

commit   : 151ce45825b317a9e06c40ddb48917bde9dc94fa    
  
author   : Noah Misch <[email protected]>    
date     : Mon, 18 Aug 2014 23:00:38 -0400    
  
committer: Noah Misch <[email protected]>    
date     : Mon, 18 Aug 2014 23:00:38 -0400    

Click here for diff

Programs need execute permission on a DLL file to load it.  MSYS  
"install" ignores the mode argument, and our Cygwin build statically  
links libpq into programs.  That explains the lack of buildfarm trouble.  
Back-patch to 9.0 (all supported versions).  

M src/interfaces/libpq/Makefile

Make pg_service.conf sample LDIF more portable.

commit   : 48e0b5ff3795a827c558a9ca7863fbfdbff6d683    
  
author   : Noah Misch <[email protected]>    
date     : Mon, 18 Aug 2014 22:58:57 -0400    
  
committer: Noah Misch <[email protected]>    
date     : Mon, 18 Aug 2014 22:58:57 -0400    

Click here for diff

The aboriginal sample placed connection parameters in  
groupOfUniqueNames/uniqueMember.  OpenLDAP, at least as early as version  
2.4.23, rejects uniqueMember entries that do not conform to the syntax  
for a distinguished name.  Use device/description, which is free-form.  
Back-patch to 9.4 for web site visibility.  

M doc/src/sgml/libpq.sgml

commit   : a611d2afb0f2ea1de8262dc132aaa0d5aaa3dbf2    
  
author   : Noah Misch <[email protected]>    
date     : Mon, 18 Aug 2014 22:58:25 -0400    
  
committer: Noah Misch <[email protected]>    
date     : Mon, 18 Aug 2014 22:58:25 -0400    

Click here for diff

Oversight in commit 7cbe57c34dec4860243e6d0f81738cfbb6e5d069.  
Back-patch to 9.4, where that commit first appeared.  In passing,  
release-note the FDW API postcondition change from the same commit.  

M doc/src/sgml/ref/alter_foreign_table.sgml
M doc/src/sgml/release-9.4.sgml

Adjust Release Notes to reflect holding off wrapped expanded mode until 9.5 (thanks Michael Paquier)

commit   : 61947069ffb27a7eb8037cbd7756dbcbb06ebd4a    
  
author   : Greg Stark <[email protected]>    
date     : Mon, 18 Aug 2014 13:59:41 +0100    
  
committer: Greg Stark <[email protected]>    
date     : Mon, 18 Aug 2014 13:59:41 +0100    

Click here for diff

M doc/src/sgml/release-9.4.sgml

Revert psql changes to support wrapped expanded mode. That feature is nice and we'll keep it in 9.5 but it'll take more time to iron out the collateral damage on other queries and also on tools like check_postgres.

commit   : 7e81c4b2901d8a692cc4e8c839a5a6490fc345e4    
  
author   : Greg Stark <[email protected]>    
date     : Mon, 18 Aug 2014 11:28:57 +0100    
  
committer: Greg Stark <[email protected]>    
date     : Mon, 18 Aug 2014 11:28:57 +0100    

Click here for diff

revert dbe31616c9be7380b8a88cdfbeaa68dbdcdebc36  
revert 6513633b94173fc1d9e2b213c43f9422ddbf5faa  

M src/bin/psql/print.c
M src/test/regress/expected/psql.out
M src/test/regress/sql/psql.sql

Fix obsolete mention of non-int64 support in CREATE SEQUENCE documentation.

commit   : f304ddc5cefff167e702c044269d75df2d5b4508    
  
author   : Tom Lane <[email protected]>    
date     : Mon, 18 Aug 2014 01:17:49 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Mon, 18 Aug 2014 01:17:49 -0400    

Click here for diff

The old text explained what happened if we didn't have working int64  
arithmetic.  Since that case has been explicitly rejected by configure  
since 8.4.3, documenting it in the 9.x branches can only produce confusion.  

M doc/src/sgml/ref/create_sequence.sgml

Use ISO 8601 format for dates converted to JSON, too.

commit   : 560e2300b2ab395a367153e37d445fd584281cf7    
  
author   : Tom Lane <[email protected]>    
date     : Sun, 17 Aug 2014 22:57:20 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Sun, 17 Aug 2014 22:57:20 -0400    

Click here for diff

Commit f30015b6d794c15d52abbb3df3a65081fbefb1ed made this happen for  
timestamp and timestamptz, but it seems pretty inconsistent to not  
do it for simple dates as well.  
  
(In passing, I re-pgindent'd json.c.)  

M doc/src/sgml/release-9.4.sgml
M src/backend/utils/adt/json.c

Add missing index terms for replication commands in the document.

commit   : 3b2f4aa0f0fe23b0cac753f91833df353994d298    
  
author   : Fujii Masao <[email protected]>    
date     : Mon, 18 Aug 2014 11:18:53 +0900    
  
committer: Fujii Masao <[email protected]>    
date     : Mon, 18 Aug 2014 11:18:53 +0900    

Click here for diff

Previously only CREATE_REPLICATION_SLOT was exposed as an index term.  
That's odd and there is no reason not to add index terms for other  
replication commands.  
  
Back-patch to 9.4.  

M doc/src/sgml/protocol.sgml

Make an editorial pass over the 9.4 release notes.

commit   : 912c70bb8db05a4a7599e43e3a79599957daa301    
  
author   : Tom Lane <[email protected]>    
date     : Sun, 17 Aug 2014 22:26:49 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Sun, 17 Aug 2014 22:26:49 -0400    

Click here for diff

Update the notes to include commits through today, and do a lot of  
wordsmithing and markup adjustment.  Notably, don't use <link> where <xref>  
will do; since we got rid of the text-format HISTORY file, there is no  
longer a reason to avoid <xref>.  

M doc/src/sgml/release-9.4.sgml

Improve DISCARD documentation.

commit   : 1071ba183a2181f109cbd5b2a597637b3b145a8c    
  
author   : Tom Lane <[email protected]>    
date     : Sun, 17 Aug 2014 15:59:06 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Sun, 17 Aug 2014 15:59:06 -0400    

Click here for diff

The new DISCARD SEQUENCES option was inadequately described, and hadn't  
been mentioned at all in the initial Description paragraph.  Rather than  
rectifying the latter the hard way, it seemed better to rewrite the  
description as a summary, instead of having it basically duplicate  
statements made under Parameters.  Be more consistent about the ordering  
of the options, too.  

M doc/src/sgml/ref/discard.sgml

doc: Work around stylesheet bug for man build

commit   : 3d5ba5395aa0437c45441d2ca7b0973cbd060305    
  
author   : Peter Eisentraut <[email protected]>    
date     : Sun, 17 Aug 2014 09:10:28 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Sun, 17 Aug 2014 09:10:28 -0400    

Click here for diff

The upstream stylesheets for man output insert a *roff comment for an  
occurrence of an indexterm, for reasons that have apparently been lost  
in history.  This, however, is done incorrectly and causes some  
formatting problems.  This hasn't been an issue until now, but the  
reorganization of indexterm elements inside variablelists has triggered  
this issue.  
  
The upstream fix (http://sourceforge.net/p/docbook/bugs/1340/) is to  
drop indexterms altogether in man output, and so we'll do the same here.  

M doc/src/sgml/stylesheet-man.xsl

Fix bogus return macros in range_overright_internal().

commit   : 364f7cd4b6d2bb89be55c8915fcd08b69b5eb84e    
  
author   : Tom Lane <[email protected]>    
date     : Sat, 16 Aug 2014 13:48:43 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Sat, 16 Aug 2014 13:48:43 -0400    

Click here for diff

PG_RETURN_BOOL() should only be used in functions following the V1 SQL  
function API.  This coding accidentally fails to fail since letting the  
compiler coerce the Datum representation of bool back to plain bool  
does give the right answer; but that doesn't make it a good idea.  
  
Back-patch to older branches just to avoid unnecessary code divergence.  

M src/backend/utils/adt/rangetypes.c

commit   : 30c05261ae842e2475fb06c7746de8623bcca731    
  
author   : Tom Lane <[email protected]>    
date     : Sat, 16 Aug 2014 12:53:57 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Sat, 16 Aug 2014 12:53:57 -0400    

Click here for diff

<@ and @> are each other's commutators, but they were incorrectly marked  
as being each other's negators instead.  (This was actually questioned  
in a comment in the original commit, but nobody followed through :-(.)  
Per bug #11178 from Christian Pronovost.  
  
In passing, fix some JSONB operator descriptions that were randomly  
different from the phrasing of every other similar description.  
  
catversion bump for pg_catalog contents change.  

M src/include/catalog/catversion.h
M src/include/catalog/pg_operator.h

Remove remnants of a JENTRY_ISFIRST flag bit.

commit   : a4eaa07bd011cba36921757489ab941f0b652587    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Fri, 15 Aug 2014 09:39:38 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Fri, 15 Aug 2014 09:39:38 +0300    

Click here for diff

I removed the flag earlier, but missed a few references in jsonb.h.  

M src/include/utils/jsonb.h

Set shared library path for in-tree TAP tests

commit   : 0964db851d8bb6805d41f66a663bd129fa3cbea0    
  
author   : Peter Eisentraut <[email protected]>    
date     : Fri, 15 Aug 2014 00:01:14 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Fri, 15 Aug 2014 00:01:14 -0400    

Click here for diff

When the TAP tests are run in-tree (make check), set the shared library  
path using the appropriate environment variable, using a logic similar  
to pg_regress, so that the right libraries are used.  

M src/Makefile.global.in

Update SysV parameter configuration documentation for FreeBSD.

commit   : 5086be023ac4205fe1003079a99803112cbaffa5    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 14 Aug 2014 16:05:49 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 14 Aug 2014 16:05:49 -0400    

Click here for diff

FreeBSD hasn't made any use of kern.ipc.semmap since 1.1, and newer  
releases reject attempts to set it altogether; so stop recommending  
that it be adjusted.  Per bug #11161.  
  
Back-patch to all supported branches.  Before 9.3, also incorporate  
commit 7a42dff47, which touches the same text and for some reason  
was not back-patched at the time.  

M doc/src/sgml/runtime.sgml

Fix help message in pg_ctl.

commit   : f3ab265052429793acf7a838a565b6d63b093914    
  
author   : Fujii Masao <[email protected]>    
date     : Thu, 14 Aug 2014 13:57:52 +0900    
  
committer: Fujii Masao <[email protected]>    
date     : Thu, 14 Aug 2014 13:57:52 +0900    

Click here for diff

Previously the help message described that -m is an option for  
"stop", "restart" and "promote" commands in pg_ctl. But actually  
that's not an option for "promote". So this commit fixes that  
incorrect description in the help message.  
  
Back-patch to 9.3 where the incorrect description was added.  

M src/bin/pg_ctl/pg_ctl.c

Expose -S option in pg_receivexlog.

commit   : 7c77ba8577d52b142997303f14c1e01abdb2d104    
  
author   : Fujii Masao <[email protected]>    
date     : Wed, 13 Aug 2014 10:45:28 +0900    
  
committer: Fujii Masao <[email protected]>    
date     : Wed, 13 Aug 2014 10:45:28 +0900    

Click here for diff

This option is equivalent to --slot option which pg_receivexlog has  
already supported, which specifies the replication slot to use for  
WAL streaming. pg_recvlogical has already supported both options,  
and this commit makes pg_receivexlog consistent with pg_recvlogical  
regarding the slot option.  
  
Back-patch to 9.4 where the slot option was added.  
  
Michael Paquier  

M doc/src/sgml/ref/pg_receivexlog.sgml
M src/bin/pg_basebackup/pg_receivexlog.c

pg_recvlogical message and code improvements.

commit   : 876f1e6805c34bb87525583e524e3445a33c215b    
  
author   : Andres Freund <[email protected]>    
date     : Tue, 12 Aug 2014 11:12:16 +0200    
  
committer: Andres Freund <[email protected]>    
date     : Tue, 12 Aug 2014 11:12:16 +0200    

Click here for diff

Some error messages complained about --init and --stop being used  
whereas the --create and --drop are the correct verbs. Fix that.  
  
Also a XLogRecPtr was tested in a boolean fashion instead of being  
compared to InvalidXLogRecPtr.  
  
Backpatch to 9.4 where pg_recvlogical was introduced.  
  
Michael Paquier  

M src/bin/pg_basebackup/pg_recvlogical.c

Be less aggressive in asking for feedback of logical walsender clients.

commit   : 423f73df9dcb9fd5b05fb1ed17bd636245bb90f3    
  
author   : Andres Freund <[email protected]>    
date     : Tue, 12 Aug 2014 11:04:50 +0200    
  
committer: Andres Freund <[email protected]>    
date     : Tue, 12 Aug 2014 11:04:50 +0200    

Click here for diff

When doing logical decoding using START_LOGICAL_REPLICATION in a  
walsender process the walsender sometimes was sending out keepalive  
messages too frequently. Asking for feedback every time.  
  
WalSndWaitForWal() sends out keepalive messages when it's waiting for  
new WAL to be generated locally when it sees that the remote side  
hasn't yet flushed WAL up to the local position. That generally is  
good but causes problems if the remote side only writes but doesn't  
flush changes yet. So check for both remote write and flush position.  
  
Additionally we've asked for feedback to the keepalive message which  
isn't warranted when waiting for WAL in contrast to preventing  
timeouts because of wal_sender_timeout.  
  
Complaint and patch by Steve Singer.  

M src/backend/replication/walsender.c

Change first call of ProcessConfigFile so as to process only data_directory.

commit   : 700f060528b1485970e6414fbf96aa1f87766a40    
  
author   : Fujii Masao <[email protected]>    
date     : Tue, 12 Aug 2014 16:50:09 +0900    
  
committer: Fujii Masao <[email protected]>    
date     : Tue, 12 Aug 2014 16:50:09 +0900    

Click here for diff

When both postgresql.conf and postgresql.auto.conf have their own entry of  
the same parameter, PostgreSQL uses the entry in postgresql.auto.conf because  
it appears last in the configuration scan. IOW, the other entries which appear  
earlier are ignored. But, previously, ProcessConfigFile() detected the invalid  
settings of even those unused entries and emitted the error messages  
complaining about them, at postmaster startup. Complaining about the entries  
to ignore is basically useless.  
  
This problem happened because ProcessConfigFile() was called twice at  
postmaster startup and the first call read only postgresql.conf. That is, the  
first call could check the entry which might be ignored eventually by  
the second call which read both postgresql.conf and postgresql.auto.conf.  
To work around the problem, this commit changes ProcessConfigFile so that  
its first call processes only data_directory and the second one does all the  
entries. It's OK to process data_directory in the first call because it's  
ensured that data_directory doesn't exist in postgresql.auto.conf.  
  
Back-patch to 9.4 where postgresql.auto.conf was added.  
  
Patch by me. Review by Amit Kapila  

M src/backend/utils/misc/guc-file.l
M src/backend/utils/misc/guc.c

Fix documentation oversights about pageinspect and initialization fork.

commit   : 44ea72d28066103b3d1df9a3e9476f52c56e06cc    
  
author   : Fujii Masao <[email protected]>    
date     : Mon, 11 Aug 2014 22:52:16 +0900    
  
committer: Fujii Masao <[email protected]>    
date     : Mon, 11 Aug 2014 22:52:16 +0900    

Click here for diff

The initialization fork was added in 9.1, but has not been taken into  
consideration in documents of get_raw_page function in pageinspect and  
storage layout. This commit fixes those oversights.  
  
get_raw_page can read not only a table but also an index, etc. So it  
should be documented that the function can read any relation. This commit  
also fixes the document of pageinspect that way.  
  
Back-patch to 9.1 where those oversights existed.  
  
Vik Fearing, review by MauMau  

M doc/src/sgml/pageinspect.sgml
M doc/src/sgml/storage.sgml

Clarify type resolution behavior for domain types.

commit   : 5d20643532cafd719482119d250c919edcac93b7    
  
author   : Tom Lane <[email protected]>    
date     : Sun, 10 Aug 2014 16:13:16 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Sun, 10 Aug 2014 16:13:16 -0400    

Click here for diff

The user documentation was vague and not entirely accurate about how  
we treat domain inputs for ambiguous operators/functions.  Clarify  
that, and add an example and some commentary.  Per a recent question  
from Adam Mackler.  
  
It's acted like this ever since we added domains, so back-patch  
to all supported branches.  

M doc/src/sgml/typeconv.sgml

Clean up handling of unknown-type inputs in json_build_object and friends.

commit   : 2591e623f5fc80a49347fb5e106aa1e03f713429    
  
author   : Tom Lane <[email protected]>    
date     : Sat, 9 Aug 2014 17:31:16 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Sat, 9 Aug 2014 17:31:16 -0400    

Click here for diff

There's actually no need for any special case for unknown-type literals,  
since we only need to push the value through its output function and  
unknownout() works fine.  The code that was here was completely bizarre  
anyway, and would fail outright in cases that should work, not to mention  
suffering from some copy-and-paste bugs.  

M src/backend/utils/adt/json.c

Further cleanup of JSON-specific error messages.

commit   : 84dd042a51e702a3761250e2ce801b3fb2b879c3    
  
author   : Tom Lane <[email protected]>    
date     : Sat, 9 Aug 2014 16:35:32 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Sat, 9 Aug 2014 16:35:32 -0400    

Click here for diff

Fix an obvious typo in json_build_object()'s complaint about invalid  
number of arguments, and make the errhint a bit more sensible too.  
  
Per discussion about how to word the improved hint, change the few places  
in the documentation that refer to JSON object field names as "names" to  
say "keys" instead, since that's what we've said in the vast majority of  
places in the docs.  Arguably "name" is more correct, since that's the  
terminology used in RFC 7159; but we're stuck with "key" in view of the  
naming of json_object_keys() so let's at least be self-consistent.  
  
I adjusted a few code comments to match this as well, and failed to  
resist the temptation to clean up some odd whitespace choices in the  
same area, as well as a useless duplicate PG_ARGISNULL() check.  There's  
still quite a bit of code that uses the phrase "field name" in non-user-  
visible ways, so I left those usages alone.  

M doc/src/sgml/func.sgml
M src/backend/utils/adt/json.c

Reject duplicate column names in foreign key referenced-columns lists.

commit   : 2f9912335c198f7ee8ec8c46a72f947c9c1c2257    
  
author   : Tom Lane <[email protected]>    
date     : Sat, 9 Aug 2014 13:46:38 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Sat, 9 Aug 2014 13:46:38 -0400    

Click here for diff

Such cases are disallowed by the SQL spec, and even if we wanted to allow  
them, the semantics seem ambiguous: how should the FK columns be matched up  
with the columns of a unique index?  (The matching could be significant in  
the presence of opclasses with different notions of equality, so this issue  
isn't just academic.)  However, our code did not previously reject such  
cases, but instead would either fail to match to any unique index, or  
generate a bizarre opclass-lookup error because of sloppy thinking in the  
index-matching code.  
  
David Rowley  

M src/backend/commands/tablecmds.c

Small message fixes

commit   : 213f0ff938949df3dd64cddd8c71f2da59812216    
  
author   : Peter Eisentraut <[email protected]>    
date     : Sat, 9 Aug 2014 00:07:00 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Sat, 9 Aug 2014 00:07:00 -0400    

Click here for diff

M src/bin/initdb/initdb.c
M src/bin/pg_basebackup/pg_basebackup.c
M src/bin/pg_dump/pg_backup_tar.c
M src/bin/pg_dump/pg_dump.c
M src/bin/pg_dump/pg_dumpall.c
M src/bin/pg_dump/pg_restore.c
M src/bin/pg_resetxlog/pg_resetxlog.c
M src/bin/psql/command.c
M src/common/username.c
M src/pl/plpgsql/src/pl_handler.c

Fix typo in docs.

commit   : 6749cd4e41ef68ba2ffe368487ec1b98fb0a974f    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 7 Aug 2014 20:46:44 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 7 Aug 2014 20:46:44 -0400    

Click here for diff

s/XIDs XIDs/XIDs/ in one place in maintenance.sgml.  
  
Guillaume Lelarge  

M doc/src/sgml/maintenance.sgml

pg_upgrade: prevent oid conflicts with new-cluster TOAST tables

commit   : f445b368d357332fb8392384ee4d75f21f07c5bb    
  
author   : Bruce Momjian <[email protected]>    
date     : Thu, 7 Aug 2014 14:56:13 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Thu, 7 Aug 2014 14:56:13 -0400    

Click here for diff

Previously, TOAST tables only required in the new cluster could cause  
oid conflicts if they were auto-numbered and a later conflicting oid had  
to be assigned.  
  
Backpatch through 9.3  

M contrib/pg_upgrade/dump.c
M contrib/pg_upgrade/pg_upgrade.c
M contrib/pg_upgrade/pg_upgrade.h
M src/backend/catalog/toasting.c
M src/include/catalog/binary_upgrade.h

Fix alternate regression test output file.

commit   : dc431f41672611d5575e330209784adad73b4f0d    
  
author   : Robert Haas <[email protected]>    
date     : Wed, 6 Aug 2014 11:18:38 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Wed, 6 Aug 2014 11:18:38 -0400    

Click here for diff

Commit 930e8ad738f5c78abd667626ca86f2553f36356f broke this.  
  
Jeff Janes  

M src/test/regress/expected/json_1.out

Change ParseConfigFp() so that it doesn't process unused entry of each parameter.

commit   : cf6a9c3742a78414184a6e651e4cc7d239f8f2c4    
  
author   : Fujii Masao <[email protected]>    
date     : Wed, 6 Aug 2014 14:49:43 +0900    
  
committer: Fujii Masao <[email protected]>    
date     : Wed, 6 Aug 2014 14:49:43 +0900    

Click here for diff

When more than one setting entries of same parameter exist in the  
configuration file, PostgreSQL uses only entry appearing last in  
configuration file scan. Since the other entries are not used,  
ParseConfigFp() doesn't need to process them, but previously it did  
that. This problematic behavior caused the configuration file scan  
to detect invalid settings of unused entries (e.g., existence of  
multiple entries of PGC_POSTMASTER parameter) and log the messages  
complaining about them.  
  
This commit changes the configuration file scan so that it processes  
only last entry of each parameter.  
  
Note that when multiple entries of same parameter exist both in  
postgresql.conf and postgresql.auto.conf, unused entries in  
postgresql.conf are still processed only at postmaster startup.  
  
The problem has existed since old version, but a user is more likely  
to encounter it since 9.4 where ALTER SYSTEM command was introduced.  
So back-patch to 9.4.  
  
Amit Kapila, slightly modified by me. Per report from Christoph Berg.  

M src/backend/utils/misc/guc-file.l

Improve some JSON error messages.

commit   : 930e8ad738f5c78abd667626ca86f2553f36356f    
  
author   : Robert Haas <[email protected]>    
date     : Tue, 5 Aug 2014 12:26:25 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Tue, 5 Aug 2014 12:26:25 -0400    

Click here for diff

These messages are new in 9.4, which hasn't been released yet, so  
back-patch to REL9_4_STABLE.  
  
Daniele Varrazzo  

M src/backend/utils/adt/json.c
M src/test/regress/expected/json.out

pg_upgrade: remove reference to autovacuum_multixact_freeze_max_age

commit   : 1337b3bbc2d821837e580fa232b714270e7ccd90    
  
author   : Bruce Momjian <[email protected]>    
date     : Mon, 4 Aug 2014 11:45:45 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Mon, 4 Aug 2014 11:45:45 -0400    

Click here for diff

autovacuum_multixact_freeze_max_age was added as a pg_ctl start  
parameter in 9.3.X to prevent autovacuum from running.  However, only  
some 9.3.X releases have autovacuum_multixact_freeze_max_age as it was  
added in a minor PG 9.3 release.  It also isn't needed because -b turns  
off autovacuum in 9.1+.  
  
Without this fix, trying to upgrade from an early 9.3 release to 9.4  
would fail.  
  
Report by EDB  
  
Backpatch through 9.3  

M contrib/pg_upgrade/server.c

Add missing PQclear() calls into pg_receivexlog.

commit   : 7cf7dc759c5c23703c1ac9e2808a2a059b0b02dc    
  
author   : Fujii Masao <[email protected]>    
date     : Sat, 2 Aug 2014 15:18:09 +0900    
  
committer: Fujii Masao <[email protected]>    
date     : Sat, 2 Aug 2014 15:18:09 +0900    

Click here for diff

Back-patch to 9.3.  

M src/bin/pg_basebackup/receivelog.c

Fix bug in pg_receivexlog --verbose.

commit   : 38803d823cfe872be11592a2d0eb2d9575b07e20    
  
author   : Fujii Masao <[email protected]>    
date     : Sat, 2 Aug 2014 14:57:21 +0900    
  
committer: Fujii Masao <[email protected]>    
date     : Sat, 2 Aug 2014 14:57:21 +0900    

Click here for diff

In 9.2, pg_receivexlog with verbose option has emitted the messages  
at the end of each WAL file. But the commit 0b63291 suppressed such  
messages by mistake. This commit fixes the bug so that pg_receivexlog  
--verbose outputs such messages again.  
  
Back-patch to 9.3 where the bug was added.  

M src/bin/pg_basebackup/receivelog.c

Fix typo in user manual

commit   : d5186cf270c0860932bd8a03897eb78f43dc88fe    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Fri, 1 Aug 2014 21:13:17 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Fri, 1 Aug 2014 21:13:17 +0300    

Click here for diff

M doc/src/sgml/libpq.sgml

Avoid wholesale autovacuuming when autovacuum is nominally off.

commit   : a95f7fb761eea4b323973671f86dc406612a5d11    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 30 Jul 2014 14:41:35 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 30 Jul 2014 14:41:35 -0400    

Click here for diff

When autovacuum is nominally off, we will still launch autovac workers  
to vacuum tables that are at risk of XID wraparound.  But after we'd done  
that, an autovac worker would proceed to autovacuum every table in the  
targeted database, if they meet the usual thresholds for autovacuuming.  
This is at best pretty unexpected; at worst it delays response to the  
wraparound threat.  Fix it so that if autovacuum is nominally off, we  
*only* do forced vacuums and not any other work.  
  
Per gripe from Andrey Zhidenkov.  This has been like this all along,  
so back-patch to all supported branches.  

M src/backend/postmaster/autovacuum.c

Fix mishandling of background worker PGPROCs in EXEC_BACKEND builds.

commit   : aeebacff114634ffa07b5299ee6c41b219717bc3    
  
author   : Robert Haas <[email protected]>    
date     : Wed, 30 Jul 2014 11:25:58 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Wed, 30 Jul 2014 11:25:58 -0400    

Click here for diff

InitProcess() relies on IsBackgroundWorker to decide whether the PGPROC  
for a new backend should be taken from ProcGlobal's freeProcs or from  
bgworkerFreeProcs.  In EXEC_BACKEND builds, InitProcess() is called  
sooner than in non-EXEC_BACKEND builds, and IsBackgroundWorker wasn't  
getting initialized soon enough.  
  
Report by Noah Misch.  Diagnosis and fix by me.  

M src/backend/postmaster/postmaster.c

doc: Clean up some recently added PL/pgSQL documentation

commit   : 98c5fe5d0df8549972f46c324d9c6b18b4c4ecc0    
  
author   : Peter Eisentraut <[email protected]>    
date     : Tue, 29 Jul 2014 23:47:16 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Tue, 29 Jul 2014 23:47:16 -0400    

Click here for diff

- Capitalize titles consistently.  
- Fix some grammar.  
- Group "Obtaining Information About an Error" under "Trapping Errors",  
  but make "Obtaining the Call Stack Context Information" its own  
  section, since it's not about errors.  

M doc/src/sgml/plpgsql.sgml

Oops, fix recoveryStopsBefore functions for regular commits.

commit   : 5b7f1f52107941a819cdf587216b86081cd967e2    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Tue, 29 Jul 2014 17:16:59 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Tue, 29 Jul 2014 17:16:59 +0300    

Click here for diff

Pointed out by Tom Lane. Backpatch to 9.4, the code was structured  
differently in earlier branches and didn't have this mistake.  

M src/backend/access/transam/xlog.c

Treat 2PC commit/abort the same as regular xacts in recovery.

commit   : 3b558ac830b2c30b50b9993c505e3061cbda036c    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Tue, 29 Jul 2014 10:33:15 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Tue, 29 Jul 2014 10:33:15 +0300    

Click here for diff

There were several oversights in recovery code where COMMIT/ABORT PREPARED  
records were ignored:  
  
* pg_last_xact_replay_timestamp() (wasn't updated for 2PC commits)  
* recovery_min_apply_delay (2PC commits were applied immediately)  
* recovery_target_xid (recovery would not stop if the XID used 2PC)  
  
The first of those was reported by Sergiy Zuban in bug #11032, analyzed by  
Tom Lane and Andres Freund. The bug was always there, but was masked before  
commit d19bd29f07aef9e508ff047d128a4046cc8bc1e2, because COMMIT PREPARED  
always created an extra regular transaction that was WAL-logged.  
  
Backpatch to all supported versions (older versions didn't have all the  
features and therefore didn't have all of the above bugs).  

M src/backend/access/transam/xlog.c
M src/include/access/xact.h

Reword the sentence for pg_logical_slot_peek_changes function.

commit   : 850ebf2db574a0c28a4f34eceae3c77dbc6320c8    
  
author   : Fujii Masao <[email protected]>    
date     : Tue, 29 Jul 2014 12:07:54 +0900    
  
committer: Fujii Masao <[email protected]>    
date     : Tue, 29 Jul 2014 12:07:54 +0900    

Click here for diff

Previously the duplicated paragraphs were used next to each other  
in the document to demonstrate that the changes in the stream  
were not consumed by pg_logical_slot_peek_changes function.  
But some users misunderstood that the duplication of the same  
paragraph was just typo. So this commit rewords the sentence in  
the latter paragraph for less confusing.  
  
Christoph Moench-Tegeder  

M doc/src/sgml/logicaldecoding.sgml

Fix obsolete statement in smgr/README.

commit   : 5307c993637674692ef71bcd41ff2412b03de914    
  
author   : Tom Lane <[email protected]>    
date     : Mon, 28 Jul 2014 16:30:14 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Mon, 28 Jul 2014 16:30:14 -0400    

Click here for diff

Since commit 2d00190495b22e0d0ba351b2cda9c95fb2e3d083, fork numbers are  
defined in relpath.h not relfilenode.h.  
  
Fabrízio de Royes Mello  

M src/backend/storage/smgr/README

doc: Fix up ALTER TABLESPACE reference page

commit   : 48f9e3d22ee3e790d4356ab46a13bbf1ed78ccce    
  
author   : Peter Eisentraut <[email protected]>    
date     : Sat, 26 Jul 2014 23:19:02 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Sat, 26 Jul 2014 23:19:02 -0400    

Click here for diff

The documentation of ALTER TABLESPACE ... MOVE was added without any  
markup, not even paragraph breaks.  Fix that, and clarify the text in a  
few places.  

M doc/src/sgml/ref/alter_tablespace.sgml

Fix a performance problem in pg_dump's dump order selection logic.

commit   : a8dddcaf758159059a83e147a960b369e9e3ab96    
  
author   : Tom Lane <[email protected]>    
date     : Fri, 25 Jul 2014 19:48:45 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Fri, 25 Jul 2014 19:48:45 -0400    

Click here for diff

findDependencyLoops() was not bright about cases where there are multiple  
dependency paths between the same two dumpable objects.  In most scenarios  
this did not hurt us too badly; but since the introduction of section  
boundary pseudo-objects in commit a1ef01fe163b304760088e3e30eb22036910a495,  
it was possible for this code to take unreasonable amounts of time (tens  
of seconds on a database with a couple thousand objects), as reported in  
bug #11033 from Joe Van Dyk.  Joe's particular problem scenario involved  
"pg_dump -a" mode with long chains of foreign key constraints, but I think  
that similar problems could arise with other situations as long as there  
were enough objects.  To fix, add a flag array that lets us notice when we  
arrive at the same object again while searching from a given start object.  
This simple change seems to be enough to eliminate the performance problem.  
  
Back-patch to 9.1, like the patch that introduced section boundary objects.  

M src/bin/pg_dump/pg_dump_sort.c

Prevent shm_mq_send from reading uninitialized memory.

commit   : df58a17df29f7ec0ffc8389deee46e81a2a58a60    
  
author   : Robert Haas <[email protected]>    
date     : Thu, 24 Jul 2014 09:19:50 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Thu, 24 Jul 2014 09:19:50 -0400    

Click here for diff

shm_mq_send_bytes didn't invariably initialize *bytes_written before  
returning, which would cause shm_mq_send to read from uninitialized  
memory and add the value it found there to mqh->mqh_partial_bytes.  
This could cause the next attempt to send a message via the queue to  
fail an assertion (if the queue was detached) or copy data from a  
garbage pointer value into the queue (if non-blocking mode was in use).  

M src/backend/storage/ipc/shm_mq.c

Fix checkpointer crash in EXEC_BACKEND builds.

commit   : 3372f1adad12bc70321fdf22f3c11ac67e429f63    
  
author   : Robert Haas <[email protected]>    
date     : Thu, 24 Jul 2014 09:04:59 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Thu, 24 Jul 2014 09:04:59 -0400    

Click here for diff

Nothing in the checkpointer calls InitXLOGAccess(), so WALInsertLocks  
never got initialized there.  Without EXEC_BACKEND, it works anyway  
because the correct value is inherited from the postmaster, but  
with EXEC_BACKEND we've got a problem.  The problem appears to have  
been introduced by commit 68a2e52bbaf98f136a96b3a0d734ca52ca440a95.  
  
To fix, move the relevant initialization steps from InitXLOGAccess()  
to XLOGShmemInit(), making this more parallel to what we do  
elsewhere.  
  
Amit Kapila  

M src/backend/access/transam/xlog.c

Properly remove ephemeral replication slots after a crash restart.

commit   : fece13d7477720bcbf02af795bed695c54d1250c    
  
author   : Andres Freund <[email protected]>    
date     : Thu, 24 Jul 2014 14:32:34 +0200    
  
committer: Andres Freund <[email protected]>    
date     : Thu, 24 Jul 2014 14:32:34 +0200    

Click here for diff

Ephemeral slots - slots that shouldn't survive database restarts -  
weren't properly cleaned up after a immediate/crash restart. They were  
ignored in the sense that they weren't restored into memory and thus  
didn't cause unwanted resource retention; but they prevented a new  
slot with the same name from being created.  
  
Now ephemeral slots are fully removed during startup.  
  
Backpatch to 9.4 where replication slots where added.  

M src/backend/replication/slot.c

Avoid access to already-released lock in LockRefindAndRelease.

commit   : 8da262879ef5e53620b9e6a0da82510d09c105cb    
  
author   : Robert Haas <[email protected]>    
date     : Thu, 24 Jul 2014 08:19:19 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Thu, 24 Jul 2014 08:19:19 -0400    

Click here for diff

Spotted by Tom Lane.  

M src/backend/storage/lmgr/lock.c

Fix TAP installcheck tests when current directory name contains spaces

commit   : e27eee10d7bcc211e1bac38575ed18c18d2ef88b    
  
author   : Peter Eisentraut <[email protected]>    
date     : Wed, 23 Jul 2014 21:41:59 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Wed, 23 Jul 2014 21:41:59 -0400    

Click here for diff

This fixes the installcheck part.  The check part has additional  
problems that will be addressed in a separate commit.  

M src/bin/initdb/t/001_initdb.pl
M src/bin/pg_controldata/t/001_pg_controldata.pl
M src/bin/pg_ctl/t/002_status.pl
M src/test/perl/TestLib.pm

Rearrange documentation paragraph describing pg_relation_size().

commit   : 7a8715b9886ef2970b89edb7e8ab2a195e0f1e0d    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 23 Jul 2014 15:20:34 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 23 Jul 2014 15:20:34 -0400    

Click here for diff

Break the list of available options into an <itemizedlist> instead of  
inline sentences.  This is mostly motivated by wanting to ensure that the  
cross-references to the FSM and VM docs don't cross page boundaries in PDF  
format; but it seems to me to read more easily this way anyway.  I took the  
liberty of editorializing a bit further while at it.  
  
Per complaint from Magnus about 9.0.18 docs not building in A4 format.  
Patch all active branches so we don't get blind-sided by this particular  
issue again in future.  

M doc/src/sgml/func.sgml

Report success when Windows kill() emulation signals an exiting process.

commit   : b28761cb3176c22d7804504c753ef4892ae0356a    
  
author   : Noah Misch <[email protected]>    
date     : Wed, 23 Jul 2014 00:35:13 -0400    
  
committer: Noah Misch <[email protected]>    
date     : Wed, 23 Jul 2014 00:35:13 -0400    

Click here for diff

This is consistent with the POSIX verdict that kill() shall not report  
ESRCH for a zombie process.  Back-patch to 9.0 (all supported versions).  
Test code from commit d7cdf6ee36adeac9233678fb8f2a112e6678a770 depends  
on it, and log messages about kill() reporting "Invalid argument" will  
cease to appear for this not-unexpected condition.  

M src/port/kill.c

MSVC: Substitute $(top_builddir) in REGRESS_OPTS.

commit   : 44acd17605032b7d32575b66f4c00ee0e2a7ab5f    
  
author   : Noah Misch <[email protected]>    
date     : Wed, 23 Jul 2014 00:35:07 -0400    
  
committer: Noah Misch <[email protected]>    
date     : Wed, 23 Jul 2014 00:35:07 -0400    

Click here for diff

Commit d7cdf6ee36adeac9233678fb8f2a112e6678a770 introduced a usage  
thereof.  Back-patch to 9.0, like that commit.  

M src/tools/msvc/vcregress.pl

Re-enable error for "SELECT ... OFFSET -1".

commit   : 30d6a9858cd8389e59d652d9919761dc095326c5    
  
author   : Tom Lane <[email protected]>    
date     : Tue, 22 Jul 2014 13:30:01 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Tue, 22 Jul 2014 13:30:01 -0400    

Click here for diff

The executor has thrown errors for negative OFFSET values since 8.4 (see  
commit bfce56eea45b1369b7bb2150a150d1ac109f5073), but in a moment of brain  
fade I taught the planner that OFFSET with a constant negative value was a  
no-op (commit 1a1832eb085e5bca198735e5d0e766a3cb61b8fc).  Reinstate the  
former behavior by only discarding OFFSET with a value of exactly 0.  In  
passing, adjust a planner comment that referenced the ancient behavior.  
  
Back-patch to 9.3 where the mistake was introduced.  

M src/backend/optimizer/plan/planner.c

Check block number against the correct fork in get_raw_page().

commit   : 1ea941450bca70ec9e30c2936e99835f9649f865    
  
author   : Tom Lane <[email protected]>    
date     : Tue, 22 Jul 2014 11:45:50 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Tue, 22 Jul 2014 11:45:50 -0400    

Click here for diff

get_raw_page tried to validate the supplied block number against  
RelationGetNumberOfBlocks(), which of course is only right when  
accessing the main fork.  In most cases, the main fork is longer  
than the others, so that the check was too weak (allowing a  
lower-level error to be reported, but no real harm to be done).  
However, very small tables could have an FSM larger than their heap,  
in which case the mistake prevented access to some FSM pages.  
Per report from Torsten Foertsch.  
  
In passing, make the bad-block-number error into an ereport not elog  
(since it's certainly not an internal error); and fix sloppily  
maintained comment for RelationGetNumberOfBlocksInFork.  
  
This has been wrong since we invented relation forks, so back-patch  
to all supported branches.  

M contrib/pageinspect/rawpage.c
M src/backend/storage/buffer/bufmgr.c

Allow empty string object keys in json_object().

commit   : a61f63df7d19006b36adf7ee402999aa5243097d    
  
author   : Andrew Dunstan <[email protected]>    
date     : Tue, 22 Jul 2014 11:22:47 -0400    
  
committer: Andrew Dunstan <[email protected]>    
date     : Tue, 22 Jul 2014 11:22:47 -0400    

Click here for diff

This makes the behaviour consistent with the json parser, other  
json-generating functions, and the JSON standards.  

M src/backend/utils/adt/json.c
M src/test/regress/expected/json.out
M src/test/regress/expected/json_1.out
M src/test/regress/sql/json.sql

Diagnose incompatible OpenLDAP versions during build and test.

commit   : fd18965e33da9dc7326803e61cf28d82237e3bba    
  
author   : Noah Misch <[email protected]>    
date     : Tue, 22 Jul 2014 11:01:03 -0400    
  
committer: Noah Misch <[email protected]>    
date     : Tue, 22 Jul 2014 11:01:03 -0400    

Click here for diff

With OpenLDAP versions 2.4.24 through 2.4.31, inclusive, PostgreSQL  
backends can crash at exit.  Raise a warning during "configure" based on  
the compile-time OpenLDAP version number, and test the crash scenario in  
the dblink test suite.  Back-patch to 9.0 (all supported versions).  

M configure
M configure.in
M contrib/dblink/Makefile
A contrib/dblink/expected/.gitignore
M contrib/dblink/expected/dblink.out
A contrib/dblink/input/paths.source
A contrib/dblink/output/paths.source
A contrib/dblink/pg_service.conf
A contrib/dblink/sql/.gitignore
M contrib/dblink/sql/dblink.sql
M src/test/regress/regress.c

Unset some local environment variables in TAP tests

commit   : 87c4232fd35fc3d1ff06189e886bffb382f6ca87    
  
author   : Peter Eisentraut <[email protected]>    
date     : Tue, 22 Jul 2014 00:42:36 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Tue, 22 Jul 2014 00:42:36 -0400    

Click here for diff

Unset environment variables that control message language, so that we  
can compare some program output with expected strings.  This is very  
similar to what pg_regress does.  

M src/test/perl/TestLib.pm

gitattributes: Ignore time zone data files for whitespace checks

commit   : 2cf489301e0487ea7bedde488e1b52ede862d058    
  
author   : Peter Eisentraut <[email protected]>    
date     : Mon, 21 Jul 2014 23:58:18 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Mon, 21 Jul 2014 23:58:18 -0400    

Click here for diff

The latest update introduced some funny whitespace, but since they are  
externally maintained files, we add them to the list of files to ignore.  

M .gitattributes

Reject out-of-range numeric timezone specifications.

commit   : ecb2d583ca6b248a94c8b53e74dac1ec863a4db7    
  
author   : Tom Lane <[email protected]>    
date     : Mon, 21 Jul 2014 22:41:23 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Mon, 21 Jul 2014 22:41:23 -0400    

Click here for diff

In commit 631dc390f49909a5c8ebd6002cfb2bcee5415a9d, we started to handle  
simple numeric timezone offsets via the zic library instead of the old  
CTimeZone/HasCTZSet kluge.  However, we overlooked the fact that the zic  
code will reject UTC offsets exceeding a week (which seems a bit arbitrary,  
but not because it's too tight ...).  This led to possibly setting  
session_timezone to NULL, which results in crashes in most timezone-related  
operations as of 9.4, and crashes in a small number of places even before  
that.  So check for NULL return from pg_tzset_offset() and report an  
appropriate error message.  Per bug #11014 from Duncan Gillis.  
  
Back-patch to all supported branches, like the previous patch.  
(Unfortunately, as of today that no longer includes 8.4.)  

M src/backend/commands/variable.c
M src/timezone/pgtz.c

Stamp 9.4beta2.

commit   : c85374626f680902c207285b986ac38a134535eb    
  
author   : Tom Lane <[email protected]>    
date     : Mon, 21 Jul 2014 15:07:50 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Mon, 21 Jul 2014 15:07:50 -0400    

Click here for diff

M configure
M configure.in
M doc/bug.template
M src/include/pg_config.h.win32

Release notes for 9.3.5, 9.2.9, 9.1.14, 9.0.18, 8.4.22.

commit   : ab2f504b2e8b4e90e44c9a20bb5d481794b39d1d    
  
author   : Tom Lane <[email protected]>    
date     : Mon, 21 Jul 2014 14:59:25 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Mon, 21 Jul 2014 14:59:25 -0400    

Click here for diff

M doc/src/sgml/release-8.4.sgml
M doc/src/sgml/release-9.0.sgml
M doc/src/sgml/release-9.1.sgml
M doc/src/sgml/release-9.2.sgml
M doc/src/sgml/release-9.3.sgml

Adjust cutoff points in newly-added sanity tests.

commit   : 3622b6be0fa8082f60eee2dd373f68911861118b    
  
author   : Tom Lane <[email protected]>    
date     : Mon, 21 Jul 2014 12:58:44 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Mon, 21 Jul 2014 12:58:44 -0400    

Click here for diff

Per recommendation from Andres.  

M src/backend/commands/vacuum.c

Defend against bad relfrozenxid/relminmxid/datfrozenxid/datminmxid values.

commit   : d122387d7d9149fdb9589ebdaf52c763464e4cd5    
  
author   : Tom Lane <[email protected]>    
date     : Mon, 21 Jul 2014 11:41:30 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Mon, 21 Jul 2014 11:41:30 -0400    

Click here for diff

In commit a61daa14d56867e90dc011bbba52ef771cea6770, we fixed pg_upgrade so  
that it would install sane relminmxid and datminmxid values, but that does  
not cure the problem for installations that were already pg_upgraded to  
9.3; they'll initially have "1" in those fields.  This is not a big problem  
so long as 1 is "in the past" compared to the current nextMultiXact  
counter.  But if an installation were more than halfway to the MXID wrap  
point at the time of upgrade, 1 would appear to be "in the future" and  
that would effectively disable tracking of oldest MXIDs in those  
tables/databases, until such time as the counter wrapped around.  
  
While in itself this isn't worse than the situation pre-9.3, where we did  
not manage MXID wraparound risk at all, the consequences of premature  
truncation of pg_multixact are worse now; so we ought to make some effort  
to cope with this.  We discussed advising users to fix the tracking values  
manually, but that seems both very tedious and very error-prone.  
  
Instead, this patch adopts two amelioration rules.  First, a relminmxid  
value that is "in the future" is allowed to be overwritten with a  
full-table VACUUM's actual freeze cutoff, ignoring the normal rule that  
relminmxid should never go backwards.  (This essentially assumes that we  
have enough defenses in place that wraparound can never occur anymore,  
and thus that a value "in the future" must be corrupt.)  Second, if we see  
any "in the future" values then we refrain from truncating pg_clog and  
pg_multixact.  This prevents loss of clog data until we have cleaned up  
all the broken tracking data.  In the worst case that could result in  
considerable clog bloat, but in practice we expect that relfrozenxid-driven  
freezing will happen soon enough to fix the problem before clog bloat  
becomes intolerable.  (Users could do manual VACUUM FREEZEs if not.)  
  
Note that this mechanism cannot save us if there are already-wrapped or  
already-truncated-away MXIDs in the table; it's only capable of dealing  
with corrupt tracking values.  But that's the situation we have with the  
pg_upgrade bug.  
  
For consistency, apply the same rules to relfrozenxid/datfrozenxid.  There  
are not known mechanisms for these to get messed up, but if they were, the  
same tactics seem appropriate for fixing them.  

M src/backend/commands/vacuum.c

Translation updates

commit   : 4bcdfb930e0477def194a651f043eaf9c8b82818    
  
author   : Peter Eisentraut <[email protected]>    
date     : Mon, 21 Jul 2014 01:07:36 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Mon, 21 Jul 2014 01:07:36 -0400    

Click here for diff

M src/backend/po/de.po
M src/backend/po/pl.po
M src/bin/initdb/po/de.po
M src/bin/initdb/po/fr.po
M src/bin/initdb/po/pl.po
M src/bin/initdb/po/pt_BR.po
M src/bin/pg_basebackup/po/de.po
M src/bin/pg_config/po/pt_BR.po
M src/bin/pg_controldata/po/fr.po
M src/bin/pg_controldata/po/pt_BR.po
M src/bin/pg_ctl/po/de.po
M src/bin/pg_ctl/po/fr.po
M src/bin/pg_ctl/po/pt_BR.po
M src/bin/pg_dump/po/de.po
M src/bin/pg_dump/po/fr.po
M src/bin/pg_dump/po/pl.po
M src/bin/pg_dump/po/pt_BR.po
M src/bin/pg_resetxlog/po/fr.po
M src/bin/pg_resetxlog/po/pl.po
M src/bin/pg_resetxlog/po/pt_BR.po
M src/bin/psql/po/pl.po
M src/bin/scripts/po/fr.po
M src/bin/scripts/po/pt_BR.po
M src/interfaces/ecpg/ecpglib/po/pt_BR.po
M src/interfaces/ecpg/preproc/po/de.po
M src/interfaces/ecpg/preproc/po/fr.po
M src/interfaces/ecpg/preproc/po/pt_BR.po
M src/interfaces/libpq/po/de.po
M src/interfaces/libpq/po/pt_BR.po
M src/pl/plperl/po/pt_BR.po
M src/pl/plpgsql/src/po/fr.po
M src/pl/plpgsql/src/po/pt_BR.po
M src/pl/plpython/po/de.po
M src/pl/plpython/po/fr.po
M src/pl/plpython/po/pt_BR.po
M src/pl/tcl/po/pt_BR.po

Update SQL features list

commit   : 2f2b7879edca272ae5ff52e27fcf7b8c09503153    
  
author   : Peter Eisentraut <[email protected]>    
date     : Mon, 21 Jul 2014 00:42:32 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Mon, 21 Jul 2014 00:42:32 -0400    

Click here for diff

M src/backend/catalog/sql_features.txt

Fix xreflabel for hot_standby_feedback.

commit   : be72263635dc95b4ada1bda3494c815fbd8987c3    
  
author   : Tom Lane <[email protected]>    
date     : Sat, 19 Jul 2014 22:20:38 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Sat, 19 Jul 2014 22:20:38 -0400    

Click here for diff

Rather remarkable that this has been wrong since 9.1 and nobody noticed.  

M doc/src/sgml/config.sgml

Update time zone data files to tzdata release 2014e.

commit   : e5ea60e80bf0b2941c63c64d0a9de4f103ec8d58    
  
author   : Tom Lane <[email protected]>    
date     : Sat, 19 Jul 2014 15:00:50 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Sat, 19 Jul 2014 15:00:50 -0400    

Click here for diff

DST law changes in Crimea, Egypt, Morocco.  New zone Antarctica/Troll  
for Norwegian base in Queen Maud Land.  

M src/timezone/data/africa
M src/timezone/data/antarctica
M src/timezone/data/asia
M src/timezone/data/australasia
M src/timezone/data/europe
M src/timezone/data/northamerica
M src/timezone/data/zone.tab

Partial fix for dropped columns in functions returning composite.

commit   : f0a497e4c499b3283b10d6092388413f9a565d65    
  
author   : Tom Lane <[email protected]>    
date     : Sat, 19 Jul 2014 14:28:25 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Sat, 19 Jul 2014 14:28:25 -0400    

Click here for diff

When a view has a function-returning-composite in FROM, and there are  
some dropped columns in the underlying composite type, ruleutils.c  
printed junk in the column alias list for the reconstructed FROM entry.  
Before 9.3, this was prevented by doing get_rte_attribute_is_dropped  
tests while printing the column alias list; but that solution is not  
currently available to us for reasons I'll explain below.  Instead,  
check for empty-string entries in the alias list, which can only exist  
if that column position had been dropped at the time the view was made.  
(The parser fills in empty strings to preserve the invariant that the  
aliases correspond to physical column positions.)  
  
While this is sufficient to handle the case of columns dropped before  
the view was made, we have still got issues with columns dropped after  
the view was made.  In particular, the view could contain Vars that  
explicitly reference such columns!  The dependency machinery really  
ought to refuse the column drop attempt in such cases, as it would do  
when trying to drop a table column that's explicitly referenced in  
views.  However, we currently neglect to store dependencies on columns  
of composite types, and fixing that is likely to be too big to be  
back-patchable (not to mention that existing views in existing databases  
would not have the needed pg_depend entries anyway).  So I'll leave that  
for a separate patch.  
  
Pre-9.3, ruleutils would print such Vars normally (with their original  
column names) even though it suppressed their entries in the RTE's  
column alias list.  This is certainly bogus, since the printed view  
definition would fail to reload, but at least it didn't crash.  However,  
as of 9.3 the printed column alias list is tightly tied to the names  
printed for Vars; so we can't treat columns as dropped for one purpose  
and not dropped for the other.  This is why we can't just put back the  
get_rte_attribute_is_dropped test: it results in an assertion failure  
if the view in fact contains any Vars referencing the dropped column.  
Once we've got dependencies preventing such cases, we'll probably want  
to do it that way instead of relying on the empty-string test used here.  
  
This fix turned up a very ancient bug in outfuncs/readfuncs, namely  
that T_String nodes containing empty strings were not dumped/reloaded  
correctly: the node was printed as "<>" which is read as a string  
value of <>.  Since (per SQL) we disallow empty-string identifiers,  
such nodes don't occur normally, which is why we'd not noticed.  
(Such nodes aren't used for literal constants, just identifiers.)  
  
Per report from Marc Schablewski.  Back-patch to 9.3 which is where  
the rule printing behavior changed.  The dangling-variable case is  
broken all the way back, but that's not what his complaint is about.  

M src/backend/nodes/outfuncs.c
M src/backend/utils/adt/ruleutils.c
M src/test/regress/expected/create_view.out
M src/test/regress/sql/create_view.sql

Limit pg_upgrade authentication advice to always-secure techniques.

commit   : f0af51d077b392cac4ce25e1347a4fc3b050d832    
  
author   : Noah Misch <[email protected]>    
date     : Fri, 18 Jul 2014 16:05:17 -0400    
  
committer: Noah Misch <[email protected]>    
date     : Fri, 18 Jul 2014 16:05:17 -0400    

Click here for diff

~/.pgpass is a sound choice everywhere, and "peer" authentication is  
safe on every platform it supports.  Cease to recommend "trust"  
authentication, the safety of which is deeply configuration-specific.  
Back-patch to 9.0, where pg_upgrade was introduced.  

M doc/src/sgml/pgupgrade.sgml

Fix two low-probability memory leaks in regular expression parsing.

commit   : 4a66f0f2d5a758f282549555feec4541c35588c4    
  
author   : Tom Lane <[email protected]>    
date     : Fri, 18 Jul 2014 13:00:27 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Fri, 18 Jul 2014 13:00:27 -0400    

Click here for diff

If pg_regcomp failed after having invoked markst/cleanst, it would leak any  
"struct subre" nodes it had created.  (We've already detected all regex  
syntax errors at that point, so the only likely causes of later failure  
would be query cancel or out-of-memory.)  To fix, make sure freesrnode  
knows the difference between the pre-cleanst and post-cleanst cleanup  
procedures.  Add some documentation of this less-than-obvious point.  
  
Also, newlacon did the wrong thing with an out-of-memory failure from  
realloc(), so that the previously allocated array would be leaked.  
  
Both of these are pretty low-probability scenarios, but a bug is a bug,  
so patch all the way back.  
  
Per bug #10976 from Arthur O'Dwyer.  

M src/backend/regex/regcomp.c

doc: Spell checking

commit   : 9fb149573dee5dc0b2849b4cdee5d5ffe83313d9    
  
author   : Peter Eisentraut <[email protected]>    
date     : Wed, 16 Jul 2014 22:20:15 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Wed, 16 Jul 2014 22:20:15 -0400    

Click here for diff

M doc/src/sgml/bgworker.sgml
M doc/src/sgml/catalogs.sgml
M doc/src/sgml/config.sgml
M doc/src/sgml/datatype.sgml
M doc/src/sgml/fdwhandler.sgml
M doc/src/sgml/func.sgml
M doc/src/sgml/high-availability.sgml
M doc/src/sgml/indexam.sgml
M doc/src/sgml/json.sgml
M doc/src/sgml/libpq.sgml
M doc/src/sgml/logicaldecoding.sgml
M doc/src/sgml/monitoring.sgml
M doc/src/sgml/perform.sgml
M doc/src/sgml/pgstatstatements.sgml
M doc/src/sgml/plpgsql.sgml
M doc/src/sgml/protocol.sgml
M doc/src/sgml/queries.sgml
M doc/src/sgml/recovery-config.sgml
M doc/src/sgml/ref/create_aggregate.sgml
M doc/src/sgml/ref/create_view.sgml
M doc/src/sgml/ref/pg_recvlogical.sgml
M doc/src/sgml/release-9.4.sgml
M doc/src/sgml/runtime.sgml
M doc/src/sgml/spi.sgml
M doc/src/sgml/xaggr.sgml
M doc/src/sgml/xindex.sgml
M doc/src/sgml/xml2.sgml

Fix bugs in SP-GiST search with range type's -|- (adjacent) operator.

commit   : 9b3ef66afe132e1f71e2577f513f28bee5fef39e    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Wed, 16 Jul 2014 09:10:54 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Wed, 16 Jul 2014 09:10:54 +0300    

Click here for diff

The consistent function contained several bugs:  
  
* The "if (which2) { ... }"  block was broken. It compared the  argument's  
lower bound against centroid's upper bound, while it was supposed to compare  
the argument's upper bound against the centroid's lower bound (the comment  
was correct, code was wrong). Also, it cleared bits in the "which1"  
variable, while it was supposed to clear bits in "which2".  
  
* If the argument's upper bound was equal to the centroid's lower bound, we  
descended to both halves (= all quadrants). That's unnecessary, searching  
the right quadrants is sufficient. This didn't lead to incorrect query  
results, but was clearly wrong, and slowed down queries unnecessarily.  
  
* In the case that argument's lower bound is adjacent to the centroid's  
upper bound, we also don't need to visit all quadrants. Per similar  
reasoning as previous point.  
  
* The code where we compare the previous centroid with the current centroid  
should match the code where we compare the current centroid with the  
argument. The point of that code is to redo the calculation done in the  
previous level, to see if we were supposed to traverse left or right (or up  
or down), and if we actually did. If we moved in the different direction,  
then we know there are no matches for bound.  
  
Refactor the code and adds comments to make it more readable and easier to  
reason about.  
  
Backpatch to 9.3 where SP-GiST support for range types was introduced.  

M src/backend/utils/adt/rangetypes_spgist.c

Move check for SSL_get_current_compression to run on mingw

commit   : 0e34d82538bd48fc537d512539cee014654a45e1    
  
author   : Magnus Hagander <[email protected]>    
date     : Tue, 15 Jul 2014 22:00:56 +0200    
  
committer: Magnus Hagander <[email protected]>    
date     : Tue, 15 Jul 2014 22:00:56 +0200    

Click here for diff

Mingw uses a different header file than msvc, so we don't get the  
hardcoded value, so we need the configure test to run.  

M configure
M configure.in

doc: Put new options in right order on reference pages

commit   : 3b70e973cf8363c84b2ef2958aea38f523765f44    
  
author   : Peter Eisentraut <[email protected]>    
date     : Tue, 15 Jul 2014 14:34:33 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Tue, 15 Jul 2014 14:34:33 -0400    

Click here for diff

M doc/src/sgml/pgbench.sgml
M doc/src/sgml/ref/pg_dump.sgml

pg_upgrade: Fix spacing in help output

commit   : e763ec989cb8b75ab010cc809cf9f5d6c2418da0    
  
author   : Peter Eisentraut <[email protected]>    
date     : Tue, 15 Jul 2014 14:33:59 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Tue, 15 Jul 2014 14:33:59 -0400    

Click here for diff

M contrib/pg_upgrade/option.c

pg_basebackup: Add more information about --max-rate option to help output

commit   : 7466037596bfdf1223f1759c7a0e4aaabff0cb53    
  
author   : Peter Eisentraut <[email protected]>    
date     : Tue, 15 Jul 2014 14:32:55 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Tue, 15 Jul 2014 14:32:55 -0400    

Click here for diff

It was previously not clear what unit the option argument should have.  

M src/bin/pg_basebackup/pg_basebackup.c

json_build_object and json_build_array are stable, not immutable.

commit   : 05011b6da5d0318710c272bfe23b84d8adc61332    
  
author   : Andrew Dunstan <[email protected]>    
date     : Tue, 15 Jul 2014 14:24:47 -0400    
  
committer: Andrew Dunstan <[email protected]>    
date     : Tue, 15 Jul 2014 14:24:47 -0400    

Click here for diff

These functions indirectly invoke output functions, so they can't be  
immutable.  
  
Backpatch to 9.4 where they were introduced.  
  
Catalog version bumped.  

M src/include/catalog/catversion.h
M src/include/catalog/pg_proc.h

Fix REASSIGN OWNED for text search objects

commit   : e45229bb66f52518cb07c38fe3d262502cd2d0c9    
  
author   : Alvaro Herrera <[email protected]>    
date     : Tue, 15 Jul 2014 13:24:07 -0400    
  
committer: Alvaro Herrera <[email protected]>    
date     : Tue, 15 Jul 2014 13:24:07 -0400    

Click here for diff

Trying to reassign objects owned by a user that had text search  
dictionaries or configurations used to fail with:  
ERROR:  unexpected classid 3600  
or  
ERROR:  unexpected classid 3602  
  
Fix by adding cases for those object types in a switch in pg_shdepend.c.  
  
Both REASSIGN OWNED and text search objects go back all the way to 8.1,  
so backpatch to all supported branches.  In 9.3 the alter-owner code was  
made generic, so the required change in recent branches is pretty  
simple; however, for 9.2 and older ones we need some additional  
reshuffling to enable specifying objects by OID rather than name.  
  
Text search templates and parsers are not owned objects, so there's no  
change required for them.  
  
Per bug #9749 reported by Michal Novotný  

M src/backend/catalog/pg_shdepend.c

Detect presence of SSL_get_current_compression

commit   : 5e4c9b37312e7d9dcb88e1e0a1fc279c780dd89e    
  
author   : Magnus Hagander <[email protected]>    
date     : Tue, 15 Jul 2014 18:04:43 +0200    
  
committer: Magnus Hagander <[email protected]>    
date     : Tue, 15 Jul 2014 18:04:43 +0200    

Click here for diff

Apparently we still build against OpenSSL so old that it doesn't  
have this function, so add an autoconf check for it to make the  
buildfarm happy. If the function doesn't exist, always return  
that compression is disabled, since presumably the actual  
compression functionality is always missing.  
  
For now, hardcode the function as present on MSVC, since we should  
hopefully be well beyond those old versions on that platform.  

M configure
M configure.in
M src/include/pg_config.h.in
M src/include/pg_config.h.win32
M src/include/port.h

Add missing source files to nls.mk

commit   : 77b41010dbb159b77b35aef02b517ce1a130f3b6    
  
author   : Peter Eisentraut <[email protected]>    
date     : Tue, 15 Jul 2014 10:00:53 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Tue, 15 Jul 2014 10:00:53 -0400    

Click here for diff

These are files under common/ that have been moved around.  Updating  
these manually is not satisfactory, but it's the only solution at the  
moment.  

M src/bin/initdb/nls.mk
M src/bin/pg_dump/nls.mk
M src/bin/psql/nls.mk
M src/bin/scripts/nls.mk

Include SSL compression status in psql banner and connection logging

commit   : d3c980694fa4523a8aa66b57343f031c4b6b8425    
  
author   : Magnus Hagander <[email protected]>    
date     : Tue, 15 Jul 2014 15:07:38 +0200    
  
committer: Magnus Hagander <[email protected]>    
date     : Tue, 15 Jul 2014 15:07:38 +0200    

Click here for diff

Both the psql banner and the connection logging already included  
SSL status, cipher and bitlength, this adds the information about  
compression being on or off.  

M src/backend/utils/init/postinit.c
M src/bin/psql/command.c

Add missing serial commas

commit   : 350651905decd60637e583837d3bb3aa5d9164b6    
  
author   : Peter Eisentraut <[email protected]>    
date     : Tue, 15 Jul 2014 08:25:27 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Tue, 15 Jul 2014 08:25:27 -0400    

Click here for diff

Also update one place where the wal_level "logical" was not added to an  
error message.  

M src/backend/access/transam/xlog.c
M src/backend/access/transam/xlogfuncs.c
M src/backend/postmaster/postmaster.c
M src/backend/utils/adt/json.c
M src/test/regress/expected/json.out
M src/test/regress/expected/json_1.out

doc: small fixes for REINDEX reference page

commit   : a53878fd5a639802237fcd883421d4ea7cced5c5    
  
author   : Peter Eisentraut <[email protected]>    
date     : Mon, 14 Jul 2014 20:37:00 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Mon, 14 Jul 2014 20:37:00 -0400    

Click here for diff

From: Josh Kupershmidt <[email protected]>  

M doc/src/sgml/ref/reindex.sgml

Move view reloptions into their own varlena struct

commit   : 28a935149fcf65c9b1b6c28c4131ed72e5183762    
  
author   : Alvaro Herrera <[email protected]>    
date     : Mon, 14 Jul 2014 17:24:40 -0400    
  
committer: Alvaro Herrera <[email protected]>    
date     : Mon, 14 Jul 2014 17:24:40 -0400    

Click here for diff

Per discussion after a gripe from me in  
http://www.postgresql.org/message-id/[email protected]  
  
Jaime Casanova  

M src/backend/access/common/reloptions.c
M src/backend/commands/tablecmds.c
M src/include/access/reloptions.h
M src/include/utils/rel.h
M src/tools/pgindent/typedefs.list

Prevent bitmap heap scans from showing unnecessary block info in EXPLAIN ANALYZE.

commit   : 543f57fc37e5d18ad4937fe11efd8e58d8fc7b23    
  
author   : Fujii Masao <[email protected]>    
date     : Mon, 14 Jul 2014 20:40:14 +0900    
  
committer: Fujii Masao <[email protected]>    
date     : Mon, 14 Jul 2014 20:40:14 +0900    

Click here for diff

EXPLAIN ANALYZE shows the information of the numbers of exact/lossy blocks which  
bitmap heap scan processes. But, previously, when those numbers were both zero,  
it displayed only the prefix "Heap Blocks:" in TEXT output format. This is strange  
and would confuse the users. So this commit suppresses such unnecessary information.  
  
Backpatch to 9.4 where EXPLAIN ANALYZE was changed so that such information was  
displayed.  
  
Etsuro Fujita  

M src/backend/commands/explain.c

Fix decoding of consecutive MULTI_INSERTs emitted by one heap_multi_insert().

commit   : 22ccce5206717036a06aefdf3f9f78ed9ffaab2f    
  
author   : Andres Freund <[email protected]>    
date     : Sat, 12 Jul 2014 14:28:19 +0200    
  
committer: Andres Freund <[email protected]>    
date     : Sat, 12 Jul 2014 14:28:19 +0200    

Click here for diff

Commit 1b86c81d2d fixed the decoding of toasted columns for the rows  
contained in one xl_heap_multi_insert record. But that's not actually  
enough, because heap_multi_insert() will actually first toast all  
passed in rows and then emit several *_multi_insert records; one for  
each page it fills with tuples.  
  
Add a XLOG_HEAP_LAST_MULTI_INSERT flag which is set in  
xl_heap_multi_insert->flag denoting that this multi_insert record is  
the last emitted by one heap_multi_insert() call. Then use that flag  
in decode.c to only set clear_toast_afterwards in the right situation.  
  
Expand the number of rows inserted via COPY in the corresponding  
regression test to make sure that more than one heap page is filled  
with tuples by one heap_multi_insert() call.  
  
Backpatch to 9.4 like the previous commit.  

M contrib/test_decoding/expected/toast.out
M contrib/test_decoding/sql/toast.sql
M src/backend/access/heap/heapam.c
M src/backend/replication/logical/decode.c
M src/include/access/heapam_xlog.h

Add autocompletion of locale keywords for CREATE DATABASE

commit   : bb4d05c026a7b811fa081d994bc02133fb6d13b1    
  
author   : Magnus Hagander <[email protected]>    
date     : Sat, 12 Jul 2014 14:19:57 +0200    
  
committer: Magnus Hagander <[email protected]>    
date     : Sat, 12 Jul 2014 14:19:57 +0200    

Click here for diff

Adds support for autocomplete of LC_COLLATE and LC_CTYPE to  
the CREATE DATABASE command in psql.  

M src/bin/psql/tab-complete.c

Fix bug with whole-row references to append subplans.

commit   : f280eff94974d4f50a927120d45580bb14c27e87    
  
author   : Tom Lane <[email protected]>    
date     : Fri, 11 Jul 2014 19:12:38 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Fri, 11 Jul 2014 19:12:38 -0400    

Click here for diff

ExecEvalWholeRowVar incorrectly supposed that it could "bless" the source  
TupleTableSlot just once per query.  But if the input is coming from an  
Append (or, perhaps, other cases?) more than one slot might be returned  
over the query run.  This led to "record type has not been registered"  
errors when a composite datum was extracted from a non-blessed slot.  
  
This bug has been there a long time; I guess it escaped notice because when  
dealing with subqueries the planner tends to expand whole-row Vars into  
RowExprs, which don't have the same problem.  It is possible to trigger  
the problem in all active branches, though, as illustrated by the added  
regression test.  

M src/backend/executor/execQual.c
M src/test/regress/expected/subselect.out
M src/test/regress/sql/subselect.sql

Rename logical decoding's pg_llog directory to pg_logical.

commit   : 6fe24405fa2e79d653daaf5c078e2a9d0a4b2c0c    
  
author   : Andres Freund <[email protected]>    
date     : Wed, 2 Jul 2014 21:07:47 +0200    
  
committer: Andres Freund <[email protected]>    
date     : Wed, 2 Jul 2014 21:07:47 +0200    

Click here for diff

The old name wasn't very descriptive as of actual contents of the  
directory, which are historical snapshots in the snapshots/  
subdirectory and mappingdata for rewritten tuples in  
mappings/. There's been a fair amount of discussion what would be a  
good name. I'm settling for pg_logical because it's likely that  
further data around logical decoding and replication will need saving  
in the future.  
  
Also add the missing entry for the directory into storage.sgml's list  
of PGDATA contents.  
  
Bumps catversion as the data directories won't be compatible.  
  
Backpatch to 9.4, which I missed to do as Michael Paquier luckily  
noticed. As there already has been a catversion bump after 9.4beta1,  
there's no reasons for having 9.4 diverge from master.  

M doc/src/sgml/storage.sgml
M src/backend/access/heap/rewriteheap.c
M src/backend/replication/logical/reorderbuffer.c
M src/backend/replication/logical/snapbuild.c
M src/bin/initdb/initdb.c
M src/include/catalog/catversion.h

Fix whitespace

commit   : 8adb4769954f072636a1c139517d08b6ba860779    
  
author   : Peter Eisentraut <[email protected]>    
date     : Tue, 8 Jul 2014 23:29:09 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Tue, 8 Jul 2014 23:29:09 -0400    

Click here for diff

M doc/src/sgml/datatype.sgml
M doc/src/sgml/func.sgml
M doc/src/sgml/gin.sgml
M doc/src/sgml/libpq.sgml
M doc/src/sgml/pgcrypto.sgml
M doc/src/sgml/pgprewarm.sgml
M doc/src/sgml/plpgsql.sgml
M doc/src/sgml/recovery-config.sgml
M doc/src/sgml/ref/alter_system.sgml
M doc/src/sgml/ref/create_aggregate.sgml
M doc/src/sgml/ref/create_table.sgml
M doc/src/sgml/ref/pg_basebackup.sgml
M doc/src/sgml/ref/psql-ref.sgml

Update key words table for 9.4

commit   : 845b3c3bb58c704374321c54307b36aa1fb4625a    
  
author   : Peter Eisentraut <[email protected]>    
date     : Tue, 8 Jul 2014 14:54:32 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Tue, 8 Jul 2014 14:54:32 -0400    

Click here for diff

M doc/src/sgml/keywords.sgml

commit   : 44850ec32a1463782055092002dd4e9cbc6f5c5f    
  
author   : Peter Eisentraut <[email protected]>    
date     : Tue, 8 Jul 2014 14:14:37 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Tue, 8 Jul 2014 14:14:37 -0400    

Click here for diff

M doc/src/sgml/func.sgml

Don't assume a subquery's output is unique if there's a SRF in its tlist.

commit   : ac45aa1dde2dd690682bf74f7535ba6d1a87bff8    
  
author   : Tom Lane <[email protected]>    
date     : Tue, 8 Jul 2014 14:03:16 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Tue, 8 Jul 2014 14:03:16 -0400    

Click here for diff

While the x output of "select x from t group by x" can be presumed unique,  
this does not hold for "select x, generate_series(1,10) from t group by x",  
because we may expand the set-returning function after the grouping step.  
(Perhaps that should be re-thought; but considering all the other oddities  
involved with SRFs in targetlists, it seems unlikely we'll change it.)  
Put a check in query_is_distinct_for() so it's not fooled by such cases.  
  
Back-patch to all supported branches.  
  
David Rowley  

M src/backend/optimizer/util/pathnode.c
M src/test/regress/expected/subselect.out
M src/test/regress/sql/subselect.sql

doc: Fix spacing in verbatim environments

commit   : 443dd97001c4cdb78ec388fffd5780ddccb3218f    
  
author   : Peter Eisentraut <[email protected]>    
date     : Tue, 8 Jul 2014 11:39:07 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Tue, 8 Jul 2014 11:39:07 -0400    

Click here for diff

M doc/src/sgml/config.sgml
M doc/src/sgml/extend.sgml
M doc/src/sgml/func.sgml
M doc/src/sgml/json.sgml
M doc/src/sgml/logicaldecoding.sgml
M doc/src/sgml/protocol.sgml
M doc/src/sgml/test-decoding.sgml

pg_upgrade: allow upgrades for new-only TOAST tables

commit   : f64fe2cbe6f1ec74a97e32d152d02ff9e371da14    
  
author   : Bruce Momjian <[email protected]>    
date     : Mon, 7 Jul 2014 13:24:08 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Mon, 7 Jul 2014 13:24:08 -0400    

Click here for diff

Previously, when calculations on the need for toast tables changed,  
pg_upgrade could not handle cases where the new cluster needed a TOAST  
table and the old cluster did not.  (It already handled the opposite  
case.)  This fixes the "OID mismatch" error typically generated in this  
case.  
  
Backpatch through 9.2  

M contrib/pg_upgrade/info.c

Fix decoding of MULTI_INSERTs when rows other than the last are toasted.

commit   : d54712e7cf2e8925d1e04782a0aec88eae2be72c    
  
author   : Andres Freund <[email protected]>    
date     : Sun, 6 Jul 2014 15:58:01 +0200    
  
committer: Andres Freund <[email protected]>    
date     : Sun, 6 Jul 2014 15:58:01 +0200    

Click here for diff

When decoding the results of a HEAP2_MULTI_INSERT (currently only  
generated by COPY FROM) toast columns for all but the last tuple  
weren't replaced by their actual contents before being handed to the  
output plugin. The reassembled toast datums where disregarded after  
every REORDER_BUFFER_CHANGE_(INSERT|UPDATE|DELETE) which is correct  
for plain inserts, updates, deletes, but not multi inserts - there we  
generate several REORDER_BUFFER_CHANGE_INSERTs for a single  
xl_heap_multi_insert record.  
  
To solve the problem add a clear_toast_afterwards boolean to  
ReorderBufferChange's union member that's used by modifications. All  
row changes but multi_inserts always set that to true, but  
multi_insert sets it only for the last change generated.  
  
Add a regression test covering decoding of multi_inserts - there was  
none at all before.  
  
Backpatch to 9.4 where logical decoding was introduced.  
  
Bug found by Petr Jelinek.  

M contrib/test_decoding/expected/toast.out
M contrib/test_decoding/sql/toast.sql
M src/backend/replication/logical/decode.c
M src/backend/replication/logical/reorderbuffer.c
M src/include/replication/reorderbuffer.h

Consistently pass an "unsigned char" to ctype.h functions.

commit   : 49c279efe7858454114bd304444e95573be0804b    
  
author   : Noah Misch <[email protected]>    
date     : Sun, 6 Jul 2014 00:29:51 -0400    
  
committer: Noah Misch <[email protected]>    
date     : Sun, 6 Jul 2014 00:29:51 -0400    

Click here for diff

The isxdigit() calls relied on undefined behavior.  The isascii() call  
was well-defined, but our prevailing style is to include the cast.  
Back-patch to 9.4, where the isxdigit() calls were introduced.  

M contrib/pg_upgrade/controldata.c
M src/backend/utils/adt/json.c

Don't cache per-group context across the whole query in orderedsetaggs.c.

commit   : e44964c709b4a5f18d3f9a8fe6d5c259091315c1    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 3 Jul 2014 18:47:09 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 3 Jul 2014 18:47:09 -0400    

Click here for diff

Although nodeAgg.c currently uses the same per-group memory context for  
all groups of a query, that might change in future.  Avoid assuming it.  
This costs us an extra AggCheckCallContext() call per group, but that's  
pretty cheap and is probably good from a safety standpoint anyway.  
  
Back-patch to 9.4 in case any third-party code copies this logic.  
  
Andrew Gierth  

M src/backend/utils/adt/orderedsetaggs.c

Redesign API presented by nodeAgg.c for ordered-set and similar aggregates.

commit   : f688cf548b3e37991009b7a3607171242c796e62    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 3 Jul 2014 18:25:37 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 3 Jul 2014 18:25:37 -0400    

Click here for diff

The previous design exposed the input and output ExprContexts of the  
Agg plan node, but work on grouping sets has suggested that we'll regret  
doing that.  Instead provide more narrowly-defined APIs that can be  
implemented in multiple ways, namely a way to get a short-term memory  
context and a way to register an aggregate shutdown callback.  
  
Back-patch to 9.4 where the bad APIs were introduced, since we don't  
want third-party code using these APIs and then having to change in 9.5.  
  
Andrew Gierth  

M src/backend/executor/nodeAgg.c
M src/backend/utils/adt/orderedsetaggs.c
M src/include/fmgr.h

Use a separate temporary directory for the Unix-domain socket

commit   : 6b56bc16cdf0c59e7d18ec046b2ed63bc82faf7b    
  
author   : Peter Eisentraut <[email protected]>    
date     : Wed, 2 Jul 2014 21:44:02 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Wed, 2 Jul 2014 21:44:02 -0400    

Click here for diff

Creating the Unix-domain socket in the build directory can run into  
name-length limitations.  Therefore, create the socket file in the  
default temporary directory of the operating system.  Keep the temporary  
data directory etc. in the build tree.  

M src/bin/pg_ctl/t/001_start_stop.pl
M src/bin/pg_ctl/t/002_status.pl
M src/test/perl/TestLib.pm

Support vpath builds in TAP tests

commit   : 04163ff1b98651ac2e04384ae8d84d8d1cb5dd60    
  
author   : Peter Eisentraut <[email protected]>    
date     : Wed, 2 Jul 2014 21:47:07 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Wed, 2 Jul 2014 21:47:07 -0400    

Click here for diff

M src/Makefile.global.in
M src/test/perl/TestLib.pm

Smooth reporting of commit/rollback statistics.

commit   : 93787ce7477b0d718bdcdb88605725792f36697e    
  
author   : Kevin Grittner <[email protected]>    
date     : Wed, 2 Jul 2014 15:03:57 -0500    
  
committer: Kevin Grittner <[email protected]>    
date     : Wed, 2 Jul 2014 15:03:57 -0500    

Click here for diff

If a connection committed or rolled back any transactions within a  
PGSTAT_STAT_INTERVAL pacing interval without accessing any tables,  
the reporting of those statistics would be held up until the  
connection closed or until it ended a PGSTAT_STAT_INTERVAL interval  
in which it had accessed a table.  This could result in under-  
reporting of transactions for an extended period, followed by a  
spike in reported transactions.  
  
While this is arguably a bug, the impact is minimal, primarily  
affecting, and being affected by, monitoring software.  It might  
cause more confusion than benefit to change the existing behavior  
in released stable branches, so apply only to master and the 9.4  
beta.  
  
Gurjeet Singh, with review and editing by Kevin Grittner,  
incorporating suggested changes from Abhijit Menon-Sen and Tom  
Lane.  

M src/backend/postmaster/pgstat.c

pg_upgrade: preserve database and relation minmxid values

commit   : b446a384b7c231e3fa10dfb0fbc9247a6b329348    
  
author   : Bruce Momjian <[email protected]>    
date     : Wed, 2 Jul 2014 15:29:38 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Wed, 2 Jul 2014 15:29:38 -0400    

Click here for diff

Also set these values for pre-9.3 old clusters that don't have values to  
preserve.  
  
Analysis by Alvaro  
  
Backpatch through 9.3  

M contrib/pg_upgrade/pg_upgrade.c
M contrib/pg_upgrade/server.c
M src/bin/pg_dump/pg_dump.c
M src/bin/pg_dump/pg_dump.h
M src/bin/pg_dump/pg_dumpall.c

pg_upgrade: no need to remove "members" files for pre-9.3 upgrades

commit   : fbbb65daa22c4fee8b608dfc39e41cb36a751cd2    
  
author   : Bruce Momjian <[email protected]>    
date     : Wed, 2 Jul 2014 13:11:05 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Wed, 2 Jul 2014 13:11:05 -0400    

Click here for diff

Per analysis by Alvaro  
  
Backpatch through 9.3  

M contrib/pg_upgrade/pg_upgrade.c

Add some errdetail to checkRuleResultList().

commit   : cec3be05f624bc32599c2a056ec1b47bec917510    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 2 Jul 2014 12:31:27 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 2 Jul 2014 12:31:27 -0400    

Click here for diff

This function wasn't originally thought to be really user-facing,  
because converting a table to a view isn't something we expect people  
to do manually.  So not all that much effort was spent on the error  
messages; in particular, while the code will complain that you got  
the column types wrong it won't say exactly what they are.  But since  
we repurposed the code to also check compatibility of rule RETURNING  
lists, it's definitely user-facing.  It now seems worthwhile to add  
errdetail messages showing exactly what the conflict is when there's  
a mismatch of column names or types.  This is prompted by bug #10836  
from Matthias Raffelsieper, which might have been forestalled if the  
error message had reported the wrong column type as being "record".  
  
Back-patch to 9.4, but not into older branches where the set of  
translatable error strings is supposed to be stable.  

M src/backend/rewrite/rewriteDefine.c

Prevent psql from issuing BEGIN before ALTER SYSTEM when AUTOCOMMIT is off.

commit   : 5520006b5bbaa36e6734a8ccf960bb870f4a4fec    
  
author   : Fujii Masao <[email protected]>    
date     : Wed, 2 Jul 2014 12:42:20 +0900    
  
committer: Fujii Masao <[email protected]>    
date     : Wed, 2 Jul 2014 12:42:20 +0900    

Click here for diff

The autocommit-off mode works by issuing an implicit BEGIN just before  
any command that is not already in a transaction block and is not itself  
a BEGIN or other transaction-control command, nor a command that  
cannot be executed inside a transaction block. This commit prevents psql  
from issuing such an implicit BEGIN before ALTER SYSTEM because it's  
not allowed inside a transaction block.  
  
Backpatch to 9.4 where ALTER SYSTEM was added.  
  
Report by Feike Steenbergen  

M src/bin/psql/common.c

Fix inadequately-sized output buffer in contrib/unaccent.

commit   : 49bca9ea53f6428f7ac6372ad4dd47ecacfac395    
  
author   : Tom Lane <[email protected]>    
date     : Tue, 1 Jul 2014 11:22:46 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Tue, 1 Jul 2014 11:22:46 -0400    

Click here for diff

The output buffer size in unaccent_lexize() was calculated as input string  
length times pg_database_encoding_max_length(), which effectively assumes  
that replacement strings aren't more than one character.  While that was  
all that we previously documented it to support, the code actually has  
always allowed replacement strings of arbitrary length; so if you tried  
to make use of longer strings, you were at risk of buffer overrun.  To fix,  
use an expansible StringInfo buffer instead of trying to determine the  
maximum space needed a-priori.  
  
This would be a security issue if unaccent rules files could be installed  
by unprivileged users; but fortunately they can't, so in the back branches  
the problem can be labeled as improper configuration by a superuser.  
Nonetheless, a memory stomp isn't a nice way of reacting to improper  
configuration, so let's back-patch the fix.  

M contrib/unaccent/unaccent.c

pg_upgrade: update C comments about pg_dumpall

commit   : 4dc3df9d193838060ec97dd29899e33676796ab5    
  
author   : Bruce Momjian <[email protected]>    
date     : Mon, 30 Jun 2014 19:57:47 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Mon, 30 Jun 2014 19:57:47 -0400    

Click here for diff

There were some C comments that hadn't been updated from the switch of  
using only pg_dumpall to using pg_dump and pg_dumpall, so update them.  
Also, don't bother using --schema-only for pg_dumpall --globals-only.  
  
Backpatch through 9.4  

M contrib/pg_upgrade/check.c
M contrib/pg_upgrade/dump.c
M contrib/pg_upgrade/exec.c
M contrib/pg_upgrade/function.c
M contrib/pg_upgrade/info.c
M contrib/pg_upgrade/pg_upgrade.c

Don't prematurely free the BufferAccessStrategy in pgstat_heap().

commit   : 37a4d3d70617f574b9a3dd5af079430b24817333    
  
author   : Noah Misch <[email protected]>    
date     : Mon, 30 Jun 2014 16:59:19 -0400    
  
committer: Noah Misch <[email protected]>    
date     : Mon, 30 Jun 2014 16:59:19 -0400    

Click here for diff

This function continued to use it after heap_endscan() freed it.  In  
passing, don't explicit create a strategy here.  Instead, use the one  
created by heap_beginscan_strat(), if any.  Back-patch to 9.2, where use  
of a BufferAccessStrategy here was introduced.  

M contrib/pgstattuple/pgstattuple.c

Check interrupts during logical decoding more frequently.

commit   : 6ad903d70a440eb0fbe0b33ceb87a8b0a81cb240    
  
author   : Andres Freund <[email protected]>    
date     : Sun, 29 Jun 2014 17:08:04 +0200    
  
committer: Andres Freund <[email protected]>    
date     : Sun, 29 Jun 2014 17:08:04 +0200    

Click here for diff

When reading large amounts of preexisting WAL during logical decoding  
using the SQL interface we possibly could fail to check interrupts in  
due time. Similarly the same could happen on systems with a very high  
WAL volume while creating a new logical replication slot, independent  
of the used interface.  
  
Previously these checks where only performed in xlogreader's read_page  
callbacks, while waiting for new WAL to be produced. That's not  
sufficient though, if there's never a need to wait.  Walsender's send  
loop already contains a interrupt check.  
  
Backpatch to 9.4 where the logical decoding feature was introduced.  

M src/backend/replication/logical/logical.c
M src/backend/replication/logical/logicalfuncs.c

Revert the assertion of no palloc's in critical section.

commit   : d27d493a4e465c7b3a9e2749e0b69d51aa1e3133    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Mon, 30 Jun 2014 10:23:18 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Mon, 30 Jun 2014 10:23:18 +0300    

Click here for diff

Per discussion, it still fires too often to be safe to enable in  
production. Keep it in master, so that we find the issues, but disable it  
in the stable branch.  

M src/backend/utils/mmgr/mcxt.c

Remove use_json_as_text options from json_to_record/json_populate_record.

commit   : 3130b8505ffcc3dae053939824c72291f6cdff3b    
  
author   : Tom Lane <[email protected]>    
date     : Sun, 29 Jun 2014 13:51:02 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Sun, 29 Jun 2014 13:51:02 -0400    

Click here for diff

The "false" case was really quite useless since all it did was to throw  
an error; a definition not helped in the least by making it the default.  
Instead let's just have the "true" case, which emits nested objects and  
arrays in JSON syntax.  We might later want to provide the ability to  
emit sub-objects in Postgres record or array syntax, but we'd be best off  
to drive that off a check of the target field datatype, not a separate  
argument.  
  
For the functions newly added in 9.4, we can just remove the flag arguments  
outright.  We can't do that for json_populate_record[set], which already  
existed in 9.3, but we can ignore the argument and always behave as if it  
were "true".  It helps that the flag arguments were optional and not  
documented in any useful fashion anyway.  

M doc/src/sgml/func.sgml
M src/backend/catalog/system_views.sql
M src/backend/utils/adt/jsonfuncs.c
M src/include/catalog/catversion.h
M src/include/catalog/pg_proc.h
M src/test/regress/expected/json.out
M src/test/regress/expected/json_1.out
M src/test/regress/expected/jsonb.out
M src/test/regress/expected/jsonb_1.out
M src/test/regress/sql/json.sql
M src/test/regress/sql/jsonb.sql

Have multixact be truncated by checkpoint, not vacuum

commit   : 56f86bb764bb99a32810c52976926f85cc3bf3b1    
  
author   : Alvaro Herrera <[email protected]>    
date     : Fri, 27 Jun 2014 14:43:52 -0400    
  
committer: Alvaro Herrera <[email protected]>    
date     : Fri, 27 Jun 2014 14:43:52 -0400    

Click here for diff

Instead of truncating pg_multixact at vacuum time, do it only at  
checkpoint time.  The reason for doing it this way is twofold: first, we  
want it to delete only segments that we're certain will not be required  
if there's a crash immediately after the removal; and second, we want to  
do it relatively often so that older files are not left behind if  
there's an untimely crash.  
  
Per my proposal in  
http://www.postgresql.org/message-id/[email protected]  
we now execute the truncation in the checkpointer process rather than as  
part of vacuum.  Vacuum is in only charge of maintaining in shared  
memory the value to which it's possible to truncate the files; that  
value is stored as part of checkpoints also, and so upon recovery we can  
reuse the same value to re-execute truncate and reset the  
oldest-value-still-safe-to-use to one known to remain after truncation.  
  
Per bug reported by Jeff Janes in the course of his tests involving  
bug #8673.  
  
While at it, update some comments that hadn't been updated since  
multixacts were changed.  
  
Backpatch to 9.3, where persistency of pg_multixact files was  
introduced by commit 0ac5ad5134f2.  

M src/backend/access/transam/multixact.c
M src/backend/access/transam/xlog.c
M src/backend/commands/vacuum.c
M src/include/access/multixact.h

Don't allow relminmxid to go backwards during VACUUM FULL

commit   : 9eecc8a7cafa2be356a859f74c5db5961e190579    
  
author   : Alvaro Herrera <[email protected]>    
date     : Fri, 27 Jun 2014 14:43:46 -0400    
  
committer: Alvaro Herrera <[email protected]>    
date     : Fri, 27 Jun 2014 14:43:46 -0400    

Click here for diff

We were allowing a table's pg_class.relminmxid value to move backwards  
when heaps were swapped by VACUUM FULL or CLUSTER.  There is a  
similar protection against relfrozenxid going backwards, which we  
neglected to clone when the multixact stuff was rejiggered by commit  
0ac5ad5134f276.  
  
Backpatch to 9.3, where relminmxid was introduced.  
  
As reported by Heikki in  
http://www.postgresql.org/message-id/[email protected]  

M src/backend/commands/cluster.c

Fix broken Assert() introduced by 8e9a16ab8f7f0e58

commit   : 4c888a6290add7ab86078c8759f0de1bd74c7377    
  
author   : Alvaro Herrera <[email protected]>    
date     : Fri, 27 Jun 2014 14:43:39 -0400    
  
committer: Alvaro Herrera <[email protected]>    
date     : Fri, 27 Jun 2014 14:43:39 -0400    

Click here for diff

Don't assert MultiXactIdIsRunning if the multi came from a tuple that  
had been share-locked and later copied over to the new cluster by  
pg_upgrade.  Doing that causes an error to be raised unnecessarily:  
MultiXactIdIsRunning is not open to the possibility that its argument  
came from a pg_upgraded tuple, and all its other callers are already  
checking; but such multis cannot, obviously, have transactions still  
running, so the assert is pointless.  
  
Noticed while investigating the bogus pg_multixact/offsets/0000 file  
left over by pg_upgrade, as reported by Andres Freund in  
http://www.postgresql.org/message-id/[email protected]  
  
Backpatch to 9.3, as the commit that introduced the buglet.  

M src/backend/access/heap/heapam.c

Disallow pushing volatile qual expressions down into DISTINCT subqueries.

commit   : 6327f25dddba0c359f8be8395e1b2d99dfe0d30c    
  
author   : Tom Lane <[email protected]>    
date     : Fri, 27 Jun 2014 11:08:51 -0700    
  
committer: Tom Lane <[email protected]>    
date     : Fri, 27 Jun 2014 11:08:51 -0700    

Click here for diff

A WHERE clause applied to the output of a subquery with DISTINCT should  
theoretically be applied only once per distinct row; but if we push it  
into the subquery then it will be evaluated at each row before duplicate  
elimination occurs.  If the qual is volatile this can give rise to  
observably wrong results, so don't do that.  
  
While at it, refactor a little bit to allow subquery_is_pushdown_safe  
to report more than one kind of restrictive condition without indefinitely  
expanding its argument list.  
  
Although this is a bug fix, it seems unwise to back-patch it into released  
branches, since it might de-optimize plans for queries that aren't giving  
any trouble in practice.  So apply to 9.4 but not further back.  

M src/backend/optimizer/path/allpaths.c
M src/test/regress/expected/subselect.out
M src/test/regress/sql/subselect.sql

Get rid of bogus separate pg_proc entries for json_extract_path operators.

commit   : c3096d57c8faa24aa5ff4cc7e87d989ce42ad05d    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 26 Jun 2014 16:22:18 -0700    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 26 Jun 2014 16:22:18 -0700    

Click here for diff

These should not have existed to begin with, but there was apparently some  
misunderstanding of the purpose of the opr_sanity regression test item  
that checks for operator implementation functions with their own comments.  
The idea there is to check for unintentional violations of the rule that  
operator implementation functions shouldn't be documented separately  
.... but for these functions, that is in fact what we want, since the  
variadic option is useful and not accessible via the operator syntax.  
Get rid of the extra pg_proc entries and fix the regression test and  
documentation to be explicit about what we're doing here.  

M doc/src/sgml/func.sgml
M src/include/catalog/catversion.h
M src/include/catalog/pg_operator.h
M src/include/catalog/pg_proc.h
M src/test/regress/expected/opr_sanity.out

Forward-patch regression test for "could not find pathkey item to sort".

commit   : 973837450c764b585321c965179eb8a57380ab5c    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 26 Jun 2014 10:40:55 -0700    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 26 Jun 2014 10:40:55 -0700    

Click here for diff

Commit a87c729153e372f3731689a7be007bc2b53f1410 already fixed the bug this  
is checking for, but the regression test case it added didn't cover this  
scenario.  Since we managed to miss the fact that there was a bug at all,  
it seems like a good idea to propagate the extra test case forward to HEAD.  

M src/test/regress/expected/union.out
M src/test/regress/sql/union.sql

Remove obsolete example of CSV log file name from log_filename document.

commit   : 2a741ca7658167c9061f9d0095992b326d6ffdbb    
  
author   : Fujii Masao <[email protected]>    
date     : Thu, 26 Jun 2014 14:27:27 +0900    
  
committer: Fujii Masao <[email protected]>    
date     : Thu, 26 Jun 2014 14:27:27 +0900    

Click here for diff

7380b63 changed log_filename so that epoch was not appended to it  
when no format specifier is given. But the example of CSV log file name  
with epoch still left in log_filename document. This commit removes  
such obsolete example.  
  
This commit also documents the defaults of log_directory and  
log_filename.  
  
Backpatch to all supported versions.  
  
Christoph Berg  

M doc/src/sgml/config.sgml

Rationalize error messages within jsonfuncs.c.

commit   : 119fed85f5f68e8fb146549e3267026c9fdc8640    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 25 Jun 2014 15:25:26 -0700    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 25 Jun 2014 15:25:26 -0700    

Click here for diff

I noticed that the functions in jsonfuncs.c sometimes printed error  
messages that claimed I'd called some other function.  Investigation showed  
that this was from repurposing code into "worker" functions without taking  
much care as to whether it would mention the right SQL-level function if it  
threw an error.  Moreover, there was a weird mismash of messages that  
contained a fixed function name, messages that used %s for a function name,  
and messages that constructed a function name out of spare parts, like  
"json%s_populate_record" (which, quite aside from being ugly as sin, wasn't  
even sufficient to cover all the cases).  This would put an undue burden on  
our long-suffering translators.  Standardize on inserting the SQL function  
name with %s so as to reduce the number of translatable strings, and pass  
function names around as needed to make sure we can report the right one.  
Fix up some gratuitous variations in wording, too.  

M src/backend/utils/adt/jsonfuncs.c
M src/test/regress/expected/jsonb.out
M src/test/regress/expected/jsonb_1.out

Cosmetic improvements in jsonfuncs.c.

commit   : 199aa7108794db50c64b55327e4c81d1c2f414a5    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 25 Jun 2014 11:22:21 -0700    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 25 Jun 2014 11:22:21 -0700    

Click here for diff

Re-pgindent, remove a lot of random vertical whitespace, remove useless  
(if not counterproductive) inline markings, get rid of unnecessary  
zero-padding of strings for hashtable searches.  No functional changes.  

M src/backend/utils/adt/jsonfuncs.c

Fix handling of nested JSON objects in json_populate_recordset and friends.

commit   : a331512dec25807c4c93e3d537ac7734ee901641    
  
author   : Tom Lane <[email protected]>    
date     : Tue, 24 Jun 2014 21:22:43 -0700    
  
committer: Tom Lane <[email protected]>    
date     : Tue, 24 Jun 2014 21:22:43 -0700    

Click here for diff

populate_recordset_object_start() improperly created a new hash table  
(overwriting the link to the existing one) if called at nest levels  
greater than one.  This resulted in previous fields not appearing in  
the final output, as reported by Matti Hameister in bug #10728.  
In 9.4 the problem also affects json_to_recordset.  
  
This perhaps missed detection earlier because the default behavior is to  
throw an error for nested objects: you have to pass use_json_as_text = true  
to see the problem.  
  
In addition, fix query-lifespan leakage of the hashtable created by  
json_populate_record().  This is pretty much the same problem recently  
fixed in dblink: creating an intended-to-be-temporary context underneath  
the executor's per-tuple context isn't enough to make it go away at the  
end of the tuple cycle, because MemoryContextReset is not  
MemoryContextResetAndDeleteChildren.  
  
Michael Paquier and Tom Lane  

M src/backend/utils/adt/jsonfuncs.c
M src/test/regress/expected/json.out
M src/test/regress/expected/json_1.out
M src/test/regress/sql/json.sql

pg_upgrade: remove pg_multixact files left by initdb

commit   : dd5369047fc3400f4b5d1d61d85b040a8eef8d1b    
  
author   : Bruce Momjian <[email protected]>    
date     : Tue, 24 Jun 2014 16:11:06 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Tue, 24 Jun 2014 16:11:06 -0400    

Click here for diff

This fixes a bug that caused vacuum to fail when the '0000' files left  
by initdb were accessed as part of vacuum's cleanup of old pg_multixact  
files.  
  
Backpatch through 9.3  

M contrib/pg_upgrade/pg_upgrade.c

Don't allow foreign tables with OIDs.

commit   : 1818ae0a789ec360d8641c98520f832b9fd9c0ef    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Tue, 24 Jun 2014 12:31:36 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Tue, 24 Jun 2014 12:31:36 +0300    

Click here for diff

The syntax doesn't let you specify "WITH OIDS" for foreign tables, but it  
was still possible with default_with_oids=true. But the rest of the system,  
including pg_dump, isn't prepared to handle foreign tables with OIDs  
properly.  
  
Backpatch down to 9.1, where foreign tables were introduced. It's possible  
that there are databases out there that already have foreign tables with  
OIDs. There isn't much we can do about that, but at least we can prevent  
them from being created in the future.  
  
Patch by Etsuro Fujita, reviewed by Hadi Moshayedi.  

M src/backend/commands/tablecmds.c

Fix typo in replication slot function doc.

commit   : e9b182404b67eef9a263c3d07b89cb60b26bed7b    
  
author   : Fujii Masao <[email protected]>    
date     : Tue, 24 Jun 2014 03:51:51 +0900    
  
committer: Fujii Masao <[email protected]>    
date     : Tue, 24 Jun 2014 03:51:51 +0900    

Click here for diff

M doc/src/sgml/func.sgml

Add missing closing parenthesis into max_replication_slots doc.

commit   : c6d0df9492b12ce657de8512a93dd473f3eff5d9    
  
author   : Fujii Masao <[email protected]>    
date     : Tue, 24 Jun 2014 03:25:01 +0900    
  
committer: Fujii Masao <[email protected]>    
date     : Tue, 24 Jun 2014 03:25:01 +0900    

Click here for diff

M doc/src/sgml/config.sgml

doc: adjust JSONB GIN index description

commit   : a2586dece1953e7c395b533bf52b54b5e7bb3a3c    
  
author   : Bruce Momjian <[email protected]>    
date     : Sat, 21 Jun 2014 15:33:22 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Sat, 21 Jun 2014 15:33:22 -0400    

Click here for diff

Backpatch through 9.4  

M doc/src/sgml/json.sgml

9.4 release notes: adjust some entry wording

commit   : 750c0351ea9c07e2398a2e116ed7d48dbc42b489    
  
author   : Bruce Momjian <[email protected]>    
date     : Sat, 21 Jun 2014 10:56:37 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Sat, 21 Jun 2014 10:56:37 -0400    

Click here for diff

Backpatch to 9.4  

M doc/src/sgml/release-9.4.sgml

Fix documentation template for CREATE TRIGGER.

commit   : bcd67a2fe97eaf3f83b5ddb72aaffff34f4d441f    
  
author   : Kevin Grittner <[email protected]>    
date     : Sat, 21 Jun 2014 09:17:14 -0500    
  
committer: Kevin Grittner <[email protected]>    
date     : Sat, 21 Jun 2014 09:17:14 -0500    

Click here for diff

By using curly braces, the template had specified that one of  
"NOT DEFERRABLE", "INITIALLY IMMEDIATE", or "INITIALLY DEFERRED"  
was required on any CREATE TRIGGER statement, which is not  
accurate.  Change to square brackets makes that optional.  
  
Backpatch to 9.1, where the error was introduced.  

M doc/src/sgml/ref/create_trigger.sgml

Clean up data conversion short-lived memory context.

commit   : 9d884a34c343641f7ab3c24377d7ec0970df4eea    
  
author   : Joe Conway <[email protected]>    
date     : Fri, 20 Jun 2014 12:22:34 -0700    
  
committer: Joe Conway <[email protected]>    
date     : Fri, 20 Jun 2014 12:22:34 -0700    

Click here for diff

dblink uses a short-lived data conversion memory context. However it  
was not deleted when no longer needed, leading to a noticeable memory  
leak under some circumstances. Plug the hole, along with minor  
refactoring. Backpatch to 9.2 where the leak was introduced.  
  
Report and initial patch by MauMau. Reviewed/modified slightly by  
Tom Lane and me.  

M contrib/dblink/dblink.c

Do all-visible handling in lazy_vacuum_page() outside its critical section.

commit   : 4bc0a13a8a6af0320923a89238b7ab3f27c28d56    
  
author   : Andres Freund <[email protected]>    
date     : Fri, 20 Jun 2014 11:06:48 +0200    
  
committer: Andres Freund <[email protected]>    
date     : Fri, 20 Jun 2014 11:06:48 +0200    

Click here for diff

Since fdf9e21196a lazy_vacuum_page() rechecks the all-visible status  
of pages in the second pass over the heap. It does so inside a  
critical section, but both visibilitymap_test() and  
heap_page_is_all_visible() perform operations that should not happen  
inside one. The former potentially performs IO and both potentially do  
memory allocations.  
  
To fix, simply move all the all-visible handling outside the critical  
section. Doing so means that the PD_ALL_VISIBLE on the page won't be  
included in the full page image of the HEAP2_CLEAN record anymore. But  
that's fine, the flag will be set by the HEAP2_VISIBLE logged later.  
  
Backpatch to 9.3 where the problem was introduced. The bug only came  
to light due to the assertion added in 4a170ee9 and isn't likely to  
cause problems in production scenarios. The worst outcome is a  
avoidable PANIC restart.  
  
This also gets rid of the difference in the order of operations  
between master and standby mentioned in 2a8e1ac5.  
  
Per reports from David Leverton and Keith Fiske in bug #10533.  

M src/backend/commands/vacuumlazy.c

Avoid leaking memory while evaluating arguments for a table function.

commit   : 1044e79a0b7b21ddedd9e093394a34e8cc2d42bc    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 19 Jun 2014 22:13:44 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 19 Jun 2014 22:13:44 -0400    

Click here for diff

ExecMakeTableFunctionResult evaluated the arguments for a function-in-FROM  
in the query-lifespan memory context.  This is insignificant in simple  
cases where the function relation is scanned only once; but if the function  
is in a sub-SELECT or is on the inside of a nested loop, any memory  
consumed during argument evaluation can add up quickly.  (The potential for  
trouble here had been foreseen long ago, per existing comments; but we'd  
not previously seen a complaint from the field about it.)  To fix, create  
an additional temporary context just for this purpose.  
  
Per an example from MauMau.  Back-patch to all active branches.  

M src/backend/executor/execQual.c
M src/backend/executor/nodeFunctionscan.c
M src/include/executor/executor.h
M src/include/nodes/execnodes.h

Document SQL functions' behavior of parsing the whole function at once.

commit   : b488daf0d59614e801059e3558f73b65b0cf7e06    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 19 Jun 2014 12:33:56 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 19 Jun 2014 12:33:56 -0400    

Click here for diff

Haribabu Kommi, somewhat rewritten by me  

M doc/src/sgml/xfunc.sgml

Fix calculation of PREDICATELOCK_MANAGER_LWLOCK_OFFSET.

commit   : 909cab83058b12cabec6fb10c945f67ef09de5ec    
  
author   : Kevin Grittner <[email protected]>    
date     : Thu, 19 Jun 2014 08:51:54 -0500    
  
committer: Kevin Grittner <[email protected]>    
date     : Thu, 19 Jun 2014 08:51:54 -0500    

Click here for diff

Commit ea9df812d8502fff74e7bc37d61bdc7d66d77a7f failed to include  
NUM_BUFFER_PARTITIONS in this offset, resulting in a bad offset.  
Ultimately this threw off NUM_FIXED_LWLOCKS which is based on  
earlier offsets, leading to memory allocation problems.  It seems  
likely to have also caused increased LWLOCK contention when  
serializable transactions were used, because lightweight locks used  
for that overlapped others.  
  
Reported by Amit Kapila with analysis and fix.  
Backpatch to 9.4, where the bug was introduced.  

M src/include/storage/lwlock.h

Don't allow data_directory to be set in postgresql.auto.conf by ALTER SYSTEM.

commit   : fc5cf383d9ae894e3c9e94701ce5dc468d334433    
  
author   : Fujii Masao <[email protected]>    
date     : Thu, 19 Jun 2014 20:31:20 +0900    
  
committer: Fujii Masao <[email protected]>    
date     : Thu, 19 Jun 2014 20:31:20 +0900    

Click here for diff

data_directory could be set both in postgresql.conf and postgresql.auto.conf so far.  
This could cause some problematic situations like circular definition. To avoid such  
situations, this commit forbids a user to set data_directory in postgresql.auto.conf.  
  
Backpatch this to 9.4 where ALTER SYSTEM command was introduced.  
  
Amit Kapila, reviewed by Abhijit Menon-Sen, with minor adjustments by me.  

M doc/src/sgml/ref/alter_system.sgml
M src/backend/utils/misc/guc.c
M src/include/utils/guc.h

Remove unnecessary check for jbvBinary in convertJsonbValue.

commit   : a6896e00058c55692347f898a9bc2a2974520df8    
  
author   : Andrew Dunstan <[email protected]>    
date     : Wed, 18 Jun 2014 19:28:20 -0400    
  
committer: Andrew Dunstan <[email protected]>    
date     : Wed, 18 Jun 2014 19:28:20 -0400    

Click here for diff

The check was confusing and is a condition that should never in fact  
happen.  
  
Per gripe from Dmitry Dolgov.  

M src/backend/utils/adt/jsonb_util.c

Fix weird spacing in error message.

commit   : fd1afbbedc55014783b9730385967d73c31a1f37    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 18 Jun 2014 15:44:15 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 18 Jun 2014 15:44:15 -0400    

Click here for diff

Seems to have been introduced in 1a3458b6d8d202715a83c88474a1b63726d0929e.  

M src/backend/port/sysv_shmem.c

Document that jsonb has all the standard comparison operators.

commit   : 8b4067e6ec051b5b50b9e8ae981708ce7c4bcf02    
  
author   : Andrew Dunstan <[email protected]>    
date     : Wed, 18 Jun 2014 15:16:48 -0400    
  
committer: Andrew Dunstan <[email protected]>    
date     : Wed, 18 Jun 2014 15:16:48 -0400    

Click here for diff

M doc/src/sgml/func.sgml

Fix the MSVC build process for uuid-ossp.

commit   : cee1f48cb3e34dbd8435849369a7cd0f7cbc6d3b    
  
author   : Noah Misch <[email protected]>    
date     : Wed, 18 Jun 2014 09:21:50 -0400    
  
committer: Noah Misch <[email protected]>    
date     : Wed, 18 Jun 2014 09:21:50 -0400    

Click here for diff

Catch up with commit b8cc8f94730610c0189aa82dfec4ae6ce9b13e34's  
introduction of the HAVE_UUID_OSSP symbol to the principal build  
process.  Back-patch to 9.4, where that commit appeared.  

M src/tools/msvc/Solution.pm

9.4 release notes: improve valgrind mention

commit   : 9d90472a0ed4955678d7080ee6b2a53a7762f32b    
  
author   : Bruce Momjian <[email protected]>    
date     : Tue, 17 Jun 2014 11:28:34 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Tue, 17 Jun 2014 11:28:34 -0400    

Click here for diff

Report by Peter Geoghegan  

M doc/src/sgml/release-9.4.sgml

Use type pgsocket for Windows pipe emulation socket calls

commit   : 0ada6b84b058b76095ffffa69175e82b6f3e63ec    
  
author   : Bruce Momjian <[email protected]>    
date     : Mon, 16 Jun 2014 15:33:19 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Mon, 16 Jun 2014 15:33:19 -0400    

Click here for diff

This prevents several compiler warnings on Windows.  

M src/bin/pg_dump/parallel.c

Secure Unix-domain sockets of "make check" temporary clusters.

commit   : 6583a75b282c221e143b57386c51f7d59305b51c    
  
author   : Noah Misch <[email protected]>    
date     : Sat, 14 Jun 2014 09:41:13 -0400    
  
committer: Noah Misch <[email protected]>    
date     : Sat, 14 Jun 2014 09:41:13 -0400    

Click here for diff

Any OS user able to access the socket can connect as the bootstrap  
superuser and proceed to execute arbitrary code as the OS user running  
the test.  Protect against that by placing the socket in a temporary,  
mode-0700 subdirectory of /tmp.  The pg_regress-based test suites and  
the pg_upgrade test suite were vulnerable; the $(prove_check)-based test  
suites were already secure.  Back-patch to 8.4 (all supported versions).  
The hazard remains wherever the temporary cluster accepts TCP  
connections, notably on Windows.  
  
As a convenient side effect, this lets testing proceed smoothly in  
builds that override DEFAULT_PGSOCKET_DIR.  Popular non-default values  
like /var/run/postgresql are often unwritable to the build user.  
  
Security: CVE-2014-0067  

M contrib/pg_upgrade/test.sh
M doc/src/sgml/regress.sgml
M src/test/regress/pg_regress.c

Add mkdtemp() to libpgport.

commit   : 598efaa37f4e223491cf326f2ab44414a934c014    
  
author   : Noah Misch <[email protected]>    
date     : Sat, 14 Jun 2014 09:41:13 -0400    
  
committer: Noah Misch <[email protected]>    
date     : Sat, 14 Jun 2014 09:41:13 -0400    

Click here for diff

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.  

M configure
M configure.in
M src/include/pg_config.h.in
M src/include/pg_config.h.win32
M src/include/port.h
A src/port/mkdtemp.c
M src/tools/msvc/Mkvcbuild.pm

Harden pg_filenode_relation test against concurrent DROP TABLE.

commit   : cc3e1553fa6786b3a8c673fc9d8ce0a258ba8809    
  
author   : Noah Misch <[email protected]>    
date     : Fri, 13 Jun 2014 19:57:59 -0400    
  
committer: Noah Misch <[email protected]>    
date     : Fri, 13 Jun 2014 19:57:59 -0400    

Click here for diff

Per buildfarm member prairiedog.  Back-patch to 9.4, where the test was  
introduced.  
  
Reviewed by Tom Lane.  

M src/test/regress/expected/alter_table.out
M src/test/regress/sql/alter_table.sql

Adjust 9.4 release notes.

commit   : b31218798a6a9119e88f08c4c646fe7236c01a5d    
  
author   : Noah Misch <[email protected]>    
date     : Fri, 13 Jun 2014 19:57:41 -0400    
  
committer: Noah Misch <[email protected]>    
date     : Fri, 13 Jun 2014 19:57:41 -0400    

Click here for diff

Back-patch to 9.4.  

M doc/src/sgml/release-9.4.sgml

emacs.samples: Reliably override ".dir-locals.el".

commit   : c221a0e22768ed7b5aa67184944a50ca735de8dc    
  
author   : Noah Misch <[email protected]>    
date     : Fri, 13 Jun 2014 19:57:18 -0400    
  
committer: Noah Misch <[email protected]>    
date     : Fri, 13 Jun 2014 19:57:18 -0400    

Click here for diff

Back-patch to 9.4, where .dir-locals.el was introduced.  

M src/tools/editors/emacs.samples

Fix pg_restore's processing of old-style BLOB COMMENTS data.

commit   : c3c1401ca23a6a990989da777c78f7c8a19ca282    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 12 Jun 2014 20:14:36 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 12 Jun 2014 20:14:36 -0400    

Click here for diff

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 branches.  

M src/bin/pg_dump/pg_backup_archiver.c
M src/bin/pg_dump/pg_backup_db.c
M src/bin/pg_dump/pg_dump.c

Improve tuplestore's error messages for I/O failures.

commit   : 3ba1776c568e36423ee66892481b6d1703f4fbd8    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 12 Jun 2014 18:59:06 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 12 Jun 2014 18:59:06 -0400    

Click here for diff

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.  

M src/backend/utils/sort/logtape.c
M src/backend/utils/sort/tuplestore.c

Adjust largeobject regression test to leave a couple of LOs behind.

commit   : b37e574865f8b465a1c99a29dcdfcecf6eca32f5    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 12 Jun 2014 17:51:47 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 12 Jun 2014 17:51:47 -0400    

Click here for diff

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.  

M src/test/regress/input/largeobject.source
M src/test/regress/output/largeobject.source
M src/test/regress/output/largeobject_1.source

commit   : 7e00e09872f194c3dc30faca6aff7c2a32b608f6    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 12 Jun 2014 16:51:05 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 12 Jun 2014 16:51:05 -0400    

Click here for diff

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.  

M src/test/regress/input/largeobject.source
M src/test/regress/output/largeobject.source
M src/test/regress/output/largeobject_1.source

Add regression test to prevent future breakage of legacy query in libpq.

commit   : e6f6db300fef2e53080209ae00f19408203e5686    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 12 Jun 2014 15:54:13 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 12 Jun 2014 15:54:13 -0400    

Click here for diff

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.  

M src/test/regress/expected/opr_sanity.out
M src/test/regress/sql/opr_sanity.sql

Rename lo_create(oid, bytea) to lo_from_bytea().

commit   : e3489847d08beaa4b9dc2a84011719f0b848f3e1    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 12 Jun 2014 15:39:09 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 12 Jun 2014 15:39:09 -0400    

Click here for diff

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.  

M doc/src/sgml/lobj.sgml
M src/backend/libpq/be-fsstubs.c
M src/include/catalog/catversion.h
M src/include/catalog/pg_proc.h
M src/include/libpq/be-fsstubs.h
M src/test/regress/input/largeobject.source
M src/test/regress/output/largeobject.source
M src/test/regress/output/largeobject_1.source

Consistency improvements for slot and decoding code.

commit   : d52a6c4944c1d83cfaae53e20561c53220e7968b    
  
author   : Andres Freund <[email protected]>    
date     : Thu, 12 Jun 2014 13:23:46 +0200    
  
committer: Andres Freund <[email protected]>    
date     : Thu, 12 Jun 2014 13:23:46 +0200    

Click here for diff

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  

M src/backend/access/transam/xlog.c
M src/backend/replication/logical/logical.c
M src/backend/replication/slot.c
M src/backend/replication/slotfuncs.c
M src/backend/replication/walsender.c
M src/include/replication/slot.h

Fix ancient encoding error in hungarian.stop.

commit   : 7f9fbb842b09da851e003a70c6c53fd8ca6c6f82    
  
author   : Tom Lane <[email protected]>    
date     : Tue, 10 Jun 2014 22:48:16 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Tue, 10 Jun 2014 22:48:16 -0400    

Click here for diff

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.  

M src/backend/snowball/stopwords/hungarian.stop

Forward-port regression test for bug #10587 into 9.3 and HEAD.

commit   : ab76208e3df6841b3770edeece57d0f048392237    
  
author   : Tom Lane <[email protected]>    
date     : Mon, 9 Jun 2014 21:37:18 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Mon, 9 Jun 2014 21:37:18 -0400    

Click here for diff

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.  

M src/test/regress/expected/join.out
M src/test/regress/sql/join.sql

Fix infinite loop when splitting inner tuples in SPGiST text indexes.

commit   : c170655cc81fd5e3c152e951c52247171bb57611    
  
author   : Tom Lane <[email protected]>    
date     : Mon, 9 Jun 2014 16:30:40 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Mon, 9 Jun 2014 16:30:40 -0400    

Click here for diff

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.  

M src/backend/access/spgist/spgtextproc.c

Wrap multixact/members correctly during extension, take 2

commit   : b0b263baab3e927fe4b4f35755b91ac8d1db8fe0    
  
author   : Alvaro Herrera <[email protected]>    
date     : Mon, 9 Jun 2014 15:17:23 -0400    
  
committer: Alvaro Herrera <[email protected]>    
date     : Mon, 9 Jun 2014 15:17:23 -0400    

Click here for diff

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.  

M src/backend/access/transam/multixact.c
M src/include/access/multixact.h

Fix off-by-one in decoding causing one-record events to be skipped.

commit   : fe7337f2dc3177da19b647fcda3a33b73da82e14    
  
author   : Andres Freund <[email protected]>    
date     : Thu, 5 Jun 2014 18:27:11 +0200    
  
committer: Andres Freund <[email protected]>    
date     : Thu, 5 Jun 2014 18:27:11 +0200    

Click here for diff

A ReorderBufferTransaction's end_lsn, the sentPtr advocated by  
walsender keepalive messages, and the end location remembered by the  
decoding get_*changes* SQL functions all use the location of the last  
read record + 1. I.e. the LSN points to the beginning of the next  
record. That cannot realistically be changed without changing the  
replication protocol because that's how keepalive messages have worked  
since 9.0.  
The bug is that the logic inside the snapshot builder, which decides  
whether a transaction's contents should be decoded, assumed the start  
location would point towards the last byte of the last record. The  
reason this didn't actually cause visible problems is that currently  
that decision is only made for commit records. Since interesting  
transactions always have at least one additional record - containing  
actual data - we'd never skip a transaction.  
But if there ever were transactions, or other events, with just one  
record containing important information, we'd skip them after stopping  
and restarting logical decoding.  

M src/backend/replication/logical/snapbuild.c

Add defenses against running with a wrong selection of LOBLKSIZE.

commit   : 5f93c37805e7485488480916b4585e098d3cc883    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 5 Jun 2014 11:31:06 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 5 Jun 2014 11:31:06 -0400    

Click here for diff

It's critical that the backend's idea of LOBLKSIZE match the way data has  
actually been divided up in pg_largeobject.  While we don't provide any  
direct way to adjust that value, doing so is a one-line source code change  
and various people have expressed interest recently in changing it.  So,  
just as with TOAST_MAX_CHUNK_SIZE, it seems prudent to record the value in  
pg_control and cross-check that the backend's compiled-in setting matches  
the on-disk data.  
  
Also tweak the code in inv_api.c so that fetches from pg_largeobject  
explicitly verify that the length of the data field is not more than  
LOBLKSIZE.  Formerly we just had Asserts() for that, which is no protection  
at all in production builds.  In some of the call sites an overlength data  
value would translate directly to a security-relevant stack clobber, so it  
seems worth one extra runtime comparison to be sure.  
  
In the back branches, we can't change the contents of pg_control; but we  
can still make the extra checks in inv_api.c, which will offer some amount  
of protection against running with the wrong value of LOBLKSIZE.  

M src/backend/access/transam/xlog.c
M src/backend/storage/large_object/inv_api.c
M src/bin/pg_controldata/pg_controldata.c
M src/bin/pg_resetxlog/pg_resetxlog.c
M src/include/catalog/pg_control.h
M src/include/storage/large_object.h

Consistently spell a replication slot's name as slot_name.

commit   : f0c108560bce3a5481db57ffc3743e71b5f7b2d1    
  
author   : Andres Freund <[email protected]>    
date     : Thu, 5 Jun 2014 16:29:20 +0200    
  
committer: Andres Freund <[email protected]>    
date     : Thu, 5 Jun 2014 16:29:20 +0200    

Click here for diff

Previously there's been a mix between 'slotname' and 'slot_name'. It's  
not nice to be unneccessarily inconsistent in a new feature. As a post  
beta1 initdb now is required in the wake of eeca4cd35e, fix the  
inconsistencies.  
Most the changes won't affect usage of replication slots because the  
majority of changes is around function parameter names. The prominent  
exception to that is that the recovery.conf parameter  
'primary_slotname' is now named 'primary_slot_name'.  

M doc/src/sgml/func.sgml
M doc/src/sgml/high-availability.sgml
M doc/src/sgml/logicaldecoding.sgml
M doc/src/sgml/protocol.sgml
M doc/src/sgml/recovery-config.sgml
M src/backend/access/transam/recovery.conf.sample
M src/backend/access/transam/xlog.c
M src/backend/catalog/system_views.sql
M src/bin/pg_basebackup/pg_recvlogical.c
M src/include/catalog/catversion.h
M src/include/catalog/pg_proc.h

Move regression test listing of builtin leakproof functions to opr_sanity.sql.

commit   : e0cb4aa89dd61cb1a76d348ced634681255b6a07    
  
author   : Andres Freund <[email protected]>    
date     : Thu, 5 Jun 2014 13:54:16 +0200    
  
committer: Andres Freund <[email protected]>    
date     : Thu, 5 Jun 2014 13:54:16 +0200    

Click here for diff

The original location in create_function_3.sql didn't invite the close  
structinity warranted for adding new leakproof functions. Add comments  
to the test explaining that functions should only be added after  
careful consideration and understanding what a leakproof function is.  
  
Per complaint from Tom Lane after 5eebb8d954ad.  

M src/test/regress/expected/create_function_3.out
M src/test/regress/expected/opr_sanity.out
M src/test/regress/sql/create_function_3.sql
M src/test/regress/sql/opr_sanity.sql

Adjust SP-GiST WAL record formats to reduce alignment padding.

commit   : 8776faa81cb651322b8993422bdd4633f1f6a487    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Thu, 5 Jun 2014 12:55:35 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Thu, 5 Jun 2014 12:55:35 +0300    

Click here for diff

The way the code was written, the padding was copied from uninitialized  
memory areas.. Because the structs are local variables in the code where  
the WAL records are constructed, making them larger and zeroing the padding  
bytes would not make the code very pretty, so rather than fixing this  
directly by zeroing out the padding bytes, it seems more clear to not try to  
align the tuples in the WAL records. The redo functions are taught to copy  
the tuple header to a local variable to avoid unaligned access.  
  
Stable-branches have the same problem, but we can't change the WAL format  
there, so fix in master only. Reading a few random extra bytes at the stack  
is harmless in practice, so it's not worth crafting a different  
back-patchable fix.  
  
Per reports from Kevin Grittner and Andres Freund, using clang static  
analyzer and Valgrind, respectively.  

M src/backend/access/spgist/spgdoinsert.c
M src/backend/access/spgist/spgvacuum.c
M src/backend/access/spgist/spgxlog.c
M src/include/access/spgist_private.h
M src/include/access/xlog_internal.h

Tweak new regression test case for better portability.

commit   : d4d48a5edd9eb28a7f2ee2e4cbe20d984274982e    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 4 Jun 2014 21:31:41 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 4 Jun 2014 21:31:41 -0400    

Click here for diff

Buildfarm says we get different plans on 32-bit and 64-bit platforms,  
probably because of MAXALIGN-related differences in memory-consumption  
calculations.  Add some dummy WHERE clauses so that the planner estimates  
different sizes for the three generate_series() relations; that should  
stabilize the choice of join order.  

M src/test/regress/expected/pg_lsn.out
M src/test/regress/sql/pg_lsn.sql

Add btree and hash opclasses for pg_lsn.

commit   : 4c8ab1b91d2bd154031f7bc8529b9e6e2f1cc443    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 4 Jun 2014 20:45:56 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 4 Jun 2014 20:45:56 -0400    

Click here for diff

This is needed to allow ORDER BY, DISTINCT, etc to work as expected for  
pg_lsn values.  
  
We had previously decided to put this off for 9.5, but in view of commit  
eeca4cd35e284c72b2ea1b4494e64e7738896e81 there's no reason to avoid a  
catversion bump for 9.4beta2, and this does make a pretty significant  
usability difference for pg_lsn.  
  
Michael Paquier, with fixes from Andres Freund and Tom Lane  

M src/backend/utils/adt/pg_lsn.c
M src/include/catalog/catversion.h
M src/include/catalog/pg_amop.h
M src/include/catalog/pg_amproc.h
M src/include/catalog/pg_opclass.h
M src/include/catalog/pg_operator.h
M src/include/catalog/pg_opfamily.h
M src/include/catalog/pg_proc.h
M src/include/utils/pg_lsn.h
M src/test/regress/expected/pg_lsn.out
M src/test/regress/sql/pg_lsn.sql

Bump PG_CONTROL_VERSION for previous 9.4 changes.

commit   : eeca4cd35e284c72b2ea1b4494e64e7738896e81    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 4 Jun 2014 18:16:17 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 4 Jun 2014 18:16:17 -0400    

Click here for diff

This should have been done in 6bc8ef0b7f1f1df3998745a66e1790e27424aa0c  
and/or 50e547096c4858a68abf09894667a542cc418315, but better late than  
never.  If we don't change this then we risk 9.3 pg_controldata or  
pg_resetxlog being inappropriately used against a 9.4 pg_control file,  
or vice versa.  

M src/include/catalog/pg_control.h

Fix longstanding bug in HeapTupleSatisfiesVacuum().

commit   : 621a99a666ba1a27b852dc5ddc0e1b224c388f53    
  
author   : Andres Freund <[email protected]>    
date     : Wed, 4 Jun 2014 21:36:19 +0200    
  
committer: Andres Freund <[email protected]>    
date     : Wed, 4 Jun 2014 21:36:19 +0200    

Click here for diff

HeapTupleSatisfiesVacuum() didn't properly discern between  
DELETE_IN_PROGRESS and INSERT_IN_PROGRESS for rows that have been  
inserted in the current transaction and deleted in a aborted  
subtransaction of the current backend. At the very least that caused  
problems for CLUSTER and CREATE INDEX in transactions that had  
aborting subtransactions producing rows, leading to warnings like:  
WARNING:  concurrent delete in progress within table "..."  
possibly in an endless, uninterruptible, loop.  
  
Instead of treating *InProgress xmins the same as *IsCurrent ones,  
treat them as being distinct like the other visibility routines. As  
implemented this separatation can cause a behaviour change for rows  
that have been inserted and deleted in another, still running,  
transaction. HTSV will now return INSERT_IN_PROGRESS instead of  
DELETE_IN_PROGRESS for those. That's both, more in line with the other  
visibility routines and arguably more correct. The latter because a  
INSERT_IN_PROGRESS will make callers look at/wait for xmin, instead of  
xmax.  
The only current caller where that's possibly worse than the old  
behaviour is heap_prune_chain() which now won't mark the page as  
prunable if a row has concurrently been inserted and deleted. That's  
harmless enough.  
  
As a cautionary measure also insert a interrupt check before the gotos  
in IndexBuildHeapScan() that lead to the uninterruptible loop. There  
are other possible causes, like a row that several sessions try to  
update and all fail, for repeated loops and the cost of doing so in  
the retry case is low.  
  
As this bug goes back all the way to the introduction of  
subtransactions in 573a71a5da backpatch to all supported releases.  
  
Reported-By: Sandro Santilli  

M src/backend/catalog/index.c
M src/backend/utils/time/tqual.c

Add description of pg_stat directory into doc.

commit   : c8c9c1f5a3fcd2db0f94d3126e142dee91c53632    
  
author   : Fujii Masao <[email protected]>    
date     : Thu, 5 Jun 2014 01:43:17 +0900    
  
committer: Fujii Masao <[email protected]>    
date     : Thu, 5 Jun 2014 01:43:17 +0900    

Click here for diff

Back-patch to 9.3 where pg_stat directory was introduced.  

M doc/src/sgml/monitoring.sgml
M doc/src/sgml/storage.sgml

Save pg_stat_statements statistics file into $PGDATA/pg_stat directory at shutdown.

commit   : 654e8e444749f053c3bf3fd543d10deb6aa6dd09    
  
author   : Fujii Masao <[email protected]>    
date     : Wed, 4 Jun 2014 12:09:45 +0900    
  
committer: Fujii Masao <[email protected]>    
date     : Wed, 4 Jun 2014 12:09:45 +0900    

Click here for diff

187492b6c2e8cafc5b39063ca3b67846e8155d24 changed pgstat.c so that  
the stats files were saved into $PGDATA/pg_stat directory when the server  
was shutdowned. But it accidentally forgot to change the location of  
pg_stat_statements permanent stats file. This commit fixes pg_stat_statements  
so that its stats file is also saved into $PGDATA/pg_stat at shutdown.  
  
Since this fix changes the file layout, we don't back-patch it to 9.3  
where this oversight was introduced.  

M contrib/pg_stat_statements/pg_stat_statements.c
M src/backend/postmaster/pgstat.c
M src/include/pgstat.h

Silence Bison deprecation warnings

commit   : 55fb759ab3e7543a6be72a35e6b6961455c5b393    
  
author   : Peter Eisentraut <[email protected]>    
date     : Tue, 3 Jun 2014 22:36:35 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Tue, 3 Jun 2014 22:36:35 -0400    

Click here for diff

Bison >=3.0 issues warnings about  
  
    %name-prefix="base_yy"  
  
instead of the now preferred  
  
    %name-prefix "base_yy"  
  
but the latter doesn't work with Bison 2.3 or less.  So for now we  
silence the deprecation warnings.  

M config/programs.m4
M configure

Use EncodeDateTime instead of to_char to render JSON timestamps.

commit   : ab14a73a6ca5cc4750f0e00a48bdc25a2293034a    
  
author   : Andrew Dunstan <[email protected]>    
date     : Tue, 3 Jun 2014 18:26:47 -0400    
  
committer: Andrew Dunstan <[email protected]>    
date     : Tue, 3 Jun 2014 18:26:47 -0400    

Click here for diff

Per gripe from Peter Eisentraut and Tom Lane.  
  
The output is slightly different, but still ISO 8601 compliant: to_char  
doesn't output the minutes when time zone offset is an integer number of  
hours, while EncodeDateTime outputs ":00".  
  
The code is slightly adapted from code in xml.c  

M src/backend/utils/adt/json.c
M src/test/regress/expected/json.out
M src/test/regress/expected/json_1.out

Do not escape a unicode sequence when escaping JSON text.

commit   : 0ad1a816320a2b539a51628e2a0b1e83ff096b1d    
  
author   : Andrew Dunstan <[email protected]>    
date     : Tue, 3 Jun 2014 16:11:31 -0400    
  
committer: Andrew Dunstan <[email protected]>    
date     : Tue, 3 Jun 2014 16:11:31 -0400    

Click here for diff

Previously, any backslash in text being escaped for JSON was doubled so  
that the result was still valid JSON. However, this led to some perverse  
results in the case of Unicode sequences, These are now detected and the  
initial backslash is no longer escaped. All other backslashes are  
still escaped. No validity check is performed, all that is looked for is  
\uXXXX where X is a hexidecimal digit.  
  
This is a change from the 9.2 and 9.3 behaviour as noted in the Release  
notes.  
  
Per complaint from Teodor Sigaev.  

M doc/src/sgml/release-9.4.sgml
M src/backend/utils/adt/json.c
M src/test/regress/expected/json.out
M src/test/regress/expected/json_1.out
M src/test/regress/expected/jsonb.out
M src/test/regress/expected/jsonb_1.out
M src/test/regress/sql/json.sql

Output timestamps in ISO 8601 format when rendering JSON.

commit   : f30015b6d794c15d52abbb3df3a65081fbefb1ed    
  
author   : Andrew Dunstan <[email protected]>    
date     : Tue, 3 Jun 2014 13:56:53 -0400    
  
committer: Andrew Dunstan <[email protected]>    
date     : Tue, 3 Jun 2014 13:56:53 -0400    

Click here for diff

Many JSON processors require timestamp strings in ISO 8601 format in  
order to convert the strings. When converting a timestamp, with or  
without timezone, to a JSON datum we therefore now use such a format  
rather than the type's default text output, in functions such as  
to_json().  
  
This is a change in behaviour from 9.2 and 9.3, as noted in the release  
notes.  

M doc/src/sgml/release-9.4.sgml
M src/backend/utils/adt/json.c
M src/test/regress/expected/json.out
M src/test/regress/expected/json_1.out
M src/test/regress/sql/json.sql

Make plpython_unicode regression test work in more database encodings.

commit   : 2dfa15de5510b3c19ffb92b512c39d5440a07b1e    
  
author   : Tom Lane <[email protected]>    
date     : Tue, 3 Jun 2014 12:01:27 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Tue, 3 Jun 2014 12:01:27 -0400    

Click here for diff

This test previously used a data value containing U+0080, and would  
therefore fail if the database encoding didn't have an equivalent to  
that; which only about half of our supported server encodings do.  
We could fall back to using some plain-ASCII character, but that seems  
like it's losing most of the point of the test.  Instead switch to using  
U+00A0 (no-break space), which translates into all our supported encodings  
except the four in the EUC_xx family.  
  
Per buildfarm testing.  Back-patch to 9.1, which is as far back as this  
test is expected to succeed everywhere.  (9.0 has the test, but without  
back-patching some 9.1 code changes we could not expect to get consistent  
results across platforms anyway.)  

M src/pl/plpython/expected/plpython_unicode.out
M src/pl/plpython/sql/plpython_unicode.sql

Set the process latch when processing recovery conflict interrupts.

commit   : 44445b28d265fe91fea3da47bd3a8c4007ce87e5    
  
author   : Andres Freund <[email protected]>    
date     : Tue, 3 Jun 2014 14:02:54 +0200    
  
committer: Andres Freund <[email protected]>    
date     : Tue, 3 Jun 2014 14:02:54 +0200    

Click here for diff

Because RecoveryConflictInterrupt() didn't set the process latch  
anything using the latter to wait for events didn't get notified about  
recovery conflicts. Most latch users are never the target of recovery  
conflicts, which explains the lack of reports about this until  
now.  
Since 9.3 two possible affected users exist though: The sql callable  
pg_sleep() now uses latches to wait and background workers are  
expected to use latches in their main loop. Both would currently wait  
until the end of WaitLatch's timeout.  
  
Fix by adding a SetLatch() to RecoveryConflictInterrupt(). It'd also  
be possible to fix the issue by having each latch user set  
set_latch_on_sigusr1. That seems failure prone and though, as most of  
these callsites won't often receive recovery conflicts and thus will  
likely only be tested against normal query cancels et al. It'd also be  
unnecessarily verbose.  
  
Backpatch to 9.1 where latches were introduced. Arguably 9.3 would be  
sufficient, because that's where pg_sleep() was converted to waiting  
on the latch and background workers got introduced; but there could be  
user level code making use of the latch pre 9.3.  

M src/backend/tcop/postgres.c

Use unaligned output in another regression test query to reduce diff noise.

commit   : 5eebb8d954adf9d600b1a157682539db1e8a3ada    
  
author   : Andres Freund <[email protected]>    
date     : Tue, 3 Jun 2014 12:19:18 +0200    
  
committer: Andres Freund <[email protected]>    
date     : Tue, 3 Jun 2014 12:19:18 +0200    

Click here for diff

Use the unaligned/no rowcount output mode in a regression tests that  
shows all built-in leakproof functions. Currently a new leakproof  
function will often change the alignment of all existing functions,  
making it hard to see the actual difference and creating unnecessary  
patch conflicts.  
  
Noticed while looking over a patch introducing new leakproof functions.  

M src/test/regress/expected/create_function_3.out
M src/test/regress/sql/create_function_3.sql

doc: fix JSON function prototype variable label

commit   : 19c9da1d9654cbfd95bae26caff497d78277fb6e    
  
author   : Bruce Momjian <[email protected]>    
date     : Mon, 2 Jun 2014 16:18:45 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Mon, 2 Jun 2014 16:18:45 -0400    

Click here for diff

from_jsonb -> from_json, for consistency  
  
Patch by rudolf (private report)  

M doc/src/sgml/func.sgml

Improve the efficiency of certain jsonb get operations.

commit   : 1a4174a498a15a848d4c4c50a3a9ef500926e4bd    
  
author   : Andrew Dunstan <[email protected]>    
date     : Sun, 1 Jun 2014 19:04:02 -0400    
  
committer: Andrew Dunstan <[email protected]>    
date     : Sun, 1 Jun 2014 19:04:02 -0400    

Click here for diff

Instead of iterating over jsonb structures, use the inbuilt functions  
findJsonbValueFromContainerLen() and getIthJsonbValueFromContainer() to  
extract values directly. These functions use algorithms that are O(n log  
n) and O(1) respectively, whereas iterating is O(n), so we should see  
considerable speedup here.  
  
Teodor Sigaev.  

M src/backend/utils/adt/jsonfuncs.c

Improvements to the replication protocol documentation.

commit   : a57509821c3147b2bf57560e3bce1641d78a7519    
  
author   : Andres Freund <[email protected]>    
date     : Sat, 31 May 2014 15:58:04 +0200    
  
committer: Andres Freund <[email protected]>    
date     : Sat, 31 May 2014 15:58:04 +0200    

Click here for diff

Document the CREATE_REPLICATION_SLOT's output_plugin parameter; that  
START_REPLICATION ... LOGICAL takes parameters; that START_REPLICATION  
... LOGICAL uses the same messages as ... PHYSICAL; and be more  
consistent with the usage of <literal/>.  
  
Michael Paquier, with some additional changes by me.  

M doc/src/sgml/protocol.sgml

commit   : 20561acf93d32b7d7fdd59d054344b2e341d6aa0    
  
author   : Tom Lane <[email protected]>    
date     : Fri, 30 May 2014 18:18:11 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Fri, 30 May 2014 18:18:11 -0400    

Click here for diff

As of Xcode 5.0, Apple isn't including the Python framework as part of the  
SDK-level files, which means that linking to it might fail depending on  
whether Xcode thinks you've selected a specific SDK version.  According to  
their Tech Note 2328, they've basically deprecated the framework method of  
linking to libpython and are telling people to link to the shared library  
normally.  (I'm pretty sure this is in direct contradiction to the advice  
they were giving a few years ago, but whatever.)  Testing says that this  
approach works fine at least as far back as OS X 10.4.11, so let's just  
rip out the framework special case entirely.  We do still need a special  
case to decide that OS X provides a shared library at all, unfortunately  
(I wonder why the distutils check doesn't work ...).  But this is still  
less of a special case than before, so it's fine.  
  
Back-patch to all supported branches, since we'll doubtless be hearing  
about this more as more people update to recent Xcode.  

M config/python.m4
M configure
M src/pl/plpython/Makefile

Fix typos in MSVC solution file.

commit   : 512f3b03e3cddf7dc1901c0e062500133e534c1d    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Fri, 30 May 2014 10:27:40 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Fri, 30 May 2014 10:27:40 +0300    

Click here for diff

Michael Paquier  

M src/tools/msvc/Solution.pm

In release notes, mention the need to initialize bgw_notify_pid.

commit   : 42be7d6923e52a8c1ceb549c0931ac43a4954b86    
  
author   : Robert Haas <[email protected]>    
date     : Thu, 29 May 2014 23:33:49 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Thu, 29 May 2014 23:33:49 -0400    

Click here for diff

Michael Paquier  

M doc/src/sgml/release-9.4.sgml

When using the OSSP UUID library, cache its uuid_t state object.

commit   : c941aed96b482e32dc3a8eba66b298824e7adc39    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 29 May 2014 13:51:02 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 29 May 2014 13:51:02 -0400    

Click here for diff

The original coding in contrib/uuid-ossp created and destroyed a uuid_t  
object (or, in some cases, even two of them) each time it was called.  
This is not the intended usage: you're supposed to keep the uuid_t object  
around so that the library can cache its state across uses.  (Other UUID  
libraries seem to keep equivalent state behind-the-scenes in static  
variables, but OSSP chose differently.)  Aside from being quite inefficient,  
creating a new uuid_t loses knowledge of the previously generated UUID,  
which in theory could result in duplicate V1-style UUIDs being created  
on sufficiently fast machines.  
  
On at least some platforms, creating a new uuid_t also draws some entropy  
from /dev/urandom, leaving less for the rest of the system.  This seems  
sufficiently unpleasant to justify back-patching this change.  

M contrib/uuid-ossp/uuid-ossp.c

Fix uuid-ossp regression tests based on buildfarm feedback.

commit   : 25dd07e0f6ba1aef0a6802474112b5bcce621ea4    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 28 May 2014 23:15:51 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 28 May 2014 23:15:51 -0400    

Click here for diff

The previous version of these tests expected uuid_generate_v1() to always  
emit MAC addresses with the local-admin and multicast address bits zero.  
However, several of the buildfarm critters are reporting values with the  
local-admin bit set.  (Perhaps they're running inside VMs or jails.)  
And a couple are reporting values with the multicast bit set, probably  
meaning that the UUID library couldn't read the system MAC address.  
  
Also, it emerges that if OSSP UUID can't read the system MAC address, it  
falls back to V1MC behavior wherein the whole node field gets randomized  
each time, breaking the test that expected the node field to remain stable  
in V1 output.  (It looks like e2fs doesn't behave that way, though.)  
  
It's not entirely clear why we can't get a system MAC address, since the  
buildfarm scripts would not work without internet access.  Nonetheless,  
the regression tests had better cope with the case, so adjust the tests  
to expect these behaviors.  

M contrib/uuid-ossp/expected/uuid_ossp.out
M contrib/uuid-ossp/sql/uuid_ossp.sql

Revert "Fix bogus %name-prefix option syntax in all our Bison files."

commit   : 71ed8b3ca76cd720f4013c3c20f0d2706583ab9a    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 28 May 2014 19:21:01 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 28 May 2014 19:21:01 -0400    

Click here for diff

This reverts commit 45b7abe59e9485657ac9380f35d2d917dd0da25b.  
  
It turns out that the %name-prefix syntax without "=" does not work  
at all in pre-2.4 Bison.  We are not prepared to make such a large  
jump in minimum required Bison version just to suppress a warning  
message in a version hardly any developers are using yet.  
When 3.0 gets more popular, we'll figure out a way to deal with this.  
In the meantime, BISONFLAGS=-Wno-deprecated is recommendable for  
anyone using 3.0 who doesn't want to see the warning.  

M contrib/cube/cubeparse.y
M contrib/seg/segparse.y
M src/backend/bootstrap/bootparse.y
M src/backend/parser/gram.y
M src/backend/replication/repl_gram.y
M src/interfaces/ecpg/preproc/ecpg.header
M src/pl/plpgsql/src/pl_gram.y
M src/test/isolation/specparse.y

Don't pay heed to wal_sender_timeout while creating a decoding slot.

commit   : 21d48d66c8be053ef5ce0474bb30f8a91b7c3dd6    
  
author   : Andres Freund <[email protected]>    
date     : Thu, 29 May 2014 00:32:09 +0200    
  
committer: Andres Freund <[email protected]>    
date     : Thu, 29 May 2014 00:32:09 +0200    

Click here for diff

Sometimes CREATE_REPLICATION_SLOT ... LOGICAL ... needs to wait for  
further WAL using WalSndWaitForWal(). That used to always respect  
wal_sender_timeout and kill the session when waiting long enough  
because no feedback/ping messages can be sent while the slot is still  
being created.  
Introduce the notion that last_reply_timestamp = 0 means that the  
walsender currently doesn't need timeout processing to avoid that  
problem. Use that notion for CREATE_REPLICATION_SLOT ... LOGICAL.  
  
Bugreport and initial patch by Steve Singer, revised by me.  

M src/backend/replication/walsender.c

Minor refactoring of jsonb_util.c

commit   : d1d50bff247f189a6a1477596cdbd52d097089a0    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Wed, 28 May 2014 23:44:31 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Wed, 28 May 2014 23:44:31 +0300    

Click here for diff

The only caller of compareJsonbScalarValue that needed locale-sensitive  
comparison of strings was also the only caller that didn't just check for  
equality. Separate the two cases for clarity: compareJsonbScalarValue now  
does locale-sensitive comparison, and a new function,  
equalsJsonbScalarValue, just checks for equality.  

M src/backend/utils/adt/jsonb_util.c

Jsonb comparison bug fixes.

commit   : b3e5cfd5f979054e31d60adafd9e75bf9c38549a    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Wed, 28 May 2014 22:47:04 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Wed, 28 May 2014 22:47:04 +0300    

Click here for diff

Fix an over-zealous assertion, which didn't take into account that sometimes  
a scalar element can be compared against an array/object element.  
  
Avoid comparing possibly-uninitialized local variables when end-of-array or  
end-of-object is reached. Also fix and enhance comments a bit.  
  
Peter Geoghegan, per reports by Pavel Stehule and me.  

M src/backend/utils/adt/jsonb_util.c

Fix bogus %name-prefix option syntax in all our Bison files.

commit   : 45b7abe59e9485657ac9380f35d2d917dd0da25b    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 28 May 2014 15:41:53 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 28 May 2014 15:41:53 -0400    

Click here for diff

%name-prefix doesn't use an "=" sign according to the Bison docs, but it  
silently accepted one anyway, until Bison 3.0.  This was originally a  
typo of mine in commit 012abebab1bc72043f3f670bf32e91ae4ee04bd2, and we  
seem to have slavishly copied the error into all the other grammar files.  
  
Per report from Vik Fearing; analysis by Peter Eisentraut.  
  
Back-patch to all active branches, since somebody might try to build  
a back branch with up-to-date tools.  

M contrib/cube/cubeparse.y
M contrib/seg/segparse.y
M src/backend/bootstrap/bootparse.y
M src/backend/parser/gram.y
M src/backend/replication/repl_gram.y
M src/interfaces/ecpg/preproc/ecpg.header
M src/pl/plpgsql/src/pl_gram.y
M src/test/isolation/specparse.y

Improve regression tests for uuid-ossp.

commit   : c0f27628d2fb53e8e5d190da2132739a2bb2f500    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 28 May 2014 14:21:17 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 28 May 2014 14:21:17 -0400    

Click here for diff

On reflection, the timestamp-advances test might fail if we're unlucky  
enough for the time_mid field to change between two calls, since uuid_cmp  
is just bytewise comparison and the field ordering has more significant  
fields later.  Build some field extraction functions so we can do a more  
honest test of that.  Also check that the version and reserved fields  
contain what they should.  

M contrib/uuid-ossp/expected/uuid_ossp.out
M contrib/uuid-ossp/sql/uuid_ossp.sql

Fix stack clobber in new uuid-ossp code.

commit   : 2103218dd4a0c6a44d05c09c066da20e1c2360fb    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 28 May 2014 11:50:41 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 28 May 2014 11:50:41 -0400    

Click here for diff

The V5 (SHA1 hashing) code wrote 20 bytes into a 16-byte local variable.  
This had accidentally failed to fail in my testing and Matteo's, but  
buildfarm results exposed the problem.  

M contrib/uuid-ossp/uuid-ossp.c

Ensure cleanup in case of early errors in streaming base backups

commit   : 8232d6df4c943a30c08e65d7ea893cb762bc5612    
  
author   : Magnus Hagander <[email protected]>    
date     : Wed, 28 May 2014 12:40:45 +0200    
  
committer: Magnus Hagander <[email protected]>    
date     : Wed, 28 May 2014 12:40:45 +0200    

Click here for diff

Move the code that sends the initial status information as well as the  
calculation of paths inside the ENSURE_ERROR_CLEANUP block. If this code  
failed, we would "leak" a counter of number of concurrent backups, thereby  
making the system always believe it was in backup mode. This could happen  
if the sending failed (which it probably never did given that the small  
amount of data to send would never cause a flush) or if the psprintf calls  
ran out of memory. Both are very low risk, but all operations after  
do_pg_start_backup should be protected.  

M src/backend/replication/basebackup.c

doc: improve markup of ssl_ecdh_curve commit

commit   : c676315658973390c5550d73d3bb1fb7b92720b5    
  
author   : Bruce Momjian <[email protected]>    
date     : Wed, 28 May 2014 06:27:01 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Wed, 28 May 2014 06:27:01 -0400    

Click here for diff

M doc/src/sgml/config.sgml

pg_lsn should not be marked typispreferred.

commit   : ec3357a3bc37d9108b2cf2db96499f83f1a93df1    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 28 May 2014 00:26:46 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 28 May 2014 00:26:46 -0400    

Click here for diff

In general it's not a good idea for built-in types in the 'U' category  
to be marked preferred; they could draw behavior away from user-defined  
types with similarly-named operators.  pg_lsn is probably at low risk  
of that right now given the lack of casts between it and other types,  
but that doesn't make this marking OK.  
  
Ordinarily we'd bump catversion when changing any predefined catalog  
contents like this, but since we're past beta1, the costs of a forced  
initdb seem to outweigh the benefits of guaranteed behavioral consistency.  
There's not any known behavioral impact today anyway --- this is more  
in the nature of being sure there's not problems in future.  
  
Per an off-list complaint from Thomas Fanghaenel.  

M src/include/catalog/pg_type.h

Fix obsolete config-module-exclusion logic in vcregress.pl.

commit   : 8600031147cee7845e1ad9e64304e1f5fe585515    
  
author   : Tom Lane <[email protected]>    
date     : Tue, 27 May 2014 22:31:21 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Tue, 27 May 2014 22:31:21 -0400    

Click here for diff

The recent addition of regression tests to uuid-ossp exposed the fact  
that the MSVC build system wasn't being consistent about whether it was  
building/testing that contrib module, ie, it would try to test the module  
even when it hadn't built it.  The same hazard was latent for sslinfo.  
  
For the moment I just copied the more up-to-date logic from point A to  
point B, but this is screaming for refactoring.  
  
Per buildfarm results.  

M src/tools/msvc/Install.pm
M src/tools/msvc/vcregress.pl

Propagate system identifier generation improvement into pg_resetxlog.

commit   : 4bcb3946249cbeed157ffd545a804913cfce749b    
  
author   : Tom Lane <[email protected]>    
date     : Tue, 27 May 2014 22:01:13 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Tue, 27 May 2014 22:01:13 -0400    

Click here for diff

Commit 5035701e07e8bd395aa878465a102afd7b74e8c3 improved xlog.c's method  
for creating a database system identifier, but I neglected to fix the  
copy of that code appearing in pg_resetxlog.c.  Spotted by Andres Freund.  

M src/bin/pg_resetxlog/pg_resetxlog.c

doc: improve ssl_ecdh_curve descriptions

commit   : 49cf2cd815d61e1399fe46f9532347f09c3ed2f9    
  
author   : Bruce Momjian <[email protected]>    
date     : Tue, 27 May 2014 21:30:20 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Tue, 27 May 2014 21:30:20 -0400    

Click here for diff

Patch by Marko Kreen  

M doc/src/sgml/config.sgml
M doc/src/sgml/release-9.4.sgml

Support BSD and e2fsprogs UUID libraries alongside OSSP UUID library.

commit   : b8cc8f94730610c0189aa82dfec4ae6ce9b13e34    
  
author   : Tom Lane <[email protected]>    
date     : Tue, 27 May 2014 19:42:08 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Tue, 27 May 2014 19:42:08 -0400    

Click here for diff

Allow the contrib/uuid-ossp extension to be built atop any one of these  
three popular UUID libraries.  (The extension's name is now arguably a  
misnomer, but we'll keep it the same so as not to cause unnecessary  
compatibility issues for users.)  
  
We would not normally consider a change like this post-beta1, but the issue  
has been forced by our upgrade to autoconf 2.69, whose more rigorous header  
checks are causing OSSP's header files to be rejected on some platforms.  
It's been foreseen for some time that we'd have to move away from depending  
on OSSP UUID due to lack of upstream maintenance, so this is a down payment  
on that problem.  
  
While at it, add some simple regression tests, in hopes of catching any  
major incompatibilities between the three implementations.  
  
Matteo Beccati, with some further hacking by me  

M configure
M configure.in
M contrib/Makefile
A contrib/uuid-ossp/.gitignore
M contrib/uuid-ossp/Makefile
A contrib/uuid-ossp/expected/uuid_ossp.out
A contrib/uuid-ossp/sql/uuid_ossp.sql
M contrib/uuid-ossp/uuid-ossp.c
M doc/src/sgml/installation.sgml
M doc/src/sgml/uuid-ossp.sgml
M src/Makefile.global.in
M src/include/pg_config.h.in

worker_spi: Initialize bgw_notify_pid in all cases.

commit   : 616afee14d7e8d6690286aaf8a2a0a01168c378a    
  
author   : Robert Haas <[email protected]>    
date     : Mon, 26 May 2014 22:56:28 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Mon, 26 May 2014 22:56:28 -0400    

Click here for diff

Commit 090d0f2050647958865cb495dff74af7257d2bb4 added new code showing  
how it can be useful to set bgw_notify_pid to a non-zero value, but it  
failed to make sure that the existing call to RegisterBackgroundWorker  
initialized the new field at all.  
  
Report and patch by Shigeru Hanada.  

M contrib/worker_spi/worker_spi.c

Avoid unportable usage of sscanf(UINT64_FORMAT).

commit   : 9d7ded0f4277f5c0063eca8e871a34e2355a8371    
  
author   : Tom Lane <[email protected]>    
date     : Mon, 26 May 2014 22:23:29 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Mon, 26 May 2014 22:23:29 -0400    

Click here for diff

On Mingw, it seems that scanf() doesn't necessarily accept the same format  
codes that printf() does, and in particular it may fail to recognize %llu  
even though printf() does.  Since configure only probes printf() behavior  
while setting up the INT64_FORMAT macros, this means it's unsafe to use  
those macros with scanf().  We had only one instance of such a coding  
pattern, in contrib/pg_stat_statements, so change that code to avoid  
the problem.  
  
Per buildfarm warnings.  Back-patch to 9.0 where the troublesome code  
was introduced.  
  
Michael Paquier  

M contrib/pg_stat_statements/pg_stat_statements.c

Fix pg_recvlogical to accept the documented -I instead only --startpos.

commit   : bf2e70ba6c0175e5a676b6aa37e49915d8918a63    
  
author   : Andres Freund <[email protected]>    
date     : Sun, 25 May 2014 18:47:05 +0200    
  
committer: Andres Freund <[email protected]>    
date     : Sun, 25 May 2014 18:47:05 +0200    

Click here for diff

The bug was caused by omitting 'I:' from the short argument list to  
getopt_long(). To make similar bugs in the future less likely reorder  
options in --help, long and short option lists to be in the same,  
alphabetical within groups, order.  
  
Report and fix by Michael Paquier, some additional reordering by me.  

M src/bin/pg_basebackup/pg_recvlogical.c

Small typo and formatting fixes in postgresql.conf.sample

commit   : 0a5faaa90718b0ce259f43bfae8d629cc040a67c    
  
author   : Peter Eisentraut <[email protected]>    
date     : Sun, 25 May 2014 23:20:15 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Sun, 25 May 2014 23:20:15 -0400    

Click here for diff

M src/backend/utils/misc/postgresql.conf.sample

Fix error when trying to delete page with half-dead left sibling.

commit   : 8da31837803e95f26642019d859c3309d1c125fa    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Sun, 25 May 2014 18:15:04 -0400    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Sun, 25 May 2014 18:15:04 -0400    

Click here for diff

The new page deletion code didn't cope with the case the target page's  
right sibling was marked half-dead. It failed a sanity check which checked  
that the downlinks in the parent page match the lower level, because a  
half-dead page has no downlink. To cope, check for that condition, and  
just give up on the deletion if it happens. The vacuum will finish the  
deletion of the half-dead page when it gets there, and on the next vacuum  
after that the empty can be deleted.  
  
Reported by Jeff Janes.  

M src/backend/access/nbtree/nbtpage.c

Allow total number of transactions in pgbench to exceed INT_MAX.

commit   : 9a65fb350717360c505de9df411024d47e55710b    
  
author   : Tom Lane <[email protected]>    
date     : Sun, 25 May 2014 16:33:29 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Sun, 25 May 2014 16:33:29 -0400    

Click here for diff

Change the total-transactions counters from int32 to int64 to accommodate  
cases where we do more than 2^31 transactions during a run.  This patch  
does not change the INT_MAX limit on explicit "-t" parameters, but it  
does allow the product of the -t and -c parameters to exceed INT_MAX, or  
allow a -T limit that is large enough that more than 2^31 transactions  
can be completed.  While pgbench did not actually fail in such cases,  
it did print an incorrect total-transactions count, and some of the  
derived numbers such as TPS would have been wrong as well.  
  
Tomas Vondra  

M contrib/pgbench/pgbench.c

Don't allocate memory inside an Assert() iff in a critical section.

commit   : 9fa93530c878a0e23147a65f7d9a62802b22a995    
  
author   : Andres Freund <[email protected]>    
date     : Sun, 25 May 2014 01:37:52 +0200    
  
committer: Andres Freund <[email protected]>    
date     : Sun, 25 May 2014 01:37:52 +0200    

Click here for diff

HeapTupleHeaderGetCmax() asserts that it is only used if the tuple has  
been updated by the current transaction. That check is correct and  
sensible but requires allocating memory if xmax is a multixact. When  
wal_level is set to logical cmax needs to be included in a wal record  
, generated inside a critical section, which can trigger the assertion  
added in 4a170ee9e.  
  
Reported-By: Steve Singer  

M src/backend/utils/time/combocid.c

Silence a couple of spurious valgrind warnings in inval.c.

commit   : 0564bbe7a1690f025f4424d5a12cb6af9d428c48    
  
author   : Andres Freund <[email protected]>    
date     : Wed, 7 May 2014 22:30:05 +0200    
  
committer: Andres Freund <[email protected]>    
date     : Wed, 7 May 2014 22:30:05 +0200    

Click here for diff

Define padding bytes in SharedInvalidationMessage structs to be  
defined. Otherwise the sinvaladt.c ringbuffer, which is accessed by  
multiple processes, will cause spurious valgrind warnings about  
undefined memory being used. That's because valgrind remembers the  
undefined bytes from the last local process's store, not realizing  
that another process has written since, filling the previously  
uninitialized bytes.  

M src/backend/utils/cache/inval.c

doc: link/caps fixes for 9.4 release notes

commit   : 37828e87aec2eb0c15655d4ad753644be851e59f    
  
author   : Bruce Momjian <[email protected]>    
date     : Fri, 23 May 2014 15:05:31 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Fri, 23 May 2014 15:05:31 -0400    

Click here for diff

Report by Tomonari Katsumata  

M doc/src/sgml/release-9.4.sgml

Fix misc typos in comments.

commit   : 57b7e83b0d5e192c01e261b76ff0ed0ccd73c37c    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Fri, 23 May 2014 08:16:09 -0400    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Fri, 23 May 2014 08:16:09 -0400    

Click here for diff

M src/backend/replication/logical/logical.c
M src/backend/storage/ipc/procarray.c

Remove unnecessary cleanup code.

commit   : 11ad3b35c25de6edcaa8a7695cb1d58650c546d3    
  
author   : Robert Haas <[email protected]>    
date     : Thu, 22 May 2014 10:40:00 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Thu, 22 May 2014 10:40:00 -0400    

Click here for diff

This is all inside a block guarded by op == DSM_OP_ATTACH, so it can  
never be the case that op == DSM_OP_CREATE.  
  
Reported by Coverity.  

M src/backend/storage/ipc/dsm_impl.c

Fix typo in comment.

commit   : 06db9cce22efeb2a2cffa69491dd576adb77b655    
  
author   : Fujii Masao <[email protected]>    
date     : Thu, 22 May 2014 16:31:55 +0900    
  
committer: Fujii Masao <[email protected]>    
date     : Thu, 22 May 2014 16:31:55 +0900    

Click here for diff

Erik Rijkers  

M src/include/utils/jsonb.h

Fix typos in comments.

commit   : 19a683f69f4bc630ee04f2938e13e46397eb7a2d    
  
author   : Fujii Masao <[email protected]>    
date     : Thu, 22 May 2014 12:43:50 +0900    
  
committer: Fujii Masao <[email protected]>    
date     : Thu, 22 May 2014 12:43:50 +0900    

Click here for diff

M src/backend/replication/walsender.c

Fix typos in comments.

commit   : 51f41e8c0a0b9ce00734ed4702d16601cc55c280    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Wed, 21 May 2014 23:18:38 -0400    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Wed, 21 May 2014 23:18:38 -0400    

Click here for diff

M src/backend/storage/ipc/standby.c
M src/backend/utils/adt/formatting.c

doc: add ALTER TABLE lock level item as major 9.4 item

commit   : 2e1b5d3f014206f6bdf3dc48d50ecec9dee10fd6    
  
author   : Bruce Momjian <[email protected]>    
date     : Wed, 21 May 2014 15:49:44 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Wed, 21 May 2014 15:49:44 -0400    

Click here for diff

Report by Simon Riggs  

M doc/src/sgml/release-9.4.sgml

Fix spurious tab character

commit   : e12d7320ca494fd05134847e300feedb2d4a5969    
  
author   : Peter Eisentraut <[email protected]>    
date     : Wed, 21 May 2014 08:00:39 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Wed, 21 May 2014 08:00:39 -0400    

Click here for diff

M src/interfaces/ecpg/preproc/ecpg.trailer

doc: 9.4 release notes update for pg_bench line limit item

commit   : 6a61308fba6f474c840192052bca8c86df95927c    
  
author   : Bruce Momjian <[email protected]>    
date     : Tue, 20 May 2014 14:10:09 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Tue, 20 May 2014 14:10:09 -0400    

Click here for diff

Report by David Johnston  

M doc/src/sgml/release-9.4.sgml

Prevent auto_explain from changing the output of a user's EXPLAIN.

commit   : e416830a296f440acd67afd8599dde5411021fc4    
  
author   : Tom Lane <[email protected]>    
date     : Tue, 20 May 2014 12:20:47 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Tue, 20 May 2014 12:20:47 -0400    

Click here for diff

Commit af7914c6627bcf0b0ca614e9ce95d3f8056602bf, which introduced the  
EXPLAIN (TIMING) option, for some reason coded explain.c to look at  
planstate->instrument->need_timer rather than es->timing to decide  
whether to print timing info.  However, the former flag might get set  
as a result of contrib/auto_explain wanting timing information.  We  
certainly don't want activation of auto_explain to change user-visible  
statement behavior, so fix that.  
  
Also fix an independent bug introduced in the same patch: in the code  
path for a never-executed node with a machine-friendly output format,  
if timing was selected, it would fail to print the Actual Rows and Actual  
Loops items.  
  
Per bug #10404 from Tomonari Katsumata.  Back-patch to 9.2 where the  
faulty code was introduced.  

M src/backend/commands/explain.c

Update obsolete comment.

commit   : a0841ecd2518d4505b96132b764b918ab5d21ad4    
  
author   : Tom Lane <[email protected]>    
date     : Mon, 19 May 2014 16:38:49 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Mon, 19 May 2014 16:38:49 -0400    

Click here for diff

Peter Geoghegan  

M src/backend/utils/adt/jsonb_util.c

Fix typo in JSON function document.

commit   : f097d70b7227c1f9aa2ed0af1d6deb05367ef657    
  
author   : Fujii Masao <[email protected]>    
date     : Mon, 19 May 2014 20:41:41 +0900    
  
committer: Fujii Masao <[email protected]>    
date     : Mon, 19 May 2014 20:41:41 +0900    

Click here for diff

M doc/src/sgml/func.sgml

Message style fixes to pg_recvlogical

commit   : 4e92f780123ca862970816d3fa70d3baf2fcbea4    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Mon, 19 May 2014 14:15:21 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Mon, 19 May 2014 14:15:21 +0300    

Click here for diff

Lowercase help statements. Use an existing message to reduce the number  
of strings to be translated.  
  
Euler Taveira  

M src/bin/pg_basebackup/pg_recvlogical.c

Fix backup-block numbering in redo of b-tree split.

commit   : c91a9b5a285e20e54cf90f3660ce51ce3a5c2ef4    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Mon, 19 May 2014 13:16:24 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Mon, 19 May 2014 13:16:24 +0300    

Click here for diff

I got the backup block numbers off-by-one in the commit that changed the  
way incomplete-splits are handled. I blame the comments, which said  
"backup block 1" and "backup block 2", even though the backup blocks  
are numbered starting from 0, in the macros and functions used in replay.  
Fix the comments and the code.  
  
Per Jeff Janes' bug report about corruption caused by torn page writes.  
The incorrect code is new in git master, but backpatch the comment change  
down to 9.0, where the numbering in the redo-side macros  was changed.  

M src/backend/access/nbtree/nbtinsert.c
M src/backend/access/nbtree/nbtxlog.c

Fix incorrect column name in pg_stat_replication document.

commit   : eb56812144bb310f7cb2f63e53d6d58f30df95b5    
  
author   : Fujii Masao <[email protected]>    
date     : Mon, 19 May 2014 17:03:30 +0900    
  
committer: Fujii Masao <[email protected]>    
date     : Mon, 19 May 2014 17:03:30 +0900    

Click here for diff

Fabrízio de Royes Mello  

M doc/src/sgml/monitoring.sgml

doc: adjust JSONB 9.4 release note item

commit   : 009ca5e7821d742ed118a87c756c857895f3ffdd    
  
author   : Bruce Momjian <[email protected]>    
date     : Mon, 19 May 2014 00:47:45 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Mon, 19 May 2014 00:47:45 -0400    

Click here for diff

Report by Andrew Dunstan  

M doc/src/sgml/release-9.4.sgml

doc: 9.4 release note adjustements

commit   : b05d1e3c0b2477797cd04b1e8dd1d3b91306e671    
  
author   : Bruce Momjian <[email protected]>    
date     : Mon, 19 May 2014 00:35:02 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Mon, 19 May 2014 00:35:02 -0400    

Click here for diff

Text from David G Johnston  

M doc/src/sgml/release-9.4.sgml

Fix non-C89-compatible coding in pgbench.

commit   : e41cc470bb57a0f3a765fa44b77ef104b5a5a01e    
  
author   : Tom Lane <[email protected]>    
date     : Mon, 19 May 2014 00:06:26 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Mon, 19 May 2014 00:06:26 -0400    

Click here for diff

C89 says that compound initializers may only contain constant expressions;  
a restriction violated by commit 89d00cbe.  While we've had no actual field  
complaints about this, C89 is still the project standard, and it's not  
saving all that much code to break compatibility here.  So let's adhere to  
the old restriction.  
  
In passing, replace a bunch of hardwired constants "256" with  
sizeof(target-variable), just because the latter is more readable and  
less breakable.  And const-ify where possible.  
  
Back-patch to 9.3 where the nonportable code was added.  
  
Andres Freund and Tom Lane  

M contrib/pgbench/pgbench.c

doc: improve 9.4 release notes

commit   : 4d30d4b9d725211859c63a18e458015636d24b94    
  
author   : Bruce Momjian <[email protected]>    
date     : Sun, 18 May 2014 23:59:23 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Sun, 18 May 2014 23:59:23 -0400    

Click here for diff

Patch by Andres Freund  

M doc/src/sgml/release-9.4.sgml

Ooops, I broke initdb with that last patch.

commit   : 0c19aaba22c4d904f7259ef11f7d6db7b5dd36a0    
  
author   : Tom Lane <[email protected]>    
date     : Sun, 18 May 2014 18:17:55 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Sun, 18 May 2014 18:17:55 -0400    

Click here for diff

That's what I get for not fully retesting the final version of the patch.  
The replace_allowed cross-check needs an additional special case for  
bootstrapping.  

M src/backend/utils/cache/relcache.c

Fix two ancient memory-leak bugs in relcache.c.

commit   : 078b2ed291c758e7125d72c3a235f128d40a232b    
  
author   : Tom Lane <[email protected]>    
date     : Sun, 18 May 2014 16:51:46 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Sun, 18 May 2014 16:51:46 -0400    

Click here for diff

RelationCacheInsert() ignored the possibility that hash_search(HASH_ENTER)  
might find a hashtable entry already present for the same OID.  However,  
that can in fact occur during recursive relcache load scenarios.  When it  
did happen, we overwrote the pointer to the pre-existing Relation, causing  
a session-lifespan leakage of that entire structure.  As far as is known,  
the pre-existing Relation would always have reference count zero by the  
time we arrive back at the outer insertion, so add code that deletes the  
pre-existing Relation if so.  If by some chance its refcount is positive,  
elog a WARNING and allow the pre-existing Relation to be leaked as before.  
  
Also, AttrDefaultFetch() was sloppy about leaking the cstring form of the  
pg_attrdef.adbin value it's copying into the relcache structure.  This is  
only a query-lifespan leakage, and normally not very significant, but it  
adds up during CLOBBER_CACHE testing.  
  
These bugs are of very ancient vintage, but I'll refrain from back-patching  
since there's no evidence that these leaks amount to anything in ordinary  
usage.  

M src/backend/utils/cache/relcache.c

Make fallback implementation of pg_memory_barrier() work.

commit   : 44cd47c1d49655c5dd9648bde8e267617c3735b4    
  
author   : Tom Lane <[email protected]>    
date     : Sat, 17 May 2014 18:29:46 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Sat, 17 May 2014 18:29:46 -0400    

Click here for diff

The fallback implementation involves acquiring and releasing a spinlock  
variable that is otherwise unreferenced --- not even to the extent of  
initializing it.  This accidentally fails to fail on platforms where  
spinlocks should be initialized to zeroes, but elsewhere it results in  
a "stuck spinlock" failure during startup.  
  
I griped about this last July, and put in a hack that worked for gcc  
on HPPA, but didn't get around to fixing the general case.  Per the  
discussion back then, the best thing to do seems to be to initialize  
dummy_spinlock in main.c.  

M src/backend/main/main.c

Fix a bunch of functions that were declared static then defined not-static.

commit   : c1907f0cc49e38df9853b7547c9afce5204e4784    
  
author   : Tom Lane <[email protected]>    
date     : Sat, 17 May 2014 17:57:53 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Sat, 17 May 2014 17:57:53 -0400    

Click here for diff

Per testing with a compiler that whines about this.  

M src/backend/access/transam/xlog.c
M src/backend/replication/logical/reorderbuffer.c
M src/backend/utils/cache/relcache.c
M src/backend/utils/misc/guc.c
M src/bin/pg_ctl/pg_ctl.c

Fix unaligned accesses in DecodeUpdate().

commit   : 6c42b2b10af3f717030966b9f05867f3e065becc    
  
author   : Tom Lane <[email protected]>    
date     : Sat, 17 May 2014 15:53:21 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Sat, 17 May 2014 15:53:21 -0400    

Click here for diff

The xl_heap_header_len structures in an XLOG_HEAP_UPDATE record aren't  
necessarily aligned adequately.  The regular replay function for these  
records is aware of that, but decode.c didn't get the memo.  I'm not  
sure why the buildfarm failed to catch this; the test_decoding test  
certainly blows up real good on my old HPPA box.  
  
Also, I'm pretty sure that the address arithmetic was wrong for the  
case of XLOG_HEAP_CONTAINS_OLD and not XLOG_HEAP_CONTAINS_NEW_TUPLE,  
though this apparently can't happen when logical decoding is active.  

M src/backend/replication/logical/decode.c

Update README, we don't do post-recovery cleanup actions anymore.

commit   : a3655dd4a5cee3917a7d1766e07e36013e7e8835    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Sat, 17 May 2014 13:48:52 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Sat, 17 May 2014 13:48:52 +0300    

Click here for diff

transam/README explained how B-tree incomplete splits were tracked and  
fixed after recovery, as an example of handling complex actions that need  
multiple WAL records, but that's not how it works anymore. Explain the new  
paradigm.  

M src/backend/access/transam/README

Make sure chr(int) can't create invalid UTF8 sequences.

commit   : 7894ac5004d5ec158f46296540d3cf49386d30e4    
  
author   : Tom Lane <[email protected]>    
date     : Fri, 16 May 2014 16:51:28 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Fri, 16 May 2014 16:51:28 -0400    

Click here for diff

Several years ago we changed chr(int) so that if the database encoding is  
UTF8, it would interpret its argument as a Unicode code point and expand it  
into the appropriate multibyte sequence.  However, we weren't sufficiently  
careful about checking validity of the input.  According to RFC3629, UTF8  
disallows code points above U+10FFFF (note that the predecessor standard  
RFC2279 was more liberal).  Also, both versions of the UTF8 spec agree  
that Unicode surrogate-pair codes should never appear in UTF8.  Because  
our encoding validity checks follow RFC3629, our failure to enforce these  
restrictions in chr() means it could be used to produce text strings that  
will be rejected when the database is dumped and reloaded.  To ensure  
consistency with the input functions, let's actually apply  
pg_utf8_islegal() to the proposed output of chr().  
  
Per discussion, this seems like too much of a behavioral change to  
back-patch, but it's not too late to squeeze it into 9.4.  

M src/backend/utils/adt/oracle_compat.c

Suppress some more valgrind whining about btree_gist.

commit   : af215d8190e6ab170c02c24afd1be81f5a147481    
  
author   : Tom Lane <[email protected]>    
date     : Fri, 16 May 2014 15:29:02 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Fri, 16 May 2014 15:29:02 -0400    

Click here for diff

A couple of functions didn't bother to zero out pad bytes in datums that  
would ultimately go to disk.  Harmless, but valgrind doesn't know that.  

M contrib/btree_gist/btree_utils_var.c

Fix a second cause of undersized pallocs for btree_gist indexes on macaddr.

commit   : 39586bc1e971c136c4487b26eb7334dbbe23b102    
  
author   : Tom Lane <[email protected]>    
date     : Fri, 16 May 2014 15:18:09 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Fri, 16 May 2014 15:18:09 -0400    

Click here for diff

gbt_macad_union also allocated 12-byte structs where we really need 16.  
  
Per report from Andres Freund.  No back-patch since there's no current  
risk of a real problem.  

M contrib/btree_gist/btree_macaddr.c

Fix valgrind warning for btree_gist indexes on macaddr.

commit   : 82bbb60c30dbff0633da34387ccab58d843379b5    
  
author   : Tom Lane <[email protected]>    
date     : Fri, 16 May 2014 15:11:51 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Fri, 16 May 2014 15:11:51 -0400    

Click here for diff

The macaddr opclass stores two macaddr structs (each of size 6) in an  
index column that's declared as being of type gbtreekey16, ie 16 bytes.  
In the original coding this led to passing a palloc'd value of size 12  
to the index insertion code, so that data would be fetched past the  
end of the allocated value during index tuple construction.  This makes  
valgrind unhappy.  In principle it could result in a SIGSEGV, though  
with the current implementation of palloc there's no risk since  
the 12-byte request size would be rounded up to 16 bytes anyway.  
  
To fix, add a field to struct gbtree_ninfo showing the declared size of  
the index datums, and use that in the palloc requests; and use palloc0  
to be sure that any wasted bytes are cleanly initialized.  
  
Per report from Andres Freund.  No back-patch since there's no current  
risk of a real problem.  

M contrib/btree_gist/btree_cash.c
M contrib/btree_gist/btree_date.c
M contrib/btree_gist/btree_float4.c
M contrib/btree_gist/btree_float8.c
M contrib/btree_gist/btree_inet.c
M contrib/btree_gist/btree_int2.c
M contrib/btree_gist/btree_int4.c
M contrib/btree_gist/btree_int8.c
M contrib/btree_gist/btree_interval.c
M contrib/btree_gist/btree_macaddr.c
M contrib/btree_gist/btree_oid.c
M contrib/btree_gist/btree_time.c
M contrib/btree_gist/btree_ts.c
M contrib/btree_gist/btree_utils_num.c
M contrib/btree_gist/btree_utils_num.h

Add test case for logical decoding of prepared transactions.

commit   : d900e192a3ef2dd73fae4522c35aadce6d72a534    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Fri, 16 May 2014 11:33:49 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Fri, 16 May 2014 11:33:49 +0300    

Click here for diff

Andres Freund  

M contrib/test_decoding/Makefile
A contrib/test_decoding/expected/prepared.out
A contrib/test_decoding/sql/prepared.sql

Fix test_decoding test case's check that slot has been dropped.

commit   : afd0fcbc5d421454e7d55d949cca0721c9c135c3    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Fri, 16 May 2014 11:23:17 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Fri, 16 May 2014 11:23:17 +0300    

Click here for diff

pg_stat_replication shows connected replication clients. The ddl test case  
never has any replication clients connected, so querying pg_stat_replication  
is pointless. To check that a slot has been dropped correctly, query  
pg_replication_slots instead.  
  
Andres Freund  

M contrib/test_decoding/expected/ddl.out
M contrib/test_decoding/sql/ddl.sql

Fix thinko in logical decoding of commit-prepared records.

commit   : 03e2b1017c0d360cae0b4d0a8bf5d6924536c834    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Fri, 16 May 2014 10:53:10 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Fri, 16 May 2014 10:53:10 +0300    

Click here for diff

The decoding of prepared transaction commits accidentally used the XID of  
the transaction performing the COMMIT PREPARED, not the XID of the prepared  
transaction. Before bb38fb0d43c8d that lead to those transactions not being  
decoded, afterwards to a assertion failure.  

M src/backend/replication/logical/decode.c

Open output file before sleeping in pg_recvlogical.

commit   : e7873b74d9c1bb7a325960f52043db6de88e6e66    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Fri, 16 May 2014 10:10:45 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Fri, 16 May 2014 10:10:45 +0300    

Click here for diff

Let's complain about e.g an invalid path or permission problem sooner rather  
than later. Before this patch, we would only try to open the output file  
after receiving the first decoded message from the server.  

M src/bin/pg_basebackup/pg_recvlogical.c

Initialize tsId and dbId fields in WAL record of COMMIT PREPARED.

commit   : 07a4a93a0e35a778c77ffbbbc18de29e859e18f0    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Fri, 16 May 2014 09:47:50 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Fri, 16 May 2014 09:47:50 +0300    

Click here for diff

Commit dd428c79 added dbId and tsId to the xl_xact_commit struct but missed  
that prepared transaction commits reuse that struct. Fix that.  
  
Because those fields were left unitialized, replaying a commit prepared WAL  
record in a hot standby node would fail to remove the relcache init file.  
That can lead to "could not open file" errors on the standby. Relcache init  
file only needs to be removed when a system table/index is rewritten in the  
transaction using two phase commit, so that should be rare in practice. In  
HEAD, the incorrect dbId/tsId values are also used for filtering in logical  
replication code, causing the transaction to always be filtered out.  
  
Analysis and fix by Andres Freund. Backpatch to 9.0 where hot standby was  
introduced.  

M src/backend/access/transam/twophase.c

Fix unportable setvbuf() usage in initdb.

commit   : f62d417825d6a8e26768a130a5f4c9e454d9dbe4    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 15 May 2014 15:57:54 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 15 May 2014 15:57:54 -0400    

Click here for diff

In yesterday's commit 2dc4f011fd61501cce507be78c39a2677690d44b, I tried  
to force buffering of stdout/stderr in initdb to be what it is by  
default when the program is run interactively on Unix (since that's how  
most manual testing is done).  This tripped over the fact that Windows  
doesn't support _IOLBF mode.  We dealt with that a long time ago in  
syslogger.c by falling back to unbuffered mode on Windows.  Export that  
solution in port.h and use it in initdb.  
  
Back-patch to 8.4, like the previous commit.  

M src/backend/postmaster/syslogger.c
M src/bin/initdb/initdb.c
M src/include/port.h

Fix whitespace

commit   : 2f8e68bd7ea3523977567369056c4b3e67e44fdc    
  
author   : Peter Eisentraut <[email protected]>    
date     : Thu, 15 May 2014 13:23:31 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Thu, 15 May 2014 13:23:31 -0400    

Click here for diff

M contrib/pg_upgrade/version.c

Fix a couple of bugs in pg_recvlogical output to stdout.

commit   : 00c26b6a60e7ceed29ddae34b0a69fe945c08f81    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Thu, 15 May 2014 19:43:37 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Thu, 15 May 2014 19:43:37 +0300    

Click here for diff

Don't close stdout on SIGHUP. Also, when a SIGHUP is received, close the  
file immediately, rather than only after receiving some more data from  
the server. Rename a variable, to avoid mentally dealing with double  
negatives (not unsynced means synced).  

M src/bin/pg_basebackup/pg_recvlogical.c

Handle duplicate XIDs in txid_snapshot.

commit   : 8f9b9590d79fc1fc1ad08b207401acfdbb0bfac7    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Thu, 15 May 2014 18:29:20 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Thu, 15 May 2014 18:29:20 +0300    

Click here for diff

The proc array can contain duplicate XIDs, when a transaction is just being  
prepared for two-phase commit. To cope, remove any duplicates in  
txid_current_snapshot(). Also ignore duplicates in the input functions, so  
that if e.g. you have an old pg_dump file that already contains duplicates,  
it will be accepted.  
  
Report and fix by Jan Wieck. Backpatch to all supported versions.  

M src/backend/utils/adt/txid.c
M src/test/regress/expected/txid.out
M src/test/regress/sql/txid.sql

Fix race condition in preparing a transaction for two-phase commit.

commit   : bb38fb0d43c8d7ff54072bfd8bd63154e536b384    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Thu, 15 May 2014 16:37:50 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Thu, 15 May 2014 16:37:50 +0300    

Click here for diff

To lock a prepared transaction's shared memory entry, we used to mark it  
with the XID of the backend. When the XID was no longer active according  
to the proc array, the entry was implicitly considered as not locked  
anymore. However, when preparing a transaction, the backend's proc array  
entry was cleared before transfering the locks (and some other state) to  
the prepared transaction's dummy PGPROC entry, so there was a window where  
another backend could finish the transaction before it was in fact fully  
prepared.  
  
To fix, rewrite the locking mechanism of global transaction entries. Instead  
of an XID, just have simple locked-or-not flag in each entry (we store the  
locking backend's backend id rather than a simple boolean, but that's just  
for debugging purposes). The backend is responsible for explicitly unlocking  
the entry, and to make sure that that happens, install a callback to unlock  
it on abort or process exit.  
  
Backpatch to all supported versions.  

M src/backend/access/transam/twophase.c
M src/backend/access/transam/xact.c
M src/include/access/twophase.h

Misc message style and doc fixes.

commit   : ff810b4928882bfdc4ebe1ce603c47830aba3132    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Thu, 15 May 2014 14:49:11 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Thu, 15 May 2014 14:49:11 +0300    

Click here for diff

Euler Taveira  

M doc/src/sgml/ref/pg_recvlogical.sgml
M src/backend/replication/libpqwalreceiver/libpqwalreceiver.c
M src/bin/pg_basebackup/pg_basebackup.c
M src/bin/pg_basebackup/pg_recvlogical.c
M src/bin/psql/command.c

Silence warnings about redefining popen on Mingw-w64.

commit   : a82a17475d8a8a91df5fd1448b0f93772f590ecd    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Thu, 15 May 2014 12:18:49 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Thu, 15 May 2014 12:18:49 +0300    

Click here for diff

Mingw-w64 headers map popen/pclose to _popen and _pclose, but we want to use  
our popen wrapper rather than the Mingw-w64. #undef the Mingw's version.  

M src/include/port.h

doc: Clarify what files pg_basebackup omits from data directory

commit   : 4773c70aa4c938c367ee179f7301f70a4efabc0e    
  
author   : Peter Eisentraut <[email protected]>    
date     : Wed, 14 May 2014 22:26:49 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Wed, 14 May 2014 22:26:49 -0400    

Click here for diff

M doc/src/sgml/protocol.sgml
M doc/src/sgml/ref/pg_basebackup.sgml

pg_ctl: Write error messages to stderr

commit   : c424c049189f758920b1a3bb961bc05c93a900df    
  
author   : Peter Eisentraut <[email protected]>    
date     : Wed, 14 May 2014 22:19:18 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Wed, 14 May 2014 22:19:18 -0400    

Click here for diff

M src/bin/pg_ctl/pg_ctl.c

In initdb, ensure stdout/stderr buffering behavior is what we expect.

commit   : 2dc4f011fd61501cce507be78c39a2677690d44b    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 14 May 2014 21:13:54 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 14 May 2014 21:13:54 -0400    

Click here for diff

Since this program may print to either stdout or stderr, the relative  
ordering of its messages depends on the buffering behavior of those files.  
Force stdout to be line-buffered and stderr to be unbuffered, ensuring  
that the behavior will match standard Unix interactive behavior, even  
when stdout and stderr are rerouted to a file.  
  
Per complaint from Tomas Vondra.  The particular case he pointed out is  
new in HEAD, but issues of the same sort could arise in any branch with  
other error messages, so back-patch to all branches.  
  
I'm unsure whether we might not want to do this in other client programs  
as well.  For the moment, just fix initdb.  

M src/bin/initdb/initdb.c

pg_update: slight major version adjustment

commit   : 2e6602dfc25d1f8e8a2e1df48c96440b02aa19c1    
  
author   : Bruce Momjian <[email protected]>    
date     : Wed, 14 May 2014 21:13:59 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Wed, 14 May 2014 21:13:59 -0400    

Click here for diff

M contrib/pg_upgrade/check.c

Fix version check for pg_upgrade line type crosscheck.

commit   : 4456763c78d2a94c42e67ce788fbe94a07aa12dc    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 14 May 2014 20:23:32 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 14 May 2014 20:23:32 -0400    

Click here for diff

Per buildfarm.  

M contrib/pg_upgrade/check.c

pg_upgrade: error out on 'line' data type usage

commit   : bb797b640449d67f722d27660c718b68a692f8f9    
  
author   : Bruce Momjian <[email protected]>    
date     : Wed, 14 May 2014 16:26:06 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Wed, 14 May 2014 16:26:06 -0400    

Click here for diff

The data type internal format changed in 9.4.  Also mention this in the  
9.4 release notes.  

M contrib/pg_upgrade/check.c
M contrib/pg_upgrade/pg_upgrade.h
M contrib/pg_upgrade/version.c
M doc/src/sgml/release-9.4.sgml

Code review for recent changes in relcache.c.

commit   : b23b0f5588d2e2f15edff66e072e339a8c9616a7    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 14 May 2014 14:55:48 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 14 May 2014 14:55:48 -0400    

Click here for diff

rd_replidindex should be managed the same as rd_oidindex, and rd_keyattr  
and rd_idattr should be managed like rd_indexattr.  Omissions in this area  
meant that the bitmapsets computed for rd_keyattr and rd_idattr would be  
leaked during any relcache flush, resulting in a slow but permanent leak in  
CacheMemoryContext.  There was also a tiny probability of relcache entry  
corruption if we ran out of memory at just the wrong point in  
RelationGetIndexAttrBitmap.  Otherwise, the fields were not zeroed where  
expected, which would not bother the code any AFAICS but could greatly  
confuse anyone examining the relcache entry while debugging.  
  
Also, create an API function RelationGetReplicaIndex rather than letting  
non-relcache code be intimate with the mechanisms underlying caching of  
that value (we won't even mention the memory leak there).  
  
Also, fix a relcache flush hazard identified by Andres Freund:  
RelationGetIndexAttrBitmap must not assume that rd_replidindex stays valid  
across index_open.  
  
The aspects of this involving rd_keyattr date back to 9.3, so back-patch  
those changes.  

M src/backend/access/heap/heapam.c
M src/backend/utils/cache/relcache.c
M src/include/utils/rel.h
M src/include/utils/relcache.h

doc: fix 9.4 release notes typo

commit   : ac53295d667e7727d7b70ddf11d82c067870501f    
  
author   : Bruce Momjian <[email protected]>    
date     : Wed, 14 May 2014 14:13:19 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Wed, 14 May 2014 14:13:19 -0400    

Click here for diff

Report by Dean Rasheed  

M doc/src/sgml/release-9.4.sgml

doc: fix typo in 9.4 release note comments

commit   : eefd90c4a95449f02b568d5370cfe6bcd1bf13e9    
  
author   : Bruce Momjian <[email protected]>    
date     : Wed, 14 May 2014 12:21:03 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Wed, 14 May 2014 12:21:03 -0400    

Click here for diff

Patch by Sergey Muraviov  

M doc/src/sgml/release-9.4.sgml

Make initdb throw error for bad locale values.

commit   : 31a263237fa3eb6f36d58335fbdb82bab3136db3    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 14 May 2014 11:51:10 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 14 May 2014 11:51:10 -0400    

Click here for diff

Historically we've printed a complaint for a bad locale setting, but then  
fallen back to the environment default.  Per discussion, this is not such  
a great idea, because rectifying an erroneous locale choice post-initdb  
(perhaps long after data has been loaded) could be enormously expensive.  
Better to complain and give the user a chance to double-check things.  
  
The behavior was particularly bad if the bad setting came from environment  
variables rather than a bogus command-line switch: in that case not only  
was there a fallback to C/SQL_ASCII, but the printed complaint was quite  
unhelpful.  It's hard to be entirely sure what variables setlocale looked  
at, but we can at least give a hint where the problem might be.  
  
Per a complaint from Tomas Vondra.  

M src/bin/initdb/initdb.c

docs: mention windows quoting change in 9.4 release notes

commit   : eb6144bb447ecbb036bfa08da85940cd50d49410    
  
author   : Bruce Momjian <[email protected]>    
date     : Wed, 14 May 2014 11:02:03 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Wed, 14 May 2014 11:02:03 -0400    

Click here for diff

Report by Heikki Linnakangas  

M doc/src/sgml/release-9.4.sgml

doc: auto-updatable view adjustments for 9.4 release notes

commit   : e513087f6401a64b0d9f0b20cd2a51a7938ac645    
  
author   : Bruce Momjian <[email protected]>    
date     : Wed, 14 May 2014 10:07:24 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Wed, 14 May 2014 10:07:24 -0400    

Click here for diff

Report by Dean Rasheed  

M doc/src/sgml/release-9.4.sgml

docs: 9.4 release notes adjustments

commit   : 062f53518927f9bfe1820578ce79d3180b1aa2ca    
  
author   : Bruce Momjian <[email protected]>    
date     : Tue, 13 May 2014 15:12:54 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Tue, 13 May 2014 15:12:54 -0400    

Click here for diff

Patch by Andres Freund, slight adjustments by me  

M doc/src/sgml/release-9.4.sgml

Fix harmless access to uninitialized memory.

commit   : f35aef415aa755c4e99f8c0ef83f9d14dbc48bb4    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Tue, 13 May 2014 19:17:28 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Tue, 13 May 2014 19:17:28 +0300    

Click here for diff

When cache invalidations arrive while ri_LoadConstraintInfo() is busy  
filling a new cache entry, InvalidateConstraintCacheCallBack() compares  
the - not yet initialized - oidHashValue field with the to-be-invalidated  
hash value. To fix, check whether the entry is already marked as invalid.  
  
Andres Freund  

M src/backend/utils/adt/ri_triggers.c

Initialize padding bytes in btree_gist varbit support.

commit   : 540ac7cea919623f691b20892ccc50e5e33b5009    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Tue, 13 May 2014 14:16:28 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Tue, 13 May 2014 14:16:28 +0300    

Click here for diff

The code expands a varbit gist leaf key to a node key by copying the bit  
data twice in a varlen datum, as both the lower and upper key. The lower key  
was expanded to INTALIGN size, but the padding bytes were not initialized.  
That's a problem because when the lower/upper keys are compared, the padding  
bytes are used compared too, when the values are otherwise equal. That could  
lead to incorrect query results.  
  
REINDEX is advised for any btree_gist indexes on bit or bit varying data  
type, to fix any garbage padding bytes on disk.  
  
Per Valgrind, reported by Andres Freund. Backpatch to all supported  
versions.  

M contrib/btree_gist/btree_bit.c

Add Valgrind suppression for reorderbuffer padding bytes.

commit   : 5a90ac29c44f0dabf1e3a7b0443ba772cf206e2e    
  
author   : Noah Misch <[email protected]>    
date     : Mon, 12 May 2014 23:03:49 -0400    
  
committer: Noah Misch <[email protected]>    
date     : Mon, 12 May 2014 23:03:49 -0400    

Click here for diff

Andres Freund  

M src/tools/valgrind.supp

docs: use structfield instead of structname in 9.4 release notes

commit   : 9af8bd51a10edaf454c6b5246d79eded73528fd2    
  
author   : Bruce Momjian <[email protected]>    
date     : Mon, 12 May 2014 21:37:49 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Mon, 12 May 2014 21:37:49 -0400    

Click here for diff

Where appropriate  

M doc/src/sgml/release-9.4.sgml

doc: 9.4 release note adjustments

commit   : 6de9a6c015d543c41933171cd6cf5d357597f19f    
  
author   : Bruce Momjian <[email protected]>    
date     : Mon, 12 May 2014 21:30:58 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Mon, 12 May 2014 21:30:58 -0400    

Click here for diff

Report by Nicolas Barbier, Tatsuo Ishii, MauMau  

M doc/src/sgml/release-9.4.sgml

Be more wary in choice of timezone names to test make_timestamptz with.

commit   : 66b737cd9a72e10df4de1867ae7b675bc48d478c    
  
author   : Tom Lane <[email protected]>    
date     : Mon, 12 May 2014 20:21:16 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Mon, 12 May 2014 20:21:16 -0400    

Click here for diff

America/Metlakatla hasn't been in the IANA database all that long, so  
some installations might not have it.  It does seem worthwhile to test  
with a fractional-minute GMT offset, but we can get that from almost  
any pre-1900 date; I chose Europe/Paris, whose LMT offset from Greenwich  
should be pretty darn well established.  
  
Also, assuming that Mars/Mons_Olympus will never be in the IANA database  
seems less than future-proof, so let's use a more fanciful location for  
the bad-zone-name check.  
  
Per complaint from Christoph Berg.  

M src/test/regress/expected/timestamptz.out
M src/test/regress/sql/timestamptz.sql

Ignore config.pl and buildenv.pl in src/tools/msvc.

commit   : 73011f35eca7f4a3973289d5813648abbc1074a0    
  
author   : Tom Lane <[email protected]>    
date     : Mon, 12 May 2014 14:24:18 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Mon, 12 May 2014 14:24:18 -0400    

Click here for diff

config.pl and buildenv.pl can be used to customize build settings when  
using MSVC.  They should never get committed into the common source tree.  
  
Back-patch to 9.0; it looks like the rules were different in 8.4.  
  
Michael Paquier  

A src/tools/msvc/.gitignore

Fix typo in test_shm_mq document.

commit   : a3632771bb66eec74c7e73c0d7a5f8cdd6719be2    
  
author   : Fujii Masao <[email protected]>    
date     : Tue, 13 May 2014 01:41:54 +0900    
  
committer: Fujii Masao <[email protected]>    
date     : Tue, 13 May 2014 01:41:54 +0900    

Click here for diff

Amit Langote  

M doc/src/sgml/test-shm-mq.sgml

Free PQresult on error in pg_receivexlog.

commit   : c890b488063e23f12b5ab01c9a6d254a034fcea2    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Mon, 12 May 2014 10:17:40 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Mon, 12 May 2014 10:17:40 +0300    

Click here for diff

The leak is fairly small and rare, but a leak nevertheless.  
  
Per Coverity report. Backpatch to 9.2, where pg_receivexlog was added.  
pg_basebackup shares the code, but it always exits on error, so there is  
no real leak.  

M src/bin/pg_basebackup/receivelog.c

Stamp 9.4beta1.

commit   : e6df2e1be6330660ba4d81daa726ae4a71535aa9    
  
author   : Tom Lane <[email protected]>    
date     : Sun, 11 May 2014 17:16:48 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Sun, 11 May 2014 17:16:48 -0400    

Click here for diff

M configure
M configure.in
M doc/bug.template
M src/include/pg_config.h.win32

Find postgresql.auto.conf in PGDATA even when postgresql.conf is elsewhere.

commit   : 195e81aff5d63da1e1f9dd0314a13859ec15c7c0    
  
author   : Tom Lane <[email protected]>    
date     : Sun, 11 May 2014 15:13:30 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Sun, 11 May 2014 15:13:30 -0400    

Click here for diff

The original coding for ALTER SYSTEM made a fundamentally bogus assumption  
that postgresql.auto.conf could be sought relative to the main config file  
if we hadn't yet determined the value of data_directory.  This fails for  
common arrangements with the config file elsewhere, as reported by  
Christoph Berg.  
  
The simplest fix is to not try to read postgresql.auto.conf until after  
SelectConfigFiles has chosen (and locked down) the data_directory setting.  
  
Because of the logic in ProcessConfigFile for handling resetting of GUCs  
that've been removed from the config file, we cannot easily read the main  
and auto config files separately; so this patch adopts a brute force  
approach of reading the main config file twice during postmaster startup.  
That's a tad ugly, but the actual time cost is likely to be negligible,  
and there's no time for a more invasive redesign before beta.  
  
With this patch, any attempt to set data_directory via ALTER SYSTEM  
will be silently ignored.  It would probably be better to throw an  
error, but that can be dealt with later.  This bug, however, would  
prevent any testing of ALTER SYSTEM by a significant fraction of the  
userbase, so it seems important to get it fixed before beta.  

M src/backend/utils/misc/guc-file.l
M src/backend/utils/misc/guc.c

Rename jsonb_hash_ops to jsonb_path_ops.

commit   : 12e611d43e6efbf0e36014a3055ed47366facee7    
  
author   : Tom Lane <[email protected]>    
date     : Sun, 11 May 2014 12:06:04 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Sun, 11 May 2014 12:06:04 -0400    

Click here for diff

There's no longer much pressure to switch the default GIN opclass for  
jsonb, but there was still some unhappiness with the name "jsonb_hash_ops",  
since hashing is no longer a distinguishing property of that opclass,  
and anyway it seems like a relatively minor detail.  At the suggestion of  
Heikki Linnakangas, we'll use "jsonb_path_ops" instead; that captures the  
important characteristic that each index entry depends on the entire path  
from the document root to the indexed value.  
  
Also add a user-facing explanation of the implementation properties of  
these two opclasses.  

M doc/src/sgml/gin.sgml
M doc/src/sgml/json.sgml
M src/backend/utils/adt/jsonb_gin.c
M src/include/catalog/catversion.h
M src/include/catalog/pg_amop.h
M src/include/catalog/pg_opclass.h
M src/include/catalog/pg_opfamily.h
M src/include/catalog/pg_proc.h
M src/include/utils/jsonb.h
M src/test/regress/expected/jsonb.out
M src/test/regress/expected/jsonb_1.out
M src/test/regress/sql/jsonb.sql

Translation updates

commit   : e136271a947d142eaa7093a789e6fa9ceda18c17    
  
author   : Peter Eisentraut <[email protected]>    
date     : Sat, 10 May 2014 21:53:11 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Sat, 10 May 2014 21:53:11 -0400    

Click here for diff

M src/backend/po/de.po
M src/backend/po/fr.po
M src/backend/po/it.po
M src/backend/po/pt_BR.po
M src/backend/po/ru.po
M src/bin/initdb/po/de.po
M src/bin/initdb/po/ru.po
M src/bin/pg_controldata/po/de.po
M src/bin/pg_dump/po/pt_BR.po
M src/bin/pg_dump/po/ru.po
M src/bin/pg_resetxlog/po/ru.po
M src/bin/psql/po/de.po
M src/bin/psql/po/fr.po
M src/bin/psql/po/it.po
M src/bin/psql/po/pt_BR.po
M src/bin/psql/po/ru.po

docs: Mark 9.4 release notes as current as of today

commit   : ea78ce1d457d8e0fef01328219a1dfd89aeba7ae    
  
author   : Bruce Momjian <[email protected]>    
date     : Sat, 10 May 2014 22:03:24 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Sat, 10 May 2014 22:03:24 -0400    

Click here for diff

M doc/src/sgml/release-9.4.sgml

Rename min_recovery_apply_delay to recovery_min_apply_delay.

commit   : 0d0b2bf175a53dfedcc0cb69eaba7576b0c286f2    
  
author   : Tom Lane <[email protected]>    
date     : Sat, 10 May 2014 19:46:19 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Sat, 10 May 2014 19:46:19 -0400    

Click here for diff

Per discussion, this seems like a more consistent choice of name.  
  
Fabrízio de Royes Mello, after a suggestion by Peter Eisentraut;  
some additional documentation wordsmithing by me  

M doc/src/sgml/recovery-config.sgml
M doc/src/sgml/release-9.4.sgml
M src/backend/access/transam/recovery.conf.sample
M src/backend/access/transam/xlog.c

More work on the JSON/JSONB user documentation.

commit   : f825c7c850dbe683d62defd7e5bd31664ee3302c    
  
author   : Tom Lane <[email protected]>    
date     : Sat, 10 May 2014 18:56:52 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Sat, 10 May 2014 18:56:52 -0400    

Click here for diff

Document existence operator adequately; fix obsolete claim that no  
Unicode-escape semantic checks happen on input (it's still true for  
json, but not for jsonb); improve examples; assorted wordsmithing.  

M doc/src/sgml/func.sgml
M doc/src/sgml/gin.sgml
M doc/src/sgml/json.sgml

Fix bug in lossy-page handling in GIN

commit   : 866e6e1d04d4ae9615bd1899a757dae0191e9c77    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Sat, 10 May 2014 23:24:23 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Sat, 10 May 2014 23:24:23 +0300    

Click here for diff

When returning rows from a bitmap, as done with partial match queries, we  
would get stuck in an infinite loop if the bitmap contained a lossy page  
reference.  
  
This bug is new in master, it was introduced by the patch to allow skipping  
items refuted by other entries in GIN scans.  
  
Report and fix by Alexander Korotkov  

M src/backend/access/gin/ginget.c

Accept tcl 8.6 in configure's probe for tclsh.

commit   : eaba54c20c5ab2cb6aaffa574444fd4990dfe2c7    
  
author   : Tom Lane <[email protected]>    
date     : Sat, 10 May 2014 10:48:01 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Sat, 10 May 2014 10:48:01 -0400    

Click here for diff

Usually the search would find plain "tclsh" without any trouble,  
but some installations might only have the version-numbered flavor  
of that program.  
  
No compatibility problems have been reported with 8.6, so we might  
as well back-patch this to all active branches.  
  
Christoph Berg  

M config/tcl.m4
M configure

Update config.guess and config.sub

commit   : 7fa5bc43aaaf01e23c3a6ab59a57c19273f6f7f4    
  
author   : Tom Lane <[email protected]>    
date     : Sat, 10 May 2014 10:33:34 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Sat, 10 May 2014 10:33:34 -0400    

Click here for diff

M config/config.guess
M config/config.sub

Fix bogus documentation of json_object_agg().

commit   : 17e4082b6312383075e397b4b2ae324c90716c5b    
  
author   : Tom Lane <[email protected]>    
date     : Fri, 9 May 2014 20:25:42 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Fri, 9 May 2014 20:25:42 -0400    

Click here for diff

It takes two arguments, not one.  

M doc/src/sgml/func.sgml

Fix broken allocation logic in recently-rewritten jsonb_util.c.

commit   : 3d8c2b496fc1fed2b8ff8a403d3a17329325466e    
  
author   : Tom Lane <[email protected]>    
date     : Fri, 9 May 2014 18:24:17 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Fri, 9 May 2014 18:24:17 -0400    

Click here for diff

reserveFromBuffer() failed to consider the possibility that it needs to  
more-than-double the current buffer size.  Beyond that, it seems likely  
that we'd someday need to worry about integer overflow of the buffer  
length variable.  Rather than reinvent the logic that's already been  
debugged in stringinfo.c, let's go back to using that logic.  We can  
still have the same targeted API, but we'll rely on stringinfo.c to  
manage reallocation.  
  
Per report from Alexander Korotkov.  

M src/backend/utils/adt/jsonb_util.c

Improve user-facing JSON documentation.

commit   : 0b92a77c17ebe8bec08e250e1a929b07efef1008    
  
author   : Tom Lane <[email protected]>    
date     : Fri, 9 May 2014 16:33:25 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Fri, 9 May 2014 16:33:25 -0400    

Click here for diff

I started out with the intention of just fixing the info about the jsonb  
operator classes, but soon found myself copy-editing most of the JSON  
material.  Hopefully it's more readable now.  

M doc/src/sgml/func.sgml
M doc/src/sgml/gin.sgml
M doc/src/sgml/json.sgml
M doc/src/sgml/release-9.3.sgml

Get rid of bogus dependency on typcategory in to_json() and friends.

commit   : 0ca6bda8e7501947c05f30c127f6d12ff90b5a64    
  
author   : Tom Lane <[email protected]>    
date     : Fri, 9 May 2014 12:55:00 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Fri, 9 May 2014 12:55:00 -0400    

Click here for diff

These functions were relying on typcategory to identify arrays and  
composites, which is not reliable and not the normal way to do it.  
Using typcategory to identify boolean, numeric types, and json itself is  
also pretty questionable, though the code in those cases didn't seem to be  
at risk of anything worse than wrong output.  Instead, use the standard  
lsyscache functions to identify arrays and composites, and rely on a direct  
check of the type OID for the other cases.  
  
In HEAD, also be sure to look through domains so that a domain is treated  
the same as its base type for conversions to JSON.  However, this is a  
small behavioral change; given the lack of field complaints, we won't  
back-patch it.  
  
In passing, refactor so that there's only one copy of the code that decides  
which conversion strategy to apply, not multiple copies that could (and  
have) gotten out of sync.  

M src/backend/utils/adt/json.c

Code review for logical decoding patch.

commit   : f1d8dd3647fd0c87f0fb238f7cfc45c1ce282a55    
  
author   : Robert Haas <[email protected]>    
date     : Fri, 9 May 2014 10:44:04 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Fri, 9 May 2014 10:44:04 -0400    

Click here for diff

Post-commit review identified a number of places where addition was  
used instead of multiplication or memory wasn't zeroed where it should  
have been.  This commit also fixes one case where a structure member  
was mis-initialized, and moves another memory allocation closer to  
the place where the allocated storage is used for clarity.  
  
Andres Freund  

M src/backend/replication/logical/reorderbuffer.c
M src/backend/replication/logical/snapbuild.c

Remove overeager assertion in logical_heap_begin_rewrite.

commit   : b2dada8f5f90ab015ca8a62b46261ef01a7c781f    
  
author   : Robert Haas <[email protected]>    
date     : Fri, 9 May 2014 10:33:40 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Fri, 9 May 2014 10:33:40 -0400    

Click here for diff

It's legal to configure wal_level=logical and max_replication_slots=0  
simultaneously.  
  
Andres Freund  

M src/backend/access/heap/rewriteheap.c

Teach add_json() that jsonb is of TYPCATEGORY_JSON.

commit   : 62e57ff040e5d0acd303b94e86fff689effc5957    
  
author   : Tom Lane <[email protected]>    
date     : Fri, 9 May 2014 09:44:11 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Fri, 9 May 2014 09:44:11 -0400    

Click here for diff

This code really needs to be refactored so that there aren't so many copies  
that can diverge.  Not to mention that this whole approach is probably  
wrong.  But for the moment I'll just stick my finger in the dike.  
Per report from Michael Paquier.  

M src/backend/utils/adt/json.c

Fix typcategory labeling of jsonb.

commit   : bdf9dd4db78a5f23e863f2d4d8500969dc261fd0    
  
author   : Tom Lane <[email protected]>    
date     : Fri, 9 May 2014 09:25:58 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Fri, 9 May 2014 09:25:58 -0400    

Click here for diff

Dunno who had the cute idea of labeling jsonb as typcategory 'C',  
but it is not a composite type.  Label it 'U', since that's what  
json is using.  

M src/include/catalog/catversion.h
M src/include/catalog/pg_type.h

More jsonb cleanup.

commit   : d9daff0e0cb15221789e6c50d9733c8754c054fb    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Fri, 9 May 2014 15:55:56 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Fri, 9 May 2014 15:55:56 +0300    

Click here for diff

Fix JSONB_MAX_ELEMS and JSONB_MAX_PAIRS macros to use CB_MASK in the  
calculation. JENTRY_POSMASK happens to have the same value at the moment,  
but that's just coincidental.  
  
Refactor jsonb iterator functions, for readability.  
  
Get rid of the JENTRY_ISFIRST flag. Whenever we handle JEntrys, we have  
access to the whole array and have enough context information to know  
which entry is the first. This frees up one bit in the JEntry header for  
future use. While we're at it, shuffle the JEntry bits so that boolean  
true and false go together, for aesthetic reasons.  
  
Bump catalog version as this changes the on-disk format slightly.  

M src/backend/utils/adt/jsonb_util.c
M src/include/catalog/catversion.h
M src/include/utils/jsonb.h

Improve key representation for GIN jsonb_ops, and fix existence-search bug.

commit   : 46dddf7673c5820be7c78a8b0e098fdbc65d003d    
  
author   : Tom Lane <[email protected]>    
date     : Fri, 9 May 2014 08:41:26 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Fri, 9 May 2014 08:41:26 -0400    

Click here for diff

Change the key representation so that values that would exceed 127 bytes  
are hashed into short strings, and so that the original JSON datatype of  
each value is recorded in the index.  The hashing rule eliminates the major  
objection to having this opclass be the default for jsonb, namely that it  
could fail for plausible input data (due to GIN's restrictions on maximum  
key length).  Preserving datatype information doesn't really buy us much  
right now, but it requires no extra space compared to the previous way,  
and it might be useful later.  
  
Also, change the consistency-checking functions to request recheck for  
exists (jsonb ? text) and related operators.  The original analysis that  
this is an exactly checkable query was incorrect, since the index does  
not preserve information about whether a key appears at top level in  
the indexed JSON object.  Add a test case demonstrating the problem.  
  
Make some other, mostly cosmetic improvements to the code in jsonb_gin.c  
as well.  
  
catversion bump due to on-disk data format change in jsonb_ops indexes.  

M src/backend/utils/adt/jsonb_gin.c
M src/include/catalog/catversion.h
M src/include/utils/jsonb.h
M src/test/regress/data/jsonb.data
M src/test/regress/expected/jsonb.out
M src/test/regress/expected/jsonb_1.out
M src/test/regress/sql/jsonb.sql

Minor cleanup of jsonb_util.c

commit   : ff7bbb0176a667aeb0577e4d48d651ffdb6afd50    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Fri, 9 May 2014 13:09:59 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Fri, 9 May 2014 13:09:59 +0300    

Click here for diff

Move the functions around to group related functions together. Remove  
binequal argument from lengthCompareJsonbStringValue, moving that  
responsibility to lengthCompareJsonbPair. Fix typo in comment.  

M src/backend/utils/adt/jsonb_util.c

Avoid some pnstrdup()s when constructing jsonb

commit   : d3c72e23df6ef1fde8122db589d12d49c8495535    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Fri, 9 May 2014 11:32:28 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Fri, 9 May 2014 11:32:28 +0300    

Click here for diff

This speeds up text to jsonb parsing and hstore to jsonb conversions  
somewhat.  

M contrib/hstore/hstore_io.c
M src/backend/utils/adt/json.c
M src/backend/utils/adt/jsonb.c
M src/include/utils/jsonapi.h

Fix missing dependencies in ecpg's test Makefiles.

commit   : 14d309cc55d88b73d4c9d1fa51b535ae491405fd    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 8 May 2014 22:34:51 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 8 May 2014 22:34:51 -0400    

Click here for diff

Ensure that ecpg preprocessor output files are rebuilt when re-testing  
after a change in the ecpg preprocessor itself, or a change in any of  
several include files that get copied verbatim into the output files.  
The lack of these dependencies was what created problems for Kevin Grittner  
after the recent pgindent run.  There's no way for --enable-depend to  
discover these dependencies automatically, so we've gotta put them into  
the Makefiles by hand.  
  
While at it, reduce the amount of duplication in the ecpg invocations.  

M src/interfaces/ecpg/test/Makefile.regress
M src/interfaces/ecpg/test/compat_informix/Makefile
M src/interfaces/ecpg/test/preproc/Makefile
M src/interfaces/ecpg/test/sql/Makefile

Document permissions needed for pg_database_size and pg_tablespace_size.

commit   : fb1974cc6b58cd21a269dd7ab8aea0120906ec3b    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 8 May 2014 21:45:02 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 8 May 2014 21:45:02 -0400    

Click here for diff

Back in 8.3, we installed permissions checks in these functions (see  
commits 8bc225e7990a and cc26599b7206).  But we forgot to document that  
anywhere in the user-facing docs; it did get mentioned in the 8.3 release  
notes, but nobody's looking at that any more.  Per gripe from Suya Huang.  

M doc/src/sgml/func.sgml

Increase the default value of effective_cache_size to 4GB.

commit   : b910d7ea358b0134d170ebf4002248df25a5f244    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 8 May 2014 21:11:47 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 8 May 2014 21:11:47 -0400    

Click here for diff

Per discussion, the old value of 128MB is ridiculously small on modern  
machines; in fact, it's not even any larger than the default value of  
shared_buffers, which it certainly should be.  Increase to 4GB, which  
is unlikely to be any worse than the old default for anyone, and should  
be noticeably better for most.  Eventually we might have an autotuning  
scheme for this setting, but the recent attempt crashed and burned,  
so for now just do this.  

M doc/src/sgml/config.sgml
M doc/src/sgml/release-9.4.sgml
M src/backend/utils/misc/postgresql.conf.sample
M src/include/optimizer/cost.h

Revert "Auto-tune effective_cache size to be 4x shared buffers"

commit   : a16d421ca4fc639929bc964b2585e8382cf16e33    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 8 May 2014 20:49:38 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 8 May 2014 20:49:38 -0400    

Click here for diff

This reverts commit ee1e5662d8d8330726eaef7d3110cb7add24d058, as well as  
a remarkably large number of followup commits, which were mostly concerned  
with the fact that the implementation didn't work terribly well.  It still  
doesn't: we probably need some rather basic work in the GUC infrastructure  
if we want to fully support GUCs whose default varies depending on the  
value of another GUC.  Meanwhile, it also emerged that there wasn't really  
consensus in favor of the definition the patch tried to implement (ie,  
effective_cache_size should default to 4 times shared_buffers).  So whack  
it all back to where it was.  In a followup commit, I'll do what was  
recently agreed to, which is to simply change the default to a higher  
value.  

M doc/src/sgml/config.sgml
M src/backend/optimizer/path/costsize.c
M src/backend/utils/misc/guc-file.l
M src/backend/utils/misc/guc.c
M src/backend/utils/misc/postgresql.conf.sample
M src/include/optimizer/cost.h
M src/include/utils/guc.h
M src/test/regress/expected/join.out
M src/test/regress/sql/join.sql

Un-break ecpg test suite under --disable-integer-datetimes.

commit   : 08c8e8962f56c23c6799178d52d3b31350a0708f    
  
author   : Noah Misch <[email protected]>    
date     : Thu, 8 May 2014 19:29:02 -0400    
  
committer: Noah Misch <[email protected]>    
date     : Thu, 8 May 2014 19:29:02 -0400    

Click here for diff

Commit 4318daecc959886d001a6e79c6ea853e8b1dfb4b broke it.  The change in  
sub-second precision at extreme dates is normal.  The inconsistent  
truncation vs. rounding is essentially a bug, albeit a longstanding one.  
Back-patch to 8.4, like the causative commit.  

M src/interfaces/ecpg/test/expected/pgtypeslib-dt_test2.c
M src/interfaces/ecpg/test/expected/pgtypeslib-dt_test2.stdout
M src/interfaces/ecpg/test/pgtypeslib/dt_test2.pgc

Fix comment.

commit   : 1e81f8462aceb07d520daaabdc999b879381bd12    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 8 May 2014 12:42:56 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 8 May 2014 12:42:56 -0400    

Click here for diff

Previous commit was confused about the case we're handling: actually,  
what the patch is dealing with is platforms that have optreset, *and*  
have <getopt.h>, but the latter fails to declare the former.  Because  
we use a linking probe to set HAVE_INT_OPTRESET, we need to be sure we  
have a declaration even if <getopt.h> doesn't think it exists.  

M src/include/pg_getopt.h

Allow for platforms that have optreset but not <getopt.h>.

commit   : 0c15a524c532c1006a7bd36d3a680f8e8b8db9fc    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 8 May 2014 12:33:29 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 8 May 2014 12:33:29 -0400    

Click here for diff

Reportedly, some versions of mingw are like that, and it seems plausible  
in general that older platforms might be that way.  However, we'd  
determined experimentally that just doing "extern int" conflicts with  
the way Cygwin declares these variables, so explicitly exclude Cygwin.  
  
Michael Paquier, tweaked by me to hopefully not break Cygwin  

M src/include/pg_getopt.h

Protect against torn pages when deleting GIN list pages.

commit   : 4f7bb4b2a36facc94a1d6b821ec6733093aa9bc6    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Thu, 8 May 2014 14:43:04 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Thu, 8 May 2014 14:43:04 +0300    

Click here for diff

To-be-deleted list pages contain no useful information, as they are being  
deleted, but we must still protect the writes from being torn by a crash  
after a partial write. To do that, re-initialize the pages on WAL replay.  
  
Jeff Janes caught this with a test program to test partial writes.  
Backpatch to all supported versions.  

M src/backend/access/gin/ginxlog.c

Include files copied from libpqport in .gitignore

commit   : 02c9a938057ecb811c65999577d32c5f5e9c99dc    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Thu, 8 May 2014 10:56:57 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Thu, 8 May 2014 10:56:57 +0300    

Click here for diff

Michael Paquier  

M src/interfaces/libpq/.gitignore

Avoid buffer bloat in libpq when server is consistently faster than client.

commit   : 2f557167b19af79ffecb8faedf8b7bce4d48f3e1    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 7 May 2014 21:38:36 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 7 May 2014 21:38:36 -0400    

Click here for diff

If the server sends a long stream of data, and the server + network are  
consistently fast enough to force the recv() loop in pqReadData() to  
iterate until libpq's input buffer is full, then upon processing the last  
incomplete message in each bufferload we'd usually double the buffer size,  
due to supposing that we didn't have enough room in the buffer to finish  
collecting that message.  After filling the newly-enlarged buffer, the  
cycle repeats, eventually resulting in an out-of-memory situation (which  
would be reported misleadingly as "lost synchronization with server").  
Of course, we should not enlarge the buffer unless we still need room  
after discarding already-processed messages.  
  
This bug dates back quite a long time: pqParseInput3 has had the behavior  
since perhaps 2003, getCopyDataMessage at least since commit 70066eb1a1ad  
in 2008.  Probably the reason it's not been isolated before is that in  
common environments the recv() loop would always be faster than the server  
(if on the same machine) or faster than the network (if not); or at least  
it wouldn't be slower consistently enough to let the buffer ramp up to a  
problematic size.  The reported cases involve Windows, which perhaps has  
different timing behavior than other platforms.  
  
Per bug #7914 from Shin-ichi Morita, though this is different from his  
proposed solution.  Back-patch to all supported branches.  

M src/interfaces/libpq/fe-misc.c

When a background worker exists with code 0, unregister it.

commit   : be7558162acc5578d0b2cf0c8d4c76b6076ce352    
  
author   : Robert Haas <[email protected]>    
date     : Wed, 7 May 2014 17:43:39 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Wed, 7 May 2014 17:43:39 -0400    

Click here for diff

The previous behavior was to restart immediately, which was generally  
viewed as less useful.  
  
Petr Jelinek, with some adjustments by me.  

M doc/src/sgml/bgworker.sgml
M src/backend/postmaster/bgworker.c
M src/backend/postmaster/postmaster.c
M src/include/postmaster/bgworker.h

Fix build after removing JsonbValue.estSize field.

commit   : 7572b7735971cd7a5ef289e133eedf7d82f79c42    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Thu, 8 May 2014 00:05:43 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Thu, 8 May 2014 00:05:43 +0300    

Click here for diff

Oops, I didn't realize that contrib/hstore refers to jsonb stuff.  

M contrib/hstore/hstore_io.c

When a bgworker exits, always call ReleasePostmasterChildSlot.

commit   : eee6cf1f337aa488a20e9111df446cdad770e645    
  
author   : Robert Haas <[email protected]>    
date     : Wed, 7 May 2014 16:30:23 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Wed, 7 May 2014 16:30:23 -0400    

Click here for diff

Commit e2ce9aa27bf20eff2d991d0267a15ea5f7024cd7 was insufficiently  
well thought out.  Repair.  

M src/backend/postmaster/postmaster.c

Restart bgworkers immediately after a crash-and-restart cycle.

commit   : 970d1f76d1600dfbdbd9cd88a9e2af113e253798    
  
author   : Robert Haas <[email protected]>    
date     : Wed, 7 May 2014 16:04:47 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Wed, 7 May 2014 16:04:47 -0400    

Click here for diff

Just as we would start bgworkers immediately after an initial startup  
of the server, we should restart them immediately when reinitializing.  
  
Petr Jelinek and Robert Haas  

M src/backend/postmaster/bgworker.c
M src/backend/postmaster/postmaster.c
M src/include/postmaster/bgworker_internals.h

Clean up jsonb code.

commit   : 364ddc3e5cbd01c93a39896b5260509129a9883e    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Wed, 7 May 2014 23:16:19 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Wed, 7 May 2014 23:16:19 +0300    

Click here for diff

The main target of this cleanup is the convertJsonb() function, but I also  
touched a lot of other things that I spotted into in the process.  
  
The new convertToJsonb() function uses an output buffer that's resized on  
demand, so the code to estimate of the size of JsonbValue is removed.  
  
The on-disk format was not changed, even though I refactored the structs  
used to handle it. The term "superheader" is replaced with "container".  
  
The jsonb_exists_any and jsonb_exists_all functions no longer sort the input  
array. That was a premature optimization, the idea being that if there are  
duplicates in the input array, you only need to check them once. Also,  
sorting the array saves some effort in the binary search used to find a key  
within an object. But there were drawbacks too: the sorting and  
deduplicating obviously isn't free, and in the typical case there are no  
duplicates to remove, and the gain in the binary search was minimal. Remove  
all that, which makes the code simpler too.  
  
This includes a bug-fix; the total length of the elements in a jsonb array  
or object mustn't exceed 2^28. That is now checked.  

M src/backend/utils/adt/jsonb.c
M src/backend/utils/adt/jsonb_gin.c
M src/backend/utils/adt/jsonb_op.c
M src/backend/utils/adt/jsonb_util.c
M src/backend/utils/adt/jsonfuncs.c
M src/include/utils/jsonb.h

Detach shared memory from bgworkers without shmem access.

commit   : 4d155d8b08fe08c1a1649fdbad61c6dcf4a8671f    
  
author   : Robert Haas <[email protected]>    
date     : Wed, 7 May 2014 14:54:43 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Wed, 7 May 2014 14:54:43 -0400    

Click here for diff

Since the postmaster won't perform a crash-and-restart sequence  
for background workers which don't request shared memory access,  
we'd better make sure that they can't corrupt shared memory.  
  
Patch by me, review by Tom Lane.  

M src/backend/postmaster/bgworker.c

Fix failure to set ActiveSnapshot while rewinding a cursor.

commit   : 04e5025be8bbe572e12b19c4ba9e2a8360b8ffe5    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 7 May 2014 14:25:11 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 7 May 2014 14:25:11 -0400    

Click here for diff

ActiveSnapshot needs to be set when we call ExecutorRewind because some  
plan node types may execute user-defined functions during their ReScan  
calls (nodeLimit.c does so, at least).  The wisdom of that is somewhat  
debatable, perhaps, but for now the simplest fix is to make sure the  
required context is valid.  Failure to do this typically led to a  
null-pointer-dereference core dump, though it's possible that in more  
complex cases a function could be executed with the wrong snapshot  
leading to very subtle misbehavior.  
  
Per report from Leif Jensen.  It's been broken for a long time, so  
back-patch to all active branches.  

M src/backend/tcop/pquery.c
M src/test/regress/expected/portals.out
M src/test/regress/sql/portals.sql

Never crash-and-restart for bgworkers without shared memory access.

commit   : e2ce9aa27bf20eff2d991d0267a15ea5f7024cd7    
  
author   : Robert Haas <[email protected]>    
date     : Wed, 7 May 2014 13:19:02 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Wed, 7 May 2014 13:19:02 -0400    

Click here for diff

The motivation for a crash and restart cycle when a backend dies is  
that it might have corrupted shared memory on the way down; and we  
can't recover reliably except by reinitializing everything.  But that  
doesn't apply to processes that don't touch shared memory.  Currently,  
there's nothing to prevent a background worker that doesn't request  
shared memory access from touching shared memory anyway, but that's a  
separate bug.  
  
Previous to this commit, the coding in postmaster.c was inconsistent:  
an exit status other than 0 or 1 didn't provoke a crash-and-restart,  
but failure to release the postmaster child slot did.  This change  
makes those cases consistent.  

M src/backend/postmaster/postmaster.c

Fix some more confusion between uint32 and Datum.

commit   : 1891b415f0cf45d56f29af423598f8518754d675    
  
author   : Tom Lane <[email protected]>    
date     : Tue, 6 May 2014 23:52:30 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Tue, 6 May 2014 23:52:30 -0400    

Click here for diff

M src/backend/utils/adt/jsonb_gin.c

Fix interval test, which was broken for floating-point timestamps.

commit   : 348aa75a678069569923c501206d5a1ca03654e3    
  
author   : Jeff Davis <[email protected]>    
date     : Tue, 6 May 2014 19:35:24 -0700    
  
committer: Jeff Davis <[email protected]>    
date     : Tue, 6 May 2014 19:35:24 -0700    

Click here for diff

Commit 4318daecc959886d001a6e79c6ea853e8b1dfb4b introduced a test that  
couldn't be made consistent between integer and floating-point  
timestamps.  
  
It was designed to test the longest possible interval output length,  
so removing four zeros from the number of hours, as this patch does,  
is not ideal. But the test still has some utility for its original  
purpose, and there aren't a lot of other good options.  
  
Noah Misch suggested a different approach where we test that the  
output either matches what we expect from integer timestamps or what  
we expect from floating-point timestamps. That seemed to obscure an  
otherwise simple test, however.  
  
Reviewed by Tom Lane and Noah Misch.  

M src/test/regress/expected/interval.out
M src/test/regress/sql/interval.sql

hash_any returns Datum, not uint32 (and definitely not "int").

commit   : 2c22afaa4e29cbd773bae3f043a941f82ff30e2d    
  
author   : Tom Lane <[email protected]>    
date     : Tue, 6 May 2014 22:49:32 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Tue, 6 May 2014 22:49:32 -0400    

Click here for diff

The coding in JsonbHashScalarValue might have accidentally failed to fail  
given current representational choices, but the key word there would be  
"accidental".  Insert the appropriate datatype conversion macro.  And  
use the right conversion macro for hash_numeric's result, too.  
  
In passing make the code a bit cleaner and less repetitive by factoring  
out the xor step from the switch.  

M src/backend/utils/adt/jsonb_util.c

Improve comment for tricky aspect of index-only scans.

commit   : 35c0cd3b05b0be18dc2d049c33b38a2d13993ffe    
  
author   : Jeff Davis <[email protected]>    
date     : Sun, 4 May 2014 13:18:55 -0700    
  
committer: Jeff Davis <[email protected]>    
date     : Sun, 4 May 2014 13:18:55 -0700    

Click here for diff

Index-only scans avoid taking a lock on the VM buffer, which would  
cause a lot of contention. To be correct, that requires some intricate  
assumptions that weren't completely documented in the previous  
comment.  
  
Reviewed by Robert Haas.  

M src/backend/executor/nodeIndexonlyscan.c

doc: Fix DocBook XML validity

commit   : 3a9d430af515e9dd8a9d34a4011367e667a66521    
  
author   : Peter Eisentraut <[email protected]>    
date     : Tue, 6 May 2014 21:28:58 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Tue, 6 May 2014 21:28:58 -0400    

Click here for diff

The main problem is that DocBook SGML allows indexterm elements just  
about everywhere, but DocBook XML is stricter.  For example, this common  
pattern  
  
    <varlistentry>  
     <indexterm>...</indexterm>  
     <term>...</term>  
     ...  
    </varlistentry>  
  
needs to be changed to something like  
  
    <varlistentry>  
     <term>...<indexterm>...</indexterm></term>  
     ...  
    </varlistentry>  
  
See also bb4eefe7bf518e42c73797ea37b033a5d8a8e70a.  
  
There is currently nothing in the build system that enforces that things  
stay valid, because that requires additional tools and will receive  
separate consideration.  

M doc/src/sgml/auth-delay.sgml
M doc/src/sgml/auto-explain.sgml
M doc/src/sgml/config.sgml
M doc/src/sgml/dfunc.sgml
M doc/src/sgml/installation.sgml
M doc/src/sgml/libpq.sgml
M doc/src/sgml/logicaldecoding.sgml
M doc/src/sgml/pageinspect.sgml
M doc/src/sgml/pgfreespacemap.sgml
M doc/src/sgml/pgstatstatements.sgml
M doc/src/sgml/pgstattuple.sgml
M doc/src/sgml/plperl.sgml
M doc/src/sgml/pltcl.sgml
M doc/src/sgml/protocol.sgml
M doc/src/sgml/queries.sgml
M doc/src/sgml/recovery-config.sgml
M doc/src/sgml/ref/alter_table.sgml
M doc/src/sgml/ref/pg_recvlogical.sgml
M doc/src/sgml/ref/psql-ref.sgml
M doc/src/sgml/rules.sgml
M doc/src/sgml/runtime.sgml
M doc/src/sgml/sepgsql.sgml
M doc/src/sgml/sslinfo.sgml
M doc/src/sgml/textsearch.sgml

With ecpg exclusion removed, re-run pgindent for 9.4

commit   : 84288a86ac74dbeae486b6ff699c017f7d9517bb    
  
author   : Bruce Momjian <[email protected]>    
date     : Tue, 6 May 2014 20:39:28 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Tue, 6 May 2014 20:39:28 -0400    

Click here for diff

Report by Tom Lane  

M src/backend/utils/adt/jsonb_util.c
M src/interfaces/ecpg/include/sqlda.h
M src/interfaces/ecpg/include/sqltypes.h
M src/interfaces/ecpg/test/expected/compat_informix-describe.c
M src/interfaces/ecpg/test/expected/compat_informix-sqlda.c
M src/interfaces/ecpg/test/expected/sql-describe.c
M src/interfaces/ecpg/test/expected/sql-sqlda.c

Remove pgindent ecpg exclusion pattern

commit   : 9516668e48abcc5c036ecb199acf15e5bcc4b008    
  
author   : Bruce Momjian <[email protected]>    
date     : Tue, 6 May 2014 20:09:00 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Tue, 6 May 2014 20:09:00 -0400    

Click here for diff

Report by Tom Lane  

M src/tools/pgindent/exclude_file_patterns

pg_basebackup streaming: adjust version check msg

commit   : 250f259a44411d341e75928401503a681844c59d    
  
author   : Simon Riggs <[email protected]>    
date     : Tue, 6 May 2014 22:50:06 +0100    
  
committer: Simon Riggs <[email protected]>    
date     : Tue, 6 May 2014 22:50:06 +0100    

Click here for diff

Allow for translatable string, rather than use "or"  

M src/bin/pg_basebackup/receivelog.c

Improve pgindent test instructions

commit   : 7c7b1f4ae5ea3b1b113682d4d4e5af4356b053bc    
  
author   : Bruce Momjian <[email protected]>    
date     : Tue, 6 May 2014 15:33:25 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Tue, 6 May 2014 15:33:25 -0400    

Click here for diff

M src/tools/pgindent/README

Fix logic bug in dsm_attach().

commit   : e0124230ba2b6778671f26b06af0d8d04bcb4d1c    
  
author   : Robert Haas <[email protected]>    
date     : Tue, 6 May 2014 13:37:46 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Tue, 6 May 2014 13:37:46 -0400    

Click here for diff

The previous coding would potentially cause attaching to segment A to  
fail if segment B was at the same time in the process of going away.  
  
Andres Freund, with a comment tweak by me  

M src/backend/storage/ipc/dsm.c

Fix improperly passed file descriptors

commit   : 4335c958154c39ef99a38dc953b3f803b13a1048    
  
author   : Bruce Momjian <[email protected]>    
date     : Tue, 6 May 2014 12:20:51 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Tue, 6 May 2014 12:20:51 -0400    

Click here for diff

Fix for commit 14ea89366fe321609afc5838ff9fe2ded1cd707d  
  
Report by Andres Freund  

M src/bin/pg_dump/pg_backup_tar.c

pgindent run for 9.4

commit   : 0a7832005792fa6dad171f9cadb8d587fe0dd800    
  
author   : Bruce Momjian <[email protected]>    
date     : Tue, 6 May 2014 12:12:18 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Tue, 6 May 2014 12:12:18 -0400    

Click here for diff

This includes removing tabs after periods in C comments, which was  
applied to back branches, so this change should not effect backpatching.  

M config/test_quiet_include.h
M contrib/auto_explain/auto_explain.c
M contrib/btree_gist/btree_interval.c
M contrib/cube/cube.c
M contrib/cube/cubedata.h
M contrib/dblink/dblink.c
M contrib/earthdistance/earthdistance.c
M contrib/file_fdw/file_fdw.c
M contrib/fuzzystrmatch/levenshtein.c
M contrib/hstore/hstore.h
M contrib/hstore/hstore_gin.c
M contrib/hstore/hstore_io.c
M contrib/intarray/_int_bool.c
M contrib/intarray/_int_gist.c
M contrib/intarray/_int_tool.c
M contrib/intarray/bench/bench.pl
M contrib/ltree/ltree_op.c
M contrib/oid2name/oid2name.c
M contrib/pageinspect/rawpage.c
M contrib/pg_archivecleanup/pg_archivecleanup.c
M contrib/pg_prewarm/pg_prewarm.c
M contrib/pg_stat_statements/pg_stat_statements.c
M contrib/pg_test_fsync/pg_test_fsync.c
M contrib/pg_trgm/trgm_gin.c
M contrib/pg_trgm/trgm_gist.c
M contrib/pg_trgm/trgm_regexp.c
M contrib/pg_upgrade/check.c
M contrib/pg_upgrade/controldata.c
M contrib/pg_upgrade/dump.c
M contrib/pg_upgrade/exec.c
M contrib/pg_upgrade/file.c
M contrib/pg_upgrade/function.c
M contrib/pg_upgrade/info.c
M contrib/pg_upgrade/option.c
M contrib/pg_upgrade/page.c
M contrib/pg_upgrade/parallel.c
M contrib/pg_upgrade/pg_upgrade.c
M contrib/pg_upgrade/pg_upgrade.h
M contrib/pg_upgrade/relfilenode.c
M contrib/pg_upgrade/server.c
M contrib/pg_upgrade/tablespace.c
M contrib/pg_upgrade/util.c
M contrib/pg_upgrade/version_old_8_3.c
M contrib/pg_xlogdump/compat.c
M contrib/pg_xlogdump/pg_xlogdump.c
M contrib/pgbench/pgbench.c
M contrib/pgcrypto/crypt-des.c
M contrib/pgcrypto/crypt-gensalt.c
M contrib/pgcrypto/fortuna.c
M contrib/pgcrypto/fortuna.h
M contrib/pgcrypto/imath.c
M contrib/pgcrypto/imath.h
M contrib/pgcrypto/internal-sha2.c
M contrib/pgcrypto/internal.c
M contrib/pgcrypto/mbuf.c
M contrib/pgcrypto/mbuf.h
M contrib/pgcrypto/md5.c
M contrib/pgcrypto/md5.h
M contrib/pgcrypto/openssl.c
M contrib/pgcrypto/pgcrypto.c
M contrib/pgcrypto/pgcrypto.h
M contrib/pgcrypto/pgp-armor.c
M contrib/pgcrypto/pgp-cfb.c
M contrib/pgcrypto/pgp-compress.c
M contrib/pgcrypto/pgp-decrypt.c
M contrib/pgcrypto/pgp-encrypt.c
M contrib/pgcrypto/pgp-info.c
M contrib/pgcrypto/pgp-mpi-internal.c
M contrib/pgcrypto/pgp-mpi-openssl.c
M contrib/pgcrypto/pgp-mpi.c
M contrib/pgcrypto/pgp-pgsql.c
M contrib/pgcrypto/pgp-pubdec.c
M contrib/pgcrypto/pgp-pubenc.c
M contrib/pgcrypto/pgp-pubkey.c
M contrib/pgcrypto/pgp-s2k.c
M contrib/pgcrypto/pgp.c
M contrib/pgcrypto/pgp.h
M contrib/pgcrypto/px-crypt.c
M contrib/pgcrypto/px-crypt.h
M contrib/pgcrypto/px-hmac.c
M contrib/pgcrypto/px.c
M contrib/pgcrypto/px.h
M contrib/pgcrypto/random.c
M contrib/pgcrypto/rijndael.c
M contrib/pgcrypto/rijndael.h
M contrib/pgcrypto/sha1.c
M contrib/pgcrypto/sha1.h
M contrib/pgcrypto/sha2.c
M contrib/pgcrypto/sha2.h
M contrib/pgstattuple/pgstatindex.c
M contrib/pgstattuple/pgstattuple.c
M contrib/postgres_fdw/connection.c
M contrib/postgres_fdw/deparse.c
M contrib/postgres_fdw/option.c
M contrib/postgres_fdw/postgres_fdw.c
M contrib/sepgsql/label.c
M contrib/sepgsql/uavc.c
M contrib/spi/timetravel.c
M contrib/sslinfo/sslinfo.c
M contrib/tcn/tcn.c
M contrib/test_decoding/test_decoding.c
M contrib/test_shm_mq/setup.c
M contrib/test_shm_mq/test.c
M contrib/test_shm_mq/test_shm_mq.h
M contrib/test_shm_mq/worker.c
M contrib/worker_spi/worker_spi.c
M contrib/xml2/xpath.c
M src/backend/access/common/heaptuple.c
M src/backend/access/common/indextuple.c
M src/backend/access/common/printtup.c
M src/backend/access/common/reloptions.c
M src/backend/access/common/tupconvert.c
M src/backend/access/common/tupdesc.c
M src/backend/access/gin/ginarrayproc.c
M src/backend/access/gin/ginbtree.c
M src/backend/access/gin/ginbulk.c
M src/backend/access/gin/gindatapage.c
M src/backend/access/gin/ginentrypage.c
M src/backend/access/gin/ginfast.c
M src/backend/access/gin/ginget.c
M src/backend/access/gin/gininsert.c
M src/backend/access/gin/ginlogic.c
M src/backend/access/gin/ginpostinglist.c
M src/backend/access/gin/ginscan.c
M src/backend/access/gin/ginutil.c
M src/backend/access/gin/ginvacuum.c
M src/backend/access/gin/ginxlog.c
M src/backend/access/gist/gist.c
M src/backend/access/gist/gistget.c
M src/backend/access/gist/gistscan.c
M src/backend/access/gist/gistsplit.c
M src/backend/access/gist/gistutil.c
M src/backend/access/gist/gistvacuum.c
M src/backend/access/gist/gistxlog.c
M src/backend/access/hash/hash.c
M src/backend/access/hash/hashfunc.c
M src/backend/access/hash/hashinsert.c
M src/backend/access/hash/hashovfl.c
M src/backend/access/hash/hashpage.c
M src/backend/access/hash/hashsearch.c
M src/backend/access/hash/hashsort.c
M src/backend/access/hash/hashutil.c
M src/backend/access/heap/heapam.c
M src/backend/access/heap/hio.c
M src/backend/access/heap/pruneheap.c
M src/backend/access/heap/rewriteheap.c
M src/backend/access/heap/syncscan.c
M src/backend/access/heap/tuptoaster.c
M src/backend/access/heap/visibilitymap.c
M src/backend/access/index/genam.c
M src/backend/access/index/indexam.c
M src/backend/access/nbtree/nbtcompare.c
M src/backend/access/nbtree/nbtinsert.c
M src/backend/access/nbtree/nbtpage.c
M src/backend/access/nbtree/nbtree.c
M src/backend/access/nbtree/nbtsearch.c
M src/backend/access/nbtree/nbtsort.c
M src/backend/access/nbtree/nbtutils.c
M src/backend/access/nbtree/nbtxlog.c
M src/backend/access/rmgrdesc/gindesc.c
M src/backend/access/rmgrdesc/nbtdesc.c
M src/backend/access/spgist/spgdoinsert.c
M src/backend/access/spgist/spginsert.c
M src/backend/access/spgist/spgscan.c
M src/backend/access/spgist/spgtextproc.c
M src/backend/access/spgist/spgutils.c
M src/backend/access/spgist/spgvacuum.c
M src/backend/access/spgist/spgxlog.c
M src/backend/access/transam/clog.c
M src/backend/access/transam/multixact.c
M src/backend/access/transam/slru.c
M src/backend/access/transam/subtrans.c
M src/backend/access/transam/timeline.c
M src/backend/access/transam/transam.c
M src/backend/access/transam/twophase.c
M src/backend/access/transam/varsup.c
M src/backend/access/transam/xact.c
M src/backend/access/transam/xlog.c
M src/backend/access/transam/xlogarchive.c
M src/backend/access/transam/xlogfuncs.c
M src/backend/access/transam/xlogreader.c
M src/backend/bootstrap/bootstrap.c
M src/backend/catalog/aclchk.c
M src/backend/catalog/catalog.c
M src/backend/catalog/dependency.c
M src/backend/catalog/heap.c
M src/backend/catalog/index.c
M src/backend/catalog/indexing.c
M src/backend/catalog/namespace.c
M src/backend/catalog/objectaddress.c
M src/backend/catalog/pg_aggregate.c
M src/backend/catalog/pg_collation.c
M src/backend/catalog/pg_constraint.c
M src/backend/catalog/pg_db_role_setting.c
M src/backend/catalog/pg_depend.c
M src/backend/catalog/pg_enum.c
M src/backend/catalog/pg_largeobject.c
M src/backend/catalog/pg_operator.c
M src/backend/catalog/pg_proc.c
M src/backend/catalog/pg_shdepend.c
M src/backend/catalog/pg_type.c
M src/backend/catalog/storage.c
M src/backend/catalog/toasting.c
M src/backend/commands/aggregatecmds.c
M src/backend/commands/alter.c
M src/backend/commands/analyze.c
M src/backend/commands/async.c
M src/backend/commands/cluster.c
M src/backend/commands/constraint.c
M src/backend/commands/copy.c
M src/backend/commands/createas.c
M src/backend/commands/dbcommands.c
M src/backend/commands/define.c
M src/backend/commands/event_trigger.c
M src/backend/commands/explain.c
M src/backend/commands/extension.c
M src/backend/commands/foreigncmds.c
M src/backend/commands/functioncmds.c
M src/backend/commands/indexcmds.c
M src/backend/commands/matview.c
M src/backend/commands/opclasscmds.c
M src/backend/commands/operatorcmds.c
M src/backend/commands/portalcmds.c
M src/backend/commands/prepare.c
M src/backend/commands/proclang.c
M src/backend/commands/schemacmds.c
M src/backend/commands/sequence.c
M src/backend/commands/tablecmds.c
M src/backend/commands/tablespace.c
M src/backend/commands/trigger.c
M src/backend/commands/typecmds.c
M src/backend/commands/user.c
M src/backend/commands/vacuum.c
M src/backend/commands/vacuumlazy.c
M src/backend/commands/variable.c
M src/backend/commands/view.c
M src/backend/executor/execAmi.c
M src/backend/executor/execCurrent.c
M src/backend/executor/execJunk.c
M src/backend/executor/execMain.c
M src/backend/executor/execProcnode.c
M src/backend/executor/execQual.c
M src/backend/executor/execScan.c
M src/backend/executor/execTuples.c
M src/backend/executor/execUtils.c
M src/backend/executor/functions.c
M src/backend/executor/nodeAgg.c
M src/backend/executor/nodeAppend.c
M src/backend/executor/nodeBitmapHeapscan.c
M src/backend/executor/nodeForeignscan.c
M src/backend/executor/nodeFunctionscan.c
M src/backend/executor/nodeHash.c
M src/backend/executor/nodeHashjoin.c
M src/backend/executor/nodeIndexonlyscan.c
M src/backend/executor/nodeIndexscan.c
M src/backend/executor/nodeLimit.c
M src/backend/executor/nodeLockRows.c
M src/backend/executor/nodeMaterial.c
M src/backend/executor/nodeMergeAppend.c
M src/backend/executor/nodeMergejoin.c
M src/backend/executor/nodeModifyTable.c
M src/backend/executor/nodeRecursiveunion.c
M src/backend/executor/nodeSetOp.c
M src/backend/executor/nodeSubplan.c
M src/backend/executor/nodeSubqueryscan.c
M src/backend/executor/nodeUnique.c
M src/backend/executor/nodeValuesscan.c
M src/backend/executor/nodeWindowAgg.c
M src/backend/executor/nodeWorktablescan.c
M src/backend/executor/spi.c
M src/backend/executor/tstoreReceiver.c
M src/backend/lib/stringinfo.c
M src/backend/libpq/auth.c
M src/backend/libpq/be-fsstubs.c
M src/backend/libpq/be-secure.c
M src/backend/libpq/hba.c
M src/backend/libpq/md5.c
M src/backend/libpq/pqcomm.c
M src/backend/libpq/pqformat.c
M src/backend/main/main.c
M src/backend/nodes/bitmapset.c
M src/backend/nodes/copyfuncs.c
M src/backend/nodes/equalfuncs.c
M src/backend/nodes/list.c
M src/backend/nodes/makefuncs.c
M src/backend/nodes/nodeFuncs.c
M src/backend/nodes/outfuncs.c
M src/backend/nodes/params.c
M src/backend/nodes/read.c
M src/backend/nodes/readfuncs.c
M src/backend/nodes/tidbitmap.c
M src/backend/optimizer/geqo/geqo_eval.c
M src/backend/optimizer/path/allpaths.c
M src/backend/optimizer/path/clausesel.c
M src/backend/optimizer/path/costsize.c
M src/backend/optimizer/path/equivclass.c
M src/backend/optimizer/path/indxpath.c
M src/backend/optimizer/path/joinpath.c
M src/backend/optimizer/path/joinrels.c
M src/backend/optimizer/path/pathkeys.c
M src/backend/optimizer/path/tidpath.c
M src/backend/optimizer/plan/analyzejoins.c
M src/backend/optimizer/plan/createplan.c
M src/backend/optimizer/plan/initsplan.c
M src/backend/optimizer/plan/planagg.c
M src/backend/optimizer/plan/planmain.c
M src/backend/optimizer/plan/planner.c
M src/backend/optimizer/plan/setrefs.c
M src/backend/optimizer/plan/subselect.c
M src/backend/optimizer/prep/prepjointree.c
M src/backend/optimizer/prep/prepqual.c
M src/backend/optimizer/prep/prepsecurity.c
M src/backend/optimizer/prep/preptlist.c
M src/backend/optimizer/prep/prepunion.c
M src/backend/optimizer/util/clauses.c
M src/backend/optimizer/util/joininfo.c
M src/backend/optimizer/util/orclauses.c
M src/backend/optimizer/util/pathnode.c
M src/backend/optimizer/util/placeholder.c
M src/backend/optimizer/util/plancat.c
M src/backend/optimizer/util/predtest.c
M src/backend/optimizer/util/relnode.c
M src/backend/optimizer/util/restrictinfo.c
M src/backend/optimizer/util/tlist.c
M src/backend/optimizer/util/var.c
M src/backend/parser/analyze.c
M src/backend/parser/kwlookup.c
M src/backend/parser/parse_agg.c
M src/backend/parser/parse_clause.c
M src/backend/parser/parse_coerce.c
M src/backend/parser/parse_collate.c
M src/backend/parser/parse_cte.c
M src/backend/parser/parse_expr.c
M src/backend/parser/parse_func.c
M src/backend/parser/parse_node.c
M src/backend/parser/parse_oper.c
M src/backend/parser/parse_param.c
M src/backend/parser/parse_relation.c
M src/backend/parser/parse_target.c
M src/backend/parser/parse_type.c
M src/backend/parser/parse_utilcmd.c
M src/backend/parser/parser.c
M src/backend/parser/scansup.c
M src/backend/port/darwin/system.c
M src/backend/port/dynloader/darwin.c
M src/backend/port/dynloader/freebsd.c
M src/backend/port/dynloader/netbsd.c
M src/backend/port/dynloader/openbsd.c
M src/backend/port/posix_sema.c
M src/backend/port/sysv_sema.c
M src/backend/port/sysv_shmem.c
M src/backend/port/unix_latch.c
M src/backend/port/win32/socket.c
M src/backend/port/win32_latch.c
M src/backend/port/win32_shmem.c
M src/backend/postmaster/autovacuum.c
M src/backend/postmaster/bgworker.c
M src/backend/postmaster/bgwriter.c
M src/backend/postmaster/checkpointer.c
M src/backend/postmaster/fork_process.c
M src/backend/postmaster/pgarch.c
M src/backend/postmaster/pgstat.c
M src/backend/postmaster/postmaster.c
M src/backend/postmaster/startup.c
M src/backend/postmaster/syslogger.c
M src/backend/postmaster/walwriter.c
M src/backend/regex/regc_color.c
M src/backend/regex/regc_cvec.c
M src/backend/regex/regc_lex.c
M src/backend/regex/regc_locale.c
M src/backend/regex/regc_nfa.c
M src/backend/regex/regc_pg_locale.c
M src/backend/regex/regcomp.c
M src/backend/regex/rege_dfa.c
M src/backend/regex/regerror.c
M src/backend/regex/regexec.c
M src/backend/regex/regfree.c
M src/backend/regex/regprefix.c
M src/backend/replication/basebackup.c
M src/backend/replication/libpqwalreceiver/libpqwalreceiver.c
M src/backend/replication/logical/decode.c
M src/backend/replication/logical/logical.c
M src/backend/replication/logical/logicalfuncs.c
M src/backend/replication/logical/reorderbuffer.c
M src/backend/replication/logical/snapbuild.c
M src/backend/replication/slot.c
M src/backend/replication/slotfuncs.c
M src/backend/replication/syncrep.c
M src/backend/replication/walreceiver.c
M src/backend/replication/walreceiverfuncs.c
M src/backend/replication/walsender.c
M src/backend/rewrite/rewriteDefine.c
M src/backend/rewrite/rewriteHandler.c
M src/backend/rewrite/rewriteManip.c
M src/backend/rewrite/rewriteSupport.c
M src/backend/storage/buffer/buf_init.c
M src/backend/storage/buffer/buf_table.c
M src/backend/storage/buffer/bufmgr.c
M src/backend/storage/buffer/freelist.c
M src/backend/storage/buffer/localbuf.c
M src/backend/storage/file/buffile.c
M src/backend/storage/file/fd.c
M src/backend/storage/freespace/freespace.c
M src/backend/storage/freespace/fsmpage.c
M src/backend/storage/ipc/dsm.c
M src/backend/storage/ipc/dsm_impl.c
M src/backend/storage/ipc/ipc.c
M src/backend/storage/ipc/ipci.c
M src/backend/storage/ipc/pmsignal.c
M src/backend/storage/ipc/procarray.c
M src/backend/storage/ipc/procsignal.c
M src/backend/storage/ipc/shm_mq.c
M src/backend/storage/ipc/shm_toc.c
M src/backend/storage/ipc/shmem.c
M src/backend/storage/ipc/shmqueue.c
M src/backend/storage/ipc/sinval.c
M src/backend/storage/ipc/sinvaladt.c
M src/backend/storage/ipc/standby.c
M src/backend/storage/large_object/inv_api.c
M src/backend/storage/lmgr/deadlock.c
M src/backend/storage/lmgr/lmgr.c
M src/backend/storage/lmgr/lock.c
M src/backend/storage/lmgr/lwlock.c
M src/backend/storage/lmgr/predicate.c
M src/backend/storage/lmgr/proc.c
M src/backend/storage/lmgr/s_lock.c
M src/backend/storage/lmgr/spin.c
M src/backend/storage/page/bufpage.c
M src/backend/storage/smgr/md.c
M src/backend/storage/smgr/smgr.c
M src/backend/tcop/fastpath.c
M src/backend/tcop/postgres.c
M src/backend/tcop/pquery.c
M src/backend/tcop/utility.c
M src/backend/tsearch/ts_locale.c
M src/backend/tsearch/ts_selfuncs.c
M src/backend/tsearch/ts_typanalyze.c
M src/backend/tsearch/ts_utils.c
M src/backend/tsearch/wparser_def.c
M src/backend/utils/adt/acl.c
M src/backend/utils/adt/array_selfuncs.c
M src/backend/utils/adt/array_typanalyze.c
M src/backend/utils/adt/array_userfuncs.c
M src/backend/utils/adt/arrayfuncs.c
M src/backend/utils/adt/arrayutils.c
M src/backend/utils/adt/cash.c
M src/backend/utils/adt/char.c
M src/backend/utils/adt/date.c
M src/backend/utils/adt/datetime.c
M src/backend/utils/adt/datum.c
M src/backend/utils/adt/dbsize.c
M src/backend/utils/adt/domains.c
M src/backend/utils/adt/float.c
M src/backend/utils/adt/format_type.c
M src/backend/utils/adt/formatting.c
M src/backend/utils/adt/geo_ops.c
M src/backend/utils/adt/geo_selfuncs.c
M src/backend/utils/adt/inet_cidr_ntop.c
M src/backend/utils/adt/int.c
M src/backend/utils/adt/int8.c
M src/backend/utils/adt/json.c
M src/backend/utils/adt/jsonb.c
M src/backend/utils/adt/jsonb_gin.c
M src/backend/utils/adt/jsonb_op.c
M src/backend/utils/adt/jsonb_util.c
M src/backend/utils/adt/jsonfuncs.c
M src/backend/utils/adt/like.c
M src/backend/utils/adt/misc.c
M src/backend/utils/adt/nabstime.c
M src/backend/utils/adt/network.c
M src/backend/utils/adt/network_gist.c
M src/backend/utils/adt/numeric.c
M src/backend/utils/adt/oid.c
M src/backend/utils/adt/orderedsetaggs.c
M src/backend/utils/adt/pg_locale.c
M src/backend/utils/adt/pg_lsn.c
M src/backend/utils/adt/pg_lzcompress.c
M src/backend/utils/adt/pgstatfuncs.c
M src/backend/utils/adt/pseudotypes.c
M src/backend/utils/adt/rangetypes.c
M src/backend/utils/adt/rangetypes_gist.c
M src/backend/utils/adt/regexp.c
M src/backend/utils/adt/regproc.c
M src/backend/utils/adt/ri_triggers.c
M src/backend/utils/adt/rowtypes.c
M src/backend/utils/adt/ruleutils.c
M src/backend/utils/adt/selfuncs.c
M src/backend/utils/adt/timestamp.c
M src/backend/utils/adt/tsginidx.c
M src/backend/utils/adt/varchar.c
M src/backend/utils/adt/varlena.c
M src/backend/utils/adt/xml.c
M src/backend/utils/cache/attoptcache.c
M src/backend/utils/cache/catcache.c
M src/backend/utils/cache/inval.c
M src/backend/utils/cache/lsyscache.c
M src/backend/utils/cache/plancache.c
M src/backend/utils/cache/relcache.c
M src/backend/utils/cache/relfilenodemap.c
M src/backend/utils/cache/relmapper.c
M src/backend/utils/cache/spccache.c
M src/backend/utils/cache/syscache.c
M src/backend/utils/cache/typcache.c
M src/backend/utils/error/elog.c
M src/backend/utils/fmgr/dfmgr.c
M src/backend/utils/fmgr/fmgr.c
M src/backend/utils/fmgr/funcapi.c
M src/backend/utils/hash/dynahash.c
M src/backend/utils/init/miscinit.c
M src/backend/utils/init/postinit.c
M src/backend/utils/mb/conversion_procs/euc_tw_and_big5/big5.c
M src/backend/utils/mb/mbutils.c
M src/backend/utils/mb/wchar.c
M src/backend/utils/mb/wstrcmp.c
M src/backend/utils/mb/wstrncmp.c
M src/backend/utils/misc/guc.c
M src/backend/utils/misc/ps_status.c
M src/backend/utils/misc/rbtree.c
M src/backend/utils/misc/timeout.c
M src/backend/utils/misc/tzparser.c
M src/backend/utils/mmgr/aset.c
M src/backend/utils/mmgr/mcxt.c
M src/backend/utils/mmgr/portalmem.c
M src/backend/utils/resowner/resowner.c
M src/backend/utils/sort/logtape.c
M src/backend/utils/sort/tuplesort.c
M src/backend/utils/sort/tuplestore.c
M src/backend/utils/time/combocid.c
M src/backend/utils/time/snapmgr.c
M src/backend/utils/time/tqual.c
M src/bin/initdb/findtimezone.c
M src/bin/initdb/initdb.c
M src/bin/initdb/t/001_initdb.pl
M src/bin/pg_basebackup/pg_basebackup.c
M src/bin/pg_basebackup/pg_receivexlog.c
M src/bin/pg_basebackup/pg_recvlogical.c
M src/bin/pg_basebackup/receivelog.c
M src/bin/pg_basebackup/streamutil.c
M src/bin/pg_basebackup/streamutil.h
M src/bin/pg_basebackup/t/010_pg_basebackup.pl
M src/bin/pg_config/t/001_pg_config.pl
M src/bin/pg_controldata/pg_controldata.c
M src/bin/pg_controldata/t/001_pg_controldata.pl
M src/bin/pg_ctl/pg_ctl.c
M src/bin/pg_ctl/t/001_start_stop.pl
M src/bin/pg_ctl/t/002_status.pl
M src/bin/pg_dump/common.c
M src/bin/pg_dump/compress_io.c
M src/bin/pg_dump/dumputils.c
M src/bin/pg_dump/parallel.c
M src/bin/pg_dump/pg_backup.h
M src/bin/pg_dump/pg_backup_archiver.c
M src/bin/pg_dump/pg_backup_archiver.h
M src/bin/pg_dump/pg_backup_custom.c
M src/bin/pg_dump/pg_backup_db.c
M src/bin/pg_dump/pg_backup_directory.c
M src/bin/pg_dump/pg_backup_tar.c
M src/bin/pg_dump/pg_dump.c
M src/bin/pg_dump/pg_dump.h
M src/bin/pg_dump/pg_dump_sort.c
M src/bin/pg_dump/pg_dumpall.c
M src/bin/pg_resetxlog/pg_resetxlog.c
M src/bin/psql/command.c
M src/bin/psql/common.c
M src/bin/psql/copy.c
M src/bin/psql/describe.c
M src/bin/psql/input.c
M src/bin/psql/large_obj.c
M src/bin/psql/mainloop.c
M src/bin/psql/mbprint.c
M src/bin/psql/print.c
M src/bin/psql/settings.h
M src/bin/psql/stringutils.c
M src/bin/psql/tab-complete.c
M src/bin/psql/variables.c
M src/bin/scripts/common.c
M src/bin/scripts/createuser.c
M src/bin/scripts/pg_isready.c
M src/bin/scripts/t/010_clusterdb.pl
M src/bin/scripts/t/011_clusterdb_all.pl
M src/bin/scripts/t/020_createdb.pl
M src/bin/scripts/t/030_createlang.pl
M src/bin/scripts/t/040_createuser.pl
M src/bin/scripts/t/050_dropdb.pl
M src/bin/scripts/t/060_droplang.pl
M src/bin/scripts/t/070_dropuser.pl
M src/bin/scripts/t/090_reindexdb.pl
M src/bin/scripts/t/091_reindexdb_all.pl
M src/bin/scripts/t/100_vacuumdb.pl
M src/bin/scripts/t/101_vacuumdb_all.pl
M src/bin/scripts/t/102_vacuumdb_stages.pl
M src/bin/scripts/vacuumdb.c
M src/common/psprintf.c
M src/common/relpath.c
M src/include/access/attnum.h
M src/include/access/genam.h
M src/include/access/gin.h
M src/include/access/gin_private.h
M src/include/access/gist.h
M src/include/access/hash.h
M src/include/access/heapam.h
M src/include/access/heapam_xlog.h
M src/include/access/htup.h
M src/include/access/htup_details.h
M src/include/access/itup.h
M src/include/access/nbtree.h
M src/include/access/reloptions.h
M src/include/access/rewriteheap.h
M src/include/access/rmgr.h
M src/include/access/rmgrlist.h
M src/include/access/skey.h
M src/include/access/slru.h
M src/include/access/spgist_private.h
M src/include/access/transam.h
M src/include/access/tupdesc.h
M src/include/access/tupmacs.h
M src/include/access/tuptoaster.h
M src/include/access/xlog.h
M src/include/access/xlog_internal.h
M src/include/access/xlogdefs.h
M src/include/c.h
M src/include/catalog/catversion.h
M src/include/catalog/dependency.h
M src/include/catalog/duplicate_oids
M src/include/catalog/genbki.h
M src/include/catalog/namespace.h
M src/include/catalog/objectaccess.h
M src/include/catalog/pg_aggregate.h
M src/include/catalog/pg_attrdef.h
M src/include/catalog/pg_attribute.h
M src/include/catalog/pg_authid.h
M src/include/catalog/pg_constraint.h
M src/include/catalog/pg_control.h
M src/include/catalog/pg_db_role_setting.h
M src/include/catalog/pg_default_acl.h
M src/include/catalog/pg_description.h
M src/include/catalog/pg_event_trigger.h
M src/include/catalog/pg_index.h
M src/include/catalog/pg_largeobject.h
M src/include/catalog/pg_opclass.h
M src/include/catalog/pg_proc.h
M src/include/catalog/pg_rewrite.h
M src/include/catalog/pg_shdepend.h
M src/include/catalog/pg_shdescription.h
M src/include/catalog/pg_statistic.h
M src/include/catalog/pg_trigger.h
M src/include/catalog/pg_ts_dict.h
M src/include/catalog/pg_ts_template.h
M src/include/catalog/pg_type.h
M src/include/catalog/toasting.h
M src/include/commands/comment.h
M src/include/commands/tablecmds.h
M src/include/commands/vacuum.h
M src/include/common/fe_memutils.h
M src/include/common/relpath.h
M src/include/datatype/timestamp.h
M src/include/executor/executor.h
M src/include/executor/hashjoin.h
M src/include/executor/spi_priv.h
M src/include/executor/tuptable.h
M src/include/fmgr.h
M src/include/funcapi.h
M src/include/lib/ilist.h
M src/include/lib/stringinfo.h
M src/include/libpq/libpq-be.h
M src/include/libpq/pqcomm.h
M src/include/mb/pg_wchar.h
M src/include/miscadmin.h
M src/include/nodes/execnodes.h
M src/include/nodes/nodes.h
M src/include/nodes/params.h
M src/include/nodes/parsenodes.h
M src/include/nodes/plannodes.h
M src/include/nodes/primnodes.h
M src/include/nodes/relation.h
M src/include/nodes/replnodes.h
M src/include/nodes/tidbitmap.h
M src/include/nodes/value.h
M src/include/parser/gramparse.h
M src/include/parser/parse_node.h
M src/include/parser/scanner.h
M src/include/pg_config_manual.h
M src/include/pgstat.h
M src/include/port.h
M src/include/port/linux.h
M src/include/port/win32.h
M src/include/portability/instr_time.h
M src/include/postgres.h
M src/include/postgres_ext.h
M src/include/postmaster/bgworker.h
M src/include/postmaster/bgworker_internals.h
M src/include/postmaster/syslogger.h
M src/include/regex/regcustom.h
M src/include/regex/regex.h
M src/include/regex/regexport.h
M src/include/regex/regguts.h
M src/include/replication/basebackup.h
M src/include/replication/decode.h
M src/include/replication/logical.h
M src/include/replication/output_plugin.h
M src/include/replication/reorderbuffer.h
M src/include/replication/slot.h
M src/include/replication/snapbuild.h
M src/include/replication/walreceiver.h
M src/include/rewrite/rewriteHandler.h
M src/include/snowball/header.h
M src/include/storage/barrier.h
M src/include/storage/block.h
M src/include/storage/buf_internals.h
M src/include/storage/bufpage.h
M src/include/storage/dsm.h
M src/include/storage/dsm_impl.h
M src/include/storage/ipc.h
M src/include/storage/itemid.h
M src/include/storage/itemptr.h
M src/include/storage/large_object.h
M src/include/storage/lock.h
M src/include/storage/lwlock.h
M src/include/storage/pg_sema.h
M src/include/storage/pg_shmem.h
M src/include/storage/pos.h
M src/include/storage/predicate_internals.h
M src/include/storage/proc.h
M src/include/storage/procarray.h
M src/include/storage/relfilenode.h
M src/include/storage/shm_mq.h
M src/include/storage/shm_toc.h
M src/include/storage/sinval.h
M src/include/storage/sinvaladt.h
M src/include/storage/smgr.h
M src/include/storage/spin.h
M src/include/tcop/dest.h
M src/include/tcop/tcopdebug.h
M src/include/utils/acl.h
M src/include/utils/builtins.h
M src/include/utils/catcache.h
M src/include/utils/datetime.h
M src/include/utils/elog.h
M src/include/utils/guc.h
M src/include/utils/hsearch.h
M src/include/utils/inet.h
M src/include/utils/jsonapi.h
M src/include/utils/jsonb.h
M src/include/utils/memutils.h
M src/include/utils/palloc.h
M src/include/utils/pg_crc.h
M src/include/utils/plancache.h
M src/include/utils/portal.h
M src/include/utils/rel.h
M src/include/utils/relcache.h
M src/include/utils/relfilenodemap.h
M src/include/utils/resowner.h
M src/include/utils/resowner_private.h
M src/include/utils/selfuncs.h
M src/include/utils/snapshot.h
M src/include/utils/sortsupport.h
M src/include/utils/tqual.h
M src/include/utils/tuplesort.h
M src/include/utils/tuplestore.h
M src/include/utils/typcache.h
M src/interfaces/ecpg/ecpglib/data.c
M src/interfaces/ecpg/ecpglib/execute.c
M src/interfaces/ecpg/ecpglib/extern.h
M src/interfaces/ecpg/include/sqlca.h
M src/interfaces/ecpg/pgtypeslib/dt.h
M src/interfaces/ecpg/pgtypeslib/dt_common.c
M src/interfaces/ecpg/pgtypeslib/interval.c
M src/interfaces/ecpg/pgtypeslib/numeric.c
M src/interfaces/ecpg/preproc/c_keywords.c
M src/interfaces/ecpg/preproc/extern.h
M src/interfaces/ecpg/preproc/output.c
M src/interfaces/ecpg/preproc/parse.pl
M src/interfaces/ecpg/preproc/parser.c
M src/interfaces/ecpg/preproc/type.c
M src/interfaces/ecpg/preproc/variable.c
M src/interfaces/ecpg/test/expected/compat_informix-test_informix2.c
M src/interfaces/ecpg/test/expected/preproc-init.c
M src/interfaces/ecpg/test/expected/sql-array.c
M src/interfaces/ecpg/test/expected/sql-code100.c
M src/interfaces/ecpg/test/expected/sql-copystdout.c
M src/interfaces/ecpg/test/expected/sql-define.c
M src/interfaces/ecpg/test/expected/sql-dynalloc.c
M src/interfaces/ecpg/test/expected/sql-dynalloc2.c
M src/interfaces/ecpg/test/expected/sql-dyntest.c
M src/interfaces/ecpg/test/expected/sql-indicators.c
M src/interfaces/ecpg/test/expected/thread-alloc.c
M src/interfaces/ecpg/test/expected/thread-descriptor.c
M src/interfaces/ecpg/test/expected/thread-prep.c
M src/interfaces/ecpg/test/pg_regress_ecpg.c
M src/interfaces/libpq/fe-auth.c
M src/interfaces/libpq/fe-connect.c
M src/interfaces/libpq/fe-exec.c
M src/interfaces/libpq/fe-lobj.c
M src/interfaces/libpq/fe-misc.c
M src/interfaces/libpq/fe-protocol2.c
M src/interfaces/libpq/fe-protocol3.c
M src/interfaces/libpq/fe-secure.c
M src/interfaces/libpq/libpq-fe.h
M src/interfaces/libpq/libpq-int.h
M src/interfaces/libpq/pqexpbuffer.c
M src/interfaces/libpq/pqexpbuffer.h
M src/interfaces/libpq/test/uri-regress.c
M src/pl/plperl/plperl.c
M src/pl/plpgsql/src/pl_comp.c
M src/pl/plpgsql/src/pl_exec.c
M src/pl/plpgsql/src/pl_funcs.c
M src/pl/plpgsql/src/pl_handler.c
M src/pl/plpgsql/src/pl_scanner.c
M src/pl/plpgsql/src/plpgsql.h
M src/pl/plpython/plpy_elog.c
M src/pl/plpython/plpy_exec.c
M src/pl/plpython/plpy_typeio.c
M src/pl/plpython/plpy_util.c
M src/pl/tcl/pltcl.c
M src/port/chklocale.c
M src/port/crypt.c
M src/port/dirent.c
M src/port/erand48.c
M src/port/fls.c
M src/port/getaddrinfo.c
M src/port/getopt.c
M src/port/getopt_long.c
M src/port/inet_aton.c
M src/port/kill.c
M src/port/path.c
M src/port/pgmkdirp.c
M src/port/pqsignal.c
M src/port/qsort.c
M src/port/qsort_arg.c
M src/port/snprintf.c
M src/port/sprompt.c
M src/port/strlcat.c
M src/port/strlcpy.c
M src/port/thread.c
M src/port/unsetenv.c
M src/test/isolation/isolation_main.c
M src/test/isolation/isolationtester.c
M src/test/isolation/isolationtester.h
M src/test/perl/TestLib.pm
M src/test/regress/pg_regress.c
M src/test/regress/pg_regress.h
M src/test/regress/pg_regress_main.c
M src/test/regress/regress.c
M src/timezone/localtime.c
M src/timezone/pgtz.c
M src/timezone/zic.c
M src/tools/entab/entab.c
M src/tools/git_changelog
M src/tools/msvc/MSBuildProject.pm
M src/tools/msvc/Mkvcbuild.pm
M src/tools/msvc/Solution.pm
M src/tools/msvc/gendef.pl
M src/tools/pgindent/pgindent
M src/tutorial/complex.c

Adjust pgindent to remove tabs after periods in C comments.

commit   : fb85cd4320414c3f6e9c8bc69ec944200ae1e493    
  
author   : Bruce Momjian <[email protected]>    
date     : Tue, 6 May 2014 10:57:15 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Tue, 6 May 2014 10:57:15 -0400    

Click here for diff

M src/tools/pgindent/pgindent

Fix detection of short tar files, broken by commit 14ea89366fe321609afc5838ff9fe2ded1cd707d

commit   : 55d5ff825fae0ee9a1114a17fcd97a3e360a23b0    
  
author   : Bruce Momjian <[email protected]>    
date     : Tue, 6 May 2014 10:00:57 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Tue, 6 May 2014 10:00:57 -0400    

Click here for diff

Report by Noah Misch  

M src/bin/pg_dump/pg_backup_archiver.c

Correct comment in Hot Standby nbtree handling

commit   : 2e54d88af137da5c1cf4749e2b9d4371224bbd47    
  
author   : Simon Riggs <[email protected]>    
date     : Tue, 6 May 2014 14:44:18 +0100    
  
committer: Simon Riggs <[email protected]>    
date     : Tue, 6 May 2014 14:44:18 +0100    

Click here for diff

Logic is correct, matching handling of LP_DEAD elsewhere.  

M src/backend/access/nbtree/nbtxlog.c

Update typedef list in preparation for pgindent run

commit   : 284c464b9f7a47e3c4559a1ced75ff3dcb697e36    
  
author   : Bruce Momjian <[email protected]>    
date     : Tue, 6 May 2014 09:08:14 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Tue, 6 May 2014 09:08:14 -0400    

Click here for diff

M src/tools/pgindent/typedefs.list

More rewording of pg_stat_statements for 9.4 release notes

commit   : 47faae931686536cfbd5dd70f347e4e658c5ebcc    
  
author   : Bruce Momjian <[email protected]>    
date     : Tue, 6 May 2014 08:52:16 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Tue, 6 May 2014 08:52:16 -0400    

Click here for diff

Report by Amit Langote  

M doc/src/sgml/release-9.4.sgml

pg_basebackup streaming: adjust version check msg

commit   : 08317edc2d4200e3716deaf585925069601c8965    
  
author   : Simon Riggs <[email protected]>    
date     : Tue, 6 May 2014 13:44:15 +0100    
  
committer: Simon Riggs <[email protected]>    
date     : Tue, 6 May 2014 13:44:15 +0100    

Click here for diff

Commit d298b50a3b469c088bb40a4d36d38111b4cd574d by Heikki Linnakangas  
requested that the version check message be updated at next release, suggesting  
that the appropriate text would be “9.3 or later”. The logic used for the check  
indicates that the correct text for 9.4 is “9.3 or 9.4”, since the logic would  
cause this to fail for later releases.  

M src/bin/pg_basebackup/receivelog.c

Fix use of free in walsender error handling after a sysid mismatch.

commit   : 3a8e9e977fa642433986e5cd145e3a6f86601c2c    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Tue, 6 May 2014 15:14:51 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Tue, 6 May 2014 15:14:51 +0300    

Click here for diff

Found via valgrind. The bug exists since the introduction of the walsender,  
so backpatch to 9.0.  
  
Andres Freund  

M src/backend/replication/libpqwalreceiver/libpqwalreceiver.c

Fix handling of array of char pointers in ecpglib.

commit   : 8d6a07fa01cece1bd3508a81e59c0c0cbc0bb867    
  
author   : Michael Meskes <[email protected]>    
date     : Tue, 6 May 2014 13:04:30 +0200    
  
committer: Michael Meskes <[email protected]>    
date     : Tue, 6 May 2014 13:04:30 +0200    

Click here for diff

When array of char * was used as target for a FETCH statement returning more  
than one row, it tried to store all the result in the first element. Instead it  
should dump array of char pointers with right offset, use the address instead  
of the value of the C variable while reading the array and treat such variable  
as char **, instead of char * for pointer arithmetic.  
  
Patch by Ashutosh Bapat <[email protected]>  

M src/interfaces/ecpg/ecpglib/data.c
M src/interfaces/ecpg/ecpglib/execute.c
M src/interfaces/ecpg/preproc/type.c

Properly detect read and write errors in pg_dump/dumpall, and pg_restore

commit   : 14ea89366fe321609afc5838ff9fe2ded1cd707d    
  
author   : Bruce Momjian <[email protected]>    
date     : Mon, 5 May 2014 20:27:16 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Mon, 5 May 2014 20:27:16 -0400    

Click here for diff

Previously some I/O errors were ignored.  

M src/bin/pg_dump/compress_io.c
M src/bin/pg_dump/compress_io.h
M src/bin/pg_dump/pg_backup.h
M src/bin/pg_dump/pg_backup_archiver.c
M src/bin/pg_dump/pg_backup_archiver.h
M src/bin/pg_dump/pg_backup_custom.c
M src/bin/pg_dump/pg_backup_db.c
M src/bin/pg_dump/pg_backup_directory.c
M src/bin/pg_dump/pg_backup_null.c
M src/bin/pg_dump/pg_backup_tar.c

Update 9.4 release notes for queryid control

commit   : 768fb0032655e37810ab37a22f870af85ab1108c    
  
author   : Bruce Momjian <[email protected]>    
date     : Mon, 5 May 2014 20:24:50 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Mon, 5 May 2014 20:24:50 -0400    

Click here for diff

M doc/src/sgml/release-9.4.sgml

Run autoconf in wake of commit a692ee5870f0f442565b4c4bff367094599e9bdf.

commit   : 9252b8eec27bbefbeae9d60d8cd4f6b8be80b861    
  
author   : Tom Lane <[email protected]>    
date     : Mon, 5 May 2014 20:24:38 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Mon, 5 May 2014 20:24:38 -0400    

Click here for diff

Heikki updated configure.in but evidently forgot to include the updated  
configure script in the commit.  Per buildfarm.  

M configure

Move pg_stat_statements into its on 9.4 release note section

commit   : a1c287a3836ff47e7ea01c82aceba75f15ba7c91    
  
author   : Bruce Momjian <[email protected]>    
date     : Mon, 5 May 2014 20:03:12 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Mon, 5 May 2014 20:03:12 -0400    

Click here for diff

M doc/src/sgml/release-9.4.sgml

In 9.4 release notes, add detail to pg_stat_statements items

commit   : 60832ea39d670cb6c39081e31ad175e0e1c555f8    
  
author   : Bruce Momjian <[email protected]>    
date     : Mon, 5 May 2014 19:58:58 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Mon, 5 May 2014 19:58:58 -0400    

Click here for diff

M doc/src/sgml/release-9.4.sgml

Improve JSONB 9.4 release text

commit   : 49c683bafda8659b885b2b119042e16cba1f702a    
  
author   : Bruce Momjian <[email protected]>    
date     : Mon, 5 May 2014 19:16:34 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Mon, 5 May 2014 19:16:34 -0400    

Click here for diff

M doc/src/sgml/release-9.4.sgml

commit   : a64560d994faab23b76848b4e95027b7b11ad9a7    
  
author   : Bruce Momjian <[email protected]>    
date     : Mon, 5 May 2014 16:26:27 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Mon, 5 May 2014 16:26:27 -0400    

Click here for diff

M doc/src/sgml/datatype.sgml
M doc/src/sgml/release-9.4.sgml

Fix possible cache invalidation failure in ReceiveSharedInvalidMessages.

commit   : 0f928a85ecd509b165bfb9acd71b18c40063a7a0    
  
author   : Tom Lane <[email protected]>    
date     : Mon, 5 May 2014 14:43:39 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Mon, 5 May 2014 14:43:39 -0400    

Click here for diff

Commit fad153ec45299bd4d4f29dec8d9e04e2f1c08148 modified sinval.c to reduce  
the number of calls into sinvaladt.c (which require taking a shared lock)  
by keeping a local buffer of collected-but-not-yet-processed messages.  
However, if processing of the last message in a batch resulted in a  
recursive call to ReceiveSharedInvalidMessages, we could overwrite that  
message with a new one while the outer invalidation function was still  
working on it.  This would be likely to lead to invalidation of the wrong  
cache entry, allowing subsequent processing to use stale cache data.  
The fix is just to make a local copy of each message while we're processing  
it.  
  
Spotted by Andres Freund.  Back-patch to 8.4 where the bug was introduced.  

M src/backend/storage/ipc/sinval.c

Fix pg_type.typlen for newly-revived line type.

commit   : 3727afafeef69088456acc3f6257360315220a20    
  
author   : Tom Lane <[email protected]>    
date     : Mon, 5 May 2014 13:37:54 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Mon, 5 May 2014 13:37:54 -0400    

Click here for diff

Commit 261c7d4b653bc3e44c31fd456d94f292caa50d8f removed the "m" field  
from struct LINE, but neglected to make pg_type.h's idea of the type's  
size match.  This resulted in reading past the end of palloc'd LINE  
values when inserting them into tuples etc.  In principle that could  
cause a SIGSEGV, though the odds of detectable problems seem low.  
  
Bump catversion since this makes an incompatible on-disk format change.  
Note that if the line type had been in use in the field, this would  
break pg_upgrade'ability of databases containing line values; but  
it seems unlikely that there are any (they'd have had to be compiled  
with -DENABLE_LINE_TYPE).  
  
Spotted by Andres Freund.  

M src/include/catalog/catversion.h
M src/include/catalog/pg_type.h

Add SGML markup tags to 9.4 release notes

commit   : b2f7bd72c4d3e80065725c72e85778d5f4bdfd4a    
  
author   : Bruce Momjian <[email protected]>    
date     : Mon, 5 May 2014 12:38:09 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Mon, 5 May 2014 12:38:09 -0400    

Click here for diff

M doc/src/sgml/release-9.4.sgml

Fix case of pg_dump -Fc to an unseekable file (such as a pipe).

commit   : e03485ae8a2025d5deea291ebb24412229cc2fe5    
  
author   : Tom Lane <[email protected]>    
date     : Mon, 5 May 2014 11:26:41 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Mon, 5 May 2014 11:26:41 -0400    

Click here for diff

This was accidentally broken in commits cfa1b4a711/5e8e794e3b.  
It saves a line or so to call ftello unconditionally in _CloseArchive,  
but we have to expect that it might fail if we're not in hasSeek mode.  
Per report from Bernd Helmle.  
  
In passing, improve _getFilePos to print an appropriate message if  
ftello fails unexpectedly, rather than just a vague complaint about  
"ftell mismatch".  

M src/bin/pg_dump/pg_backup_custom.c

Update "huge pages" description in the 9.4 release notes

commit   : f8db074049be74fa100b4f97d09ee76222660e7c    
  
author   : Bruce Momjian <[email protected]>    
date     : Mon, 5 May 2014 10:30:45 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Mon, 5 May 2014 10:30:45 -0400    

Click here for diff

M doc/src/sgml/release-9.4.sgml

Update 9.4 release notes with feedback from the hackers list

commit   : 5b8de6d4676ed9eb6df4685deb601be3db4eaa24    
  
author   : Bruce Momjian <[email protected]>    
date     : Mon, 5 May 2014 10:06:26 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Mon, 5 May 2014 10:06:26 -0400    

Click here for diff

M doc/src/sgml/release-9.4.sgml

doc: In FDW handler docs, mark up scan_clauses with <literal>.

commit   : c70cc9afb3c561addeab805b15352d5ffb6d8f38    
  
author   : Robert Haas <[email protected]>    
date     : Mon, 5 May 2014 10:04:02 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Mon, 5 May 2014 10:04:02 -0400    

Click here for diff

Etsuro Fujita  

M doc/src/sgml/fdwhandler.sgml

Pass sensible value to memset() when randomizing reorderbuffer's tuple slab.

commit   : 377790fbd707b41bdf2264fe6c217e903e241f7c    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Mon, 5 May 2014 16:21:46 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Mon, 5 May 2014 16:21:46 +0300    

Click here for diff

This is entirely harmless, but still wrong. Noticed by coverity.  
  
Andres Freund  

M src/backend/replication/logical/reorderbuffer.c

Don't leak memory after connection aborts in pg_recvlogical.

commit   : 329de9fa983debc941ebd79f335f2574b72a3694    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Mon, 5 May 2014 16:20:12 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Mon, 5 May 2014 16:20:12 +0300    

Click here for diff

Andres Freund, noticed by coverity.  

M src/bin/pg_basebackup/pg_recvlogical.c

Use Size instead of uint32 to store result of sizeof()

commit   : c83457683968e2263d7e6bcdcdd52d472f9b0f8d    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Mon, 5 May 2014 16:17:16 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Mon, 5 May 2014 16:17:16 +0300    

Click here for diff

Silences coverity and is more consistent with other functions in the  
same file.  
  
Andres Freund  

M src/backend/replication/logical/snapbuild.c

Assert that pre/post-fix updated tuples are on the same page during replay.

commit   : 1460b199e6e748712253fa130d1c3368ba6ac861    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Mon, 5 May 2014 16:14:41 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Mon, 5 May 2014 16:14:41 +0300    

Click here for diff

If they were not 'oldtup.t_data' would be dereferenced while set to NULL  
in case of a full page image for block 0.  
  
Do so primarily to silence coverity; but also to make sure this prerequisite  
isn't changed without adapting the replay routine as that would appear to  
work in many cases.  
  
Andres Freund  

M src/backend/access/heap/heapam.c

Replace SYSTEMQUOTEs with Windows-specific wrapper functions.

commit   : a692ee5870f0f442565b4c4bff367094599e9bdf    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Mon, 5 May 2014 16:07:40 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Mon, 5 May 2014 16:07:40 +0300    

Click here for diff

It's easy to forget using SYSTEMQUOTEs when constructing command strings  
for system() or popen(). Even if we fix all the places missing it now, it is  
bound to be forgotten again in the future. Introduce wrapper functions that  
do the the extra quoting for you, and get rid of SYSTEMQUOTEs in all the  
callers.  
  
We previosly used SYSTEMQUOTEs in all the hard-coded command strings, and  
this doesn't change the behavior of those. But user-supplied commands, like  
archive_command, restore_command, COPY TO/FROM PROGRAM calls, as well as  
pgbench's \shell, will now gain an extra pair of quotes. That is desirable,  
but if you have existing scripts or config files that include an extra  
pair of quotes, those might need to be adjusted.  
  
Reviewed by Amit Kapila and Tom Lane  

M configure.in
M contrib/pg_upgrade/check.c
M contrib/pg_upgrade/controldata.c
M contrib/pg_upgrade/exec.c
M src/bin/initdb/initdb.c
M src/bin/pg_ctl/pg_ctl.c
M src/bin/pg_dump/pg_dumpall.c
M src/bin/psql/command.c
M src/include/port.h
M src/interfaces/ecpg/test/pg_regress_ecpg.c
M src/interfaces/libpq/Makefile
M src/interfaces/libpq/bcc32.mak
M src/interfaces/libpq/win32.mak
A src/port/system.c
M src/test/isolation/isolation_main.c
M src/test/regress/pg_regress.c
M src/test/regress/pg_regress_main.c
M src/tools/msvc/Mkvcbuild.pm

Add missing 9.4 release file.

commit   : d69ffd6f035fe24483247bf9b2335d7474eaf31a    
  
author   : Bruce Momjian <[email protected]>    
date     : Sun, 4 May 2014 07:12:48 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Sun, 4 May 2014 07:12:48 -0400    

Click here for diff

A doc/src/sgml/release-9.4.sgml

Initial version of Postgres 9.4 release notes

commit   : 21223c24c2c4694efea3d9b4b29dfe45fda71f2a    
  
author   : Bruce Momjian <[email protected]>    
date     : Sat, 3 May 2014 23:16:24 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Sat, 3 May 2014 23:16:24 -0400    

Click here for diff

M doc/src/sgml/filelist.sgml
M doc/src/sgml/release.sgml

doc: Update pg_basebackup version compatibility claim for 9.4

commit   : 0717748c904719af8689c04dc610a937de6d9a0e    
  
author   : Peter Eisentraut <[email protected]>    
date     : Thu, 1 May 2014 22:08:22 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Thu, 1 May 2014 22:08:22 -0400    

Click here for diff

M doc/src/sgml/ref/pg_basebackup.sgml

Fix yet another corner case in dumping rules/views with USING clauses.

commit   : 91e16b980612d80de1017e97e9f206239afb9026    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 1 May 2014 20:22:37 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 1 May 2014 20:22:37 -0400    

Click here for diff

ruleutils.c tries to cope with additions/deletions/renamings of columns in  
tables referenced by views, by means of adding machine-generated aliases to  
the printed form of a view when needed to preserve the original semantics.  
A recent blog post by Marko Tiikkaja pointed out a case I'd missed though:  
if one input of a join with USING is itself a join, there is nothing to  
stop the user from adding a column of the same name as the USING column to  
whichever side of the sub-join didn't provide the USING column.  And then  
there'll be an error when the view is re-parsed, since now the sub-join  
exposes two columns matching the USING specification.  We were catching a  
lot of related cases, but not this one, so add some logic to cope with it.  
  
Back-patch to 9.3, which is the first release that makes any serious  
attempt to cope with such cases (cf commit 2ffa740be and follow-ons).  

M src/backend/utils/adt/ruleutils.c
M src/test/regress/expected/create_view.out
M src/test/regress/sql/create_view.sql

Fix "quiet inline" configure test for newer clang compilers.

commit   : 4c8aa8b5aea1e032f569222d4b6c1019e84622dc    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 1 May 2014 16:16:36 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 1 May 2014 16:16:36 -0400    

Click here for diff

This test used to just define an unused static inline function and check  
whether that causes a warning.  But newer clang versions warn about  
unused static inline functions when defined inside a .c file, but not  
when defined in an included header, which is the case we care about.  
Change the test to cope.  
  
Andres Freund  

M config/c-compiler.m4
A config/test_quiet_include.h
M configure

Fix failure to detoast fields in composite elements of structured types.

commit   : 3f8c8e3c61cef5729980ee4372ec159862a979f1    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 1 May 2014 15:19:06 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 1 May 2014 15:19:06 -0400    

Click here for diff

If we have an array of records stored on disk, the individual record fields  
cannot contain out-of-line TOAST pointers: the tuptoaster.c mechanisms are  
only prepared to deal with TOAST pointers appearing in top-level fields of  
a stored row.  The same applies for ranges over composite types, nested  
composites, etc.  However, the existing code only took care of expanding  
sub-field TOAST pointers for the case of nested composites, not for other  
structured types containing composites.  For example, given a command such  
as  
  
UPDATE tab SET arraycol = ARRAY[(ROW(x,42)::mycompositetype] ...  
  
where x is a direct reference to a field of an on-disk tuple, if that field  
is long enough to be toasted out-of-line then the TOAST pointer would be  
inserted as-is into the array column.  If the source record for x is later  
deleted, the array field value would become a dangling pointer, leading  
to errors along the line of "missing chunk number 0 for toast value ..."  
when the value is referenced.  A reproducible test case for this was  
provided by Jan Pecek, but it seems likely that some of the "missing chunk  
number" reports we've heard in the past were caused by similar issues.  
  
Code-wise, the problem is that PG_DETOAST_DATUM() is not adequate to  
produce a self-contained Datum value if the Datum is of composite type.  
Seen in this light, the problem is not just confined to arrays and ranges,  
but could also affect some other places where detoasting is done in that  
way, for example form_index_tuple().  
  
I tried teaching the array code to apply toast_flatten_tuple_attribute()  
along with PG_DETOAST_DATUM() when the array element type is composite,  
but this was messy and imposed extra cache lookup costs whether or not any  
TOAST pointers were present, indeed sometimes when the array element type  
isn't even composite (since sometimes it takes a typcache lookup to find  
that out).  The idea of extending that approach to all the places that  
currently use PG_DETOAST_DATUM() wasn't attractive at all.  
  
This patch instead solves the problem by decreeing that composite Datum  
values must not contain any out-of-line TOAST pointers in the first place;  
that is, we expand out-of-line fields at the point of constructing a  
composite Datum, not at the point where we're about to insert it into a  
larger tuple.  This rule is applied only to true composite Datums, not  
to tuples that are being passed around the system as tuples, so it's not  
as invasive as it might sound at first.  With this approach, the amount  
of code that has to be touched for a full solution is greatly reduced,  
and added cache lookup costs are avoided except when there actually is  
a TOAST pointer that needs to be inlined.  
  
The main drawback of this approach is that we might sometimes dereference  
a TOAST pointer that will never actually be used by the query, imposing a  
rather large cost that wasn't there before.  On the other side of the coin,  
if the field value is used multiple times then we'll come out ahead by  
avoiding repeat detoastings.  Experimentation suggests that common SQL  
coding patterns are unaffected either way, though.  Applications that are  
very negatively affected could be advised to modify their code to not fetch  
columns they won't be using.  
  
In future, we might consider reverting this solution in favor of detoasting  
only at the point where data is about to be stored to disk, using some  
method that can drill down into multiple levels of nested structured types.  
That will require defining new APIs for structured types, though, so it  
doesn't seem feasible as a back-patchable fix.  
  
Note that this patch changes HeapTupleGetDatum() from a macro to a function  
call; this means that any third-party code using that macro will not get  
protection against creating TOAST-pointer-containing Datums until it's  
recompiled.  The same applies to any uses of PG_RETURN_HEAPTUPLEHEADER().  
It seems likely that this is not a big problem in practice: most of the  
tuple-returning functions in core and contrib produce outputs that could  
not possibly be toasted anyway, and the same probably holds for third-party  
extensions.  
  
This bug has existed since TOAST was invented, so back-patch to all  
supported branches.  

M src/backend/access/common/heaptuple.c
M src/backend/access/common/indextuple.c
M src/backend/access/heap/tuptoaster.c
M src/backend/executor/execQual.c
M src/backend/executor/execTuples.c
M src/backend/executor/functions.c
M src/backend/executor/spi.c
M src/backend/utils/adt/rowtypes.c
M src/include/access/htup_details.h
M src/include/access/tuptoaster.h
M src/include/fmgr.h
M src/include/funcapi.h
M src/pl/plpgsql/src/pl_exec.c
M src/test/regress/expected/arrays.out
M src/test/regress/regress.c
M src/test/regress/sql/arrays.sql

Documentation corrections for pg_replication_slots.

commit   : 65fb5ff13009ef34ff95300d3e03540cf872e494    
  
author   : Robert Haas <[email protected]>    
date     : Wed, 30 Apr 2014 22:55:16 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Wed, 30 Apr 2014 22:55:16 -0400    

Click here for diff

Thomas Reiss, with changes to the catalog_xmin language by me.  

M doc/src/sgml/catalogs.sgml

Improve error messages in reorderbuffer.c.

commit   : 203b0d132fe9038061b5bab70f1362440ae94aa8    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 30 Apr 2014 18:16:53 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 30 Apr 2014 18:16:53 -0400    

Click here for diff

Be more clear about failure cases in relfilenode->relation lookup,  
and fix some other places that were inconsistent or not per our  
message style guidelines.  
  
Andres Freund and Tom Lane  

M src/backend/replication/logical/reorderbuffer.c

Consistently allow reading of messages from a detached shm_mq.

commit   : 5ec45bb7fa0a1495a360165a12ba5d6b4587bb4a    
  
author   : Robert Haas <[email protected]>    
date     : Wed, 30 Apr 2014 17:38:18 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Wed, 30 Apr 2014 17:38:18 -0400    

Click here for diff

This was intended to work always, but the previous code only allowed  
it if at least one message was successfully read by the receiver  
before the sender detached the queue.  
  
Report by Petr Jelinek.  Patch by me.  

M src/backend/storage/ipc/shm_mq.c

Rationalize common/relpath.[hc].

commit   : 2d00190495b22e0d0ba351b2cda9c95fb2e3d083    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 30 Apr 2014 17:30:50 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 30 Apr 2014 17:30:50 -0400    

Click here for diff

Commit a73018392636ce832b09b5c31f6ad1f18a4643ea created rather a mess by  
putting dependencies on backend-only include files into include/common.  
We really shouldn't do that.  To clean it up:  
  
* Move TABLESPACE_VERSION_DIRECTORY back to its longtime home in  
catalog/catalog.h.  We won't consider this symbol part of the FE/BE API.  
  
* Push enum ForkNumber from relfilenode.h into relpath.h.  We'll consider  
relpath.h as the source of truth for fork numbers, since relpath.c was  
already partially serving that function, and anyway relfilenode.h was  
kind of a random place for that enum.  
  
* So, relfilenode.h now includes relpath.h rather than vice-versa.  This  
direction of dependency is fine.  (That allows most, but not quite all,  
of the existing explicit #includes of relpath.h to go away again.)  
  
* Push forkname_to_number from catalog.c to relpath.c, just to centralize  
fork number stuff a bit better.  
  
* Push GetDatabasePath from catalog.c to relpath.c; it was rather odd  
that the previous commit didn't keep this together with relpath().  
  
* To avoid needing relfilenode.h in common/, redefine the underlying  
function (now called GetRelationPath) as taking separate OID arguments,  
and make the APIs using RelFileNode or RelFileNodeBackend into macro  
wrappers.  (The macros have a potential multiple-eval risk, but none of  
the existing call sites have an issue with that; one of them had such a  
risk already anyway.)  
  
* Fix failure to follow the directions when "init" fork type was added;  
specifically, the errhint in forkname_to_number wasn't updated, and neither  
was the SGML documentation for pg_relation_size().  
  
* Fix tablespace-path-too-long check in CreateTableSpace() to account for  
fork-name component of maximum-length pathnames.  This requires putting  
FORKNAMECHARS into a header file, but it was rather useless (and  
actually unreferenced) where it was.  
  
The last couple of items are potentially back-patchable bug fixes,  
if anyone is sufficiently excited about them; but personally I'm not.  
  
Per a gripe from Christoph Berg about how include/common wasn't  
self-contained.  

M contrib/pg_xlogdump/pg_xlogdump.c
M doc/src/sgml/func.sgml
M src/backend/access/rmgrdesc/smgrdesc.c
M src/backend/access/rmgrdesc/xactdesc.c
M src/backend/access/rmgrdesc/xlogdesc.c
M src/backend/access/transam/xlogutils.c
M src/backend/catalog/catalog.c
M src/backend/commands/tablecmds.c
M src/backend/commands/tablespace.c
M src/backend/replication/basebackup.c
M src/backend/replication/logical/reorderbuffer.c
M src/backend/storage/buffer/bufmgr.c
M src/backend/storage/buffer/localbuf.c
M src/backend/storage/file/fd.c
M src/backend/storage/smgr/md.c
M src/backend/utils/adt/dbsize.c
M src/backend/utils/adt/misc.c
M src/backend/utils/cache/relcache.c
M src/common/relpath.c
M src/include/catalog/catalog.h
M src/include/common/relpath.h
M src/include/storage/relfilenode.h

Check for interrupts and stack overflow during rule/view dumps.

commit   : 0bff398761b5e6119b40550bbe3751f4194dc7a7    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 30 Apr 2014 13:46:13 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 30 Apr 2014 13:46:13 -0400    

Click here for diff

Since ruleutils.c recurses, it could be driven to stack overflow by  
deeply nested constructs.  Very large queries might also take long  
enough to deparse that a check for interrupts seems like a good idea.  
Stick appropriate tests into a couple of key places.  
  
Noted by Greg Stark.  Back-patch to all supported branches.  

M src/backend/utils/adt/ruleutils.c

Reduce indentation/parenthesization of set operations in rule/view dumps.

commit   : 41de93c53aa941167d445ecb7d91d58829adcc92    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 30 Apr 2014 13:26:26 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 30 Apr 2014 13:26:26 -0400    

Click here for diff

A query such as "SELECT x UNION SELECT y UNION SELECT z UNION ..."  
produces a left-deep nested parse tree, which we formerly showed in its  
full nested glory and with all the possible parentheses.  This does little  
for readability, though, and long UNION lists resulting in excessive  
indentation are common.  Instead, let's omit parentheses and indent all  
the subqueries at the same level in such cases.  
  
This patch skips indentation/parenthesization whenever the lefthand input  
of a SetOperationStmt is another SetOperationStmt of the same kind and  
ALL/DISTINCT property.  We could teach the code the exact syntactic  
precedence of set operations and thereby avoid parenthesization in some  
more cases, but it's not clear that that'd be a readability win: it seems  
better to parenthesize if the set operation changes.  (As an example,  
if there's one UNION in a long list of UNION ALL, it now stands out like  
a sore thumb, which seems like a good thing.)  
  
Back-patch to 9.3.  This completes our response to a complaint from Greg  
Stark that since commit 62e666400d there's a performance problem in pg_dump  
for views containing long UNION sequences (or other types of deeply nested  
constructs).  The previous commit 0601cb54dac14d979d726ab2ebeda251ae36e857  
handles the general problem, but this one makes the specific case of UNION  
lists look a lot nicer.  

M src/backend/utils/adt/ruleutils.c
M src/test/regress/expected/create_view.out
M src/test/regress/expected/matview.out
M src/test/regress/expected/rules.out
M src/test/regress/expected/with.out

Limit overall indentation in rule/view dumps.

commit   : 0601cb54dac14d979d726ab2ebeda251ae36e857    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 30 Apr 2014 12:48:12 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 30 Apr 2014 12:48:12 -0400    

Click here for diff

Continuing to indent no matter how deeply nested we get doesn't really  
do anything for readability; what's worse, it results in O(N^2) total  
whitespace, which can become a performance and memory-consumption issue.  
  
To address this, once we get past 40 characters of indentation, reduce  
the indentation step distance 4x, and also limit the maximum indentation  
by reducing it modulo 40.  This latter choice is a bit weird at first  
glance, but it seems to preserve readability better than a simple cap  
would do.  
  
Back-patch to 9.3, because since commit 62e666400d the performance issue  
is a hazard for pg_dump.  
  
Greg Stark and Tom Lane  

M src/backend/utils/adt/ruleutils.c
M src/test/regress/expected/rules.out

Fix indentation of JOIN clauses in rule/view dumps.

commit   : d166eed302400a71eed1aaa301d30be3af7b5715    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 30 Apr 2014 12:01:19 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 30 Apr 2014 12:01:19 -0400    

Click here for diff

The code attempted to outdent JOIN clauses further left than the parent  
FROM keyword, which was odd in any case, and led to inconsistent formatting  
since in simple cases the clauses couldn't be moved any further left than  
that.  And it left a permanent decrement of the indentation level, causing  
subsequent lines to be much further left than they should be (again, this  
couldn't be seen in simple cases for lack of indentation to give up).  
  
After a little experimentation I chose to make it indent JOIN keywords  
two spaces from the parent FROM, which is one space more than the join's  
lefthand input in cases where that appears on a different line from FROM.  
  
Back-patch to 9.3.  This is a purely cosmetic change, and the bug is quite  
old, so that may seem arbitrary; but we are going to be making some other  
changes to the indentation behavior in both HEAD and 9.3, so it seems  
reasonable to include this in 9.3 too.  I committed this one first because  
its effects are more visible in the regression test results as they  
currently stand than they will be later.  

M src/backend/utils/adt/ruleutils.c
M src/test/regress/expected/create_view.out
M src/test/regress/expected/rangefuncs.out
M src/test/regress/expected/rules.out

Fix uninitialized-variable warnings induced by recent commit.

commit   : 5358bfdc98a47d26649ae094dab88842a0603968    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 30 Apr 2014 11:15:15 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 30 Apr 2014 11:15:15 -0400    

Click here for diff

M src/bin/psql/print.c

Add missing SYSTEMQUOTEs

commit   : 503de5462158b0260f6deaf3087cf0945f7327f0    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Wed, 30 Apr 2014 10:34:15 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Wed, 30 Apr 2014 10:34:15 +0300    

Click here for diff

Some popen() calls were missing SYSTEMQUOTEs, which caused initdb and  
pg_upgrade to fail on Windows, if the installation path contained both  
spaces and @ signs.  
  
Patch by Nikhil Deshpande. Backpatch to all supported versions.  

M contrib/pg_upgrade/check.c
M src/bin/initdb/initdb.c

PL/Python: Adjust the regression tests for Python 3.4

commit   : d0765d50f429472d00554701ac6531c84d324811    
  
author   : Peter Eisentraut <[email protected]>    
date     : Tue, 29 Apr 2014 22:16:16 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Tue, 29 Apr 2014 22:16:16 -0400    

Click here for diff

The error test case in the plpython_do test resulted in a slightly  
different error message with Python 3.4.  So pick a different way to  
test it that avoids that and is perhaps also a bit clearer.  

M src/pl/plpython/expected/plpython_do.out
M src/pl/plpython/sql/plpython_do.sql

Fix whitespace

commit   : 322173eb0a6c2f43394645f8ae33eedd70bab432    
  
author   : Peter Eisentraut <[email protected]>    
date     : Tue, 29 Apr 2014 21:35:07 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Tue, 29 Apr 2014 21:35:07 -0400    

Click here for diff

M src/bin/psql/print.c

Improve planner to drop constant-NULL inputs of AND/OR where it's legal.

commit   : 95811032d782049642a672e3db0a5382616ab084    
  
author   : Tom Lane <[email protected]>    
date     : Tue, 29 Apr 2014 13:12:26 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Tue, 29 Apr 2014 13:12:26 -0400    

Click here for diff

In general we can't discard constant-NULL inputs, since they could change  
the result of the AND/OR to be NULL.  But at top level of WHERE, we do not  
need to distinguish a NULL result from a FALSE result, so it's okay to  
treat NULL as FALSE and then simplify AND/OR accordingly.  
  
This is a very ancient oversight, but in 9.2 and later it can lead to  
failure to optimize queries that previous releases did optimize, as a  
result of more aggressive parameter substitution rules making it possible  
to reduce more subexpressions to NULL constants.  This is the root cause of  
bug #10171 from Arnold Scheffler.  We could alternatively have fixed that  
by teaching orclauses.c to ignore constant-NULL OR arms, but it seems  
better to get rid of them globally.  
  
I resisted the temptation to back-patch this change into all active  
branches, but it seems appropriate to back-patch as far as 9.2 so that  
there will not be performance regressions of the kind shown in this bug.  

M src/backend/optimizer/prep/prepqual.c
M src/test/regress/expected/create_index.out
M src/test/regress/sql/create_index.sql

Remove unnecessary cast causing a warning

commit   : dbe31616c9be7380b8a88cdfbeaa68dbdcdebc36    
  
author   : Greg Stark <[email protected]>    
date     : Tue, 29 Apr 2014 12:43:03 +0100    
  
committer: Greg Stark <[email protected]>    
date     : Tue, 29 Apr 2014 12:43:03 +0100    

Click here for diff

Incidentally, I reversed the two names in the earlier commit. The  
original author was Sergey Muraviov and the reviewer was Emre  
Hasegeli.  

M src/bin/psql/print.c

Add support for wrapping to psql's "extended" mode. This makes it very feasible to display tables that have both many columns and some large data in some columns (such as pg_stats).

commit   : 6513633b94173fc1d9e2b213c43f9422ddbf5faa    
  
author   : Greg Stark <[email protected]>    
date     : Mon, 28 Apr 2014 18:41:36 +0100    
  
committer: Greg Stark <[email protected]>    
date     : Mon, 28 Apr 2014 18:41:36 +0100    

Click here for diff

Emre Hasegeli with review and rewriting from Sergey Muraviov and  
reviewed by Greg Stark  

M src/bin/psql/print.c
M src/test/regress/expected/psql.out
M src/test/regress/sql/psql.sql

Fix two bugs in WAL-logging of GIN pending-list pages.

commit   : d2722443d993988ff2e529b652c61fec1ca527f7    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Mon, 28 Apr 2014 16:12:45 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Mon, 28 Apr 2014 16:12:45 +0300    

Click here for diff

In writeListPage, never take a full-page image of the page, because we  
have all the information required to re-initialize in the WAL record  
anyway. Before this fix, a full-page image was always generated, unless  
full_page_writes=off, because when the page is initialized its LSN is  
always 0. In stable-branches, keep the code to restore the backup blocks  
if they exist, in case that the WAL is generated with an older minor  
version, but in master Assert that there are no full-page images.  
  
In the redo routine, add missing "off++". Otherwise the tuples are added  
to the page in reverse order. That happens to be harmless because we  
always scan and remove all the tuples together, but it was clearly wrong.  
Also, it was masked by the first bug unless full_page_writes=off, because  
the page was always restored from a full-page image.  
  
Backpatch to all supported versions.  

M src/backend/access/gin/ginfast.c
M src/backend/access/gin/ginxlog.c

Minor fixes for ALTER TABLE documentation.

commit   : 728c06f17f68f4f80b61808b491b1c7b065a3d27    
  
author   : Robert Haas <[email protected]>    
date     : Mon, 28 Apr 2014 10:10:51 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Mon, 28 Apr 2014 10:10:51 -0400    

Click here for diff

Etsuro Fujita  

M doc/src/sgml/ref/alter_table.sgml

Can't completely get rid of #ifndef FRONTEND in palloc.h :-(

commit   : a9baeb361d635963a19a0268a7d60636c813d2ee    
  
author   : Tom Lane <[email protected]>    
date     : Sun, 27 Apr 2014 21:24:19 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Sun, 27 Apr 2014 21:24:19 -0400    

Click here for diff

pg_controldata includes postgres.h not postgres_fe.h, so utils/palloc.h  
must be able to compile in a "#define FRONTEND" context.  It appears that  
Solaris Studio is smart enough to persuade us to define PG_USE_INLINE,  
but not smart enough to not make a copy of unreferenced static functions;  
which leads to an unsatisfied reference to CurrentMemoryContext.  So we  
need an #ifndef FRONTEND around that declaration.  Per buildfarm.  

M src/include/utils/palloc.h

Improve generation algorithm for database system identifier.

commit   : 5035701e07e8bd395aa878465a102afd7b74e8c3    
  
author   : Tom Lane <[email protected]>    
date     : Sat, 26 Apr 2014 15:11:10 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Sat, 26 Apr 2014 15:11:10 -0400    

Click here for diff

As noted some time ago, the original coding had a typo ("|" for "^")  
that made the result less unique than intended.  Even the intended  
behavior is obsolete since it was based on wanting to produce a  
usable value even if we didn't have int64 arithmetic --- a limitation  
we stopped supporting years ago.  Instead, let's redefine the system  
identifier as tv_sec in the upper 32 bits (same as before), tv_usec  
in the next 20 bits, and the low 12 bits of getpid() in the remaining  
bits.  This is still hardly guaranteed-universally-unique, but it's  
noticeably better than before.  Per my proposal at  
<[email protected]>  

M src/backend/access/transam/xlog.c

Don't #include utils/palloc.h in common/fe_memutils.h.

commit   : 528c454b2ada89ca0f0cd9a64f939e775b55b879    
  
author   : Tom Lane <[email protected]>    
date     : Sat, 26 Apr 2014 14:14:28 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Sat, 26 Apr 2014 14:14:28 -0400    

Click here for diff

This breaks the principle that common/ ought not depend on anything in the  
server, not only code-wise but in the headers.  The only arguable advantage  
is avoidance of duplication of half a dozen extern declarations, and even  
that is rather dubious, considering that the previous coding was wrong  
about which declarations to duplicate: it exposed pnstrdup() to frontend  
code even though no such function is provided in fe_memutils.c.  
  
On the same principle, don't #include utils/memutils.h in the frontend  
build of psprintf.c.  This requires duplicating the definition of  
MaxAllocSize, but that seems fine to me: there's no a-priori reason why  
frontend code should use the same size limit as the backend anyway.  
  
In passing, clean up some rather odd layout and ordering choices that  
were imposed on palloc.h to reduce the number of #ifdefs required by  
the previous approach.  
  
Per gripe from Christoph Berg.  There's still more work to do to make  
include/common/ clean, but this part seems reasonably noncontroversial.  

M src/common/psprintf.c
M src/include/common/fe_memutils.h
M src/include/utils/palloc.h

Record the proper typmod for an index expression column.

commit   : 39b0c7681e465f3e486ca2a5d13fbbafbe25cb1a    
  
author   : Tom Lane <[email protected]>    
date     : Sat, 26 Apr 2014 12:22:09 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Sat, 26 Apr 2014 12:22:09 -0400    

Click here for diff

We should use exprTypmod() to extract the typmod of the expression,  
instead of just blindly storing -1.  This seems to have been an aboriginal  
oversight in commit fc8d970cbcdd6f025475822a4cf01dfda0873226 which  
introduced general-expression indexes.  The consequences are only cosmetic  
at present, since the index machinery doesn't really look at typmod for  
index columns; but still it seems best to describe the column type as  
precisely as we can.  Per off-list complaint from Thomas Fanghaenel.  

M src/backend/catalog/index.c

Fix off-by-one bug in LWLockRegisterTranche().

commit   : 4bfc5f1396b18da3a0db73e4406badc4ce793a1e    
  
author   : Tom Lane <[email protected]>    
date     : Fri, 25 Apr 2014 15:59:57 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Fri, 25 Apr 2014 15:59:57 -0400    

Click here for diff

Original coding failed to enlarge the array as required if  
the requested tranche_id was equal to LWLockTranchesAllocated.  
  
In passing, fix poor style of not casting the result of (re)palloc.  

M src/backend/storage/lmgr/lwlock.c

Clean up temp installations after client program tests.

commit   : 49137ec9d469f744289d0dfa2487a7fc1ef217cb    
  
author   : Tom Lane <[email protected]>    
date     : Fri, 25 Apr 2014 15:40:35 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Fri, 25 Apr 2014 15:40:35 -0400    

Click here for diff

Commit 7d0f493f19607774fdccb1a1ea06fdd96a3d9698 added infrastructure  
to perform tests in assorted src/bin/ subdirectories, but forgot to  
teach "make clean" to clean up the detritus the tests leave behind.  

M src/bin/initdb/Makefile
M src/bin/pg_basebackup/Makefile
M src/bin/pg_config/Makefile
M src/bin/pg_controldata/Makefile
M src/bin/pg_ctl/Makefile
M src/bin/scripts/Makefile

Fix race when updating a tuple concurrently locked by another process

commit   : 1a917ae8610d44985fd2027da0cfe60ccece9104    
  
author   : Alvaro Herrera <[email protected]>    
date     : Thu, 24 Apr 2014 15:41:55 -0300    
  
committer: Alvaro Herrera <[email protected]>    
date     : Thu, 24 Apr 2014 15:41:55 -0300    

Click here for diff

If a tuple is locked, and this lock is later upgraded either to an  
update or to a stronger lock, and in the meantime some other process  
tries to lock, update or delete the same tuple, it (the tuple) could end  
up being updated twice, or having conflicting locks held.  
  
The reason for this is that the second updater checks for a change in  
Xmax value, or in the HEAP_XMAX_IS_MULTI infomask bit, after noticing  
the first lock; and if there's a change, it restarts and re-evaluates  
its ability to update the tuple.  But it neglected to check for changes  
in lock strength or in lock-vs-update status when those two properties  
stayed the same.  This would lead it to take the wrong decision and  
continue with its own update, when in reality it shouldn't do so but  
instead restart from the top.  
  
This could lead to either an assertion failure much later (when a  
multixact containing multiple updates is detected), or duplicate copies  
of tuples.  
  
To fix, make sure to compare the other relevant infomask bits alongside  
the Xmax value and HEAP_XMAX_IS_MULTI bit, and restart from the top if  
necessary.  
  
Also, in the belt-and-suspenders spirit, add a check to  
MultiXactCreateFromMembers that a multixact being created does not have  
two or more members that are claimed to be updates.  This should protect  
against other bugs that might cause similar bogus situations.  
  
Backpatch to 9.3, where the possibility of multixacts containing updates  
was introduced.  (In prior versions it was possible to have the tuple  
lock upgraded from shared to exclusive, and an update would not restart  
from the top; yet we're protected against a bug there because there's  
always a sleep to wait for the locking transaction to complete before  
continuing to do anything.  Really, the fact that tuple locks always  
conflicted with concurrent updates is what protected against bugs here.)  
  
Per report from Andrew Dunstan and Josh Berkus in thread at  
http://www.postgresql.org/message-id/[email protected]  
  
Bug analysis by Andres Freund.  

M src/backend/access/heap/heapam.c
M src/backend/access/transam/multixact.c
M src/include/access/multixact.h

Reset pg_stat_activity.xact_start during PREPARE TRANSACTION.

commit   : d19bd29f07aef9e508ff047d128a4046cc8bc1e2    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 24 Apr 2014 13:29:48 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 24 Apr 2014 13:29:48 -0400    

Click here for diff

Once we've completed a PREPARE, our session is not running a transaction,  
so its entry in pg_stat_activity should show xact_start as null, rather  
than leaving the value as the start time of the now-prepared transaction.  
  
I think possibly this oversight was triggered by faulty extrapolation  
from the adjacent comment that says PrepareTransaction should not call  
AtEOXact_PgStat, so tweak the wording of that comment.  
  
Noted by Andres Freund while considering bug #10123 from Maxim Boguk,  
although this error doesn't seem to explain that report.  
  
Back-patch to all active branches.  

M src/backend/access/transam/xact.c

Properly build pg_recvlogical in the msvc build system

commit   : b2c9b161b8ae36dd9972e77297274afb9a675782    
  
author   : Magnus Hagander <[email protected]>    
date     : Thu, 24 Apr 2014 09:30:44 +0200    
  
committer: Magnus Hagander <[email protected]>    
date     : Thu, 24 Apr 2014 09:30:44 +0200    

Click here for diff

Michael Paquier  

M src/tools/msvc/Mkvcbuild.pm

Fix incorrect pg_proc.proallargtypes entries for two built-in functions.

commit   : a0f9358149b78c62871a0b7d3c167b78f9b2c77e    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 23 Apr 2014 21:21:05 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 23 Apr 2014 21:21:05 -0400    

Click here for diff

pg_sequence_parameters() and pg_identify_object() have had incorrect  
proallargtypes entries since 9.1 and 9.3 respectively.  This was mostly  
masked by the correct information in proargtypes, but a few operations  
such as pg_get_function_arguments() (and thus psql's \df display) would  
show the wrong data types for these functions' input parameters.  
  
In HEAD, fix the wrong info, bump catversion, and add an opr_sanity  
regression test to catch future mistakes of this sort.  
  
In the back branches, just fix the wrong info so that installations  
initdb'd with future minor releases will have the right data.  We  
can't force an initdb, and it doesn't seem like a good idea to add  
a regression test that will fail on existing installations.  
  
Andres Freund  

M src/include/catalog/catversion.h
M src/include/catalog/pg_proc.h
M src/test/regress/expected/opr_sanity.out
M src/test/regress/sql/opr_sanity.sql

Allow polymorphic aggregates to have non-polymorphic state data types.

commit   : f0fedfe82c8adea78354652d67c027a1a8fbce88    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 23 Apr 2014 19:17:31 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 23 Apr 2014 19:17:31 -0400    

Click here for diff

Before 9.4, such an aggregate couldn't be declared, because its final  
function would have to have polymorphic result type but no polymorphic  
argument, which CREATE FUNCTION would quite properly reject.  The  
ordered-set-aggregate patch found a workaround: allow the final function  
to be declared as accepting additional dummy arguments that have types  
matching the aggregate's regular input arguments.  However, we failed  
to notice that this problem applies just as much to regular aggregates,  
despite the fact that we had a built-in regular aggregate array_agg()  
that was known to be undeclarable in SQL because its final function  
had an illegal signature.  So what we should have done, and what this  
patch does, is to decouple the extra-dummy-arguments behavior from  
ordered-set aggregates and make it generally available for all aggregate  
declarations.  We have to put this into 9.4 rather than waiting till  
later because it slightly alters the rules for declaring ordered-set  
aggregates.  
  
The patch turned out a bit bigger than I'd hoped because it proved  
necessary to record the extra-arguments option in a new pg_aggregate  
column.  I'd thought we could just look at the final function's pronargs  
at runtime, but that didn't work well for variadic final functions.  
It's probably just as well though, because it simplifies life for pg_dump  
to record the option explicitly.  
  
While at it, fix array_agg() to have a valid final-function signature,  
and add an opr_sanity test to notice future deviations from polymorphic  
consistency.  I also marked the percentile_cont() aggregates as not  
needing extra arguments, since they don't.  

M doc/src/sgml/catalogs.sgml
M doc/src/sgml/ref/create_aggregate.sgml
M doc/src/sgml/xaggr.sgml
M src/backend/catalog/pg_aggregate.c
M src/backend/commands/aggregatecmds.c
M src/backend/executor/nodeAgg.c
M src/backend/executor/nodeWindowAgg.c
M src/backend/parser/parse_agg.c
M src/bin/pg_dump/pg_dump.c
M src/include/catalog/catversion.h
M src/include/catalog/pg_aggregate.h
M src/include/catalog/pg_proc.h
M src/include/parser/parse_agg.h
M src/test/regress/expected/create_aggregate.out
M src/test/regress/expected/opr_sanity.out
M src/test/regress/sql/create_aggregate.sql
M src/test/regress/sql/opr_sanity.sql

doc: Fix DocBook table column count declaration

commit   : 125ba2945aacde7713f3767b012c429c384f3b62    
  
author   : Peter Eisentraut <[email protected]>    
date     : Wed, 23 Apr 2014 16:14:14 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Wed, 23 Apr 2014 16:14:14 -0400    

Click here for diff

This was broken in 26cd1d7d9513b2b490efc746551ec5a786b56212.  

M doc/src/sgml/func.sgml

ecpg: Add additional files to .gitignore

commit   : c18cc0034e184374e1586c822a2ab09a494d33ff    
  
author   : Peter Eisentraut <[email protected]>    
date     : Wed, 23 Apr 2014 13:30:36 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Wed, 23 Apr 2014 13:30:36 -0400    

Click here for diff

These are test files added by f9179685371b74bf4752bf3f87846e5625cf91fa.  

M src/interfaces/ecpg/test/preproc/.gitignore

Update obsolete comments.

commit   : a4ad9afec2c2266105736ff8d78870356867cc37    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Wed, 23 Apr 2014 14:39:12 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Wed, 23 Apr 2014 14:39:12 +0300    

Click here for diff

We no longer have a TLI field in the page header.  

M src/backend/access/heap/heapam.c
M src/backend/access/nbtree/nbtinsert.c

Fix typo, trance -> tranche, in docs.

commit   : 4a781f1e6cf3be5ca84f09804f7d7c3a2180210b    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Wed, 23 Apr 2014 13:00:08 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Wed, 23 Apr 2014 13:00:08 +0300    

Click here for diff

Amit Langote  

M doc/src/sgml/monitoring.sgml

Fix typos in comment.

commit   : 8fbfbf1472776cc5d12cafc5e625a15593272b33    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Wed, 23 Apr 2014 12:56:41 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Wed, 23 Apr 2014 12:56:41 +0300    

Click here for diff

M src/backend/access/nbtree/nbtree.c

Cleanup of new b-tree page deletion code.

commit   : 4fafc4ecd9e4d224d92c4a8549c5646860787a5d    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Wed, 23 Apr 2014 10:15:06 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Wed, 23 Apr 2014 10:15:06 +0300    

Click here for diff

When marking a branch as half-dead, a pointer to the top of the branch is  
stored in the leaf block's hi-key. During normal operation, the high key  
was left in place, and the block number was just stored in the ctid field  
of the high key tuple, but in WAL replay, the high key was recreated as a  
truncated tuple with zero columns. For the sake of easier debugging, also  
truncate the tuple in normal operation, so that the page is identical  
after WAL replay. Also, rename the 'downlink' field in the WAL record to  
'topparent', as that seems like a more descriptive name. And make sure  
it's set to invalid when unlinking the leaf page.  

M src/backend/access/nbtree/nbtpage.c
M src/backend/access/nbtree/nbtxlog.c
M src/backend/access/rmgrdesc/nbtdesc.c
M src/include/access/nbtree.h

Fix documentation of FmgrInfo.fn_nargs.

commit   : d26b042ce577a4012b9798528f0b1bcfa6e502eb    
  
author   : Tom Lane <[email protected]>    
date     : Tue, 22 Apr 2014 23:22:12 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Tue, 22 Apr 2014 23:22:12 -0400    

Click here for diff

Some ancient comments claimed that fn_nargs could be -1 to indicate a  
variable number of input arguments; but this was never implemented, and  
is at variance with what we ultimately did with "variadic" functions.  
Update the comments.  

M src/backend/utils/fmgr/README
M src/include/fmgr.h

Fix broken logic in logical_heap_rewrite_flush_mappings().

commit   : c6a4ace5bf839b2480e8bb4c36bd3ec850c55c65    
  
author   : Tom Lane <[email protected]>    
date     : Tue, 22 Apr 2014 22:33:35 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Tue, 22 Apr 2014 22:33:35 -0400    

Click here for diff

It's blatantly obvious that commit 4d0d607a454ee832574afd52a3c515099cc85eb3  
wasn't tested.  The leak's real enough, though.  

M src/backend/access/heap/rewriteheap.c

revert 4d0d607a454ee832574afd52a3c515099cc85eb3

commit   : cee850c403c9dde121dde042334554167f79d989    
  
author   : Bruce Momjian <[email protected]>    
date     : Tue, 22 Apr 2014 22:21:54 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Tue, 22 Apr 2014 22:21:54 -0400    

Click here for diff

Revert due to contrib/test_decoding regression failure  

M src/backend/access/heap/rewriteheap.c

doc: adjust 9970443640b4569cf72b3c8e84abe80bdf533c7f for "null string"

commit   : 2362c2bd234f01935336208fe2924c986564baa9    
  
author   : Bruce Momjian <[email protected]>    
date     : Tue, 22 Apr 2014 20:33:12 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Tue, 22 Apr 2014 20:33:12 -0400    

Click here for diff

Report by Andrew Dunstan  

M doc/src/sgml/ref/copy.sgml

doc: improve wording of COPY commit 7ec73783d88a743799b0c262f1235f772497fb1d

commit   : 9970443640b4569cf72b3c8e84abe80bdf533c7f    
  
author   : Bruce Momjian <[email protected]>    
date     : Tue, 22 Apr 2014 19:16:54 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Tue, 22 Apr 2014 19:16:54 -0400    

Click here for diff

M doc/src/sgml/ref/copy.sgml

doc: mention CREATE MATERIALIZED VIEW AS can be EXPLAINed

commit   : 8506a607a3b261576240d09f1ed4abfb2dba1635    
  
author   : Bruce Momjian <[email protected]>    
date     : Tue, 22 Apr 2014 18:38:14 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Tue, 22 Apr 2014 18:38:14 -0400    

Click here for diff

Patch by Amit Langote  
  
Report by  
  
Backpatch through  

M doc/src/sgml/ref/explain.sgml

docs: add results for JSON operator examples

commit   : 26cd1d7d9513b2b490efc746551ec5a786b56212    
  
author   : Bruce Momjian <[email protected]>    
date     : Tue, 22 Apr 2014 18:19:07 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Tue, 22 Apr 2014 18:19:07 -0400    

Click here for diff

Patch by Sehrope Sarkuni  

M doc/src/sgml/func.sgml

build: add EXTRA_REGRESS_OPTS to all pg_regress invocations

commit   : 19fa6161dd6ba85b6c88b3476d165745dd5192d9    
  
author   : Bruce Momjian <[email protected]>    
date     : Tue, 22 Apr 2014 18:13:10 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Tue, 22 Apr 2014 18:13:10 -0400    

Click here for diff

Patch by Christoph Berg  

M src/Makefile.global.in

docs: clearify use of pg_database.datistemplate

commit   : 72590b3a69baaf24d1090a2c2ceb9181be34043e    
  
author   : Bruce Momjian <[email protected]>    
date     : Tue, 22 Apr 2014 18:10:14 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Tue, 22 Apr 2014 18:10:14 -0400    

Click here for diff

Patch by Rajeev rastogi  

M doc/src/sgml/catalogs.sgml

release memory used while flushing logical mappings

commit   : 4d0d607a454ee832574afd52a3c515099cc85eb3    
  
author   : Bruce Momjian <[email protected]>    
date     : Tue, 22 Apr 2014 18:05:44 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Tue, 22 Apr 2014 18:05:44 -0400    

Click here for diff

Patch by Ants Aasma  

M src/backend/access/heap/rewriteheap.c

doc: improve CREATE RULE event list

commit   : c27bf777cf4e05d318e202316857b354cc2f7a5a    
  
author   : Bruce Momjian <[email protected]>    
date     : Tue, 22 Apr 2014 17:54:42 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Tue, 22 Apr 2014 17:54:42 -0400    

Click here for diff

Patch by Fujii Masao  
  
Report by Emanuel Calvo  

M doc/src/sgml/ref/create_rule.sgml

regression test: fix hot standby tests by using repeatable read

commit   : 2985e16031b61e9a428635e6860b3024570d3666    
  
author   : Bruce Momjian <[email protected]>    
date     : Tue, 22 Apr 2014 17:23:58 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Tue, 22 Apr 2014 17:23:58 -0400    

Click here for diff

Serializable transactions won't work on a Hot Standby.  Also fix  
VACUUM/ANALYZE label mixup.  
  
Patch by Martín Marqués  

M src/test/regress/expected/hs_standby_allowed.out
M src/test/regress/expected/hs_standby_disallowed.out
M src/test/regress/sql/hs_standby_allowed.sql

copy: update docs for FORCE_NULL and FORCE_NOT_NULL combination

commit   : 7ec73783d88a743799b0c262f1235f772497fb1d    
  
author   : Bruce Momjian <[email protected]>    
date     : Tue, 22 Apr 2014 16:06:37 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Tue, 22 Apr 2014 16:06:37 -0400    

Click here for diff

Also update regression tests  
  
Patch by Michael Paquier  

M contrib/file_fdw/file_fdw.c
M contrib/file_fdw/input/file_fdw.source
M contrib/file_fdw/output/file_fdw.source
M doc/src/sgml/ref/copy.sgml
M src/test/regress/expected/copy2.out
M src/test/regress/sql/copy2.sql

Fix bug in the new B-tree incomplete-split code.

commit   : 4a5d55ec2b711e13438a32d119a809a22ced410b    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Tue, 22 Apr 2014 22:40:44 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Tue, 22 Apr 2014 22:40:44 +0300    

Click here for diff

Forgot to update LSN of left sibling's page, when creating a new root.  
I fixed this for regular insertions and page splits earlier, but missed  
new root creation.  

M src/backend/access/nbtree/nbtinsert.c

Fix Gin README.

commit   : 45e67a2ad7fcc1389cf897e308a75c3cb9f88c3f    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Tue, 22 Apr 2014 22:36:32 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Tue, 22 Apr 2014 22:36:32 +0300    

Click here for diff

The README incorrectly claimed that GIN posting tree pages contain an array  
of uncompressed items in addition to compressed posting lists. Earlier  
versions of the GIN posting list compression patch worked that way, but not  
the one that was committed.  

M src/backend/access/gin/README

doc: Improve "replication slot" index entries

commit   : 80ce90b9c40d10dc3acaf10ac0975c3b8d1e3289    
  
author   : Peter Eisentraut <[email protected]>    
date     : Tue, 22 Apr 2014 15:22:10 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Tue, 22 Apr 2014 15:22:10 -0400    

Click here for diff

Now that we have accumulated two different "replication slot" concepts,  
make the index entries consistent.  

M doc/src/sgml/high-availability.sgml
M doc/src/sgml/logicaldecoding.sgml

Fix bug in new B-tree page deletion code.

commit   : 77fe2b6d795f3f4ed282c9c980920e128a57624e    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Tue, 22 Apr 2014 15:34:54 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Tue, 22 Apr 2014 15:34:54 +0300    

Click here for diff

When modifying a page, must hold an exclusive lock. A shared lock is  
obviously not good enough.  

M src/backend/access/nbtree/nbtpage.c

Retain original physical order of tuples in redo of b-tree splits.

commit   : 7e30c186da8eaae84ab30352ac23f0d5bdc59e25    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Tue, 22 Apr 2014 13:03:37 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Tue, 22 Apr 2014 13:03:37 +0300    

Click here for diff

It makes no difference to the system, but minimizing the differences  
between a master and standby makes debugging simpler.  

M src/backend/access/nbtree/nbtxlog.c

Fix rm_desc routine of b-tree page delete records.

commit   : 7d98054f0dd115f57ad0ec1f424a66c13459013b    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Tue, 22 Apr 2014 13:02:52 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Tue, 22 Apr 2014 13:02:52 +0300    

Click here for diff

A couple of typos from my refactoring of the page deletion patch.  

M src/backend/access/rmgrdesc/nbtdesc.c

Avoid transient bogus page contents when creating a sequence.

commit   : 8d34f6862853b4b67e29b368dfedf7d4c28d694b    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Tue, 22 Apr 2014 09:50:47 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Tue, 22 Apr 2014 09:50:47 +0300    

Click here for diff

Don't use simple_heap_insert to insert the tuple to a sequence relation.  
simple_heap_insert creates a heap insertion WAL record, and replaying that  
will create a regular heap page without the special area containing the  
sequence magic constant, which is wrong for a sequence. That was not a bug  
because we always created a sequence WAL record after that, and replaying  
that overwrote the bogus heap page, and the transient state could never be  
seen by another backend because it was only done when creating a new  
sequence relation. But it's simpler and cleaner to avoid that in the first  
place.  

M src/backend/commands/sequence.c

pg_stat_statements forgot to let previous occupant of hook get control too.

commit   : 78a3c9b6a5f6cc84abaf4e13deb58c620eb2161b    
  
author   : Tom Lane <[email protected]>    
date     : Mon, 21 Apr 2014 13:28:07 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Mon, 21 Apr 2014 13:28:07 -0400    

Click here for diff

pgss_post_parse_analyze() neglected to pass the call on to any earlier  
occupant of the post_parse_analyze_hook.  There are no other users of that  
hook in contrib/, and most likely none in the wild either, so this is  
probably just a latent bug.  But it's a bug nonetheless, so back-patch  
to 9.2 where this code was introduced.  

M contrib/pg_stat_statements/pg_stat_statements.c

Fix another typo.

commit   : 602b27ab8e45fbb07cf5b275b0593b38190232e4    
  
author   : Robert Haas <[email protected]>    
date     : Sun, 20 Apr 2014 16:32:57 +0200    
  
committer: Robert Haas <[email protected]>    
date     : Sun, 20 Apr 2014 16:32:57 +0200    

Click here for diff

Etsuro Fujita  

M src/include/access/gin_private.h

Fix typo.

commit   : fab6170cabbd5af8ffabd2fcbf53e30287f11a41    
  
author   : Robert Haas <[email protected]>    
date     : Sun, 20 Apr 2014 16:30:55 +0200    
  
committer: Robert Haas <[email protected]>    
date     : Sun, 20 Apr 2014 16:30:55 +0200    

Click here for diff

Etsuro Fujita  

M src/backend/access/gin/README

doc: CREATE DATABASE doesn't copy template database-level config params

commit   : 012025f9ae20e174b81f71af45b467f9a62fe478    
  
author   : Bruce Momjian <[email protected]>    
date     : Sat, 19 Apr 2014 15:26:49 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Sat, 19 Apr 2014 15:26:49 -0400    

Click here for diff

Report by Alexey Bashtanov  

M doc/src/sgml/ref/create_database.sgml

doc: mention archive_command and recovery_command are exec'ed locally

commit   : 0e8beed515b78d5a987c04ec047b7c9bee69ac83    
  
author   : Bruce Momjian <[email protected]>    
date     : Sat, 19 Apr 2014 14:59:47 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Sat, 19 Apr 2014 14:59:47 -0400    

Click here for diff

Report by Craig Ringer  

M doc/src/sgml/config.sgml
M doc/src/sgml/recovery-config.sgml

docs: tablespaces cannot be accessed independently

commit   : 4353d1809f6d10845be76dda1dad45013d0b14b8    
  
author   : Bruce Momjian <[email protected]>    
date     : Sat, 19 Apr 2014 10:52:49 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Sat, 19 Apr 2014 10:52:49 -0400    

Click here for diff

Mention impossibility of moving tablespaces, backing them up  
independently, or the inadvisability of placing them on temporary  
file systems.  
  
Patch by Craig Ringer, adjustments by Ian Lawrence Warwick and me  

M doc/src/sgml/manage-ag.sgml
M doc/src/sgml/ref/create_tablespace.sgml

libpq: have PQconnectdbParams() and PQpingParams accept "" as default

commit   : 13ecb822e8da5668133b706474c25bc908ae370a    
  
author   : Bruce Momjian <[email protected]>    
date     : Sat, 19 Apr 2014 08:41:51 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Sat, 19 Apr 2014 08:41:51 -0400    

Click here for diff

Previously, these functions treated "" optin values as defaults in some  
ways, but not in others, like when comparing to .pgpass.  Also, add  
documentation to clarify that now "" and NULL use defaults, like  
PQsetdbLogin() has always done.  
  
BACKWARD INCOMPATIBILITY  
  
Patch by Adrian Vondendriesch, docs by me  
  
Report by Jeff Janes  

M doc/src/sgml/libpq.sgml
M src/interfaces/libpq/fe-connect.c

Fix typo

commit   : 66b1084e2ccf1f5b8cb57ebb41f54f76850a2b5d    
  
author   : Magnus Hagander <[email protected]>    
date     : Fri, 18 Apr 2014 12:49:54 +0200    
  
committer: Magnus Hagander <[email protected]>    
date     : Fri, 18 Apr 2014 12:49:54 +0200    

Click here for diff

Amit Langote  

M src/backend/access/transam/recovery.conf.sample

Create function prototype as part of PG_FUNCTION_INFO_V1 macro

commit   : e7128e8dbb305059c30ec085461297e619bcbff4    
  
author   : Peter Eisentraut <[email protected]>    
date     : Fri, 18 Apr 2014 00:03:19 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Fri, 18 Apr 2014 00:03:19 -0400    

Click here for diff

Because of gcc -Wmissing-prototypes, all functions in dynamically  
loadable modules must have a separate prototype declaration.  This is  
meant to detect global functions that are not declared in header files,  
but in cases where the function is called via dfmgr, this is redundant.  
Besides filling up space with boilerplate, this is a frequent source of  
compiler warnings in extension modules.  
  
We can fix that by creating the function prototype as part of the  
PG_FUNCTION_INFO_V1 macro, which such modules have to use anyway.  That  
makes the code of modules cleaner, because there is one less place where  
the entry points have to be listed, and creates an additional check that  
functions have the right prototype.  
  
Remove now redundant prototypes from contrib and other modules.  

M contrib/adminpack/adminpack.c
M contrib/btree_gin/btree_gin.c
M contrib/btree_gist/btree_bit.c
M contrib/btree_gist/btree_bytea.c
M contrib/btree_gist/btree_cash.c
M contrib/btree_gist/btree_date.c
M contrib/btree_gist/btree_float4.c
M contrib/btree_gist/btree_float8.c
M contrib/btree_gist/btree_gist.c
M contrib/btree_gist/btree_inet.c
M contrib/btree_gist/btree_int2.c
M contrib/btree_gist/btree_int4.c
M contrib/btree_gist/btree_int8.c
M contrib/btree_gist/btree_interval.c
M contrib/btree_gist/btree_macaddr.c
M contrib/btree_gist/btree_numeric.c
M contrib/btree_gist/btree_oid.c
M contrib/btree_gist/btree_text.c
M contrib/btree_gist/btree_time.c
M contrib/btree_gist/btree_ts.c
M contrib/btree_gist/btree_utils_var.c
M contrib/chkpass/chkpass.c
M contrib/citext/citext.c
M contrib/cube/cube.c
M contrib/dict_int/dict_int.c
M contrib/dict_xsyn/dict_xsyn.c
M contrib/earthdistance/earthdistance.c
M contrib/file_fdw/file_fdw.c
M contrib/fuzzystrmatch/dmetaphone.c
M contrib/fuzzystrmatch/fuzzystrmatch.c
M contrib/hstore/hstore.h
M contrib/hstore/hstore_compat.c
M contrib/hstore/hstore_gin.c
M contrib/hstore/hstore_gist.c
M contrib/hstore/hstore_io.c
M contrib/hstore/hstore_op.c
M contrib/intarray/_int_bool.c
M contrib/intarray/_int_gin.c
M contrib/intarray/_int_gist.c
M contrib/intarray/_int_op.c
M contrib/intarray/_intbig_gist.c
M contrib/lo/lo.c
M contrib/ltree/_ltree_gist.c
M contrib/ltree/_ltree_op.c
M contrib/ltree/ltree_gist.c
M contrib/ltree/ltree_io.c
M contrib/ltree/ltree_op.c
M contrib/ltree/ltxtquery_io.c
M contrib/pageinspect/btreefuncs.c
M contrib/pageinspect/fsmfuncs.c
M contrib/pageinspect/heapfuncs.c
M contrib/pageinspect/rawpage.c
M contrib/pg_buffercache/pg_buffercache_pages.c
M contrib/pg_freespacemap/pg_freespacemap.c
M contrib/pg_prewarm/pg_prewarm.c
M contrib/pg_stat_statements/pg_stat_statements.c
M contrib/pg_trgm/trgm_gin.c
M contrib/pg_trgm/trgm_gist.c
M contrib/pg_trgm/trgm_op.c
M contrib/pg_upgrade_support/pg_upgrade_support.c
M contrib/pgcrypto/pgp-pgsql.c
M contrib/pgrowlocks/pgrowlocks.c
M contrib/pgstattuple/pgstatindex.c
M contrib/pgstattuple/pgstattuple.c
M contrib/postgres_fdw/option.c
M contrib/postgres_fdw/postgres_fdw.c
M contrib/seg/seg.c
M contrib/spi/autoinc.c
M contrib/spi/insert_username.c
M contrib/spi/moddatetime.c
M contrib/spi/refint.c
M contrib/spi/timetravel.c
M contrib/sslinfo/sslinfo.c
M contrib/tcn/tcn.c
M contrib/test_parser/test_parser.c
M contrib/test_shm_mq/test.c
M contrib/tsearch2/tsearch2.c
M contrib/unaccent/unaccent.c
M contrib/uuid-ossp/uuid-ossp.c
M contrib/worker_spi/worker_spi.c
M contrib/xml2/xpath.c
M contrib/xml2/xslt_proc.c
M src/include/fmgr.h
M src/pl/plperl/plperl.c
M src/pl/plpgsql/src/plpgsql.h
M src/pl/plpython/plpy_main.c
M src/pl/tcl/pltcl.c
M src/test/regress/regress.c

Fix unused-variable warning on Windows.

commit   : 01563158235f5650743fd9b1dfa80c3d8faf89bb    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 17 Apr 2014 16:12:24 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 17 Apr 2014 16:12:24 -0400    

Click here for diff

Introduced in 585bca39: msgid is not used in the Windows code path.  
  
Also adjust comments a tad (mostly to keep pgindent from messing it up).  
  
David Rowley  

M src/interfaces/libpq/fe-connect.c

pgcrypto: fix memset() calls that might be optimized away

commit   : 9fe55259fd61fd9199907623f974caa7af66e780    
  
author   : Bruce Momjian <[email protected]>    
date     : Thu, 17 Apr 2014 12:37:53 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Thu, 17 Apr 2014 12:37:53 -0400    

Click here for diff

Specifically, on-stack memset() might be removed, so:  
  
	* Replace memset() with px_memset()  
	* Add px_memset to copy_crlf()  
	* Add px_memset to pgp-s2k.c  
  
Patch by Marko Kreen  
  
Report by PVS-Studio  
  
Backpatch through 8.4.  

M contrib/pgcrypto/crypt-blowfish.c
M contrib/pgcrypto/crypt-md5.c
M contrib/pgcrypto/fortuna.c
M contrib/pgcrypto/internal-sha2.c
M contrib/pgcrypto/internal.c
M contrib/pgcrypto/mbuf.c
M contrib/pgcrypto/openssl.c
M contrib/pgcrypto/pgp-cfb.c
M contrib/pgcrypto/pgp-compress.c
M contrib/pgcrypto/pgp-decrypt.c
M contrib/pgcrypto/pgp-encrypt.c
M contrib/pgcrypto/pgp-mpi.c
M contrib/pgcrypto/pgp-pgsql.c
M contrib/pgcrypto/pgp-pubenc.c
M contrib/pgcrypto/pgp-pubkey.c
M contrib/pgcrypto/pgp-s2k.c
M contrib/pgcrypto/pgp.c
M contrib/pgcrypto/px-crypt.c
M contrib/pgcrypto/px-hmac.c
M contrib/pgcrypto/px.c
M contrib/pgcrypto/px.h
M contrib/pgcrypto/sha2.c

report stat() error in trigger file check

commit   : 83defef8c794e7772e4099a7efa2ebac3c62742c    
  
author   : Bruce Momjian <[email protected]>    
date     : Thu, 17 Apr 2014 11:55:57 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Thu, 17 Apr 2014 11:55:57 -0400    

Click here for diff

Permissions might prevent the existence of the trigger file from being  
checked.  
  
Per report from Andres Freund  

M src/backend/access/transam/xlog.c

pg_upgrade: throw an error for non-existent tablespace directories

commit   : c1275cf74172cd0ed478dbc31e34e2ffffc6e789    
  
author   : Bruce Momjian <[email protected]>    
date     : Thu, 17 Apr 2014 11:42:21 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Thu, 17 Apr 2014 11:42:21 -0400    

Click here for diff

Non-existent tablespace directory references can occur if user  
tablespaces are created inside data directories and the data directory  
is renamed in preparation for running pg_upgrade, and the symbolic links  
are not updated.  
  
Backpatch to 9.3.  

M contrib/pg_upgrade/tablespace.c

docs: adjustments for streaming standbys that disconnect frequently

commit   : 52e757420fa98a76015c2c88432db94269f3e8f4    
  
author   : Bruce Momjian <[email protected]>    
date     : Thu, 17 Apr 2014 10:52:32 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Thu, 17 Apr 2014 10:52:32 -0400    

Click here for diff

Document problems when disconnection causes loss of hot_standby_feedback  
and suggest adjusting max_standby_archive_delay and  
max_standby_streaming_delay.  
  
Initial patch by Marko Tiikkaja, adjustments by me  

M doc/src/sgml/high-availability.sgml

Set the all-visible flag on heap page before writing WAL record, not after.

commit   : 2a8e1ac598c864ac2775f33da21a117c363c6c7f    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Thu, 17 Apr 2014 17:47:50 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Thu, 17 Apr 2014 17:47:50 +0300    

Click here for diff

If we set the all-visible flag after writing WAL record, and XLogInsert  
takes a full-page image of the page, the image would not include the flag.  
We will then proceed to set the VM bit, which would then be set without the  
corresponding all-visible flag on the heap page.  
  
Found by comparing page images on master and standby, after writing/replaying  
each WAL record. (There is still a discrepancy: the all-visible flag won't  
be set after replaying the HEAP_CLEAN record, even though it is set in the  
master. However, it will be set when replaying the HEAP2_VISIBLE record and  
setting the VM bit, so the all-visible flag and VM bit are always consistent  
on the standby, even though they are momentarily out-of-sync with master)  
  
Backpatch to 9.3 where this code was introduced.  

M src/backend/commands/vacuumlazy.c

Rename EXPLAIN ANALYZE's "total runtime" output to "execution time".

commit   : 5f86cbd714c9d43c0fbb43a7b172f77ebf429548    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 16 Apr 2014 20:48:51 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 16 Apr 2014 20:48:51 -0400    

Click here for diff

Now that EXPLAIN also outputs a "planning time" measurement, the use of  
"total" here seems rather confusing: it sounds like it might include the  
planning time which of course it doesn't.  Majority opinion was that  
"execution time" is a better label, so we'll call it that.  
  
This should be noted as a backwards incompatibility for tools that examine  
EXPLAIN ANALYZE output.  
  
In passing, I failed to resist the temptation to do a little editing on the  
materialized-view example affected by this change.  

M doc/src/sgml/perform.sgml
M doc/src/sgml/ref/explain.sgml
M doc/src/sgml/rules.sgml
M src/backend/commands/explain.c

docs: properly document psql auto encoding mode

commit   : e183d11262f4e04ce7f191a9655aeeaa4682a7f5    
  
author   : Bruce Momjian <[email protected]>    
date     : Wed, 16 Apr 2014 19:53:42 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Wed, 16 Apr 2014 19:53:42 -0400    

Click here for diff

In psql, both stdin and stdout must be terminals to get a client  
encoding of 'auto'.  
  
Patch by Albe Laurenz  
  
Backpatch to 9.3.  

M doc/src/sgml/ref/psql-ref.sgml

libpq: use pgsocket for socket values, for portability

commit   : 5d305d86bd917723f09ab4f15c075d90586a210a    
  
author   : Bruce Momjian <[email protected]>    
date     : Wed, 16 Apr 2014 19:46:51 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Wed, 16 Apr 2014 19:46:51 -0400    

Click here for diff

Previously, 'int' was used for socket values in libpq, but socket values  
are unsigned on Windows.  This is a style correction.  
  
Initial patch and previous PGINVALID_SOCKET initial patch by Joel  
Jacobson, modified by me  
  
Report from PVS-Studio  

M src/interfaces/libpq/fe-connect.c
M src/interfaces/libpq/fe-exec.c
M src/interfaces/libpq/fe-misc.c
M src/interfaces/libpq/fe-protocol2.c
M src/interfaces/libpq/fe-protocol3.c
M src/interfaces/libpq/libpq-int.h

doc: move min_recovery_apply_delay into the right section

commit   : be5f7fff470066dc3ee655b25840733eb9006426    
  
author   : Bruce Momjian <[email protected]>    
date     : Wed, 16 Apr 2014 19:15:16 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Wed, 16 Apr 2014 19:15:16 -0400    

Click here for diff

Patch by Fujii Masao  

M doc/src/sgml/recovery-config.sgml

psql: update --help output for unaligned mode params

commit   : 8c349ba5c04c3b5fdceb13c35996e7ff4b69585f    
  
author   : Bruce Momjian <[email protected]>    
date     : Wed, 16 Apr 2014 18:13:15 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Wed, 16 Apr 2014 18:13:15 -0400    

Click here for diff

Previously it wasn't clear from --help that -F, -R, -z, -0 only  
controlled psql unaligned output.  
  
Initial patch from Jov <[email protected]>, adjustments by me  

M src/bin/psql/help.c

Fix object identities for text search objects

commit   : 83ab8e32f24542e3ab1f73b24c57cdbed6a4c9e4    
  
author   : Alvaro Herrera <[email protected]>    
date     : Wed, 16 Apr 2014 18:25:44 -0300    
  
committer: Alvaro Herrera <[email protected]>    
date     : Wed, 16 Apr 2014 18:25:44 -0300    

Click here for diff

We were neglecting to schema-qualify them.  
  
Backpatch to 9.3, where object identities were introduced as a concept  
by commit f8348ea32ec8.  

M src/backend/catalog/objectaddress.c

Fix contrib/postgres_fdw's remote-estimate representation of array Params.

commit   : 5b68d81697bcb0d16136bd037e454ee53c521185    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 16 Apr 2014 17:21:57 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 16 Apr 2014 17:21:57 -0400    

Click here for diff

We were emitting "(SELECT null::typename)", which is usually interpreted  
as a scalar subselect, but not so much in the context "x = ANY(...)".  
This led to remote-side parsing failures when remote_estimate is enabled.  
A quick and ugly fix is to stick in an extra cast step,  
"((SELECT null::typename)::typename)".  The cast will be thrown away as  
redundant by parse analysis, but not before it's done its job of making  
sure the grammar sees the ANY argument as an a_expr rather than a  
select_with_parens.  Per an example from Hannu Krosing.  

M contrib/postgres_fdw/deparse.c
M contrib/postgres_fdw/expected/postgres_fdw.out
M contrib/postgres_fdw/sql/postgres_fdw.sql

docs: make max_wal_senders higher to handle disconnects

commit   : 9c5334650085d441324e0f4fd9f8db12657b25c7    
  
author   : Bruce Momjian <[email protected]>    
date     : Wed, 16 Apr 2014 15:06:17 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Wed, 16 Apr 2014 15:06:17 -0400    

Click here for diff

Document abrupt streaming client disconnection might leave slots in use,  
so max_wal_senders should be slightly higher than needed to allow for  
immediate reconnection.  
  
Per mention by Magnus  

M doc/src/sgml/config.sgml

Update oidjoins regression test for 9.4.

commit   : cbb5e23bfa92973bddf11935448a9d42c32f7d42    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 16 Apr 2014 14:28:59 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 16 Apr 2014 14:28:59 -0400    

Click here for diff

Now that we're pretty much feature-frozen, it's time to update the checks  
on system catalog foreign-key references.  
  
(It looks like we missed doing this altogether for 9.3.  Sigh.)  

M src/test/regress/expected/oidjoins.out
M src/test/regress/sql/oidjoins.sql
A src/tools/findoidjoins/.gitignore
M src/tools/findoidjoins/README

Attempt to get plpython regression tests working again for MSVC builds.

commit   : ef158312e96960bfbc802ceda58f432f6fd845eb    
  
author   : Andrew Dunstan <[email protected]>    
date     : Wed, 16 Apr 2014 13:35:46 -0400    
  
committer: Andrew Dunstan <[email protected]>    
date     : Wed, 16 Apr 2014 13:35:46 -0400    

Click here for diff

This has probably been broken for quite a long time. Buildfarm member  
currawong's current results suggest that it's been broken since 9.1, so  
backpatch this to that branch.  
  
This only supports Python 2 - I will handle Python 3 separately, but  
this is a fairly simple fix.  

M src/tools/msvc/vcregress.pl

pg_upgrade: remove redundant include files

commit   : 95cb917297ebe77add3cef4f01cca1004031fa9a    
  
author   : Bruce Momjian <[email protected]>    
date     : Wed, 16 Apr 2014 13:27:00 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Wed, 16 Apr 2014 13:27:00 -0400    

Click here for diff

The files were already included by pg_upgrade.h.  

M contrib/pg_upgrade/exec.c
M contrib/pg_upgrade/option.c

Use AF_UNSPEC not PF_UNSPEC in getaddrinfo calls.

commit   : cad4fe6455bdc9ef1026b4a247eeb588ab3a8bd6    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 16 Apr 2014 13:20:54 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 16 Apr 2014 13:20:54 -0400    

Click here for diff

According to the Single Unix Spec and assorted man pages, you're supposed  
to use the constants named AF_xxx when setting ai_family for a getaddrinfo  
call.  In a few places we were using PF_xxx instead.  Use of PF_xxx  
appears to be an ancient BSD convention that was not adopted by later  
standardization.  On BSD and most later Unixen, it doesn't matter much  
because those constants have equivalent values anyway; but nonetheless  
this code is not per spec.  
  
In the same vein, replace PF_INET by AF_INET in one socket() call, which  
wasn't even consistent with the other socket() call in the same function  
let alone the remainder of our code.  
  
Per investigation of a Cygwin trouble report from Marco Atzeri.  It's  
probably a long shot that this will fix his issue, but it's wrong in  
any case.  

M src/backend/libpq/hba.c
M src/backend/postmaster/pgstat.c
M src/bin/initdb/initdb.c
M src/bin/pg_dump/parallel.c

Fix timeout in LDAP lookup of libpq connection parameters

commit   : 585bca393640b609c54159e1bedd30a89fec5ea8    
  
author   : Magnus Hagander <[email protected]>    
date     : Wed, 16 Apr 2014 17:18:02 +0200    
  
committer: Magnus Hagander <[email protected]>    
date     : Wed, 16 Apr 2014 17:18:02 +0200    

Click here for diff

Bind attempts to an LDAP server should time out after two seconds,  
allowing additional lines in the service control file to be parsed  
(which provide a fall back to a secondary LDAP server or default options).  
The existing code failed to enforce that timeout during TCP connect,  
resulting in a hang far longer than two seconds if the LDAP server  
does not respond.  
  
Laurenz Albe  

M src/interfaces/libpq/fe-connect.c

Add to_regprocedure() and to_regoperator().

commit   : dfc0219f649d5450a5e4d491dab1eeb23ac5530a    
  
author   : Robert Haas <[email protected]>    
date     : Wed, 16 Apr 2014 12:21:43 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Wed, 16 Apr 2014 12:21:43 -0400    

Click here for diff

These are natural complements to the functions added by commit  
0886fc6a5c75b294544263ea979b9cf6195407d9, but they weren't included  
in the original patch for some reason.  Add them.  
  
Patch by me, per a complaint by Tom Lane.  Review by Tatsuo  
Ishii.  

M doc/src/sgml/func.sgml
M src/backend/utils/adt/regproc.c
M src/include/catalog/catversion.h
M src/include/catalog/pg_proc.h
M src/include/utils/builtins.h
M src/test/regress/expected/regproc.out
M src/test/regress/sql/regproc.sql

Try to fix spurious DSM failures on Windows.

commit   : 1a81daab8be9a0b3769a2660db44a56a6035e34a    
  
author   : Robert Haas <[email protected]>    
date     : Wed, 16 Apr 2014 12:04:44 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Wed, 16 Apr 2014 12:04:44 -0400    

Click here for diff

Apparently, Windows can sometimes return an error code even when the  
operation actually worked just fine.  Rearrange the order of checks  
according to what appear to be the best practices in this area.  
  
Amit Kapila  

M src/backend/storage/ipc/dsm_impl.c

doc: fix json_extract_path_text() typo by adding jsonb

commit   : ed4a26260c6ebd7948eacc42eddae1e898239f6e    
  
author   : Bruce Momjian <[email protected]>    
date     : Wed, 16 Apr 2014 11:24:38 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Wed, 16 Apr 2014 11:24:38 -0400    

Click here for diff

Report from rudolf <[email protected]>  

M doc/src/sgml/func.sgml

check socket creation errors against PGINVALID_SOCKET

commit   : 41809346518a2b57530b22148609a346a718adc9    
  
author   : Bruce Momjian <[email protected]>    
date     : Wed, 16 Apr 2014 10:45:48 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Wed, 16 Apr 2014 10:45:48 -0400    

Click here for diff

Previously, in some places, socket creation errors were checked for  
negative values, which is not true for Windows because sockets are  
unsigned.  This masked socket creation errors on Windows.  
  
Backpatch through 9.0.  8.4 doesn't have the infrastructure to fix this.  

M src/backend/libpq/auth.c
M src/backend/libpq/ip.c
M src/backend/libpq/pqcomm.c
M src/backend/port/win32/socket.c
M src/backend/postmaster/postmaster.c
M src/interfaces/libpq/fe-connect.c
M src/interfaces/libpq/libpq-int.h

Use correctly-sized buffer when zero-filling a WAL file.

commit   : 848b9f05ab283724dd063d936a92568c1fdf422b    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Wed, 16 Apr 2014 10:21:09 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Wed, 16 Apr 2014 10:21:09 +0300    

Click here for diff

I mixed up BLCKSZ and XLOG_BLCKSZ when I changed the way the buffer is  
allocated a couple of weeks ago. With the default settings, they are both  
8k, but they can be changed at compile-time.  

M src/backend/access/transam/xlog.c

contrib/test_decoding: fix regression test for psql oid display changes

commit   : ab76d8e9d672c661fe8ce4d9405dc8956b8ece9d    
  
author   : Bruce Momjian <[email protected]>    
date     : Tue, 15 Apr 2014 14:45:10 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Tue, 15 Apr 2014 14:45:10 -0400    

Click here for diff

Missed in previous commit  

M contrib/test_decoding/expected/ddl.out

psql: conditionally display oids and replication identity

commit   : 4168c00a5d9c0c0c17cdfc902587b6d22ea1720f    
  
author   : Bruce Momjian <[email protected]>    
date     : Tue, 15 Apr 2014 13:28:54 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Tue, 15 Apr 2014 13:28:54 -0400    

Click here for diff

In psql \d+, display oids only when they exist, and display replication  
identity only when it is non-default.  Also document the defaults for  
replication identity for system and non-system tables.  Update  
regression output.  

M doc/src/sgml/ref/alter_table.sgml
M doc/src/sgml/ref/psql-ref.sgml
M src/bin/psql/describe.c
M src/test/regress/expected/create_table_like.out
M src/test/regress/expected/foreign_data.out
M src/test/regress/expected/inherit.out
M src/test/regress/expected/replica_identity.out
M src/test/regress/expected/rules.out
M src/test/regress/sql/replica_identity.sql

vacuumdb: Add option --analyze-in-stages

commit   : c92c3d50d7fbe7391b5fc864b444346b2db29ffe    
  
author   : Peter Eisentraut <[email protected]>    
date     : Mon, 14 Apr 2014 23:15:05 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Mon, 14 Apr 2014 23:15:05 -0400    

Click here for diff

Add vacuumdb option --analyze-in-stages which runs ANALYZE three times  
with different configuration settings, adopting the logic from the  
analyze_new_cluster.sh script that pg_upgrade generates.  That way,  
users of pg_dump/pg_restore can also use that functionality.  
  
Change pg_upgrade to create the script so that it calls vacuumdb instead  
of implementing the logic itself.  

M contrib/pg_upgrade/check.c
M doc/src/sgml/ref/vacuumdb.sgml
A src/bin/scripts/t/102_vacuumdb_stages.pl
M src/bin/scripts/vacuumdb.c

Have lcov call the right gcov

commit   : 0d3b2b80aa6aee753f372bb0300a131691e9f55c    
  
author   : Peter Eisentraut <[email protected]>    
date     : Mon, 14 Apr 2014 21:52:03 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Mon, 14 Apr 2014 21:52:03 -0400    

Click here for diff

By default, lcov will call whatever gcov it can find in the path.  But  
if the user has specified a different gcov to configure, this could be  
incompatible.  So tell lcov explicitly with an option which gcov program  
to call.  

M src/Makefile.global.in

Add @configure_input@ marker to Makefile.global.in

commit   : e3fd9327384abc1cd252ddd8ce9429ab7bef48b5    
  
author   : Peter Eisentraut <[email protected]>    
date     : Mon, 14 Apr 2014 21:49:57 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Mon, 14 Apr 2014 21:49:57 -0400    

Click here for diff

That way, when looking at Makefile.global, we don't get confused by the  
comment that claims that this is Makefile.global.in.  

M src/Makefile.global.in

Add TAP tests for client programs

commit   : 7d0f493f19607774fdccb1a1ea06fdd96a3d9698    
  
author   : Peter Eisentraut <[email protected]>    
date     : Mon, 14 Apr 2014 21:33:46 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Mon, 14 Apr 2014 21:33:46 -0400    

Click here for diff

Reviewed-by: Pavel Stěhule <[email protected]>  
Reviewed-by: Erik Rijkers <[email protected]>  

M GNUmakefile.in
M configure
M configure.in
M doc/src/sgml/installation.sgml
M doc/src/sgml/regress.sgml
M src/Makefile.global.in
M src/bin/initdb/.gitignore
M src/bin/initdb/Makefile
A src/bin/initdb/t/001_initdb.pl
M src/bin/pg_basebackup/.gitignore
M src/bin/pg_basebackup/Makefile
A src/bin/pg_basebackup/t/010_pg_basebackup.pl
A src/bin/pg_basebackup/t/020_pg_receivexlog.pl
M src/bin/pg_config/.gitignore
M src/bin/pg_config/Makefile
A src/bin/pg_config/t/001_pg_config.pl
M src/bin/pg_controldata/.gitignore
M src/bin/pg_controldata/Makefile
A src/bin/pg_controldata/t/001_pg_controldata.pl
M src/bin/pg_ctl/.gitignore
M src/bin/pg_ctl/Makefile
A src/bin/pg_ctl/t/001_start_stop.pl
A src/bin/pg_ctl/t/002_status.pl
M src/bin/scripts/.gitignore
M src/bin/scripts/Makefile
A src/bin/scripts/t/010_clusterdb.pl
A src/bin/scripts/t/011_clusterdb_all.pl
A src/bin/scripts/t/020_createdb.pl
A src/bin/scripts/t/030_createlang.pl
A src/bin/scripts/t/040_createuser.pl
A src/bin/scripts/t/050_dropdb.pl
A src/bin/scripts/t/060_droplang.pl
A src/bin/scripts/t/070_dropuser.pl
A src/bin/scripts/t/080_pg_isready.pl
A src/bin/scripts/t/090_reindexdb.pl
A src/bin/scripts/t/091_reindexdb_all.pl
A src/bin/scripts/t/100_vacuumdb.pl
A src/bin/scripts/t/101_vacuumdb_all.pl
A src/test/perl/TestLib.pm

Fix whitespace

commit   : 7b5a9d61a8202c46f4cc02878eafa8367080c59a    
  
author   : Peter Eisentraut <[email protected]>    
date     : Mon, 14 Apr 2014 15:36:54 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Mon, 14 Apr 2014 15:36:54 -0400    

Click here for diff

M src/interfaces/ecpg/preproc/type.c

Set pd_lower on internal GIN posting tree pages.

commit   : f1dadd34fa9fccc72800ed206b8c274073dfd039    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Mon, 14 Apr 2014 21:03:01 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Mon, 14 Apr 2014 21:03:01 +0300    

Click here for diff

This allows squeezing out the unused space in full-page writes. And more  
importantly, it can be a useful debugging aid.  
  
In hindsight we should've done this back when GIN was added - we wouldn't  
need the 'maxoff' field in the page opaque struct if we had used pd_lower  
and pd_upper like on normal pages. But as long as there can be pages in the  
index that have been binary-upgraded from pre-9.4 versions, we can't rely  
on that, and have to continue using 'maxoff'.  
  
Most of the code churn comes from renaming some macros, now that they're  
used on internal pages, too.  
  
This change is completely backwards-compatible, no effect on pg_upgrade.  

M src/backend/access/gin/gindatapage.c
M src/backend/access/gin/ginvacuum.c
M src/backend/access/gin/ginxlog.c
M src/include/access/gin_private.h

doc: Suggesting clearing pg_replslot from a hot filesystem backup.

commit   : 69671ab548459814d489315bf5cd421f84e984a4    
  
author   : Robert Haas <[email protected]>    
date     : Mon, 14 Apr 2014 13:00:04 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Mon, 14 Apr 2014 13:00:04 -0400    

Click here for diff

Maybe we'll settle on another way of solving this problem, but for  
now this is the recommended procedure.  
  
Per discussion with Michael Paquier.  

M doc/src/sgml/backup.sgml

doc: Update yet another place that didn't get the memo about matviews.

commit   : c050b2aae3b2f745ef61b379087cf9a67deea293    
  
author   : Robert Haas <[email protected]>    
date     : Mon, 14 Apr 2014 12:47:46 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Mon, 14 Apr 2014 12:47:46 -0400    

Click here for diff

Etsuro Fujita  

M doc/src/sgml/ref/create_foreign_table.sgml

Fix bogus handling of bad strategy number in GIST consistent() functions.

commit   : 4dfb065b3ab662dcc96d07ee7fc9dadf6975a0cb    
  
author   : Tom Lane <[email protected]>    
date     : Mon, 14 Apr 2014 11:10:32 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Mon, 14 Apr 2014 11:10:32 -0400    

Click here for diff

Make sure we throw an error instead of silently doing the wrong thing when  
fed a strategy number we don't recognize.  Also, in the places that did  
already throw an error, spell the error message in a way more consistent  
with our message style guidelines.  
  
Per report from Paul Jones.  Although this is a bug, it won't occur unless  
a superuser tries to do something he shouldn't, so it doesn't seem worth  
back-patching.  

M src/backend/access/gist/gistproc.c

Correct description of constraint_name in ALTER TABLE documentation.

commit   : f0aa6c06d4e114ecb7ed81a2168238bbcfd54878    
  
author   : Robert Haas <[email protected]>    
date     : Mon, 14 Apr 2014 10:52:07 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Mon, 14 Apr 2014 10:52:07 -0400    

Click here for diff

Apparently, the old text was written at a time when the only use of  
constraint_name here was for a constraint to be dropped, but that's  
no longer true.  
  
Etsuro Fujita  

M doc/src/sgml/ref/alter_table.sgml

Update list of relation types on which ALTER TABLE RENAME/OWNER work.

commit   : 0c953540d285a94684b0c0dc7a2c338cb1d65ef0    
  
author   : Robert Haas <[email protected]>    
date     : Mon, 14 Apr 2014 10:43:53 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Mon, 14 Apr 2014 10:43:53 -0400    

Click here for diff

Etsuro Fujita  

M doc/src/sgml/ref/alter_table.sgml

Tab completion for event triggers.

commit   : 7b979524afb21c969234f7a0a9b1c97ceec4629d    
  
author   : Robert Haas <[email protected]>    
date     : Mon, 14 Apr 2014 08:44:21 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Mon, 14 Apr 2014 08:44:21 -0400    

Click here for diff

Ian Barwick  

M src/bin/psql/tab-complete.c

Remove dead checks for invalid left page in ginDeletePage.

commit   : e3e6e3af560116adc20cc9d6e75bfe82a45def60    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Mon, 14 Apr 2014 15:27:32 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Mon, 14 Apr 2014 15:27:32 +0300    

Click here for diff

In some places, the function assumes the left page is valid, and in others,  
it checks if it is valid. Remove all the checks.  

M src/backend/access/gin/ginvacuum.c

GIN entry pages follow the standard page layout - tell XLogInsert.

commit   : 1bd3842163f2b44e29938b5ab158bb6a589ff10c    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Mon, 14 Apr 2014 14:49:30 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Mon, 14 Apr 2014 14:49:30 +0300    

Click here for diff

The entry B-tree pages all follow the standard page layout. The 9.3 code has  
this right. I inadvertently changed this at some point during the big  
refactorings in git master.  

M src/backend/access/gin/ginentrypage.c

Improve some O(N^2) behavior in window function evaluation.

commit   : e0c91a7ff015fab0ccbb0f75b6819f29ae00295e    
  
author   : Tom Lane <[email protected]>    
date     : Sun, 13 Apr 2014 13:59:17 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Sun, 13 Apr 2014 13:59:17 -0400    

Click here for diff

Repositioning the tuplestore seek pointer in window_gettupleslot() turns  
out to be a very significant expense when the window frame is sizable and  
the frame end can move.  To fix, introduce a tuplestore function for  
skipping an arbitrary number of tuples in one call, parallel to the one we  
introduced for tuplesort objects in commit 8d65da1f.  This reduces the cost  
of window_gettupleslot() to O(1) if the tuplestore has not spilled to disk.  
As in the previous commit, I didn't try to do any real optimization of  
tuplestore_skiptuples for the case where the tuplestore has spilled to  
disk.  There is probably no practical way to get the cost to less than O(N)  
anyway, but perhaps someone can think of something later.  
  
Also fix PersistHoldablePortal() to make use of this API now that we have  
it.  
  
Based on a suggestion by Dean Rasheed, though this turns out not to look  
much like his patch.  

M src/backend/commands/portalcmds.c
M src/backend/executor/nodeWindowAgg.c
M src/backend/utils/sort/tuplestore.c
M src/include/utils/tuplestore.h

Suppress compiler warning in new contrib/pg_trgm code.

commit   : 46a60abfe9fa13087dbbe15953c20df35f006968    
  
author   : Tom Lane <[email protected]>    
date     : Sun, 13 Apr 2014 11:00:11 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Sun, 13 Apr 2014 11:00:11 -0400    

Click here for diff

MSVC doesn't seem to like it when a constant initializer loses  
precision upon being assigned.  
  
David Rowley  

M contrib/pg_trgm/trgm_regexp.c

Make a dedicated AlterTblSpcStmt production

commit   : 5f508b6dea19b66961c645bf5e5c427ac3af8359    
  
author   : Stephen Frost <[email protected]>    
date     : Sun, 13 Apr 2014 01:02:44 -0400    
  
committer: Stephen Frost <[email protected]>    
date     : Sun, 13 Apr 2014 01:02:44 -0400    

Click here for diff

Given that ALTER TABLESPACE has moved on from just existing for  
general purpose rename/owner changes, it deserves its own top-level  
production in the grammar.  This also cleans up the RenameStmt to  
only ever be used for actual RENAMEs again- it really wasn't  
appropriate to hide non-RENAME productions under there.  
  
Noted by Alvaro.  

M src/backend/parser/gram.y

Add ANALYZE into regression tests

commit   : b3e6593716efef901fcc847f33256c6b49958898    
  
author   : Stephen Frost <[email protected]>    
date     : Sun, 13 Apr 2014 00:41:33 -0400    
  
committer: Stephen Frost <[email protected]>    
date     : Sun, 13 Apr 2014 00:41:33 -0400    

Click here for diff

Looks like we can end up with different plans happening on the  
buildfarm, which breaks the regression tests when we include  
EXPLAIN output (which is done in the regression tests for  
updatable security views, to ensure that the user-defined  
function isn't pushed down to a level where it could view the  
rows before the security quals are applied).  
  
This adds in ANALYZE to hopefully make the plans consistent.  
The ANALYZE ends up changing the original plan too, so the  
update looks bigger than it really is.  The new plan looks  
perfectly valid, of course.  

M src/test/regress/expected/updatable_views.out
M src/test/regress/sql/updatable_views.sql

Provide moving-aggregate support for boolean aggregates.

commit   : d95425c8b9d3ea1681bd91b76ce73be95ca5ee21    
  
author   : Tom Lane <[email protected]>    
date     : Sun, 13 Apr 2014 00:01:46 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Sun, 13 Apr 2014 00:01:46 -0400    

Click here for diff

David Rowley and Florian Pflug, reviewed by Dean Rasheed  

M src/backend/utils/adt/bool.c
M src/include/catalog/catversion.h
M src/include/catalog/pg_aggregate.h
M src/include/catalog/pg_proc.h
M src/include/utils/builtins.h
M src/test/regress/expected/window.out
M src/test/regress/sql/window.sql

Make security barrier views automatically updatable

commit   : 842faa714c0454d67e523f5a0b6df6500e9bc1a5    
  
author   : Stephen Frost <[email protected]>    
date     : Sat, 12 Apr 2014 21:04:58 -0400    
  
committer: Stephen Frost <[email protected]>    
date     : Sat, 12 Apr 2014 21:04:58 -0400    

Click here for diff

Views which are marked as security_barrier must have their quals  
applied before any user-defined quals are called, to prevent  
user-defined functions from being able to see rows which the  
security barrier view is intended to prevent them from seeing.  
  
Remove the restriction on security barrier views being automatically  
updatable by adding a new securityQuals list to the RTE structure  
which keeps track of the quals from security barrier views at each  
level, independently of the user-supplied quals.  When RTEs are  
later discovered which have securityQuals populated, they are turned  
into subquery RTEs which are marked as security_barrier to prevent  
any user-supplied quals being pushed down (modulo LEAKPROOF quals).  
  
Dean Rasheed, reviewed by Craig Ringer, Simon Riggs, KaiGai Kohei  

M doc/src/sgml/ref/create_view.sgml
M src/backend/commands/tablecmds.c
M src/backend/commands/view.c
M src/backend/nodes/copyfuncs.c
M src/backend/nodes/equalfuncs.c
M src/backend/nodes/nodeFuncs.c
M src/backend/nodes/outfuncs.c
M src/backend/nodes/readfuncs.c
M src/backend/optimizer/plan/planner.c
M src/backend/optimizer/prep/Makefile
A src/backend/optimizer/prep/prepsecurity.c
M src/backend/optimizer/prep/prepunion.c
M src/backend/rewrite/rewriteHandler.c
M src/include/nodes/parsenodes.h
M src/include/optimizer/prep.h
M src/include/rewrite/rewriteHandler.h
M src/test/regress/expected/create_view.out
M src/test/regress/expected/updatable_views.out
M src/test/regress/sql/updatable_views.sql

Provide moving-aggregate support for a bunch of numerical aggregates.

commit   : 9d229f399e87d2ae7132c2e8feef317ce1479728    
  
author   : Tom Lane <[email protected]>    
date     : Sat, 12 Apr 2014 20:33:09 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Sat, 12 Apr 2014 20:33:09 -0400    

Click here for diff

First installment of the promised moving-aggregate support in built-in  
aggregates: count(), sum(), avg(), stddev() and variance() for  
assorted datatypes, though not for float4/float8.  
  
In passing, remove a 2001-vintage kluge in interval_accum(): interval  
array elements have been properly aligned since around 2003, but  
nobody remembered to take out this workaround.  Also, fix a thinko  
in the opr_sanity tests for moving-aggregate catalog entries.  
  
David Rowley and Florian Pflug, reviewed by Dean Rasheed  

M src/backend/utils/adt/int8.c
M src/backend/utils/adt/numeric.c
M src/backend/utils/adt/timestamp.c
M src/include/catalog/catversion.h
M src/include/catalog/pg_aggregate.h
M src/include/catalog/pg_proc.h
M src/include/utils/builtins.h
M src/include/utils/int8.h
M src/include/utils/timestamp.h
M src/test/regress/expected/opr_sanity.out
M src/test/regress/expected/window.out
M src/test/regress/sql/opr_sanity.sql
M src/test/regress/sql/window.sql

Create infrastructure for moving-aggregate optimization.

commit   : a9d9acbf219b9e96585779cd5f99d674d4ccba74    
  
author   : Tom Lane <[email protected]>    
date     : Sat, 12 Apr 2014 11:58:53 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Sat, 12 Apr 2014 11:58:53 -0400    

Click here for diff

Until now, when executing an aggregate function as a window function  
within a window with moving frame start (that is, any frame start mode  
except UNBOUNDED PRECEDING), we had to recalculate the aggregate from  
scratch each time the frame head moved.  This patch allows an aggregate  
definition to include an alternate "moving aggregate" implementation  
that includes an inverse transition function for removing rows from  
the aggregate's running state.  As long as this can be done successfully,  
runtime is proportional to the total number of input rows, rather than  
to the number of input rows times the average frame length.  
  
This commit includes the core infrastructure, documentation, and regression  
tests using user-defined aggregates.  Follow-on commits will update some  
of the built-in aggregates to use this feature.  
  
David Rowley and Florian Pflug, reviewed by Dean Rasheed; additional  
hacking by me  

M doc/src/sgml/catalogs.sgml
M doc/src/sgml/ref/create_aggregate.sgml
M doc/src/sgml/xaggr.sgml
M src/backend/catalog/pg_aggregate.c
M src/backend/commands/aggregatecmds.c
M src/backend/executor/nodeAgg.c
M src/backend/executor/nodeWindowAgg.c
M src/backend/optimizer/util/clauses.c
M src/backend/parser/parse_agg.c
M src/bin/pg_dump/pg_dump.c
M src/include/catalog/catversion.h
M src/include/catalog/pg_aggregate.h
M src/include/nodes/execnodes.h
M src/include/parser/parse_agg.h
M src/test/regress/expected/create_aggregate.out
M src/test/regress/expected/opr_sanity.out
M src/test/regress/expected/window.out
M src/test/regress/sql/create_aggregate.sql
M src/test/regress/sql/opr_sanity.sql
M src/test/regress/sql/window.sql

docs: psql '--' comments are not passed to the server

commit   : 3c41b812c5578fd7bd5c2de42941012d7d56dde2    
  
author   : Bruce Momjian <[email protected]>    
date     : Thu, 10 Apr 2014 17:16:22 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Thu, 10 Apr 2014 17:16:22 -0400    

Click here for diff

C-style block comments are passed to the server.  

M doc/src/sgml/ref/psql-ref.sgml

Fix bugs in GIN "fast scan" with partial match.

commit   : 614167c6d7e98d4538c4546754b3c2dba480f71c    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Thu, 10 Apr 2014 23:42:04 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Thu, 10 Apr 2014 23:42:04 +0300    

Click here for diff

There were a couple of bugs here. First, if the fuzzy limit was exceeded,  
the loop in entryGetItem might drop out too soon if a whole block needs to  
be skipped because it's < advancePast ("continue" in a while-loop checks the  
loop condition too). Secondly, the loop checked when stepping to a new page  
that there is at least one offset on the page < advancePast, but we cannot  
rely on that on subsequent calls of entryGetItem, because advancePast might  
change in between. That caused the skipping loop to read bogus items in the  
TbmIterateResult's offset array.  
  
First item and fix by Alexander Korotkov, second bug pointed out by Fabrízio  
de Royes Mello, by a small variation of Alexander's test query.  

M src/backend/access/gin/ginget.c

The new pointer_to_struct test needs a special command line parameter to ecpg. Hopefully this will fix the buildfarm failures on Windows.

commit   : ef29a884575f233e6cd382dcfb42af602fa78cd6    
  
author   : Michael Meskes <[email protected]>    
date     : Thu, 10 Apr 2014 20:37:00 +0200    
  
committer: Michael Meskes <[email protected]>    
date     : Thu, 10 Apr 2014 20:37:00 +0200    

Click here for diff

M src/tools/msvc/ecpg_regression.proj

C comment: track_activity_query_size doesn't support memory units

commit   : 8fcccadfea491a1074be38266e2346162faa03e3    
  
author   : Bruce Momjian <[email protected]>    
date     : Thu, 10 Apr 2014 09:56:25 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Thu, 10 Apr 2014 09:56:25 -0400    

Click here for diff

And explain why.  
  
Per report from Pavel Stehule  

M src/backend/utils/misc/guc.c

Fix typo in comment.

commit   : 787064cd0078a346cd744f832794e23136392efd    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Thu, 10 Apr 2014 13:11:49 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Thu, 10 Apr 2014 13:11:49 +0300    

Click here for diff

Tomonari Katsumata  

M src/backend/access/transam/xlog.c

Fix a few more misc typos in comments.

commit   : 150a9df5288d2ba59a26767659a99c44b683fe8f    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Thu, 10 Apr 2014 00:53:15 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Thu, 10 Apr 2014 00:53:15 +0300    

Click here for diff

M src/backend/replication/logical/snapbuild.c
M src/include/access/htup.h

commit   : 85c6bba2ce37761fb5e5d21fb5d53cae3d6861f9    
  
author   : Bruce Momjian <[email protected]>    
date     : Wed, 9 Apr 2014 17:44:59 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Wed, 9 Apr 2014 17:44:59 -0400    

Click here for diff

This references the meaning of the fast/spread checkpoint option.  
  
Per private IM report  

M doc/src/sgml/ref/pg_basebackup.sgml

Fix misc typos in comments.

commit   : 5b075ae893a2b6eb42188463bbb76c6a141370a8    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Wed, 9 Apr 2014 23:16:08 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Wed, 9 Apr 2014 23:16:08 +0300    

Click here for diff

M src/backend/replication/logical/snapbuild.c
M src/backend/storage/lmgr/predicate.c

Add missing include.

commit   : b0827320610c6e4a42b2747b354ed05f7c94a30d    
  
author   : Robert Haas <[email protected]>    
date     : Wed, 9 Apr 2014 11:38:52 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Wed, 9 Apr 2014 11:38:52 -0400    

Click here for diff

This is more cleanup from commit 11a65eed1637a05b03e174700799b024e104bfb4.  
  
Amit Kapila  

M src/backend/port/win32_shmem.c

Several fixes to array handling in ecpg.

commit   : f9179685371b74bf4752bf3f87846e5625cf91fa    
  
author   : Michael Meskes <[email protected]>    
date     : Wed, 9 Apr 2014 11:21:46 +0200    
  
committer: Michael Meskes <[email protected]>    
date     : Wed, 9 Apr 2014 11:21:46 +0200    

Click here for diff

Patches by Ashutosh Bapat <[email protected]>  

M src/interfaces/ecpg/preproc/type.c
M src/interfaces/ecpg/test/ecpg_schedule
M src/interfaces/ecpg/test/expected/preproc-array_of_struct.c
M src/interfaces/ecpg/test/expected/preproc-outofscope.c
A src/interfaces/ecpg/test/expected/preproc-pointer_to_struct.c
A src/interfaces/ecpg/test/expected/preproc-pointer_to_struct.stderr
A src/interfaces/ecpg/test/expected/preproc-pointer_to_struct.stdout
M src/interfaces/ecpg/test/expected/preproc-type.c
M src/interfaces/ecpg/test/expected/preproc-variable.c
M src/interfaces/ecpg/test/preproc/Makefile
A src/interfaces/ecpg/test/preproc/pointer_to_struct.pgc

Fix silly oversight in patch to remove dsm state file.

commit   : 0c4ea7a309249064b7c2a8b9612ee00f570f14af    
  
author   : Robert Haas <[email protected]>    
date     : Tue, 8 Apr 2014 16:22:50 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Tue, 8 Apr 2014 16:22:50 -0400    

Click here for diff

I'm not sure if this is what's causing the Windows buildfarm members  
to get unhappy, but I don't think it can be helping anything...  

M src/backend/port/win32_shmem.c

Add an in-core GiST index opclass for inet/cidr types.

commit   : f23a5630ebc797219b62797f566dec9f65090e03    
  
author   : Tom Lane <[email protected]>    
date     : Tue, 8 Apr 2014 15:46:14 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Tue, 8 Apr 2014 15:46:14 -0400    

Click here for diff

This operator class can accelerate subnet/supernet tests as well as  
btree-equivalent ordered comparisons.  It also handles a new network  
operator inet && inet (overlaps, a/k/a "is supernet or subnet of"),  
which is expected to be useful in exclusion constraints.  
  
Ideally this opclass would be the default for GiST with inet/cidr data,  
but we can't mark it that way until we figure out how to do a more or  
less graceful transition from the current situation, in which the  
really-completely-bogus inet/cidr opclasses in contrib/btree_gist are  
marked as default.  Having the opclass in core and not default is better  
than not having it at all, though.  
  
While at it, add new documentation sections to allow us to officially  
document GiST/GIN/SP-GiST opclasses, something there was never a clear  
place to do before.  I filled these in with some simple tables listing  
the existing opclasses and the operators they support, but there's  
certainly scope to put more information there.  
  
Emre Hasegeli, reviewed by Andreas Karlsson, further hacking by me  

M doc/src/sgml/func.sgml
M doc/src/sgml/gin.sgml
M doc/src/sgml/gist.sgml
M doc/src/sgml/indices.sgml
M doc/src/sgml/spgist.sgml
M src/backend/utils/adt/Makefile
M src/backend/utils/adt/network.c
A src/backend/utils/adt/network_gist.c
A src/backend/utils/adt/network_selfuncs.c
M src/include/catalog/catversion.h
M src/include/catalog/pg_amop.h
M src/include/catalog/pg_amproc.h
M src/include/catalog/pg_opclass.h
M src/include/catalog/pg_operator.h
M src/include/catalog/pg_opfamily.h
M src/include/catalog/pg_proc.h
M src/include/utils/builtins.h
M src/include/utils/inet.h
M src/test/regress/expected/inet.out
M src/test/regress/expected/opr_sanity.out
M src/test/regress/sql/inet.sql

doc: Fix typo.

commit   : 02f65617eab3deb715428a3ed62ca4e7f56ceda3    
  
author   : Robert Haas <[email protected]>    
date     : Tue, 8 Apr 2014 11:47:29 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Tue, 8 Apr 2014 11:47:29 -0400    

Click here for diff

Ian Barwick  

M doc/src/sgml/func.sgml

Get rid of the dynamic shared memory state file.

commit   : 11a65eed1637a05b03e174700799b024e104bfb4    
  
author   : Robert Haas <[email protected]>    
date     : Tue, 8 Apr 2014 11:39:55 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Tue, 8 Apr 2014 11:39:55 -0400    

Click here for diff

Instead of storing the ID of the dynamic shared memory control  
segment in a file within the data directory, store it in the main  
control segment.  This avoids a number of nasty corner cases,  
most seriously that doing an online backup and then using it on  
the same machine (e.g. to fire up a standby) would result in the  
standby clobbering all of the master's dynamic shared memory  
segments.  
  
Per complaints from Heikki Linnakangas, Fujii Masao, and Tom  
Lane.  

M src/backend/port/sysv_shmem.c
M src/backend/port/win32_shmem.c
M src/backend/storage/ipc/dsm.c
M src/backend/storage/ipc/ipci.c
M src/include/storage/dsm.h
M src/include/storage/pg_shmem.h

Add new to_reg* functions for error-free OID lookups.

commit   : 0886fc6a5c75b294544263ea979b9cf6195407d9    
  
author   : Robert Haas <[email protected]>    
date     : Tue, 8 Apr 2014 10:27:56 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Tue, 8 Apr 2014 10:27:56 -0400    

Click here for diff

These functions won't throw an error if the object doesn't exist,  
or if (for functions and operators) there's more than one matching  
object.  
  
Yugo Nagata and Nozomi Anzai, reviewed by Amit Khandekar, Marti  
Raudsepp, Amit Kapila, and me.  

M doc/src/sgml/func.sgml
M src/backend/catalog/namespace.c
M src/backend/parser/parse_oper.c
M src/backend/parser/parse_type.c
M src/backend/utils/adt/regproc.c
M src/include/catalog/catversion.h
M src/include/catalog/namespace.h
M src/include/catalog/pg_proc.h
M src/include/parser/parse_type.h
M src/include/utils/builtins.h
M src/pl/plperl/plperl.c
M src/pl/plpgsql/src/pl_gram.y
M src/pl/plpython/plpy_spi.c
M src/pl/tcl/pltcl.c
A src/test/regress/expected/regproc.out
M src/test/regress/parallel_schedule
M src/test/regress/serial_schedule
A src/test/regress/sql/regproc.sql

Fix hot standby bug with GiST scans.

commit   : 7ca32e255ba4f7e55bbdbcf0df996ac62798672b    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Tue, 8 Apr 2014 14:47:24 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Tue, 8 Apr 2014 14:47:24 +0300    

Click here for diff

Don't reset the rightlink of a page when replaying a page update record.  
This was a leftover from pre-hot standby days, when it was not possible to  
have scans concurrent with WAL replay. Resetting the right-link was not  
necessary back then either, but it was done for the sake of tidiness. But  
with hot standby, it's wrong, because a concurrent scan might still need it.  
  
Backpatch all versions with hot standby, 9.0 and above.  

M src/backend/access/gist/gistxlog.c

Zero padding byte at end of GIN posting list.

commit   : 38a2b95c342c0d3d261d525a74943a977725483e    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Mon, 7 Apr 2014 19:48:03 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Mon, 7 Apr 2014 19:48:03 +0300    

Click here for diff

This isn't strictly necessary, but helps debugging.  

M src/backend/access/gin/ginpostinglist.c

Remove 'make clean' support for ipc_test.

commit   : f235db03ff28ef3e5d13aa49d496cba5693217de    
  
author   : Robert Haas <[email protected]>    
date     : Mon, 7 Apr 2014 11:44:54 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Mon, 7 Apr 2014 11:44:54 -0400    

Click here for diff

I missed this in the previous commit; Tom Lane spotted my error.  

M src/backend/port/Makefile

Assert that strong-lock count is >0 everywhere it's decremented.

commit   : 315772e4ecf2e91f17a8e375afe8dff2c2174406    
  
author   : Robert Haas <[email protected]>    
date     : Mon, 7 Apr 2014 10:59:42 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Mon, 7 Apr 2014 10:59:42 -0400    

Click here for diff

The one existing assertion of this type has tripped a few times in the  
buildfarm lately, but it's not clear whether the problem is really  
originating there or whether it's leftovers from a trip through one  
of the other two paths that lack a matching assertion.  So add one.  
  
Since the same bug(s) most likely exist(s) in the back-branches also,  
back-patch to 9.2, where the fast-path lock mechanism was added.  

M src/backend/storage/lmgr/lock.c

Remove ipc_test.

commit   : b8a721149b190dc09c00620f65cb85b190b83d45    
  
author   : Robert Haas <[email protected]>    
date     : Mon, 7 Apr 2014 10:40:47 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Mon, 7 Apr 2014 10:40:47 -0400    

Click here for diff

This doesn't seem to be useful any more, and it's not really worth the  
effort to keep updating it every time relevant dependencies or calling  
signatures in the shared memory or semaphore code change.  

M src/backend/port/Makefile
D src/backend/port/ipc_test.c

Fix WAL replay bug in the new GIN incomplete-split code.

commit   : 594bac42728fed67e05458633f35c2b1d7b38f1e    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Mon, 7 Apr 2014 14:34:31 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Mon, 7 Apr 2014 14:34:31 +0300    

Click here for diff

Forgot to set the incomplete-split flag on the left page half, in redo of a  
page split.  
  
Spotted this by comparing the page contents on master and standby, after  
inserting/applying each WAL record.  

M src/backend/access/gin/ginxlog.c

Extra warnings and errors for PL/pgSQL

commit   : 7d8f1de1bc04bf8ddda6548156ef32f46e13dd50    
  
author   : Simon Riggs <[email protected]>    
date     : Sun, 6 Apr 2014 12:21:51 -0400    
  
committer: Simon Riggs <[email protected]>    
date     : Sun, 6 Apr 2014 12:21:51 -0400    

Click here for diff

Infrastructure to allow  
 plpgsql.extra_warnings  
 plpgsql.extra_errors  
  
Initial extra checks only for shadowed_variables  
  
Marko Tiikkaja and Petr Jelinek  
Reviewed by Simon Riggs and Pavel Stěhule  

M doc/src/sgml/plpgsql.sgml
M src/pl/plpgsql/src/pl_comp.c
M src/pl/plpgsql/src/pl_gram.y
M src/pl/plpgsql/src/pl_handler.c
M src/pl/plpgsql/src/plpgsql.h
M src/test/regress/expected/plpgsql.out
M src/test/regress/sql/plpgsql.sql

Isolation test files for ALTER TABLE patch

commit   : f14a6bbedb79adce2298d0d4f5e2abe8563e0eca    
  
author   : Simon Riggs <[email protected]>    
date     : Sun, 6 Apr 2014 11:44:24 -0400    
  
committer: Simon Riggs <[email protected]>    
date     : Sun, 6 Apr 2014 11:44:24 -0400    

Click here for diff

A src/test/isolation/expected/alter-table-1.out
A src/test/isolation/specs/alter-table-1.spec

Reduce lock levels of some ALTER TABLE cmds

commit   : e5550d5fec66aa74caad1f79b79826ec64898688    
  
author   : Simon Riggs <[email protected]>    
date     : Sun, 6 Apr 2014 11:13:43 -0400    
  
committer: Simon Riggs <[email protected]>    
date     : Sun, 6 Apr 2014 11:13:43 -0400    

Click here for diff

VALIDATE CONSTRAINT  
  
CLUSTER ON  
SET WITHOUT CLUSTER  
  
ALTER COLUMN SET STATISTICS  
ALTER COLUMN SET ()  
ALTER COLUMN RESET ()  
  
All other sub-commands use AccessExclusiveLock  
  
Simon Riggs and Noah Misch  
  
Reviews by Robert Haas and Andres Freund  

M doc/src/sgml/mvcc.sgml
M doc/src/sgml/ref/alter_table.sgml
M src/backend/catalog/toasting.c
M src/backend/commands/cluster.c
M src/backend/commands/createas.c
M src/backend/commands/tablecmds.c
M src/backend/tcop/utility.c
M src/backend/utils/adt/ruleutils.c
M src/backend/utils/cache/relcache.c
M src/include/catalog/toasting.h
M src/test/isolation/isolation_schedule
M src/test/regress/expected/alter_table.out
M src/test/regress/sql/alter_table.sql

Improve contrib/pg_trgm's heuristics for regexp index searches.

commit   : 80a5cf643adb496abe577a1ca6dc0c476d849c19    
  
author   : Tom Lane <[email protected]>    
date     : Sat, 5 Apr 2014 20:48:47 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Sat, 5 Apr 2014 20:48:47 -0400    

Click here for diff

When extracting trigrams from a regular expression for search of a GIN or  
GIST trigram index, it's useful to penalize (preferentially discard)  
trigrams that contain whitespace, since those are typically far more common  
in the index than trigrams not containing whitespace.  Of course, this  
should only be a preference not a hard rule, since we might otherwise end  
up with no trigrams to search for.  The previous coding tended to produce  
fairly inefficient trigram search sets for anchored regexp patterns, as  
reported by Erik Rijkers.  This patch penalizes whitespace-containing  
trigrams, and also reduces the target number of extracted trigrams, since  
experience suggests that the original coding tended to select too many  
trigrams to search for.  
  
Alexander Korotkov, reviewed by Tom Lane  

M contrib/pg_trgm/trgm_regexp.c

Block signals earlier during postmaster startup.

commit   : 5d8117e1f38d7240e99d57e624a9d880872c7e98    
  
author   : Tom Lane <[email protected]>    
date     : Sat, 5 Apr 2014 18:16:08 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Sat, 5 Apr 2014 18:16:08 -0400    

Click here for diff

Formerly, we set up the postmaster's signal handling only when we were  
about to start launching subprocesses.  This is a bad idea though, as  
it means that for example a SIGINT arriving before that will kill the  
postmaster instantly, perhaps leaving lockfiles, socket files, shared  
memory, etc laying about.  We'd rather that such a signal caused orderly  
postmaster termination including releasing of those resources.  A simple  
fix is to move the PostmasterMain stanza that initializes signal handling  
to an earlier point, before we've created any such resources.  Then, an  
early-arriving signal will be blocked until we're ready to deal with it  
in the usual way.  (The only part that really needs to be moved up is  
blocking of signals, but it seems best to keep the signal handler  
installation calls together with that; for one thing this ensures the  
kernel won't drop any signals we wished to get.  The handlers won't get  
invoked in any case until we unblock signals in ServerLoop.)  
  
Per a report from MauMau.  He proposed changing the way "pg_ctl stop"  
works to deal with this, but that'd just be masking one symptom not  
fixing the core issue.  
  
It's been like this since forever, so back-patch to all supported branches.  

M src/backend/postmaster/postmaster.c

Fix another palloc in critical section.

commit   : ffbba6ee1244901b492fe268ea94f72e35aedf38    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Sat, 5 Apr 2014 22:02:28 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Sat, 5 Apr 2014 22:02:28 +0300    

Click here for diff

Also add a regression test for a GIN index with enough items with the same  
key, so that a GIN posting tree gets created. Apparently none of the  
existing GIN tests were large enough for that.  
  
This code is new, no backpatching required.  

M src/backend/access/gin/gindatapage.c
M src/test/regress/expected/create_index.out
M src/test/regress/sql/create_index.sql

Fix processing of PGC_BACKEND GUC parameters on Windows.

commit   : 6862ca6970d11c47996d99e49a1cf8b55ef9b40d    
  
author   : Tom Lane <[email protected]>    
date     : Sat, 5 Apr 2014 12:41:25 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Sat, 5 Apr 2014 12:41:25 -0400    

Click here for diff

EXEC_BACKEND builds (i.e., Windows) failed to absorb values of PGC_BACKEND  
parameters if they'd been changed post-startup via the config file.  This  
for example prevented log_connections from working if it were turned on  
post-startup.  The mechanism for handling this case has always been a bit  
of a kluge, and it wasn't revisited when we implemented EXEC_BACKEND.  
While in a normal forking environment new backends will inherit the  
postmaster's value of such settings, EXEC_BACKEND backends have to read  
the settings from the CONFIG_EXEC_PARAMS file, and they were mistakenly  
rejecting them.  So this case has always been broken in the Windows port;  
so back-patch to all supported branches.  
  
Amit Kapila  

M src/backend/utils/misc/guc.c

ecpg/ecpglib must build the src/port files it uses with -DFRONTEND.

commit   : 44c5d387eafb4ba1a032f8d7b13d85c553d69181    
  
author   : Tom Lane <[email protected]>    
date     : Sat, 5 Apr 2014 02:20:25 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Sat, 5 Apr 2014 02:20:25 -0400    

Click here for diff

Remarkably, this hasn't been noticed before, though it surely should  
have been happening since around the fall of the Byzantine empire.  
Commit 438b529604 changed path.c to depend on FRONTEND, and that exposed  
the omission, per buildfarm reports.  
  
I'm suspicious that some other subdirectories are missing this too,  
but this one change is enough to make ecpg tests pass for me.  

M src/interfaces/ecpg/ecpglib/Makefile

Fix tablespace creation WAL replay to work on Windows.

commit   : abe075dfffe2ef7e76ebbf5717fa3823f9a70a1f    
  
author   : Tom Lane <[email protected]>    
date     : Fri, 4 Apr 2014 23:09:35 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Fri, 4 Apr 2014 23:09:35 -0400    

Click here for diff

The code segment that removes the old symlink (if present) wasn't clued  
into the fact that on Windows, symlinks are junction points which have  
to be removed with rmdir().  
  
Backpatch to 9.0, where the failing code was introduced.  
  
MauMau, reviewed by Muhammad Asif Naeem and Amit Kapila  

M src/backend/commands/tablespace.c

Allow "-C variable" and "--describe-config" even to root users.

commit   : b203c57bb778d90bb8728be19e78825134d5820f    
  
author   : Tom Lane <[email protected]>    
date     : Fri, 4 Apr 2014 22:03:35 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Fri, 4 Apr 2014 22:03:35 -0400    

Click here for diff

There's no really compelling reason to refuse to do these read-only,  
non-server-starting options as root, and there's at least one good  
reason to allow -C: pg_ctl uses -C to find out the true data directory  
location when pointed at a config-only directory.  On Windows, this is  
done before dropping administrator privileges, which means that pg_ctl  
fails for administrators if and only if a config-only layout is used.  
  
Since the root-privilege check is done so early in startup, it's a bit  
awkward to check for these switches.  Make the somewhat arbitrary  
decision that we'll only skip the root check if -C is the first switch.  
This is not just to make the code a bit simpler: it also guarantees that  
we can't misinterpret a --boot mode switch.  (While AuxiliaryProcessMain  
doesn't currently recognize any such switch, it might have one in the  
future.)  This is no particular problem for pg_ctl, and since the whole  
behavior is undocumented anyhow, it's not a documentation issue either.  
(--describe-config only works as the first switch anyway, so this is  
no restriction for that case either.)  
  
Back-patch to 9.2 where pg_ctl first began to use -C.  
  
MauMau, heavily edited by me  

M src/backend/main/main.c
M src/bin/pg_ctl/pg_ctl.c

Preserve errno across free().

commit   : 2209c0f8618bbed257975055e017efab139e3fa3    
  
author   : Tom Lane <[email protected]>    
date     : Fri, 4 Apr 2014 19:07:37 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Fri, 4 Apr 2014 19:07:37 -0400    

Click here for diff

Dept. of second thoughts: free() isn't guaranteed not to change errno.  
Make sure we report the right error if getcwd() fails.  

M src/port/path.c

Make sure -D is an absolute path when starting server on Windows.

commit   : 9aca51250681d2e8d18ed1d73e7cd1283d1cf303    
  
author   : Tom Lane <[email protected]>    
date     : Fri, 4 Apr 2014 18:42:13 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Fri, 4 Apr 2014 18:42:13 -0400    

Click here for diff

This is needed because Windows services may get started with a different  
current directory than where pg_ctl is executed.  We want relative -D  
paths to be interpreted relative to pg_ctl's CWD, similarly to what  
happens on other platforms.  
  
In support of this, move the backend's make_absolute_path() function  
into src/port/path.c (where it probably should have been long since)  
and get rid of the rather inferior version in pg_regress.  
  
Kumar Rajeev Rastogi, reviewed by MauMau  

M src/backend/utils/init/miscinit.c
M src/bin/pg_ctl/pg_ctl.c
M src/include/miscadmin.h
M src/include/port.h
M src/port/path.c
M src/test/regress/pg_regress.c

Fix bogus time printout in walreceiver's debug log messages.

commit   : 8120c7452a51a773ad7a249b55557439f39d41ef    
  
author   : Tom Lane <[email protected]>    
date     : Fri, 4 Apr 2014 11:43:34 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Fri, 4 Apr 2014 11:43:34 -0400    

Click here for diff

The displayed sendtime and receipttime were always exactly equal, because  
somebody forgot that timestamptz_to_str returns a static buffer (thereby  
simplifying life for most callers, at the cost of complicating it for those  
who need two results concurrently).  Apply the same pstrdup solution used  
by the other call sites with this issue.  Back-patch to 9.2 where the  
faulty code was introduced.  Per bug #9849 from Haruka Takatsuka, though  
this is not exactly his patch.  
  
Possibly we should change timestamptz_to_str's API, but I wouldn't want  
to do so in the back branches.  

M src/backend/replication/walreceiver.c

Fix some compiler warnings that clang emits with -pedantic.

commit   : 59202fae0434c98beb4994c5fe4df354a6af31e6    
  
author   : Robert Haas <[email protected]>    
date     : Fri, 4 Apr 2014 11:26:01 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Fri, 4 Apr 2014 11:26:01 -0400    

Click here for diff

Andres Freund  

M src/backend/access/transam/xlog.c
M src/bin/pg_dump/parallel.c
M src/bin/psql/tab-complete.c
M src/include/catalog/objectaccess.h
M src/include/pgstat.h
M src/include/utils/jsonapi.h

Move multixid allocation out of critical section.

commit   : b1236f4b7ba2c05542f44d07c0a9ffbec3b66295    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Fri, 4 Apr 2014 18:20:22 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Fri, 4 Apr 2014 18:20:22 +0300    

Click here for diff

It can fail if you run out of memory.  
  
This call was added in 9.3, so backpatch to 9.3 only.  

M src/backend/access/heap/heapam.c

In checkpoint, move the check for in-progress xacts out of critical section.

commit   : d9e7873bbbdee76a49e76ddaa49787cab112bb2e    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Fri, 4 Apr 2014 17:29:50 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Fri, 4 Apr 2014 17:29:50 +0300    

Click here for diff

GetVirtualXIDsDelayingChkpt calls palloc, which isn't safe in a critical  
section. I thought I covered this case with the exemption for the  
checkpointer, but CreateCheckPoint is also called from the startup process.  

M src/backend/access/transam/xlog.c

Add an Assertion that you don't palloc within a critical section.

commit   : 4a170ee9e0ebd7021cb1190fabd5b0cbe2effb8e    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Fri, 4 Apr 2014 14:27:18 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Fri, 4 Apr 2014 14:27:18 +0300    

Click here for diff

This caught a bunch of cases doing that already, which I just fixed in  
previous commit. This is the assertion itself.  
  
Per Tom Lane's idea.  

M src/backend/utils/mmgr/mcxt.c

Avoid allocations in critical sections.

commit   : 877b088785b178c50e7976d86c82dfafa4031792    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Fri, 4 Apr 2014 13:12:38 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Fri, 4 Apr 2014 13:12:38 +0300    

Click here for diff

If a palloc in a critical section fails, it becomes a PANIC.  

M src/backend/access/nbtree/nbtinsert.c
M src/backend/access/spgist/spgdoinsert.c
M src/backend/access/transam/xlog.c
M src/backend/storage/page/bufpage.c

Fix non-equivalence of VARIADIC and non-VARIADIC function call formats.

commit   : c7b353959931ae8e95177fe0a138b8119db9b802    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 3 Apr 2014 22:02:24 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 3 Apr 2014 22:02:24 -0400    

Click here for diff

For variadic functions (other than VARIADIC ANY), the syntaxes foo(x,y,...)  
and foo(VARIADIC ARRAY[x,y,...]) should be considered equivalent, since the  
former is converted to the latter at parse time.  They have indeed been  
equivalent, in all releases before 9.3.  However, commit 75b39e790 made an  
ill-considered decision to record which syntax had been used in FuncExpr  
nodes, and then to make equal() test that in checking node equality ---  
which caused the syntaxes to not be seen as equivalent by the planner.  
This is the underlying cause of bug #9817 from Dmitry Ryabov.  
  
It might seem that a quick fix would be to make equal() disregard  
FuncExpr.funcvariadic, but the same commit made that untenable, because  
the field actually *is* semantically significant for some VARIADIC ANY  
functions.  This patch instead adopts the approach of redefining  
funcvariadic (and aggvariadic, in HEAD) as meaning that the last argument  
is a variadic array, whether it got that way by parser intervention or was  
supplied explicitly by the user.  Therefore the value will always be true  
for non-ANY variadic functions, restoring the principle of equivalence.  
(However, the planner will continue to consider use of VARIADIC as a  
meaningful difference for VARIADIC ANY functions, even though some such  
functions might disregard it.)  
  
In HEAD, this change lets us simplify the decompilation logic in  
ruleutils.c, since the funcvariadic/aggvariadic flag tells directly whether  
to print VARIADIC.  However, in 9.3 we have to continue to cope with  
existing stored rules/views that might contain the previous definition.  
Fortunately, this just means no change in ruleutils.c, since its existing  
behavior effectively ignores funcvariadic for all cases other than VARIADIC  
ANY functions.  
  
In HEAD, bump catversion to reflect the fact that FuncExpr.funcvariadic  
changed meanings; this is sort of pro forma, since I don't believe any  
built-in views are affected.  
  
Unfortunately, this patch doesn't magically fix everything for affected  
9.3 users.  After installing 9.3.5, they might need to recreate their  
rules/views/indexes containing variadic function calls in order to get  
everything consistent with the new definition.  As in the cited bug,  
the symptom of a problem would be failure to use a nominally matching  
index that has a variadic function call in its definition.  We'll need  
to mention this in the 9.3.5 release notes.  

M contrib/postgres_fdw/deparse.c
M doc/src/sgml/xfunc.sgml
M src/backend/parser/parse_func.c
M src/backend/utils/adt/ruleutils.c
M src/backend/utils/fmgr/fmgr.c
M src/include/catalog/catversion.h
M src/include/nodes/primnodes.h

Code review for commit d26888bc4d1e539a82f21382b0000fe5bbf889d9.

commit   : 741364bf5caeeae79b83bbdba778805d286622ba    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 3 Apr 2014 16:57:45 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 3 Apr 2014 16:57:45 -0400    

Click here for diff

Mostly, copy-edit the comments; but also fix it to not reject domains over  
arrays.  

M src/backend/parser/parse_func.c
M src/backend/utils/adt/varlena.c

Fix documentation about joining pg_locks to other views.

commit   : 42c6236f37988b4cb067f3fc908b247e70177496    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 3 Apr 2014 14:18:25 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 3 Apr 2014 14:18:25 -0400    

Click here for diff

The advice to join to pg_prepared_xacts via the transaction column was not  
updated when the transaction column was replaced by virtualtransaction.  
Since it's not quite obvious how to do that join, give an explicit example.  
For consistency also give an example for the adjacent case of joining to  
pg_stat_activity.  And link-ify the view references too, just because we  
can.  Per bug #9840 from Alexey Bashtanov.  
  
Michael Paquier and Tom Lane  

M doc/src/sgml/catalogs.sgml

Avoid promising that "ADD COLUMN ... DEFAULT NULL" is free.

commit   : 879808e5197c374e431e81fb5599dfea533bb9aa    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 3 Apr 2014 12:38:00 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 3 Apr 2014 12:38:00 -0400    

Click here for diff

The system realizes that DEFAULT NULL is dummy in simple cases, but not if  
a cast function (such as a length coercion) needs to be applied.  It's  
dubious that suppressing that function call would be appropriate, anyway.  
For the moment, let's just adjust the docs to say that you should omit the  
DEFAULT clause if you don't want a rewrite to happen.  Per gripe from Amit  
Langote.  

M doc/src/sgml/ref/alter_table.sgml

Avoid palloc in critical section in GiST WAL-logging.

commit   : 04e298b826d452ceb838d9fda884a29f229d484d    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Thu, 3 Apr 2014 15:09:37 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Thu, 3 Apr 2014 15:09:37 +0300    

Click here for diff

Memory allocation can fail if you run out of memory, and inside a critical  
section that will lead to a PANIC. Use conservatively-sized arrays in stack  
instead.  
  
There was previously no explicit limit on the number of pages a GiST split  
can produce, it was only limited by the number of LWLocks that can be held  
simultaneously (100 at the moment). This patch adds an explicit limit of 75  
pages. That should be plenty, a typical split shouldn't produce more than  
2-3 page halves.  
  
The bug has been there forever, but only backpatch down to 9.1. The code  
was changed significantly in 9.1, and it doesn't seem worth the risk or  
trouble to adapt this for 9.0 and 8.4.  

M src/backend/access/gist/README
M src/backend/access/gist/gist.c
M src/backend/access/gist/gistxlog.c
M src/include/access/gist_private.h

Fix assorted issues in client host name lookup.

commit   : fc752505a99a4e2c781a070d3d42a25289c22e3c    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 2 Apr 2014 17:11:24 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 2 Apr 2014 17:11:24 -0400    

Click here for diff

The code for matching clients to pg_hba.conf lines that specify host names  
(instead of IP address ranges) failed to complain if reverse DNS lookup  
failed; instead it silently didn't match, so that you might end up getting  
a surprising "no pg_hba.conf entry for ..." error, as seen in bug #9518  
from Mike Blackwell.  Since we don't want to make this a fatal error in  
situations where pg_hba.conf contains a mixture of host names and IP  
addresses (clients matching one of the numeric entries should not have to  
have rDNS data), remember the lookup failure and mention it as DETAIL if  
we get to "no pg_hba.conf entry".  Apply the same approach to forward-DNS  
lookup failures, too, rather than treating them as immediate hard errors.  
  
Along the way, fix a couple of bugs that prevented us from detecting an  
rDNS lookup error reliably, and make sure that we make only one rDNS lookup  
attempt; formerly, if the lookup attempt failed, the code would try again  
for each host name entry in pg_hba.conf.  Since more or less the whole  
point of this design is to ensure there's only one lookup attempt not one  
per entry, the latter point represents a performance bug that seems  
sufficient justification for back-patching.  
  
Also, adjust src/port/getaddrinfo.c so that it plays as well as it can  
with this code.  Which is not all that well, since it does not have actual  
support for rDNS lookup, but at least it should return the expected (and  
required by spec) error codes so that the main code correctly perceives the  
lack of functionality as a lookup failure.  It's unlikely that PG is still  
being used in production on any machines that require our getaddrinfo.c,  
so I'm not excited about working harder than this.  
  
To keep the code in the various branches similar, this includes  
back-patching commits c424d0d1052cb4053c8712ac44123f9b9a9aa3f2 and  
1997f34db4687e671690ed054c8f30bb501b1168 into 9.2 and earlier.  
  
Back-patch to 9.1 where the facility for hostnames in pg_hba.conf was  
introduced.  

M src/backend/libpq/auth.c
M src/backend/libpq/hba.c
M src/backend/postmaster/postmaster.c
M src/include/getaddrinfo.h
M src/include/libpq/libpq-be.h
M src/port/getaddrinfo.c

De-anonymize the union in JsonbValue.

commit   : f33a71a7865a1dd54f04b370e2637f88665f8db8    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 2 Apr 2014 14:30:08 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 2 Apr 2014 14:30:08 -0400    

Click here for diff

Needed for strict C89 compliance.  

M contrib/hstore/hstore_io.c
M src/backend/utils/adt/jsonb.c
M src/backend/utils/adt/jsonb_gin.c
M src/backend/utils/adt/jsonb_op.c
M src/backend/utils/adt/jsonb_util.c
M src/backend/utils/adt/jsonfuncs.c
M src/include/utils/jsonb.h

Fix bugs in manipulation of PgBackendStatus.st_clienthostname.

commit   : 682c5bbec5d9533d2d654d6a096c36bbae9f5bd0    
  
author   : Tom Lane <[email protected]>    
date     : Tue, 1 Apr 2014 21:30:08 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Tue, 1 Apr 2014 21:30:08 -0400    

Click here for diff

Initialization of this field was not being done according to the  
st_changecount protocol (it has to be done within the changecount increment  
range, not outside).  And the test to see if the value should be reported  
as null was wrong.  Noted while perusing uses of Port.remote_hostname.  
  
This was wrong from the introduction of this code (commit 4a25bc145),  
so back-patch to 9.1.  

M src/backend/postmaster/pgstat.c
M src/backend/utils/adt/pgstatfuncs.c

Fix bug in the new GIN incomplete-split code.

commit   : 8bbbcb91bae1489471d11fef269533bc4df2f766    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Tue, 1 Apr 2014 22:45:10 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Tue, 1 Apr 2014 22:45:10 +0300    

Click here for diff

Inserting a downlink to an internal page clears the incomplete-split flag  
of the child's left sibling, so the left sibling's LSN also needs to be  
updated and it needs to be marked dirty. The codepath for an insertion got  
this right, but the case where the internal node is split because of  
inserting the new downlink missed that.  

M src/backend/access/gin/ginbtree.c

Doc: improve discussion of reverse+forward host name lookup in pg_hba.conf.

commit   : 6eff0accfe6b6170d10b91df769ea523b50927b8    
  
author   : Tom Lane <[email protected]>    
date     : Tue, 1 Apr 2014 15:20:30 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Tue, 1 Apr 2014 15:20:30 -0400    

Click here for diff

Fix some grammatical issues and make it a bit more readable.  

M doc/src/sgml/client-auth.sgml

Remove dead check for backup block, replace with Assert.

commit   : cfe992e7eb24fa92f93ee9d31f1f0f515a49c11d    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Tue, 1 Apr 2014 21:16:10 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Tue, 1 Apr 2014 21:16:10 +0300    

Click here for diff

We don't use backup blocks with GIN vacuum records anymore, the page is  
always recreated from scratch.  

M src/backend/access/gin/ginxlog.c

Fix bug in the new B-tree incomplete-split code.

commit   : 954523cdfe229f1cb99a43a19e291a557ae2822d    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Tue, 1 Apr 2014 19:19:47 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Tue, 1 Apr 2014 19:19:47 +0300    

Click here for diff

Inserting a downlink to an internal page clears the incomplete-split flag  
of the child's left sibling, so the left sibling's LSN also needs to be  
updated.  

M src/backend/access/nbtree/nbtinsert.c

Move SizeOfHeapNewCid next to xl_heap_new_cid struct.

commit   : f7534296b484fa73b064c87cc3a5062ba3803f3b    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Tue, 1 Apr 2014 16:23:16 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Tue, 1 Apr 2014 16:23:16 +0300    

Click here for diff

They belong together, but the xl_heap_rewrite_mapping struct was wedged  
in between.  

M src/include/access/heapam_xlog.h

Fix typo in comment.

commit   : 554bb3beba27bf4a49edecc40f6c0f249974bc7c    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Tue, 1 Apr 2014 09:27:37 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Tue, 1 Apr 2014 09:27:37 +0300    

Click here for diff

Amit Langote  

M contrib/sepgsql/relation.c

Mark FastPathStrongRelationLocks volatile.

commit   : 4bc15a8bfbc7856bc3426dc9ab99567eebbb64d3    
  
author   : Robert Haas <[email protected]>    
date     : Mon, 31 Mar 2014 14:32:12 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Mon, 31 Mar 2014 14:32:12 -0400    

Click here for diff

Otherwise, the compiler might decide to move modifications to data  
within this structure outside the enclosing SpinLockAcquire /  
SpinLockRelease pair, leading to shared memory corruption.  
  
This may or may not explain a recent lmgr-related buildfarm failure  
on prairiedog, but it needs to be fixed either way.  

M src/backend/storage/lmgr/lock.c

test_decoding: Update .gitignore

commit   : 0f95b723eb207ca8fe2a0391b444db23b386617b    
  
author   : Robert Haas <[email protected]>    
date     : Mon, 31 Mar 2014 14:18:35 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Mon, 31 Mar 2014 14:18:35 -0400    

Click here for diff

Commit 7317d8d961f210c3a6b20972cd605bcd9bffb06e changed the set of  
things that need to be ignored, but neglected to update .gitignore.  

M contrib/test_decoding/.gitignore

Count buffers dirtied due to hints in pgBufferUsage.shared_blks_dirtied.

commit   : 066254cea117a5a40d21401f754c83cc163378ae    
  
author   : Robert Haas <[email protected]>    
date     : Mon, 31 Mar 2014 13:06:26 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Mon, 31 Mar 2014 13:06:26 -0400    

Click here for diff

Previously, such buffers weren't counted, with the possible result that  
EXPLAIN (BUFFERS) and pg_stat_statements would understate the true  
number of blocks dirtied by an SQL statement.  
  
Back-patch to 9.2, where this counter was introduced.  
  
Amit Kapila  

M src/backend/storage/buffer/bufmgr.c

Fix thinko in logical decoding code.

commit   : 3f0e4be453ffd27b5f5e6c115172091abda3a38f    
  
author   : Robert Haas <[email protected]>    
date     : Mon, 31 Mar 2014 13:03:18 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Mon, 31 Mar 2014 13:03:18 -0400    

Click here for diff

Andres Freund  

M src/backend/replication/logical/logical.c

Rewrite the way GIN posting lists are packed on a page, to reduce WAL volume.

commit   : 14d02f0bb352d70d50106e153aca4af9c4b0b842    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Mon, 31 Mar 2014 15:15:19 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Mon, 31 Mar 2014 15:15:19 +0300    

Click here for diff

Inserting (in retail) into the new 9.4 format GIN posting tree created much  
larger WAL records than in 9.3. The previous strategy to WAL logging was  
basically to log the whole page on each change, with the exception of  
completely unmodified segments up to the first modified one. That was not  
too bad when appending to the end of the page, as only the last segment had  
to be WAL-logged, but per Fujii Masao's testing, even that produced 2x the  
WAL volume that 9.3 did.  
  
The new strategy is to keep track of changes to the posting lists in a more  
fine-grained fashion, and also make the repacking" code smarter to avoid  
decoding and re-encoding segments unnecessarily.  

M src/backend/access/gin/gindatapage.c
M src/backend/access/gin/ginpostinglist.c
M src/backend/access/gin/ginxlog.c
M src/backend/access/rmgrdesc/gindesc.c
M src/include/access/gin_private.h

Rename GinLogicValue to GinTernaryValue.

commit   : 0cfa34c25a7c8e7017cac346d954016fad0dfc16    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Mon, 31 Mar 2014 10:26:38 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Mon, 31 Mar 2014 10:26:38 +0300    

Click here for diff

It's more descriptive. Also, get rid of the enum, and use #defines instead,  
per Greg Stark's suggestion.  

M src/backend/access/gin/ginarrayproc.c
M src/backend/access/gin/ginget.c
M src/backend/access/gin/ginlogic.c
M src/backend/utils/adt/jsonb_gin.c
M src/backend/utils/adt/tsginidx.c
M src/include/access/gin.h
M src/include/access/gin_private.h

Use separate output dirs for test_decoding's two runs.

commit   : 7317d8d961f210c3a6b20972cd605bcd9bffb06e    
  
author   : Andrew Dunstan <[email protected]>    
date     : Sun, 30 Mar 2014 18:30:59 -0400    
  
committer: Andrew Dunstan <[email protected]>    
date     : Sun, 30 Mar 2014 18:30:59 -0400    

Click here for diff

contrib/test_decoding's "make check" runs two sets of tests. Unless we  
specify separate output directories for each set the isolation tests  
will overwrite the output from the  normal regression set. Doing this  
will help the buildfarm collect complete logs.  

M contrib/test_decoding/Makefile

psql: display "Replica Identity" only for FULL and NOTHING

commit   : 9d66116444b9763bc09defb688fb09343420e040    
  
author   : Bruce Momjian <[email protected]>    
date     : Sat, 29 Mar 2014 19:00:11 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Sat, 29 Mar 2014 19:00:11 -0400    

Click here for diff

INDEX is already displayed on the index, and we now exclude pg_catalog.  
DEFAULT is not displayed.  

M contrib/test_decoding/expected/ddl.out
M src/bin/psql/describe.c
M src/test/regress/expected/create_table_like.out
M src/test/regress/expected/inherit.out
M src/test/regress/expected/matview.out
M src/test/regress/expected/replica_identity.out
M src/test/regress/expected/rules.out

Fix dumping of a materialized view that depends on a table's primary key.

commit   : 62215de2925705bc607635e45ff800364456b1a1    
  
author   : Tom Lane <[email protected]>    
date     : Sat, 29 Mar 2014 17:34:00 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Sat, 29 Mar 2014 17:34:00 -0400    

Click here for diff

It is possible for a view or materialized view to depend on a table's  
primary key, if the view query relies on functional dependency to  
abbreviate a GROUP BY list.  This is problematic for pg_dump since we  
ordinarily want to dump view definitions in the pre-data section but  
indexes in post-data.  pg_dump knows how to deal with this situation for  
regular views, by breaking the view's ON SELECT rule apart from the view  
proper.  But it had not been taught what to do about materialized views,  
and in fact mistakenly dumped them as regular views in such cases, as  
seen in bug #9616 from Jesse Denardo.  
  
If we had CREATE OR REPLACE MATERIALIZED VIEW, we could fix this in a  
manner analogous to what's done for regular views; but we don't yet,  
and we'd not back-patch such a thing into 9.3 anyway.  As a hopefully-  
temporary workaround, break the circularity by postponing the matview  
into post-data altogether when this case occurs.  

M src/bin/pg_dump/pg_dump.c
M src/bin/pg_dump/pg_dump.h
M src/bin/pg_dump/pg_dump_sort.c

Revert "Secure Unix-domain sockets of "make check" temporary clusters."

commit   : 8f5578d0f9681ef81bc71a3762a191d66a29c8b1    
  
author   : Noah Misch <[email protected]>    
date     : Sat, 29 Mar 2014 03:12:00 -0400    
  
committer: Noah Misch <[email protected]>    
date     : Sat, 29 Mar 2014 03:12:00 -0400    

Click here for diff

About half of the buildfarm members use too-long directory names,  
strongly suggesting that this approach is a dead end.  

M contrib/pg_upgrade/test.sh
M doc/src/sgml/regress.sgml
M src/test/regress/pg_regress.c

Secure Unix-domain sockets of "make check" temporary clusters.

commit   : 31c6e54ec9abab0c63d709e492ef18a701b02641    
  
author   : Noah Misch <[email protected]>    
date     : Sat, 29 Mar 2014 00:52:56 -0400    
  
committer: Noah Misch <[email protected]>    
date     : Sat, 29 Mar 2014 00:52:56 -0400    

Click here for diff

Any OS user able to access the socket can connect as the bootstrap  
superuser and in turn execute arbitrary code as the OS user running the  
test.  Protect against that by placing the socket in the temporary data  
directory, which has mode 0700 thanks to initdb.  Back-patch to 8.4 (all  
supported versions).  The hazard remains wherever the temporary cluster  
accepts TCP connections, notably on Windows.  
  
Attempts to run "make check" from a directory with a long name will now  
fail.  An alternative not sharing that problem was to place the socket  
in a subdirectory of /tmp, but that is only secure if /tmp is sticky.  
The PG_REGRESS_SOCK_DIR environment variable is available as a  
workaround when testing from long directory paths.  
  
As a convenient side effect, this lets testing proceed smoothly in  
builds that override DEFAULT_PGSOCKET_DIR.  Popular non-default values  
like /var/run/postgresql are often unwritable to the build user.  
  
Security: CVE-2014-0067  

M contrib/pg_upgrade/test.sh
M doc/src/sgml/regress.sgml
M src/test/regress/pg_regress.c

Document platform-specificity of unix_socket_permissions.

commit   : fbd32b0cab806a2244bd5171e4b60e53f4a9dfe7    
  
author   : Noah Misch <[email protected]>    
date     : Sat, 29 Mar 2014 00:52:31 -0400    
  
committer: Noah Misch <[email protected]>    
date     : Sat, 29 Mar 2014 00:52:31 -0400    

Click here for diff

Back-patch to 8.4 (all supported versions).  

M doc/src/sgml/config.sgml

Force consistent row order in contrib/test_decoding regression test.

commit   : 7ed908be41fbca1635d34f97138abb13beab8b24    
  
author   : Noah Misch <[email protected]>    
date     : Sat, 29 Mar 2014 00:31:44 -0400    
  
committer: Noah Misch <[email protected]>    
date     : Sat, 29 Mar 2014 00:31:44 -0400    

Click here for diff

M contrib/test_decoding/expected/ddl.out
M contrib/test_decoding/sql/ddl.sql

Improve regression test for pg_filenode_relation().

commit   : 9613a1d98e5f940d8124850e61b0a950157c8863    
  
author   : Tom Lane <[email protected]>    
date     : Fri, 28 Mar 2014 16:58:09 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Fri, 28 Mar 2014 16:58:09 -0400    

Click here for diff

Make it print the details in case there's a failure.  
  
Andres Freund, slightly modified by me  

M src/test/regress/expected/alter_table.out
M src/test/regress/sql/alter_table.sql

Adjust getpwuid() fix commit to display errno string on failure

commit   : e1827012ed4119150e29c3afcf462d3353f3a405    
  
author   : Bruce Momjian <[email protected]>    
date     : Fri, 28 Mar 2014 12:50:11 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Fri, 28 Mar 2014 12:50:11 -0400    

Click here for diff

This adjusts patch 613c6d26bd42dd8c2dd0664315be9551475b8864.  

M src/backend/libpq/auth.c

Fix EquivalenceClass processing for nested append relations.

commit   : a87c729153e372f3731689a7be007bc2b53f1410    
  
author   : Tom Lane <[email protected]>    
date     : Fri, 28 Mar 2014 11:50:01 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Fri, 28 Mar 2014 11:50:01 -0400    

Click here for diff

The original coding of EquivalenceClasses didn't foresee that appendrel  
child relations might themselves be appendrels; but this is possible for  
example when a UNION ALL subquery scans a table with inheritance children.  
The oversight led to failure to optimize ordering-related issues very well  
for the grandchild tables.  After some false starts involving explicitly  
flattening the appendrel representation, we found that this could be fixed  
easily by removing a few implicit assumptions about appendrel parent rels  
not being children themselves.  
  
Kyotaro Horiguchi and Tom Lane, reviewed by Noah Misch  

M src/backend/optimizer/path/allpaths.c
M src/backend/optimizer/path/equivclass.c
M src/backend/optimizer/plan/createplan.c
M src/test/regress/expected/union.out
M src/test/regress/sql/union.sql

Un-break peer authentication.

commit   : b777be0d48a042f500cac72140ffb50392973aa2    
  
author   : Tom Lane <[email protected]>    
date     : Fri, 28 Mar 2014 10:30:37 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Fri, 28 Mar 2014 10:30:37 -0400    

Click here for diff

Commit 613c6d26bd42dd8c2dd0664315be9551475b8864 sloppily replaced a  
lookup of the UID obtained from getpeereid() with a lookup of the  
server's own user name, thus totally destroying peer authentication.  
Revert.  Per report from Christoph Berg.  
  
In passing, make sure get_user_name() zeroes *errstr on success on  
Windows as well as non-Windows.  I don't think any callers actually  
depend on this ATM, but we should be consistent across platforms.  

M src/backend/libpq/auth.c
M src/common/username.c

Improve documentation note about Python 2.3 and cdecimal.

commit   : e5a452b3a4600dfc9c045e1591c25e6a567d8d73    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 27 Mar 2014 17:15:45 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 27 Mar 2014 17:15:45 -0400    

Click here for diff

Explain exactly what fails (ie, function arguments of type numeric)  
if you don't have it.  

M doc/src/sgml/installation.sgml

contrib/test_decoding: adjust expected output

commit   : 5906e10a2aecf472c41b2cb5a2a923c7bbabdce2    
  
author   : Bruce Momjian <[email protected]>    
date     : Thu, 27 Mar 2014 10:47:48 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Thu, 27 Mar 2014 10:47:48 -0400    

Click here for diff

Expected output has changed because of psql replica identity output  
changes.  
  
Reported by Christoph Berg  

M contrib/test_decoding/expected/ddl.out

Silence compiler warnings in new jsonb code.

commit   : e709ced1536d1ed34d96633ea7c319a3a2a2751c    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Thu, 27 Mar 2014 08:53:44 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Thu, 27 Mar 2014 08:53:44 +0200    

Click here for diff

Amit Kapila.  

M src/backend/utils/adt/jsonb_util.c

Document that Python 2.3 requires cdecimal module for full functionality.

commit   : f3cfc23195e3363ceab49449ed851944bcaf0849    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 26 Mar 2014 22:43:22 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 26 Mar 2014 22:43:22 -0400    

Click here for diff

This has been true for some time, but we were leaving users to discover it  
the hard way.  
  
Back-patch to 9.2.  It might've been true before that, but we were claiming  
Python 2.2 compatibility before that, so I won't guess at the exact  
requirements back then.  

M doc/src/sgml/installation.sgml

Fix uninitialized variables in json's populate_record_worker().

commit   : 7e4d1600a621ee4e786e715bc82eaad1113dba0e    
  
author   : Andrew Dunstan <[email protected]>    
date     : Wed, 26 Mar 2014 18:20:56 -0400    
  
committer: Andrew Dunstan <[email protected]>    
date     : Wed, 26 Mar 2014 18:20:56 -0400    

Click here for diff

Peter Geoghegan.  

M src/backend/utils/adt/jsonfuncs.c

Fix refcounting bug in PLy_modify_tuple().

commit   : 2d5e0f07de0119045fb889f9c11de0e486ce4ac5    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 26 Mar 2014 16:41:32 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 26 Mar 2014 16:41:32 -0400    

Click here for diff

We must increment the refcount on "plntup" as soon as we have the  
reference, not sometime later.  Otherwise, if an error is thrown in  
between, the Py_XDECREF(plntup) call in the PG_CATCH block removes a  
refcount we didn't add, allowing the object to be freed even though  
it's still part of the plpython function's parsetree.  
  
This appears to be the cause of crashes seen on buildfarm member  
prairiedog.  It's a bit surprising that we've not seen it fail repeatably  
before, considering that the regression tests have been exercising the  
faulty code path since 2009.  
  
The real-world impact is probably minimal, since it's unlikely anyone would  
be provoking the "TD["new"] is not a dictionary" error in production, and  
that's the only case that is actually wrong.  Still, it's a bug affecting  
the regression tests, so patch all supported branches.  
  
In passing, remove dead variable "plstr", and demote "platt" to a local  
variable inside the PG_TRY block, since we don't need to clean it up  
in the PG_CATCH path.  

M src/pl/plpython/plpy_exec.c

Pass more than the first XLogRecData entry to rm_desc, with WAL_DEBUG.

commit   : c2a6724823c14fd442c5441eb169b2581781fef0    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Wed, 26 Mar 2014 18:04:57 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Wed, 26 Mar 2014 18:04:57 +0200    

Click here for diff

If you compile with WAL_DEBUG and enable it with wal_debug=on, we used to  
only pass the first XLogRecData entry to the rm_desc routine. I think the  
original assumprion was that the first XLogRecData entry contains all the  
necessary information for the rm_desc routine, but that's a pretty shaky  
assumption. At least standby_redo didn't get the memo.  
  
To fix, piece together all the data in a temporary buffer, and pass that to  
the rm_desc routine.  
  
It's been like this forever, but the patch didn't apply cleanly to  
back-branches. Probably wouldn't be hard to fix the conflicts, but it's  
not worth the trouble.  

M src/backend/access/transam/xlog.c

psql: update "replica identity" display for \d+

commit   : b69c4e65bea92ef617581365c365d2f43aa9e1fa    
  
author   : Bruce Momjian <[email protected]>    
date     : Wed, 26 Mar 2014 11:13:17 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Wed, 26 Mar 2014 11:13:17 -0400    

Click here for diff

Display "replica identity" only for \d plus mode, exclude system schema  
objects, and display all possible values, not just non-default,  
non-index ones.  

M src/bin/psql/describe.c
M src/test/regress/expected/create_table_like.out
M src/test/regress/expected/inherit.out
M src/test/regress/expected/matview.out
M src/test/regress/expected/replica_identity.out
M src/test/regress/expected/rules.out

pg_upgrade: use pg_usleep(); remove Windows workaround

commit   : ba08155bd5e6dffe5cd4bda9e7d6616b5e20d564    
  
author   : Bruce Momjian <[email protected]>    
date     : Wed, 26 Mar 2014 10:22:16 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Wed, 26 Mar 2014 10:22:16 -0400    

Click here for diff

M contrib/pg_upgrade/exec.c
M contrib/pg_upgrade/pg_upgrade.h

Cleanup around json_to_record/json_to_recordset

commit   : f9c6d72cbf49257fea4265d994b96e66f25b2474    
  
author   : Andrew Dunstan <[email protected]>    
date     : Wed, 26 Mar 2014 10:18:24 -0400    
  
committer: Andrew Dunstan <[email protected]>    
date     : Wed, 26 Mar 2014 10:18:24 -0400    

Click here for diff

Set function parameter names and defaults. Add jsonb versions (which the  
code already provided for so the actual new code is trivial). Add jsonb  
regression tests and docs.  
  
Bump catalog version (which I apparently forgot to do when jsonb was  
committed).  

M doc/src/sgml/func.sgml
M src/backend/catalog/system_views.sql
M src/backend/utils/adt/jsonfuncs.c
M src/include/catalog/catversion.h
M src/include/catalog/pg_proc.h
M src/include/utils/json.h
M src/test/regress/expected/jsonb.out
M src/test/regress/expected/jsonb_1.out
M src/test/regress/sql/jsonb.sql

Use pg_usleep() instead of plain sleep(), to fix Windows build

commit   : 28475f8e58bd5da2b44a42203665a543f335c6a3    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Wed, 26 Mar 2014 15:25:39 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Wed, 26 Mar 2014 15:25:39 +0200    

Click here for diff

Per buildfarm.  

M contrib/pg_xlogdump/pg_xlogdump.c

Add -f/--follow option to pg_xlogdump.

commit   : ce9bb92f8fb8d25cf00ec939797ffdb5930fb792    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Wed, 26 Mar 2014 13:48:20 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Wed, 26 Mar 2014 13:48:20 +0200    

Click here for diff

This is useful for seeing what WAL records are inserted in real-time, by  
pointing pg_xlogdump to a live server.  

M contrib/pg_xlogdump/pg_xlogdump.c
M doc/src/sgml/pg_xlogdump.sgml

Fix 'recheck' flag in tsquery's GIN tri-consistent function.

commit   : 86cf41ed27f6e822a99998505ecffb42f2662662    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Wed, 26 Mar 2014 10:13:44 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Wed, 26 Mar 2014 10:13:44 +0200    

Click here for diff

It needs to be initialized, like in the boolean gin_tsquery_consistent  
version.  
  
Peter Geoghegan.  

M src/backend/utils/adt/tsginidx.c

Tidy up the populate/to_record{set} code for json a bit.

commit   : fbc3def8620953cf124aac65e7be4821f138c37f    
  
author   : Andrew Dunstan <[email protected]>    
date     : Tue, 25 Mar 2014 21:20:54 -0400    
  
committer: Andrew Dunstan <[email protected]>    
date     : Tue, 25 Mar 2014 21:20:54 -0400    

Click here for diff

In the process fix a small bug.  

M src/backend/utils/adt/jsonfuncs.c

Don't forget to flush XLOG_PARAMETER_CHANGE record.

commit   : 49638868f81f05e9ea4799e6c6148b76b47da83d    
  
author   : Fujii Masao <[email protected]>    
date     : Wed, 26 Mar 2014 02:12:39 +0900    
  
committer: Fujii Masao <[email protected]>    
date     : Wed, 26 Mar 2014 02:12:39 +0900    

Click here for diff

Backpatch to 9.0 where XLOG_PARAMETER_CHANGE record was instroduced.  

M src/backend/access/transam/xlog.c

Fix typos in pg_basebackup documentation

commit   : 36f7c3a1e019d16a83a363958c3f3927692821d9    
  
author   : Magnus Hagander <[email protected]>    
date     : Tue, 25 Mar 2014 11:16:57 +0100    
  
committer: Magnus Hagander <[email protected]>    
date     : Tue, 25 Mar 2014 11:16:57 +0100    

Click here for diff

Joshua Tolley  

M doc/src/sgml/ref/pg_basebackup.sgml

doc: list unlogged tables as a non-durable option

commit   : 6c5ced1526b189ed98baa0d195a7078d1afd112e    
  
author   : Bruce Momjian <[email protected]>    
date     : Mon, 24 Mar 2014 22:04:44 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Mon, 24 Mar 2014 22:04:44 -0400    

Click here for diff

M doc/src/sgml/perform.sgml

Remove wchar.c Asserts that were stricter than the main code

commit   : 5db55c6bbca28b8be4d68d2fa0e22465cfe8e755    
  
author   : Bruce Momjian <[email protected]>    
date     : Mon, 24 Mar 2014 15:59:38 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Mon, 24 Mar 2014 15:59:38 -0400    

Click here for diff

Assert errors were thrown for functions being passed invalid encodings,  
while the main code handled it just fine.  
  
Also document that libpq's PQclientEncoding() returns -1 for an encoding  
lookup failure.  
  
Per report from Peter Geoghegan  

M doc/src/sgml/libpq.sgml
M src/backend/utils/mb/wchar.c

docs: Add short "cover density" description

commit   : 0b5c0f3bc78d72b753387f84b9188709af3ef8fb    
  
author   : Bruce Momjian <[email protected]>    
date     : Mon, 24 Mar 2014 15:46:59 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Mon, 24 Mar 2014 15:46:59 -0400    

Click here for diff

Also, previous commit 1420f3a9827a39e5c6c998f6fa35a6fc97903145 to fix  
ts_rank_cd() for stripped lexemes was from a patch created by Alex Hill.  

M doc/src/sgml/textsearch.sgml

Fix ts_rank_cd() to ignore stripped lexemes

commit   : 1420f3a9827a39e5c6c998f6fa35a6fc97903145    
  
author   : Bruce Momjian <[email protected]>    
date     : Mon, 24 Mar 2014 14:36:36 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Mon, 24 Mar 2014 14:36:36 -0400    

Click here for diff

Previously, stripped lexemes got a default location and could be  
considered if mixed with non-stripped lexemes.  
  
BACKWARD INCOMPATIBILITY CHANGE  

M doc/src/sgml/textsearch.sgml
M src/backend/utils/adt/tsrank.c
M src/test/regress/expected/tsearch.out
M src/test/regress/sql/tsearch.sql

Change ginMergeItemPointers to return a palloc'd array.

commit   : bb42e21be274a71f6868ce2fc8fae2c15c3ecf66    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Mon, 24 Mar 2014 18:40:26 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Mon, 24 Mar 2014 18:40:26 +0200    

Click here for diff

That seems nicer than making it the caller's responsibility to pass a  
suitable-sized array. All the callers were just palloc'ing an array anyway.  

M src/backend/access/gin/gindatapage.c
M src/backend/access/gin/gininsert.c
M src/backend/access/gin/ginpostinglist.c
M src/include/access/gin_private.h

Fix START_REPLICATION syntax in document.

commit   : cf5d38f4b9bcdf035c46ca8b3e5442557a21ef34    
  
author   : Fujii Masao <[email protected]>    
date     : Mon, 24 Mar 2014 19:23:32 +0900    
  
committer: Fujii Masao <[email protected]>    
date     : Mon, 24 Mar 2014 19:23:32 +0900    

Click here for diff

Enclose "TIMELINE tli" part with brackets because it's optional.  
  
Backport to 9.3 where TIMELINE option was introduced.  
  
Noted by Marko Tiikkaja  

M doc/src/sgml/protocol.sgml

Remove dead code and add comments.

commit   : 2f3afc09793da3a30f2878f34eda30a71060da7e    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Mon, 24 Mar 2014 11:02:23 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Mon, 24 Mar 2014 11:02:23 +0200    

Click here for diff

'cbuffer' variable was left over from an earlier version of the patch to  
rewrite the incomplete split handling.  

M src/backend/access/nbtree/nbtxlog.c

Fix "the the" typos.

commit   : 3ed249b74133bc567a4efcfb90eb69d445097c1b    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Mon, 24 Mar 2014 08:42:13 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Mon, 24 Mar 2014 08:42:13 +0200    

Click here for diff

Erik Rijkers  

M doc/src/sgml/json.sgml
M doc/src/sgml/logicaldecoding.sgml
M src/backend/access/transam/xlog.c

Do jsonb regression test input in the conventional way.

commit   : ab22b149c60a10b842e3ec7fe3eb3b0b66c6611a    
  
author   : Andrew Dunstan <[email protected]>    
date     : Sun, 23 Mar 2014 20:18:06 -0400    
  
committer: Andrew Dunstan <[email protected]>    
date     : Sun, 23 Mar 2014 20:18:06 -0400    

Click here for diff

This should make the buildfarm happier.  

M src/test/regress/expected/create_table.out
M src/test/regress/expected/jsonb.out
M src/test/regress/expected/jsonb_1.out
M src/test/regress/expected/sanity_check.out
M src/test/regress/input/copy.source
M src/test/regress/output/copy.source
M src/test/regress/output/misc.source
M src/test/regress/sql/create_table.sql
M src/test/regress/sql/jsonb.sql

Fix mis-spelling in jsonb docs.

commit   : ca07cd59b24e00e428ed26716754244cec7f56b7    
  
author   : Andrew Dunstan <[email protected]>    
date     : Sun, 23 Mar 2014 18:25:16 -0400    
  
committer: Andrew Dunstan <[email protected]>    
date     : Sun, 23 Mar 2014 18:25:16 -0400    

Click here for diff

Per Thom Brown.  

M doc/src/sgml/json.sgml

Introduce jsonb, a structured format for storing json.

commit   : d9134d0a355cfa447adc80db4505d5931084278a    
  
author   : Andrew Dunstan <[email protected]>    
date     : Sun, 23 Mar 2014 16:40:19 -0400    
  
committer: Andrew Dunstan <[email protected]>    
date     : Sun, 23 Mar 2014 16:40:19 -0400    

Click here for diff

The new format accepts exactly the same data as the json type. However, it is  
stored in a format that does not require reparsing the orgiginal text in order  
to process it, making it much more suitable for indexing and other operations.  
Insignificant whitespace is discarded, and the order of object keys is not  
preserved. Neither are duplicate object keys kept - the later value for a given  
key is the only one stored.  
  
The new type has all the functions and operators that the json type has,  
with the exception of the json generation functions (to_json, json_agg etc.)  
and with identical semantics. In addition, there are operator classes for  
hash and btree indexing, and two classes for GIN indexing, that have no  
equivalent in the json type.  
  
This feature grew out of previous work by Oleg Bartunov and Teodor Sigaev, which  
was intended to provide similar facilities to a nested hstore type, but which  
in the end proved to have some significant compatibility issues.  
  
Authors: Oleg Bartunov,  Teodor Sigaev, Peter Geoghegan and Andrew Dunstan.  
Review: Andres Freund  

M contrib/hstore/Makefile
M contrib/hstore/expected/hstore.out
A contrib/hstore/hstore–1.2–1.3.sql
R097 contrib/hstore/hstore–1.2.sql contrib/hstore/hstore–1.3.sql
M contrib/hstore/hstore.control
M contrib/hstore/hstore_io.c
M contrib/hstore/sql/hstore.sql
M doc/src/sgml/datatype.sgml
M doc/src/sgml/filelist.sgml
M doc/src/sgml/func.sgml
A doc/src/sgml/json.sgml
M src/backend/catalog/system_views.sql
M src/backend/utils/adt/Makefile
M src/backend/utils/adt/json.c
A src/backend/utils/adt/jsonb.c
A src/backend/utils/adt/jsonb_gin.c
A src/backend/utils/adt/jsonb_op.c
A src/backend/utils/adt/jsonb_util.c
M src/backend/utils/adt/jsonfuncs.c
M src/backend/utils/adt/numeric.c
M src/include/catalog/pg_amop.h
M src/include/catalog/pg_amproc.h
M src/include/catalog/pg_cast.h
M src/include/catalog/pg_opclass.h
M src/include/catalog/pg_operator.h
M src/include/catalog/pg_opfamily.h
M src/include/catalog/pg_proc.h
M src/include/catalog/pg_type.h
M src/include/funcapi.h
M src/include/utils/json.h
M src/include/utils/jsonapi.h
A src/include/utils/jsonb.h
M src/include/utils/numeric.h
A src/test/regress/data/jsonb.data
M src/test/regress/expected/json.out
M src/test/regress/expected/json_1.out
A src/test/regress/expected/jsonb.out
A src/test/regress/expected/jsonb_1.out
M src/test/regress/expected/opr_sanity.out
M src/test/regress/parallel_schedule
M src/test/regress/serial_schedule
M src/test/regress/sql/json.sql
A src/test/regress/sql/jsonb.sql

Don't test xmin/xmax columns of a postgres_fdw foreign table.

commit   : b2b2491b06074e68fc7c96148cb0fdf0c8eb0469    
  
author   : Noah Misch <[email protected]>    
date     : Sun, 23 Mar 2014 03:48:17 -0400    
  
committer: Noah Misch <[email protected]>    
date     : Sun, 23 Mar 2014 03:48:17 -0400    

Click here for diff

Their values are unspecified and system-dependent.  
  
Per buildfarm member kouprey.  

M contrib/postgres_fdw/expected/postgres_fdw.out
M contrib/postgres_fdw/sql/postgres_fdw.sql

Offer triggers on foreign tables.

commit   : 7cbe57c34dec4860243e6d0f81738cfbb6e5d069    
  
author   : Noah Misch <[email protected]>    
date     : Sun, 23 Mar 2014 02:16:34 -0400    
  
committer: Noah Misch <[email protected]>    
date     : Sun, 23 Mar 2014 02:16:34 -0400    

Click here for diff

This covers all the SQL-standard trigger types supported for regular  
tables; it does not cover constraint triggers.  The approach for  
acquiring the old row mirrors that for view INSTEAD OF triggers.  For  
AFTER ROW triggers, we spool the foreign tuples to a tuplestore.  
  
This changes the FDW API contract; when deciding which columns to  
populate in the slot returned from data modification callbacks, writable  
FDWs will need to check for AFTER ROW triggers in addition to checking  
for a RETURNING clause.  
  
In support of the feature addition, refactor the TriggerFlags bits and  
the assembly of old tuples in ModifyTable.  
  
Ronan Dunklau, reviewed by KaiGai Kohei; some additional hacking by me.  

M contrib/postgres_fdw/deparse.c
M contrib/postgres_fdw/expected/postgres_fdw.out
M contrib/postgres_fdw/postgres_fdw.c
M contrib/postgres_fdw/sql/postgres_fdw.sql
M doc/src/sgml/fdwhandler.sgml
M doc/src/sgml/ref/create_trigger.sgml
M doc/src/sgml/trigger.sgml
M src/backend/commands/tablecmds.c
M src/backend/commands/trigger.c
M src/backend/executor/nodeModifyTable.c
M src/backend/rewrite/rewriteHandler.c
M src/include/commands/trigger.h
M src/test/regress/expected/foreign_data.out
M src/test/regress/sql/foreign_data.sql

Improve comments about AfterTriggerBeginQuery() query level usage.

commit   : 6115480c543c0141011a99db78987ad13540be59    
  
author   : Noah Misch <[email protected]>    
date     : Sun, 23 Mar 2014 02:15:52 -0400    
  
committer: Noah Misch <[email protected]>    
date     : Sun, 23 Mar 2014 02:15:52 -0400    

Click here for diff

M src/backend/commands/trigger.c

Address ccvalid/ccnoinherit in TupleDesc support functions.

commit   : c31305de5f5a4880b0ba2f5983025ef0210a3b2a    
  
author   : Noah Misch <[email protected]>    
date     : Sun, 23 Mar 2014 02:13:43 -0400    
  
committer: Noah Misch <[email protected]>    
date     : Sun, 23 Mar 2014 02:13:43 -0400    

Click here for diff

equalTupleDescs() neglected both of these ConstrCheck fields, and  
CreateTupleDescCopyConstr() neglected ccnoinherit.  At this time, the  
only known behavior defect resulting from these omissions is constraint  
exclusion disregarding a CHECK constraint validated by an ALTER TABLE  
VALIDATE CONSTRAINT statement issued earlier in the same transaction.  
Back-patch to 9.2, where these fields were introduced.  

M src/backend/access/common/tupdesc.c

Fix thinkos in GinLogicValue enum.

commit   : 4c0e97c2d58f1cec9fc24237342962811de3cfee    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Fri, 21 Mar 2014 23:41:37 +0100    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Fri, 21 Mar 2014 23:41:37 +0100    

Click here for diff

It was incorrectly declared as global variable, not an enum type, and  
the comments for GIN_FALSE and GIN_TRUE were backwards.  

M src/include/access/gin.h

Fix build with LWLOCK_STATS or dtrace.

commit   : dea6ed2c980286e89caf4166ad329f506abbff29    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Fri, 21 Mar 2014 23:11:24 +0100    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Fri, 21 Mar 2014 23:11:24 +0100    

Click here for diff

Also fix the name of the dtrace probe for LWLockAcquireOrWait(). The  
function was renamed from LWLockWaitUntilFree to LWLockAqcuireOrWait, but  
the dtrace probe was neglected.  
  
Pointed out by Andres Freund and the buildfarm.  

M src/backend/storage/lmgr/lwlock.c
M src/backend/utils/probes.d

Remove MinGW readdir/errno bug workaround fixed on 2003-10-10

commit   : 1494931d7375ccdc6afd34f135bc708f8954eecc    
  
author   : Bruce Momjian <[email protected]>    
date     : Fri, 21 Mar 2014 13:47:37 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Fri, 21 Mar 2014 13:47:37 -0400    

Click here for diff

M contrib/pg_archivecleanup/pg_archivecleanup.c
M contrib/pg_standby/pg_standby.c
M src/backend/storage/file/fd.c
M src/bin/initdb/initdb.c
M src/bin/pg_basebackup/pg_receivexlog.c
M src/bin/pg_dump/pg_backup_directory.c
M src/bin/pg_resetxlog/pg_resetxlog.c
M src/common/pgfnames.c
M src/port/pgcheckdir.c

Properly check for readdir/closedir() failures

commit   : 6f03927fce038096f53ca67eeab9adb24938f8a6    
  
author   : Bruce Momjian <[email protected]>    
date     : Fri, 21 Mar 2014 13:45:11 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Fri, 21 Mar 2014 13:45:11 -0400    

Click here for diff

Clear errno before calling readdir() and handle old MinGW errno bug  
while adding full test coverage for readdir/closedir failures.  
  
Backpatch through 8.4.  

M contrib/pg_archivecleanup/pg_archivecleanup.c
M contrib/pg_standby/pg_standby.c
M src/backend/storage/file/fd.c
M src/bin/initdb/initdb.c
M src/bin/pg_basebackup/pg_receivexlog.c
M src/bin/pg_dump/pg_backup_directory.c
M src/bin/pg_resetxlog/pg_resetxlog.c
M src/common/pgfnames.c
M src/port/dirent.c
M src/port/pgcheckdir.c

Replace the XLogInsert slots with regular LWLocks.

commit   : 68a2e52bbaf98f136a96b3a0d734ca52ca440a95    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Fri, 21 Mar 2014 15:06:08 +0100    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Fri, 21 Mar 2014 15:06:08 +0100    

Click here for diff

The special feature the XLogInsert slots had over regular LWLocks is the  
insertingAt value that was updated atomically with releasing backends  
waiting on it. Add new functions to the LWLock API to do that, and replace  
the slots with LWLocks. This reduces the amount of duplicated code.  
(There's still some duplication, but at least it's all in lwlock.c now.)  
  
Reviewed by Andres Freund.  

M src/backend/access/transam/xlog.c
M src/backend/storage/lmgr/lwlock.c
M src/backend/utils/misc/guc.c
M src/include/access/xlog.h
M src/include/storage/lwlock.h

Again fix initialization of auto-tuned effective_cache_size.

commit   : af930e606a3217db3909029c6c3f8d003ba70920    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 20 Mar 2014 12:58:13 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 20 Mar 2014 12:58:13 -0400    

Click here for diff

The previous method was overly complex and underly correct; in particular,  
by assigning the default value with PGC_S_OVERRIDE, it prevented later  
attempts to change the setting in postgresql.conf, as noted by Jeff Janes.  
We should just assign the default value with source PGC_S_DYNAMIC_DEFAULT,  
which will have the desired priority relative to the boot_val as well as  
user-set values.  
  
There is still a gap in this method: if there's an explicit assignment of  
effective_cache_size = -1 in the postgresql.conf file, and that assignment  
appears before shared_buffers is assigned, the code will substitute 4 times  
the bootstrap default for shared_buffers, and that value will then persist  
(since it will have source PGC_S_FILE).  I don't see any very nice way  
to avoid that though, and it's not a case to be expected in practice.  
The existing comments in guc-file.l look forward to a redesign of the  
DYNAMIC_DEFAULT mechanism; if that ever happens, we should consider this  
case as one of the things we'd like to improve.  

M src/backend/optimizer/path/costsize.c
M src/backend/utils/misc/guc-file.l

libpq: pass a memory allocation failure error up to PQconndefaults()

commit   : a4c8f14364c27508233f8a31ac4b10a4c90235a9    
  
author   : Bruce Momjian <[email protected]>    
date     : Thu, 20 Mar 2014 11:48:31 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Thu, 20 Mar 2014 11:48:31 -0400    

Click here for diff

Previously user name memory allocation failures were ignored and the  
default user name set to NULL.  

M src/interfaces/libpq/fe-auth.c
M src/interfaces/libpq/fe-connect.c

test_shm_mq: Improve regression tests.

commit   : d1bdab2fa39f9a29fc806e1f2b6b5428b88d7cc5    
  
author   : Robert Haas <[email protected]>    
date     : Thu, 20 Mar 2014 08:42:53 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Thu, 20 Mar 2014 08:42:53 -0400    

Click here for diff

Per discussion with Tom Lane.  

M contrib/test_shm_mq/expected/test_shm_mq.out
M contrib/test_shm_mq/sql/test_shm_mq.sql

Setup error context callback for transaction lock waits

commit   : f88d4cfc9d417dac2ee41a8f5e593898e56fd2bd    
  
author   : Alvaro Herrera <[email protected]>    
date     : Wed, 19 Mar 2014 15:10:36 -0300    
  
committer: Alvaro Herrera <[email protected]>    
date     : Wed, 19 Mar 2014 15:10:36 -0300    

Click here for diff

With this in place, a session blocking behind another one because of  
tuple locks will get a context line mentioning the relation name, tuple  
TID, and operation being done on tuple.  For example:  
  
LOG:  process 11367 still waiting for ShareLock on transaction 717 after 1000.108 ms  
DETAIL:  Process holding the lock: 11366. Wait queue: 11367.  
CONTEXT:  while updating tuple (0,2) in relation "foo"  
STATEMENT:  UPDATE foo SET value = 3;  
  
Most usefully, the new line is displayed by log entries due to  
log_lock_waits, although of course it will be printed by any other log  
message as well.  
  
Author: Christian Kruse, some tweaks by Álvaro Herrera  
Reviewed-by: Amit Kapila, Andres Freund, Tom Lane, Robert Haas  

M src/backend/access/heap/heapam.c
M src/backend/access/nbtree/nbtinsert.c
M src/backend/catalog/index.c
M src/backend/executor/execMain.c
M src/backend/executor/execUtils.c
M src/backend/replication/logical/snapbuild.c
M src/backend/storage/lmgr/lmgr.c
M src/include/storage/lmgr.h
M src/nls-global.mk

Fix memory leak during regular expression execution.

commit   : ea8c7e9054abf23fa3de2f8e4414f60ac8a8b620    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 19 Mar 2014 11:09:24 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 19 Mar 2014 11:09:24 -0400    

Click here for diff

For a regex containing backrefs, pg_regexec() might fail to free all the  
sub-DFAs that were created during execution, resulting in a permanent  
(session lifespan) memory leak.  Problem was introduced by me in commit  
587359479acbbdc95c8e37da40707e37097423f5.  Per report from Sandro Santilli;  
diagnosis by Greg Stark.  

M src/backend/regex/regexec.c

Some minor improvements to logical decoding document.

commit   : fb1d92a9fa0226c435daf16d08e5d05d6986fc54    
  
author   : Fujii Masao <[email protected]>    
date     : Wed, 19 Mar 2014 22:13:05 +0900    
  
committer: Fujii Masao <[email protected]>    
date     : Wed, 19 Mar 2014 22:13:05 +0900    

Click here for diff

Also improve help message in pg_recvlogical.  

M doc/src/sgml/logicaldecoding.sgml
M src/bin/pg_basebackup/pg_recvlogical.c

Fix compilation of pg_xlogdump, now that rm_safe_restartpoint is no more.

commit   : 033dc1c92cf018d396e983d425b821dda420cfff    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Tue, 18 Mar 2014 22:23:00 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Tue, 18 Mar 2014 22:23:00 +0200    

Click here for diff

Oops. Pointed out by Andres Freund.  

M contrib/pg_xlogdump/rmgrdesc.c

Remove rm_safe_restartpoint machinery.

commit   : 59a5ab3f426e74e3f901dc2cf533726bcea08ed2    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Tue, 18 Mar 2014 22:06:59 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Tue, 18 Mar 2014 22:06:59 +0200    

Click here for diff

It is no longer used, none of the resource managers have multi-record  
actions that would make it unsafe to perform a restartpoint.  
  
Also don't allow rm_cleanup to write WAL records, it's also no longer  
required. Move the call to rm_cleanup routines to make it more symmetric  
with rm_startup.  

M src/backend/access/transam/rmgr.c
M src/backend/access/transam/xlog.c
M src/include/access/rmgr.h
M src/include/access/rmgrlist.h
M src/include/access/xlog_internal.h

Fix misc typos in comments.

commit   : 1d3b258cbe4aedfb49c92c28b9cbd7c18d277e04    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Tue, 18 Mar 2014 21:03:17 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Tue, 18 Mar 2014 21:03:17 +0200    

Click here for diff

M src/bin/pg_basebackup/pg_recvlogical.c
M src/test/regress/expected/replica_identity.out
M src/test/regress/sql/replica_identity.sql

Logical decoding documentation corrections.

commit   : 3ee4fcfc63452a1ab5586b2d4cb4b6908d1badff    
  
author   : Robert Haas <[email protected]>    
date     : Tue, 18 Mar 2014 14:57:49 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Tue, 18 Mar 2014 14:57:49 -0400    

Click here for diff

Thom Brown  

M doc/src/sgml/logicaldecoding.sgml

Fix uninitialized variable.

commit   : a3b30d4cfe5f3ae718fd2cc6aa05b7707cac88dd    
  
author   : Robert Haas <[email protected]>    
date     : Tue, 18 Mar 2014 14:54:00 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Tue, 18 Mar 2014 14:54:00 -0400    

Click here for diff

Report from Andres Freund, but not his fix.  

M src/bin/pg_basebackup/pg_recvlogical.c

Make the handling of interrupted B-tree page splits more robust.

commit   : 40dae7ec537c5619fc93ad602c62f37be786d161    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Tue, 18 Mar 2014 20:12:58 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Tue, 18 Mar 2014 20:12:58 +0200    

Click here for diff

Splitting a page consists of two separate steps: splitting the child page,  
and inserting the downlink for the new right page to the parent. Previously,  
we handled the case that you crash in between those steps with a cleanup  
routine after the WAL recovery had finished, which finished the incomplete  
split. However, that doesn't help if the page split is interrupted but the  
database doesn't crash, so that you don't perform WAL recovery. That could  
happen for example if you run out of disk space.  
  
Remove the end-of-recovery cleanup step. Instead, when a page is split, the  
left page is marked with a new INCOMPLETE_SPLIT flag, and when the downlink  
is inserted to the parent, the flag is cleared again. If an insertion sees  
a page with the flag set, it knows that the split was interrupted for some  
reason, and inserts the missing downlink before proceeding.  
  
I used the same approach to fix GIN and GiST split algorithms earlier. This  
was the last WAL cleanup routine, so we could get rid of that whole  
machinery now, but I'll leave that for a separate patch.  
  
Reviewed by Peter Geoghegan.  

M src/backend/access/nbtree/README
M src/backend/access/nbtree/nbtinsert.c
M src/backend/access/nbtree/nbtpage.c
M src/backend/access/nbtree/nbtsearch.c
M src/backend/access/nbtree/nbtxlog.c
M src/include/access/nbtree.h
M src/include/access/rmgrlist.h
M src/include/access/xlog_internal.h

Fix some remaining int64 vestiges in contrib/test_shm_mq.

commit   : b6ec7c92ac7ab6223b3c45dc554efffd1953758f    
  
author   : Tom Lane <[email protected]>    
date     : Tue, 18 Mar 2014 14:26:44 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Tue, 18 Mar 2014 14:26:44 -0400    

Click here for diff

Andres Freund and Tom Lane  

M contrib/test_shm_mq/setup.c
M contrib/test_shm_mq/test.c

test_shm_mq: Use Size rather than uint64.

commit   : c676ac0f3fc87911588ca8e5f92483d1671ba89f    
  
author   : Robert Haas <[email protected]>    
date     : Tue, 18 Mar 2014 13:30:19 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Tue, 18 Mar 2014 13:30:19 -0400    

Click here for diff

Commit 3bd261ca18c67eafe18088e58fab511e3b965418 updated the API but  
neglected to make the corresponding edits here.  
  
Per Tom Lane and the buildfarm.  

M contrib/test_shm_mq/test.c
M contrib/test_shm_mq/worker.c

Documentation for logical decoding.

commit   : 49c0864d7ef5227faa24f903902db90e5c9d5d69    
  
author   : Robert Haas <[email protected]>    
date     : Tue, 18 Mar 2014 13:20:01 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Tue, 18 Mar 2014 13:20:01 -0400    

Click here for diff

Craig Ringer, Andres Freund, Christian Kruse, with edits by me.  

M doc/src/sgml/catalogs.sgml
M doc/src/sgml/filelist.sgml
M doc/src/sgml/func.sgml
A doc/src/sgml/logicaldecoding.sgml
M doc/src/sgml/postgres.sgml
M doc/src/sgml/protocol.sgml
M doc/src/sgml/ref/allfiles.sgml
M doc/src/sgml/ref/alter_table.sgml
M doc/src/sgml/ref/create_table.sgml
A doc/src/sgml/ref/pg_recvlogical.sgml
M doc/src/sgml/reference.sgml

Add pg_recvlogical, a tool to receive data logical decoding data.

commit   : 8bdd12bbf093c846c9383c205e363d6ae35f11a6    
  
author   : Robert Haas <[email protected]>    
date     : Tue, 18 Mar 2014 12:19:57 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Tue, 18 Mar 2014 12:19:57 -0400    

Click here for diff

This is fairly basic at the moment, but it's at least useful for  
testing and debugging, and possibly more.  
  
Andres Freund  

M src/bin/pg_basebackup/.gitignore
M src/bin/pg_basebackup/Makefile
M src/bin/pg_basebackup/nls.mk
A src/bin/pg_basebackup/pg_recvlogical.c
M src/bin/pg_basebackup/receivelog.c
M src/bin/pg_basebackup/receivelog.h
M src/bin/pg_basebackup/streamutil.c
M src/bin/pg_basebackup/streamutil.h

Rewrite comment for shm_mq_receive_bytes.

commit   : 250f8a7bbe83a7dbc9618c0a506f7170ab610e4b    
  
author   : Robert Haas <[email protected]>    
date     : Tue, 18 Mar 2014 11:51:51 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Tue, 18 Mar 2014 11:51:51 -0400    

Click here for diff

The comment and the code diverged at some point before the initial  
commit of this feature, and I failed to notice.  
  
Noted by Tom Lane.  

M src/backend/storage/ipc/shm_mq.c

Fix relcache reference leak in refresh_by_match_merge().

commit   : f7271c44278352516ec66b2de311952ce330b6d5    
  
author   : Tom Lane <[email protected]>    
date     : Tue, 18 Mar 2014 11:36:45 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Tue, 18 Mar 2014 11:36:45 -0400    

Click here for diff

One path through the loop over indexes forgot to do index_close().  Rather  
than adding a fourth call, restructure slightly so that there's only one.  
  
In passing, get rid of an unnecessary syscache lookup: the pg_index struct  
for the index is already available from its relcache entry.  
  
Per report from YAMAMOTO Takashi, though this is a bit different from his  
suggested patch.  This is new code in HEAD, so no need for back-patch.  

M src/backend/commands/matview.c

Improve shm_mq portability around MAXIMUM_ALIGNOF and sizeof(Size).

commit   : 3bd261ca18c67eafe18088e58fab511e3b965418    
  
author   : Robert Haas <[email protected]>    
date     : Tue, 18 Mar 2014 11:19:13 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Tue, 18 Mar 2014 11:19:13 -0400    

Click here for diff

Revise the original decision to expose a uint64-based interface and  
use Size everywhere possible.  Avoid assuming that MAXIMUM_ALIGNOF is  
8, or making any assumption about the relationship between that value  
and sizeof(Size).  If MAXIMUM_ALIGNOF is bigger, we'll now insert  
padding after the length word; if it's smaller, we are now prepared  
to read and write the length word in chunks.  
  
Per discussion with Tom Lane.  

M src/backend/storage/ipc/shm_mq.c
M src/include/storage/shm_mq.h

Fix pg_dumpall option parsing: -i doesn't take an argument.

commit   : 19f2d6cdae2bfa97c2ce8a7f5ac453a91f40704a    
  
author   : Tom Lane <[email protected]>    
date     : Tue, 18 Mar 2014 10:38:25 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Tue, 18 Mar 2014 10:38:25 -0400    

Click here for diff

This used to work properly, but got fat-fingered in commit  
3dee636e0404885d07885d41c0d70e50c784f324.  Per bug #9620 from  
Nicolas Payart.  

M src/bin/pg_dump/pg_dumpall.c

Fix help message and document in pg_receivexlog.

commit   : e726e59dc4845fff1e0e5849ef8d0bae958002fd    
  
author   : Fujii Masao <[email protected]>    
date     : Tue, 18 Mar 2014 21:15:45 +0900    
  
committer: Fujii Masao <[email protected]>    
date     : Tue, 18 Mar 2014 21:15:45 +0900    

Click here for diff

Add SLOTNAME placeholder to --slot option in help message and  
document.  

M doc/src/sgml/ref/pg_receivexlog.sgml
M src/bin/pg_basebackup/pg_receivexlog.c

Make it easy to detach completely from shared memory.

commit   : 79a4d24f31e09eb3c421deb34829eee0bf6acd67    
  
author   : Robert Haas <[email protected]>    
date     : Tue, 18 Mar 2014 07:58:53 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Tue, 18 Mar 2014 07:58:53 -0400    

Click here for diff

The new function dsm_detach_all() can be used either by postmaster  
children that don't wish to take any risk of accidentally corrupting  
shared memory; or by forked children of regular backends with  
the same need.  This patch also updates the postmaster children that  
already do PGSharedMemoryDetach() to do dsm_detach_all() as well.  
  
Per discussion with Tom Lane.  

M src/backend/postmaster/pgarch.c
M src/backend/postmaster/pgstat.c
M src/backend/postmaster/syslogger.c
M src/backend/storage/ipc/dsm.c
M src/include/storage/dsm.h

Release notes for 9.3.4, 9.2.8, 9.1.13, 9.0.17, 8.4.21.

commit   : 551fb5ac742eb7dbf92aa80743aa5a52b8a0189f    
  
author   : Tom Lane <[email protected]>    
date     : Mon, 17 Mar 2014 15:28:22 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Mon, 17 Mar 2014 15:28:22 -0400    

Click here for diff

M doc/src/sgml/release-8.4.sgml
M doc/src/sgml/release-9.0.sgml
M doc/src/sgml/release-9.1.sgml
M doc/src/sgml/release-9.2.sgml
M doc/src/sgml/release-9.3.sgml

During index build, check and elog (not just Assert) for broken HOT chain.

commit   : d70cf811f7dd26c07dbb78df4a51b667e7a3489b    
  
author   : Tom Lane <[email protected]>    
date     : Mon, 17 Mar 2014 12:36:11 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Mon, 17 Mar 2014 12:36:11 -0400    

Click here for diff

The recently-fixed bug in WAL replay could result in not finding a parent  
tuple for a heap-only tuple.  The existing code would either Assert or  
generate an invalid index entry, neither of which is desirable.  Throw a  
regular error instead.  

M src/backend/catalog/index.c

Fix thinko: have trueTriConsistentFn return GIN_TRUE.

commit   : d663d4399e767223e454302ea90d04f78b2f9d29    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Mon, 17 Mar 2014 17:18:40 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Mon, 17 Mar 2014 17:18:40 +0200    

Click here for diff

While we're at it, also improve comments in ginlogic.c.  

M src/backend/access/gin/ginlogic.c

Fix typos in comments.

commit   : 2bccced110025f48bf426a8a9d7f627ef3663fcd    
  
author   : Fujii Masao <[email protected]>    
date     : Mon, 17 Mar 2014 20:47:28 +0900    
  
committer: Fujii Masao <[email protected]>    
date     : Mon, 17 Mar 2014 20:47:28 +0900    

Click here for diff

Thom Brown  

M contrib/pgcrypto/openssl.c
M doc/src/sgml/gin.sgml
M src/backend/access/gin/ginget.c
M src/backend/access/gin/ginlogic.c
M src/backend/access/heap/rewriteheap.c
M src/backend/lib/ilist.c
M src/backend/replication/logical/logical.c
M src/backend/replication/logical/snapbuild.c
M src/backend/rewrite/rewriteHandler.c
M src/backend/utils/adt/json.c
M src/backend/utils/time/tqual.c

Fix bug in clean shutdown of walsender that pg_receiving is connecting to.

commit   : 5c6d9fc4b2b8b6688a482a4b4116d7642e36b9d9    
  
author   : Fujii Masao <[email protected]>    
date     : Mon, 17 Mar 2014 20:37:50 +0900    
  
committer: Fujii Masao <[email protected]>    
date     : Mon, 17 Mar 2014 20:37:50 +0900    

Click here for diff

On clean shutdown, walsender waits for all WAL to be replicated to a standby,  
and exits. It determined whether that replication had been completed by  
checking whether its sent location had been equal to a standby's flush  
location. Unfortunately this condition never becomes true when the standby  
such as pg_receivexlog which always returns an invalid flush location is  
connecting to walsender, and then walsender waits forever.  
  
This commit changes walsender so that it just checks a standby's write  
location if a flush location is invalid.  
  
Back-patch to 9.1 where enough infrastructure for this exists.  

M src/backend/replication/walsender.c

Fix small typo in comment

commit   : 02703ff2277791a7f1bccf61124bee830f2b5fcb    
  
author   : Magnus Hagander <[email protected]>    
date     : Mon, 17 Mar 2014 09:09:21 +0100    
  
committer: Magnus Hagander <[email protected]>    
date     : Mon, 17 Mar 2014 09:09:21 +0100    

Click here for diff

Michael Paquier  

M src/include/access/nbtree.h

plperl: Fix memory leak in hek2cstr

commit   : bd1154edec5484390d7dcd05d12287ccc81c30e8    
  
author   : Alvaro Herrera <[email protected]>    
date     : Sun, 16 Mar 2014 23:22:21 -0300    
  
committer: Alvaro Herrera <[email protected]>    
date     : Sun, 16 Mar 2014 23:22:21 -0300    

Click here for diff

Backpatch all the way back to 9.1, where it was introduced by commit  
50d89d42.  
  
Reported by Sergey Burladyan in #9223  
Author: Alex Hunsaker  

M src/pl/plperl/plperl.c

Fix unportable shell-script syntax in pg_upgrade's test.sh.

commit   : 0268d21e5d3c732bf5543d68a6d870e4eee7e673    
  
author   : Tom Lane <[email protected]>    
date     : Sun, 16 Mar 2014 21:55:02 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Sun, 16 Mar 2014 21:55:02 -0400    

Click here for diff

I discovered the hard way that on some old shells, the locution  
    FOO=""   unset FOO  
does not behave the same as  
    FOO="";  unset FOO  
and in fact leaves FOO set to an empty string.  test.sh was inconsistently  
spelling it different ways on adjacent lines.  
  
This got broken relatively recently, in commit c737a2e56, so the lack of  
field reports to date doesn't represent a lot of evidence that the problem  
is rare.  

M contrib/pg_upgrade/test.sh

Make punctuation consistent

commit   : 2861e8e9cb7bcf7ca7839378743a4a881b67edcf    
  
author   : Peter Eisentraut <[email protected]>    
date     : Sun, 16 Mar 2014 21:44:58 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Sun, 16 Mar 2014 21:44:58 -0400    

Click here for diff

M src/backend/utils/misc/guc.c

Fix whitespace

commit   : e2b959478c97a53c93bea7c695a3684db1c084d7    
  
author   : Peter Eisentraut <[email protected]>    
date     : Sun, 16 Mar 2014 21:43:59 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Sun, 16 Mar 2014 21:43:59 -0400    

Click here for diff

M src/backend/storage/ipc/dsm_impl.c

Fix advertised dispsize for libpq's sslmode connection parameter.

commit   : f4051e363c1757a5fa05825a361d9dd0e54508bc    
  
author   : Tom Lane <[email protected]>    
date     : Sun, 16 Mar 2014 21:43:40 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Sun, 16 Mar 2014 21:43:40 -0400    

Click here for diff

"8" was correct back when "disable" was the longest allowed value, but  
since "verify-full" was added, it should be "12".  Given the lack of  
complaints, I wouldn't be surprised if nobody is actually using these  
values ... but still, if they're in the API, they should be right.  
  
Noticed while pursuing a different problem.  It's been wrong for quite  
a long time, so back-patch to all supported branches.  

M src/interfaces/libpq/fe-connect.c

Cleanups from the remove-native-krb5 patch

commit   : 0294023a6b1c5df7683707a77238ab634d4ea8c1    
  
author   : Magnus Hagander <[email protected]>    
date     : Sun, 16 Mar 2014 15:18:52 +0100    
  
committer: Magnus Hagander <[email protected]>    
date     : Sun, 16 Mar 2014 15:18:52 +0100    

Click here for diff

krb_srvname is actually not available anymore as a parameter server-side, since  
with gssapi we accept all principals in our keytab. It's still used in libpq for  
client side specification.  
  
In passing remove declaration of krb_server_hostname, where all the functionality  
was already removed.  
  
Noted by Stephen Frost, though a different solution than his suggestion  

M doc/src/sgml/client-auth.sgml
M doc/src/sgml/config.sgml
M src/backend/libpq/auth.c
M src/backend/utils/misc/guc.c
M src/backend/utils/misc/postgresql.conf.sample
M src/include/libpq/auth.h
M src/include/libpq/hba.h

First-draft release notes for 9.3.4.

commit   : e3c9f23250fc445568b2aefab8bcdc25371cff5b    
  
author   : Tom Lane <[email protected]>    
date     : Sat, 15 Mar 2014 15:58:59 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Sat, 15 Mar 2014 15:58:59 -0400    

Click here for diff

As usual, the release notes for older branches will be made by cutting  
these down, but put them up for community review first.  

M doc/src/sgml/release-9.3.sgml

Update time zone data files to tzdata release 2014a.

commit   : aba7f56779f9ca231f6b612f1566771e3a9380e8    
  
author   : Tom Lane <[email protected]>    
date     : Sat, 15 Mar 2014 13:36:07 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Sat, 15 Mar 2014 13:36:07 -0400    

Click here for diff

DST law changes in Fiji, Turkey; historical changes in Israel, Ukraine.  

M src/timezone/data/asia
M src/timezone/data/australasia
M src/timezone/data/europe
M src/timezone/data/northamerica
M src/timezone/data/southamerica

Fix race condition in B-tree page deletion.

commit   : efada2b8e920adfdf7418862e939925d2acd1b89    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Fri, 14 Mar 2014 15:43:58 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Fri, 14 Mar 2014 15:43:58 +0200    

Click here for diff

In short, we don't allow a page to be deleted if it's the rightmost child  
of its parent, but that situation can change after we check for it.  
  
Problem  
-------  
  
We check that the page to be deleted is not the rightmost child of its  
parent, and then lock its left sibling, the page itself, its right sibling,  
and the parent, in that order. However, if the parent page is split after  
the check but before acquiring the locks, the target page might become the  
rightmost child, if the split happens at the right place. That leads to an  
error in vacuum (I reproduced this by setting a breakpoint in debugger):  
  
ERROR:  failed to delete rightmost child 41 of block 3 in index "foo_pkey"  
  
We currently re-check that the page is still the rightmost child, and throw  
the above error if it's not. We could easily just give up rather than throw  
an error, but that approach doesn't scale to half-dead pages. To recap,  
although we don't normally allow deleting the rightmost child, if the page  
is the *only* child of its parent, we delete the child page and mark the  
parent page as half-dead in one atomic operation. But before we do that, we  
check that the parent can later be deleted, by checking that it in turn is  
not the rightmost child of the grandparent (potentially recursing all the  
way up to the root). But the same situation can arise there - the  
grandparent can be split while we're not holding the locks. We end up with  
a half-dead page that we cannot delete.  
  
To make things worse, the keyspace of the deleted page has already been  
transferred to its right sibling. As the README points out, the keyspace at  
the grandparent level is "out-of-whack" until the half-dead page is deleted,  
and if enough tuples with keys in the transferred keyspace are inserted, the  
page might get split and a downlink might be inserted into the grandparent  
that is out-of-order. That might not cause any serious problem if it's  
transient (as the README ponders), but is surely bad if it stays that way.  
  
Solution  
--------  
  
This patch changes the page deletion algorithm to avoid that problem. After  
checking that the topmost page in the chain of to-be-deleted pages is not  
the rightmost child of its parent, and then deleting the pages from bottom  
up, unlink the pages from top to bottom. This way, the intermediate stages  
are similar to the intermediate stages in page splitting, and there is no  
transient stage where the keyspace is "out-of-whack". The topmost page in  
the to-be-deleted chain doesn't have a downlink pointing to it, like a page  
split before the downlink has been inserted.  
  
This also allows us to get rid of the cleanup step after WAL recovery, if we  
crash during page deletion. The deletion will be continued at next VACUUM,  
but the tree is consistent for searches and insertions at every step.  
  
This bug is old, all supported versions are affected, but this patch is too  
big to back-patch (and changes the WAL record formats of related records).  
We have not heard any reports of the bug from users, so clearly it's not  
easy to bump into. Maybe backpatch later, after this has had some field  
testing.  
  
Reviewed by Kevin Grittner and Peter Geoghegan.  

M src/backend/access/nbtree/README
M src/backend/access/nbtree/nbtpage.c
M src/backend/access/nbtree/nbtree.c
M src/backend/access/nbtree/nbtxlog.c
M src/backend/access/rmgrdesc/nbtdesc.c
M src/include/access/nbtree.h
M src/include/access/xlog_internal.h

Prevent interrupts while reporting non-ERROR elog messages.

commit   : 6c461cb92f295788446fbd5659b92e279244c725    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 13 Mar 2014 20:59:42 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 13 Mar 2014 20:59:42 -0400    

Click here for diff

This should eliminate the risk of recursive entry to syslog(3), which  
appears to be the cause of the hang reported in bug #9551 from James  
Morton.  
  
Arguably, the real problem here is auth.c's willingness to turn on  
ImmediateInterruptOK while executing fairly wide swaths of backend code.  
We may well need to work at narrowing the code ranges in which the  
authentication_timeout interrupt is enabled.  For the moment, though,  
this is a cheap and reasonably noninvasive fix for a field-reported  
failure; the other approach would be complex and not necessarily  
bug-free itself.  
  
Back-patch to all supported branches.  

M src/backend/utils/error/elog.c

Allow psql to print COPY command status in more cases.

commit   : f70a78bc1f5556546d809a8164b9ba6a907f266f    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 13 Mar 2014 13:49:03 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 13 Mar 2014 13:49:03 -0400    

Click here for diff

Previously, psql would print the "COPY nnn" command status only for COPY  
commands executed server-side.  Now it will print that for frontend copies  
too (including \copy).  However, we continue to suppress the command status  
for COPY TO STDOUT, since in that case the copy data has been routed to the  
same place that the command status would go, and there is a risk of the  
status line being mistaken for another line of COPY data.  Doing that would  
break existing scripts, and it doesn't seem worth the benefit --- this case  
seems fairly analogous to SELECT, for which we also suppress the command  
status.  
  
Kumar Rajeev Rastogi, with substantial review by Amit Khandekar  

M doc/src/sgml/ref/copy.sgml
M doc/src/sgml/ref/psql-ref.sgml
M src/bin/psql/common.c
M src/bin/psql/copy.c
M src/bin/psql/copy.h

Avoid transaction-commit race condition while receiving a NOTIFY message.

commit   : 7bae0284eeb0863220260e0d5ac80f0b37053690    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 13 Mar 2014 12:02:54 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 13 Mar 2014 12:02:54 -0400    

Click here for diff

Use TransactionIdIsInProgress, then TransactionIdDidCommit, to distinguish  
whether a NOTIFY message's originating transaction is in progress,  
committed, or aborted.  The previous coding could accept a message from a  
transaction that was still in-progress according to the PGPROC array;  
if the client were fast enough at starting a new transaction, it might fail  
to see table rows added/updated by the message-sending transaction.  Which  
of course would usually be the point of receiving the message.  We noted  
this type of race condition long ago in tqual.c, but async.c overlooked it.  
  
The race condition probably cannot occur unless there are multiple NOTIFY  
senders in action, since an individual backend doesn't send NOTIFY signals  
until well after it's done committing.  But if two senders commit in close  
succession, it's certainly possible that we could see the second sender's  
message within the race condition window while responding to the signal  
from the first one.  
  
Per bug #9557 from Marko Tiikkaja.  This patch is slightly more invasive  
than what he proposed, since it removes the now-redundant  
TransactionIdDidAbort call.  
  
Back-patch to 9.0, where the current NOTIFY implementation was introduced.  

M src/backend/commands/async.c

Fix a couple of typos in docs.

commit   : 16ff08b79443cb1a9963e77530b307156d904d8b    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Thu, 13 Mar 2014 15:01:45 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Thu, 13 Mar 2014 15:01:45 +0200    

Click here for diff

Thom Brown  

M doc/src/sgml/gin.sgml

C comments: remove odd blank lines after #ifdef WIN32 lines

commit   : 242c2737fbec05a756e516f6e2fec4b739cc49d1    
  
author   : Bruce Momjian <[email protected]>    
date     : Thu, 13 Mar 2014 01:42:24 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Thu, 13 Mar 2014 01:42:24 -0400    

Click here for diff

A few more  

M src/backend/utils/mb/mbutils.c
M src/bin/initdb/initdb.c
M src/bin/pg_resetxlog/pg_resetxlog.c
M src/common/pgfnames.c
M src/port/pgcheckdir.c

C comments: remove odd blank lines after #ifdef WIN32 lines

commit   : 886c0be3f65bdbb68e86ec2d66a8c1a4c34b2923    
  
author   : Bruce Momjian <[email protected]>    
date     : Thu, 13 Mar 2014 01:34:42 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Thu, 13 Mar 2014 01:34:42 -0400    

Click here for diff

M src/backend/access/transam/xlog.c
M src/backend/libpq/pqcomm.c
M src/backend/main/main.c
M src/backend/postmaster/postmaster.c
M src/backend/storage/file/fd.c
M src/backend/utils/adt/pg_locale.c
M src/backend/utils/adt/selfuncs.c
M src/backend/utils/error/elog.c
M src/bin/initdb/initdb.c
M src/interfaces/libpq/fe-connect.c
M src/pl/plperl/plperl.c
M src/port/getaddrinfo.c
M src/port/getrusage.c
M src/port/path.c
M src/port/sprompt.c
M src/test/regress/pg_regress.c
M src/timezone/zic.c

Only WAL-log the modified portion in an UPDATE, if possible.

commit   : a3115f0d9ec1ac93b82156535dc00b10172a4fe7    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Wed, 12 Mar 2014 22:46:04 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Wed, 12 Mar 2014 22:46:04 +0200    

Click here for diff

When a row is updated, and the new tuple version is put on the same page as  
the old one, only WAL-log the part of the new tuple that's not identical to  
the old. This saves significantly on the amount of WAL that needs to be  
written, in the common case that most fields are not modified.  
  
Amit Kapila, with a lot of back and forth with me, Robert Haas, and others.  

M src/backend/access/heap/heapam.c
M src/backend/access/transam/xlog.c
M src/include/access/heapam_xlog.h
M src/include/access/xlog.h

Items on GIN data pages are no longer always 6 bytes; update gincostestimate.

commit   : 17d787a3b160eefb2ff4a3fdf12ca1fedc02cbc1    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Wed, 12 Mar 2014 20:43:07 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Wed, 12 Mar 2014 20:43:07 +0200    

Click here for diff

Also improve the comments a bit.  

M src/backend/utils/adt/selfuncs.c

Show PIDs of lock holders and waiters in log_lock_waits log message.

commit   : 588fb5071545ce6e8ffb6a88e146789560e6c879    
  
author   : Fujii Masao <[email protected]>    
date     : Thu, 13 Mar 2014 03:26:47 +0900    
  
committer: Fujii Masao <[email protected]>    
date     : Thu, 13 Mar 2014 03:26:47 +0900    

Click here for diff

Christian Kruse, reviewed by Kumar Rajeev Rastogi.  

M doc/src/sgml/sources.sgml
M src/backend/storage/lmgr/proc.c
M src/backend/utils/error/elog.c
M src/include/utils/elog.h

test_decoding: Documentation fix.

commit   : a0b4c355c2f4e26735d28372c49f4661621988f2    
  
author   : Robert Haas <[email protected]>    
date     : Wed, 12 Mar 2014 14:11:06 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Wed, 12 Mar 2014 14:11:06 -0400    

Click here for diff

Andres Freund  

M doc/src/sgml/test-decoding.sgml

Fix incorrect assertion about historical snapshots.

commit   : 336a578b8c8866490e0d9069f10c17ba14f4705a    
  
author   : Robert Haas <[email protected]>    
date     : Wed, 12 Mar 2014 14:07:41 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Wed, 12 Mar 2014 14:07:41 -0400    

Click here for diff

Also fix some nearby comments.  
  
Andres Freund  

M src/backend/utils/time/snapmgr.c

commit   : 890194f14d6ff6838d79215b8ba62786185aa9a2    
  
author   : Robert Haas <[email protected]>    
date     : Wed, 12 Mar 2014 14:03:09 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Wed, 12 Mar 2014 14:03:09 -0400    

Click here for diff

Andres Freund, per complaints by Peter Eisentraut.  

M contrib/test_decoding/test_decoding.c
M src/backend/replication/logical/logical.c

Allow opclasses to provide tri-valued GIN consistent functions.

commit   : c5608ea26a1f51998ad3cf987c3f0bda643c87a8    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Wed, 12 Mar 2014 17:13:22 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Wed, 12 Mar 2014 17:13:22 +0200    

Click here for diff

With the GIN "fast scan" feature, GIN can skip items without fetching all  
the keys for them, if it can prove that they don't match regardless of  
those keys. So far, it has done the proving by calling the boolean  
consistent function with all combinations of TRUE/FALSE for the unfetched  
keys, but since that's O(n^2), it becomes unfeasible with more than a few  
keys. We can avoid calling consistent with all the combinations, if we can  
tell the operator class implementation directly which keys are unknown.  
  
This commit includes a triConsistent function for the built-in array and  
tsvector opclasses.  
  
Alexander Korotkov, with some changes by me.  

M doc/src/sgml/gin.sgml
M doc/src/sgml/xindex.sgml
M src/backend/access/gin/ginarrayproc.c
M src/backend/access/gin/ginlogic.c
M src/backend/access/gin/ginutil.c
M src/backend/utils/adt/tsginidx.c
M src/include/access/gin.h
M src/include/access/gin_private.h
M src/include/catalog/catversion.h
M src/include/catalog/pg_am.h
M src/include/catalog/pg_amproc.h
M src/include/catalog/pg_proc.h
M src/include/tsearch/ts_utils.h
M src/include/utils/builtins.h
M src/test/regress/expected/opr_sanity.out
M src/test/regress/sql/opr_sanity.sql

In WAL replay, restore GIN metapage unconditionally to avoid torn page.

commit   : fecfc2b913c4be5eeed24b32ef51a3239580bd1e    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Wed, 12 Mar 2014 09:59:49 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Wed, 12 Mar 2014 09:59:49 +0200    

Click here for diff

We don't take a full-page image of the GIN metapage; instead, the WAL record  
contains all the information required to reconstruct it from scratch. But  
to avoid torn page hazards, we must re-initialize it from the WAL record  
every time, even if it already has a greater LSN, similar to how normal full  
page images are restored.  
  
This was highly unlikely to cause any problems in practice, because the GIN  
metapage is small. We rely on an update smaller than a 512 byte disk sector  
to be atomic elsewhere, at least in pg_control. But better safe than sorry,  
and this would be easy to overlook if more fields are added to the metapage  
so that it's no longer small.  
  
Reported by Noah Misch. Backpatch to all supported versions.  

M src/backend/access/gin/ginxlog.c

Fix tracking of psql script line numbers during \copy from another place.

commit   : e85a5ffba8ae559b612b6fbc07acf1b16636887e    
  
author   : Tom Lane <[email protected]>    
date     : Mon, 10 Mar 2014 15:47:06 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Mon, 10 Mar 2014 15:47:06 -0400    

Click here for diff

Commit 08146775acd8bfe0fcc509c71857abb928697171 changed do_copy() to  
temporarily scribble on pset.cur_cmd_source.  That was a mighty ugly bit of  
code in any case, but in particular it broke handleCopyIn's ability to tell  
whether it was reading from the current script source file (in which case  
pset.lineno should be incremented for each line of COPY data), or from  
someplace else (in which case it shouldn't).  The former case still worked,  
the latter not so much.  The visible effect was that line numbers reported  
for errors in a script file would be wrong if there were an earlier \copy  
that was reading anything other than inline-in-the-script-file data.  
  
To fix, introduce another pset field that holds the file do_copy wants the  
COPY code to use.  This is a little bit ugly, but less so than passing the  
file down explicitly through several layers that aren't COPY-specific.  
  
Extracted from a larger patch by Kumar Rajeev Rastogi; that patch also  
changes printing of COPY command tags, which is not a bug fix and shouldn't  
get back-patched.  This particular idea was from a suggestion by Amit  
Khandekar, if I'm reading the thread correctly.  
  
Back-patch to 9.2 where the faulty code was introduced.  

M src/bin/psql/common.c
M src/bin/psql/copy.c
M src/bin/psql/settings.h
M src/bin/psql/startup.c

Allow dynamic shared memory segments to be kept until shutdown.

commit   : 8722017bbcbc95e311bbaa6d21cd028e296e5e35    
  
author   : Robert Haas <[email protected]>    
date     : Mon, 10 Mar 2014 14:04:47 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Mon, 10 Mar 2014 14:04:47 -0400    

Click here for diff

Amit Kapila, reviewed by Kyotaro Horiguchi, with some further  
changes by me.  

M src/backend/storage/ipc/dsm.c
M src/backend/storage/ipc/dsm_impl.c
M src/include/storage/dsm.h
M src/include/storage/dsm_impl.h

Allow logical decoding via the walsender interface.

commit   : 5a991ef8692ed0d170b44958a81a6bd70e90585c    
  
author   : Robert Haas <[email protected]>    
date     : Mon, 10 Mar 2014 13:50:28 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Mon, 10 Mar 2014 13:50:28 -0400    

Click here for diff

In order for this to work, walsenders need the optional ability to  
connect to a database, so the "replication" keyword now allows true  
or false, for backward-compatibility, and the new value "database"  
(which causes the "dbname" parameter to be respected).  
  
walsender needs to loop not only when idle but also when sending  
decoded data to the user and when waiting for more xlog data to decode.  
This means that there are now three separate loops inside walsender.c;  
although some refactoring has been done here, this is still a bit ugly.  
  
Andres Freund, with contributions from Álvaro Herrera, and further  
review by me.  

M doc/src/sgml/protocol.sgml
M src/backend/postmaster/postmaster.c
M src/backend/replication/libpqwalreceiver/libpqwalreceiver.c
M src/backend/replication/repl_gram.y
M src/backend/replication/repl_scanner.l
M src/backend/replication/walsender.c
M src/backend/utils/init/postinit.c
M src/bin/pg_basebackup/pg_basebackup.c
M src/bin/pg_basebackup/pg_receivexlog.c
M src/bin/pg_basebackup/receivelog.c
M src/include/replication/walsender.h
M src/tools/pgindent/typedefs.list

Teach on_exit_reset() to discard pending cleanups for dsm.

commit   : cb9a0c7987466b130fbced01ab5d5481cf3a16df    
  
author   : Robert Haas <[email protected]>    
date     : Mon, 10 Mar 2014 10:17:19 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Mon, 10 Mar 2014 10:17:19 -0400    

Click here for diff

If a postmaster child invokes fork() and then calls on_exit_reset, that  
should be sufficient to let it exit() without breaking anything, but  
dynamic shared memory broke that by not updating on_exit_reset() to  
discard callbacks registered with dynamic shared memory segments.  
  
Per investigation of a complaint from Tom Lane.  

M src/backend/storage/ipc/dsm.c
M src/backend/storage/ipc/ipc.c
M src/include/storage/dsm.h

Correct copy/pasto in comment for REPLICA IDENTITY

commit   : 77049443a1794bc5222aabb051476367fe347202    
  
author   : Simon Riggs <[email protected]>    
date     : Sun, 9 Mar 2014 09:05:16 +0000    
  
committer: Simon Riggs <[email protected]>    
date     : Sun, 9 Mar 2014 09:05:16 +0000    

Click here for diff

M src/bin/pg_dump/pg_dump.c

doc: remove extra whitespace in SGML markup

commit   : 19026aadd82a18f86252415c9d2adeeaa1377b7d    
  
author   : Bruce Momjian <[email protected]>    
date     : Sat, 8 Mar 2014 17:08:01 -0500    
  
committer: Bruce Momjian <[email protected]>    
date     : Sat, 8 Mar 2014 17:08:01 -0500    

Click here for diff

M doc/src/sgml/func.sgml

C comments: improve description of relfilenode uniqueness

commit   : 5024044a204ea4158c9223b28a31f60afc1e759f    
  
author   : Bruce Momjian <[email protected]>    
date     : Sat, 8 Mar 2014 12:20:30 -0500    
  
committer: Bruce Momjian <[email protected]>    
date     : Sat, 8 Mar 2014 12:20:30 -0500    

Click here for diff

Report by Antonin Houska  

M src/backend/catalog/catalog.c
M src/backend/commands/tablecmds.c
M src/include/storage/relfilenode.h

pg_ctl: improve handling of invalid data directory

commit   : 11d205e2bd66cefe0b7d69c02e831cd055cbb5bb    
  
author   : Bruce Momjian <[email protected]>    
date     : Sat, 8 Mar 2014 12:15:25 -0500    
  
committer: Bruce Momjian <[email protected]>    
date     : Sat, 8 Mar 2014 12:15:25 -0500    

Click here for diff

Return '4' and report a meaningful error message when a non-existent or  
invalid data directory is passed.  Previously, pg_ctl would just report  
the server was not running.  
  
Patch by me and Amit Kapila  
Report from Peter Eisentraut  

M doc/src/sgml/ref/pg_ctl-ref.sgml
M src/bin/pg_ctl/pg_ctl.c

docs: small adjustements to recent SELECT and pg_upgrade improvements

commit   : 3624acd342d7b5ad6bb07730b8bac5ed5874fc23    
  
author   : Bruce Momjian <[email protected]>    
date     : Sat, 8 Mar 2014 11:26:47 -0500    
  
committer: Bruce Momjian <[email protected]>    
date     : Sat, 8 Mar 2014 11:26:47 -0500    

Click here for diff

M doc/src/sgml/pgupgrade.sgml
M doc/src/sgml/ref/select.sgml

pg_upgrade: document delete problems with tablespaces inside the cluster directory

commit   : 8879fa09ee7aa6232097198b66c3376184b0de06    
  
author   : Bruce Momjian <[email protected]>    
date     : Fri, 7 Mar 2014 22:46:38 -0500    
  
committer: Bruce Momjian <[email protected]>    
date     : Fri, 7 Mar 2014 22:46:38 -0500    

Click here for diff

Per report by Marc Mamin  

M doc/src/sgml/pgupgrade.sgml

doc: improve server's keepalive description

commit   : ea43af38dc90d1656e67d7fbdbc809385c380435    
  
author   : Bruce Momjian <[email protected]>    
date     : Fri, 7 Mar 2014 22:02:38 -0500    
  
committer: Bruce Momjian <[email protected]>    
date     : Fri, 7 Mar 2014 22:02:38 -0500    

Click here for diff

Use superior libpq keepalive description for the server-level  
parameters.  
  
Per report by Tatsuo Ishii and Marko Tiikkaja  

M doc/src/sgml/config.sgml

docs: improve TABLE command by showing supported clauses

commit   : b0cb40f93a85fd15e930828d9336e9f999ca3224    
  
author   : Bruce Momjian <[email protected]>    
date     : Fri, 7 Mar 2014 20:56:00 -0500    
  
committer: Bruce Momjian <[email protected]>    
date     : Fri, 7 Mar 2014 20:56:00 -0500    

Click here for diff

Initial patch by Colin 't Hart  

M doc/src/sgml/ref/select.sgml

Remove unportable use of anonymous unions from reorderbuffer.h.

commit   : ea177a3ba7a7901f6467eadb0a407e03d46462fd    
  
author   : Tom Lane <[email protected]>    
date     : Fri, 7 Mar 2014 17:02:48 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Fri, 7 Mar 2014 17:02:48 -0500    

Click here for diff

In b89e151054a I had assumed it was ok to use anonymous unions as  
struct members, but while a longstanding extension in many compilers,  
it's only been standardized in C11.  
  
To fix, remove one of the anonymous unions which tried to hide some  
implementation specific enum values and give the other a name. The  
latter unfortunately requires changes in output plugins, but since the  
feature has only been added a few days ago...  
  
Andres Freund  

M contrib/test_decoding/test_decoding.c
M src/backend/replication/logical/decode.c
M src/backend/replication/logical/reorderbuffer.c
M src/include/replication/reorderbuffer.h

Fix contrib/postgres_fdw to handle multiple join conditions properly.

commit   : 83204e100c7855a50ccffd761bcd45474955b5fb    
  
author   : Tom Lane <[email protected]>    
date     : Fri, 7 Mar 2014 16:35:58 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Fri, 7 Mar 2014 16:35:58 -0500    

Click here for diff

The previous coding supposed that it could consider just a single join  
condition in any one parameterized path for the foreign table.  But in  
reality, the parameterized-path machinery forces all join clauses that are  
"movable to" the foreign table to be evaluated at that node; including  
clauses that we might not consider safe to send across.  Such cases would  
result in an Assert failure in an assert-enabled build, and otherwise in  
sending an unsafe clause to the foreign server, which might result in  
errors or silently-wrong answers.  A lesser problem was that the  
cost/rowcount estimates generated for the parameterized path failed to  
account for any additional join quals that get assigned to the scan.  
  
To fix, rewrite postgresGetForeignPaths so that it correctly collects all  
the movable quals for any one outer relation when generating parameterized  
paths; we'll now generate just one path per outer relation not one per join  
qual.  Also fix bogus assumptions in postgresGetForeignPlan and  
estimate_path_cost_size that only safe-to-send join quals will be  
presented.  
  
Based on complaint from Etsuro Fujita that the path costs were being  
miscalculated, though this is significantly different from his proposed  
patch.  

M contrib/postgres_fdw/deparse.c
M contrib/postgres_fdw/expected/postgres_fdw.out
M contrib/postgres_fdw/postgres_fdw.c
M contrib/postgres_fdw/postgres_fdw.h
M contrib/postgres_fdw/sql/postgres_fdw.sql

release notes: add item missed in 9.2.5 release

commit   : 4ea2e2d47449dac509327c2c0c4b22223bfe3faa    
  
author   : Bruce Momjian <[email protected]>    
date     : Fri, 7 Mar 2014 13:45:38 -0500    
  
committer: Bruce Momjian <[email protected]>    
date     : Fri, 7 Mar 2014 13:45:38 -0500    

Click here for diff

Item is "Prevent errors in WAL replay due to references to uninitialized  
empty pages".  
  
Report and text by Andres Freund  
  
Backpatch through 9.2.  

M doc/src/sgml/release-9.2.sgml

fix ReplicationSlotsCountDBSlots for dropping unrelated databases

commit   : 91d9de97518b26a1e0d601b2c1580f5225030e56    
  
author   : Bruce Momjian <[email protected]>    
date     : Fri, 7 Mar 2014 11:42:18 -0500    
  
committer: Bruce Momjian <[email protected]>    
date     : Fri, 7 Mar 2014 11:42:18 -0500    

Click here for diff

YAMAMOTO Takashi  

M src/backend/replication/slot.c

Fix dangling smgr_owner pointer when a fake relcache entry is freed.

commit   : 55566c9a740144439b54ff3aacbd43d11b6de52f    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Fri, 7 Mar 2014 13:25:11 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Fri, 7 Mar 2014 13:25:11 +0200    

Click here for diff

A fake relcache entry can "own" a SmgrRelation object, like a regular  
relcache entry. But when it was free'd, the owner field in SmgrRelation  
was not cleared, so it was left pointing to free'd memory.  
  
Amazingly this apparently hasn't caused crashes in practice, or we would've  
heard about it earlier. Andres found this with Valgrind.  
  
Report and fix by Andres Freund, with minor modifications by me. Backpatch  
to all supported versions.  

M src/backend/access/transam/xlogutils.c
M src/backend/storage/smgr/smgr.c
M src/include/storage/smgr.h

Avoid memcpy() with same source and destination address.

commit   : ad7b48ea08d6c33bae0a33c5f2a06272293c0f2f    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Fri, 7 Mar 2014 13:13:33 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Fri, 7 Mar 2014 13:13:33 +0200    

Click here for diff

The behavior of that is undefined, although unlikely to lead to problems in  
practice.  
  
Found by running regression tests with Valgrind.  

M src/backend/tsearch/dict_ispell.c
M src/backend/utils/adt/tsvector.c

Fix name of syslog_ident GUC in docs.

commit   : 2b8483d69d1be9700abae0dc7c48c5b7edb77498    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Fri, 7 Mar 2014 10:35:37 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Fri, 7 Mar 2014 10:35:37 +0200    

Click here for diff

Michael Paquier  

M doc/src/sgml/config.sgml

Avoid getting more than AccessShareLock when deparsing a query.

commit   : 7c31874945120c0a263c5d0fe15ab362e6e5c99d    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 6 Mar 2014 19:31:05 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 6 Mar 2014 19:31:05 -0500    

Click here for diff

In make_ruledef and get_query_def, we have long used AcquireRewriteLocks  
to ensure that the querytree we are about to deparse is up-to-date and  
the schemas of the underlying relations aren't changing.  Howwever, that  
function thinks the query is about to be executed, so it acquires locks  
that are stronger than necessary for the purpose of deparsing.  Thus for  
example, if pg_dump asks to deparse a rule that includes "INSERT INTO t",  
we'd acquire RowExclusiveLock on t.  That results in interference with  
concurrent transactions that might for example ask for ShareLock on t.  
Since pg_dump is documented as being purely read-only, this is unexpected.  
(Worse, it used to actually be read-only; this behavior dates back only  
to 8.1, cf commit ba4200246.)  
  
Fix this by adding a parameter to AcquireRewriteLocks to tell it whether  
we want the "real" execution locks or only AccessShareLock.  
  
Report, diagnosis, and patch by Dean Rasheed.  Back-patch to all supported  
branches.  

M src/backend/commands/matview.c
M src/backend/rewrite/rewriteHandler.c
M src/backend/utils/adt/ruleutils.c
M src/include/rewrite/rewriteHandler.h

isdigit() needs an unsigned char argument.

commit   : a0c2fa9b5cfaf9595e8809a68eec929a5052834e    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Thu, 6 Mar 2014 21:19:00 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Thu, 6 Mar 2014 21:19:00 +0200    

Click here for diff

Per the C standard, the routine should be passed an int, with a value that's  
representable as an unsigned char or EOF. Passing a signed char is wrong,  
because a negative value is not representable as an unsigned char.  
Unfortunately no compiler warns about that.  

M src/backend/utils/adt/timestamp.c

Send keepalives from walsender even when busy sending WAL.

commit   : 94ae6ba74dfc626efa271461902db1be35d2a551    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Thu, 6 Mar 2014 21:13:38 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Thu, 6 Mar 2014 21:13:38 +0200    

Click here for diff

If walsender doesn't hear from the client for the time specified by  
wal_sender_timeout, it will conclude the connection or client is dead, and  
disconnect. When half of wal_sender_timeout has elapsed, it sends a ping  
to the client, leaving it the remainig half of wal_sender_timeout to  
respond. However, it only checked if half of wal_sender_timeout had elapsed  
when it was about to sleep, so if it was busy sending WAL to the client for  
long enough, it would not send the ping request in time. Then the client  
would not know it needs to send a reply, and the walsender will disconnect  
even though the client is still alive. Fix that.  
  
Andres Freund, reviewed by Robert Haas, and some further changes by me.  
Backpatch to 9.3. Earlier versions relied on the client to send the  
keepalives on its own, and hence didn't have this problem.  

M src/backend/replication/walsender.c

Don't reject ROW_MARK_REFERENCE rowmarks for materialized views.

commit   : bf4052faa1c289883799d49f063715161a8a4f1e    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 6 Mar 2014 11:37:02 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 6 Mar 2014 11:37:02 -0500    

Click here for diff

We should allow this so that matviews can be referenced in UPDATE/DELETE  
statements in READ COMMITTED isolation level.  The requirement for that  
is that a re-fetch by TID will see the same row version the query saw  
earlier, which is true of matviews, so there's no reason for the  
restriction.  Per bug #9398.  
  
Michael Paquier, after a suggestion by me  

M src/backend/executor/execMain.c
M src/test/regress/expected/matview.out
M src/test/regress/sql/matview.sql

C comment update: relfilenode is only unique with a tablespace

commit   : 0024a3a3b6cfdca9d5c00f8ac5d5809f2e7ec3a5    
  
author   : Bruce Momjian <[email protected]>    
date     : Wed, 5 Mar 2014 20:52:34 -0500    
  
committer: Bruce Momjian <[email protected]>    
date     : Wed, 5 Mar 2014 20:52:34 -0500    

Click here for diff

Report from Antonin Houska  

M src/include/storage/relfilenode.h

docs: to_timestamp and to_date do minimal range checking

commit   : e2224faf17abb6b3cde0af33346835cc013fb1c0    
  
author   : Bruce Momjian <[email protected]>    
date     : Wed, 5 Mar 2014 20:45:27 -0500    
  
committer: Bruce Momjian <[email protected]>    
date     : Wed, 5 Mar 2014 20:45:27 -0500    

Click here for diff

Initial patch from Steve Crawford  

M doc/src/sgml/func.sgml

pg_dump: make argument combination error exit code consistent

commit   : b44fc39fcecf58c1c93a322d71be2faee525853f    
  
author   : Bruce Momjian <[email protected]>    
date     : Wed, 5 Mar 2014 18:15:19 -0500    
  
committer: Bruce Momjian <[email protected]>    
date     : Wed, 5 Mar 2014 18:15:19 -0500    

Click here for diff

Per report from Pavel Golub  

M src/bin/pg_dump/pg_dump.c

Fix portability issues in recently added make_timestamp/make_interval code.

commit   : f1ba94bcd9717b94b36868d6905547e313f3a359    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 5 Mar 2014 16:42:18 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 5 Mar 2014 16:42:18 -0500    

Click here for diff

Explicitly reject infinity/NaN inputs, rather than just assuming that  
something else will do it for us.  Per buildfarm.  
  
While at it, make some over-parenthesized and under-legible code  
more readable.  

M src/backend/utils/adt/timestamp.c

Add comment that ec_relids excludes "child" EquivalenceClass members.

commit   : 8cf0ad1ea38db3e16ac04b408168df4c937862e6    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 5 Mar 2014 16:00:22 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 5 Mar 2014 16:00:22 -0500    

Click here for diff

This was already documented a few lines further down, but the comment  
just beside the field declaration could be misleading.  Per gripe  
from Kyotaro Horiguchi.  

M src/include/nodes/relation.h

Fix some typos introduced by the logical decoding patch.

commit   : 406a1a9ef0beb0a7e3f58805ab2d3140e2202deb    
  
author   : Robert Haas <[email protected]>    
date     : Wed, 5 Mar 2014 13:00:22 -0500    
  
committer: Robert Haas <[email protected]>    
date     : Wed, 5 Mar 2014 13:00:22 -0500    

Click here for diff

Erik Rijkers  

M src/backend/replication/logical/decode.c
M src/backend/replication/logical/logical.c
M src/backend/replication/logical/reorderbuffer.c
M src/backend/storage/ipc/procarray.c

Fix test_decoding regression test outputs.

commit   : 97e899e1b85c7e42ab29cd09fc91cf57760bc1cb    
  
author   : Robert Haas <[email protected]>    
date     : Wed, 5 Mar 2014 12:55:43 -0500    
  
committer: Robert Haas <[email protected]>    
date     : Wed, 5 Mar 2014 12:55:43 -0500    

Click here for diff

Commit 6f37c08057685ee3c6c63222dba0dac012760dde removed whitespace  
from the SQL file but not the expected-output file, and commit  
7e8db2dc420099df3fa73987cf2d2d6d1a609d86 changed the error message  
without updating the expected outputs.  

M contrib/test_decoding/expected/binary.out
M contrib/test_decoding/expected/ddl.out

Remove unused field "evttype".

commit   : 114b26c06fb93d74afd6993d4be49b5b3e960979    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 5 Mar 2014 11:57:53 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 5 Mar 2014 11:57:53 -0500    

Click here for diff

Apparent oversight in commit 3855968f.  

M src/bin/pg_dump/pg_dump.h

Remove the correct pgstat file on DROP DATABASE

commit   : 2b4f2ab33dea09e47b93a2eb4be05aa4d40b49ee    
  
author   : Alvaro Herrera <[email protected]>    
date     : Wed, 5 Mar 2014 13:03:29 -0300    
  
committer: Alvaro Herrera <[email protected]>    
date     : Wed, 5 Mar 2014 13:03:29 -0300    

Click here for diff

We were unlinking the permanent file, not the non-permanent one.  But  
since the stat collector already unlinks all permanent files on startup,  
there was nothing for it to unlink.  The non-permanent file remained in  
place, and was copied to the permanent directory on shutdown, so in  
effect no file was ever dropped.  
  
Backpatch to 9.3, where the issue was introduced by commit 187492b6c2e8.  
Before that, there were no per-database files and thus no file to drop  
on DROP DATABASE.  
  
Per report from Thom Brown.  
  
Author: Tomáš Vondra  

M src/backend/postmaster/pgstat.c

pg_upgrade: improve C comment about what old/new oids match

commit   : 65b96714118d3919195d2dd47e8d2df23718c7ab    
  
author   : Bruce Momjian <[email protected]>    
date     : Wed, 5 Mar 2014 10:43:45 -0500    
  
committer: Bruce Momjian <[email protected]>    
date     : Wed, 5 Mar 2014 10:43:45 -0500    

Click here for diff

M contrib/pg_upgrade/pg_upgrade.c

Allocate fresh memory for post_opts/exec_path

commit   : dd917bb793b27f8c7616f0e64f9a119e8d98eb24    
  
author   : Stephen Frost <[email protected]>    
date     : Wed, 5 Mar 2014 08:50:12 -0500    
  
committer: Stephen Frost <[email protected]>    
date     : Wed, 5 Mar 2014 08:50:12 -0500    

Click here for diff

Instead of having read_post_opts() depend on the memory allocated for  
the config file (which is now getting free'd), pg_strdup() for  
post_opts and exec_path (similar to how it's being done elsewhere).  
  
Noted by Thom Brown.  

M src/bin/pg_ctl/pg_ctl.c

Do wal_level and hot standby checks when doing crash-then-archive recovery.

commit   : 956685f82b6983ff17e6a39bd386b11f554715a8    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Wed, 5 Mar 2014 14:41:55 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Wed, 5 Mar 2014 14:41:55 +0200    

Click here for diff

CheckRequiredParameterValues() should perform the checks if archive recovery  
was requested, even if we are going to perform crash recovery first.  
  
Reported by Kyotaro HORIGUCHI. Backpatch to 9.2, like the crash-then-archive  
recovery mode.  

M src/backend/access/transam/xlog.c

Fix lastReplayedEndRecPtr calculation when starting from shutdown checkpoint.

commit   : af246c37c056e3b16be04e899e94e3a100f3918e    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Wed, 5 Mar 2014 13:27:18 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Wed, 5 Mar 2014 13:27:18 +0200    

Click here for diff

When entering crash recovery followed by archive recovery, and the latest  
checkpoint is a shutdown checkpoint, and there are no more WAL records to  
replay before transitioning from crash to archive recovery, we would not  
immediately allow read-only connections in hot standby mode even if we  
could. That's because when starting from a shutdown checkpoint, we set  
lastReplayedEndRecPtr incorrectly to the record before the checkpoint  
record, instead of the checkpoint record itself. We don't run the redo  
routine of the shutdown checkpoint record, but starting recovery from it  
goes through the same motions, so it should be considered as replayed.  
  
Reported by Kyotaro HORIGUCHI. All versions with hot standby are affected,  
so backpatch to 9.0.  

M src/backend/access/transam/xlog.c

Fix issues with pg_ctl

commit   : eb933162cdcbcaa5c56c75eb21b9c055af9748a0    
  
author   : Stephen Frost <[email protected]>    
date     : Wed, 5 Mar 2014 01:30:03 -0500    
  
committer: Stephen Frost <[email protected]>    
date     : Wed, 5 Mar 2014 01:30:03 -0500    

Click here for diff

The new, small, free_readfile managed to have bug in it which could  
cause it to try and free something it shouldn't, and fix the case  
where it was being called with an invalid pointer leading to a  
segfault.  
  
Noted by Bruce, issues introduced and fixed by me.  

M src/bin/pg_ctl/pg_ctl.c

Fix whitespace

commit   : 6f37c08057685ee3c6c63222dba0dac012760dde    
  
author   : Peter Eisentraut <[email protected]>    
date     : Tue, 4 Mar 2014 21:53:25 -0500    
  
committer: Peter Eisentraut <[email protected]>    
date     : Tue, 4 Mar 2014 21:53:25 -0500    

Click here for diff

M contrib/test_decoding/sql/ddl.sql

Provide a FORCE NULL option to COPY in CSV mode.

commit   : 3b5e03dca2afea7a2c12dbc8605175d0568b5555    
  
author   : Andrew Dunstan <[email protected]>    
date     : Tue, 4 Mar 2014 17:31:59 -0500    
  
committer: Andrew Dunstan <[email protected]>    
date     : Tue, 4 Mar 2014 17:31:59 -0500    

Click here for diff

This forces an input field containing the quoted null string to be  
returned as a NULL. Without this option, only unquoted null strings  
behave this way. This helps where some CSV producers insist on quoting  
every field, whether or not it is needed. The option takes a list of  
fields, and only applies to those columns. There is an equivalent  
column-level option added to file_fdw.  
  
Ian Barwick, with some tweaking by Andrew Dunstan, reviewed by Payal  
Singh.  

M contrib/file_fdw/data/text.csv
M contrib/file_fdw/file_fdw.c
M contrib/file_fdw/input/file_fdw.source
M contrib/file_fdw/output/file_fdw.source
M doc/src/sgml/file-fdw.sgml
M doc/src/sgml/ref/copy.sgml
M src/backend/commands/copy.c
M src/backend/parser/gram.y
M src/test/regress/expected/copy2.out
M src/test/regress/sql/copy2.sql

auto_explain: Add logging of trigger execution

commit   : e2a0fc5363e293d29053d0582a1009bc9fef0276    
  
author   : Alvaro Herrera <[email protected]>    
date     : Tue, 4 Mar 2014 15:31:18 -0300    
  
committer: Alvaro Herrera <[email protected]>    
date     : Tue, 4 Mar 2014 15:31:18 -0300    

Click here for diff

Author: Kyotaro HORIGUCHI  
Reviewed-by: Jaime Casanova  

M contrib/auto_explain/auto_explain.c
M doc/src/sgml/auto-explain.sgml

Constructors for interval, timestamp, timestamptz

commit   : 84df54b22e8035addc7108abd9ff6995e8c49264    
  
author   : Alvaro Herrera <[email protected]>    
date     : Tue, 4 Mar 2014 15:09:43 -0300    
  
committer: Alvaro Herrera <[email protected]>    
date     : Tue, 4 Mar 2014 15:09:43 -0300    

Click here for diff

Author: Pavel Stěhule, editorialized somewhat by Álvaro Herrera  
Reviewed-by: Tomáš Vondra, Marko Tiikkaja  
With input from Fabrízio de Royes Mello, Jim Nasby  

M doc/src/sgml/func.sgml
M src/backend/catalog/system_views.sql
M src/backend/utils/adt/datetime.c
M src/backend/utils/adt/timestamp.c
M src/include/catalog/catversion.h
M src/include/catalog/pg_proc.h
M src/include/utils/datetime.h
M src/include/utils/timestamp.h
M src/test/regress/expected/interval.out
M src/test/regress/expected/timestamp.out
M src/test/regress/expected/timestamptz.out
M src/test/regress/sql/interval.sql
M src/test/regress/sql/timestamp.sql
M src/test/regress/sql/timestamptz.sql

Allow VACUUM FULL/CLUSTER to bump freeze horizons even for pg_class.

commit   : af2543e884db06c0beb75010218cd88680203b86    
  
author   : Robert Haas <[email protected]>    
date     : Tue, 4 Mar 2014 11:08:18 -0500    
  
committer: Robert Haas <[email protected]>    
date     : Tue, 4 Mar 2014 11:08:18 -0500    

Click here for diff

pg_class is a special case for CLUSTER and VACUUM FULL, so although  
commit 3cff1879f8d03cb729368722ca823a4bf74c0cac caused these  
operations to advance relfrozenxid and relminmxid for all other  
tables, it did not provide the same benefit for pg_class.  This  
plugs that gap.  
  
Andres Freund  

M src/backend/commands/cluster.c

Minor corrections to logical decoding patch.

commit   : 7e8db2dc420099df3fa73987cf2d2d6d1a609d86    
  
author   : Robert Haas <[email protected]>    
date     : Tue, 4 Mar 2014 11:07:54 -0500    
  
committer: Robert Haas <[email protected]>    
date     : Tue, 4 Mar 2014 11:07:54 -0500    

Click here for diff

M src/backend/replication/logical/logical.c
M src/backend/replication/logical/logicalfuncs.c
M src/include/utils/snapshot.h

Error out on send failure in walsender loop.

commit   : 7558cc95d31edbf1437321d910562494071c5589    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Tue, 4 Mar 2014 15:30:52 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Tue, 4 Mar 2014 15:30:52 +0200    

Click here for diff

I changed the loop in 9.3 to use "goto send_failure" instead of "break" on  
errors, but I missed this one case. It was a relatively harmless bug: if  
the flush fails once it will most likely fail again as soon as we try to  
flush the output again. But it's a bug nevertheless.  
  
Report and fix by Andres Freund.  

M src/backend/replication/walsender.c

Introduce logical decoding.

commit   : b89e151054a05f0f6d356ca52e3b725dd0505e53    
  
author   : Robert Haas <[email protected]>    
date     : Mon, 3 Mar 2014 16:32:18 -0500    
  
committer: Robert Haas <[email protected]>    
date     : Mon, 3 Mar 2014 16:32:18 -0500    

Click here for diff

This feature, building on previous commits, allows the write-ahead log  
stream to be decoded into a series of logical changes; that is,  
inserts, updates, and deletes and the transactions which contain them.  
It is capable of handling decoding even across changes to the schema  
of the effected tables.  The output format is controlled by a  
so-called "output plugin"; an example is included.  To make use of  
this in a real replication system, the output plugin will need to be  
modified to produce output in the format appropriate to that system,  
and to perform filtering.  
  
Currently, information can be extracted from the logical decoding  
system only via SQL; future commits will add the ability to stream  
changes via walsender.  
  
Andres Freund, with review and other contributions from many other  
people, including Álvaro Herrera, Abhijit Menon-Sen, Peter Gheogegan,  
Kevin Grittner, Robert Haas, Heikki Linnakangas, Fujii Masao, Abhijit  
Menon-Sen, Michael Paquier, Simon Riggs, Craig Ringer, and Steve  
Singer.  

M contrib/Makefile
A contrib/test_decoding/.gitignore
A contrib/test_decoding/Makefile
A contrib/test_decoding/expected/binary.out
A contrib/test_decoding/expected/concurrent_ddl_dml.out
A contrib/test_decoding/expected/ddl.out
A contrib/test_decoding/expected/decoding_in_xact.out
A contrib/test_decoding/expected/delayed_startup.out
A contrib/test_decoding/expected/mxact.out
A contrib/test_decoding/expected/permissions.out
A contrib/test_decoding/expected/rewrite.out
A contrib/test_decoding/expected/toast.out
A contrib/test_decoding/logical.conf
A contrib/test_decoding/specs/concurrent_ddl_dml.spec
A contrib/test_decoding/specs/delayed_startup.spec
A contrib/test_decoding/specs/mxact.spec
A contrib/test_decoding/sql/binary.sql
A contrib/test_decoding/sql/ddl.sql
A contrib/test_decoding/sql/decoding_in_xact.sql
A contrib/test_decoding/sql/permissions.sql
A contrib/test_decoding/sql/rewrite.sql
A contrib/test_decoding/sql/toast.sql
A contrib/test_decoding/test_decoding.c
M doc/src/sgml/contrib.sgml
M doc/src/sgml/filelist.sgml
A doc/src/sgml/test-decoding.sgml
M src/Makefile.global.in
M src/backend/access/heap/heapam.c
M src/backend/access/heap/pruneheap.c
M src/backend/access/heap/rewriteheap.c
M src/backend/access/heap/tuptoaster.c
M src/backend/access/index/indexam.c
M src/backend/access/rmgrdesc/heapdesc.c
M src/backend/access/transam/xact.c
M src/backend/access/transam/xlog.c
M src/backend/catalog/index.c
M src/backend/catalog/system_views.sql
M src/backend/commands/analyze.c
M src/backend/commands/cluster.c
M src/backend/commands/dbcommands.c
M src/backend/commands/vacuum.c
M src/backend/commands/vacuumlazy.c
M src/backend/executor/nodeBitmapHeapscan.c
M src/backend/replication/Makefile
A src/backend/replication/logical/Makefile
A src/backend/replication/logical/decode.c
A src/backend/replication/logical/logical.c
A src/backend/replication/logical/logicalfuncs.c
A src/backend/replication/logical/reorderbuffer.c
A src/backend/replication/logical/snapbuild.c
M src/backend/replication/slot.c
M src/backend/replication/slotfuncs.c
M src/backend/replication/walreceiver.c
M src/backend/replication/walsender.c
M src/backend/storage/ipc/procarray.c
M src/backend/storage/ipc/standby.c
M src/backend/storage/lmgr/proc.c
M src/backend/tcop/postgres.c
M src/backend/utils/cache/inval.c
M src/backend/utils/cache/relcache.c
M src/backend/utils/time/snapmgr.c
M src/backend/utils/time/tqual.c
M src/bin/initdb/initdb.c
M src/include/access/heapam.h
M src/include/access/heapam_xlog.h
M src/include/access/rewriteheap.h
M src/include/access/transam.h
M src/include/access/tuptoaster.h
M src/include/access/xlog.h
M src/include/catalog/catversion.h
M src/include/catalog/pg_proc.h
M src/include/commands/vacuum.h
A src/include/replication/decode.h
A src/include/replication/logical.h
A src/include/replication/logicalfuncs.h
A src/include/replication/output_plugin.h
A src/include/replication/reorderbuffer.h
M src/include/replication/slot.h
A src/include/replication/snapbuild.h
M src/include/storage/itemptr.h
M src/include/storage/proc.h
M src/include/storage/procarray.h
M src/include/storage/sinval.h
M src/include/utils/inval.h
M src/include/utils/snapmgr.h
M src/include/utils/snapshot.h
M src/include/utils/tqual.h
M src/test/regress/expected/rules.out
M src/tools/pgindent/typedefs.list

Fix whitespace

commit   : de94b47c0a92faeddab5ac980449d3fa877b4a4f    
  
author   : Peter Eisentraut <[email protected]>    
date     : Mon, 3 Mar 2014 14:05:33 -0500    
  
committer: Peter Eisentraut <[email protected]>    
date     : Mon, 3 Mar 2014 14:05:33 -0500    

Click here for diff

M src/bin/pg_ctl/pg_ctl.c
M src/interfaces/ecpg/preproc/variable.c
M src/interfaces/libpq/fe-exec.c
M src/test/regress/pg_regress.c

Rename huge_tlb_pages to huge_pages, and improve docs.

commit   : f8ce16d0d2645f3e223b1a68cd8f6b2fa3d56627    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Mon, 3 Mar 2014 20:52:48 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Mon, 3 Mar 2014 20:52:48 +0200    

Click here for diff

Christian Kruse  

M doc/src/sgml/config.sgml
M doc/src/sgml/runtime.sgml
M src/backend/port/sysv_shmem.c
M src/backend/port/win32_shmem.c
M src/backend/utils/misc/guc.c
M src/backend/utils/misc/postgresql.conf.sample
M src/include/storage/pg_shmem.h

pg_dump et al: Add --if-exists option

commit   : 9067310cc5dd590e36c2c3219dbf3961d7c9f8cb    
  
author   : Alvaro Herrera <[email protected]>    
date     : Mon, 3 Mar 2014 15:02:18 -0300    
  
committer: Alvaro Herrera <[email protected]>    
date     : Mon, 3 Mar 2014 15:02:18 -0300    

Click here for diff

This option makes pg_dump, pg_dumpall and pg_restore inject an IF EXISTS  
clause to each DROP command they emit.  (In pg_dumpall, the clause is  
not added to individual objects drops, but rather to the CREATE DATABASE  
commands, as well as CREATE ROLE and CREATE TABLESPACE.)  
  
This allows for a better user dump experience when using --clean in case  
some objects do not already exist.  Per bug #7873 by Dave Rolsky.  
  
Author: Pavel Stěhule  
Reviewed-by: Jeevan Chalke, Álvaro Herrera, Josh Kupershmidt  

M doc/src/sgml/ref/pg_dump.sgml
M doc/src/sgml/ref/pg_dumpall.sgml
M doc/src/sgml/ref/pg_restore.sgml
M src/bin/pg_dump/pg_backup.h
M src/bin/pg_dump/pg_backup_archiver.c
M src/bin/pg_dump/pg_dump.c
M src/bin/pg_dump/pg_dumpall.c
M src/bin/pg_dump/pg_restore.c

Use a longer buffer in libpqrcv_startstreaming.

commit   : 34c6d9611d23178539ed09b8f2ce40c5788a21cb    
  
author   : Robert Haas <[email protected]>    
date     : Mon, 3 Mar 2014 07:24:52 -0500    
  
committer: Robert Haas <[email protected]>    
date     : Mon, 3 Mar 2014 07:24:52 -0500    

Click here for diff

Because of the new SLOT clause in the START_REPLICATION command, it's  
possible for the command to end up too long for the old maximum buffer  
length.  
  
Andres Freund  

M src/backend/replication/libpqwalreceiver/libpqwalreceiver.c

Bump catversion.

commit   : a8e9b86b5e027a78ffeb738e207158424427e674    
  
author   : Robert Haas <[email protected]>    
date     : Mon, 3 Mar 2014 07:22:20 -0500    
  
committer: Robert Haas <[email protected]>    
date     : Mon, 3 Mar 2014 07:22:20 -0500    

Click here for diff

The previous patch should have entailed a catversion bump, but I  
forgot.  

M src/include/catalog/catversion.h

Corrections to replication slots code and documentation.

commit   : d83ee62231d41092c7907166204d57edc3d57070    
  
author   : Robert Haas <[email protected]>    
date     : Mon, 3 Mar 2014 07:16:54 -0500    
  
committer: Robert Haas <[email protected]>    
date     : Mon, 3 Mar 2014 07:16:54 -0500    

Click here for diff

Andres Freund, per a report from Vik Faering  

M doc/src/sgml/func.sgml
M doc/src/sgml/high-availability.sgml
M src/backend/replication/slotfuncs.c
M src/include/catalog/pg_proc.h

pageinspect: Use new pg_lsn datatype.

commit   : 45ffeb7e00576dc8b0544611f2a244540e9662c1    
  
author   : Robert Haas <[email protected]>    
date     : Mon, 3 Mar 2014 07:14:31 -0500    
  
committer: Robert Haas <[email protected]>    
date     : Mon, 3 Mar 2014 07:14:31 -0500    

Click here for diff

Michael Paquier, with slight comment changes by me  

M contrib/pageinspect/Makefile
A contrib/pageinspect/pageinspect–1.1–1.2.sql
R097 contrib/pageinspect/pageinspect–1.1.sql contrib/pageinspect/pageinspect–1.2.sql
M contrib/pageinspect/pageinspect.control
M contrib/pageinspect/rawpage.c

Define LSNOID in pg_type.h.

commit   : ae95f5f74af74850e99632c61e67528ffcf92d3b    
  
author   : Robert Haas <[email protected]>    
date     : Mon, 3 Mar 2014 07:03:41 -0500    
  
committer: Robert Haas <[email protected]>    
date     : Mon, 3 Mar 2014 07:03:41 -0500    

Click here for diff

Most other built-in types have a similarly-named constant, so this  
type should probably have one, too.  
  
Michael Paquier  

M src/include/catalog/pg_type.h

Another round of Coverity fixes

commit   : 5592ebac55460866da867df5c783c34e3c9a7cae    
  
author   : Stephen Frost <[email protected]>    
date     : Mon, 3 Mar 2014 03:18:51 -0500    
  
committer: Stephen Frost <[email protected]>    
date     : Mon, 3 Mar 2014 03:18:51 -0500    

Click here for diff

Additional non-security issues/improvements spotted by Coverity.  
  
In backend/libpq, no sense trying to protect against port->hba being  
NULL after we've already dereferenced it in the switch() statement.  
  
Prevent against possible overflow due to 32bit arithmitic in  
basebackup throttling (not yet released, so no security concern).  
  
Remove nonsensical check of array pointer against NULL in procarray.c,  
looks to be a holdover from 9.1 and earlier when there were pointers  
being used but now it's just an array.  
  
Remove pointer check-against-NULL in tsearch/spell.c as we had already  
dereferenced it above (in the strcmp()).  
  
Remove dead code from adt/orderedsetaggs.c, isnull is checked  
immediately after each tuplesort_getdatum() call and if true we return,  
so no point checking it again down at the bottom.  
  
Remove recently added minor error-condition memory leak in pg_regress.  

M src/backend/libpq/auth.c
M src/backend/replication/basebackup.c
M src/backend/storage/ipc/procarray.c
M src/backend/tsearch/spell.c
M src/backend/utils/adt/orderedsetaggs.c
M src/test/regress/pg_regress.c

Various Coverity-spotted fixes

commit   : b1aebbb6a86e96d7b8f3035ac730dfc24652496c    
  
author   : Stephen Frost <[email protected]>    
date     : Sat, 1 Mar 2014 22:14:14 -0500    
  
committer: Stephen Frost <[email protected]>    
date     : Sat, 1 Mar 2014 22:14:14 -0500    

Click here for diff

A number of issues were identified by the Coverity scanner and are  
addressed in this patch.  None of these appear to be security issues  
and many are mostly cosmetic changes.  
  
Short comments for each of the changes follows.  
  
Correct the semi-colon placement in be-secure.c regarding SSL retries.  
Remove a useless comparison-to-NULL in proc.c (value is dereferenced  
  prior to this check and therefore can't be NULL).  
Add checking of chmod() return values to initdb.  
Fix a couple minor memory leaks in initdb.  
Fix memory leak in pg_ctl- involves free'ing the config file contents.  
Use an int to capture fgetc() return instead of an enum in pg_dump.  
Fix minor memory leaks in pg_dump.  
  (note minor change to convertOperatorReference()'s API)  
Check fclose()/remove() return codes in psql.  
Check fstat(), find_my_exec() return codes in psql.  
Various ECPG memory leak fixes.  
Check find_my_exec() return in ECPG.  
Explicitly ignore pqFlush return in libpq error-path.  
Change PQfnumber() to avoid doing an strdup() when no changes required.  
Remove a few useless check-against-NULL's (value deref'd beforehand).  
Check rmtree(), malloc() results in pg_regress.  
Also check get_alternative_expectfile() return in pg_regress.  

M src/backend/libpq/be-secure.c
M src/backend/storage/lmgr/proc.c
M src/bin/initdb/initdb.c
M src/bin/pg_ctl/pg_ctl.c
M src/bin/pg_dump/pg_backup_archiver.c
M src/bin/pg_dump/pg_dump.c
M src/bin/psql/command.c
M src/bin/psql/copy.c
M src/bin/psql/startup.c
M src/interfaces/ecpg/ecpglib/execute.c
M src/interfaces/ecpg/preproc/ecpg.c
M src/interfaces/ecpg/preproc/type.c
M src/interfaces/ecpg/preproc/variable.c
M src/interfaces/libpq/fe-connect.c
M src/interfaces/libpq/fe-exec.c
M src/test/regress/pg_regress.c

Allow regex operations to be terminated early by query cancel requests.

commit   : 9662143f0c35d64d7042fbeaf879df8f0b54be32    
  
author   : Tom Lane <[email protected]>    
date     : Sat, 1 Mar 2014 15:20:56 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Sat, 1 Mar 2014 15:20:56 -0500    

Click here for diff

The regex code didn't have any provision for query cancel; which is  
unsurprising given its non-Postgres origin, but still problematic since  
some operations can take a long time.  Introduce a callback function to  
check for a pending query cancel or session termination request, and  
call it in a couple of strategic spots where we can make the regex code  
exit with an error indicator.  
  
If we ever actually split out the regex code as a standalone library,  
some additional work will be needed to let the cancel callback function  
be specified externally to the library.  But that's straightforward  
(certainly so by comparison to putting the locale-dependent character  
classification logic on a similar arms-length basis), and there seems  
no need to do it right now.  
  
A bigger issue is that there may be more places than these two where  
we need to check for cancels.  We can always add more checks later,  
now that the infrastructure is in place.  
  
Since there are known examples of not-terribly-long regexes that can  
lock up a backend for a long time, back-patch to all supported branches.  
I have hopes of fixing the known performance problems later, but adding  
query cancel ability seems like a good idea even if they were all fixed.  

M src/backend/regex/regc_nfa.c
M src/backend/regex/regcomp.c
M src/backend/regex/regexec.c
M src/backend/utils/adt/regexp.c
M src/backend/utils/adt/varlena.c
M src/include/regex/regerrs.h
M src/include/regex/regex.h
M src/include/regex/regguts.h

Remove bogus while-loop.

commit   : d8a42b150fa83de0a058843a4d9d61af3d98e333    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Fri, 28 Feb 2014 13:22:25 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Fri, 28 Feb 2014 13:22:25 +0200    

Click here for diff

Commit abf5c5c9a4f142b3343614746bb9e99a794f8e7b added a bogus while-  
statement after the for(;;)-loop. It went unnoticed in testing, because  
it was dead code.  
  
Report by KONDO Mitsumasa. Backpatch to 9.3. The commit that introduced  
this was also applied to 9.2, but not the bogus while-loop part, because  
the code in 9.2 looks quite different.  

M src/backend/access/transam/xlog.c

pgbench: Fix help message

commit   : 192d8e04bd3112965d47bb4dc6747ee984abaf07    
  
author   : Peter Eisentraut <[email protected]>    
date     : Thu, 27 Feb 2014 21:52:21 -0500    
  
committer: Peter Eisentraut <[email protected]>    
date     : Thu, 27 Feb 2014 21:52:21 -0500    

Click here for diff

Add NUM placeholder to -t option in help message.  It got lost in  
79cddb18419778be3202c971b3f21cdd90f7b719.  
  
Author: Fabien COELHO <[email protected]>  

M contrib/pgbench/pgbench.c

Allow BASE_BACKUP to be throttled

commit   : ef5856fd9b77ef9d0d0c31fb314bb61bbfb1d704    
  
author   : Alvaro Herrera <[email protected]>    
date     : Thu, 27 Feb 2014 18:55:57 -0300    
  
committer: Alvaro Herrera <[email protected]>    
date     : Thu, 27 Feb 2014 18:55:57 -0300    

Click here for diff

A new MAX_RATE option allows imposing a limit to the network transfer  
rate from the server side.  This is useful to limit the stress that  
taking a base backup has on the server.  
  
pg_basebackup is now able to specify a value to the server, too.  
  
Author: Antonin Houska  
  
Patch reviewed by Stefan Radomski, Andres Freund, Zoltán Böszörményi,  
Fujii Masao, and Álvaro Herrera.  

M doc/src/sgml/protocol.sgml
M doc/src/sgml/ref/pg_basebackup.sgml
M src/backend/replication/basebackup.c
M src/backend/replication/repl_gram.y
M src/backend/replication/repl_scanner.l
M src/bin/pg_basebackup/pg_basebackup.c
M src/include/replication/basebackup.h

Remove dependency on database encoding in citext regression test.

commit   : 1161d895d826950cbb736e5872935f3f53cc2e27    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 27 Feb 2014 14:58:47 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 27 Feb 2014 14:58:47 -0500    

Click here for diff

Testing convert_to(..., 'ISO-8859-1') fails if there isn't a conversion  
function available from the database encoding to ISO-8859-1.  This has  
been broken since day one, but the breakage was hidden by  
pg_do_encoding_conversion's failure to complain, up till commit  
49c817eab78c6f0ce8c3bf46766b73d6cf3190b7.  
  
Since the data being converted in this test is plain ASCII, no actual  
conversion need happen (and if it did, it would prove little about citext  
anyway).  So that we still have some code coverage of the convert() family  
of functions, let's switch to using convert_from, with SQL_ASCII as the  
specified source encoding.  Per buildfarm.  

M contrib/citext/expected/citext.out
M contrib/citext/expected/citext_1.out
M contrib/citext/sql/citext.sql

doc: bgw_main takes a Datum argument, not void *.

commit   : 4333eee82d399df8f724faa331827dcfae1fdf28    
  
author   : Alvaro Herrera <[email protected]>    
date     : Thu, 27 Feb 2014 11:41:43 -0300    
  
committer: Alvaro Herrera <[email protected]>    
date     : Thu, 27 Feb 2014 11:41:43 -0300    

Click here for diff

Per report from James Harper.  

M doc/src/sgml/bgworker.sgml

Fix WAL replay of locking an updated tuple

commit   : 6bfa88acd3df830a5f7e8677c13512b1b50ae813    
  
author   : Alvaro Herrera <[email protected]>    
date     : Thu, 27 Feb 2014 11:13:39 -0300    
  
committer: Alvaro Herrera <[email protected]>    
date     : Thu, 27 Feb 2014 11:13:39 -0300    

Click here for diff

We were resetting the tuple's HEAP_HOT_UPDATED flag as well as t_ctid on  
WAL replay of a tuple-lock operation, which is incorrect when the tuple  
is already updated.  
  
Back-patch to 9.3.  The clearing of both header elements was there  
previously, but since no update could be present on a tuple that was  
being locked, it was harmless.  
  
Bug reported by Peter Geoghegan and Greg Stark in  
CAM3SWZTMQiCi5PV5OWHb+bYkUcnCk=O67w0cSswPvV7XfUcU5g@mail.gmail.com and  
CAM-w4HPTOeMT4KP0OJK+mGgzgcTOtLRTvFZyvD0O4aH-7dxo3Q@mail.gmail.com  
respectively; diagnosis by Andres Freund.  

M src/backend/access/heap/heapam.c

btbuild no longer calls _bt_doinsert(), update comment.

commit   : 00976f202ce13daf15ec6e8de37f87fc9904b5e2    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Wed, 26 Feb 2014 18:48:21 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Wed, 26 Feb 2014 18:48:21 +0200    

Click here for diff

Peter Geoghegan  

M src/backend/access/nbtree/nbtinsert.c

Fix crash in json_to_record().

commit   : 486ea0b19e08c10ff53e36e46209a928df048281    
  
author   : Jeff Davis <[email protected]>    
date     : Wed, 26 Feb 2014 07:47:09 -0800    
  
committer: Jeff Davis <[email protected]>    
date     : Wed, 26 Feb 2014 07:47:09 -0800    

Click here for diff

json_to_record() depends on get_call_result_type() for the tuple  
descriptor of the record that should be returned, but in some cases  
that cannot be determined. Add a guard to check if the tuple  
descriptor has been properly resolved, similar to other callers of  
get_call_result_type().  
  
Also add guard for two other callers of get_call_result_type() in  
jsonfuncs.c. Although json_to_record() is the only actual bug, it's a  
good idea to follow convention.  

M src/backend/utils/adt/jsonfuncs.c

Use SnapshotDirty rather than an active snapshot to probe index endpoints.

commit   : fccebe421d0c410e6378fb281419442c84759213    
  
author   : Tom Lane <[email protected]>    
date     : Tue, 25 Feb 2014 16:04:06 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Tue, 25 Feb 2014 16:04:06 -0500    

Click here for diff

If there are lots of uncommitted tuples at the end of the index range,  
get_actual_variable_range() ends up fetching each one and doing an MVCC  
visibility check on it, until it finally hits a visible tuple.  This is  
bad enough in isolation, considering that we don't need an exact answer  
only an approximate one.  But because the tuples are not yet committed,  
each visibility check does a TransactionIdIsInProgress() test, which  
involves scanning the ProcArray.  When multiple sessions do this  
concurrently, the ensuing contention results in horrid performance loss.  
20X overall throughput loss on not-too-complicated queries is easy to  
demonstrate in the back branches (though someone's made it noticeably  
less bad in HEAD).  
  
We can dodge the problem fairly effectively by using SnapshotDirty rather  
than a normal MVCC snapshot.  This will cause the index probe to take  
uncommitted tuples as good, so that we incur only one tuple fetch and test  
even if there are many such tuples.  The extent to which this degrades the  
estimate is debatable: it's possible the result is actually a more accurate  
prediction than before, if the endmost tuple has become committed by the  
time we actually execute the query being planned.  In any case, it's not  
very likely that it makes the estimate a lot worse.  
  
SnapshotDirty will still reject tuples that are known committed dead, so  
we won't give bogus answers if an invalid outlier has been deleted but not  
yet vacuumed from the index.  (Because btrees know how to mark such tuples  
dead in the index, we shouldn't have a big performance problem in the case  
that there are many of them at the end of the range.)  This consideration  
motivates not using SnapshotAny, which was also considered as a fix.  
  
Note: the back branches were using SnapshotNow instead of an MVCC snapshot,  
but the problem and solution are the same.  
  
Per performance complaints from Bartlomiej Romanski, Josh Berkus, and  
others.  Back-patch to 9.0, where the issue was introduced (by commit  
40608e7f949fb7e4025c0ddd5be01939adc79eec).  

M src/backend/utils/adt/selfuncs.c

Update a few comments to mention materialized views.

commit   : cf6aa68bbd78e3119d5156616b474fea47e10a33    
  
author   : Robert Haas <[email protected]>    
date     : Tue, 25 Feb 2014 13:40:12 -0500    
  
committer: Robert Haas <[email protected]>    
date     : Tue, 25 Feb 2014 13:40:12 -0500    

Click here for diff

Etsuro Fujita  

M src/backend/commands/tablecmds.c

Show xid and xmin in pg_stat_activity and pg_stat_replication.

commit   : dd1a3bccca241a998b4ebf39d67202698e5fa599    
  
author   : Robert Haas <[email protected]>    
date     : Tue, 25 Feb 2014 12:34:04 -0500    
  
committer: Robert Haas <[email protected]>    
date     : Tue, 25 Feb 2014 12:34:04 -0500    

Click here for diff

Christian Kruse, reviewed by Andres Freund and myself, with further  
minor adjustments by me.  

M doc/src/sgml/monitoring.sgml
M src/backend/catalog/system_views.sql
M src/backend/postmaster/pgstat.c
M src/backend/storage/ipc/sinvaladt.c
M src/backend/utils/adt/pgstatfuncs.c
M src/include/catalog/catversion.h
M src/include/catalog/pg_proc.h
M src/include/pgstat.h
M src/include/storage/sinvaladt.h
M src/test/regress/expected/rules.out

pg_basebackup: Skip only the *contents* of pg_replslot.

commit   : 278c94209b90b8e241f64ea4ce2d955b63b1f5d7    
  
author   : Robert Haas <[email protected]>    
date     : Tue, 25 Feb 2014 11:23:45 -0500    
  
committer: Robert Haas <[email protected]>    
date     : Tue, 25 Feb 2014 11:23:45 -0500    

Click here for diff

Include the directory itself.  
  
Fujii Masao  

M src/backend/replication/basebackup.c

Update and clarify ssl_ciphers default

commit   : 32001ab0b7b4ee143e195f100543f531757a555b    
  
author   : Peter Eisentraut <[email protected]>    
date     : Mon, 24 Feb 2014 20:30:28 -0500    
  
committer: Peter Eisentraut <[email protected]>    
date     : Mon, 24 Feb 2014 20:30:28 -0500    

Click here for diff

- Write HIGH:MEDIUM instead of DEFAULT:!LOW:!EXP for clarity.  
- Order 3DES last to work around inappropriate OpenSSL default.  
- Remove !MD5 and @STRENGTH, because they are irrelevant.  
- Add clarifying documentation.  
  
Effectively, the new default is almost the same as the old one, but it  
is arguably easier to understand and modify.  
  
Author: Marko Kreen <[email protected]>  

M doc/src/sgml/config.sgml
M src/backend/utils/misc/guc.c
M src/backend/utils/misc/postgresql.conf.sample

Increase work_mem and maintenance_work_mem defaults by 4x

commit   : 848ae330a497b4d430d93bd813f93c40d2bb0157    
  
author   : Bruce Momjian <[email protected]>    
date     : Mon, 24 Feb 2014 13:04:51 -0500    
  
committer: Bruce Momjian <[email protected]>    
date     : Mon, 24 Feb 2014 13:04:51 -0500    

Click here for diff

New defaults are 4MB and 64MB.  

M doc/src/sgml/config.sgml
M src/backend/utils/misc/guc.c
M src/backend/utils/misc/postgresql.conf.sample

docs: remove unnecessary references to old PG versions

commit   : 6f14a6f703a26ec12f4da6f53f107dd260fbb9db    
  
author   : Bruce Momjian <[email protected]>    
date     : Mon, 24 Feb 2014 12:56:37 -0500    
  
committer: Bruce Momjian <[email protected]>    
date     : Mon, 24 Feb 2014 12:56:37 -0500    

Click here for diff

M doc/src/sgml/datatype.sgml
M doc/src/sgml/ddl.sgml
M doc/src/sgml/extend.sgml
M doc/src/sgml/func.sgml
M doc/src/sgml/libpq.sgml
M doc/src/sgml/pgrowlocks.sgml
M doc/src/sgml/plpgsql.sgml
M doc/src/sgml/plpython.sgml
M doc/src/sgml/ref/create_cast.sgml
M doc/src/sgml/ref/create_table_as.sgml
M doc/src/sgml/ref/pg_config-ref.sgml
M doc/src/sgml/ref/reindex.sgml
M doc/src/sgml/ref/select_into.sgml
M doc/src/sgml/rules.sgml
M doc/src/sgml/storage.sgml
M doc/src/sgml/xfunc.sgml

psql: add separate \d display for disabled system triggers

commit   : 4bad548d981636ceb79492a1b7f607f22f0867de    
  
author   : Bruce Momjian <[email protected]>    
date     : Mon, 24 Feb 2014 12:44:55 -0500    
  
committer: Bruce Momjian <[email protected]>    
date     : Mon, 24 Feb 2014 12:44:55 -0500    

Click here for diff

Previously if you disabled all triggers, only user triggers would  
show as disabled  
  
Per report from Andres Freund  

M src/bin/psql/describe.c

pg_dump: fix subtle memory leak in func and arg signature processing

commit   : d613861b9523c143db427d1bf26b9769319ca102    
  
author   : Bruce Momjian <[email protected]>    
date     : Mon, 24 Feb 2014 12:32:41 -0500    
  
committer: Bruce Momjian <[email protected]>    
date     : Mon, 24 Feb 2014 12:32:41 -0500    

Click here for diff

M src/bin/pg_dump/pg_dump.c

Fix markup for CHAR() doc patch

commit   : 3f05bedaf23a50979125159ac881094175edf9eb    
  
author   : Bruce Momjian <[email protected]>    
date     : Mon, 24 Feb 2014 12:26:04 -0500    
  
committer: Bruce Momjian <[email protected]>    
date     : Mon, 24 Feb 2014 12:26:04 -0500    

Click here for diff

M doc/src/sgml/datatype.sgml

Allow single-point polygons to be converted to circles

commit   : 423f69ab64a6e51fbdd97a83c1dc55d68ca6190d    
  
author   : Bruce Momjian <[email protected]>    
date     : Mon, 24 Feb 2014 12:24:00 -0500    
  
committer: Bruce Momjian <[email protected]>    
date     : Mon, 24 Feb 2014 12:24:00 -0500    

Click here for diff

This allows finding the center of a single-point polygon and converting  
it to a point.  
  
Per report from Josef Grahn  

M src/backend/utils/adt/geo_ops.c

docs: document behavior of CHAR() comparisons with chars < space

commit   : 8457d0beca731bf062bb0d126870d9a291ab47a5    
  
author   : Bruce Momjian <[email protected]>    
date     : Mon, 24 Feb 2014 12:09:23 -0500    
  
committer: Bruce Momjian <[email protected]>    
date     : Mon, 24 Feb 2014 12:09:23 -0500    

Click here for diff

Space trimming rather than space-padding causes unusual behavior, which  
might not be standards-compliant.  
  
Also remove recently-added now-redundant C comment.  

M doc/src/sgml/datatype.sgml
M src/backend/utils/adt/varchar.c

Use pg_lsn data type in pg_stat_replication, too.

commit   : 6615e77439a3c8c26c0091a616f00eefdea22604    
  
author   : Robert Haas <[email protected]>    
date     : Mon, 24 Feb 2014 10:38:45 -0500    
  
committer: Robert Haas <[email protected]>    
date     : Mon, 24 Feb 2014 10:38:45 -0500    

Click here for diff

Michael Paquier, per a suggestion from Andres Freund  

M doc/src/sgml/monitoring.sgml
M src/backend/replication/walsender.c
M src/include/catalog/catversion.h
M src/include/catalog/pg_proc.h

Remove a couple of comments from the pg_lsn regression test.

commit   : bb818b53d47c77eb58bfce57516fab93d0e6965d    
  
author   : Robert Haas <[email protected]>    
date     : Mon, 24 Feb 2014 09:32:21 -0500    
  
committer: Robert Haas <[email protected]>    
date     : Mon, 24 Feb 2014 09:32:21 -0500    

Click here for diff

Previously, one of these was a negative test case, but that got  
changed along the way and the comments didn't get the memo.  
  
Michael Paquier  

M src/test/regress/expected/pg_lsn.out
M src/test/regress/sql/pg_lsn.sql

doc: Improve DocBook XML validity

commit   : bb4eefe7bf518e42c73797ea37b033a5d8a8e70a    
  
author   : Peter Eisentraut <[email protected]>    
date     : Sun, 23 Feb 2014 21:25:35 -0500    
  
committer: Peter Eisentraut <[email protected]>    
date     : Sun, 23 Feb 2014 21:25:35 -0500    

Click here for diff

DocBook XML is superficially compatible with DocBook SGML but has a  
slightly stricter DTD that we have been violating in a few cases.  
Although XSLT doesn't care whether the document is valid, the style  
sheets don't necessarily process invalid documents correctly, so we need  
to work toward fixing this.  
  
This first commit moves the indexterms in refentry elements to an  
allowed position.  It has no impact on the output.  

M doc/src/sgml/dblink.sgml
M doc/src/sgml/oid2name.sgml
M doc/src/sgml/pg_xlogdump.sgml
M doc/src/sgml/pgarchivecleanup.sgml
M doc/src/sgml/pgbench.sgml
M doc/src/sgml/pgstandby.sgml
M doc/src/sgml/pgtestfsync.sgml
M doc/src/sgml/pgtesttiming.sgml
M doc/src/sgml/pgupgrade.sgml
M doc/src/sgml/ref/abort.sgml
M doc/src/sgml/ref/alter_aggregate.sgml
M doc/src/sgml/ref/alter_collation.sgml
M doc/src/sgml/ref/alter_conversion.sgml
M doc/src/sgml/ref/alter_database.sgml
M doc/src/sgml/ref/alter_default_privileges.sgml
M doc/src/sgml/ref/alter_domain.sgml
M doc/src/sgml/ref/alter_event_trigger.sgml
M doc/src/sgml/ref/alter_extension.sgml
M doc/src/sgml/ref/alter_foreign_data_wrapper.sgml
M doc/src/sgml/ref/alter_foreign_table.sgml
M doc/src/sgml/ref/alter_function.sgml
M doc/src/sgml/ref/alter_group.sgml
M doc/src/sgml/ref/alter_index.sgml
M doc/src/sgml/ref/alter_language.sgml
M doc/src/sgml/ref/alter_large_object.sgml
M doc/src/sgml/ref/alter_materialized_view.sgml
M doc/src/sgml/ref/alter_opclass.sgml
M doc/src/sgml/ref/alter_operator.sgml
M doc/src/sgml/ref/alter_opfamily.sgml
M doc/src/sgml/ref/alter_role.sgml
M doc/src/sgml/ref/alter_rule.sgml
M doc/src/sgml/ref/alter_schema.sgml
M doc/src/sgml/ref/alter_sequence.sgml
M doc/src/sgml/ref/alter_server.sgml
M doc/src/sgml/ref/alter_system.sgml
M doc/src/sgml/ref/alter_table.sgml
M doc/src/sgml/ref/alter_tablespace.sgml
M doc/src/sgml/ref/alter_trigger.sgml
M doc/src/sgml/ref/alter_tsconfig.sgml
M doc/src/sgml/ref/alter_tsdictionary.sgml
M doc/src/sgml/ref/alter_tsparser.sgml
M doc/src/sgml/ref/alter_tstemplate.sgml
M doc/src/sgml/ref/alter_type.sgml
M doc/src/sgml/ref/alter_user.sgml
M doc/src/sgml/ref/alter_user_mapping.sgml
M doc/src/sgml/ref/alter_view.sgml
M doc/src/sgml/ref/analyze.sgml
M doc/src/sgml/ref/begin.sgml
M doc/src/sgml/ref/checkpoint.sgml
M doc/src/sgml/ref/close.sgml
M doc/src/sgml/ref/cluster.sgml
M doc/src/sgml/ref/clusterdb.sgml
M doc/src/sgml/ref/comment.sgml
M doc/src/sgml/ref/commit.sgml
M doc/src/sgml/ref/commit_prepared.sgml
M doc/src/sgml/ref/copy.sgml
M doc/src/sgml/ref/create_aggregate.sgml
M doc/src/sgml/ref/create_cast.sgml
M doc/src/sgml/ref/create_collation.sgml
M doc/src/sgml/ref/create_conversion.sgml
M doc/src/sgml/ref/create_database.sgml
M doc/src/sgml/ref/create_domain.sgml
M doc/src/sgml/ref/create_event_trigger.sgml
M doc/src/sgml/ref/create_extension.sgml
M doc/src/sgml/ref/create_foreign_data_wrapper.sgml
M doc/src/sgml/ref/create_foreign_table.sgml
M doc/src/sgml/ref/create_function.sgml
M doc/src/sgml/ref/create_group.sgml
M doc/src/sgml/ref/create_index.sgml
M doc/src/sgml/ref/create_language.sgml
M doc/src/sgml/ref/create_materialized_view.sgml
M doc/src/sgml/ref/create_opclass.sgml
M doc/src/sgml/ref/create_operator.sgml
M doc/src/sgml/ref/create_opfamily.sgml
M doc/src/sgml/ref/create_role.sgml
M doc/src/sgml/ref/create_rule.sgml
M doc/src/sgml/ref/create_schema.sgml
M doc/src/sgml/ref/create_sequence.sgml
M doc/src/sgml/ref/create_server.sgml
M doc/src/sgml/ref/create_table.sgml
M doc/src/sgml/ref/create_table_as.sgml
M doc/src/sgml/ref/create_tablespace.sgml
M doc/src/sgml/ref/create_trigger.sgml
M doc/src/sgml/ref/create_tsconfig.sgml
M doc/src/sgml/ref/create_tsdictionary.sgml
M doc/src/sgml/ref/create_tsparser.sgml
M doc/src/sgml/ref/create_tstemplate.sgml
M doc/src/sgml/ref/create_type.sgml
M doc/src/sgml/ref/create_user.sgml
M doc/src/sgml/ref/create_user_mapping.sgml
M doc/src/sgml/ref/create_view.sgml
M doc/src/sgml/ref/createdb.sgml
M doc/src/sgml/ref/createlang.sgml
M doc/src/sgml/ref/createuser.sgml
M doc/src/sgml/ref/deallocate.sgml
M doc/src/sgml/ref/declare.sgml
M doc/src/sgml/ref/delete.sgml
M doc/src/sgml/ref/discard.sgml
M doc/src/sgml/ref/do.sgml
M doc/src/sgml/ref/drop_aggregate.sgml
M doc/src/sgml/ref/drop_cast.sgml
M doc/src/sgml/ref/drop_collation.sgml
M doc/src/sgml/ref/drop_conversion.sgml
M doc/src/sgml/ref/drop_database.sgml
M doc/src/sgml/ref/drop_domain.sgml
M doc/src/sgml/ref/drop_event_trigger.sgml
M doc/src/sgml/ref/drop_extension.sgml
M doc/src/sgml/ref/drop_foreign_data_wrapper.sgml
M doc/src/sgml/ref/drop_foreign_table.sgml
M doc/src/sgml/ref/drop_function.sgml
M doc/src/sgml/ref/drop_group.sgml
M doc/src/sgml/ref/drop_index.sgml
M doc/src/sgml/ref/drop_language.sgml
M doc/src/sgml/ref/drop_materialized_view.sgml
M doc/src/sgml/ref/drop_opclass.sgml
M doc/src/sgml/ref/drop_operator.sgml
M doc/src/sgml/ref/drop_opfamily.sgml
M doc/src/sgml/ref/drop_owned.sgml
M doc/src/sgml/ref/drop_role.sgml
M doc/src/sgml/ref/drop_rule.sgml
M doc/src/sgml/ref/drop_schema.sgml
M doc/src/sgml/ref/drop_sequence.sgml
M doc/src/sgml/ref/drop_server.sgml
M doc/src/sgml/ref/drop_table.sgml
M doc/src/sgml/ref/drop_tablespace.sgml
M doc/src/sgml/ref/drop_trigger.sgml
M doc/src/sgml/ref/drop_tsconfig.sgml
M doc/src/sgml/ref/drop_tsdictionary.sgml
M doc/src/sgml/ref/drop_tsparser.sgml
M doc/src/sgml/ref/drop_tstemplate.sgml
M doc/src/sgml/ref/drop_type.sgml
M doc/src/sgml/ref/drop_user.sgml
M doc/src/sgml/ref/drop_user_mapping.sgml
M doc/src/sgml/ref/drop_view.sgml
M doc/src/sgml/ref/dropdb.sgml
M doc/src/sgml/ref/droplang.sgml
M doc/src/sgml/ref/dropuser.sgml
M doc/src/sgml/ref/ecpg-ref.sgml
M doc/src/sgml/ref/end.sgml
M doc/src/sgml/ref/execute.sgml
M doc/src/sgml/ref/explain.sgml
M doc/src/sgml/ref/fetch.sgml
M doc/src/sgml/ref/grant.sgml
M doc/src/sgml/ref/initdb.sgml
M doc/src/sgml/ref/insert.sgml
M doc/src/sgml/ref/listen.sgml
M doc/src/sgml/ref/load.sgml
M doc/src/sgml/ref/lock.sgml
M doc/src/sgml/ref/move.sgml
M doc/src/sgml/ref/notify.sgml
M doc/src/sgml/ref/pg_basebackup.sgml
M doc/src/sgml/ref/pg_config-ref.sgml
M doc/src/sgml/ref/pg_controldata.sgml
M doc/src/sgml/ref/pg_ctl-ref.sgml
M doc/src/sgml/ref/pg_dump.sgml
M doc/src/sgml/ref/pg_dumpall.sgml
M doc/src/sgml/ref/pg_isready.sgml
M doc/src/sgml/ref/pg_receivexlog.sgml
M doc/src/sgml/ref/pg_resetxlog.sgml
M doc/src/sgml/ref/pg_restore.sgml
M doc/src/sgml/ref/postgres-ref.sgml
M doc/src/sgml/ref/postmaster.sgml
M doc/src/sgml/ref/prepare.sgml
M doc/src/sgml/ref/prepare_transaction.sgml
M doc/src/sgml/ref/psql-ref.sgml
M doc/src/sgml/ref/reassign_owned.sgml
M doc/src/sgml/ref/refresh_materialized_view.sgml
M doc/src/sgml/ref/reindex.sgml
M doc/src/sgml/ref/reindexdb.sgml
M doc/src/sgml/ref/release_savepoint.sgml
M doc/src/sgml/ref/reset.sgml
M doc/src/sgml/ref/revoke.sgml
M doc/src/sgml/ref/rollback.sgml
M doc/src/sgml/ref/rollback_prepared.sgml
M doc/src/sgml/ref/rollback_to.sgml
M doc/src/sgml/ref/savepoint.sgml
M doc/src/sgml/ref/security_label.sgml
M doc/src/sgml/ref/select.sgml
M doc/src/sgml/ref/select_into.sgml
M doc/src/sgml/ref/set.sgml
M doc/src/sgml/ref/set_constraints.sgml
M doc/src/sgml/ref/set_role.sgml
M doc/src/sgml/ref/set_session_auth.sgml
M doc/src/sgml/ref/set_transaction.sgml
M doc/src/sgml/ref/show.sgml
M doc/src/sgml/ref/start_transaction.sgml
M doc/src/sgml/ref/truncate.sgml
M doc/src/sgml/ref/unlisten.sgml
M doc/src/sgml/ref/update.sgml
M doc/src/sgml/ref/vacuum.sgml
M doc/src/sgml/ref/vacuumdb.sgml
M doc/src/sgml/ref/values.sgml
M doc/src/sgml/spi.sgml
M doc/src/sgml/vacuumlo.sgml

Prefer pg_any_to_server/pg_server_to_any over pg_do_encoding_conversion.

commit   : 769065c1b2471f484bb48bb58a8bdcf1d12a419c    
  
author   : Tom Lane <[email protected]>    
date     : Sun, 23 Feb 2014 16:59:05 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Sun, 23 Feb 2014 16:59:05 -0500    

Click here for diff

A large majority of the callers of pg_do_encoding_conversion were  
specifying the database encoding as either source or target of the  
conversion, meaning that we can use the less general functions  
pg_any_to_server/pg_server_to_any instead.  
  
The main advantage of using the latter functions is that they can make use  
of a cached conversion-function lookup in the common case that the other  
encoding is the current client_encoding.  It's notationally cleaner too in  
most cases, not least because of the historical artifact that the latter  
functions use "char *" rather than "unsigned char *" in their APIs.  
  
Note that pg_any_to_server will apply an encoding verification step in  
some cases where pg_do_encoding_conversion would have just done nothing.  
This seems to me to be a good idea at most of these call sites, though  
it partially negates the performance benefit.  
  
Per discussion of bug #9210.  

M contrib/pg_stat_statements/pg_stat_statements.c
M contrib/sslinfo/sslinfo.c
M src/backend/commands/extension.c
M src/backend/snowball/dict_snowball.c
M src/backend/tsearch/ts_locale.c
M src/backend/utils/adt/pg_locale.c
M src/backend/utils/adt/xml.c
M src/backend/utils/mb/mbutils.c
M src/pl/plperl/plperl.c
M src/pl/plperl/plperl_helpers.h
M src/pl/plpython/plpy_util.c
M src/pl/tcl/pltcl.c

Plug some more holes in encoding conversion.

commit   : 49c817eab78c6f0ce8c3bf46766b73d6cf3190b7    
  
author   : Tom Lane <[email protected]>    
date     : Sun, 23 Feb 2014 15:22:50 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Sun, 23 Feb 2014 15:22:50 -0500    

Click here for diff

Various places assume that pg_do_encoding_conversion() and  
pg_server_to_any() will ensure encoding validity of their results;  
but they failed to do so in the case that the source encoding is SQL_ASCII  
while the destination is not.  We cannot perform any actual "conversion"  
in that scenario, but we should still validate the string according to the  
destination encoding.  Per bug #9210 from Digoal Zhou.  
  
Arguably this is a back-patchable bug fix, but on the other hand adding  
more enforcing of encoding checks might break existing applications that  
were being sloppy.  On balance there doesn't seem to be much enthusiasm  
for a back-patch, so fix in HEAD only.  
  
While at it, remove some apparently-no-longer-needed provisions for  
letting pg_do_encoding_conversion() "work" outside a transaction ---  
if you consider it "working" to silently fail to do the requested  
conversion.  
  
Also, make a few cosmetic improvements in mbutils.c, notably removing  
some Asserts that are certainly dead code since the variables they  
assert aren't null are never null, even at process start.  (I think  
this wasn't true at one time, but it is now.)  

M src/backend/utils/mb/mbutils.c

configure.in: Use dnl in place of # where appropriate

commit   : 2c65856b7b444a5e804d4f694438e7444811d26b    
  
author   : Peter Eisentraut <[email protected]>    
date     : Sat, 22 Feb 2014 20:42:39 -0500    
  
committer: Peter Eisentraut <[email protected]>    
date     : Sat, 22 Feb 2014 20:42:39 -0500    

Click here for diff

The comment added by ed011d9754fd4b76eac0eaa8c057fcfc0c302a6a used #,  
which means it gets copied into configure, but it doesn't make sense  
there.  So use dnl, which gets dropped when creating configure.  

M configure
M configure.in

pg_basebackup: Add support for relocating tablespaces

commit   : fb05f3ce83d225dd0f39f8860ce04082753e9e98    
  
author   : Peter Eisentraut <[email protected]>    
date     : Sat, 22 Feb 2014 13:38:06 -0500    
  
committer: Peter Eisentraut <[email protected]>    
date     : Sat, 22 Feb 2014 13:38:06 -0500    

Click here for diff

Tablespaces can be relocated in plain backup mode by specifying one or  
more -T olddir=newdir options.  
  
Author: Steeve Lennmark <[email protected]>  
Reviewed-by: Peter Eisentraut <[email protected]>  

M doc/src/sgml/ref/pg_basebackup.sgml
M src/bin/pg_basebackup/pg_basebackup.c

Do ScalarArrayOp estimation correctly when array is a stable expression.

commit   : 77585bce03042e8fee62d8df0dde9c008a904699    
  
author   : Tom Lane <[email protected]>    
date     : Fri, 21 Feb 2014 17:10:46 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Fri, 21 Feb 2014 17:10:46 -0500    

Click here for diff

Most estimation functions apply estimate_expression_value to see if they  
can reduce an expression to a constant; the key difference is that it  
allows evaluation of stable as well as immutable functions in hopes of  
ending up with a simple Const node.  scalararraysel didn't get the memo  
though, and neither did gincost_opexpr/gincost_scalararrayopexpr.  Fix  
that, and remove a now-unnecessary estimate_expression_value step in the  
subsidiary function scalararraysel_containment.  
  
Per complaint from Alexey Klyukin.  Back-patch to 9.3.  The problem  
goes back further, but I'm hesitant to change estimation behavior in  
long-stable release branches.  

M src/backend/utils/adt/array_selfuncs.c
M src/backend/utils/adt/selfuncs.c

Avoid integer overflow in hstore_to_json().

commit   : 0c5783ff301ae3e470000c918bfc2395129de4c5    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Fri, 21 Feb 2014 15:43:31 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Fri, 21 Feb 2014 15:43:31 +0200    

Click here for diff

The length of the output buffer was calculated based on the size of the  
argument hstore. On a sizeof(int) == 4 platform and a huge argument, it  
could overflow, causing a too small buffer to be allocated.  
  
Refactor the function to use a StringInfo instead of pre-allocating the  
buffer. Makes it shorter and more readable, too.  

M contrib/hstore/hstore_io.c

doc: Clarify documentation page header customization code

commit   : 8c059dffd83384fa0c2fe6050429d601355bc3af    
  
author   : Peter Eisentraut <[email protected]>    
date     : Thu, 20 Feb 2014 21:41:24 -0500    
  
committer: Peter Eisentraut <[email protected]>    
date     : Thu, 20 Feb 2014 21:41:24 -0500    

Click here for diff

The customization overrode the fast-forward code with its custom Up  
link.  So this is no longer really the fast-forward feature, so we might  
as well turn that off and override the non-ff template instead, thus  
removing one mental indirection.  
  
Fix the wrong column span declaration.  
  
Clarify and update the documentation.  

M doc/src/sgml/stylesheet.dsl

Improve comment on setting data_checksum GUC.

commit   : 8f09ca436dbeda5350a0864adeaa22f920692382    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Thu, 20 Feb 2014 10:43:36 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Thu, 20 Feb 2014 10:43:36 +0200    

Click here for diff

There was an extra space there, and "fixed" wasn't very descriptive.  

M src/backend/access/transam/xlog.c

Remove inappropriate EXPORTS line.

commit   : ae5266f25910d6e084692a7cdbd02b9e52800046    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 19 Feb 2014 21:08:50 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 19 Feb 2014 21:08:50 -0500    

Click here for diff

Looks like this gets added later ...  

M src/bin/pgevent/exports.txt

Avoid using dllwrap to build pgevent in Mingw builds.

commit   : 4f5f485d10cad372a3a0cd8dd70780f1a32f43f0    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 19 Feb 2014 19:34:50 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 19 Feb 2014 19:34:50 -0500    

Click here for diff

If this works, we can get rid of configure's support for locating dllwrap  
... but let's see what the buildfarm says, first.  
  
Hiroshi Inoue  

M src/bin/pgevent/Makefile
A src/bin/pgevent/exports.txt

Fix some missing .gitignore and "make clean" items in ecpg.

commit   : 52acfd27f11ca586f90c2c1255ca9a4a66766b57    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 19 Feb 2014 18:50:48 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 19 Feb 2014 18:50:48 -0500    

Click here for diff

Some of the files we optionally link in from elsewhere weren't ignored  
and/or weren't cleaned up at "make clean".  Noted while testing on a  
machine that needs our version of snprintf.c.  

M src/interfaces/ecpg/compatlib/.gitignore
M src/interfaces/ecpg/ecpglib/.gitignore
M src/interfaces/ecpg/ecpglib/Makefile
M src/interfaces/ecpg/pgtypeslib/.gitignore

Document pg_replslot in storage.sgml.

commit   : 7b3cf9ba9d3d12ad95c0a06cef04f9097a9c65cf    
  
author   : Robert Haas <[email protected]>    
date     : Wed, 19 Feb 2014 11:57:31 -0500    
  
committer: Robert Haas <[email protected]>    
date     : Wed, 19 Feb 2014 11:57:31 -0500    

Click here for diff

Per an observation from Amit Kapila.  

M doc/src/sgml/storage.sgml

Switch various builtin functions to use pg_lsn instead of text.

commit   : 6f289c2b7d00f07f13f679092f7c71f78950e9da    
  
author   : Robert Haas <[email protected]>    
date     : Wed, 19 Feb 2014 11:13:44 -0500    
  
committer: Robert Haas <[email protected]>    
date     : Wed, 19 Feb 2014 11:13:44 -0500    

Click here for diff

The functions in slotfuncs.c don't exist in any released version,  
but the changes to xlogfuncs.c represent backward-incompatibilities.  
Per discussion, we're hoping that the queries using these functions  
are few enough and simple enough that this won't cause too much  
breakage for users.  
  
Michael Paquier, reviewed by Andres Freund and further modified  
by me.  

M doc/src/sgml/catalogs.sgml
M doc/src/sgml/func.sgml
M src/backend/access/transam/xlogfuncs.c
M src/backend/catalog/system_views.sql
M src/backend/replication/slotfuncs.c
M src/include/catalog/catversion.h
M src/include/catalog/pg_proc.h

Further code review for pg_lsn data type.

commit   : 694e3d139a9d090c58494428bebfadad216419da    
  
author   : Robert Haas <[email protected]>    
date     : Wed, 19 Feb 2014 10:06:59 -0500    
  
committer: Robert Haas <[email protected]>    
date     : Wed, 19 Feb 2014 10:06:59 -0500    

Click here for diff

Change input function error messages to be more consistent with what is  
done elsewhere.  Remove a bunch of redundant type casts, so that the  
compiler will warn us if we screw up.  Don't pass LSNs by value on  
platforms where a Datum is only 32 bytes, per buildfarm.  Move macros  
for packing and unpacking LSNs to pg_lsn.h so that we can include  
access/xlogdefs.h, to avoid an unsatisfied dependency on XLogRecPtr.  

M src/backend/utils/adt/pg_lsn.c
M src/include/catalog/pg_type.h
M src/include/fmgr.h
M src/include/postgres.h
M src/include/utils/pg_lsn.h
M src/test/regress/expected/pg_lsn.out

pg_lsn macro naming and type behavior revisions.

commit   : 844a28a9dd1a48045ad1db9246da5e2783c9bd40    
  
author   : Robert Haas <[email protected]>    
date     : Wed, 19 Feb 2014 09:34:15 -0500    
  
committer: Robert Haas <[email protected]>    
date     : Wed, 19 Feb 2014 09:34:15 -0500    

Click here for diff

Change pg_lsn_mi so that it can return negative values when subtracting  
LSNs, and clean up some perhaps ill-considered macro names.  

M src/backend/utils/adt/pg_lsn.c
M src/include/fmgr.h
M src/include/postgres.h
M src/test/regress/expected/pg_lsn.out

Add a pg_lsn data type, to represent an LSN.

commit   : 7d03a83f4d0736ba869fa6f93973f7623a27038a    
  
author   : Robert Haas <[email protected]>    
date     : Wed, 19 Feb 2014 08:35:23 -0500    
  
committer: Robert Haas <[email protected]>    
date     : Wed, 19 Feb 2014 08:35:23 -0500    

Click here for diff

Robert Haas and Michael Paquier  

M doc/src/sgml/datatype.sgml
M src/backend/utils/adt/Makefile
A src/backend/utils/adt/pg_lsn.c
M src/include/catalog/catversion.h
M src/include/catalog/pg_operator.h
M src/include/catalog/pg_proc.h
M src/include/catalog/pg_type.h
M src/include/fmgr.h
M src/include/postgres.h
A src/include/utils/pg_lsn.h
A src/test/regress/expected/pg_lsn.out
M src/test/regress/parallel_schedule
M src/test/regress/serial_schedule
A src/test/regress/sql/pg_lsn.sql

Remove broken code that tried to handle OVERLAPS with a single argument.

commit   : a222f7fda6a04ab8ec655cd5a9de5ff70ff916c3    
  
author   : Tom Lane <[email protected]>    
date     : Tue, 18 Feb 2014 12:44:20 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Tue, 18 Feb 2014 12:44:20 -0500    

Click here for diff

The SQL standard says that OVERLAPS should have a two-element row  
constructor on each side.  The original coding of OVERLAPS support in  
our grammar attempted to extend that by allowing a single-element row  
constructor, which it internally duplicated ... or tried to, anyway.  
But that code has certainly not worked since our List infrastructure was  
rewritten in 2004, and I'm none too sure it worked before that.  As it  
stands, it ends up building a List that includes itself, leading to  
assorted undesirable behaviors later in the parser.  
  
Even if it worked as intended, it'd be a bit evil because of the  
possibility of duplicate evaluation of a volatile function that the user  
had written only once.  Given the lack of documentation, test cases, or  
complaints, let's just get rid of the idea and only support the standard  
syntax.  
  
While we're at it, improve the error cursor positioning for the  
wrong-number-of-arguments errors, and inline the makeOverlaps() function  
since it's only called in one place anyway.  
  
Per bug #9227 from Joshua Yanovski.  Initial patch by Joshua Yanovski,  
extended a bit by me.  

M src/backend/parser/gram.y

Disable RandomizedBaseAddress on MSVC builds

commit   : 7f3e17b4827b61ad84e0774e3e43da4c57c4487f    
  
author   : Magnus Hagander <[email protected]>    
date     : Tue, 18 Feb 2014 14:45:58 +0100    
  
committer: Magnus Hagander <[email protected]>    
date     : Tue, 18 Feb 2014 14:45:58 +0100    

Click here for diff

The ASLR in Windows 8/Windows 2012 can break PostgreSQL's shared memory. It  
doesn't fail every time (which is explained by the Random part in ASLR), but  
can fail with errors abut failing to reserve shared memory region.  
  
MauMau, reviewed by Craig Ringer  

M src/tools/msvc/MSBuildProject.pm
M src/tools/msvc/VCBuildProject.pm

Fix comment; checkpointer, not bgwriter, performs checkpoints since 9.2.

commit   : 057152b37c8dbbddf87de2be32314a3d4fec5d5e    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Tue, 18 Feb 2014 09:48:18 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Tue, 18 Feb 2014 09:48:18 +0200    

Click here for diff

Amit Langote  

M src/backend/access/transam/xlog.c

Last-minute updates for release notes.

commit   : 7b1fab3fd2e17063fb1ec98e8ff5512a6b3da9b6    
  
author   : Tom Lane <[email protected]>    
date     : Mon, 17 Feb 2014 14:25:34 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Mon, 17 Feb 2014 14:25:34 -0500    

Click here for diff

Add entries for security issues.  
  
Security: CVE-2014-0060 through CVE-2014-0067  

M doc/src/sgml/release-8.4.sgml
M doc/src/sgml/release-9.0.sgml
M doc/src/sgml/release-9.1.sgml
M doc/src/sgml/release-9.2.sgml
M doc/src/sgml/release-9.3.sgml

Fix capitalization in README.

commit   : 876f78d57566a60e443d40f7c789c36566749e2f    
  
author   : Robert Haas <[email protected]>    
date     : Mon, 17 Feb 2014 14:02:10 -0500    
  
committer: Robert Haas <[email protected]>    
date     : Mon, 17 Feb 2014 14:02:10 -0500    

Click here for diff

Vik Fearing  

M src/backend/storage/buffer/README

Improve documentation about multixact IDs.

commit   : e7f409756dac9fedc12d5aece0f8df5efb8d9e01    
  
author   : Tom Lane <[email protected]>    
date     : Mon, 17 Feb 2014 12:20:57 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Mon, 17 Feb 2014 12:20:57 -0500    

Click here for diff

Per gripe from Josh Berkus.  

M doc/src/sgml/maintenance.sgml
M doc/src/sgml/release-9.3.sgml

Document risks of "make check" in the regression testing instructions.

commit   : 6ef325429cad60d7d24504fa25b5318fd4e35379    
  
author   : Tom Lane <[email protected]>    
date     : Mon, 17 Feb 2014 11:24:32 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Mon, 17 Feb 2014 11:24:32 -0500    

Click here for diff

Since the temporary server started by "make check" uses "trust"  
authentication, another user on the same machine could connect to it  
as database superuser, and then potentially exploit the privileges of  
the operating-system user who started the tests.  We should change  
the testing procedures to prevent this risk; but discussion is required  
about the best way to do that, as well as more testing than is practical  
for an undisclosed security problem.  Besides, the same issue probably  
affects some user-written test harnesses.  So for the moment, we'll just  
warn people against using "make check" when there are untrusted users on  
the same machine.  
  
In passing, remove some ancient advice that suggested making the  
regression testing subtree world-writable if you'd built as root.  
That looks dangerously insecure in modern contexts, and anyway we  
should not be encouraging people to build Postgres as root.  
  
Security: CVE-2014-0067  

M doc/src/sgml/regress.sgml

Prevent potential overruns of fixed-size buffers.

commit   : 01824385aead50e557ca1af28640460fa9877d51    
  
author   : Tom Lane <[email protected]>    
date     : Mon, 17 Feb 2014 11:20:21 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Mon, 17 Feb 2014 11:20:21 -0500    

Click here for diff

Coverity identified a number of places in which it couldn't prove that a  
string being copied into a fixed-size buffer would fit.  We believe that  
most, perhaps all of these are in fact safe, or are copying data that is  
coming from a trusted source so that any overrun is not really a security  
issue.  Nonetheless it seems prudent to forestall any risk by using  
strlcpy() and similar functions.  
  
Fixes by Peter Eisentraut and Jozef Mlich based on Coverity reports.  
  
In addition, fix a potential null-pointer-dereference crash in  
contrib/chkpass.  The crypt(3) function is defined to return NULL on  
failure, but chkpass.c didn't check for that before using the result.  
The main practical case in which this could be an issue is if libc is  
configured to refuse to execute unapproved hashing algorithms (e.g.,  
"FIPS mode").  This ideally should've been a separate commit, but  
since it touches code adjacent to one of the buffer overrun changes,  
I included it in this commit to avoid last-minute merge issues.  
This issue was reported by Honza Horak.  
  
Security: CVE-2014-0065 for buffer overruns, CVE-2014-0066 for crypt()  

M contrib/chkpass/chkpass.c
M contrib/pg_standby/pg_standby.c
M src/backend/access/transam/xlog.c
M src/backend/tsearch/spell.c
M src/backend/utils/adt/datetime.c
M src/bin/initdb/findtimezone.c
M src/bin/pg_basebackup/pg_basebackup.c
M src/common/exec.c
M src/interfaces/ecpg/preproc/pgc.l
M src/interfaces/libpq/fe-protocol2.c
M src/interfaces/libpq/fe-protocol3.c
M src/test/regress/pg_regress.c
M src/timezone/pgtz.c

Predict integer overflow to avoid buffer overruns.

commit   : 31400a673325147e1205326008e32135a78b4d8a    
  
author   : Noah Misch <[email protected]>    
date     : Mon, 17 Feb 2014 09:33:31 -0500    
  
committer: Noah Misch <[email protected]>    
date     : Mon, 17 Feb 2014 09:33:31 -0500    

Click here for diff

Several functions, mostly type input functions, calculated an allocation  
size such that the calculation wrapped to a small positive value when  
arguments implied a sufficiently-large requirement.  Writes past the end  
of the inadvertent small allocation followed shortly thereafter.  
Coverity identified the path_in() vulnerability; code inspection led to  
the rest.  In passing, add check_stack_depth() to prevent stack overflow  
in related functions.  
  
Back-patch to 8.4 (all supported versions).  The non-comment hstore  
changes touch code that did not exist in 8.4, so that part stops at 9.0.  
  
Noah Misch and Heikki Linnakangas, reviewed by Tom Lane.  
  
Security: CVE-2014-0064  

M contrib/hstore/hstore.h
M contrib/hstore/hstore_io.c
M contrib/hstore/hstore_op.c
M contrib/intarray/_int.h
M contrib/intarray/_int_bool.c
M contrib/ltree/ltree.h
M contrib/ltree/ltree_io.c
M contrib/ltree/ltxtquery_io.c
M src/backend/utils/adt/geo_ops.c
M src/backend/utils/adt/tsquery.c
M src/backend/utils/adt/tsquery_util.c
M src/backend/utils/adt/txid.c
M src/backend/utils/adt/varbit.c
M src/include/tsearch/ts_type.h
M src/include/utils/varbit.h

Fix handling of wide datetime input/output.

commit   : 4318daecc959886d001a6e79c6ea853e8b1dfb4b    
  
author   : Noah Misch <[email protected]>    
date     : Mon, 17 Feb 2014 09:33:31 -0500    
  
committer: Noah Misch <[email protected]>    
date     : Mon, 17 Feb 2014 09:33:31 -0500    

Click here for diff

Many server functions use the MAXDATELEN constant to size a buffer for  
parsing or displaying a datetime value.  It was much too small for the  
longest possible interval output and slightly too small for certain  
valid timestamp input, particularly input with a long timezone name.  
The long input was rejected needlessly; the long output caused  
interval_out() to overrun its buffer.  ECPG's pgtypes library has a copy  
of the vulnerable functions, which bore the same vulnerabilities along  
with some of its own.  In contrast to the server, certain long inputs  
caused stack overflow rather than failing cleanly.  Back-patch to 8.4  
(all supported versions).  
  
Reported by Daniel Schüssler, reviewed by Tom Lane.  
  
Security: CVE-2014-0063  

M src/include/utils/datetime.h
M src/interfaces/ecpg/pgtypeslib/datetime.c
M src/interfaces/ecpg/pgtypeslib/dt.h
M src/interfaces/ecpg/pgtypeslib/dt_common.c
M src/interfaces/ecpg/pgtypeslib/interval.c
M src/interfaces/ecpg/pgtypeslib/timestamp.c
M src/interfaces/ecpg/test/expected/pgtypeslib-dt_test2.c
M src/interfaces/ecpg/test/expected/pgtypeslib-dt_test2.stdout
M src/interfaces/ecpg/test/pgtypeslib/dt_test2.pgc
M src/test/regress/expected/interval.out
M src/test/regress/sql/interval.sql

Avoid repeated name lookups during table and index DDL.

commit   : 5f173040e324f6c2eebb90d86cf1b0cdb5890f0a    
  
author   : Robert Haas <[email protected]>    
date     : Mon, 17 Feb 2014 09:33:31 -0500    
  
committer: Robert Haas <[email protected]>    
date     : Mon, 17 Feb 2014 09:33:31 -0500    

Click here for diff

If the name lookups come to different conclusions due to concurrent  
activity, we might perform some parts of the DDL on a different table  
than other parts.  At least in the case of CREATE INDEX, this can be  
used to cause the permissions checks to be performed against a  
different table than the index creation, allowing for a privilege  
escalation attack.  
  
This changes the calling convention for DefineIndex, CreateTrigger,  
transformIndexStmt, transformAlterTableStmt, CheckIndexCompatible  
(in 9.2 and newer), and AlterTable (in 9.1 and older).  In addition,  
CheckRelationOwnership is removed in 9.2 and newer and the calling  
convention is changed in older branches.  A field has also been added  
to the Constraint node (FkConstraint in 8.4).  Third-party code calling  
these functions or using the Constraint node will require updating.  
  
Report by Andres Freund.  Patch by Robert Haas and Andres Freund,  
reviewed by Tom Lane.  
  
Security: CVE-2014-0062  

M src/backend/bootstrap/bootparse.y
M src/backend/catalog/index.c
M src/backend/catalog/pg_constraint.c
M src/backend/commands/indexcmds.c
M src/backend/commands/tablecmds.c
M src/backend/commands/trigger.c
M src/backend/nodes/copyfuncs.c
M src/backend/nodes/equalfuncs.c
M src/backend/nodes/outfuncs.c
M src/backend/parser/parse_utilcmd.c
M src/backend/tcop/utility.c
M src/include/catalog/pg_constraint.h
M src/include/commands/defrem.h
M src/include/commands/tablecmds.h
M src/include/commands/trigger.h
M src/include/nodes/parsenodes.h
M src/include/parser/parse_utilcmd.h
M src/include/tcop/utility.h

Document security implications of check_function_bodies.

commit   : 540b4e5bc85f7e44842493a810b04a84881db20f    
  
author   : Noah Misch <[email protected]>    
date     : Mon, 17 Feb 2014 09:33:31 -0500    
  
committer: Noah Misch <[email protected]>    
date     : Mon, 17 Feb 2014 09:33:31 -0500    

Click here for diff

Back-patch to 8.4 (all supported versions).  

M doc/src/sgml/config.sgml
M doc/src/sgml/plhandler.sgml

Prevent privilege escalation in explicit calls to PL validators.

commit   : 537cbd35c893e67a63c59bc636c3e888bd228bc7    
  
author   : Noah Misch <[email protected]>    
date     : Mon, 17 Feb 2014 09:33:31 -0500    
  
committer: Noah Misch <[email protected]>    
date     : Mon, 17 Feb 2014 09:33:31 -0500    

Click here for diff

The primary role of PL validators is to be called implicitly during  
CREATE FUNCTION, but they are also normal functions that a user can call  
explicitly.  Add a permissions check to each validator to ensure that a  
user cannot use explicit validator calls to achieve things he could not  
otherwise achieve.  Back-patch to 8.4 (all supported versions).  
Non-core procedural language extensions ought to make the same two-line  
change to their own validators.  
  
Andres Freund, reviewed by Tom Lane and Noah Misch.  
  
Security: CVE-2014-0061  

M doc/src/sgml/plhandler.sgml
M src/backend/catalog/pg_proc.c
M src/backend/commands/functioncmds.c
M src/backend/utils/fmgr/fmgr.c
M src/include/fmgr.h
M src/pl/plperl/plperl.c
M src/pl/plpgsql/src/pl_handler.c
M src/pl/plpython/plpy_main.c

Shore up ADMIN OPTION restrictions.

commit   : fea164a72a7bfd50d77ba5fb418d357f8f2bb7d0    
  
author   : Noah Misch <[email protected]>    
date     : Mon, 17 Feb 2014 09:33:31 -0500    
  
committer: Noah Misch <[email protected]>    
date     : Mon, 17 Feb 2014 09:33:31 -0500    

Click here for diff

Granting a role without ADMIN OPTION is supposed to prevent the grantee  
from adding or removing members from the granted role.  Issuing SET ROLE  
before the GRANT bypassed that, because the role itself had an implicit  
right to add or remove members.  Plug that hole by recognizing that  
implicit right only when the session user matches the current role.  
Additionally, do not recognize it during a security-restricted operation  
or during execution of a SECURITY DEFINER function.  The restriction on  
SECURITY DEFINER is not security-critical.  However, it seems best for a  
user testing his own SECURITY DEFINER function to see the same behavior  
others will see.  Back-patch to 8.4 (all supported versions).  
  
The SQL standards do not conflate roles and users as PostgreSQL does;  
only SQL roles have members, and only SQL users initiate sessions.  An  
application using PostgreSQL users and roles as SQL users and roles will  
never attempt to grant membership in the role that is the session user,  
so the implicit right to add or remove members will never arise.  
  
The security impact was mostly that a role member could revoke access  
from others, contrary to the wishes of his own grantor.  Unapproved role  
member additions are less notable, because the member can still largely  
achieve that by creating a view or a SECURITY DEFINER function.  
  
Reviewed by Andres Freund and Tom Lane.  Reported, independently, by  
Jonas Sundman and Noah Misch.  
  
Security: CVE-2014-0060  

M doc/src/sgml/ref/grant.sgml
M src/backend/commands/user.c
M src/backend/utils/adt/acl.c
M src/test/regress/expected/privileges.out
M src/test/regress/sql/privileges.sql

Release notes for 9.3.3, 9.2.7, 9.1.12, 9.0.16, 8.4.20.

commit   : 0983315b1d37cc17b2174dad87449d8402e357ee    
  
author   : Tom Lane <[email protected]>    
date     : Sun, 16 Feb 2014 22:08:28 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Sun, 16 Feb 2014 22:08:28 -0500    

Click here for diff

M doc/src/sgml/release-8.4.sgml
M doc/src/sgml/release-9.0.sgml
M doc/src/sgml/release-9.1.sgml
M doc/src/sgml/release-9.2.sgml

PGDLLIMPORT-ify MainLWLockArray, ProcDiePending, proc_exit_inprogress.

commit   : fa1f0d785921b34a98562a806aed2c3d34aaf7be    
  
author   : Tom Lane <[email protected]>    
date     : Sun, 16 Feb 2014 20:12:43 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Sun, 16 Feb 2014 20:12:43 -0500    

Click here for diff

These are needed in HEAD to make assorted contrib modules build on Windows.  
Now that all the MSVC and Mingw buildfarm members seem to be on the same  
page about the need for them, we can have some confidence that future  
problems of this ilk will be detected promptly; there seems nothing more  
to be learned by delaying this fix further.  
  
I chose to mark QueryCancelPending as well, since it's easy to imagine code  
that wants to touch ProcDiePending also caring about QueryCancelPending.  

M src/include/miscadmin.h
M src/include/storage/ipc.h
M src/include/storage/lwlock.h

Fix unportable coding in tarCreateHeader().

commit   : a1c802712c369af4085c365cb79c3063b8407ef4    
  
author   : Tom Lane <[email protected]>    
date     : Sun, 16 Feb 2014 20:01:18 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Sun, 16 Feb 2014 20:01:18 -0500    

Click here for diff

uid_t and gid_t might be wider than int on some platforms.  
Per buildfarm member brolga.  

M src/port/tar.c

Revert to using --enable-auto-import in Cygwin builds.

commit   : 8d6e2d4abf77c422714448e5f4270fdb1a84d973    
  
author   : Tom Lane <[email protected]>    
date     : Sun, 16 Feb 2014 15:14:04 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Sun, 16 Feb 2014 15:14:04 -0500    

Click here for diff

Disabling auto-import requires that all libraries we use be careful about  
declspecs for exported variables; and it seems they aren't.  This means  
that Cygwin will not give us useful info about missing PGDLLIMPORT markers;  
but it's probably sufficient that MSVC and Mingw builds do.  

M src/template/cygwin

Further wordsmithing on 9.3.3 release notes.

commit   : 734ff84b086e098e6106f19c4146357c5eaa9594    
  
author   : Tom Lane <[email protected]>    
date     : Sun, 16 Feb 2014 14:54:28 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Sun, 16 Feb 2014 14:54:28 -0500    

Click here for diff

No substantive changes, but reorder some items and improve some  
descriptions.  

M doc/src/sgml/release-9.3.sgml

PGDLLIMPORT'ify DateStyle and IntervalStyle.

commit   : a5cf60682e4c61e7cc35c5024abf52ed561775ea    
  
author   : Tom Lane <[email protected]>    
date     : Sun, 16 Feb 2014 12:37:07 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Sun, 16 Feb 2014 12:37:07 -0500    

Click here for diff

This is needed on Windows to support contrib/postgres_fdw.  Although it's  
been broken since last March, we didn't notice until recently because there  
were no active buildfarm members that complained about missing PGDLLIMPORT  
marking.  Efforts are underway to improve that situation, in support of  
which we're delaying fixing some other cases of global variables that  
should be marked PGDLLIMPORT.  However, this case affects 9.3, so we  
can't wait any longer to fix it.  
  
I chose to mark DateOrder as well, though it's not strictly necessary  
for postgres_fdw.  

M src/include/miscadmin.h

Improve release notes per comments from Andres Freund.

commit   : 8fd994e40cb42b56d6bdef07e1bd7ac79270816b    
  
author   : Tom Lane <[email protected]>    
date     : Sun, 16 Feb 2014 12:03:54 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Sun, 16 Feb 2014 12:03:54 -0500    

Click here for diff

Make a bit more noise about the timeout-interrupt bug.  Also, remove the  
release note entry for commit 423e1211a; that patch fixed a problem  
introduced post-9.3.2, so there's no need to document it in the release  
notes.  

M doc/src/sgml/release-9.3.sgml

On Windows, expect to find Tcl DLL in bin directory not lib directory.

commit   : 56caaf195e996919088d532832a2a57ca33431b2    
  
author   : Tom Lane <[email protected]>    
date     : Sun, 16 Feb 2014 11:24:38 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Sun, 16 Feb 2014 11:24:38 -0500    

Click here for diff

Still another step in the continuing saga of trying to get  
--disable-auto-import to work.  
  
Hiroshi Inoue  

M src/pl/tcl/Makefile

First-draft release notes for 9.3.3.

commit   : cefd3e507d7cc402225e5da100d05dcafb90c0bd    
  
author   : Tom Lane <[email protected]>    
date     : Sun, 16 Feb 2014 00:40:37 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Sun, 16 Feb 2014 00:40:37 -0500    

Click here for diff

As usual, the release notes for older branches will be made by cutting  
these down, but put them up for community review first.  

M doc/src/sgml/release-9.3.sgml

Fix unportable coding in BackgroundWorkerStateChange().

commit   : 643f75ca9b5b3883395576aaf5246b67270a657b    
  
author   : Tom Lane <[email protected]>    
date     : Sat, 15 Feb 2014 17:15:05 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Sat, 15 Feb 2014 17:15:05 -0500    

Click here for diff

PIDs aren't necessarily ints; our usual practice for printing them  
is to explicitly cast to long.  Per buildfarm member rover_firefly.  

M src/backend/postmaster/bgworker.c

Fix unportable coding in DetermineSleepTime().

commit   : f0ee42d59b797603d645df8876ae3abf6d016f1e    
  
author   : Tom Lane <[email protected]>    
date     : Sat, 15 Feb 2014 17:09:50 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Sat, 15 Feb 2014 17:09:50 -0500    

Click here for diff

We should not assume that struct timeval.tv_sec is a long, because  
it ain't necessarily.  (POSIX says that it's a time_t, which might  
well be 64 bits now or in the future; or for that matter might be  
32 bits on machines with 64-bit longs.)  Per buildfarm member panther.  
  
Back-patch to 9.3 where the dubious coding was introduced.  

M src/backend/postmaster/postmaster.c

commit   : 60ff2fdd9970ba29f5267317a5e7354d2658c1e5    
  
author   : Tom Lane <[email protected]>    
date     : Sat, 15 Feb 2014 14:31:30 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Sat, 15 Feb 2014 14:31:30 -0500    

Click here for diff

We used to have externs for getopt() and its API variables scattered  
all over the place.  Now that we find we're going to need to tweak the  
variable declarations for Cygwin, it seems like a good idea to have  
just one place to tweak.  
  
In this commit, the variables are declared "#ifndef HAVE_GETOPT_H".  
That may or may not work everywhere, but we'll soon find out.  
  
Andres Freund  

M contrib/oid2name/oid2name.c
M contrib/pg_archivecleanup/pg_archivecleanup.c
M contrib/pg_standby/pg_standby.c
M contrib/pg_upgrade/option.c
M contrib/pgbench/pgbench.c
M contrib/vacuumlo/vacuumlo.c
M src/backend/bootstrap/bootstrap.c
M src/backend/postmaster/postmaster.c
M src/backend/tcop/postgres.c
M src/bin/pg_dump/pg_dump.c
M src/bin/pg_dump/pg_restore.c
M src/bin/pg_resetxlog/pg_resetxlog.c
M src/bin/psql/startup.c
M src/include/getopt_long.h
A src/include/pg_getopt.h
M src/include/port.h
M src/port/getopt.c
M src/test/isolation/isolationtester.c
M src/timezone/zic.c

Remove use of sscanf in pg_upgrade, and add C comment to pg_dump

commit   : 32be1c8e900b89a89ec5e3a064c6b6010869d062    
  
author   : Bruce Momjian <[email protected]>    
date     : Sat, 15 Feb 2014 11:50:56 -0500    
  
committer: Bruce Momjian <[email protected]>    
date     : Sat, 15 Feb 2014 11:50:56 -0500    

Click here for diff

Per report from Jackie Chang  

M contrib/pg_upgrade/option.c
M src/bin/pg_dump/pg_backup_directory.c

psql: Add C comment about gset_prefix being freed later

commit   : a0d8947acb8b4300cc771b0d5a2f53e4e5148a40    
  
author   : Bruce Momjian <[email protected]>    
date     : Sat, 15 Feb 2014 00:09:24 -0500    
  
committer: Bruce Momjian <[email protected]>    
date     : Sat, 15 Feb 2014 00:09:24 -0500    

Click here for diff

M src/bin/psql/command.c

Ooops, forgot to remove solar87 and friends from src/timezone/Makefile.

commit   : 1c5143a0b58259df723ed2473ae11d45d08a8b24    
  
author   : Tom Lane <[email protected]>    
date     : Fri, 14 Feb 2014 23:20:08 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Fri, 14 Feb 2014 23:20:08 -0500    

Click here for diff

Per buildfarm.  

M src/timezone/Makefile

Update time zone data files to tzdata release 2013i.

commit   : e04641f4b4d1578f00160878f1f3f801f38221cb    
  
author   : Tom Lane <[email protected]>    
date     : Fri, 14 Feb 2014 21:59:13 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Fri, 14 Feb 2014 21:59:13 -0500    

Click here for diff

DST law changes in Jordan; historical changes in Cuba.  
  
Also, remove the zones Asia/Riyadh87, Asia/Riyadh88, and Asia/Riyadh89.  
Per the upstream announcement:  
    The files solar87, solar88, and solar89 are no longer distributed.  
    They were a negative experiment -- that is, a demonstration that  
    tz data can represent solar time only with some difficulty and error.  
    Their presence in the distribution caused confusion, as Riyadh  
    civil time was generally not solar time in those years.  

M src/timezone/data/asia
M src/timezone/data/northamerica
D src/timezone/data/solar87
D src/timezone/data/solar88
D src/timezone/data/solar89

Fix fat-fingered makefile changes for pltcl.

commit   : 638b153f2a23dadbbc5079c30f062a10be42ad11    
  
author   : Tom Lane <[email protected]>    
date     : Fri, 14 Feb 2014 17:10:53 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Fri, 14 Feb 2014 17:10:53 -0500    

Click here for diff

I put the OBJS assignments in the wrong order.  Per buildfarm.  

M src/pl/tcl/Makefile

Update regression testing instructions.

commit   : 2128c52f5c476276fcaa2bc49b31f6d445365f95    
  
author   : Tom Lane <[email protected]>    
date     : Fri, 14 Feb 2014 16:50:22 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Fri, 14 Feb 2014 16:50:22 -0500    

Click here for diff

This documentation never got the word about the existence of check-world or  
installcheck-world.  Revise to recommend use of those, and document all the  
subsidiary test suites.  Do some minor wordsmithing elsewhere, too.  
  
In passing, remove markup related to generation of plain-text regression  
test instructions, since we don't do that anymore.  
  
Back-patch to 9.1 where check-world was added.  (installcheck-world exists  
in 9.0; but since check-world doesn't, this patch would need additional  
work to cover that branch, and it doesn't seem worth the effort.)  

M doc/src/sgml/regress.sgml

In mingw builds, make our own import library for libtcl, too.

commit   : dcbf39774ff3159e17c614a24740ce00fdb14620    
  
author   : Tom Lane <[email protected]>    
date     : Fri, 14 Feb 2014 13:13:06 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Fri, 14 Feb 2014 13:13:06 -0500    

Click here for diff

Per buildfarm results.  

M src/pl/tcl/Makefile

Suggest shell here-documents instead of psql -c for multiple commands.

commit   : 1ea081bbd73bffed2bd4b0300fe9d99afec465ce    
  
author   : Tom Lane <[email protected]>    
date     : Fri, 14 Feb 2014 12:54:39 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Fri, 14 Feb 2014 12:54:39 -0500    

Click here for diff

The documentation suggested using "echo | psql", but not the often-superior  
alternative of a here-document.  Also, be more direct about suggesting  
that people avoid -c for multiple commands.  Per discussion.  

M doc/src/sgml/ref/psql-ref.sgml

In mingw builds, make our own import library for libperl.

commit   : 02b61dd08f9973eee3058c458afba7b9336230dc    
  
author   : Tom Lane <[email protected]>    
date     : Fri, 14 Feb 2014 11:51:02 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Fri, 14 Feb 2014 11:51:02 -0500    

Click here for diff

Borrow the method already used by plpython.  This is pretty ugly, but  
it might fix the build failure exhibited by buildfarm member narwhal  
since commit 846e91e0223cf9f2821c3ad4dfffffbb929cb027.  
  
Hiroshi Inoue  

M src/pl/plperl/GNUmakefile

Cosmetic improvements in plpython's make rule for libpython import library.

commit   : a7983e989d9cafc9cef49becfee054e34b1ed9b4    
  
author   : Tom Lane <[email protected]>    
date     : Fri, 14 Feb 2014 11:31:35 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Fri, 14 Feb 2014 11:31:35 -0500    

Click here for diff

This build technique is remarkably ugly, but that doesn't mean it has  
to be unreadable too.  Be a bit more liberal with the vertical whitespace,  
and give the .def file a proper dependency, just in case.  

M src/pl/plpython/Makefile

Change the order that pg_xlog and WAL archive are polled for WAL segments.

commit   : 4d894b41cd12179b710526eba9dc62c2b99abc4d    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Fri, 14 Feb 2014 15:15:09 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Fri, 14 Feb 2014 15:15:09 +0200    

Click here for diff

If there is a WAL segment with same ID but different TLI present in both  
the WAL archive and pg_xlog, prefer the one with higher TLI. Before this  
patch, the archive was polled first, for all expected TLIs, and only if no  
file was found was pg_xlog scanned. This was a change in behavior from 9.3,  
which first scanned archive and pg_xlog for the highest TLI, then archive  
and pg_xlog for the next highest TLI and so forth. This patch reverts the  
behavior back to what it was in 9.2.  
  
The reason for this is that if for example you try to do archive recovery  
to timeline 2, which branched off timeline 1, but the WAL for timeline 2 is  
not archived yet, we would replay past the timeline switch point on  
timeline 1 using the archived files, before even looking timeline 2's files  
in pg_xlog  
  
Report and patch by Kyotaro Horiguchi. Backpatch to 9.3 where the behavior  
was changed.  

M src/backend/access/transam/xlog.c

Fix typo

commit   : 0f2ca0075c4bd42351cd48b3e6889f11f0e03e65    
  
author   : Peter Eisentraut <[email protected]>    
date     : Thu, 13 Feb 2014 21:50:43 -0500    
  
committer: Peter Eisentraut <[email protected]>    
date     : Thu, 13 Feb 2014 21:50:43 -0500    

Click here for diff

Stefan Kaltenbrunner  

M src/include/mb/pg_wchar.h

Add C comment about problems with CHAR() space trimming

commit   : 9c57d11fca3b87daa741151f75085e2554ee310f    
  
author   : Bruce Momjian <[email protected]>    
date     : Thu, 13 Feb 2014 21:45:57 -0500    
  
committer: Bruce Momjian <[email protected]>    
date     : Thu, 13 Feb 2014 21:45:57 -0500    

Click here for diff

M src/backend/utils/adt/varchar.c

Clean up error cases in psql's COPY TO STDOUT/FROM STDIN code.

commit   : b8f00a46bc4ae77c09f4564f3b3c675fb9e51974    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 13 Feb 2014 18:45:12 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 13 Feb 2014 18:45:12 -0500    

Click here for diff

Adjust handleCopyOut() to stop trying to write data once it's failed  
one time.  For typical cases such as out-of-disk-space or broken-pipe,  
additional attempts aren't going to do anything but waste time, and  
in any case clean truncation of the output seems like a better behavior  
than randomly dropping blocks in the middle.  
  
Also remove dubious (and misleadingly documented) attempt to force our way  
out of COPY_OUT state if libpq didn't do that.  If we did have a situation  
like that, it'd be a bug in libpq and would be better fixed there, IMO.  
We can hope that commit fa4440f51628d692f077d54b8313aea31af087ea took care  
of any such problems, anyway.  
  
Also fix longstanding bug in handleCopyIn(): PQputCopyEnd() only supports  
a non-null errormsg parameter in protocol version 3, and will actively  
fail if one is passed in version 2.  This would've made our attempts  
to get out of COPY_IN state after a failure into infinite loops when  
talking to pre-7.4 servers.  
  
Back-patch the COPY_OUT state change business back to 9.2 where it was  
introduced, and the other two fixes into all supported branches.  

M src/bin/psql/copy.c

Separate multixact freezing parameters from xid's

commit   : 801c2dc72cb3c68a7c430bb244675b7a68fd541a    
  
author   : Alvaro Herrera <[email protected]>    
date     : Thu, 13 Feb 2014 19:30:30 -0300    
  
committer: Alvaro Herrera <[email protected]>    
date     : Thu, 13 Feb 2014 19:30:30 -0300    

Click here for diff

Previously we were piggybacking on transaction ID parameters to freeze  
multixacts; but since there isn't necessarily any relationship between  
rates of Xid and multixact consumption, this turns out not to be a good  
idea.  
  
Therefore, we now have multixact-specific freezing parameters:  
  
vacuum_multixact_freeze_min_age: when to remove multis as we come across  
them in vacuum (default to 5 million, i.e. early in comparison to Xid's  
default of 50 million)  
  
vacuum_multixact_freeze_table_age: when to force whole-table scans  
instead of scanning only the pages marked as not all visible in  
visibility map (default to 150 million, same as for Xids).  Whichever of  
both which reaches the 150 million mark earlier will cause a whole-table  
scan.  
  
autovacuum_multixact_freeze_max_age: when for cause emergency,  
uninterruptible whole-table scans (default to 400 million, double as  
that for Xids).  This means there shouldn't be more frequent emergency  
vacuuming than previously, unless multixacts are being used very  
rapidly.  
  
Backpatch to 9.3 where multixacts were made to persist enough to require  
freezing.  To avoid an ABI break in 9.3, VacuumStmt has a couple of  
fields in an unnatural place, and StdRdOptions is split in two so that  
the newly added fields can go at the end.  
  
Patch by me, reviewed by Robert Haas, with additional input from Andres  
Freund and Tom Lane.  

M doc/src/sgml/config.sgml
M doc/src/sgml/maintenance.sgml
M doc/src/sgml/ref/create_table.sgml
M src/backend/access/common/reloptions.c
M src/backend/access/transam/multixact.c
M src/backend/access/transam/varsup.c
M src/backend/commands/cluster.c
M src/backend/commands/vacuum.c
M src/backend/commands/vacuumlazy.c
M src/backend/nodes/copyfuncs.c
M src/backend/nodes/equalfuncs.c
M src/backend/parser/gram.y
M src/backend/postmaster/autovacuum.c
M src/backend/utils/misc/guc.c
M src/backend/utils/misc/postgresql.conf.sample
M src/include/commands/vacuum.h
M src/include/nodes/parsenodes.h
M src/include/postmaster/autovacuum.h
M src/include/utils/rel.h

docs: improve CREATE FUNCTION docs about language case and quoting

commit   : de4b6558be4285d8186e16f33ab474d619bb0cf6    
  
author   : Bruce Momjian <[email protected]>    
date     : Thu, 13 Feb 2014 17:07:05 -0500    
  
committer: Bruce Momjian <[email protected]>    
date     : Thu, 13 Feb 2014 17:07:05 -0500    

Click here for diff

Report from Marc Mamin  

M doc/src/sgml/ref/create_function.sgml

pgcrypto: clarify 'md5' (hash) table entry

commit   : 474cb24df7f6f85a936e87314edeb2deb92365cd    
  
author   : Bruce Momjian <[email protected]>    
date     : Thu, 13 Feb 2014 15:38:30 -0500    
  
committer: Bruce Momjian <[email protected]>    
date     : Thu, 13 Feb 2014 15:38:30 -0500    

Click here for diff

Per suggestion from Peter Eisentraut  

M doc/src/sgml/pgcrypto.sgml

Fix length checking for Unicode identifiers containing escapes (U&"...").

commit   : 44c216330201126d12e466442c667a8e091decd3    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 13 Feb 2014 14:24:42 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 13 Feb 2014 14:24:42 -0500    

Click here for diff

We used the length of the input string, not the de-escaped string, as  
the trigger for NAMEDATALEN truncation.  AFAICS this would only result  
in sometimes printing a phony truncation warning; but it's just luck  
that there was no worse problem, since we were violating the API spec  
for truncate_identifier().  Per bug #9204 from Joshua Yanovski.  
  
This has been wrong since the Unicode-identifier support was added,  
so back-patch to all supported branches.  

M src/backend/parser/scan.l

pg_upgrade: mention the need for tablespace snapshots in docs

commit   : 3f735ae831d3c249378280050b104ff751dfc668    
  
author   : Bruce Momjian <[email protected]>    
date     : Thu, 13 Feb 2014 05:06:22 -0500    
  
committer: Bruce Momjian <[email protected]>    
date     : Thu, 13 Feb 2014 05:06:22 -0500    

Click here for diff

M doc/src/sgml/pgupgrade.sgml

pg_upgrade: document use of file system and COW snapshots

commit   : bcec58cf1ebf20ea237be042d3ef774f887557a9    
  
author   : Bruce Momjian <[email protected]>    
date     : Wed, 12 Feb 2014 22:06:38 -0500    
  
committer: Bruce Momjian <[email protected]>    
date     : Wed, 12 Feb 2014 22:06:38 -0500    

Click here for diff

M doc/src/sgml/pgupgrade.sgml

Improve cross-references between minor version release notes.

commit   : 4a6f136c4676bd183b5c1145387eedd837c56ffa    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 12 Feb 2014 19:09:18 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 12 Feb 2014 19:09:18 -0500    

Click here for diff

We have a practice of providing a "bread crumb" trail between the minor  
versions where the migration section actually tells you to do something.  
Historically that was just plain text, eg, "see the release notes for  
9.2.4"; but if you're using a browser or PDF reader, it's a lot nicer  
if it's a live hyperlink.  So use "<xref>" instead.  Any argument against  
doing this vanished with the recent decommissioning of plain-text release  
notes.  
  
Vik Fearing  

M doc/src/sgml/release-7.4.sgml
M doc/src/sgml/release-8.0.sgml
M doc/src/sgml/release-8.1.sgml
M doc/src/sgml/release-8.2.sgml
M doc/src/sgml/release-8.3.sgml
M doc/src/sgml/release-8.4.sgml
M doc/src/sgml/release-9.0.sgml
M doc/src/sgml/release-9.1.sgml
M doc/src/sgml/release-9.2.sgml
M doc/src/sgml/release-9.3.sgml
M doc/src/sgml/release-old.sgml

Improve text of stub HISTORY file.

commit   : dea5a8c402b11819a24a06f1e110c371a908d359    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 12 Feb 2014 18:16:17 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 12 Feb 2014 18:16:17 -0500    

Click here for diff

Per Peter Eisentraut.  

M HISTORY

Improve libpq's error recovery for connection loss during COPY.

commit   : fa4440f51628d692f077d54b8313aea31af087ea    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 12 Feb 2014 17:50:07 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 12 Feb 2014 17:50:07 -0500    

Click here for diff

In pqSendSome, if the connection is already closed at entry, discard any  
queued output data before returning.  There is no possibility of ever  
sending the data, and anyway this corresponds to what we'd do if we'd  
detected a hard error while trying to send().  This avoids possible  
indefinite bloat of the output buffer if the application keeps trying  
to send data (or even just keeps trying to do PQputCopyEnd, as psql  
indeed will).  
  
Because PQputCopyEnd won't transition out of PGASYNC_COPY_IN state  
until it's successfully queued the COPY END message, and pqPutMsgEnd  
doesn't distinguish a queuing failure from a pqSendSome failure,  
this omission allowed an infinite loop in psql if the connection closure  
occurred when we had at least 8K queued to send.  It might be worth  
refactoring so that we can make that distinction, but for the moment  
the other changes made here seem to offer adequate defenses.  
  
To guard against other variants of this scenario, do not allow  
PQgetResult to return a PGRES_COPY_XXX result if the connection is  
already known dead.  Make sure it returns PGRES_FATAL_ERROR instead.  
  
Per report from Stephen Frost.  Back-patch to all active branches.  

M src/interfaces/libpq/fe-exec.c
M src/interfaces/libpq/fe-misc.c

Revert gmake/make release note changes

commit   : 993c3961a4166a766c9b0a67701e9c82432550cc    
  
author   : Bruce Momjian <[email protected]>    
date     : Wed, 12 Feb 2014 17:32:20 -0500    
  
committer: Bruce Momjian <[email protected]>    
date     : Wed, 12 Feb 2014 17:32:20 -0500    

Click here for diff

Backbranch release note changes cause merge conflicts.  

M doc/src/sgml/release-8.3.sgml
M doc/src/sgml/release-9.2.sgml

commit   : 2fc80e8e8304913c8dd1090bb2976632c0f4a8c3    
  
author   : Bruce Momjian <[email protected]>    
date     : Wed, 12 Feb 2014 17:29:19 -0500    
  
committer: Bruce Momjian <[email protected]>    
date     : Wed, 12 Feb 2014 17:29:19 -0500    

Click here for diff

This simplifies the docs and makes it easier to cut/paste command lines.  

M contrib/README
M contrib/pg_upgrade/TESTING
M doc/src/sgml/Makefile
M doc/src/sgml/contrib.sgml
M doc/src/sgml/docguide.sgml
M doc/src/sgml/installation.sgml
M doc/src/sgml/nls.sgml
M doc/src/sgml/pgupgrade.sgml
M doc/src/sgml/regress.sgml
M doc/src/sgml/release-8.3.sgml
M doc/src/sgml/release-9.2.sgml
M src/backend/port/ipc_test.c
M src/interfaces/ecpg/Makefile
M src/interfaces/ecpg/preproc/Makefile
M src/pl/plperl/README
M src/test/isolation/README
M src/test/locale/README
M src/test/regress/regressplans.sh
M src/timezone/Makefile
M src/timezone/README
M src/tools/pgindent/README
M src/tutorial/Makefile
M src/tutorial/README

pg_upgrade: dramatically reduce memory consumption

commit   : 2a2e40aaaad6d9d8a2c6a61817542a2d8c369935    
  
author   : Bruce Momjian <[email protected]>    
date     : Wed, 12 Feb 2014 16:35:24 -0500    
  
committer: Bruce Momjian <[email protected]>    
date     : Wed, 12 Feb 2014 16:35:24 -0500    

Click here for diff

Report from Jeff Janes  

M contrib/pg_upgrade/check.c
M contrib/pg_upgrade/info.c
M contrib/pg_upgrade/pg_upgrade.h

pg_test_fsync: add C comment about direct I/O and write size failure

commit   : f9bb944cd879949cf454b941f2b8fa7b00fcc1e4    
  
author   : Bruce Momjian <[email protected]>    
date     : Wed, 12 Feb 2014 15:38:14 -0500    
  
committer: Bruce Momjian <[email protected]>    
date     : Wed, 12 Feb 2014 15:38:14 -0500    

Click here for diff

Report from Marti Raudsepp  

M contrib/pg_test_fsync/pg_test_fsync.c

In XLogReadBufferExtended, don't assume P_NEW yields consecutive pages.

commit   : 6f2aead1ffec6f056dc3c371c2ec6a12d7d5ccd3    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 12 Feb 2014 14:52:16 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 12 Feb 2014 14:52:16 -0500    

Click here for diff

In a database that's not yet reached consistency, it's possible that some  
segments of a relation are not full-size but are not the last ones either.  
Because of the way smgrnblocks() works, asking for a new page with P_NEW  
will fill in the last not-full-size segment --- and if that makes it full  
size, the apparent EOF of the relation will increase by more than one page,  
so that the next P_NEW request will yield a page past the next consecutive  
one.  This breaks the relation-extension logic in XLogReadBufferExtended,  
possibly allowing a page update to be applied to some page far past where  
it was intended to go.  This appears to be the explanation for reports of  
table bloat on replication slaves compared to their masters, and probably  
explains some corrupted-slave reports as well.  
  
Fix the loop to check the page number it actually got, rather than merely  
Assert()'ing that dead reckoning got it to the desired place.  AFAICT,  
there are no other places that make assumptions about exactly which page  
they'll get from P_NEW.  
  
Problem identified by Greg Stark, though this is not the same as his  
proposed patch.  
  
It's been like this for a long time, so back-patch to all supported  
branches.  

M src/backend/access/transam/xlogutils.c

Add missing include, required on some platforms

commit   : 48870dd9f752db7f953dde54b3d16e82d529e0db    
  
author   : Magnus Hagander <[email protected]>    
date     : Wed, 12 Feb 2014 20:04:13 +0100    
  
committer: Magnus Hagander <[email protected]>    
date     : Wed, 12 Feb 2014 20:04:13 +0100    

Click here for diff

Noted by the buildfarm and Andres Freund  

M src/bin/pg_basebackup/pg_basebackup.c

Kill pg_basebackup background process when exiting

commit   : 63ab2befe0d2332a5571f46c1a2c0af9447c6a4b    
  
author   : Magnus Hagander <[email protected]>    
date     : Sun, 9 Feb 2014 13:10:14 +0100    
  
committer: Magnus Hagander <[email protected]>    
date     : Sun, 9 Feb 2014 13:10:14 +0100    

Click here for diff

If an error occurs in the foreground (backup) process of pg_basebackup,  
and we exit in a controlled way, the background process (streaming  
xlog process) would stay around and keep streaming.  

M src/bin/pg_basebackup/pg_basebackup.c
M src/bin/pg_basebackup/pg_receivexlog.c
M src/bin/pg_basebackup/streamutil.h

Use --disable-auto-import linker switch in Mingw builds, too.

commit   : 1c9acd5c86a71b8ab73bc139eb5e0ad292b9a7d4    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 12 Feb 2014 12:03:53 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 12 Feb 2014 12:03:53 -0500    

Click here for diff

This is evidently the default on buildfarm member narwhal, but that  
is a pretty ancient Mingw version, and there is reason to think that  
more recent versions of GNU ld have this feature turned on by default.  
Since we are trying to achieve consistency of link behavior across  
all Windows toolchains, let's just make sure here.  

M src/template/win32

Remove --enable-auto-import linker switch in Cygwin build.

commit   : 30657b796c7fdcaf9c0eb9ac53d4bab6399eb65b    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 12 Feb 2014 11:53:07 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 12 Feb 2014 11:53:07 -0500    

Click here for diff

This is expected to make it start failing when contrib modules  
reference non-PGDLLIMPORT'ed global variables, as the other Windows  
build methods do.  Aside from the value of consistency, the underlying  
implementation of this switch is pretty ugly and not really something  
we want to rely on if we have to use PGDLLIMPORT anyway for MSVC.  

M src/template/cygwin

doc: Postgres date-style date-only output is ISO

commit   : 8c9db4a5a4b5e8fe1142b1ea6659b225b7641a76    
  
author   : Bruce Momjian <[email protected]>    
date     : Wed, 12 Feb 2014 11:25:04 -0500    
  
committer: Bruce Momjian <[email protected]>    
date     : Wed, 12 Feb 2014 11:25:04 -0500    

Click here for diff

Backpatch to 9.3  
  
Report from MauMau  

M doc/src/sgml/datatype.sgml

commit   : b23fd2d8b3cdfea5b6998c1ab95ae3e776a8f832    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 12 Feb 2014 11:22:23 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 12 Feb 2014 11:22:23 -0500    

Click here for diff

Reading the GNU ld man page suggests that this is order-sensitive  
and should go in front of library references.  Correction to commit  
846e91e0223cf9f2821c3ad4dfffffbb929cb027.  

M src/Makefile.shlib

Make gendef.pl emit DATA annotations for global variables.

commit   : a5eed4d7706749046e74fa2e23823beb43f254fd    
  
author   : Tom Lane <[email protected]>    
date     : Tue, 11 Feb 2014 13:39:14 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Tue, 11 Feb 2014 13:39:14 -0500    

Click here for diff

This should make the MSVC build act more like builds for other platforms,  
i.e. backend global variables will be automatically available to loadable  
libraries without need for explicit PGDLLIMPORT marking.  
  
Craig Ringer  

M src/tools/msvc/gendef.pl

Flush a stray definition of $(DLLTOOL).

commit   : 7a98d323df2d0839ebb4aab2004c626b64343b76    
  
author   : Tom Lane <[email protected]>    
date     : Tue, 11 Feb 2014 12:59:48 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Tue, 11 Feb 2014 12:59:48 -0500    

Click here for diff

Even if this is needed, it'd be configure's responsibility to set it.  

M src/makefiles/Makefile.cygwin

Get rid of use of dlltool in Mingw builds.

commit   : 846e91e0223cf9f2821c3ad4dfffffbb929cb027    
  
author   : Tom Lane <[email protected]>    
date     : Tue, 11 Feb 2014 12:56:20 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Tue, 11 Feb 2014 12:56:20 -0500    

Click here for diff

We are almost completely out of the dlltool game, if this works.  
  
Hiroshi Inoue  

M src/Makefile.shlib
M src/backend/Makefile
M src/makefiles/Makefile.win32

Cygwin build fixes.

commit   : cba6ffaef3987211fb31ba869eb2a476bad6f6d3    
  
author   : Tom Lane <[email protected]>    
date     : Tue, 11 Feb 2014 12:10:52 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Tue, 11 Feb 2014 12:10:52 -0500    

Click here for diff

Get rid of use of dlltool for linking the main postgres executable.  
dlltool is obsolete and we'd prefer to stop depending on it.  
  
Also, include $(LDAP_LIBS_FE) in $(libpq_pgport).  (It's not clear that  
this is really needed, or why it's not a linker bug if it is needed.  
But reports are that it's needed on current Cygwin.)  
  
We might want to back-patch this if it works, but first let's see  
what the buildfarm thinks.  
  
Marco Atzeri  

M src/Makefile.global.in
M src/backend/Makefile

scripts: Remove newlines from end of generated SQL

commit   : d3c4c471553265e7517be24bae64b81967f6df40    
  
author   : Peter Eisentraut <[email protected]>    
date     : Mon, 10 Feb 2014 21:47:19 -0500    
  
committer: Peter Eisentraut <[email protected]>    
date     : Mon, 10 Feb 2014 21:47:19 -0500    

Click here for diff

This results in spurious empty lines in the server log.  Instead, add  
the newlines only when printing out the --echo output.  In some cases,  
this was already done, leading to two newlines being printed.  Clean  
that up as well.  
  
From: Fabrízio de Royes Mello <[email protected]>  

M src/bin/scripts/clusterdb.c
M src/bin/scripts/createdb.c
M src/bin/scripts/createlang.c
M src/bin/scripts/createuser.c
M src/bin/scripts/dropdb.c
M src/bin/scripts/droplang.c
M src/bin/scripts/dropuser.c
M src/bin/scripts/reindexdb.c
M src/bin/scripts/vacuumdb.c

Don't generate plain-text HISTORY and src/test/regress/README anymore.

commit   : 2895415205d86cc7ab55acab5f90fd70a7c68f3c    
  
author   : Tom Lane <[email protected]>    
date     : Mon, 10 Feb 2014 20:48:04 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Mon, 10 Feb 2014 20:48:04 -0500    

Click here for diff

Providing this information as plain text was doubtless worth the trouble  
ten years ago, but it seems likely that hardly anyone reads it in this  
format anymore.  And the effort required to maintain these files (in the  
form of extra-complex markup rules in the relevant parts of the SGML  
documentation) is significant.  So, let's stop doing that and rely solely  
on the other documentation formats.  
  
Per discussion, the plain-text INSTALL instructions might still be worth  
their keep, so we continue to generate that file.  
  
Rather than remove HISTORY and src/test/regress/README from distribution  
tarballs entirely, replace them with simple stub files that tell the reader  
where to find the relevant documentation.  This is mainly to avoid possibly  
breaking packaging recipes that expect these files to exist.  
  
Back-patch to all supported branches, because simplifying the markup  
requirements for release notes won't help much unless we do it in all  
branches.  

M GNUmakefile.in
A HISTORY
M README
M README.git
M doc/src/sgml/.gitignore
M doc/src/sgml/Makefile
M doc/src/sgml/docguide.sgml
D doc/src/sgml/generate_history.pl
M doc/src/sgml/release.sgml
M doc/src/sgml/standalone-install.sgml
A src/test/regress/README
M src/tools/RELEASE_CHANGES

Fix WakeupWaiters() to not wake up an exclusive locker unnecessarily.

commit   : d699ba41349e4ef397222a7223606fa03f4c4870    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Mon, 10 Feb 2014 15:14:07 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Mon, 10 Feb 2014 15:14:07 +0200    

Click here for diff

WakeupWaiters() is supposed to wake up all LW_WAIT_UNTIL_FREE waiters of  
the slot, but the loop incorrectly also woke up the first LW_EXCLUSIVE  
waiter, if there was no LW_WAIT_UNTIL_FREE waiters in the queue.  
  
Noted by Andres Freund. This code is new in 9.4, so no backpatching.  

M src/backend/access/transam/xlog.c

Use memmove() instead of memcpy() for copying overlapping regions.

commit   : 6c2744f1d3a0d2e456f8d52776c976da3eb8d3a0    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Mon, 10 Feb 2014 09:55:14 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Mon, 10 Feb 2014 09:55:14 +0200    

Click here for diff

In commit d2495f272cd164ff075bee5c4ce95aed11338a36, I fixed this bug in  
to_tsquery(), but missed the fact that plainto_tsquery() has the same bug.  

M src/backend/tsearch/to_tsany.c

Further pg_dump / ftello improvements

commit   : dfb1e9bdc0d0a506899b11038c7fce9631cac9fe    
  
author   : Stephen Frost <[email protected]>    
date     : Sun, 9 Feb 2014 18:28:14 -0500    
  
committer: Stephen Frost <[email protected]>    
date     : Sun, 9 Feb 2014 18:28:14 -0500    

Click here for diff

Make ftello error-checking consistent to all calls and remove a  
bit of ftello-related code which has been #if 0'd out since 2001.  
  
Note that we are not concerned with the ftello() call under  
snprintf() failing as it is just building a string to call  
exit_horribly() with; printing -1 in such a case is fine.  

M src/bin/pg_dump/pg_backup_archiver.c
M src/bin/pg_dump/pg_backup_tar.c

Focus on ftello result < 0 instead of errno

commit   : 5e8e794e3be9fbeddf6f2e2c0515dd0f04c784ec    
  
author   : Stephen Frost <[email protected]>    
date     : Sun, 9 Feb 2014 13:29:36 -0500    
  
committer: Stephen Frost <[email protected]>    
date     : Sun, 9 Feb 2014 13:29:36 -0500    

Click here for diff

Rather than reset errno (or just hope that its cleared already),  
check just the result of the ftello for < 0 to determine if there  
was an issue.  
  
Oversight by me, pointed out by Tom.  

M src/bin/pg_dump/pg_backup_custom.c

Limit pg_basebackup progress output to 1/second

commit   : 8198a321c9ea2072c5acde438f4d19638e04f6f2    
  
author   : Magnus Hagander <[email protected]>    
date     : Sun, 9 Feb 2014 12:47:09 +0100    
  
committer: Magnus Hagander <[email protected]>    
date     : Sun, 9 Feb 2014 12:47:09 +0100    

Click here for diff

This prevents pg_basebackup from generating excessive output when  
dumping large clusters. The status is now updated once / second,  
still making it possible to see that there is progress happening,  
but limiting the total bandwidth.  
  
Mika Eloranta, reviewed by Sawada Masahiko and Oskari Saarenmaa  

M src/bin/pg_basebackup/pg_basebackup.c

Avoid printing uninitialized filename variable in verbose mode

commit   : 01025d80a16c747641386e2909deb81e2f9423a6    
  
author   : Magnus Hagander <[email protected]>    
date     : Sun, 9 Feb 2014 11:54:33 +0100    
  
committer: Magnus Hagander <[email protected]>    
date     : Sun, 9 Feb 2014 11:54:33 +0100    

Click here for diff

When using verbose mode for pg_basebackup, in tar format sent to  
stdout, we'd print an unitialized buffer as the filename.  
  
Reported by Pontus Lundkvist  

M src/bin/pg_basebackup/pg_basebackup.c

Minor pg_dump improvements

commit   : cfa1b4a711dd03f824a9c3ab50911e61419d1eeb    
  
author   : Stephen Frost <[email protected]>    
date     : Sat, 8 Feb 2014 21:25:47 -0500    
  
committer: Stephen Frost <[email protected]>    
date     : Sat, 8 Feb 2014 21:25:47 -0500    

Click here for diff

Improve pg_dump by checking results on various fgetc() calls which  
previously were unchecked, ditto for ftello.  Also clean up a couple  
of very minor memory leaks by waiting to allocate structures until  
after the initial check(s).  
  
Issues spotted by Coverity.  

M src/bin/pg_dump/pg_backup_archiver.c
M src/bin/pg_dump/pg_backup_custom.c
M src/bin/pg_dump/pg_dump.c

Mark some more variables as static or include the appropriate header

commit   : 66c04c981dfe7c1d1e633dddcecf01982d0bde65    
  
author   : Peter Eisentraut <[email protected]>    
date     : Sat, 8 Feb 2014 21:21:46 -0500    
  
committer: Peter Eisentraut <[email protected]>    
date     : Sat, 8 Feb 2014 21:21:46 -0500    

Click here for diff

Detected by clang's -Wmissing-variable-declarations.  
  
From: Andres Freund <[email protected]>  

M src/backend/commands/event_trigger.c
M src/backend/postmaster/bgworker.c
M src/backend/postmaster/postmaster.c
M src/backend/storage/lmgr/s_lock.c
M src/backend/utils/init/globals.c
M src/bin/initdb/initdb.c
M src/include/storage/pg_shmem.h
M src/interfaces/ecpg/preproc/pgc.l

Initialize the entryRes array between each call to triConsistent.

commit   : 6aa2bdf6a01ce099e315cb313396ca4b8415321b    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Fri, 7 Feb 2014 18:41:01 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Fri, 7 Feb 2014 18:41:01 +0200    

Click here for diff

The shimTriConstistentFn, which calls the opclass's consistent function with  
all combinations of TRUE/FALSE for any MAYBE argument, modifies the entryRes  
array passed by the caller. Change startScanKey to re-initialize it between  
each call to accommodate that.  
  
It's actually a bad habit by shimTriConsistentFn to modify its argument. But  
the only caller that doesn't already re-initialize the entryRes array was  
startScanKey, and it's easy for startScanKey to do so. Add a comment to  
shimTriConsistentFn about that.  
  
Note: this does not give a free pass to opclass-provided consistent  
functions to modify the entryRes argument; shimTriConsistent assumes that  
they don't, even though it does it itself.  
  
While at it, refactor startScanKey to allocate the requiredEntries and  
additionalEntries after it knows exactly how large they need to be. Saves a  
little bit of memory, and looks nicer anyway.  
  
Per complaint by Tom Lane, buildfarm and the pg_trgm regression test.  

M src/backend/access/gin/ginget.c
M src/backend/access/gin/ginlogic.c

Speed up "rare & frequent" type GIN queries.

commit   : dbc649fd773e7e16458bfbec2611bf15f4355bc4    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Fri, 7 Feb 2014 14:58:11 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Fri, 7 Feb 2014 14:58:11 +0200    

Click here for diff

If you have a GIN query like "rare & frequent", we currently fetch all the  
items that match either rare or frequent, call the consistent function for  
each item, and let the consistent function filter out items that only match  
one of the terms. However, if we can deduce that "rare" must be present for  
the overall qual to be true, we can scan all the rare items, and for each  
rare item, skip over to the next frequent item with the same or greater TID.  
That greatly speeds up "rare & frequent" type queries.  
  
To implement that, introduce the concept of a tri-state consistent function,  
where the 3rd value is MAYBE, indicating that we don't know if that term is  
present. Operator classes only provide a boolean consistent function, so we  
simulate the tri-state consistent function by calling the boolean function  
several times, with the MAYBE arguments set to all combinations of TRUE and  
FALSE. Testing all combinations is only feasible for a small number of MAYBE  
arguments, but it is envisioned that we'll provide a way for operator  
classes to provide a native tri-state consistent function, which can be much  
more efficient. But that is not included in this patch.  
  
We were already using that trick to for lossy pages, calling the consistent  
function with the lossy entry set to TRUE and FALSE. Now that we have the  
tri-state consistent function, use it for lossy pages too.  
  
Alexander Korotkov, with fair amount of refactoring by me.  

M src/backend/access/gin/Makefile
M src/backend/access/gin/ginget.c
A src/backend/access/gin/ginlogic.c
M src/backend/access/gin/ginscan.c
M src/include/access/gin_private.h

Fix thinko in comment.

commit   : e001030c2711c0fb65cf72813f16a8eb26483c16    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Fri, 7 Feb 2014 10:27:26 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Fri, 7 Feb 2014 10:27:26 +0200    

Click here for diff

Amit Langote  

M src/backend/storage/freespace/freespace.c

In RelationClearRelation, postpone cache reload if !IsTransactionState().

commit   : 8de3e410faa06ab20ec1aa6d0abb0a2c040261ba    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 6 Feb 2014 19:37:58 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 6 Feb 2014 19:37:58 -0500    

Click here for diff

We may process relcache flush requests during transaction startup or  
shutdown.  In general it's not terribly safe to do catalog access at those  
times, so the code's habit of trying to immediately revalidate unflushable  
relcache entries is risky.  Although there are no field trouble reports  
that are positively traceable to this, we have been able to demonstrate  
failure of the assertions recently added in RelationIdGetRelation() and  
SearchCatCache().  On the other hand, it seems safe to just postpone  
revalidation of the cache entry until we're inside a valid transaction.  
The one case where this is questionable is where we're exiting a  
subtransaction and the outer transaction is holding the relcache entry open  
--- but if we made any significant changes to the rel inside such a  
subtransaction, we've got problems anyway.  There are mechanisms in place  
to prevent that (to wit, locks for cross-session cases and  
CheckTableNotInUse() for intra-session cases), so let's trust to those  
mechanisms to keep us out of trouble.  

M src/backend/utils/cache/relcache.c
M src/test/regress/expected/transactions.out
M src/test/regress/sql/transactions.sql

Alphabeticize list in OBJS definition in utils/adt Makefile.

commit   : 45e1b6c4c490a173208f98f4babc03b8fc69439e    
  
author   : Andrew Dunstan <[email protected]>    
date     : Thu, 6 Feb 2014 12:11:49 -0500    
  
committer: Andrew Dunstan <[email protected]>    
date     : Thu, 6 Feb 2014 12:11:49 -0500    

Click here for diff

M src/backend/utils/adt/Makefile

Assert(IsTransactionState()) in RelationIdGetRelation().

commit   : ddfc9cb054abed4d08cc2709c9b2197dab96f449    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 6 Feb 2014 11:28:13 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 6 Feb 2014 11:28:13 -0500    

Click here for diff

Commit 42c80c696e9c8323841180029cc62741c21bd356 added an  
Assert(IsTransactionState()) in SearchCatCache(), to catch  
any code that thought it could do a catcache lookup outside  
transactions.  Extend the same idea to relcache lookups.  

M src/backend/utils/cache/relcache.c

doc: Disable indentation of XHTML output

commit   : f31005e340c55948df6ab64370ce5cf202935f89    
  
author   : Peter Eisentraut <[email protected]>    
date     : Wed, 5 Feb 2014 23:49:25 -0500    
  
committer: Peter Eisentraut <[email protected]>    
date     : Wed, 5 Feb 2014 23:49:25 -0500    

Click here for diff

Indenting the XHTML output can lead to incorrect rendering.  This only  
affects the build via XSLT.  

M doc/src/sgml/stylesheet.xsl

Fix whitespace

commit   : f65233755ca5d01f49137b37f6a78b46acc83484    
  
author   : Peter Eisentraut <[email protected]>    
date     : Wed, 5 Feb 2014 23:12:51 -0500    
  
committer: Peter Eisentraut <[email protected]>    
date     : Wed, 5 Feb 2014 23:12:51 -0500    

Click here for diff

M src/backend/utils/adt/jsonfuncs.c

Remove unnecessary relcache flushes after changing btree metapages.

commit   : ac8bc3b6e4a28cf7cd33fe11866d72f6deb2a38f    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 5 Feb 2014 13:43:37 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 5 Feb 2014 13:43:37 -0500    

Click here for diff

These flushes were added in my commit d2896a9ed, which added the btree  
logic that keeps a cached copy of the index metapage data in index relcache  
entries.  The idea was to ensure that other backends would promptly update  
their cached copies after a change.  However, this is not really necessary,  
since _bt_getroot() has adequate defenses against believing a stale root  
page link, and _bt_getrootheight() doesn't have to be 100% right.  
Moreover, if it were necessary, a relcache flush would be an unreliable way  
to do it, since the sinval mechanism believes that relcache flush requests  
represent transactional updates, and therefore discards them on transaction  
rollback.  Therefore, we might as well drop these flush requests and save  
the time to rebuild the whole relcache entry after a metapage change.  
  
If we ever try to support in-place truncation of btree indexes, it might  
be necessary to revisit this issue so that _bt_getroot() can't get caught  
by trying to follow a metapage link to a page that no longer exists.  
A possible solution to that is to make use of an smgr, rather than  
relcache, inval request to force other backends to discard their cached  
metapages.  But for the moment this is not worth pursuing.  

M src/backend/access/nbtree/README
M src/backend/access/nbtree/nbtinsert.c
M src/backend/access/nbtree/nbtpage.c
M src/backend/access/nbtree/nbtree.c

Minor improvements to replication slot documentation.

commit   : 14aa601f50edefb18f65956a4b32131b9c9ea2da    
  
author   : Robert Haas <[email protected]>    
date     : Wed, 5 Feb 2014 13:41:25 -0500    
  
committer: Robert Haas <[email protected]>    
date     : Wed, 5 Feb 2014 13:41:25 -0500    

Click here for diff

Fix a thinko pointed out by Jeff Davis, and convert a couple of other  
references into links.  

M doc/src/sgml/high-availability.sgml

PL/Perl: Fix compiler warning

commit   : 4e182361804f8688cef953c998e24134e606aea4    
  
author   : Peter Eisentraut <[email protected]>    
date     : Tue, 4 Feb 2014 20:04:35 -0500    
  
committer: Peter Eisentraut <[email protected]>    
date     : Tue, 4 Feb 2014 20:04:35 -0500    

Click here for diff

The code was assigning a (Datum) 0 to a void pointer.  That creates a  
warning from clang 3.4.  It was probably a thinko to begin with.  

M src/pl/plperl/plperl.c

Improve connection-failure error handling in contrib/postgres_fdw.

commit   : 00d4f2af8bd6a1b9db2f676cc76b64d98ace99fb    
  
author   : Tom Lane <[email protected]>    
date     : Mon, 3 Feb 2014 21:30:02 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Mon, 3 Feb 2014 21:30:02 -0500    

Click here for diff

postgres_fdw tended to say "unknown error" if it tried to execute a command  
on an already-dead connection, because some paths in libpq just return a  
null PGresult for such cases.  Out-of-memory might result in that, too.  
To fix, pass the PGconn to pgfdw_report_error, and look at its  
PQerrorMessage() string if we can't get anything out of the PGresult.  
  
Also, fix the transaction-exit logic to reliably drop a dead connection.  
It was attempting to do that already, but it assumed that only connection  
cache entries with xact_depth > 0 needed to be examined.  The folly in that  
is that if we fail while issuing START TRANSACTION, we'll not have bumped  
xact_depth.  (At least for the case I was testing, this fix masks the  
other problem; but it still seems like a good idea to have the PGconn  
fallback logic.)  
  
Per investigation of bug #9087 from Craig Lucas.  Backpatch to 9.3 where  
this code was introduced.  

M contrib/postgres_fdw/connection.c
M contrib/postgres_fdw/postgres_fdw.c
M contrib/postgres_fdw/postgres_fdw.h

Fix comparison of an array of characters with zero to compare with '\0' instead.

commit   : 489e6ac5a1a4ca7e4ca7683a86ccd8a5d5e3eb59    
  
author   : Fujii Masao <[email protected]>    
date     : Tue, 4 Feb 2014 10:59:39 +0900    
  
committer: Fujii Masao <[email protected]>    
date     : Tue, 4 Feb 2014 10:59:39 +0900    

Click here for diff

Report from Andres Freund.  

M src/backend/utils/adt/pgstatfuncs.c

commit   : c1fe08eb2f74d2a84e9dd48d54aa836ab74b3f94    
  
author   : Robert Haas <[email protected]>    
date     : Mon, 3 Feb 2014 20:10:48 -0500    
  
committer: Robert Haas <[email protected]>    
date     : Mon, 3 Feb 2014 20:10:48 -0500    

Click here for diff

Otherwise, the standalone regress_README build gets unhappy.  

M doc/src/sgml/regress.sgml

Fix lexing of U& sequences just before EOF.

commit   : 0c2338abbb17b7b319f36a73d8db77735346804f    
  
author   : Tom Lane <[email protected]>    
date     : Mon, 3 Feb 2014 19:47:57 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Mon, 3 Feb 2014 19:47:57 -0500    

Click here for diff

Commit a5ff502fceadc7c203b0d7a11b45c73f1b421f69 was a brick shy of a load  
in the backend lexer too, not just psql.  Per further testing of bug #9068.  
  
In passing, improve related comments.  

M src/backend/parser/scan.l
M src/bin/psql/psqlscan.l

Fix *-qualification of named parameters in SQL-language functions.

commit   : 0def2573c5f0ff127d0c7dc12ec7da56ae6fb7fe    
  
author   : Tom Lane <[email protected]>    
date     : Mon, 3 Feb 2014 14:46:51 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Mon, 3 Feb 2014 14:46:51 -0500    

Click here for diff

Given a composite-type parameter named x, "$1.*" worked fine, but "x.*"  
not so much.  This has been broken since named parameter references were  
added in commit 9bff0780cf5be2193a5bad0d3df2dbe143085264, so patch back  
to 9.2.  Per bug #9085 from Hardy Falk.  

M src/backend/executor/functions.c
M src/test/regress/expected/rowtypes.out
M src/test/regress/sql/rowtypes.sql

Adjust pg_sleep_for/pg_sleep_until to use clock_timestamp.

commit   : 80353f35285f89382cea7fc543580827f0465e69    
  
author   : Robert Haas <[email protected]>    
date     : Mon, 3 Feb 2014 14:33:43 -0500    
  
committer: Robert Haas <[email protected]>    
date     : Mon, 3 Feb 2014 14:33:43 -0500    

Click here for diff

Otherwise, pg_sleep_until does the wrong thing in a multi-statement  
transaction.  
  
Julien Rouhaud  

M src/include/catalog/catversion.h
M src/include/catalog/pg_proc.h

Document a few more regression test hazards.

commit   : 65a193ebbb5e94b87773fbcbf8909ff8044734ab    
  
author   : Robert Haas <[email protected]>    
date     : Mon, 3 Feb 2014 10:27:47 -0500    
  
committer: Robert Haas <[email protected]>    
date     : Mon, 3 Feb 2014 10:27:47 -0500    

Click here for diff

Michael Paquier, reviewed by Christian Kruse  

M doc/src/sgml/regress.sgml

In json code, clean up temp memory contexts after processing.

commit   : d3ee45152b198ac269b1bc055927ef7aabf85a49    
  
author   : Andrew Dunstan <[email protected]>    
date     : Mon, 3 Feb 2014 10:40:12 -0500    
  
committer: Andrew Dunstan <[email protected]>    
date     : Mon, 3 Feb 2014 10:40:12 -0500    

Click here for diff

Craig Ringer.  

M src/backend/utils/adt/jsonfuncs.c

Make pg_basebackup skip temporary statistics files.

commit   : 3e8554a54a95425e93fe49025ccda499a1a93173    
  
author   : Fujii Masao <[email protected]>    
date     : Mon, 3 Feb 2014 23:19:49 +0900    
  
committer: Fujii Masao <[email protected]>    
date     : Mon, 3 Feb 2014 23:19:49 +0900    

Click here for diff

The temporary statistics files don't need to be included in the backup  
because they are always reset at the beginning of the archive recovery.  
This patch changes pg_basebackup so that it skips all files located in  
$PGDATA/pg_stat_tmp or the directory specified by stats_temp_directory  
parameter.  

M contrib/pg_stat_statements/pg_stat_statements.c
M src/backend/replication/basebackup.c
M src/backend/utils/misc/guc.c
M src/include/pgstat.h

Switch in psql_scan() must cover all lexer states (except backslash cases).

commit   : 47aaebaac95c9000549d1a6de809e15b729231f5    
  
author   : Tom Lane <[email protected]>    
date     : Sun, 2 Feb 2014 18:59:34 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Sun, 2 Feb 2014 18:59:34 -0500    

Click here for diff

Oversight in commit f7559c0101afa33bfb4e104036ca46adac900111, which changed  
UESCAPE lexing in psql.  Per bug #9068 from Manuel Gómez.  

M src/bin/psql/psqlscan.l

Add <indexterm> for functions pg_sleep_for and pg_sleep_until.

commit   : c087e8cf3470081546c74b43e086e2b4d0a255d3    
  
author   : Fujii Masao <[email protected]>    
date     : Mon, 3 Feb 2014 03:40:36 +0900    
  
committer: Fujii Masao <[email protected]>    
date     : Mon, 3 Feb 2014 03:40:36 +0900    

Click here for diff

M doc/src/sgml/func.sgml

Clean up some sloppy coding in repl_gram.y.

commit   : 46825d4978b63a0ae9637efbf6298220c833fa8d    
  
author   : Tom Lane <[email protected]>    
date     : Sun, 2 Feb 2014 12:51:14 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Sun, 2 Feb 2014 12:51:14 -0500    

Click here for diff

Remove unused copy-and-pasted macro definitions, and improve formatting  
of recently-added productions.  
  
I got interested in this because buildfarm member protosciurus has been  
crashing in "bison repl_gram.y" since commit 858ec11.  It's a long shot  
that this will fix that, though maybe the missing trailing semicolon  
has something to do with it?  In any case, there's no need to approve  
of dead code, nor of code whose formatting isn't even self-consistent  
let alone consistent with what's around it.  

M src/backend/replication/repl_gram.y

Add primary_slotname to recovery.conf.sample.

commit   : 0753bdb352270a03dec52bc959418fa82e9b07cc    
  
author   : Fujii Masao <[email protected]>    
date     : Mon, 3 Feb 2014 00:41:50 +0900    
  
committer: Fujii Masao <[email protected]>    
date     : Mon, 3 Feb 2014 00:41:50 +0900    

Click here for diff

M src/backend/access/transam/recovery.conf.sample

Fix typos in docs and comments.

commit   : 63be3b78f6e1d92c7f02d4f73a55dd5cefab923b    
  
author   : Fujii Masao <[email protected]>    
date     : Sun, 2 Feb 2014 10:28:18 +0900    
  
committer: Fujii Masao <[email protected]>    
date     : Sun, 2 Feb 2014 10:28:18 +0900    

Click here for diff

Thom Brown  

M doc/src/sgml/high-availability.sgml
M doc/src/sgml/ref/pg_receivexlog.sgml
M src/backend/replication/slot.c
M src/backend/replication/walsender.c
M src/bin/pg_basebackup/receivelog.c

Fix makefile syntax.

commit   : 9abed7d1cb1e219254bcf4b92afd02c11337e7a3    
  
author   : Andrew Dunstan <[email protected]>    
date     : Sat, 1 Feb 2014 19:52:39 -0500    
  
committer: Andrew Dunstan <[email protected]>    
date     : Sat, 1 Feb 2014 19:52:39 -0500    

Click here for diff

M src/interfaces/libpq/Makefile

Fix some wide-character bugs in the text-search parser.

commit   : 082c0dfa140b5799bc7eb574d68610dcfaa619ba    
  
author   : Tom Lane <[email protected]>    
date     : Sat, 1 Feb 2014 18:26:55 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Sat, 1 Feb 2014 18:26:55 -0500    

Click here for diff

In p_isdigit and other character class test functions generated by the  
p_iswhat macro, the code path for non-C locales with multibyte encodings  
contained a bogus pointer cast that would accidentally fail to malfunction  
if types wchar_t and wint_t have the same width.  Apparently that is true  
on most platforms, but not on recent Cygwin releases.  Remove the cast,  
as it seems completely unnecessary (I think it arose from a false analogy  
to the need to cast to unsigned char when dealing with the <ctype.h>  
functions).  Per bug #8970 from Marco Atzeri.  
  
In the same functions, the code path for C locale with a multibyte encoding  
simply ANDed each wide character with 0xFF before passing it to the  
corresponding <ctype.h> function.  This could result in false positive  
answers for some non-ASCII characters, so use a range test instead.  
Noted by me while investigating Marco's complaint.  
  
Also, remove some useless though not actually buggy maskings and casts  
in the hand-coded p_isalnum and p_isalpha functions, which evidently  
got tested a bit more carefully than the macro-generated functions.  

M src/backend/tsearch/wparser_def.c

fix whitespace

commit   : c8158a2eed8eb060c524620c8314bec30ac94c99    
  
author   : Andrew Dunstan <[email protected]>    
date     : Sat, 1 Feb 2014 16:30:26 -0500    
  
committer: Andrew Dunstan <[email protected]>    
date     : Sat, 1 Feb 2014 16:30:26 -0500    

Click here for diff

M src/Makefile.shlib

Fix some more bugs in signal handlers and process shutdown logic.

commit   : 214c7a4f0b1784ce855512c2961b09c9f51dafd8    
  
author   : Tom Lane <[email protected]>    
date     : Sat, 1 Feb 2014 16:20:56 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Sat, 1 Feb 2014 16:20:56 -0500    

Click here for diff

WalSndKill was doing things exactly backwards: it should first clear  
MyWalSnd (to stop signal handlers from touching MyWalSnd->latch),  
then disown the latch, and only then mark the WalSnd struct unused by  
clearing its pid field.  
  
Also, WalRcvSigUsr1Handler and worker_spi_sighup failed to preserve  
errno, which is surely a requirement for any signal handler.  
  
Per discussion of recent buildfarm failures.  Back-patch as far  
as the relevant code exists.  

M contrib/worker_spi/worker_spi.c
M src/backend/replication/walreceiver.c
M src/backend/replication/walsender.c

Don't use deprecated dllwrap on Cygwin.

commit   : 7e1531a4504248d9df5deae8c4aa9340adaa7ef5    
  
author   : Andrew Dunstan <[email protected]>    
date     : Sat, 1 Feb 2014 16:08:33 -0500    
  
committer: Andrew Dunstan <[email protected]>    
date     : Sat, 1 Feb 2014 16:08:33 -0500    

Click here for diff

The preferred method is to use "cc -shared", and this allows binaries  
to be rebased if required, unlike dllwrap.  
  
Backpatch to 9.0 where we have buildfarm coverage.  
  
There are still some issues with Cygwin, especially modern Cygwin, but  
this helps us get closer to good support.  
  
Marco Atzeri.  

M src/Makefile.shlib
M src/makefiles/Makefile.cygwin

Copy the libpq DLL to the bin directory on Mingw and Cygwin.

commit   : d587298b80e14afdbf2a6b0980f4902280af980e    
  
author   : Andrew Dunstan <[email protected]>    
date     : Sat, 1 Feb 2014 15:11:13 -0500    
  
committer: Andrew Dunstan <[email protected]>    
date     : Sat, 1 Feb 2014 15:11:13 -0500    

Click here for diff

This has long been done by the MSVC build system, and has caused  
confusion in the past when programs like psql have failed to start  
because they can't find the DLL. If it's in the same directory as it now  
will be they will find it.  
  
Backpatch to all live branches.  

M src/interfaces/libpq/Makefile

arrays: tighten checks for multi-dimensional input

commit   : d0ee93797d9c06e619b3f382705d99ee195bb573    
  
author   : Bruce Momjian <[email protected]>    
date     : Sat, 1 Feb 2014 10:49:17 -0500    
  
committer: Bruce Momjian <[email protected]>    
date     : Sat, 1 Feb 2014 10:49:17 -0500    

Click here for diff

Previously an input array string that started with a single-element  
array dimension would then later accept a multi-dimensional segment.  
  
BACKWARD INCOMPATIBILITY  

M src/backend/utils/adt/arrayfuncs.c
M src/test/regress/expected/arrays.out
M src/test/regress/sql/arrays.sql

Introduce replication slots.

commit   : 858ec11858a914d4c380971985709b6d6b7dd6fc    
  
author   : Robert Haas <[email protected]>    
date     : Fri, 31 Jan 2014 22:45:17 -0500    
  
committer: Robert Haas <[email protected]>    
date     : Fri, 31 Jan 2014 22:45:17 -0500    

Click here for diff

Replication slots are a crash-safe data structure which can be created  
on either a master or a standby to prevent premature removal of  
write-ahead log segments needed by a standby, as well as (with  
hot_standby_feedback=on) pruning of tuples whose removal would cause  
replication conflicts.  Slots have some advantages over existing  
techniques, as explained in the documentation.  
  
In a few places, we refer to the type of replication slots introduced  
by this patch as "physical" slots, because forthcoming patches for  
logical decoding will also have slots, but with somewhat different  
properties.  
  
Andres Freund and Robert Haas  

M doc/src/sgml/catalogs.sgml
M doc/src/sgml/config.sgml
M doc/src/sgml/func.sgml
M doc/src/sgml/high-availability.sgml
M doc/src/sgml/protocol.sgml
M doc/src/sgml/recovery-config.sgml
M doc/src/sgml/ref/pg_receivexlog.sgml
M src/backend/access/transam/xlog.c
M src/backend/catalog/system_views.sql
M src/backend/replication/Makefile
M src/backend/replication/README
M src/backend/replication/basebackup.c
M src/backend/replication/libpqwalreceiver/libpqwalreceiver.c
M src/backend/replication/repl_gram.y
M src/backend/replication/repl_scanner.l
A src/backend/replication/slot.c
A src/backend/replication/slotfuncs.c
M src/backend/replication/walreceiver.c
M src/backend/replication/walreceiverfuncs.c
M src/backend/replication/walsender.c
M src/backend/storage/ipc/ipci.c
M src/backend/storage/ipc/procarray.c
M src/backend/storage/lmgr/lwlock.c
M src/backend/storage/lmgr/proc.c
M src/backend/utils/misc/guc.c
M src/backend/utils/misc/postgresql.conf.sample
M src/bin/initdb/initdb.c
M src/bin/pg_basebackup/pg_receivexlog.c
M src/bin/pg_basebackup/receivelog.c
M src/bin/pg_basebackup/streamutil.c
M src/bin/pg_basebackup/streamutil.h
M src/include/access/xlog.h
M src/include/catalog/catversion.h
M src/include/catalog/pg_proc.h
M src/include/nodes/nodes.h
M src/include/nodes/replnodes.h
A src/include/replication/slot.h
M src/include/replication/walreceiver.h
M src/include/storage/lwlock.h
M src/include/storage/procarray.h
M src/test/regress/expected/rules.out
M src/tools/pgindent/typedefs.list

docs: mention 'g' is not in the regex embedded options table

commit   : 5bdef38b8917cfbe206d14969c61a5d38fc822b6    
  
author   : Bruce Momjian <[email protected]>    
date     : Fri, 31 Jan 2014 22:40:08 -0500    
  
committer: Bruce Momjian <[email protected]>    
date     : Fri, 31 Jan 2014 22:40:08 -0500    

Click here for diff

Mentioned in substring() and regexp_replace() sections.  

M doc/src/sgml/func.sgml

pg_restore: make help output plural for multi-enabled options

commit   : 5168c76964fe90646b69b37e2c5bc7b60ba12d65    
  
author   : Bruce Momjian <[email protected]>    
date     : Fri, 31 Jan 2014 22:28:54 -0500    
  
committer: Bruce Momjian <[email protected]>    
date     : Fri, 31 Jan 2014 22:28:54 -0500    

Click here for diff

per report from Josh Kupershmidt  

M src/bin/pg_dump/pg_restore.c

Clear MyProc and MyProcSignalState before they become invalid.

commit   : d1981719adbcc05fa15f540e8fc4327907991fc6    
  
author   : Robert Haas <[email protected]>    
date     : Fri, 31 Jan 2014 21:31:08 -0500    
  
committer: Robert Haas <[email protected]>    
date     : Fri, 31 Jan 2014 21:31:08 -0500    

Click here for diff

Evidence from buildfarm member crake suggests that the new test_shm_mq  
module is routinely crashing the server due to the arrival of a SIGUSR1  
after the shared memory segment has been unmapped.  Although processes  
using the new dynamic background worker facilities are more likely to  
receive a SIGUSR1 around this time, the problem is also possible on older  
branches, so I'm back-patching the parts of this change that apply to  
older branches as far as they apply.  
  
It's already generally the case that code checks whether these pointers  
are NULL before deferencing them, so the important thing is mostly to  
make sure that they do get set to NULL before they become invalid.  But  
in master, there's one case in procsignal_sigusr1_handler that lacks a  
NULL guard, so add that.  
  
Patch by me; review by Tom Lane.  

M src/backend/storage/ipc/procsignal.c
M src/backend/storage/lmgr/proc.c

doc: mention statistics reset during crash recovery

commit   : 637fab6e575b36d3a4368e7c2b923231c5504035    
  
author   : Bruce Momjian <[email protected]>    
date     : Fri, 31 Jan 2014 21:28:15 -0500    
  
committer: Bruce Momjian <[email protected]>    
date     : Fri, 31 Jan 2014 21:28:15 -0500    

Click here for diff

Takayuki Tsunakawa  

M doc/src/sgml/monitoring.sgml

chkpass: check for NULL return value from crypt()

commit   : 6afe200ceea818c82e3a1a754c5043e7df1efa10    
  
author   : Bruce Momjian <[email protected]>    
date     : Fri, 31 Jan 2014 20:19:53 -0500    
  
committer: Bruce Momjian <[email protected]>    
date     : Fri, 31 Jan 2014 20:19:53 -0500    

Click here for diff

Report from Jozef Mlich using Coverity  

M contrib/chkpass/chkpass.c

doc: mention data page checksums in WAL section

commit   : 85317e88ccae270ef77bd01c2d3d55a900df2d72    
  
author   : Bruce Momjian <[email protected]>    
date     : Fri, 31 Jan 2014 19:04:37 -0500    
  
committer: Bruce Momjian <[email protected]>    
date     : Fri, 31 Jan 2014 19:04:37 -0500    

Click here for diff

Backpatch to 9.3  
  
Adjusted patch from Ian Lawrence Barwick  

M doc/src/sgml/wal.sgml

Disallow use of SSL v3 protocol in the server as well as in libpq.

commit   : 326e1d73c476a0b5061ef00134bdf57aed70d5e7    
  
author   : Tom Lane <[email protected]>    
date     : Fri, 31 Jan 2014 17:51:07 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Fri, 31 Jan 2014 17:51:07 -0500    

Click here for diff

Commit 820f08cabdcbb8998050c3d4873e9619d6d8cba4 claimed to make the server  
and libpq handle SSL protocol versions identically, but actually the server  
was still accepting SSL v3 protocol while libpq wasn't.  Per discussion,  
SSL v3 is obsolete, and there's no good reason to continue to accept it.  
So make the code really equivalent on both sides.  The behavior now is  
that we use the highest mutually-supported TLS protocol version.  
  
Marko Kreen, some comment-smithing by me  

M src/backend/libpq/be-secure.c
M src/interfaces/libpq/fe-secure.c

docs: mention tgconstrindid supports exclusion constraints

commit   : 3fd3e34914a2aa520a8bc5109a773621385cf1f4    
  
author   : Bruce Momjian <[email protected]>    
date     : Fri, 31 Jan 2014 17:44:18 -0500    
  
committer: Bruce Momjian <[email protected]>    
date     : Fri, 31 Jan 2014 17:44:18 -0500    

Click here for diff

Dean Rasheed  

M doc/src/sgml/catalogs.sgml

Add some examples to the postgres_fdw documentation.

commit   : e93ca1618b92ff4ca3e1ed3bff89179d3e2abd9e    
  
author   : Tom Lane <[email protected]>    
date     : Fri, 31 Jan 2014 17:27:50 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Fri, 31 Jan 2014 17:27:50 -0500    

Click here for diff

Michael Paquier  

M doc/src/sgml/postgres-fdw.sgml

doc: authentication wording improvements

commit   : 384fbd1a5d49c3acaecf15d7a7eefae49049f6eb    
  
author   : Bruce Momjian <[email protected]>    
date     : Fri, 31 Jan 2014 17:08:27 -0500    
  
committer: Bruce Momjian <[email protected]>    
date     : Fri, 31 Jan 2014 17:08:27 -0500    

Click here for diff

Suggested by David Tonhofer  

M doc/src/sgml/client-auth.sgml

docs: specify FOR UPDATE/SHARE incompatibilities

commit   : 8824b38909b28c801456ade7a63ff67e3795ed1d    
  
author   : Bruce Momjian <[email protected]>    
date     : Fri, 31 Jan 2014 16:37:25 -0500    
  
committer: Bruce Momjian <[email protected]>    
date     : Fri, 31 Jan 2014 16:37:25 -0500    

Click here for diff

Document that FOR UPDATE/SHARE are incompatible with GROUP BY, DISTINCT,  
HAVING and window functions.  
  
Michael Paquier  

M doc/src/sgml/ref/select.sgml

system catalogs: reorder pg_amproc entries into proper sections

commit   : fc4ffba9685809474a1cb9aa7bd122f62f0ee2e5    
  
author   : Bruce Momjian <[email protected]>    
date     : Fri, 31 Jan 2014 16:04:18 -0500    
  
committer: Bruce Momjian <[email protected]>    
date     : Fri, 31 Jan 2014 16:04:18 -0500    

Click here for diff

Report form Antonin Houska  

M src/include/catalog/pg_amproc.h

pgindent: add Perl comment

commit   : 290d2cb500ea8903cf605e626fc46ea11a619f28    
  
author   : Bruce Momjian <[email protected]>    
date     : Fri, 31 Jan 2014 14:46:00 -0500    
  
committer: Bruce Momjian <[email protected]>    
date     : Fri, 31 Jan 2014 14:46:00 -0500    

Click here for diff

M src/tools/pgindent/pgindent

pgindent: add --list-of-typedefs option

commit   : cad1e022b265be8f2526cd82e5d2f8da3ba9f613    
  
author   : Bruce Momjian <[email protected]>    
date     : Fri, 31 Jan 2014 13:35:50 -0500    
  
committer: Bruce Momjian <[email protected]>    
date     : Fri, 31 Jan 2014 13:35:50 -0500    

Click here for diff

Allows typedefs to be specified on the command line, per request from  
Andrew.  

M src/tools/pgindent/pgindent

Add tab completion for ALTER TABLESPACE MOVE in psql.

commit   : a87ae38be844a140786bf2fb3f3f8a094d51fa26    
  
author   : Fujii Masao <[email protected]>    
date     : Sat, 1 Feb 2014 01:45:48 +0900    
  
committer: Fujii Masao <[email protected]>    
date     : Sat, 1 Feb 2014 01:45:48 +0900    

Click here for diff

M src/bin/psql/tab-complete.c

entab: add new options

commit   : 5ff47acf8f2da1103219a99e61b4862dba8b6f3d    
  
author   : Bruce Momjian <[email protected]>    
date     : Fri, 31 Jan 2014 11:05:15 -0500    
  
committer: Bruce Momjian <[email protected]>    
date     : Fri, 31 Jan 2014 11:05:15 -0500    

Click here for diff

Add new entab options to process only C comment whitespace after  
periods, and to protect leading whitespace.  

M src/tools/entab/entab.c

Fix documented return type of json_array_elements_text.

commit   : e9afdf2f4bddb9d3a5a09aa8eff7fcc49db231d2    
  
author   : Andrew Dunstan <[email protected]>    
date     : Fri, 31 Jan 2014 09:31:58 -0500    
  
committer: Andrew Dunstan <[email protected]>    
date     : Fri, 31 Jan 2014 09:31:58 -0500    

Click here for diff

Per gripe from hubert depesz lubaczewski.  
  
Also improve examples for this and json_array_elements so they match the  
example results.  

M doc/src/sgml/func.sgml

Allow unrecognized encoding names in locales, as long as they're the same.

commit   : cd3e0071b8c9e082f5fe903a019d4e474be98e57    
  
author   : Tom Lane <[email protected]>    
date     : Fri, 31 Jan 2014 02:03:30 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Fri, 31 Jan 2014 02:03:30 -0500    

Click here for diff

The buildfarm says commit 58274728fb8e087049df67c0eee903d9743fdeda doesn't  
work so well on Windows.  This is because the encoding part of Windows  
locale names can be just a code page number, eg "1252", which we don't  
consider to be a valid encoding name.  Add a check to accept encoding  
parts that are case-insensitively string equal; this at least ensures  
that the new code doesn't reject any cases that the old code allowed.  

M contrib/pg_upgrade/check.c

pgindent: preserve blank lines around #else/#endif

commit   : db98b313296d1d50f357d58fbcb6572ed1ab018f    
  
author   : Bruce Momjian <[email protected]>    
date     : Thu, 30 Jan 2014 22:40:05 -0500    
  
committer: Bruce Momjian <[email protected]>    
date     : Thu, 30 Jan 2014 22:40:05 -0500    

Click here for diff

This requires a new version of pg_bsd_indent, version 1.3, to be  
downloaded.  

M src/tools/pgindent/pgindent

Be forgiving of variant spellings of locale names in pg_upgrade.

commit   : 58274728fb8e087049df67c0eee903d9743fdeda    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 30 Jan 2014 19:07:06 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 30 Jan 2014 19:07:06 -0500    

Click here for diff

Even though the server tries to canonicalize stored locale names, the  
platform often doesn't cooperate, so it's entirely possible that one DB  
thinks its locale is, say, "en_US.UTF-8" while the other has "en_US.utf8".  
Rather than failing, we should try to allow this where it's clearly OK.  
  
There is already pretty robust encoding lookup in encnames.c, so make  
use of that to compare the encoding parts of the names.  The locale  
identifier parts are just compared case-insensitively, which we were  
already doing.  The major problem known to exist in the field is variant  
encoding-name spellings, so hopefully this will be Good Enough.  If not,  
we can try being even laxer.  
  
Pavel Raiskup, reviewed by Rushabh Lathia  

M contrib/pg_upgrade/check.c

Fix potential coredump on bad locale value in pg_upgrade.

commit   : 41e364ec67ec3a009574db9d20d1b85a654f95ae    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 30 Jan 2014 18:10:01 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 30 Jan 2014 18:10:01 -0500    

Click here for diff

Thinko in error report (and a typo in the message text, too).  We're  
failing anyway, but it would be good to print something useful first.  
Noted while reviewing a patch to make pg_upgrade's locale code laxer.  

M contrib/pg_upgrade/check.c

Add convenience functions pg_sleep_for and pg_sleep_until.

commit   : 760c770ff66b5c2f77f2e17750a2e263a74d82b3    
  
author   : Robert Haas <[email protected]>    
date     : Thu, 30 Jan 2014 15:45:14 -0500    
  
committer: Robert Haas <[email protected]>    
date     : Thu, 30 Jan 2014 15:45:14 -0500    

Click here for diff

Vik Fearing, reviewed by Pavel Stehule and myself  

M doc/src/sgml/func.sgml
M src/include/catalog/catversion.h
M src/include/catalog/pg_proc.h
M src/test/regress/expected/stats.out
M src/test/regress/sql/stats.sql

Fix bogus handling of "postponed" lateral quals.

commit   : 043f6ff05d0a5140dfe25faf277ec9f1d7169005    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 30 Jan 2014 14:51:16 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 30 Jan 2014 14:51:16 -0500    

Click here for diff

When pulling a "postponed" qual from a LATERAL subquery up into the quals  
of an outer join, we must make sure that the postponed qual is included  
in those seen by make_outerjoininfo().  Otherwise we might compute a  
too-small min_lefthand or min_righthand for the outer join, leading to  
"JOIN qualification cannot refer to other relations" failures from  
distribute_qual_to_rels.  Subtler errors in the created plan seem possible,  
too, if the extra qual would only affect join ordering constraints.  
  
Per bug #9041 from David Leverton.  Back-patch to 9.3.  

M src/backend/optimizer/plan/initsplan.c
M src/test/regress/expected/join.out
M src/test/regress/sql/join.sql

docs: improve xref description for xreflabel and refentry links

commit   : c29a6dd54860082153ec7fedb603a4c2c37b1445    
  
author   : Bruce Momjian <[email protected]>    
date     : Thu, 30 Jan 2014 12:26:18 -0500    
  
committer: Bruce Momjian <[email protected]>    
date     : Thu, 30 Jan 2014 12:26:18 -0500    

Click here for diff

M doc/src/sgml/README.links

docs: mention SGML refentry also pulls text from the link

commit   : 7aba24e9715b725f71b2cc97a18a96c45761f469    
  
author   : Bruce Momjian <[email protected]>    
date     : Thu, 30 Jan 2014 12:21:48 -0500    
  
committer: Bruce Momjian <[email protected]>    
date     : Thu, 30 Jan 2014 12:21:48 -0500    

Click here for diff

M doc/src/sgml/README.links

docs: add mention of index swapping

commit   : b1cbd2b573edc690bdb75cf25fe31037c8126b2f    
  
author   : Bruce Momjian <[email protected]>    
date     : Thu, 30 Jan 2014 12:14:24 -0500    
  
committer: Bruce Momjian <[email protected]>    
date     : Thu, 30 Jan 2014 12:14:24 -0500    

Click here for diff

Backpatch to 9.3  
  
Greg Smith  

M doc/src/sgml/maintenance.sgml
M doc/src/sgml/ref/create_index.sgml

Add checks for interval overflow/underflow

commit   : 146604ec43bcd6f977c31775a91022cf9737daf5    
  
author   : Bruce Momjian <[email protected]>    
date     : Thu, 30 Jan 2014 09:41:43 -0500    
  
committer: Bruce Momjian <[email protected]>    
date     : Thu, 30 Jan 2014 09:41:43 -0500    

Click here for diff

New checks include input, month/day/time internal adjustments, addition,  
subtraction, multiplication, and negation.  Also adjust docs to  
correctly specify interval size in bytes.  
  
Report from Rok Kralj  

M doc/src/sgml/datatype.sgml
M src/backend/utils/adt/datetime.c
M src/backend/utils/adt/timestamp.c
M src/interfaces/ecpg/pgtypeslib/interval.c

Fix unsafe references to errno within error messaging logic.

commit   : 571addd729a400cece396d79696adcc63387e43b    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 29 Jan 2014 20:03:57 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 29 Jan 2014 20:03:57 -0500    

Click here for diff

Various places were supposing that errno could be expected to hold still  
within an ereport() nest or similar contexts.  This isn't true necessarily,  
though in some cases it accidentally failed to fail depending on how the  
compiler chanced to order the subexpressions.  This class of thinko  
explains recent reports of odd failures on clang-built versions, typically  
missing or inappropriate HINT fields in messages.  
  
Problem identified by Christian Kruse, who also submitted the patch this  
commit is based on.  (I fixed a few issues in his patch and found a couple  
of additional places with the same disease.)  
  
Back-patch as appropriate to all supported branches.  

M src/backend/commands/tablespace.c
M src/backend/port/sysv_sema.c
M src/backend/port/sysv_shmem.c
M src/bin/psql/command.c
M src/common/username.c

Silence compiler warnings about possibly unset variables.

commit   : 120c5cc761e0d99a9a2f3349f4031850b0dbd5a0    
  
author   : Andrew Dunstan <[email protected]>    
date     : Wed, 29 Jan 2014 18:54:14 -0500    
  
committer: Andrew Dunstan <[email protected]>    
date     : Wed, 29 Jan 2014 18:54:14 -0500    

Click here for diff

They are in fact set in every case where they are needed, but the  
compiler doesn't know that.  
  
Per gripe from Tom Lane.  

M src/backend/utils/adt/jsonfuncs.c

Forgot to bump catalog version for json_array_elements_text.

commit   : 5e52e9d6d467d352c28141f16a95db6c2df71ecc    
  
author   : Andrew Dunstan <[email protected]>    
date     : Wed, 29 Jan 2014 16:38:31 -0500    
  
committer: Andrew Dunstan <[email protected]>    
date     : Wed, 29 Jan 2014 16:38:31 -0500    

Click here for diff

M src/include/catalog/catversion.h

Include planning time in EXPLAIN ANALYZE output.

commit   : 9347baa5bbc70368f2f01438bbb8116863dac1ec    
  
author   : Robert Haas <[email protected]>    
date     : Wed, 29 Jan 2014 16:04:19 -0500    
  
committer: Robert Haas <[email protected]>    
date     : Wed, 29 Jan 2014 16:04:19 -0500    

Click here for diff

This doesn't work for prepared queries, but it's not too easy to get  
the information in that case and there's some debate as to exactly  
what the right thing to measure is, so just do this for now.  
  
Andreas Karlsson, with slight doc changes by me.  

M doc/src/sgml/perform.sgml
M doc/src/sgml/ref/explain.sgml
M src/backend/commands/explain.c
M src/backend/commands/prepare.c
M src/include/commands/explain.h

Add json_array_elements_text function.

commit   : 5264d9154178d3aeaa0359b43a450298a7ce7281    
  
author   : Andrew Dunstan <[email protected]>    
date     : Wed, 29 Jan 2014 15:39:01 -0500    
  
committer: Andrew Dunstan <[email protected]>    
date     : Wed, 29 Jan 2014 15:39:01 -0500    

Click here for diff

This was a notable omission from the json functions added in 9.3 and  
there have been numerous complaints about its absence.  
  
Laurence Rowe.  

M doc/src/sgml/func.sgml
M src/backend/utils/adt/jsonfuncs.c
M src/include/catalog/pg_proc.h
M src/include/utils/json.h
M src/test/regress/expected/json.out
M src/test/regress/expected/json_1.out
M src/test/regress/sql/json.sql

Fix thinko in huge_tlb_pages patch.

commit   : 699b1f40da3139def660235fa8a782ec8dd8f575    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Wed, 29 Jan 2014 21:33:56 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Wed, 29 Jan 2014 21:33:56 +0200    

Click here for diff

We calculated the rounded-up size for the allocation, but then failed to  
use the rounded-up value in the mmap() call. Oops.  
  
Also, initialize allocsize, to silence warnings seen with some compilers,  
as pointed out by Jeff Janes.  

M src/backend/port/sysv_shmem.c

Further optimize GIN multi-key searches.

commit   : 626a120656a75bf4fe64b1d0d83c23cb38d3771a    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Wed, 29 Jan 2014 21:22:08 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Wed, 29 Jan 2014 21:22:08 +0200    

Click here for diff

When skipping over some items in a posting tree, re-find the new location  
by descending the tree from root, rather than walking the right links.  
This can save a lot of I/O.  
  
Heavily modified from Alexander Korotkov's fast scan patch.  

M src/backend/access/gin/gindatapage.c
M src/backend/access/gin/ginget.c
M src/include/access/gin_private.h

Fix pointer processing in new entab.c function

commit   : 8440897b38be38903ecc2041002bba08e08308ad    
  
author   : Bruce Momjian <[email protected]>    
date     : Wed, 29 Jan 2014 13:31:11 -0500    
  
committer: Bruce Momjian <[email protected]>    
date     : Wed, 29 Jan 2014 13:31:11 -0500    

Click here for diff

M src/tools/entab/entab.c

Add C functions to centralize entab processing

commit   : e93f7253a7999531b3768080fa4e58817ed8b112    
  
author   : Bruce Momjian <[email protected]>    
date     : Wed, 29 Jan 2014 12:48:07 -0500    
  
committer: Bruce Momjian <[email protected]>    
date     : Wed, 29 Jan 2014 12:48:07 -0500    

Click here for diff

M src/tools/entab/entab.c

Add more C comments to entab.c.

commit   : db90bcf8df427616a3dbce8ca3895874c2eaa9d7    
  
author   : Bruce Momjian <[email protected]>    
date     : Wed, 29 Jan 2014 12:22:12 -0500    
  
committer: Bruce Momjian <[email protected]>    
date     : Wed, 29 Jan 2014 12:22:12 -0500    

Click here for diff

M src/tools/entab/entab.c

Further optimize multi-key GIN searches.

commit   : 25b1dafab63f465a65c63b26834dc18857f0fa0c    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Wed, 29 Jan 2014 18:23:17 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Wed, 29 Jan 2014 18:23:17 +0200    

Click here for diff

If we're skipping past a certain TID, avoid decoding posting list segments  
that only contain smaller TIDs.  
  
Extracted from Alexander Korotkov's fast scan patch, heavily modified.  

M src/backend/access/gin/gindatapage.c
M src/backend/access/gin/ginget.c
M src/include/access/gin_private.h

Allow skipping some items in a multi-key GIN search.

commit   : e20c70cb0fa74d5bffa080e21a99b44bf0768667    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Wed, 29 Jan 2014 17:53:39 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Wed, 29 Jan 2014 17:53:39 +0200    

Click here for diff

In a multi-key search, ie. something like "col @> 'foo' AND col @> 'bar'",  
as soon as we find the next item that matches the first criteria, we don't  
need to check the second criteria for TIDs smaller the first match. That  
saves a lot of effort, especially if one of the terms is rare, while the  
second occurs very frequently.  
  
Based on ideas from Alexander Korotkov's fast scan patch.  

M src/backend/access/gin/ginget.c

Remedy two small omissions in the new json functions docs.

commit   : 2013e5eef7e08d924237c03196b76a9edf43254a    
  
author   : Andrew Dunstan <[email protected]>    
date     : Wed, 29 Jan 2014 09:51:02 -0500    
  
committer: Andrew Dunstan <[email protected]>    
date     : Wed, 29 Jan 2014 09:51:02 -0500    

Click here for diff

M doc/src/sgml/func.sgml

Fix docs build.

commit   : 991659dcd768163c77924e67a75088e91c713189    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Wed, 29 Jan 2014 16:16:19 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Wed, 29 Jan 2014 16:16:19 +0200    

Click here for diff

Broken by the huge_tlb_pages patch.  
  
Vik Fearing.  

M doc/src/sgml/config.sgml

Allow using huge TLB pages on Linux (MAP_HUGETLB)

commit   : 1a3458b6d8d202715a83c88474a1b63726d0929e    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Wed, 29 Jan 2014 13:44:45 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Wed, 29 Jan 2014 13:44:45 +0200    

Click here for diff

This patch adds an option, huge_tlb_pages, which allows requesting the  
shared memory segment to be allocated using huge pages, by using the  
MAP_HUGETLB flag in mmap(). This can improve performance.  
  
The default is 'try', which means that we will attempt using huge pages,  
and fall back to non-huge pages if it doesn't work. Currently, only Linux  
has MAP_HUGETLB. On other platforms, the default 'try' behaves the same as  
'off'.  
  
In the passing, don't try to round the mmap() size to a multiple of  
pagesize. mmap() doesn't require that, and there's no particular reason for  
PostgreSQL to do that either. When using MAP_HUGETLB, however, round the  
request size up to nearest 2MB boundary. This is to work around a bug in  
some Linux kernel versions, but also to avoid wasting memory, because the  
kernel will round the size up anyway.  
  
Many people were involved in writing this patch, including Christian Kruse,  
Richard Poole, Abhijit Menon-Sen, reviewed by Peter Geoghegan, Andres Freund  
and me.  

M doc/src/sgml/config.sgml
M src/backend/port/sysv_shmem.c
M src/backend/port/win32_shmem.c
M src/backend/utils/misc/guc.c
M src/backend/utils/misc/postgresql.conf.sample
M src/include/storage/pg_shmem.h

Fix compiler warning in EXEC_BACKEND builds.

commit   : b7643b19f0fdbfb1636db52e39db4be6f0174ce0    
  
author   : Robert Haas <[email protected]>    
date     : Tue, 28 Jan 2014 23:35:50 -0500    
  
committer: Robert Haas <[email protected]>    
date     : Tue, 28 Jan 2014 23:35:50 -0500    

Click here for diff

Per a report by Rajeev Rastogi.  

M src/backend/postmaster/postmaster.c

Minor docs fixes for new json functions.

commit   : c2099751cd85d46745a9734b64b953d3277e5b9e    
  
author   : Andrew Dunstan <[email protected]>    
date     : Tue, 28 Jan 2014 18:28:16 -0500    
  
committer: Andrew Dunstan <[email protected]>    
date     : Tue, 28 Jan 2014 18:28:16 -0500    

Click here for diff

Thom Brown.  

M doc/src/sgml/func.sgml

Add new make targets check-tests and installcheck-tests.

commit   : 7043ac7100cd80345d7f12ece60d05a3ab2baf06    
  
author   : Andrew Dunstan <[email protected]>    
date     : Tue, 28 Jan 2014 18:10:00 -0500    
  
committer: Andrew Dunstan <[email protected]>    
date     : Tue, 28 Jan 2014 18:10:00 -0500    

Click here for diff

These do not run any specific schedule of tests, but only those  
specified as part of the invocation, e.g.:  
  
    make check-tests TESTS="json jsonb"  

M GNUmakefile.in
M src/test/regress/GNUmakefile

New json functions.

commit   : 105639900bf83fd3e3eb5b49f49b4d74d6347b9b    
  
author   : Andrew Dunstan <[email protected]>    
date     : Tue, 28 Jan 2014 17:48:21 -0500    
  
committer: Andrew Dunstan <[email protected]>    
date     : Tue, 28 Jan 2014 17:48:21 -0500    

Click here for diff

json_build_array() and json_build_object allow for the construction of  
arbitrarily complex json trees. json_object() turns a one or two  
dimensional array, or two separate arrays, into a json_object of  
name/value pairs, similarly to the hstore() function.  
json_object_agg() aggregates its two arguments into a single json object  
as name value pairs.  
  
Catalog version bumped.  
  
Andrew Dunstan, reviewed by Marko Tiikkaja.  

M doc/src/sgml/func.sgml
M src/backend/utils/adt/json.c
M src/backend/utils/adt/jsonfuncs.c
M src/include/catalog/catversion.h
M src/include/catalog/pg_aggregate.h
M src/include/catalog/pg_proc.h
M src/include/utils/json.h
M src/test/regress/expected/json.out
M src/test/regress/expected/json_1.out
M src/test/regress/sql/json.sql

Add pg_stat_archiver statistics view.

commit   : 9132b189bf5589591cb63fef7952842b772e4fe6    
  
author   : Fujii Masao <[email protected]>    
date     : Wed, 29 Jan 2014 02:58:22 +0900    
  
committer: Fujii Masao <[email protected]>    
date     : Wed, 29 Jan 2014 02:58:22 +0900    

Click here for diff

This view shows the statistics about the WAL archiver process's activity.  
  
Gabriele Bartolini, reviewed by Michael Paquier, refactored a bit by me.  

M doc/src/sgml/monitoring.sgml
M src/backend/catalog/system_views.sql
M src/backend/postmaster/pgarch.c
M src/backend/postmaster/pgstat.c
M src/backend/utils/adt/pgstatfuncs.c
M src/include/catalog/pg_proc.h
M src/include/pgstat.h
M src/include/postmaster/pgarch.h
M src/test/regress/expected/rules.out

Update comment.

commit   : 98d62c28fd774ad8d123b66131dcdaa0b9c9d6d4    
  
author   : Tom Lane <[email protected]>    
date     : Tue, 28 Jan 2014 12:34:29 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Tue, 28 Jan 2014 12:34:29 -0500    

Click here for diff

generate_normalized_query() no longer needs to truncate text, but this  
one comment didn't get the memo.  Per Peter Geoghegan.  

M contrib/pg_stat_statements/pg_stat_statements.c

Revert C comment change in slot_attisnull()

commit   : c871e8f53bd6dc9249b6d79f2fde34dedb200824    
  
author   : Bruce Momjian <[email protected]>    
date     : Tue, 28 Jan 2014 12:28:14 -0500    
  
committer: Bruce Momjian <[email protected]>    
date     : Tue, 28 Jan 2014 12:28:14 -0500    

Click here for diff

Revert 89774b58b0ea2874765cae10c094bb6aaf707feb  

M src/backend/access/common/heaptuple.c

Remove orphaned prototype

commit   : 051b3341c1e8be67ec41a6d60dbb2a1df5582ca2    
  
author   : Bruce Momjian <[email protected]>    
date     : Tue, 28 Jan 2014 11:29:39 -0500    
  
committer: Bruce Momjian <[email protected]>    
date     : Tue, 28 Jan 2014 11:29:39 -0500    

Click here for diff

Rajeev rastogi  

M src/include/access/gin_private.h

Revert dup2() checking in syslogger.c

commit   : aef61bf433a9e9b6e2d98b0fdcce8562c3ad526f    
  
author   : Stephen Frost <[email protected]>    
date     : Tue, 28 Jan 2014 08:40:41 -0500    
  
committer: Stephen Frost <[email protected]>    
date     : Tue, 28 Jan 2014 08:40:41 -0500    

Click here for diff

Per the expanded comment-  
  
As we're just trying to reset these to go to DEVNULL, there's not  
much point in checking for failure from the close/dup2 calls here,  
if they fail then presumably the file descriptors are closed and  
any writes will go into the bitbucket anyway.  
  
Pointed out by Tom.  

M src/backend/postmaster/syslogger.c

Log a detail message for auth failures due to missing or expired password.

commit   : 64e43c59b817a78ddf70f2fd62de31a4add5d988    
  
author   : Tom Lane <[email protected]>    
date     : Mon, 27 Jan 2014 21:04:09 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Mon, 27 Jan 2014 21:04:09 -0500    

Click here for diff

It's worth distinguishing these cases from run-of-the-mill wrong-password  
problems, since users have been known to waste lots of time pursuing the  
wrong theory about what's failing.  Now, our longstanding policy about how  
to report authentication failures is that we don't really want to tell the  
*client* such things, since that might be giving information to a bad guy.  
But there's nothing wrong with reporting the details to the postmaster log,  
and indeed the comments in this area of the code contemplate that  
interesting details should be so reported.  We just weren't handling these  
particular interesting cases usefully.  
  
To fix, add infrastructure allowing subroutines of ClientAuthentication()  
to return a string to be added to the errdetail_log field of the main  
authentication-failed error report.  We might later want to use this to  
report other subcases of authentication failure the same way, but for the  
moment I just dealt with password cases.  
  
Per discussion of a patch from Josh Drake, though this is not what  
he proposed.  

M src/backend/libpq/auth.c
M src/backend/libpq/crypt.c
M src/include/libpq/crypt.h

Keep pg_stat_statements' query texts in a file, not in shared memory.

commit   : f0d6f20278b7c5c412ce40a9b86c6b31dc2fbfdd    
  
author   : Tom Lane <[email protected]>    
date     : Mon, 27 Jan 2014 15:37:54 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Mon, 27 Jan 2014 15:37:54 -0500    

Click here for diff

This change allows us to eliminate the previous limit on stored query  
length, and it makes the shared-memory hash table very much smaller,  
allowing more statements to be tracked.  (The default value of  
pg_stat_statements.max is therefore increased from 1000 to 5000.)  
In typical scenarios, the hash table can be large enough to hold all the  
statements commonly issued by an application, so that there is little  
"churn" in the set of tracked statements, and thus little need to do I/O  
to the file.  
  
To further reduce the need for I/O to the query-texts file, add a way  
to retrieve all the columns of the pg_stat_statements view except for  
the query text column.  This is probably not of much interest for human  
use but it could be exploited by programs, which will prefer using the  
queryid anyway.  
  
Ordinarily, we'd need to bump the extension version number for the latter  
change.  But since we already advanced pg_stat_statements' version number  
from 1.1 to 1.2 in the 9.4 development cycle, it seems all right to just  
redefine what 1.2 means.  
  
Peter Geoghegan, reviewed by Pavel Stehule  

M contrib/pg_stat_statements/pg_stat_statements–1.1–1.2.sql
M contrib/pg_stat_statements/pg_stat_statements–1.2.sql
M contrib/pg_stat_statements/pg_stat_statements.c
M doc/src/sgml/pgstatstatements.sgml

Relax the requirement that all lwlocks be stored in a single array.

commit   : ea9df812d8502fff74e7bc37d61bdc7d66d77a7f    
  
author   : Robert Haas <[email protected]>    
date     : Mon, 27 Jan 2014 11:07:44 -0500    
  
committer: Robert Haas <[email protected]>    
date     : Mon, 27 Jan 2014 11:07:44 -0500    

Click here for diff

This makes it possible to store lwlocks as part of some other data  
structure in the main shared memory segment, or in a dynamic shared  
memory segment.  There is still a main LWLock array and this patch does  
not move anything out of it, but it provides necessary infrastructure  
for doing that in the future.  
  
This change is likely to increase the size of LWLockPadded on some  
platforms, especially 32-bit platforms where it was previously only  
16 bytes.  
  
Patch by me.  Review by Andres Freund and KaiGai Kohei.  

M contrib/pg_buffercache/pg_buffercache_pages.c
M contrib/pg_stat_statements/pg_stat_statements.c
M doc/src/sgml/monitoring.sgml
M src/backend/access/transam/slru.c
M src/backend/postmaster/postmaster.c
M src/backend/storage/buffer/bufmgr.c
M src/backend/storage/ipc/ipci.c
M src/backend/storage/lmgr/lock.c
M src/backend/storage/lmgr/lwlock.c
M src/backend/storage/lmgr/predicate.c
M src/backend/storage/lmgr/proc.c
M src/backend/utils/probes.d
M src/include/access/slru.h
M src/include/storage/buf_internals.h
M src/include/storage/lock.h
M src/include/storage/lwlock.h
M src/include/storage/proc.h
M src/tools/pgindent/typedefs.list

Fix typo in README

commit   : f62eba204f367acbfea7e63991524bf981b307f8    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Mon, 27 Jan 2014 09:32:51 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Mon, 27 Jan 2014 09:32:51 +0200    

Click here for diff

Amit Langote  

M src/backend/catalog/README

Code review for auto-tuned effective_cache_size.

commit   : 2850896961994aa0993b9e2ed79a209750181b8a    
  
author   : Tom Lane <[email protected]>    
date     : Mon, 27 Jan 2014 00:05:49 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Mon, 27 Jan 2014 00:05:49 -0500    

Click here for diff

Fix integer overflow issue noted by Magnus Hagander, as well as a bunch  
of other infelicities in commit ee1e5662d8d8330726eaef7d3110cb7add24d058  
and its unreasonably large number of followups.  

M doc/src/sgml/config.sgml
M src/backend/optimizer/path/costsize.c
M src/backend/postmaster/postmaster.c
M src/backend/utils/misc/guc.c
M src/backend/utils/misc/postgresql.conf.sample
M src/include/optimizer/cost.h
M src/include/utils/guc.h

Change the suffix of auto conf temporary file from "temp" to "tmp".

commit   : dd515d4082876f9fcc0b6eed421dd3b6d43579be    
  
author   : Fujii Masao <[email protected]>    
date     : Mon, 27 Jan 2014 12:39:11 +0900    
  
committer: Fujii Masao <[email protected]>    
date     : Mon, 27 Jan 2014 12:39:11 +0900    

Click here for diff

Michael Paquier  

M src/backend/replication/basebackup.c
M src/backend/utils/misc/guc.c

Fix typos in comments for ALTER SYSTEM.

commit   : 7c619be623237f3fee3222bc171a6a0afb0ce7a5    
  
author   : Fujii Masao <[email protected]>    
date     : Mon, 27 Jan 2014 12:23:20 +0900    
  
committer: Fujii Masao <[email protected]>    
date     : Mon, 27 Jan 2014 12:23:20 +0900    

Click here for diff

Michael Paquier  

M src/backend/utils/misc/guc-file.l
M src/backend/utils/misc/guc.c
M src/bin/initdb/initdb.c
M src/include/pg_config_manual.h

Fix minor leak in pg_dump

commit   : 152d24f5ddbc535bb437b57856fa3c7c5c630472    
  
author   : Stephen Frost <[email protected]>    
date     : Sun, 26 Jan 2014 17:58:48 -0500    
  
committer: Stephen Frost <[email protected]>    
date     : Sun, 26 Jan 2014 17:58:48 -0500    

Click here for diff

Move allocation to after we check the remote server version, to avoid  
a possible, very minor, memory leak.  This makes us more consistent  
throughout as most places in pg_dump are done in the same way (due, in  
part, to previous fixes like this).  
  
Spotted by the Coverity scanner.  

M src/bin/pg_dump/pg_dump.c

Provide for client-only installs with MSVC.

commit   : a7e5f7bf6890fdf14a6c6ecd0854ac3f5f308ccd    
  
author   : Andrew Dunstan <[email protected]>    
date     : Sun, 26 Jan 2014 17:03:13 -0500    
  
committer: Andrew Dunstan <[email protected]>    
date     : Sun, 26 Jan 2014 17:03:13 -0500    

Click here for diff

MauMau.  

M doc/src/sgml/install-windows.sgml
M src/tools/msvc/Install.pm
M src/tools/msvc/install.bat
M src/tools/msvc/install.pl
M src/tools/msvc/vcregress.pl

Check dup2() results in syslogger

commit   : 790eaa699e4a9626d8a610ec5844e1fd70d73b4e    
  
author   : Stephen Frost <[email protected]>    
date     : Sun, 26 Jan 2014 16:26:18 -0500    
  
committer: Stephen Frost <[email protected]>    
date     : Sun, 26 Jan 2014 16:26:18 -0500    

Click here for diff

Consistently check the dup2() call results throughout syslogger.c.  
It's pretty unlikely that they'll error out, but if they do,  
ereport(FATAL) instead of blissfully continuing on.  
  
Spotted by the Coverity scanner.  

M src/backend/postmaster/syslogger.c

Move the options column of \db+ before the description

commit   : f2795f8b5393005ab2d2438fadce116b032bea6e    
  
author   : Magnus Hagander <[email protected]>    
date     : Sun, 26 Jan 2014 21:13:57 +0100    
  
committer: Magnus Hagander <[email protected]>    
date     : Sun, 26 Jan 2014 21:13:57 +0100    

Click here for diff

The convention is to have the description field at the end.  
  
Noted by Tom Lane  

M src/bin/psql/describe.c

Include tablespace options in verbose output of \db

commit   : cae10ca27e5d478353b9b053073e5f2a1cf97659    
  
author   : Magnus Hagander <[email protected]>    
date     : Sun, 26 Jan 2014 18:11:15 +0100    
  
committer: Magnus Hagander <[email protected]>    
date     : Sun, 26 Jan 2014 18:11:15 +0100    

Click here for diff

M src/bin/psql/describe.c

Enable building with Visual Studion 2013.

commit   : cec8394b5ccd32259e446f963690dd4784646b4d    
  
author   : Andrew Dunstan <[email protected]>    
date     : Sun, 26 Jan 2014 09:49:10 -0500    
  
committer: Andrew Dunstan <[email protected]>    
date     : Sun, 26 Jan 2014 09:49:10 -0500    

Click here for diff

Backpatch to 9.3.  
  
Brar Piening.  

M doc/src/sgml/install-windows.sgml
M src/backend/utils/adt/float.c
M src/bin/pg_ctl/pg_ctl.c
M src/include/pg_config.h.win32
M src/include/port/win32.h
M src/tools/msvc/MSBuildProject.pm
M src/tools/msvc/Mkvcbuild.pm
M src/tools/msvc/Solution.pm
M src/tools/msvc/VSObjectFactory.pm

Use E, not e, for escaping in example docs

commit   : 00ba97365d356823c48c02147b4cd66f8f06b1d6    
  
author   : Stephen Frost <[email protected]>    
date     : Sun, 26 Jan 2014 09:40:34 -0500    
  
committer: Stephen Frost <[email protected]>    
date     : Sun, 26 Jan 2014 09:40:34 -0500    

Click here for diff

From the Department of Nitpicking, be consistent with other escaping  
and use 'E' instead of 'e' to escape the string in the example docs  
for GET DISAGNOSTICS stack = PG_CONTEXT.  
  
Noticed by Department Chief Magnus Hagander.  

M doc/src/sgml/plpgsql.sgml

Adjust C comment in slot_attisnull() regarding nulls.

commit   : 89774b58b0ea2874765cae10c094bb6aaf707feb    
  
author   : Bruce Momjian <[email protected]>    
date     : Sat, 25 Jan 2014 16:43:14 -0500    
  
committer: Bruce Momjian <[email protected]>    
date     : Sat, 25 Jan 2014 16:43:14 -0500    

Click here for diff

M src/backend/access/common/heaptuple.c

Copy-editing docs for recovery_target='immediate', and "ie."

commit   : a16c2edcc7d54ae36dc8acec23201b1d2dfc34b0    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Sat, 25 Jan 2014 23:30:17 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Sat, 25 Jan 2014 23:30:17 +0200    

Click here for diff

Phrase the sentence better. Also, spell "i.e." rather than "ie."  
  
Thom Brown  

M doc/src/sgml/config.sgml
M doc/src/sgml/recovery-config.sgml

docs: mention CREATE TABLE LIKE linkage using INCLUDING DEFAULTS

commit   : e2989fcab6150da5b4296eb1481284ad2825892e    
  
author   : Bruce Momjian <[email protected]>    
date     : Sat, 25 Jan 2014 14:32:48 -0500    
  
committer: Bruce Momjian <[email protected]>    
date     : Sat, 25 Jan 2014 14:32:48 -0500    

Click here for diff

Mention that CREATE TABLE LIKE INCLUDING DEFAULTS creates a link between  
the original and new tables if a default function modifies the database,  
like nextval().  

M doc/src/sgml/ref/create_table.sgml

Add recovery_target='immediate' option.

commit   : 71c6a8e375b138af8aa46d80226ea9e98f2b94bc    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Sat, 25 Jan 2014 17:34:04 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Sat, 25 Jan 2014 17:34:04 +0200    

Click here for diff

This allows ending recovery as a consistent state has been reached. Without  
this, there was no easy way to e.g restore an online backup, without  
replaying any extra WAL after the backup ended.  
  
MauMau and me.  

M doc/src/sgml/backup.sgml
M doc/src/sgml/recovery-config.sgml
M src/backend/access/transam/recovery.conf.sample
M src/backend/access/transam/xlog.c
M src/include/access/xlog.h

libpq: Support TLS versions beyond TLSv1.

commit   : 820f08cabdcbb8998050c3d4873e9619d6d8cba4    
  
author   : Noah Misch <[email protected]>    
date     : Fri, 24 Jan 2014 19:29:06 -0500    
  
committer: Noah Misch <[email protected]>    
date     : Fri, 24 Jan 2014 19:29:06 -0500    

Click here for diff

Per report from Jeffrey Walton, libpq has been accepting only TLSv1  
exactly.  Along the lines of the backend code, libpq will now support  
new versions as OpenSSL adds them.  
  
Marko Kreen, reviewed by Wim Lewis.  

M src/interfaces/libpq/fe-secure.c

psql: Mention SSL protocol version in \conninfo.

commit   : 3a5313265d53322519b5edce018ebdea14062bf9    
  
author   : Noah Misch <[email protected]>    
date     : Fri, 24 Jan 2014 19:23:56 -0500    
  
committer: Noah Misch <[email protected]>    
date     : Fri, 24 Jan 2014 19:23:56 -0500    

Click here for diff

Marko Kreen, reviewed by Wim Lewis.  

M src/bin/psql/command.c

Avoid minor leak in parallel pg_dump

commit   : 6794a9f9a194e24862e60a918eac031b7641686c    
  
author   : Stephen Frost <[email protected]>    
date     : Fri, 24 Jan 2014 15:10:08 -0500    
  
committer: Stephen Frost <[email protected]>    
date     : Fri, 24 Jan 2014 15:10:08 -0500    

Click here for diff

During parallel pg_dump, a worker process closing the connection caused  
a minor memory leak (particularly minor as we are likely about to exit  
anyway).  Instead, free the memory in this case prior to returning NULL  
to indicate connection closed.  
  
Spotting by the Coverity scanner.  
  
Back patch to 9.3 where this was introduced.  

M src/bin/pg_dump/parallel.c

Reset unused fields in GIN data leaf page footer.

commit   : d150ff57812ae01a2f78a55f33a46f9b7febf933    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Fri, 24 Jan 2014 19:08:52 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Fri, 24 Jan 2014 19:08:52 +0200    

Click here for diff

The maxoff field is not used in the new, compressed page format. Let's  
reset it when converting an old-format page to the new format. The code  
won't care either way, but this makes it possible to use the field for  
something else in the future.  

M src/backend/access/gin/gindatapage.c
M src/backend/access/gin/ginxlog.c

Fix off-by-one in newly-introdcued GIN assertion.

commit   : a8f374849fe2e2fcd62bbba8be85ccf030c31683    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Fri, 24 Jan 2014 11:10:09 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Fri, 24 Jan 2014 11:10:09 +0200    

Click here for diff

Spotted by Alexander Korotkov  

M src/backend/access/gin/gindatapage.c

In GIN recompression code, use mmemove rather than memcpy, for vacuum.

commit   : 398cf255ad50db86ca665b75582317d4e795242a    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Fri, 24 Jan 2014 10:42:38 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Fri, 24 Jan 2014 10:42:38 +0200    

Click here for diff

When vacuuming a data leaf page, any compressed posting lists that are not  
modified, are copied back to the buffer from a later location in the same  
buffer rather than from  a palloc'd copy. IOW, they are just moved  
downwards in the same buffer. Because the source and destination addresses  
can overlap, we must use memmove rather than memcpy.  
  
Report and fix by Alexander Korotkov.  

M src/backend/access/gin/gindatapage.c

ALTER TABLESPACE ... MOVE ... OWNED BY

commit   : fbe19ee3b87590f1006d072be5fecf8a33d4e9f5    
  
author   : Stephen Frost <[email protected]>    
date     : Thu, 23 Jan 2014 23:52:40 -0500    
  
committer: Stephen Frost <[email protected]>    
date     : Thu, 23 Jan 2014 23:52:40 -0500    

Click here for diff

Add the ability to specify the objects to move by who those objects are  
owned by (as relowner) and change ALL to mean ALL objects.  This  
makes the command always operate against a well-defined set of objects  
and not have the objects-to-be-moved based on the role of the user  
running the command.  
  
Per discussion with Simon and Tom.  

M doc/src/sgml/ref/alter_tablespace.sgml
M src/backend/commands/tablespace.c
M src/backend/commands/user.c
M src/backend/nodes/copyfuncs.c
M src/backend/nodes/equalfuncs.c
M src/backend/parser/gram.y
M src/include/commands/user.h
M src/include/nodes/parsenodes.h

Remove duplicate index entry DATE_TRUNC in document.

commit   : 3ee74df2e48cde3c471637d14b18475abb0eb69a    
  
author   : Fujii Masao <[email protected]>    
date     : Fri, 24 Jan 2014 11:12:48 +0900    
  
committer: Fujii Masao <[email protected]>    
date     : Fri, 24 Jan 2014 11:12:48 +0900    

Click here for diff

M doc/src/sgml/func.sgml

Allow use of "z" flag in our printf calls, and use it where appropriate.

commit   : ac4ef637ad2ff2a24847f67d14027b8745f6741e    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 23 Jan 2014 17:18:23 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 23 Jan 2014 17:18:23 -0500    

Click here for diff

Since C99, it's been standard for printf and friends to accept a "z" size  
modifier, meaning "whatever size size_t has".  Up to now we've generally  
dealt with printing size_t values by explicitly casting them to unsigned  
long and using the "l" modifier; but this is really the wrong thing on  
platforms where pointers are wider than longs (such as Win64).  So let's  
start using "z" instead.  To ensure we can do that on all platforms, teach  
src/port/snprintf.c to understand "z", and add a configure test to force  
use of that implementation when the platform's version doesn't handle "z".  
  
Having done that, modify a bunch of places that were using the  
unsigned-long hack to use "z" instead.  This patch doesn't pretend to have  
gotten everyplace that could benefit, but it catches many of them.  I made  
an effort in particular to ensure that all uses of the same error message  
text were updated together, so as not to increase the number of  
translatable strings.  
  
It's possible that this change will result in format-string warnings from  
pre-C99 compilers.  We might have to reconsider if there are any popular  
compilers that will warn about this; but let's start by seeing what the  
buildfarm thinks.  
  
Andres Freund, with a little additional work by me  

M config/c-library.m4
M configure
M configure.in
M src/backend/access/common/indextuple.c
M src/backend/access/gin/ginentrypage.c
M src/backend/access/hash/hashinsert.c
M src/backend/access/heap/hio.c
M src/backend/access/heap/rewriteheap.c
M src/backend/access/nbtree/nbtinsert.c
M src/backend/access/nbtree/nbtsort.c
M src/backend/access/spgist/spgdoinsert.c
M src/backend/access/spgist/spgutils.c
M src/backend/access/transam/xlog.c
M src/backend/nodes/readfuncs.c
M src/backend/port/sysv_shmem.c
M src/backend/port/win32_shmem.c
M src/backend/storage/file/fd.c
M src/backend/storage/freespace/freespace.c
M src/backend/storage/ipc/dsm.c
M src/backend/storage/ipc/dsm_impl.c
M src/backend/storage/ipc/ipci.c
M src/backend/storage/ipc/shmem.c
M src/backend/storage/lmgr/predicate.c
M src/backend/utils/mmgr/aset.c
M src/backend/utils/mmgr/mcxt.c
M src/include/pg_config.h.in
M src/port/snprintf.c

Fix alignment of GIN in-line posting lists stored in entry tuples.

commit   : ec8f692c3cd5760435712b7ec4afa8f014ed7b2e    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Thu, 23 Jan 2014 22:58:12 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Thu, 23 Jan 2014 22:58:12 +0200    

Click here for diff

The Sparc machines in the buildfarm are crashing because of misaligned  
access to posting lists stored in entry tuples.  
  
I accidentally removed a critical SHORTALIGN() from ginFormTuple, as part  
of the packed posting lists patch. Perhaps I thought it was unnecessary,  
because the index_form_tuple() call above the SHORTALIGN already aligned  
the size, missing the fact that the null-category byte makes it misaligned  
again (I think the SHORTALIGN is indeed unnecessary if there's no null-  
category byte, but let's just play it safe...)  

M src/backend/access/gin/ginentrypage.c

Silence compiler warning.

commit   : 0fdb2f7d7c0059a1621710206ed506124cf98f77    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Thu, 23 Jan 2014 22:14:20 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Thu, 23 Jan 2014 22:14:20 +0200    

Click here for diff

Not all compilers understand that elog(ERROR, ...) never returns.  

M src/backend/access/gin/ginbtree.c

Make DROP IF EXISTS more consistently not fail

commit   : b152c6cd0de1827ba58756e24e18110cf902182a    
  
author   : Alvaro Herrera <[email protected]>    
date     : Thu, 23 Jan 2014 14:40:29 -0300    
  
committer: Alvaro Herrera <[email protected]>    
date     : Thu, 23 Jan 2014 14:40:29 -0300    

Click here for diff

Some cases were still reporting errors and aborting, instead of a NOTICE  
that the object was being skipped.  This makes it more difficult to  
cleanly handle pg_dump --clean, so change that to instead skip missing  
objects properly.  
  
Per bug #7873 reported by Dave Rolsky; apparently this affects a large  
number of users.  
  
Authors: Pavel Stehule and Dean Rasheed.  Some tweaks by Álvaro Herrera  

M src/backend/catalog/namespace.c
M src/backend/catalog/objectaddress.c
M src/backend/commands/dropcmds.c
M src/backend/commands/functioncmds.c
M src/backend/commands/opclasscmds.c
M src/backend/commands/tablecmds.c
M src/backend/commands/typecmds.c
M src/backend/parser/parse_func.c
M src/backend/parser/parse_oper.c
M src/backend/parser/parse_type.c
M src/backend/utils/adt/regproc.c
M src/include/catalog/namespace.h
M src/include/parser/parse_type.h
M src/pl/plpgsql/src/pl_comp.c
M src/test/regress/expected/drop_if_exists.out
M src/test/regress/expected/event_trigger.out
M src/test/regress/sql/drop_if_exists.sql

Add libpq function PQhostaddr().

commit   : 9f80f4835a55a1cbffcda5d23a617917f3286c14    
  
author   : Fujii Masao <[email protected]>    
date     : Fri, 24 Jan 2014 02:32:39 +0900    
  
committer: Fujii Masao <[email protected]>    
date     : Fri, 24 Jan 2014 02:32:39 +0900    

Click here for diff

There was a bug in the psql's meta command \conninfo. When the  
IP address was specified in the hostaddr and psql used it to create  
a connection (i.e., psql -d "hostaddr=xxx"), \conninfo could not  
display that address. This is because \conninfo got the connection  
information only from PQhost() which could not return hostaddr.  
  
This patch adds PQhostaddr(), and changes \conninfo so that it  
can display not only the host name that PQhost() returns but also  
the IP address which PQhostaddr() returns.  
  
The bug has existed since 9.1 where \conninfo was introduced.  
But it's too late to add new libpq function into the released versions,  
so no backpatch.  

M doc/src/sgml/libpq.sgml
M src/bin/psql/command.c
M src/interfaces/libpq/exports.txt
M src/interfaces/libpq/fe-connect.c
M src/interfaces/libpq/libpq-fe.h

Allow case insensitive build version argument for MSVC.

commit   : d5bc6ce6ac20e6de8b61946977db14e13acec2a0    
  
author   : Andrew Dunstan <[email protected]>    
date     : Thu, 23 Jan 2014 12:18:15 -0500    
  
committer: Andrew Dunstan <[email protected]>    
date     : Thu, 23 Jan 2014 12:18:15 -0500    

Click here for diff

Dilip Kumar.  

M src/tools/msvc/build.pl

Fix bugs in PQhost().

commit   : 77035fa8a92d8c39f4c689e54f46813f203f09a8    
  
author   : Fujii Masao <[email protected]>    
date     : Thu, 23 Jan 2014 22:48:12 +0900    
  
committer: Fujii Masao <[email protected]>    
date     : Thu, 23 Jan 2014 22:48:12 +0900    

Click here for diff

In the platform that doesn't support Unix-domain socket, when  
neither host nor hostaddr are specified, the default host  
'localhost' is used to connect to the server and PQhost() must  
return that, but it didn't. This patch fixes PQhost() so that  
it returns the default host in that case.  
  
Also this patch fixes PQhost() so that it doesn't return  
Unix-domain socket directory path in the platform that doesn't  
support Unix-domain socket.  
  
Back-patch to all supported versions.  

M src/interfaces/libpq/fe-connect.c

Add date_trunc('', interval) documentation mention

commit   : 90afc7d805657f6913935913a5bbd2462da80388    
  
author   : Bruce Momjian <[email protected]>    
date     : Wed, 22 Jan 2014 22:26:45 -0500    
  
committer: Bruce Momjian <[email protected]>    
date     : Wed, 22 Jan 2014 22:26:45 -0500    

Click here for diff

Report from Eric Howe  

M doc/src/sgml/func.sgml

Fix declaration of GinVacuumState.

commit   : 6668ad1d7004e9420107dda5bab1690193b13bc6    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Wed, 22 Jan 2014 19:54:16 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Wed, 22 Jan 2014 19:54:16 +0200    

Click here for diff

gcc 4.8 was happy with having a duplicate typedef, but most compilers seem not  
to be, per buildfarm.  

M src/backend/access/gin/ginvacuum.c

Compress GIN posting lists, for smaller index size.

commit   : 36a35c550ac114caa423bcbe339d3515db0cd957    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Wed, 22 Jan 2014 18:51:48 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Wed, 22 Jan 2014 18:51:48 +0200    

Click here for diff

GIN posting lists are now encoded using varbyte-encoding, which allows them  
to fit in much smaller space than the straight ItemPointer array format used  
before. The new encoding is used for both the lists stored in-line in entry  
tree items, and in posting tree leaf pages.  
  
To maintain backwards-compatibility and keep pg_upgrade working, the code  
can still read old-style pages and tuples. Posting tree leaf pages in the  
new format are flagged with GIN_COMPRESSED flag, to distinguish old and new  
format pages. Likewise, entry tree tuples in the new format have a  
GIN_ITUP_COMPRESSED flag set in a bit that was previously unused.  
  
This patch bumps GIN_CURRENT_VERSION from 1 to 2. New indexes created with  
version 9.4 will therefore have version number 2 in the metapage, while old  
pg_upgraded indexes will have version 1. The code treats them the same, but  
it might be come handy in the future, if we want to drop support for the  
uncompressed format.  
  
Alexander Korotkov and me. Reviewed by Tomas Vondra and Amit Langote.  

M contrib/pgstattuple/expected/pgstattuple.out
M src/backend/access/gin/README
M src/backend/access/gin/ginbtree.c
M src/backend/access/gin/gindatapage.c
M src/backend/access/gin/ginentrypage.c
M src/backend/access/gin/ginfast.c
M src/backend/access/gin/ginget.c
M src/backend/access/gin/gininsert.c
M src/backend/access/gin/ginpostinglist.c
M src/backend/access/gin/ginvacuum.c
M src/backend/access/gin/ginxlog.c
M src/backend/access/rmgrdesc/gindesc.c
M src/include/access/gin_private.h

Reindent json.c and jsonfuncs.c.

commit   : 243ee266339bd4a049ff92e101010242169b7287    
  
author   : Andrew Dunstan <[email protected]>    
date     : Wed, 22 Jan 2014 08:46:51 -0500    
  
committer: Andrew Dunstan <[email protected]>    
date     : Wed, 22 Jan 2014 08:46:51 -0500    

Click here for diff

This will help in preparation of clean patches for upcoming  
json work.  

M src/backend/utils/adt/json.c
M src/backend/utils/adt/jsonfuncs.c

Allow type_func_name_keywords in even more places

commit   : 6c36f383df728866d7085c155cbe45ebc07b195f    
  
author   : Stephen Frost <[email protected]>    
date     : Tue, 21 Jan 2014 22:49:22 -0500    
  
committer: Stephen Frost <[email protected]>    
date     : Tue, 21 Jan 2014 22:49:22 -0500    

Click here for diff

A while back, 2c92edad48796119c83d7dbe6c33425d1924626d allowed  
type_func_name_keywords to be used in more places, including role  
identifiers.  Unfortunately, that commit missed out on cases where  
name_list was used for lists-of-roles, eg: for DROP ROLE.  This  
resulted in the unfortunate situation that you could CREATE a role  
with a type_func_name_keywords-allowed identifier, but not DROP it  
(directly- ALTER could be used to rename it to something which  
could be DROP'd).  
  
This extends allowing type_func_name_keywords to places where role  
lists can be used.  
  
Back-patch to 9.0, as 2c92edad48796119c83d7dbe6c33425d1924626d was.  

M src/backend/parser/gram.y

commit   : 69c7a9838c82bbfdd61301c697e3774e9543805e    
  
author   : Tom Lane <[email protected]>    
date     : Tue, 21 Jan 2014 16:34:28 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Tue, 21 Jan 2014 16:34:28 -0500    

Click here for diff

All these constructs generate parse trees consisting of a Const and  
a run-time type coercion (perhaps a FuncExpr or a CoerceViaIO).  Modify  
the raw parse output so that we end up with the original token's location  
attached to the type coercion node while the Const has location -1;  
before, it was the other way around.  This makes no difference in terms  
of what exprLocation() will say about the parse tree as a whole, so it  
should not have any user-visible impact.  The point of changing it is that  
we do not want contrib/pg_stat_statements to treat these constructs as  
replaceable constants.  It will do the right thing if the Const has  
location -1 rather than a valid location.  
  
This is a pretty ugly hack, but then this code is ugly already; we should  
someday replace this translation with special-purpose parse node(s) that  
would allow ruleutils.c to reconstruct the original query text.  
  
(See also commit 5d3fcc4c2e137417ef470d604fee5e452b22f6a7, which also  
hacked location assignment rules for the benefit of pg_stat_statements.)  
  
Back-patch to 9.2 where pg_stat_statements grew the ability to recognize  
replaceable constants.  
  
Kyotaro Horiguchi  

M src/backend/parser/gram.y

Add a cardinality function for arrays.

commit   : 01f7808b3eafcae1f6077f2f61e13b4c132ccd47    
  
author   : Robert Haas <[email protected]>    
date     : Tue, 21 Jan 2014 12:38:53 -0500    
  
committer: Robert Haas <[email protected]>    
date     : Tue, 21 Jan 2014 12:38:53 -0500    

Click here for diff

Unlike our other array functions, this considers the total number of  
elements across all dimensions, and returns 0 rather than NULL when the  
array has no elements.  But it seems that both of those behaviors are  
almost universally disliked, so hopefully that's OK.  
  
Marko Tiikkaja, reviewed by Dean Rasheed and Pavel Stehule  

M doc/src/sgml/array.sgml
M doc/src/sgml/func.sgml
M src/backend/utils/adt/arrayfuncs.c
M src/include/catalog/catversion.h
M src/include/catalog/pg_proc.h
M src/include/utils/array.h
M src/test/regress/expected/arrays.out
M src/test/regress/sql/arrays.sql

Fix inadvertent semantics change in last patch to plug memory leaks.

commit   : 033b2343fae9d8c9df124cde62087dcb481c9c5e    
  
author   : Robert Haas <[email protected]>    
date     : Tue, 21 Jan 2014 11:42:37 -0500    
  
committer: Robert Haas <[email protected]>    
date     : Tue, 21 Jan 2014 11:42:37 -0500    

Click here for diff

Commit a5bca4ef034f71175d46462963af2329d22068c2 accidentally changed  
the semantics when the "skipping missing configuration file" is  
emitted, because it forced OK to true instead of leaving the value  
untouched.  
  
Spotted by Tom Lane.  

M src/backend/utils/misc/guc-file.l

Avoid a possible relcache leak in get_object_address_attribute.

commit   : 5709b8acc67d80584e9623a1d355374b580c95e8    
  
author   : Robert Haas <[email protected]>    
date     : Tue, 21 Jan 2014 10:02:37 -0500    
  
committer: Robert Haas <[email protected]>    
date     : Tue, 21 Jan 2014 10:02:37 -0500    

Click here for diff

There's no apparent way to trigger this, so I'm not going to worry  
about back-patching it for now.  But it's still wrong.  
  
Marti Raudsepp  

M src/backend/catalog/objectaddress.c

Plug more memory leaks when reloading config file.

commit   : a5bca4ef034f71175d46462963af2329d22068c2    
  
author   : Robert Haas <[email protected]>    
date     : Tue, 21 Jan 2014 09:41:40 -0500    
  
committer: Robert Haas <[email protected]>    
date     : Tue, 21 Jan 2014 09:41:40 -0500    

Click here for diff

Commit 138184adc5f7c60c184972e4d23f8cdb32aed77d plugged some but not  
all of the leaks from commit 2a0c81a12c7e6c5ac1557b0f1f4a581f23fd4ca7.  
This tightens things up some more.  
  
Amit Kapila, per an observation by Tom Lane  

M src/backend/utils/misc/guc-file.l

Expose a routine to print triggers during EXPLAIN ANALYZE

commit   : d2458e3b20f744ef88a8d3afaab91caa17508370    
  
author   : Alvaro Herrera <[email protected]>    
date     : Mon, 20 Jan 2014 17:12:50 -0300    
  
committer: Alvaro Herrera <[email protected]>    
date     : Mon, 20 Jan 2014 17:12:50 -0300    

Click here for diff

This is so that auto_explain can use it.  
  
Kyotaro HORIGUCHI  

M src/backend/commands/explain.c
M src/include/commands/explain.h

Remove pg_stat_statements--1.1.sql.

commit   : fe0c690dfdcf628671d62d04caa39449fdc56078    
  
author   : Tom Lane <[email protected]>    
date     : Mon, 20 Jan 2014 15:03:51 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Mon, 20 Jan 2014 15:03:51 -0500    

Click here for diff

Commit 91484409bdd17f330d10671d388b72d4ef1451d7 should have removed this  
file, not just reduced it to zero size.  

D contrib/pg_stat_statements/pg_stat_statements–1.1.sql

Fix to_timestamp/to_date's handling of consecutive spaces in format string.

commit   : 9a8f5729b4625ec0468ad5a48296c3e729cf3e65    
  
author   : Tom Lane <[email protected]>    
date     : Mon, 20 Jan 2014 13:45:51 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Mon, 20 Jan 2014 13:45:51 -0500    

Click here for diff

When there are consecutive spaces (or other non-format-code characters) in  
the format, we should advance over exactly that many characters of input.  
The previous coding mistakenly did a "skip whitespace" action between such  
characters, possibly allowing more input to be skipped than the user  
intended.  We only need to skip whitespace just before an actual field.  
  
This is really a bug fix, but given the minimal number of field complaints  
and the risk of breaking applications coded to expect the old behavior,  
let's not back-patch it.  
  
Jeevan Chalke  

M src/backend/utils/adt/formatting.c
M src/test/regress/expected/horology.out
M src/test/regress/sql/horology.sql

Fix typo in comment.

commit   : 5363c7f2bc5e77caf2f308bed93e3e881a9113cf    
  
author   : Fujii Masao <[email protected]>    
date     : Tue, 21 Jan 2014 02:22:49 +0900    
  
committer: Fujii Masao <[email protected]>    
date     : Tue, 21 Jan 2014 02:22:49 +0900    

Click here for diff

Sawada Masahiko  

M src/backend/commands/cluster.c

Speed up COPY into tables with DEFAULT nextval()

commit   : 4d1e2aeb1a162770683a8d1e13fc13ac2d95d810    
  
author   : Simon Riggs <[email protected]>    
date     : Mon, 20 Jan 2014 17:22:38 +0000    
  
committer: Simon Riggs <[email protected]>    
date     : Mon, 20 Jan 2014 17:22:38 +0000    

Click here for diff

Previously the presence of a nextval() prevented the  
use of batch-mode COPY.  This patch introduces a  
special case just for nextval() functions. In future  
we will introduce a general case solution for  
labelling volatile functions as safe for use.  

M src/backend/commands/copy.c
M src/backend/optimizer/util/clauses.c
M src/include/optimizer/clauses.h

Rename msvc build option krb5 to gss

commit   : 74a72ec208671f3ff301b4f6ef703f4957deccea    
  
author   : Magnus Hagander <[email protected]>    
date     : Sun, 19 Jan 2014 17:07:15 +0100    
  
committer: Magnus Hagander <[email protected]>    
date     : Sun, 19 Jan 2014 17:07:15 +0100    

Click here for diff

In the MSVC build system we've never separated krb5 from gss,  
and always built them both. Since the removal of native krb5  
support, this parameter only controls GSSAPI, so rename it  
accordingly.  

M src/tools/msvc/Solution.pm

Remove support for native krb5 authentication

commit   : 98de86e4221a418d670db86bf28ff15e880beadc    
  
author   : Magnus Hagander <[email protected]>    
date     : Wed, 15 Jan 2014 17:24:01 +0100    
  
committer: Magnus Hagander <[email protected]>    
date     : Wed, 15 Jan 2014 17:24:01 +0100    

Click here for diff

krb5 has been deprecated since 8.3, and the recommended way to do  
Kerberos authentication is using the GSSAPI authentication method  
(which is still fully supported).  
  
libpq retains the ability to identify krb5 authentication, but only  
gives an error message about it being unsupported. Since all authentication  
is initiated from the backend, there is no need to keep it at all  
in the backend.  

M configure
M configure.in
M doc/src/sgml/client-auth.sgml
M doc/src/sgml/config.sgml
M doc/src/sgml/install-windows.sgml
M doc/src/sgml/installation.sgml
M doc/src/sgml/libpq.sgml
M doc/src/sgml/passwordcheck.sgml
M doc/src/sgml/protocol.sgml
M src/backend/libpq/auth.c
M src/backend/libpq/hba.c
M src/backend/libpq/pg_hba.conf.sample
M src/bin/initdb/initdb.c
M src/include/libpq/hba.h
M src/include/libpq/pqcomm.h
M src/include/pg_config.h.in
M src/include/pg_config.h.win32
M src/interfaces/libpq/fe-auth.c
M src/interfaces/libpq/fe-connect.c
M src/interfaces/libpq/libpq-int.h
M src/tools/msvc/Solution.pm
M src/tools/msvc/config_default.pl

Adjust the SSL connection notification message

commit   : 4b8f2859ccc4fe1e9b66fbdb332b830b69a9d6cf    
  
author   : Magnus Hagander <[email protected]>    
date     : Sun, 19 Jan 2014 13:27:22 +0100    
  
committer: Magnus Hagander <[email protected]>    
date     : Sun, 19 Jan 2014 13:27:22 +0100    

Click here for diff

Suggested by Tom  

M src/backend/utils/init/postinit.c

Add CREATE TABLESPACE ... WITH ... Options

commit   : 5254958e924cd54f33d37026d85483fef986060d    
  
author   : Stephen Frost <[email protected]>    
date     : Sat, 18 Jan 2014 20:59:31 -0500    
  
committer: Stephen Frost <[email protected]>    
date     : Sat, 18 Jan 2014 20:59:31 -0500    

Click here for diff

Tablespaces have a few options which can be set on them to give PG hints  
as to how the tablespace behaves (perhaps it's faster for sequential  
scans, or better able to handle random access, etc).  These options were  
only available through the ALTER TABLESPACE command.  
  
This adds the ability to set these options at CREATE TABLESPACE time,  
removing the need to do both a CREATE TABLESPACE and ALTER TABLESPACE to  
get the correct options set on the tablespace.  
  
Vik Fearing, reviewed by Michael Paquier.  

M doc/src/sgml/ref/create_tablespace.sgml
M src/backend/commands/tablespace.c
M src/backend/nodes/copyfuncs.c
M src/backend/nodes/equalfuncs.c
M src/backend/parser/gram.y
M src/include/nodes/parsenodes.h
M src/test/regress/input/tablespace.source
M src/test/regress/output/tablespace.source

Fix VACUUM's reporting of dead-tuple counts to the stats collector.

commit   : 115f414124e71749d2d8f512e469ca63bc2166e5    
  
author   : Tom Lane <[email protected]>    
date     : Sat, 18 Jan 2014 19:24:20 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Sat, 18 Jan 2014 19:24:20 -0500    

Click here for diff

Historically, VACUUM has just reported its new_rel_tuples estimate  
(the same thing it puts into pg_class.reltuples) to the stats collector.  
That number counts both live and dead-but-not-yet-reclaimable tuples.  
This behavior may once have been right, but modern versions of the  
pgstats code track live and dead tuple counts separately, so putting  
the total into n_live_tuples and zero into n_dead_tuples is surely  
pretty bogus.  Fix it to report live and dead tuple counts separately.  
  
This doesn't really do much for situations where updating transactions  
commit concurrently with a VACUUM scan (possibly causing double-counting or  
omission of the tuples they add or delete); but it's clearly an improvement  
over what we were doing before.  
  
Hari Babu, reviewed by Amit Kapila  

M src/backend/commands/vacuumlazy.c
M src/backend/postmaster/pgstat.c
M src/include/pgstat.h

Add ALTER TABLESPACE ... MOVE command

commit   : 76e91b38ba64e1da70ea21744b342cb105ea3400    
  
author   : Stephen Frost <[email protected]>    
date     : Sat, 18 Jan 2014 18:56:40 -0500    
  
committer: Stephen Frost <[email protected]>    
date     : Sat, 18 Jan 2014 18:56:40 -0500    

Click here for diff

This adds a 'MOVE' sub-command to ALTER TABLESPACE which allows moving sets of  
objects from one tablespace to another.  This can be extremely handy and avoids  
a lot of error-prone scripting.  ALTER TABLESPACE ... MOVE will only move  
objects the user owns, will notify the user if no objects were found, and can  
be used to move ALL objects or specific types of objects (TABLES, INDEXES, or  
MATERIALIZED VIEWS).  

M doc/src/sgml/ref/alter_tablespace.sgml
M src/backend/commands/tablespace.c
M src/backend/nodes/copyfuncs.c
M src/backend/nodes/equalfuncs.c
M src/backend/parser/gram.y
M src/backend/tcop/utility.c
M src/include/commands/tablespace.h
M src/include/nodes/nodes.h
M src/include/nodes/parsenodes.h
M src/include/parser/kwlist.h
M src/test/regress/input/tablespace.source
M src/test/regress/output/tablespace.source
M src/tools/pgindent/typedefs.list

Allow SET TABLESPACE to database default

commit   : 6f25c62d788ea6312fe718ed57a3d169d8efc066    
  
author   : Stephen Frost <[email protected]>    
date     : Sat, 18 Jan 2014 18:41:52 -0500    
  
committer: Stephen Frost <[email protected]>    
date     : Sat, 18 Jan 2014 18:41:52 -0500    

Click here for diff

We've always allowed CREATE TABLE to create tables in the database's default  
tablespace without checking for CREATE permissions on that tablespace.  
Unfortunately, the original implementation of ALTER TABLE ... SET TABLESPACE  
didn't pick up on that exception.  
  
This changes ALTER TABLE ... SET TABLESPACE to allow the database's default  
tablespace without checking for CREATE rights on that tablespace, just as  
CREATE TABLE works today.  Users could always do this through a series of  
commands (CREATE TABLE ... AS SELECT * FROM ...; DROP TABLE ...; etc), so  
let's fix the oversight in SET TABLESPACE's original implementation.  

M src/backend/commands/tablecmds.c

Make various variables const (read-only).

commit   : 0d79c0a8cc20dbaa39112d78a9abb821c4ca3554    
  
author   : Tom Lane <[email protected]>    
date     : Sat, 18 Jan 2014 16:04:11 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Sat, 18 Jan 2014 16:04:11 -0500    

Click here for diff

These changes should generally improve correctness/maintainability.  
A nice side benefit is that several kilobytes move from initialized  
data to text segment, allowing them to be shared across processes and  
probably reducing copy-on-write overhead while forking a new backend.  
Unfortunately this doesn't seem to help libpq in the same way (at least  
not when it's compiled with -fpic on x86_64), but we can hope the linker  
at least collects all nominally-const data together even if it's not  
actually part of the text segment.  
  
Also, make pg_encname_tbl[] static in encnames.c, since there seems  
no very good reason for any other code to use it; per a suggestion  
from Wim Lewis, who independently submitted a patch that was mostly  
a subset of this one.  
  
Oskari Saarenmaa, with some editorialization by me  

M src/backend/catalog/objectaddress.c
M src/backend/commands/conversioncmds.c
M src/backend/regex/regc_lex.c
M src/backend/regex/regcomp.c
M src/backend/regex/regerror.c
M src/backend/tsearch/wparser_def.c
M src/backend/utils/adt/datetime.c
M src/backend/utils/adt/formatting.c
M src/backend/utils/adt/tsrank.c
M src/backend/utils/mb/encnames.c
M src/backend/utils/mb/mbutils.c
M src/backend/utils/mb/wchar.c
M src/common/relpath.c
M src/include/common/relpath.h
M src/include/mb/pg_wchar.h
M src/include/utils/datetime.h

Export a few more symbols required for test_shm_mq module.

commit   : 7d7eee8bb702d7796a0d7c5886c1f4685f2e2806    
  
author   : Andrew Dunstan <[email protected]>    
date     : Sat, 18 Jan 2014 15:29:45 -0500    
  
committer: Andrew Dunstan <[email protected]>    
date     : Sat, 18 Jan 2014 15:29:45 -0500    

Click here for diff

Patch from Amit Kapila.  

M src/include/miscadmin.h
M src/include/postmaster/bgworker.h
M src/include/storage/shm_mq.h

Fix client-only installation

commit   : ad6bf0291a9fed503af3d5e777315a8997571647    
  
author   : Peter Eisentraut <[email protected]>    
date     : Fri, 17 Jan 2014 23:08:22 -0500    
  
committer: Peter Eisentraut <[email protected]>    
date     : Fri, 17 Jan 2014 23:08:22 -0500    

Click here for diff

The psql Makefile was not creating $(datadir) before installing  
psqlrc.sample there.  
  
In most cases, the directory would be created in some other way, but for  
the documented from-source client-only installation procedure, it could  
fail.  
  
Reported-by: Mike Blackwell <[email protected]>  

M src/bin/psql/Makefile

Minor code beautification in contrib/sslinfo.

commit   : af9e3d652358664f2e749be2398428732121e317    
  
author   : Tom Lane <[email protected]>    
date     : Fri, 17 Jan 2014 20:58:31 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Fri, 17 Jan 2014 20:58:31 -0500    

Click here for diff

Static-ify some functions that didn't need to be exported, and improve  
a couple of comments.  
  
Gurjeet Singh  

M contrib/sslinfo/sslinfo.c

Add gen_random_uuid() to contrib/pgcrypto.

commit   : e6170126fc201052b0ec5fc92177eb181d602d26    
  
author   : Tom Lane <[email protected]>    
date     : Fri, 17 Jan 2014 16:52:06 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Fri, 17 Jan 2014 16:52:06 -0500    

Click here for diff

This function provides a way of generating version 4 (pseudorandom) UUIDs  
based on pgcrypto's PRNG.  The main reason for doing this is that the  
OSSP UUID library depended on by contrib/uuid-ossp is becoming more and  
more of a porting headache, so we need an alternative for people who can't  
install that.  A nice side benefit though is that this implementation is  
noticeably faster than uuid-ossp's uuid_generate_v4() function.  
  
Oskari Saarenmaa, reviewed by Emre Hasegeli  

M contrib/pgcrypto/Makefile
A contrib/pgcrypto/pgcrypto–1.0–1.1.sql
R096 contrib/pgcrypto/pgcrypto–1.0.sql contrib/pgcrypto/pgcrypto–1.1.sql
M contrib/pgcrypto/pgcrypto.c
M contrib/pgcrypto/pgcrypto.control
M contrib/pgcrypto/pgcrypto.h
M doc/src/sgml/datatype.sgml
M doc/src/sgml/pgcrypto.sgml
M doc/src/sgml/uuid-ossp.sgml

Export set_latch_on_sigusr1 symbol for Windows.

commit   : 708c529c7fdeba9387825d746752fc6f439d781e    
  
author   : Andrew Dunstan <[email protected]>    
date     : Fri, 17 Jan 2014 12:48:23 -0500    
  
committer: Andrew Dunstan <[email protected]>    
date     : Fri, 17 Jan 2014 12:48:23 -0500    

Click here for diff

Per buildfarm currawong and grip from David Rowley.  

M src/include/storage/procsignal.h

Prevent double macro definition of WIN32.

commit   : b64d956d583a64c9638bdcdc9cd2969a529dbcdc    
  
author   : Andrew Dunstan <[email protected]>    
date     : Fri, 17 Jan 2014 11:49:44 -0500    
  
committer: Andrew Dunstan <[email protected]>    
date     : Fri, 17 Jan 2014 11:49:44 -0500    

Click here for diff

David Rowley.  

M src/include/c.h

Show SSL encryption information when logging connections

commit   : 4cba1f6bbf7c8f956c95e72c43e517a56b97665b    
  
author   : Magnus Hagander <[email protected]>    
date     : Fri, 17 Jan 2014 13:27:18 +0100    
  
committer: Magnus Hagander <[email protected]>    
date     : Fri, 17 Jan 2014 13:27:18 +0100    

Click here for diff

Expand the messages when log_connections is enabled to include the  
fact that SSL is used and the SSL cipher information.  
  
Dr. Andreas Kunert, review by Marko Kreen  

M src/backend/utils/init/postinit.c

Define WIN32 when _WIN32 is set

commit   : 9c14dd22e144a5bef9b114a7a94df97cb23c6b9b    
  
author   : Magnus Hagander <[email protected]>    
date     : Fri, 17 Jan 2014 12:37:57 +0100    
  
committer: Magnus Hagander <[email protected]>    
date     : Fri, 17 Jan 2014 12:37:57 +0100    

Click here for diff

_WIN32 is set by the compiler, whereas our code uses WIN32 that is  
normally set through our build system. To make it possible to build  
extensions out of tree we cannot rely on that, so set the WIN32  
symbol explicitly whenever the compiler has set _WIN32.  
  
Not setting this symbol causes double inclusion of pg_config_os.h,  
and possibly other errors as well.  
  
Craig Ringer  

M src/include/c.h

Prevent integer overflow with --progress >= 2148

commit   : 277279981fba7646d0f05a664d58b845d2fdf69d    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Fri, 17 Jan 2014 10:10:43 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Fri, 17 Jan 2014 10:10:43 +0200    

Click here for diff

If --progress=2148 or higher was given, the calculation of the next time  
to report overflowed, and pgbench would print a progress report very  
frequently.  
  
Kingter Wang  

M contrib/pgbench/pgbench.c

doc: rename "Equals" to "Equal"

commit   : d8a0b96c50b76992d63287ef9affbcf847f725ad    
  
author   : Bruce Momjian <[email protected]>    
date     : Thu, 16 Jan 2014 19:38:22 -0500    
  
committer: Bruce Momjian <[email protected]>    
date     : Thu, 16 Jan 2014 19:38:22 -0500    

Click here for diff

M doc/src/sgml/plpgsql.sgml

doc: fix := description typo.

commit   : 93c4bbc9998e7f326a9733fc187a7f2b97ef7b95    
  
author   : Bruce Momjian <[email protected]>    
date     : Thu, 16 Jan 2014 19:28:50 -0500    
  
committer: Bruce Momjian <[email protected]>    
date     : Thu, 16 Jan 2014 19:28:50 -0500    

Click here for diff

M doc/src/sgml/plpgsql.sgml

docs: update PL/pgSQL docs about the use of := and =

commit   : 7e1955b861a1be9ef2dfd6acdd50d0c6b5a75794    
  
author   : Bruce Momjian <[email protected]>    
date     : Thu, 16 Jan 2014 16:40:17 -0500    
  
committer: Bruce Momjian <[email protected]>    
date     : Thu, 16 Jan 2014 16:40:17 -0500    

Click here for diff

M doc/src/sgml/plpgsql.sgml
M src/pl/plpgsql/src/pl_gram.y

Fix Hot Standby feedback sending when streaming busily.

commit   : a472ae1e4e2bf5fb71ac655d38d1e35df4c1c966    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Thu, 16 Jan 2014 23:05:02 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Thu, 16 Jan 2014 23:05:02 +0200    

Click here for diff

Commit 6f60fdd7015b032bf49273c99f80913d57eac284 accidentally removed a  
call to XLogWalRcvSendHSFeedback() after flushing received WAL to disk.  
The consequence is that when walsender is busy streaming WAL, it doesn't  
send HS feedback messages. One is sent if nothing is received from the  
master for 100ms, but if there's a steady stream of WAL, it never happens.  
  
Backpatch to 9.3.  
  
Andres Freund and Amit Kapila  

M src/backend/replication/walreceiver.c

Split ecpg_execute() in constituent parts

commit   : 61bee9f756ce875f3b678099a6bb9654bd2fa21a    
  
author   : Alvaro Herrera <[email protected]>    
date     : Thu, 16 Jan 2014 18:06:50 -0300    
  
committer: Alvaro Herrera <[email protected]>    
date     : Thu, 16 Jan 2014 18:06:50 -0300    

Click here for diff

Split the rather long ecpg_execute() function into ecpg_build_params(),  
ecpg_autostart_transaction(), a smaller ecpg_execute() and  
ecpg_process_output().  There is no user-visible change here, only code  
reorganization to support future patches.  
  
Author: Zoltán Böszörményi  
  
Reviewed by Antonin Houska.  Larger, older versions of this patch were  
reviewed by Noah Misch and Michael Meskes.  

M src/interfaces/ecpg/ecpglib/execute.c
M src/interfaces/ecpg/ecpglib/extern.h
M src/interfaces/ecpg/test/expected/compat_informix-describe.stderr
M src/interfaces/ecpg/test/expected/compat_informix-rnull.stderr
M src/interfaces/ecpg/test/expected/compat_informix-sqlda.stderr
M src/interfaces/ecpg/test/expected/compat_informix-test_informix.stderr
M src/interfaces/ecpg/test/expected/compat_informix-test_informix2.stderr
M src/interfaces/ecpg/test/expected/connect-test2.stderr
M src/interfaces/ecpg/test/expected/connect-test3.stderr
M src/interfaces/ecpg/test/expected/connect-test5.stderr
M src/interfaces/ecpg/test/expected/pgtypeslib-dt_test.stderr
M src/interfaces/ecpg/test/expected/pgtypeslib-nan_test.stderr
M src/interfaces/ecpg/test/expected/pgtypeslib-num_test.stderr
M src/interfaces/ecpg/test/expected/preproc-array_of_struct.stderr
M src/interfaces/ecpg/test/expected/preproc-autoprep.stderr
M src/interfaces/ecpg/test/expected/preproc-cursor.stderr
M src/interfaces/ecpg/test/expected/preproc-define.stderr
M src/interfaces/ecpg/test/expected/preproc-outofscope.stderr
M src/interfaces/ecpg/test/expected/preproc-strings.stderr
M src/interfaces/ecpg/test/expected/preproc-type.stderr
M src/interfaces/ecpg/test/expected/preproc-variable.stderr
M src/interfaces/ecpg/test/expected/preproc-whenever.stderr
M src/interfaces/ecpg/test/expected/sql-array.stderr
M src/interfaces/ecpg/test/expected/sql-binary.stderr
M src/interfaces/ecpg/test/expected/sql-code100.stderr
M src/interfaces/ecpg/test/expected/sql-copystdout.stderr
M src/interfaces/ecpg/test/expected/sql-define.stderr
M src/interfaces/ecpg/test/expected/sql-desc.stderr
M src/interfaces/ecpg/test/expected/sql-describe.stderr
M src/interfaces/ecpg/test/expected/sql-dynalloc.stderr
M src/interfaces/ecpg/test/expected/sql-dynalloc2.stderr
M src/interfaces/ecpg/test/expected/sql-dyntest.stderr
M src/interfaces/ecpg/test/expected/sql-execute.stderr
M src/interfaces/ecpg/test/expected/sql-fetch.stderr
M src/interfaces/ecpg/test/expected/sql-func.stderr
M src/interfaces/ecpg/test/expected/sql-indicators.stderr
M src/interfaces/ecpg/test/expected/sql-insupd.stderr
M src/interfaces/ecpg/test/expected/sql-oldexec.stderr
M src/interfaces/ecpg/test/expected/sql-parser.stderr
M src/interfaces/ecpg/test/expected/sql-quote.stderr
M src/interfaces/ecpg/test/expected/sql-show.stderr
M src/interfaces/ecpg/test/expected/sql-sqlda.stderr

Add display of oprcode (the underlying function's name) to psql's \do+.

commit   : 515d2c596c1b6b95d020d14edaab0d233d5d9ea9    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 16 Jan 2014 15:29:18 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 16 Jan 2014 15:29:18 -0500    

Click here for diff

The + modifier of \do didn't use to do anything, but now it adds an oprcode  
column.  This is useful both as an additional form of documentation of what  
the operator does, and to save a step when finding out properties of the  
underlying function.  
  
Marko Tiikkaja, reviewed by Rushabh Lathia, adjusted a bit by me  

M doc/src/sgml/ref/psql-ref.sgml
M src/bin/psql/command.c
M src/bin/psql/describe.c
M src/bin/psql/describe.h

Split ECPGdo() in constituent parts

commit   : 3291301385ee5e9ca38d70a68b93ce31cc2674ac    
  
author   : Alvaro Herrera <[email protected]>    
date     : Thu, 16 Jan 2014 16:36:41 -0300    
  
committer: Alvaro Herrera <[email protected]>    
date     : Thu, 16 Jan 2014 16:36:41 -0300    

Click here for diff

This splits ECPGdo() into ecpg_prologue(), ecpg_do() and  
ecpg_epilogue(), and renames free_params() into ecpg_free_params() and  
exports it.  This makes it possible for future code to use these  
routines for their own purposes.  
  
There is no user-visible functionality change here, only code  
reorganization.  
  
Zoltán Böszörményi  
  
Reviewed by Antonin Houska.  Larger, older versions of this patch were  
reviewed by Noah Misch and Michael Meskes.  

M src/interfaces/ecpg/ecpglib/execute.c
M src/interfaces/ecpg/ecpglib/extern.h
M src/interfaces/ecpg/test/expected/compat_informix-rnull.stderr
M src/interfaces/ecpg/test/expected/compat_informix-sqlda.stderr
M src/interfaces/ecpg/test/expected/compat_informix-test_informix.stderr
M src/interfaces/ecpg/test/expected/compat_informix-test_informix2.stderr
M src/interfaces/ecpg/test/expected/pgtypeslib-dt_test.stderr
M src/interfaces/ecpg/test/expected/pgtypeslib-nan_test.stderr
M src/interfaces/ecpg/test/expected/pgtypeslib-num_test.stderr
M src/interfaces/ecpg/test/expected/preproc-autoprep.stderr
M src/interfaces/ecpg/test/expected/preproc-type.stderr
M src/interfaces/ecpg/test/expected/sql-array.stderr
M src/interfaces/ecpg/test/expected/sql-binary.stderr
M src/interfaces/ecpg/test/expected/sql-code100.stderr
M src/interfaces/ecpg/test/expected/sql-desc.stderr
M src/interfaces/ecpg/test/expected/sql-execute.stderr
M src/interfaces/ecpg/test/expected/sql-fetch.stderr
M src/interfaces/ecpg/test/expected/sql-indicators.stderr
M src/interfaces/ecpg/test/expected/sql-oldexec.stderr
M src/interfaces/ecpg/test/expected/sql-sqlda.stderr

Suppress Coverity complaints in readfuncs.c.

commit   : 8ba288da5dce7bd890dd968ddb9664931099b8c5    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Thu, 16 Jan 2014 11:55:08 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Thu, 16 Jan 2014 11:55:08 +0200    

Click here for diff

Coverity is complaining that the value returned by pg_strtok in  
READ_LOCATION_FIELD and READ_BITMAPSET_FIELD macros is not used. In commit  
39bfc94c86f1990e9db8ea3da0e82995cc1b76db, we did this to the other macros  
to placate compilers that complained when the variable was completely  
unused, this extends that to the last remaining macros.  

M src/backend/nodes/readfuncs.c

Fix whitespace

commit   : a687ec7d5bf11fd16a68ffba6185aabe9100f98f    
  
author   : Peter Eisentraut <[email protected]>    
date     : Wed, 15 Jan 2014 21:14:28 -0500    
  
committer: Peter Eisentraut <[email protected]>    
date     : Wed, 15 Jan 2014 21:14:28 -0500    

Click here for diff

M contrib/test_shm_mq/setup.c
M contrib/test_shm_mq/worker.c

test_shm_mq: Try again to fix compiler warning.

commit   : b1365ff7a811760c56ae88a1e819b2529fb5452b    
  
author   : Robert Haas <[email protected]>    
date     : Wed, 15 Jan 2014 12:44:22 -0500    
  
committer: Robert Haas <[email protected]>    
date     : Wed, 15 Jan 2014 12:44:22 -0500    

Click here for diff

Per complaints from Andres Freund and Tom Lane.  

M contrib/test_shm_mq/setup.c

Logging running transactions every 15 seconds.

commit   : ed46758381ff63a422fcb0b1f2763eb13273640f    
  
author   : Robert Haas <[email protected]>    
date     : Wed, 15 Jan 2014 12:41:20 -0500    
  
committer: Robert Haas <[email protected]>    
date     : Wed, 15 Jan 2014 12:41:20 -0500    

Click here for diff

Previously, we did this just once per checkpoint, but that could make  
Hot Standby take a long time to initialize.  To avoid busying an  
otherwise-idle system, we don't do this if no WAL has been written  
since we did it last.  
  
Andres Freund  

M src/backend/postmaster/bgwriter.c
M src/backend/storage/ipc/standby.c
M src/include/storage/standby.h

Fix missing parentheses resulting in wrong order of dereference.

commit   : d02c0ddb152978980ea17f9214c7ac734e4d6d8f    
  
author   : Robert Haas <[email protected]>    
date     : Wed, 15 Jan 2014 10:53:07 -0500    
  
committer: Robert Haas <[email protected]>    
date     : Wed, 15 Jan 2014 10:53:07 -0500    

Click here for diff

This could result in referencing uninitialized memory.  
  
Michael Paquier, in response to a complaint from Andres Freund  

M src/backend/access/heap/tuptoaster.c

test_shm_mq: Fix checks for negative queue size.

commit   : b5763cedde2541a6629f64cccf77e37b21348714    
  
author   : Robert Haas <[email protected]>    
date     : Wed, 15 Jan 2014 10:50:00 -0500    
  
committer: Robert Haas <[email protected]>    
date     : Wed, 15 Jan 2014 10:50:00 -0500    

Click here for diff

Noted while addressing compiler warnings pointed out on pgsql-hackers.  

M contrib/test_shm_mq/setup.c
M contrib/test_shm_mq/test_shm_mq.h

Fix compiler warning.

commit   : d89746c7c534ef5b061fee0b8f587042f55bd92d    
  
author   : Robert Haas <[email protected]>    
date     : Wed, 15 Jan 2014 10:24:28 -0500    
  
committer: Robert Haas <[email protected]>    
date     : Wed, 15 Jan 2014 10:24:28 -0500    

Click here for diff

Kevin Gritter reports that his compiler complains about inq and outq  
being possibly-uninitialized at the point where they are passed to  
shm_mq_attach().  They are initialized by the call to  
setup_dynamic_shared_memory, but apparently his compiler is inlining  
that function and then having doubts about whether the for loop will  
always execute at least once.  Fix by initializing them to NULL.  

M contrib/test_shm_mq/setup.c

Fix compiler warning: Size isn't 64 bits on 32 bit platforms.

commit   : be361ef2a0b58ce1f3faff7ccabe174e20d50497    
  
author   : Robert Haas <[email protected]>    
date     : Wed, 15 Jan 2014 08:29:28 -0500    
  
committer: Robert Haas <[email protected]>    
date     : Wed, 15 Jan 2014 08:29:28 -0500    

Click here for diff

Report by Peter Eisentraut.  

M contrib/test_shm_mq/setup.c

Improve FILES section of psql reference page.

commit   : 5df99f6481b1eadbcbc8547d2e387f4dcf192c6f    
  
author   : Tom Lane <[email protected]>    
date     : Tue, 14 Jan 2014 19:27:57 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Tue, 14 Jan 2014 19:27:57 -0500    

Click here for diff

Primarily, explain where to find the system-wide psqlrc file, per recent  
gripe from John Sutton.  Do some general wordsmithing and improve the  
markup, too.  
  
Also adjust psqlrc.sample so its comments about file location are somewhat  
trustworthy.  (Not sure why we bother with this file when it's empty,  
but whatever.)  
  
Back-patch to 9.2 where the startup file naming scheme was last changed.  

M doc/src/sgml/ref/psql-ref.sgml
M src/bin/psql/psqlrc.sample

Fix multiple bugs in index page locking during hot-standby WAL replay.

commit   : 061b079f89800929a863a692b952207cadf15886    
  
author   : Tom Lane <[email protected]>    
date     : Tue, 14 Jan 2014 17:34:47 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Tue, 14 Jan 2014 17:34:47 -0500    

Click here for diff

In ordinary operation, VACUUM must be careful to take a cleanup lock on  
each leaf page of a btree index; this ensures that no indexscans could  
still be "in flight" to heap tuples due to be deleted.  (Because of  
possible index-tuple motion due to concurrent page splits, it's not enough  
to lock only the pages we're deleting index tuples from.)  In Hot Standby,  
the WAL replay process must likewise lock every leaf page.  There were  
several bugs in the code for that:  
  
* The replay scan might come across unused, all-zero pages in the index.  
While btree_xlog_vacuum itself did the right thing (ie, nothing) with  
such pages, xlogutils.c supposed that such pages must be corrupt and  
would throw an error.  This accounts for various reports of replication  
failures with "PANIC: WAL contains references to invalid pages".  To  
fix, add a ReadBufferMode value that instructs XLogReadBufferExtended  
not to complain when we're doing this.  
  
* btree_xlog_vacuum performed the extra locking if standbyState ==  
STANDBY_SNAPSHOT_READY, but that's not the correct test: we won't open up  
for hot standby queries until the database has reached consistency, and  
we don't want to do the extra locking till then either, for fear of reading  
corrupted pages (which bufmgr.c would complain about).  Fix by exporting a  
new function from xlog.c that will report whether we're actually in hot  
standby replay mode.  
  
* To ensure full coverage of the index in the replay scan, btvacuumscan  
would emit a dummy WAL record for the last page of the index, if no  
vacuuming work had been done on that page.  However, if the last page  
of the index is all-zero, that would result in corruption of said page,  
since the functions called on it weren't prepared to handle that case.  
There's no need to lock any such pages, so change the logic to target  
the last normal leaf page instead.  
  
The first two of these bugs were diagnosed by Andres Freund, the other one  
by me.  Fixes based on ideas from Heikki Linnakangas and myself.  
  
This has been wrong since Hot Standby was introduced, so back-patch to 9.0.  

M src/backend/access/nbtree/nbtree.c
M src/backend/access/nbtree/nbtxlog.c
M src/backend/access/transam/xlog.c
M src/backend/access/transam/xlogutils.c
M src/backend/storage/buffer/bufmgr.c
M src/include/access/xlog.h
M src/include/storage/bufmgr.h

Documentation for test_shm_mq.

commit   : 16cad3e8674777d3e0bedbc1e1c408b0448d0545    
  
author   : Robert Haas <[email protected]>    
date     : Tue, 14 Jan 2014 15:58:15 -0500    
  
committer: Robert Haas <[email protected]>    
date     : Tue, 14 Jan 2014 15:58:15 -0500    

Click here for diff

Commit 4db3744f1f43554b03d8193da4645a0a5326eb18 added this contrib  
module but neglected to document it.  Oops.  

M doc/src/sgml/contrib.sgml
M doc/src/sgml/filelist.sgml
A doc/src/sgml/test-shm-mq.sgml

Mention that VACUUM FREEZE also effectively zeroes the table freeze age.

commit   : b682709451b17333b038af9f2907c523754dacce    
  
author   : Robert Haas <[email protected]>    
date     : Tue, 14 Jan 2014 14:48:57 -0500    
  
committer: Robert Haas <[email protected]>    
date     : Tue, 14 Jan 2014 14:48:57 -0500    

Click here for diff

Maciek Sakrejda, reviewed by Amit Kapila  

M doc/src/sgml/ref/vacuum.sgml

Fix typo in comment.

commit   : 246a9a8d0c43d29d307f40461eaa59004d0340f9    
  
author   : Robert Haas <[email protected]>    
date     : Tue, 14 Jan 2014 14:34:43 -0500    
  
committer: Robert Haas <[email protected]>    
date     : Tue, 14 Jan 2014 14:34:43 -0500    

Click here for diff

Etsuro Fujita  

M src/include/access/gin_private.h

Test code for shared memory message queue facility.

commit   : 4db3744f1f43554b03d8193da4645a0a5326eb18    
  
author   : Robert Haas <[email protected]>    
date     : Tue, 14 Jan 2014 12:24:12 -0500    
  
committer: Robert Haas <[email protected]>    
date     : Tue, 14 Jan 2014 12:24:12 -0500    

Click here for diff

This code is intended as a demonstration of how the dynamic shared  
memory and dynamic background worker facilities can be used to establish  
a group of coooperating processes which can coordinate their activities  
using the shared memory message queue facility.  By itself, the code  
does nothing particularly interesting: it simply allows messages to  
be passed through a loop of workers and back to the original process.  
But it's a useful unit test, in addition to its demonstration value.  

M contrib/Makefile
A contrib/test_shm_mq/.gitignore
A contrib/test_shm_mq/Makefile
A contrib/test_shm_mq/expected/test_shm_mq.out
A contrib/test_shm_mq/setup.c
A contrib/test_shm_mq/sql/test_shm_mq.sql
A contrib/test_shm_mq/test.c
A contrib/test_shm_mq/test_shm_mq–1.0.sql
A contrib/test_shm_mq/test_shm_mq.control
A contrib/test_shm_mq/test_shm_mq.h
A contrib/test_shm_mq/worker.c

Single-reader, single-writer, lightweight shared message queue.

commit   : ec9037df2634ddcd6a3b036463722c8ee009b132    
  
author   : Robert Haas <[email protected]>    
date     : Tue, 14 Jan 2014 12:23:22 -0500    
  
committer: Robert Haas <[email protected]>    
date     : Tue, 14 Jan 2014 12:23:22 -0500    

Click here for diff

This code provides infrastructure for user backends to communicate  
relatively easily with background workers.  The message queue is  
structured as a ring buffer and allows messages of arbitary length  
to be sent and received.  
  
Patch by me.  Review by KaiGai Kohei and Andres Freund.  

M src/backend/storage/ipc/Makefile
A src/backend/storage/ipc/shm_mq.c
A src/include/storage/shm_mq.h

Simple table of contents for a shared memory segment.

commit   : 6ddd5137b26c64360b86ea4174f21362df4f167a    
  
author   : Robert Haas <[email protected]>    
date     : Tue, 14 Jan 2014 12:18:58 -0500    
  
committer: Robert Haas <[email protected]>    
date     : Tue, 14 Jan 2014 12:18:58 -0500    

Click here for diff

This interface is intended to make it simple to divide a dynamic shared  
memory segment into different regions with distinct purposes.  It  
therefore serves much the same purpose that ShmemIndex accomplishes for  
the main shared memory segment, but it is intended to be more  
lightweight.  
  
Patch by me.  Review by Andres Freund.  

M src/backend/storage/ipc/Makefile
A src/backend/storage/ipc/shm_toc.c
A src/include/storage/shm_toc.h

Code improvements for ALTER SYSTEM .. SET.

commit   : 05ff5062da5fb4b0c950260ed12af0ae5d8932a4    
  
author   : Robert Haas <[email protected]>    
date     : Mon, 13 Jan 2014 14:54:00 -0500    
  
committer: Robert Haas <[email protected]>    
date     : Mon, 13 Jan 2014 14:54:00 -0500    

Click here for diff

Move FreeConfigVariables() later to make sure ErrorConfFile is valid  
when we use it, and get rid of an unnecessary string copy operation.  
  
Amit Kapila, kibitzed by me.  

M src/backend/utils/misc/guc-file.l

Make bitmap heap scans show exact/lossy block info in EXPLAIN ANALYZE.

commit   : 2bb1f14b89deacd1142b4a06bcb1a52a76270449    
  
author   : Robert Haas <[email protected]>    
date     : Mon, 13 Jan 2014 14:42:16 -0500    
  
committer: Robert Haas <[email protected]>    
date     : Mon, 13 Jan 2014 14:42:16 -0500    

Click here for diff

Etsuro Fujita  

M src/backend/commands/explain.c
M src/backend/executor/nodeBitmapHeapscan.c
M src/include/nodes/execnodes.h

Fix possible buffer overrun in contrib/pg_trgm.

commit   : c3ccc9ee584b9b015dd9c1931e261e21f3961e5f    
  
author   : Tom Lane <[email protected]>    
date     : Mon, 13 Jan 2014 13:07:10 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Mon, 13 Jan 2014 13:07:10 -0500    

Click here for diff

Allow for the possibility that folding a string to lower case makes it  
longer (due to replacing a character with a longer multibyte character).  
This doesn't change the number of trigrams that will be extracted, but  
it does affect the required size of an intermediate buffer in  
generate_trgm().  Per bug #8821 from Ufuk Kayserilioglu.  
  
Also install some checks that the input string length is not so large  
as to cause overflow in the calculations of palloc request sizes.  
  
Back-patch to all supported versions.  

M contrib/pg_trgm/trgm_op.c

Fix calculation of ISMN check digit.

commit   : 866a1f0923b67373701a578e98b74ab2458f74db    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Mon, 13 Jan 2014 15:42:35 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Mon, 13 Jan 2014 15:42:35 +0200    

Click here for diff

This has always been broken, so back-patch to all supported versions.  
  
Fabien COELHO  

M contrib/isn/isn.c

Add OVERLAPS to index in the docs.

commit   : 04038148b652d11ead706fb14ccecbcd94d81f4d    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Mon, 13 Jan 2014 15:14:42 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Mon, 13 Jan 2014 15:14:42 +0200    

Click here for diff

Per report from Adam Mackler and Jonathan Katz  

M doc/src/sgml/func.sgml

Always use the same way to addres a descriptor in ecpg's regression tests.

commit   : 976a7d11560e4f932aff1c72fc2062ffaffaa3e9    
  
author   : Michael Meskes <[email protected]>    
date     : Mon, 13 Jan 2014 10:41:53 +0100    
  
committer: Michael Meskes <[email protected]>    
date     : Mon, 13 Jan 2014 10:41:53 +0100    

Click here for diff

M src/interfaces/ecpg/test/expected/sql-desc.c
M src/interfaces/ecpg/test/sql/desc.pgc

Fix pg_dumpall on pre-8.1 servers

commit   : bb953ad164ade6ece0c8b8d02ae155980c967d8b    
  
author   : Bruce Momjian <[email protected]>    
date     : Sun, 12 Jan 2014 22:25:27 -0500    
  
committer: Bruce Momjian <[email protected]>    
date     : Sun, 12 Jan 2014 22:25:27 -0500    

Click here for diff

rolname did not exist in pg_shadow.  
  
Backpatch to 9.3  
  
Report by Andrew Gierth via IRC  

M src/bin/pg_dump/pg_dumpall.c

Disallow LATERAL references to the target table of an UPDATE/DELETE.

commit   : 158b7fa6a34006bdc70b515e14e120d3e896589b    
  
author   : Tom Lane <[email protected]>    
date     : Sat, 11 Jan 2014 19:03:12 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Sat, 11 Jan 2014 19:03:12 -0500    

Click here for diff

On second thought, commit 0c051c90082da0b7e5bcaf9aabcbd4f361137cdc was  
over-hasty: rather than allowing this case, we ought to reject it for now.  
That leaves the field clear for a future feature that allows the target  
table to be re-specified in the FROM (or USING) clause, which will enable  
left-joining the target table to something else.  We can then also allow  
LATERAL references to such an explicitly re-specified target table.  
But allowing them right now will create ambiguities or worse for such a  
feature, and it isn't something we documented 9.3 as supporting.  
  
While at it, add a convenience subroutine to avoid having several copies  
of the ereport for disalllowed-LATERAL-reference cases.  

M src/backend/parser/analyze.c
M src/backend/parser/parse_relation.c
M src/include/parser/parse_node.h
M src/test/regress/expected/join.out
M src/test/regress/sql/join.sql

Fix possible crashes due to using elog/ereport too early in startup.

commit   : 910bac5953012198e210848660ea31f27ab08abc    
  
author   : Tom Lane <[email protected]>    
date     : Sat, 11 Jan 2014 16:35:26 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Sat, 11 Jan 2014 16:35:26 -0500    

Click here for diff

Per reports from Andres Freund and Luke Campbell, a server failure during  
set_pglocale_pgservice results in a segfault rather than a useful error  
message, because the infrastructure needed to use ereport hasn't been  
initialized; specifically, MemoryContextInit hasn't been called.  
One known cause of this is starting the server in a directory it  
doesn't have permission to read.  
  
We could try to prevent set_pglocale_pgservice from using anything that  
depends on palloc or elog, but that would be messy, and the odds of future  
breakage seem high.  Moreover there are other things being called in main.c  
that look likely to use palloc or elog too --- perhaps those things  
shouldn't be there, but they are there today.  The best solution seems to  
be to move the call of MemoryContextInit to very early in the backend's  
real main() function.  I've verified that an elog or ereport occurring  
immediately after that is now capable of sending something useful to  
stderr.  
  
I also added code to elog.c to print something intelligible rather than  
just crashing if MemoryContextInit hasn't created the ErrorContext.  
This could happen if MemoryContextInit itself fails (due to malloc  
failure), and provides some future-proofing against someone trying to  
sneak in new code even earlier in server startup.  
  
Back-patch to all supported branches.  Since we've only heard reports of  
this type of failure recently, it may be that some recent change has made  
it more likely to see a crash of this kind; but it sure looks like it's  
broken all the way back.  

M src/backend/bootstrap/bootstrap.c
M src/backend/main/main.c
M src/backend/postmaster/postmaster.c
M src/backend/tcop/postgres.c
M src/backend/utils/error/elog.c
M src/backend/utils/mmgr/mcxt.c

Revert fd2ace802811c333b0b4e1a28b138fd4774745f3

commit   : d84c584ece6d882c3a45cacd056ca8635e963996    
  
author   : Bruce Momjian <[email protected]>    
date     : Sat, 11 Jan 2014 14:00:32 -0500    
  
committer: Bruce Momjian <[email protected]>    
date     : Sat, 11 Jan 2014 14:00:32 -0500    

Click here for diff

Seems we want to document '=' plpgsql assignment instead.  

M doc/src/sgml/plpgsql.sgml

Fix compute_scalar_stats() for case that all values exceed WIDTH_THRESHOLD.

commit   : 6286526207d53e5b31968103adb89b4c9cd21499    
  
author   : Tom Lane <[email protected]>    
date     : Sat, 11 Jan 2014 13:41:41 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Sat, 11 Jan 2014 13:41:41 -0500    

Click here for diff

The standard typanalyze functions skip over values whose detoasted size  
exceeds WIDTH_THRESHOLD (1024 bytes), so as to limit memory bloat during  
ANALYZE.  However, we (I think I, actually :-() failed to consider the  
possibility that *every* non-null value in a column is too wide.  While  
compute_minimal_stats() seems to behave reasonably anyway in such a case,  
compute_scalar_stats() just fell through and generated no pg_statistic  
entry at all.  That's unnecessarily pessimistic: we can still produce  
valid stanullfrac and stawidth values in such cases, since we do include  
too-wide values in the average-width calculation.  Furthermore, since the  
general assumption in this code is that too-wide values are probably all  
distinct from each other, it seems reasonable to set stadistinct to -1  
("all distinct").  
  
Per complaint from Kadri Raudsepp.  This has been like this since roughly  
neolithic times, so back-patch to all supported branches.  

M src/backend/commands/analyze.c

docs: remove undocumented assign syntax in plpgsql examples

commit   : fd2ace802811c333b0b4e1a28b138fd4774745f3    
  
author   : Bruce Momjian <[email protected]>    
date     : Sat, 11 Jan 2014 13:41:01 -0500    
  
committer: Bruce Momjian <[email protected]>    
date     : Sat, 11 Jan 2014 13:41:01 -0500    

Click here for diff

Pavel Stehule  

M doc/src/sgml/plpgsql.sgml

Add another regression test cross-checking operator and function comments.

commit   : 28233ffaa436852218113d34aa79b7e54f470ed7    
  
author   : Tom Lane <[email protected]>    
date     : Sat, 11 Jan 2014 00:16:08 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Sat, 11 Jan 2014 00:16:08 -0500    

Click here for diff

Add a query that lists all the functions that are operator implementation  
functions and have a SQL comment that doesn't just say "implementation of  
XYZ operator".  (Note that the preceding test checks that such functions'  
comments exactly match the corresponding operators' comments.)  
  
While it's not forbidden to add more functions to this list, that should  
only be done when we're encouraging users to use either the function or  
operator syntax for the functionality, which is a fairly rare situation.  

M src/test/regress/expected/opr_sanity.out
M src/test/regress/sql/opr_sanity.sql

Remove DESCR entries for json operator functions.

commit   : 11829ff8b2c877469845c08e5966a704b814ca5f    
  
author   : Andrew Dunstan <[email protected]>    
date     : Fri, 10 Jan 2014 22:25:04 -0500    
  
committer: Andrew Dunstan <[email protected]>    
date     : Fri, 10 Jan 2014 22:25:04 -0500    

Click here for diff

Per -hackers discussion.  

M src/include/catalog/pg_proc.h

Adjust pg_upgrade for move of username lookup functions to /common

commit   : 850ade3e32ea12e0c6b2d10c6b628772bf851727    
  
author   : Bruce Momjian <[email protected]>    
date     : Fri, 10 Jan 2014 20:56:47 -0500    
  
committer: Bruce Momjian <[email protected]>    
date     : Fri, 10 Jan 2014 20:56:47 -0500    

Click here for diff

M contrib/pg_upgrade/util.c

Move username lookup functions from /port to /common

commit   : 111022eac64579cc12d20e33146ce01717562b29    
  
author   : Bruce Momjian <[email protected]>    
date     : Fri, 10 Jan 2014 18:03:28 -0500    
  
committer: Bruce Momjian <[email protected]>    
date     : Fri, 10 Jan 2014 18:03:28 -0500    

Click here for diff

Per suggestion from Peter E and Alvaro  

M src/backend/libpq/auth.c
M src/backend/main/main.c
M src/bin/initdb/initdb.c
M src/bin/psql/help.c
M src/bin/scripts/common.h
M src/common/Makefile
R096 src/port/username.c src/common/username.c
A src/include/common/username.h
M src/include/port.h
M src/port/Makefile
M src/tools/msvc/Mkvcbuild.pm

Accept pg_upgraded tuples during multixact freezing

commit   : 423e1211a86df0d0dd8914223137edbfd4d52400    
  
author   : Alvaro Herrera <[email protected]>    
date     : Fri, 10 Jan 2014 18:03:18 -0300    
  
committer: Alvaro Herrera <[email protected]>    
date     : Fri, 10 Jan 2014 18:03:18 -0300    

Click here for diff

The new MultiXact freezing routines introduced by commit 8e9a16ab8f7  
neglected to consider tuples that came from a pg_upgrade'd database; a  
vacuum run that tried to freeze such tuples would die with an error such  
as  
ERROR: MultiXactId 11415437 does no longer exist -- apparent wraparound  
  
To fix, ensure that GetMultiXactIdMembers is allowed to return empty  
multis when the infomask bits are right, as is done in other callsites.  
  
Per trouble report from F-Secure.  
  
In passing, fix a copy&paste bug reported by Andrey Karpov from VIVA64  
from their PVS-Studio static checked, that instead of setting relminmxid  
to Invalid, we were setting relfrozenxid twice.  Not an important  
mistake because that code branch is about relations for which we don't  
use the frozenxid/minmxid values at all in the first place, but seems to  
warrants a fix nonetheless.  

M src/backend/access/heap/heapam.c
M src/backend/catalog/heap.c

Remove unnecessary local variables to work around an icc optimization bug.

commit   : faab7a957d31389f4abfd83784f622c91d076f49    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 9 Jan 2014 12:59:55 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 9 Jan 2014 12:59:55 -0500    

Click here for diff

Buildfarm member dunlin has been crashing since commit 8b49a60, but other  
machines seem fine with that code.  It turns out that removing the local  
variables in ordered_set_startup() that are copies of fields in "qstate"  
dodges the problem.  This might cost a few cycles on register-rich  
machines, but it's probably a wash on others, and in any case this code  
isn't performance-critical.  Thanks to Jeremy Drake for off-list  
investigation.  

M src/backend/utils/adt/orderedsetaggs.c

Changed regression test to ecpg test suite for alignment problem just with last commit.

commit   : 192b4aacad45c16a8a9341644479125977366dab    
  
author   : Michael Meskes <[email protected]>    
date     : Thu, 9 Jan 2014 16:18:12 +0100    
  
committer: Michael Meskes <[email protected]>    
date     : Thu, 9 Jan 2014 16:18:12 +0100    

Click here for diff

M src/interfaces/ecpg/test/expected/sql-desc.c
M src/interfaces/ecpg/test/expected/sql-desc.stderr
M src/interfaces/ecpg/test/sql/desc.pgc

Fix descriptor output in ECPG.

commit   : d685e2424967509f004d9eb6d005dfb58e21d837    
  
author   : Michael Meskes <[email protected]>    
date     : Thu, 9 Jan 2014 15:41:51 +0100    
  
committer: Michael Meskes <[email protected]>    
date     : Thu, 9 Jan 2014 15:41:51 +0100    

Click here for diff

While working on most platforms the old way sometimes created alignment  
problems. This should fix it. Also the regresion tests were updated to test for  
the reported case.  
  
Report and fix by MauMau <[email protected]>  

M src/interfaces/ecpg/preproc/type.c
M src/interfaces/ecpg/test/expected/compat_informix-describe.c
M src/interfaces/ecpg/test/expected/sql-desc.c
M src/interfaces/ecpg/test/expected/sql-describe.c
M src/interfaces/ecpg/test/expected/sql-dynalloc.c
M src/interfaces/ecpg/test/expected/sql-dynalloc2.c
M src/interfaces/ecpg/test/expected/sql-dyntest.c

Refactor checking whether we've reached the recovery target.

commit   : c945af80cfdaf72adb91d6688fb3a4c4f17c0757    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Thu, 9 Jan 2014 14:00:39 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Thu, 9 Jan 2014 14:00:39 +0200    

Click here for diff

Makes the replay loop slightly more readable, by separating the concerns of  
whether to stop and whether to delay, and how to extract the timestamp from  
a record.  
  
This has the user-visible change that the timestamp of the last applied  
record is now updated after actually applying it. Before, it was updated  
just before applying it. That meant that pg_last_xact_replay_timestamp()  
could return the timestamp of a commit record that is in process of being  
replayed, but not yet applied. Normally the difference is small, but if  
min_recovery_apply_delay is set, there could be a significant delay between  
reading a record and applying it.  
  
Another behavioral change is that if you recover to a restore point, we stop  
after the restore point record, not before it. It makes no difference as far  
as running queries on the server is concerned, as applying a restore point  
record changes nothing, but if examine the timeline history you will see  
that the new timeline branched off just after the restore point record, not  
before it. One practical consequence is that if you do PITR to the new  
timeline, and set recovery target to the same named restore point again, it  
will find and stop recovery at the same restore point. Conceptually, I think  
it makes more sense to consider the restore point as part of the new  
timeline's history than not.  
  
In principle, setting the last-replayed timestamp before actually applying  
the record was a bug all along, but it doesn't seem worth the risk to  
backpatch, since min_recovery_apply_delay was only added in 9.4.  

M src/backend/access/transam/xlog.c

pgcrypto: Make header files stand alone

commit   : 10a3b165a32e9dd116ba340dd2d2f8c77895418e    
  
author   : Peter Eisentraut <[email protected]>    
date     : Thu, 9 Jan 2014 06:44:24 -0500    
  
committer: Peter Eisentraut <[email protected]>    
date     : Thu, 9 Jan 2014 06:44:24 -0500    

Click here for diff

pgp.h used to require including mbuf.h and px.h first.  Include those in  
pgp.h, so that it can be used without prerequisites.  Remove mbuf.h  
inclusions in .c files where mbuf.h features are not used  
directly.  (px.h was always used.)  

M contrib/pgcrypto/pgp-armor.c
M contrib/pgcrypto/pgp-cfb.c
M contrib/pgcrypto/pgp-compress.c
M contrib/pgcrypto/pgp-mpi-internal.c
M contrib/pgcrypto/pgp-mpi-openssl.c
M contrib/pgcrypto/pgp-mpi.c
M contrib/pgcrypto/pgp-pubdec.c
M contrib/pgcrypto/pgp-pubenc.c
M contrib/pgcrypto/pgp-s2k.c
M contrib/pgcrypto/pgp.c
M contrib/pgcrypto/pgp.h

We don't need to include pg_sema.h in s_lock.h anymore.

commit   : 220b34331f77effdb46798ddd7cca0cffc1b2858    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 8 Jan 2014 20:58:22 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 8 Jan 2014 20:58:22 -0500    

Click here for diff

Minor improvement to commit daa7527afc2274432094ebe7ceb03aa41f916607:  
s_lock.h no longer has any need to mention PGSemaphoreData, so we can  
rip out the #include that supplies that.  In a non-HAVE_SPINLOCKS  
build, this doesn't really buy much since we still need the #include  
in spin.h --- but everywhere else, this reduces #include footprint by  
some trifle, and helps keep the different locking facilities separate.  

M src/backend/storage/lmgr/spin.c
M src/include/storage/s_lock.h
M src/include/storage/spin.h

Fix "cannot accept a set" error when only some arms of a CASE return a set.

commit   : 080b7db72ebbec22580237631d6b07d0e1147b01    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 8 Jan 2014 20:18:06 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 8 Jan 2014 20:18:06 -0500    

Click here for diff

In commit c1352052ef1d4eeb2eb1d822a207ddc2d106cb13, I implemented an  
optimization that assumed that a function's argument expressions would  
either always return a set (ie multiple rows), or always not.  This is  
wrong however: we allow CASE expressions in which some arms return a set  
of some type and others just return a scalar of that type.  There may be  
other examples as well.  To fix, replace the run-time test of whether an  
argument returned a set with a static precheck (expression_returns_set).  
This adds a little bit of query startup overhead, but it seems barely  
measurable.  
  
Per bug #8228 from David Johnston.  This has been broken since 8.0,  
so patch all supported branches.  

M src/backend/executor/execQual.c
M src/test/regress/expected/rangefuncs.out
M src/test/regress/sql/rangefuncs.sql

Reduce the number of semaphores used under --disable-spinlocks.

commit   : daa7527afc2274432094ebe7ceb03aa41f916607    
  
author   : Robert Haas <[email protected]>    
date     : Wed, 8 Jan 2014 18:49:14 -0500    
  
committer: Robert Haas <[email protected]>    
date     : Wed, 8 Jan 2014 18:49:14 -0500    

Click here for diff

Instead of allocating a semaphore from the operating system for every  
spinlock, allocate a fixed number of semaphores (by default, 1024)  
from the operating system and multiplex all the spinlocks that get  
created onto them.  This could self-deadlock if a process attempted  
to acquire more than one spinlock at a time, but since processes  
aren't supposed to execute anything other than short stretches of  
straight-line code while holding a spinlock, that shouldn't happen.  
  
One motivation for this change is that, with the introduction of  
dynamic shared memory, it may be desirable to create spinlocks that  
last for less than the lifetime of the server.  Without this change,  
attempting to use such facilities under --disable-spinlocks would  
quickly exhaust any supply of available semaphores.  Quite apart  
from that, it's desirable to contain the quantity of semaphores  
needed to run the server simply on convenience grounds, since using  
too many may make it harder to get PostgreSQL running on a new  
platform, which is mostly the point of --disable-spinlocks in the  
first place.  
  
Patch by me; review by Tom Lane.  

M src/backend/postmaster/postmaster.c
M src/backend/storage/ipc/ipci.c
M src/backend/storage/ipc/shmem.c
M src/backend/storage/lmgr/spin.c
M src/include/pg_config_manual.h
M src/include/storage/s_lock.h
M src/include/storage/spin.h

Fix pause_at_recovery_target + recovery_target_inclusive combination.

commit   : 3739e5ab93afb21b69da2e42f6e161ef63aa95c8    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Wed, 8 Jan 2014 23:06:03 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Wed, 8 Jan 2014 23:06:03 +0200    

Click here for diff

If pause_at_recovery_target is set, recovery pauses *before* applying the  
target record, even if recovery_target_inclusive is set. If you then  
continue with pg_xlog_replay_resume(), it will apply the target record  
before ending recovery. In other words, if you log in while it's paused  
and verify that the database looks OK, ending recovery changes its state  
again, possibly destroying data that you were tring to salvage with PITR.  
  
Backpatch to 9.1, this has been broken since pause_at_recovery_target was  
added.  

M src/backend/access/transam/xlog.c

If multiple recovery_targets are specified, use the latest one.

commit   : 815d71deed5df2a91b06da76edbe5bc64965bfea    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Wed, 8 Jan 2014 22:26:39 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Wed, 8 Jan 2014 22:26:39 +0200    

Click here for diff

The docs say that only one of recovery_target_xid, recovery_target_time, or  
recovery_target_name can be specified. But the code actually did something  
different, so that a name overrode time, and xid overrode both time and name.  
Now the target specified last takes effect, whether it's an xid, time or  
name.  
  
With this patch, we still accept multiple recovery_target settings, even  
though docs say that only one can be specified. It's a general property of  
the recovery.conf file parser that you if you specify the same option twice,  
the last one takes effect, like with postgresql.conf.  

M src/backend/access/transam/xlog.c

Avoid extra AggCheckCallContext() checks in ordered-set aggregates.

commit   : 847e46abc92333a5a948d8fa886604832c1db238    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 8 Jan 2014 14:33:52 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 8 Jan 2014 14:33:52 -0500    

Click here for diff

In the transition functions, we don't really need to recheck this after the  
first call.  I had been feeling paranoid about possibly getting a non-null  
argument value in some other context; but it's probably game over anyway  
if we have a non-null "internal" value that's not what we are expecting.  
  
In the final functions, the general convention in pre-existing final  
functions seems to be that an Assert() is good enough, so do it like that  
here too.  
  
This seems to save a few tenths of a percent of overall query runtime,  
which isn't much, but still it's just overhead if there's not a plausible  
case where the checks would fire.  

M src/backend/utils/adt/orderedsetaggs.c

Save a few cycles in advance_transition_function().

commit   : e6336b8b5772b9856d65ef967e0b9f748f0f7b0b    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 8 Jan 2014 13:58:15 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 8 Jan 2014 13:58:15 -0500    

Click here for diff

Keep a pre-initialized FunctionCallInfoData in AggStatePerAggData, and  
re-use that at each row instead of doing InitFunctionCallInfoData each  
time.  This saves only half a dozen assignments and maybe some stack  
manipulation, and yet that seems to be good for a percent or two of the  
overall query run time for simple aggregates such as count(*).  The cost  
is that the FunctionCallInfoData (which is about a kilobyte, on 64-bit  
machines) stays allocated for the duration of the query instead of being  
short-lived stack data.  But we're already paying an equivalent space cost  
for each regular FuncExpr or OpExpr node, so I don't feel bad about paying  
it for aggregate functions.  The code seems a little cleaner this way too,  
since the number of things passed to advance_transition_function decreases.  

M src/backend/executor/nodeAgg.c

Fix bug in determining when recovery has reached consistency.

commit   : d59ff6c110162fc6f3f62b160ff451bfda871af0    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Wed, 8 Jan 2014 11:39:55 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Wed, 8 Jan 2014 11:39:55 +0200    

Click here for diff

When starting WAL replay from an online checkpoint, the last replayed WAL  
record variable was initialized using the checkpoint record's location, even  
though the records between the REDO location and the checkpoint record had  
not been replayed yet. That was noted as "slightly confusing" but harmless  
in the comment, but in some cases, it fooled CheckRecoveryConsistency to  
incorrectly conclude that we had already reached a consistent state  
immediately at the beginning of WAL replay. That caused the system to accept  
read-only connections in hot standby mode too early, and also PANICs with  
message "WAL contains references to invalid pages".  
  
Fix by initializing the variables to the REDO location instead.  
  
In 9.2 and above, change CheckRecoveryConsistency() to use  
lastReplayedEndRecPtr variable when checking if backup end location has  
been reached. It was inconsistently using EndRecPtr for that check, but  
lastReplayedEndRecPtr when checking min recovery point. It made no  
difference before this patch, because in all the places where  
CheckRecoveryConsistency was called the two variables were the same, but  
it was always an accident waiting to happen, and would have been wrong  
after this patch anyway.  
  
Report and analysis by Tomonari Katsumata, bug #8686. Backpatch to 9.0,  
where hot standby was introduced.  

M src/backend/access/transam/xlog.c

pg_upgrade: Fix fatal error handling

commit   : ca607b155e86ce529fc9ac322a232f264cda9ab6    
  
author   : Peter Eisentraut <[email protected]>    
date     : Wed, 8 Jan 2014 07:01:16 -0500    
  
committer: Peter Eisentraut <[email protected]>    
date     : Wed, 8 Jan 2014 07:01:16 -0500    

Click here for diff

Restore exiting when pg_log(PG_FATAL) is called directly instead of  
calling pg_fatal().  Fault introduced in  
264aa14a2f687eba8c8cc2a5b6cbd6397973da98.  

M contrib/pg_upgrade/util.c

commit   : 7e04792a1cbd1763edf72474f6b1fbad2cd0ad31    
  
author   : Bruce Momjian <[email protected]>    
date     : Tue, 7 Jan 2014 16:05:30 -0500    
  
committer: Bruce Momjian <[email protected]>    
date     : Tue, 7 Jan 2014 16:05:30 -0500    

Click here for diff

Update all files in head, and files COPYRIGHT and legal.sgml in all back  
branches.  

M COPYRIGHT
M configure
M configure.in
M contrib/adminpack/adminpack.c
M contrib/auto_explain/auto_explain.c
M contrib/dblink/dblink.c
M contrib/dblink/dblink.h
M contrib/dict_int/dict_int.c
M contrib/dict_xsyn/dict_xsyn.c
M contrib/dummy_seclabel/dummy_seclabel.c
M contrib/file_fdw/file_fdw.c
M contrib/fuzzystrmatch/fuzzystrmatch.c
M contrib/fuzzystrmatch/levenshtein.c
M contrib/isn/isn.c
M contrib/isn/isn.h
M contrib/pageinspect/fsmfuncs.c
M contrib/pageinspect/heapfuncs.c
M contrib/pageinspect/rawpage.c
M contrib/passwordcheck/passwordcheck.c
M contrib/pg_prewarm/pg_prewarm.c
M contrib/pg_stat_statements/pg_stat_statements.c
M contrib/pg_trgm/trgm_regexp.c
M contrib/pg_upgrade/check.c
M contrib/pg_upgrade/controldata.c
M contrib/pg_upgrade/dump.c
M contrib/pg_upgrade/exec.c
M contrib/pg_upgrade/file.c
M contrib/pg_upgrade/function.c
M contrib/pg_upgrade/info.c
M contrib/pg_upgrade/option.c
M contrib/pg_upgrade/page.c
M contrib/pg_upgrade/parallel.c
M contrib/pg_upgrade/pg_upgrade.c
M contrib/pg_upgrade/pg_upgrade.h
M contrib/pg_upgrade/relfilenode.c
M contrib/pg_upgrade/server.c
M contrib/pg_upgrade/tablespace.c
M contrib/pg_upgrade/test.sh
M contrib/pg_upgrade/util.c
M contrib/pg_upgrade/version.c
M contrib/pg_upgrade/version_old_8_3.c
M contrib/pg_upgrade_support/pg_upgrade_support.c
M contrib/pg_xlogdump/compat.c
M contrib/pg_xlogdump/pg_xlogdump.c
M contrib/pgbench/pgbench.c
M contrib/postgres_fdw/connection.c
M contrib/postgres_fdw/deparse.c
M contrib/postgres_fdw/option.c
M contrib/postgres_fdw/postgres_fdw.c
M contrib/postgres_fdw/postgres_fdw.h
M contrib/sepgsql/database.c
M contrib/sepgsql/dml.c
M contrib/sepgsql/hooks.c
M contrib/sepgsql/label.c
M contrib/sepgsql/launcher
M contrib/sepgsql/proc.c
M contrib/sepgsql/relation.c
M contrib/sepgsql/schema.c
M contrib/sepgsql/selinux.c
M contrib/sepgsql/sepgsql.h
M contrib/sepgsql/uavc.c
M contrib/tablefunc/tablefunc.c
M contrib/tablefunc/tablefunc.h
M contrib/tcn/tcn.c
M contrib/test_parser/test_parser.c
M contrib/tsearch2/tsearch2.c
M contrib/unaccent/unaccent.c
M contrib/uuid-ossp/uuid-ossp.c
M contrib/vacuumlo/vacuumlo.c
M doc/src/sgml/generate-errcodes-table.pl
M doc/src/sgml/legal.sgml
M doc/src/sgml/lobj.sgml
M src/backend/Makefile
M src/backend/access/common/heaptuple.c
M src/backend/access/common/indextuple.c
M src/backend/access/common/printtup.c
M src/backend/access/common/reloptions.c
M src/backend/access/common/scankey.c
M src/backend/access/common/tupconvert.c
M src/backend/access/common/tupdesc.c
M src/backend/access/gin/ginarrayproc.c
M src/backend/access/gin/ginbtree.c
M src/backend/access/gin/ginbulk.c
M src/backend/access/gin/gindatapage.c
M src/backend/access/gin/ginentrypage.c
M src/backend/access/gin/ginfast.c
M src/backend/access/gin/ginget.c
M src/backend/access/gin/gininsert.c
M src/backend/access/gin/ginpostinglist.c
M src/backend/access/gin/ginscan.c
M src/backend/access/gin/ginutil.c
M src/backend/access/gin/ginvacuum.c
M src/backend/access/gin/ginxlog.c
M src/backend/access/gist/gist.c
M src/backend/access/gist/gistbuild.c
M src/backend/access/gist/gistbuildbuffers.c
M src/backend/access/gist/gistget.c
M src/backend/access/gist/gistproc.c
M src/backend/access/gist/gistscan.c
M src/backend/access/gist/gistsplit.c
M src/backend/access/gist/gistutil.c
M src/backend/access/gist/gistvacuum.c
M src/backend/access/gist/gistxlog.c
M src/backend/access/hash/hash.c
M src/backend/access/hash/hashfunc.c
M src/backend/access/hash/hashinsert.c
M src/backend/access/hash/hashovfl.c
M src/backend/access/hash/hashpage.c
M src/backend/access/hash/hashscan.c
M src/backend/access/hash/hashsearch.c
M src/backend/access/hash/hashsort.c
M src/backend/access/hash/hashutil.c
M src/backend/access/heap/heapam.c
M src/backend/access/heap/hio.c
M src/backend/access/heap/pruneheap.c
M src/backend/access/heap/rewriteheap.c
M src/backend/access/heap/syncscan.c
M src/backend/access/heap/tuptoaster.c
M src/backend/access/heap/visibilitymap.c
M src/backend/access/index/genam.c
M src/backend/access/index/indexam.c
M src/backend/access/nbtree/nbtcompare.c
M src/backend/access/nbtree/nbtinsert.c
M src/backend/access/nbtree/nbtpage.c
M src/backend/access/nbtree/nbtree.c
M src/backend/access/nbtree/nbtsearch.c
M src/backend/access/nbtree/nbtsort.c
M src/backend/access/nbtree/nbtutils.c
M src/backend/access/nbtree/nbtxlog.c
M src/backend/access/rmgrdesc/clogdesc.c
M src/backend/access/rmgrdesc/dbasedesc.c
M src/backend/access/rmgrdesc/gindesc.c
M src/backend/access/rmgrdesc/gistdesc.c
M src/backend/access/rmgrdesc/hashdesc.c
M src/backend/access/rmgrdesc/heapdesc.c
M src/backend/access/rmgrdesc/mxactdesc.c
M src/backend/access/rmgrdesc/nbtdesc.c
M src/backend/access/rmgrdesc/relmapdesc.c
M src/backend/access/rmgrdesc/seqdesc.c
M src/backend/access/rmgrdesc/smgrdesc.c
M src/backend/access/rmgrdesc/spgdesc.c
M src/backend/access/rmgrdesc/standbydesc.c
M src/backend/access/rmgrdesc/tblspcdesc.c
M src/backend/access/rmgrdesc/xactdesc.c
M src/backend/access/rmgrdesc/xlogdesc.c
M src/backend/access/spgist/spgdoinsert.c
M src/backend/access/spgist/spginsert.c
M src/backend/access/spgist/spgkdtreeproc.c
M src/backend/access/spgist/spgquadtreeproc.c
M src/backend/access/spgist/spgscan.c
M src/backend/access/spgist/spgtextproc.c
M src/backend/access/spgist/spgutils.c
M src/backend/access/spgist/spgvacuum.c
M src/backend/access/spgist/spgxlog.c
M src/backend/access/transam/clog.c
M src/backend/access/transam/multixact.c
M src/backend/access/transam/slru.c
M src/backend/access/transam/subtrans.c
M src/backend/access/transam/timeline.c
M src/backend/access/transam/transam.c
M src/backend/access/transam/twophase.c
M src/backend/access/transam/twophase_rmgr.c
M src/backend/access/transam/varsup.c
M src/backend/access/transam/xact.c
M src/backend/access/transam/xlog.c
M src/backend/access/transam/xlogarchive.c
M src/backend/access/transam/xlogfuncs.c
M src/backend/access/transam/xlogreader.c
M src/backend/access/transam/xlogutils.c
M src/backend/bootstrap/bootparse.y
M src/backend/bootstrap/bootscanner.l
M src/backend/bootstrap/bootstrap.c
M src/backend/catalog/Catalog.pm
M src/backend/catalog/aclchk.c
M src/backend/catalog/catalog.c
M src/backend/catalog/dependency.c
M src/backend/catalog/genbki.pl
M src/backend/catalog/heap.c
M src/backend/catalog/index.c
M src/backend/catalog/indexing.c
M src/backend/catalog/information_schema.sql
M src/backend/catalog/namespace.c
M src/backend/catalog/objectaccess.c
M src/backend/catalog/objectaddress.c
M src/backend/catalog/pg_aggregate.c
M src/backend/catalog/pg_collation.c
M src/backend/catalog/pg_constraint.c
M src/backend/catalog/pg_conversion.c
M src/backend/catalog/pg_db_role_setting.c
M src/backend/catalog/pg_depend.c
M src/backend/catalog/pg_enum.c
M src/backend/catalog/pg_inherits.c
M src/backend/catalog/pg_largeobject.c
M src/backend/catalog/pg_namespace.c
M src/backend/catalog/pg_operator.c
M src/backend/catalog/pg_proc.c
M src/backend/catalog/pg_range.c
M src/backend/catalog/pg_shdepend.c
M src/backend/catalog/pg_type.c
M src/backend/catalog/storage.c
M src/backend/catalog/system_views.sql
M src/backend/catalog/toasting.c
M src/backend/commands/aggregatecmds.c
M src/backend/commands/alter.c
M src/backend/commands/analyze.c
M src/backend/commands/async.c
M src/backend/commands/cluster.c
M src/backend/commands/collationcmds.c
M src/backend/commands/comment.c
M src/backend/commands/constraint.c
M src/backend/commands/conversioncmds.c
M src/backend/commands/copy.c
M src/backend/commands/createas.c
M src/backend/commands/dbcommands.c
M src/backend/commands/define.c
M src/backend/commands/discard.c
M src/backend/commands/dropcmds.c
M src/backend/commands/event_trigger.c
M src/backend/commands/explain.c
M src/backend/commands/extension.c
M src/backend/commands/foreigncmds.c
M src/backend/commands/functioncmds.c
M src/backend/commands/indexcmds.c
M src/backend/commands/lockcmds.c
M src/backend/commands/matview.c
M src/backend/commands/opclasscmds.c
M src/backend/commands/operatorcmds.c
M src/backend/commands/portalcmds.c
M src/backend/commands/prepare.c
M src/backend/commands/proclang.c
M src/backend/commands/schemacmds.c
M src/backend/commands/seclabel.c
M src/backend/commands/sequence.c
M src/backend/commands/tablecmds.c
M src/backend/commands/tablespace.c
M src/backend/commands/trigger.c
M src/backend/commands/tsearchcmds.c
M src/backend/commands/typecmds.c
M src/backend/commands/user.c
M src/backend/commands/vacuum.c
M src/backend/commands/vacuumlazy.c
M src/backend/commands/variable.c
M src/backend/commands/view.c
M src/backend/executor/execAmi.c
M src/backend/executor/execCurrent.c
M src/backend/executor/execGrouping.c
M src/backend/executor/execJunk.c
M src/backend/executor/execMain.c
M src/backend/executor/execProcnode.c
M src/backend/executor/execQual.c
M src/backend/executor/execScan.c
M src/backend/executor/execTuples.c
M src/backend/executor/execUtils.c
M src/backend/executor/functions.c
M src/backend/executor/instrument.c
M src/backend/executor/nodeAgg.c
M src/backend/executor/nodeAppend.c
M src/backend/executor/nodeBitmapAnd.c
M src/backend/executor/nodeBitmapHeapscan.c
M src/backend/executor/nodeBitmapIndexscan.c
M src/backend/executor/nodeBitmapOr.c
M src/backend/executor/nodeCtescan.c
M src/backend/executor/nodeForeignscan.c
M src/backend/executor/nodeFunctionscan.c
M src/backend/executor/nodeGroup.c
M src/backend/executor/nodeHash.c
M src/backend/executor/nodeHashjoin.c
M src/backend/executor/nodeIndexonlyscan.c
M src/backend/executor/nodeIndexscan.c
M src/backend/executor/nodeLimit.c
M src/backend/executor/nodeLockRows.c
M src/backend/executor/nodeMaterial.c
M src/backend/executor/nodeMergeAppend.c
M src/backend/executor/nodeMergejoin.c
M src/backend/executor/nodeModifyTable.c
M src/backend/executor/nodeNestloop.c
M src/backend/executor/nodeRecursiveunion.c
M src/backend/executor/nodeResult.c
M src/backend/executor/nodeSeqscan.c
M src/backend/executor/nodeSetOp.c
M src/backend/executor/nodeSort.c
M src/backend/executor/nodeSubplan.c
M src/backend/executor/nodeSubqueryscan.c
M src/backend/executor/nodeTidscan.c
M src/backend/executor/nodeUnique.c
M src/backend/executor/nodeValuesscan.c
M src/backend/executor/nodeWindowAgg.c
M src/backend/executor/nodeWorktablescan.c
M src/backend/executor/spi.c
M src/backend/executor/tstoreReceiver.c
M src/backend/foreign/foreign.c
M src/backend/lib/binaryheap.c
M src/backend/lib/ilist.c
M src/backend/lib/stringinfo.c
M src/backend/libpq/auth.c
M src/backend/libpq/be-fsstubs.c
M src/backend/libpq/be-secure.c
M src/backend/libpq/crypt.c
M src/backend/libpq/hba.c
M src/backend/libpq/ip.c
M src/backend/libpq/md5.c
M src/backend/libpq/pqcomm.c
M src/backend/libpq/pqformat.c
M src/backend/libpq/pqsignal.c
M src/backend/main/main.c
M src/backend/nodes/bitmapset.c
M src/backend/nodes/copyfuncs.c
M src/backend/nodes/equalfuncs.c
M src/backend/nodes/list.c
M src/backend/nodes/makefuncs.c
M src/backend/nodes/nodeFuncs.c
M src/backend/nodes/nodes.c
M src/backend/nodes/outfuncs.c
M src/backend/nodes/params.c
M src/backend/nodes/print.c
M src/backend/nodes/read.c
M src/backend/nodes/readfuncs.c
M src/backend/nodes/tidbitmap.c
M src/backend/nodes/value.c
M src/backend/optimizer/geqo/geqo_copy.c
M src/backend/optimizer/geqo/geqo_eval.c
M src/backend/optimizer/geqo/geqo_main.c
M src/backend/optimizer/geqo/geqo_misc.c
M src/backend/optimizer/geqo/geqo_pool.c
M src/backend/optimizer/geqo/geqo_random.c
M src/backend/optimizer/geqo/geqo_selection.c
M src/backend/optimizer/path/allpaths.c
M src/backend/optimizer/path/clausesel.c
M src/backend/optimizer/path/costsize.c
M src/backend/optimizer/path/equivclass.c
M src/backend/optimizer/path/indxpath.c
M src/backend/optimizer/path/joinpath.c
M src/backend/optimizer/path/joinrels.c
M src/backend/optimizer/path/pathkeys.c
M src/backend/optimizer/path/tidpath.c
M src/backend/optimizer/plan/analyzejoins.c
M src/backend/optimizer/plan/createplan.c
M src/backend/optimizer/plan/initsplan.c
M src/backend/optimizer/plan/planagg.c
M src/backend/optimizer/plan/planmain.c
M src/backend/optimizer/plan/planner.c
M src/backend/optimizer/plan/setrefs.c
M src/backend/optimizer/plan/subselect.c
M src/backend/optimizer/prep/prepjointree.c
M src/backend/optimizer/prep/prepqual.c
M src/backend/optimizer/prep/preptlist.c
M src/backend/optimizer/prep/prepunion.c
M src/backend/optimizer/util/clauses.c
M src/backend/optimizer/util/joininfo.c
M src/backend/optimizer/util/orclauses.c
M src/backend/optimizer/util/pathnode.c
M src/backend/optimizer/util/placeholder.c
M src/backend/optimizer/util/plancat.c
M src/backend/optimizer/util/predtest.c
M src/backend/optimizer/util/relnode.c
M src/backend/optimizer/util/restrictinfo.c
M src/backend/optimizer/util/tlist.c
M src/backend/optimizer/util/var.c
M src/backend/parser/analyze.c
M src/backend/parser/check_keywords.pl
M src/backend/parser/gram.y
M src/backend/parser/keywords.c
M src/backend/parser/kwlookup.c
M src/backend/parser/parse_agg.c
M src/backend/parser/parse_clause.c
M src/backend/parser/parse_coerce.c
M src/backend/parser/parse_collate.c
M src/backend/parser/parse_cte.c
M src/backend/parser/parse_expr.c
M src/backend/parser/parse_func.c
M src/backend/parser/parse_node.c
M src/backend/parser/parse_oper.c
M src/backend/parser/parse_param.c
M src/backend/parser/parse_relation.c
M src/backend/parser/parse_target.c
M src/backend/parser/parse_type.c
M src/backend/parser/parse_utilcmd.c
M src/backend/parser/parser.c
M src/backend/parser/scan.l
M src/backend/parser/scansup.c
M src/backend/port/dynloader/aix.h
M src/backend/port/dynloader/cygwin.h
M src/backend/port/dynloader/freebsd.c
M src/backend/port/dynloader/freebsd.h
M src/backend/port/dynloader/hpux.c
M src/backend/port/dynloader/hpux.h
M src/backend/port/dynloader/linux.c
M src/backend/port/dynloader/linux.h
M src/backend/port/dynloader/netbsd.c
M src/backend/port/dynloader/netbsd.h
M src/backend/port/dynloader/openbsd.c
M src/backend/port/dynloader/openbsd.h
M src/backend/port/dynloader/osf.h
M src/backend/port/dynloader/sco.h
M src/backend/port/dynloader/solaris.h
M src/backend/port/dynloader/unixware.h
M src/backend/port/ipc_test.c
M src/backend/port/posix_sema.c
M src/backend/port/sysv_sema.c
M src/backend/port/sysv_shmem.c
M src/backend/port/tas/sunstudio_sparc.s
M src/backend/port/tas/sunstudio_x86.s
M src/backend/port/unix_latch.c
M src/backend/port/win32/crashdump.c
M src/backend/port/win32/mingwcompat.c
M src/backend/port/win32/security.c
M src/backend/port/win32/signal.c
M src/backend/port/win32/socket.c
M src/backend/port/win32/timer.c
M src/backend/port/win32_latch.c
M src/backend/port/win32_sema.c
M src/backend/port/win32_shmem.c
M src/backend/postmaster/autovacuum.c
M src/backend/postmaster/bgworker.c
M src/backend/postmaster/bgwriter.c
M src/backend/postmaster/checkpointer.c
M src/backend/postmaster/fork_process.c
M src/backend/postmaster/pgarch.c
M src/backend/postmaster/pgstat.c
M src/backend/postmaster/postmaster.c
M src/backend/postmaster/startup.c
M src/backend/postmaster/syslogger.c
M src/backend/postmaster/walwriter.c
M src/backend/regex/regc_pg_locale.c
M src/backend/regex/regexport.c
M src/backend/regex/regprefix.c
M src/backend/replication/basebackup.c
M src/backend/replication/libpqwalreceiver/libpqwalreceiver.c
M src/backend/replication/repl_gram.y
M src/backend/replication/repl_scanner.l
M src/backend/replication/syncrep.c
M src/backend/replication/walreceiver.c
M src/backend/replication/walreceiverfuncs.c
M src/backend/replication/walsender.c
M src/backend/rewrite/rewriteDefine.c
M src/backend/rewrite/rewriteHandler.c
M src/backend/rewrite/rewriteManip.c
M src/backend/rewrite/rewriteRemove.c
M src/backend/rewrite/rewriteSupport.c
M src/backend/snowball/dict_snowball.c
M src/backend/storage/buffer/buf_init.c
M src/backend/storage/buffer/buf_table.c
M src/backend/storage/buffer/bufmgr.c
M src/backend/storage/buffer/freelist.c
M src/backend/storage/buffer/localbuf.c
M src/backend/storage/file/buffile.c
M src/backend/storage/file/copydir.c
M src/backend/storage/file/fd.c
M src/backend/storage/file/reinit.c
M src/backend/storage/freespace/freespace.c
M src/backend/storage/freespace/fsmpage.c
M src/backend/storage/freespace/indexfsm.c
M src/backend/storage/ipc/dsm.c
M src/backend/storage/ipc/dsm_impl.c
M src/backend/storage/ipc/ipc.c
M src/backend/storage/ipc/ipci.c
M src/backend/storage/ipc/pmsignal.c
M src/backend/storage/ipc/procarray.c
M src/backend/storage/ipc/procsignal.c
M src/backend/storage/ipc/shmem.c
M src/backend/storage/ipc/shmqueue.c
M src/backend/storage/ipc/sinval.c
M src/backend/storage/ipc/sinvaladt.c
M src/backend/storage/ipc/standby.c
M src/backend/storage/large_object/inv_api.c
M src/backend/storage/lmgr/deadlock.c
M src/backend/storage/lmgr/lmgr.c
M src/backend/storage/lmgr/lock.c
M src/backend/storage/lmgr/lwlock.c
M src/backend/storage/lmgr/predicate.c
M src/backend/storage/lmgr/proc.c
M src/backend/storage/lmgr/s_lock.c
M src/backend/storage/lmgr/spin.c
M src/backend/storage/page/bufpage.c
M src/backend/storage/page/checksum.c
M src/backend/storage/page/itemptr.c
M src/backend/storage/smgr/md.c
M src/backend/storage/smgr/smgr.c
M src/backend/storage/smgr/smgrtype.c
M src/backend/tcop/dest.c
M src/backend/tcop/fastpath.c
M src/backend/tcop/postgres.c
M src/backend/tcop/pquery.c
M src/backend/tcop/utility.c
M src/backend/tsearch/Makefile
M src/backend/tsearch/dict.c
M src/backend/tsearch/dict_ispell.c
M src/backend/tsearch/dict_simple.c
M src/backend/tsearch/dict_synonym.c
M src/backend/tsearch/dict_thesaurus.c
M src/backend/tsearch/regis.c
M src/backend/tsearch/spell.c
M src/backend/tsearch/to_tsany.c
M src/backend/tsearch/ts_locale.c
M src/backend/tsearch/ts_parse.c
M src/backend/tsearch/ts_selfuncs.c
M src/backend/tsearch/ts_typanalyze.c
M src/backend/tsearch/ts_utils.c
M src/backend/tsearch/wparser.c
M src/backend/tsearch/wparser_def.c
M src/backend/utils/Gen_dummy_probes.sed
M src/backend/utils/Gen_fmgrtab.pl
M src/backend/utils/adt/acl.c
M src/backend/utils/adt/array_selfuncs.c
M src/backend/utils/adt/array_typanalyze.c
M src/backend/utils/adt/array_userfuncs.c
M src/backend/utils/adt/arrayfuncs.c
M src/backend/utils/adt/arrayutils.c
M src/backend/utils/adt/ascii.c
M src/backend/utils/adt/bool.c
M src/backend/utils/adt/char.c
M src/backend/utils/adt/date.c
M src/backend/utils/adt/datetime.c
M src/backend/utils/adt/datum.c
M src/backend/utils/adt/dbsize.c
M src/backend/utils/adt/domains.c
M src/backend/utils/adt/encode.c
M src/backend/utils/adt/enum.c
M src/backend/utils/adt/float.c
M src/backend/utils/adt/format_type.c
M src/backend/utils/adt/formatting.c
M src/backend/utils/adt/genfile.c
M src/backend/utils/adt/geo_ops.c
M src/backend/utils/adt/geo_selfuncs.c
M src/backend/utils/adt/int.c
M src/backend/utils/adt/int8.c
M src/backend/utils/adt/json.c
M src/backend/utils/adt/jsonfuncs.c
M src/backend/utils/adt/like.c
M src/backend/utils/adt/like_match.c
M src/backend/utils/adt/lockfuncs.c
M src/backend/utils/adt/misc.c
M src/backend/utils/adt/nabstime.c
M src/backend/utils/adt/name.c
M src/backend/utils/adt/numeric.c
M src/backend/utils/adt/numutils.c
M src/backend/utils/adt/oid.c
M src/backend/utils/adt/oracle_compat.c
M src/backend/utils/adt/orderedsetaggs.c
M src/backend/utils/adt/pg_locale.c
M src/backend/utils/adt/pg_lzcompress.c
M src/backend/utils/adt/pgstatfuncs.c
M src/backend/utils/adt/pseudotypes.c
M src/backend/utils/adt/quote.c
M src/backend/utils/adt/rangetypes.c
M src/backend/utils/adt/rangetypes_gist.c
M src/backend/utils/adt/rangetypes_selfuncs.c
M src/backend/utils/adt/rangetypes_spgist.c
M src/backend/utils/adt/rangetypes_typanalyze.c
M src/backend/utils/adt/regexp.c
M src/backend/utils/adt/regproc.c
M src/backend/utils/adt/ri_triggers.c
M src/backend/utils/adt/rowtypes.c
M src/backend/utils/adt/ruleutils.c
M src/backend/utils/adt/selfuncs.c
M src/backend/utils/adt/tid.c
M src/backend/utils/adt/timestamp.c
M src/backend/utils/adt/trigfuncs.c
M src/backend/utils/adt/tsginidx.c
M src/backend/utils/adt/tsgistidx.c
M src/backend/utils/adt/tsquery.c
M src/backend/utils/adt/tsquery_cleanup.c
M src/backend/utils/adt/tsquery_gist.c
M src/backend/utils/adt/tsquery_op.c
M src/backend/utils/adt/tsquery_rewrite.c
M src/backend/utils/adt/tsquery_util.c
M src/backend/utils/adt/tsrank.c
M src/backend/utils/adt/tsvector.c
M src/backend/utils/adt/tsvector_op.c
M src/backend/utils/adt/tsvector_parser.c
M src/backend/utils/adt/txid.c
M src/backend/utils/adt/uuid.c
M src/backend/utils/adt/varbit.c
M src/backend/utils/adt/varchar.c
M src/backend/utils/adt/varlena.c
M src/backend/utils/adt/version.c
M src/backend/utils/adt/windowfuncs.c
M src/backend/utils/adt/xid.c
M src/backend/utils/adt/xml.c
M src/backend/utils/cache/attoptcache.c
M src/backend/utils/cache/catcache.c
M src/backend/utils/cache/evtcache.c
M src/backend/utils/cache/inval.c
M src/backend/utils/cache/lsyscache.c
M src/backend/utils/cache/plancache.c
M src/backend/utils/cache/relcache.c
M src/backend/utils/cache/relfilenodemap.c
M src/backend/utils/cache/relmapper.c
M src/backend/utils/cache/spccache.c
M src/backend/utils/cache/syscache.c
M src/backend/utils/cache/ts_cache.c
M src/backend/utils/cache/typcache.c
M src/backend/utils/errcodes.txt
M src/backend/utils/error/assert.c
M src/backend/utils/error/elog.c
M src/backend/utils/fmgr/dfmgr.c
M src/backend/utils/fmgr/fmgr.c
M src/backend/utils/fmgr/funcapi.c
M src/backend/utils/generate-errcodes.pl
M src/backend/utils/hash/dynahash.c
M src/backend/utils/hash/hashfn.c
M src/backend/utils/init/globals.c
M src/backend/utils/init/miscinit.c
M src/backend/utils/init/postinit.c
M src/backend/utils/mb/Unicode/Makefile
M src/backend/utils/mb/Unicode/UCS_to_BIG5.pl
M src/backend/utils/mb/Unicode/UCS_to_EUC_CN.pl
M src/backend/utils/mb/Unicode/UCS_to_EUC_JIS_2004.pl
M src/backend/utils/mb/Unicode/UCS_to_EUC_JP.pl
M src/backend/utils/mb/Unicode/UCS_to_EUC_KR.pl
M src/backend/utils/mb/Unicode/UCS_to_EUC_TW.pl
M src/backend/utils/mb/Unicode/UCS_to_GB18030.pl
M src/backend/utils/mb/Unicode/UCS_to_SHIFT_JIS_2004.pl
M src/backend/utils/mb/Unicode/UCS_to_SJIS.pl
M src/backend/utils/mb/Unicode/UCS_to_most.pl
M src/backend/utils/mb/Unicode/ucs2utf.pl
M src/backend/utils/mb/conv.c
M src/backend/utils/mb/conversion_procs/ascii_and_mic/ascii_and_mic.c
M src/backend/utils/mb/conversion_procs/cyrillic_and_mic/cyrillic_and_mic.c
M src/backend/utils/mb/conversion_procs/euc2004_sjis2004/euc2004_sjis2004.c
M src/backend/utils/mb/conversion_procs/euc_cn_and_mic/euc_cn_and_mic.c
M src/backend/utils/mb/conversion_procs/euc_jp_and_sjis/euc_jp_and_sjis.c
M src/backend/utils/mb/conversion_procs/euc_kr_and_mic/euc_kr_and_mic.c
M src/backend/utils/mb/conversion_procs/euc_tw_and_big5/euc_tw_and_big5.c
M src/backend/utils/mb/conversion_procs/latin2_and_win1250/latin2_and_win1250.c
M src/backend/utils/mb/conversion_procs/latin_and_mic/latin_and_mic.c
M src/backend/utils/mb/conversion_procs/utf8_and_ascii/utf8_and_ascii.c
M src/backend/utils/mb/conversion_procs/utf8_and_big5/utf8_and_big5.c
M src/backend/utils/mb/conversion_procs/utf8_and_cyrillic/utf8_and_cyrillic.c
M src/backend/utils/mb/conversion_procs/utf8_and_euc2004/utf8_and_euc2004.c
M src/backend/utils/mb/conversion_procs/utf8_and_euc_cn/utf8_and_euc_cn.c
M src/backend/utils/mb/conversion_procs/utf8_and_euc_jp/utf8_and_euc_jp.c
M src/backend/utils/mb/conversion_procs/utf8_and_euc_kr/utf8_and_euc_kr.c
M src/backend/utils/mb/conversion_procs/utf8_and_euc_tw/utf8_and_euc_tw.c
M src/backend/utils/mb/conversion_procs/utf8_and_gb18030/utf8_and_gb18030.c
M src/backend/utils/mb/conversion_procs/utf8_and_gbk/utf8_and_gbk.c
M src/backend/utils/mb/conversion_procs/utf8_and_iso8859/utf8_and_iso8859.c
M src/backend/utils/mb/conversion_procs/utf8_and_iso8859_1/utf8_and_iso8859_1.c
M src/backend/utils/mb/conversion_procs/utf8_and_johab/utf8_and_johab.c
M src/backend/utils/mb/conversion_procs/utf8_and_sjis/utf8_and_sjis.c
M src/backend/utils/mb/conversion_procs/utf8_and_sjis2004/utf8_and_sjis2004.c
M src/backend/utils/mb/conversion_procs/utf8_and_uhc/utf8_and_uhc.c
M src/backend/utils/mb/conversion_procs/utf8_and_win/utf8_and_win.c
M src/backend/utils/misc/guc-file.l
M src/backend/utils/misc/guc.c
M src/backend/utils/misc/help_config.c
M src/backend/utils/misc/pg_rusage.c
M src/backend/utils/misc/ps_status.c
M src/backend/utils/misc/rbtree.c
M src/backend/utils/misc/superuser.c
M src/backend/utils/misc/timeout.c
M src/backend/utils/misc/tzparser.c
M src/backend/utils/mmgr/aset.c
M src/backend/utils/mmgr/mcxt.c
M src/backend/utils/mmgr/portalmem.c
M src/backend/utils/probes.d
M src/backend/utils/resowner/resowner.c
M src/backend/utils/sort/logtape.c
M src/backend/utils/sort/sortsupport.c
M src/backend/utils/sort/tuplesort.c
M src/backend/utils/sort/tuplestore.c
M src/backend/utils/time/combocid.c
M src/backend/utils/time/snapmgr.c
M src/backend/utils/time/tqual.c
M src/bin/Makefile
M src/bin/initdb/Makefile
M src/bin/initdb/findtimezone.c
M src/bin/initdb/initdb.c
M src/bin/pg_basebackup/Makefile
M src/bin/pg_basebackup/pg_basebackup.c
M src/bin/pg_basebackup/pg_receivexlog.c
M src/bin/pg_basebackup/receivelog.c
M src/bin/pg_basebackup/streamutil.c
M src/bin/pg_config/Makefile
M src/bin/pg_config/pg_config.c
M src/bin/pg_controldata/Makefile
M src/bin/pg_ctl/Makefile
M src/bin/pg_ctl/pg_ctl.c
M src/bin/pg_dump/Makefile
M src/bin/pg_dump/common.c
M src/bin/pg_dump/compress_io.c
M src/bin/pg_dump/compress_io.h
M src/bin/pg_dump/dumputils.c
M src/bin/pg_dump/dumputils.h
M src/bin/pg_dump/keywords.c
M src/bin/pg_dump/parallel.c
M src/bin/pg_dump/parallel.h
M src/bin/pg_dump/pg_backup_directory.c
M src/bin/pg_dump/pg_backup_utils.c
M src/bin/pg_dump/pg_backup_utils.h
M src/bin/pg_dump/pg_dump.c
M src/bin/pg_dump/pg_dump.h
M src/bin/pg_dump/pg_dump_sort.c
M src/bin/pg_dump/pg_dumpall.c
M src/bin/pg_resetxlog/Makefile
M src/bin/pg_resetxlog/pg_resetxlog.c
M src/bin/pgevent/Makefile
M src/bin/psql/Makefile
M src/bin/psql/command.c
M src/bin/psql/command.h
M src/bin/psql/common.c
M src/bin/psql/common.h
M src/bin/psql/copy.c
M src/bin/psql/copy.h
M src/bin/psql/create_help.pl
M src/bin/psql/describe.c
M src/bin/psql/describe.h
M src/bin/psql/help.c
M src/bin/psql/help.h
M src/bin/psql/input.c
M src/bin/psql/input.h
M src/bin/psql/large_obj.c
M src/bin/psql/large_obj.h
M src/bin/psql/mainloop.c
M src/bin/psql/mainloop.h
M src/bin/psql/mbprint.c
M src/bin/psql/print.c
M src/bin/psql/print.h
M src/bin/psql/prompt.c
M src/bin/psql/prompt.h
M src/bin/psql/psqlscan.h
M src/bin/psql/psqlscan.l
M src/bin/psql/settings.h
M src/bin/psql/startup.c
M src/bin/psql/stringutils.c
M src/bin/psql/stringutils.h
M src/bin/psql/tab-complete.c
M src/bin/psql/tab-complete.h
M src/bin/psql/variables.c
M src/bin/psql/variables.h
M src/bin/scripts/Makefile
M src/bin/scripts/clusterdb.c
M src/bin/scripts/common.c
M src/bin/scripts/common.h
M src/bin/scripts/createdb.c
M src/bin/scripts/createlang.c
M src/bin/scripts/createuser.c
M src/bin/scripts/dropdb.c
M src/bin/scripts/droplang.c
M src/bin/scripts/dropuser.c
M src/bin/scripts/pg_isready.c
M src/bin/scripts/reindexdb.c
M src/bin/scripts/vacuumdb.c
M src/common/exec.c
M src/common/fe_memutils.c
M src/common/pgfnames.c
M src/common/psprintf.c
M src/common/relpath.c
M src/common/rmtree.c
M src/common/wait_error.c
M src/include/access/attnum.h
M src/include/access/clog.h
M src/include/access/genam.h
M src/include/access/gin.h
M src/include/access/gin_private.h
M src/include/access/gist.h
M src/include/access/gist_private.h
M src/include/access/gistscan.h
M src/include/access/hash.h
M src/include/access/heapam.h
M src/include/access/heapam_xlog.h
M src/include/access/hio.h
M src/include/access/htup.h
M src/include/access/htup_details.h
M src/include/access/itup.h
M src/include/access/multixact.h
M src/include/access/nbtree.h
M src/include/access/printtup.h
M src/include/access/reloptions.h
M src/include/access/relscan.h
M src/include/access/rewriteheap.h
M src/include/access/rmgrlist.h
M src/include/access/sdir.h
M src/include/access/skey.h
M src/include/access/slru.h
M src/include/access/spgist.h
M src/include/access/spgist_private.h
M src/include/access/subtrans.h
M src/include/access/sysattr.h
M src/include/access/timeline.h
M src/include/access/transam.h
M src/include/access/tupconvert.h
M src/include/access/tupdesc.h
M src/include/access/tupmacs.h
M src/include/access/tuptoaster.h
M src/include/access/twophase.h
M src/include/access/twophase_rmgr.h
M src/include/access/valid.h
M src/include/access/visibilitymap.h
M src/include/access/xact.h
M src/include/access/xlog.h
M src/include/access/xlog_fn.h
M src/include/access/xlog_internal.h
M src/include/access/xlogdefs.h
M src/include/access/xlogreader.h
M src/include/access/xlogutils.h
M src/include/bootstrap/bootstrap.h
M src/include/c.h
M src/include/catalog/binary_upgrade.h
M src/include/catalog/catalog.h
M src/include/catalog/catversion.h
M src/include/catalog/dependency.h
M src/include/catalog/genbki.h
M src/include/catalog/heap.h
M src/include/catalog/index.h
M src/include/catalog/indexing.h
M src/include/catalog/namespace.h
M src/include/catalog/objectaccess.h
M src/include/catalog/objectaddress.h
M src/include/catalog/pg_aggregate.h
M src/include/catalog/pg_am.h
M src/include/catalog/pg_amop.h
M src/include/catalog/pg_amproc.h
M src/include/catalog/pg_attrdef.h
M src/include/catalog/pg_attribute.h
M src/include/catalog/pg_auth_members.h
M src/include/catalog/pg_authid.h
M src/include/catalog/pg_cast.h
M src/include/catalog/pg_class.h
M src/include/catalog/pg_collation.h
M src/include/catalog/pg_collation_fn.h
M src/include/catalog/pg_constraint.h
M src/include/catalog/pg_control.h
M src/include/catalog/pg_conversion.h
M src/include/catalog/pg_conversion_fn.h
M src/include/catalog/pg_database.h
M src/include/catalog/pg_db_role_setting.h
M src/include/catalog/pg_default_acl.h
M src/include/catalog/pg_depend.h
M src/include/catalog/pg_description.h
M src/include/catalog/pg_enum.h
M src/include/catalog/pg_event_trigger.h
M src/include/catalog/pg_extension.h
M src/include/catalog/pg_foreign_data_wrapper.h
M src/include/catalog/pg_foreign_server.h
M src/include/catalog/pg_foreign_table.h
M src/include/catalog/pg_index.h
M src/include/catalog/pg_inherits.h
M src/include/catalog/pg_inherits_fn.h
M src/include/catalog/pg_language.h
M src/include/catalog/pg_largeobject.h
M src/include/catalog/pg_largeobject_metadata.h
M src/include/catalog/pg_namespace.h
M src/include/catalog/pg_opclass.h
M src/include/catalog/pg_operator.h
M src/include/catalog/pg_opfamily.h
M src/include/catalog/pg_pltemplate.h
M src/include/catalog/pg_proc.h
M src/include/catalog/pg_proc_fn.h
M src/include/catalog/pg_range.h
M src/include/catalog/pg_rewrite.h
M src/include/catalog/pg_seclabel.h
M src/include/catalog/pg_shdepend.h
M src/include/catalog/pg_shdescription.h
M src/include/catalog/pg_shseclabel.h
M src/include/catalog/pg_statistic.h
M src/include/catalog/pg_tablespace.h
M src/include/catalog/pg_trigger.h
M src/include/catalog/pg_ts_config.h
M src/include/catalog/pg_ts_config_map.h
M src/include/catalog/pg_ts_dict.h
M src/include/catalog/pg_ts_parser.h
M src/include/catalog/pg_ts_template.h
M src/include/catalog/pg_type.h
M src/include/catalog/pg_type_fn.h
M src/include/catalog/pg_user_mapping.h
M src/include/catalog/storage.h
M src/include/catalog/storage_xlog.h
M src/include/catalog/toasting.h
M src/include/commands/alter.h
M src/include/commands/async.h
M src/include/commands/cluster.h
M src/include/commands/collationcmds.h
M src/include/commands/comment.h
M src/include/commands/conversioncmds.h
M src/include/commands/copy.h
M src/include/commands/createas.h
M src/include/commands/dbcommands.h
M src/include/commands/defrem.h
M src/include/commands/discard.h
M src/include/commands/event_trigger.h
M src/include/commands/explain.h
M src/include/commands/extension.h
M src/include/commands/lockcmds.h
M src/include/commands/matview.h
M src/include/commands/portalcmds.h
M src/include/commands/prepare.h
M src/include/commands/schemacmds.h
M src/include/commands/seclabel.h
M src/include/commands/sequence.h
M src/include/commands/tablecmds.h
M src/include/commands/tablespace.h
M src/include/commands/trigger.h
M src/include/commands/typecmds.h
M src/include/commands/vacuum.h
M src/include/commands/variable.h
M src/include/commands/view.h
M src/include/common/fe_memutils.h
M src/include/common/relpath.h
M src/include/datatype/timestamp.h
M src/include/executor/execdebug.h
M src/include/executor/execdesc.h
M src/include/executor/executor.h
M src/include/executor/functions.h
M src/include/executor/hashjoin.h
M src/include/executor/instrument.h
M src/include/executor/nodeAgg.h
M src/include/executor/nodeAppend.h
M src/include/executor/nodeBitmapAnd.h
M src/include/executor/nodeBitmapHeapscan.h
M src/include/executor/nodeBitmapIndexscan.h
M src/include/executor/nodeBitmapOr.h
M src/include/executor/nodeCtescan.h
M src/include/executor/nodeForeignscan.h
M src/include/executor/nodeFunctionscan.h
M src/include/executor/nodeGroup.h
M src/include/executor/nodeHash.h
M src/include/executor/nodeHashjoin.h
M src/include/executor/nodeIndexonlyscan.h
M src/include/executor/nodeIndexscan.h
M src/include/executor/nodeLimit.h
M src/include/executor/nodeLockRows.h
M src/include/executor/nodeMaterial.h
M src/include/executor/nodeMergeAppend.h
M src/include/executor/nodeMergejoin.h
M src/include/executor/nodeModifyTable.h
M src/include/executor/nodeNestloop.h
M src/include/executor/nodeRecursiveunion.h
M src/include/executor/nodeResult.h
M src/include/executor/nodeSeqscan.h
M src/include/executor/nodeSetOp.h
M src/include/executor/nodeSort.h
M src/include/executor/nodeSubplan.h
M src/include/executor/nodeSubqueryscan.h
M src/include/executor/nodeTidscan.h
M src/include/executor/nodeUnique.h
M src/include/executor/nodeValuesscan.h
M src/include/executor/nodeWindowAgg.h
M src/include/executor/nodeWorktablescan.h
M src/include/executor/spi.h
M src/include/executor/spi_priv.h
M src/include/executor/tstoreReceiver.h
M src/include/executor/tuptable.h
M src/include/fmgr.h
M src/include/foreign/fdwapi.h
M src/include/foreign/foreign.h
M src/include/funcapi.h
M src/include/getaddrinfo.h
M src/include/getopt_long.h
M src/include/lib/binaryheap.h
M src/include/lib/ilist.h
M src/include/lib/stringinfo.h
M src/include/libpq/auth.h
M src/include/libpq/be-fsstubs.h
M src/include/libpq/crypt.h
M src/include/libpq/ip.h
M src/include/libpq/libpq-be.h
M src/include/libpq/libpq-fs.h
M src/include/libpq/libpq.h
M src/include/libpq/md5.h
M src/include/libpq/pqcomm.h
M src/include/libpq/pqformat.h
M src/include/libpq/pqsignal.h
M src/include/mb/pg_wchar.h
M src/include/miscadmin.h
M src/include/nodes/bitmapset.h
M src/include/nodes/execnodes.h
M src/include/nodes/makefuncs.h
M src/include/nodes/memnodes.h
M src/include/nodes/nodeFuncs.h
M src/include/nodes/nodes.h
M src/include/nodes/params.h
M src/include/nodes/parsenodes.h
M src/include/nodes/pg_list.h
M src/include/nodes/plannodes.h
M src/include/nodes/primnodes.h
M src/include/nodes/print.h
M src/include/nodes/readfuncs.h
M src/include/nodes/relation.h
M src/include/nodes/replnodes.h
M src/include/nodes/tidbitmap.h
M src/include/nodes/value.h
M src/include/optimizer/clauses.h
M src/include/optimizer/cost.h
M src/include/optimizer/geqo.h
M src/include/optimizer/geqo_copy.h
M src/include/optimizer/geqo_gene.h
M src/include/optimizer/geqo_misc.h
M src/include/optimizer/geqo_mutation.h
M src/include/optimizer/geqo_pool.h
M src/include/optimizer/geqo_random.h
M src/include/optimizer/geqo_recombination.h
M src/include/optimizer/geqo_selection.h
M src/include/optimizer/joininfo.h
M src/include/optimizer/orclauses.h
M src/include/optimizer/pathnode.h
M src/include/optimizer/paths.h
M src/include/optimizer/placeholder.h
M src/include/optimizer/plancat.h
M src/include/optimizer/planmain.h
M src/include/optimizer/planner.h
M src/include/optimizer/predtest.h
M src/include/optimizer/prep.h
M src/include/optimizer/restrictinfo.h
M src/include/optimizer/subselect.h
M src/include/optimizer/tlist.h
M src/include/optimizer/var.h
M src/include/parser/analyze.h
M src/include/parser/gramparse.h
M src/include/parser/keywords.h
M src/include/parser/kwlist.h
M src/include/parser/parse_agg.h
M src/include/parser/parse_clause.h
M src/include/parser/parse_coerce.h
M src/include/parser/parse_collate.h
M src/include/parser/parse_cte.h
M src/include/parser/parse_expr.h
M src/include/parser/parse_func.h
M src/include/parser/parse_node.h
M src/include/parser/parse_oper.h
M src/include/parser/parse_param.h
M src/include/parser/parse_relation.h
M src/include/parser/parse_target.h
M src/include/parser/parse_type.h
M src/include/parser/parse_utilcmd.h
M src/include/parser/parser.h
M src/include/parser/parsetree.h
M src/include/parser/scanner.h
M src/include/parser/scansup.h
M src/include/pg_config_manual.h
M src/include/pg_trace.h
M src/include/pgstat.h
M src/include/pgtar.h
M src/include/pgtime.h
M src/include/port.h
M src/include/portability/instr_time.h
M src/include/portability/mem.h
M src/include/postgres.h
M src/include/postgres_fe.h
M src/include/postmaster/autovacuum.h
M src/include/postmaster/bgworker.h
M src/include/postmaster/bgworker_internals.h
M src/include/postmaster/bgwriter.h
M src/include/postmaster/fork_process.h
M src/include/postmaster/pgarch.h
M src/include/postmaster/postmaster.h
M src/include/postmaster/startup.h
M src/include/postmaster/syslogger.h
M src/include/postmaster/walwriter.h
M src/include/regex/regexport.h
M src/include/replication/basebackup.h
M src/include/replication/syncrep.h
M src/include/replication/walreceiver.h
M src/include/replication/walsender.h
M src/include/replication/walsender_private.h
M src/include/rewrite/prs2lock.h
M src/include/rewrite/rewriteDefine.h
M src/include/rewrite/rewriteHandler.h
M src/include/rewrite/rewriteManip.h
M src/include/rewrite/rewriteRemove.h
M src/include/rewrite/rewriteSupport.h
M src/include/rusagestub.h
M src/include/snowball/header.h
M src/include/storage/backendid.h
M src/include/storage/barrier.h
M src/include/storage/block.h
M src/include/storage/buf.h
M src/include/storage/buf_internals.h
M src/include/storage/buffile.h
M src/include/storage/bufmgr.h
M src/include/storage/bufpage.h
M src/include/storage/checksum.h
M src/include/storage/checksum_impl.h
M src/include/storage/copydir.h
M src/include/storage/dsm.h
M src/include/storage/dsm_impl.h
M src/include/storage/fd.h
M src/include/storage/freespace.h
M src/include/storage/fsm_internals.h
M src/include/storage/indexfsm.h
M src/include/storage/ipc.h
M src/include/storage/item.h
M src/include/storage/itemid.h
M src/include/storage/itemptr.h
M src/include/storage/large_object.h
M src/include/storage/latch.h
M src/include/storage/lmgr.h
M src/include/storage/lock.h
M src/include/storage/lwlock.h
M src/include/storage/off.h
M src/include/storage/pg_sema.h
M src/include/storage/pg_shmem.h
M src/include/storage/pmsignal.h
M src/include/storage/pos.h
M src/include/storage/predicate.h
M src/include/storage/predicate_internals.h
M src/include/storage/proc.h
M src/include/storage/procarray.h
M src/include/storage/procsignal.h
M src/include/storage/reinit.h
M src/include/storage/relfilenode.h
M src/include/storage/s_lock.h
M src/include/storage/shmem.h
M src/include/storage/sinval.h
M src/include/storage/sinvaladt.h
M src/include/storage/smgr.h
M src/include/storage/spin.h
M src/include/storage/standby.h
M src/include/tcop/dest.h
M src/include/tcop/fastpath.h
M src/include/tcop/pquery.h
M src/include/tcop/tcopdebug.h
M src/include/tcop/tcopprot.h
M src/include/tcop/utility.h
M src/include/tsearch/dicts/regis.h
M src/include/tsearch/dicts/spell.h
M src/include/tsearch/ts_cache.h
M src/include/tsearch/ts_locale.h
M src/include/tsearch/ts_public.h
M src/include/tsearch/ts_type.h
M src/include/tsearch/ts_utils.h
M src/include/utils/acl.h
M src/include/utils/array.h
M src/include/utils/ascii.h
M src/include/utils/attoptcache.h
M src/include/utils/builtins.h
M src/include/utils/bytea.h
M src/include/utils/catcache.h
M src/include/utils/combocid.h
M src/include/utils/date.h
M src/include/utils/datetime.h
M src/include/utils/datum.h
M src/include/utils/dynahash.h
M src/include/utils/dynamic_loader.h
M src/include/utils/elog.h
M src/include/utils/evtcache.h
M src/include/utils/fmgrtab.h
M src/include/utils/formatting.h
M src/include/utils/geo_decls.h
M src/include/utils/guc.h
M src/include/utils/guc_tables.h
M src/include/utils/help_config.h
M src/include/utils/hsearch.h
M src/include/utils/inet.h
M src/include/utils/int8.h
M src/include/utils/inval.h
M src/include/utils/json.h
M src/include/utils/jsonapi.h
M src/include/utils/logtape.h
M src/include/utils/lsyscache.h
M src/include/utils/memdebug.h
M src/include/utils/memutils.h
M src/include/utils/nabstime.h
M src/include/utils/numeric.h
M src/include/utils/palloc.h
M src/include/utils/pg_crc.h
M src/include/utils/pg_crc_tables.h
M src/include/utils/pg_locale.h
M src/include/utils/pg_rusage.h
M src/include/utils/plancache.h
M src/include/utils/portal.h
M src/include/utils/rangetypes.h
M src/include/utils/rbtree.h
M src/include/utils/rel.h
M src/include/utils/relcache.h
M src/include/utils/relfilenodemap.h
M src/include/utils/relmapper.h
M src/include/utils/reltrigger.h
M src/include/utils/resowner.h
M src/include/utils/resowner_private.h
M src/include/utils/selfuncs.h
M src/include/utils/snapmgr.h
M src/include/utils/snapshot.h
M src/include/utils/sortsupport.h
M src/include/utils/spccache.h
M src/include/utils/syscache.h
M src/include/utils/timeout.h
M src/include/utils/timestamp.h
M src/include/utils/tqual.h
M src/include/utils/tuplesort.h
M src/include/utils/tuplestore.h
M src/include/utils/typcache.h
M src/include/utils/tzparser.h
M src/include/utils/uuid.h
M src/include/utils/varbit.h
M src/include/utils/xml.h
M src/include/windowapi.h
M src/interfaces/ecpg/compatlib/Makefile
M src/interfaces/ecpg/ecpglib/Makefile
M src/interfaces/ecpg/ecpglib/pg_type.h
M src/interfaces/ecpg/pgtypeslib/Makefile
M src/interfaces/ecpg/preproc/Makefile
M src/interfaces/ecpg/preproc/check_rules.pl
M src/interfaces/ecpg/preproc/ecpg.c
M src/interfaces/ecpg/preproc/keywords.c
M src/interfaces/ecpg/preproc/parse.pl
M src/interfaces/ecpg/preproc/parser.c
M src/interfaces/ecpg/preproc/pgc.l
M src/interfaces/ecpg/test/pg_regress_ecpg.c
M src/interfaces/libpq/Makefile
M src/interfaces/libpq/fe-auth.c
M src/interfaces/libpq/fe-auth.h
M src/interfaces/libpq/fe-connect.c
M src/interfaces/libpq/fe-exec.c
M src/interfaces/libpq/fe-lobj.c
M src/interfaces/libpq/fe-misc.c
M src/interfaces/libpq/fe-print.c
M src/interfaces/libpq/fe-protocol2.c
M src/interfaces/libpq/fe-protocol3.c
M src/interfaces/libpq/fe-secure.c
M src/interfaces/libpq/libpq-events.c
M src/interfaces/libpq/libpq-events.h
M src/interfaces/libpq/libpq-fe.h
M src/interfaces/libpq/libpq-int.h
M src/interfaces/libpq/libpq.rc.in
M src/interfaces/libpq/pqexpbuffer.c
M src/interfaces/libpq/pqexpbuffer.h
M src/interfaces/libpq/pthread-win32.c
M src/interfaces/libpq/test/uri-regress.c
M src/interfaces/libpq/win32.c
M src/pl/plperl/plperl.h
M src/pl/plpgsql/src/generate-plerrcodes.pl
M src/pl/plpgsql/src/pl_comp.c
M src/pl/plpgsql/src/pl_exec.c
M src/pl/plpgsql/src/pl_funcs.c
M src/pl/plpgsql/src/pl_gram.y
M src/pl/plpgsql/src/pl_handler.c
M src/pl/plpgsql/src/pl_scanner.c
M src/pl/plpgsql/src/plpgsql.h
M src/pl/plpython/generate-spiexceptions.pl
M src/pl/plpython/plpython.h
M src/port/chklocale.c
M src/port/dirent.c
M src/port/dirmod.c
M src/port/fls.c
M src/port/fseeko.c
M src/port/getaddrinfo.c
M src/port/gethostname.c
M src/port/getpeereid.c
M src/port/getrusage.c
M src/port/isinf.c
M src/port/kill.c
M src/port/noblock.c
M src/port/open.c
M src/port/path.c
M src/port/pg_crc.c
M src/port/pgcheckdir.c
M src/port/pgsleep.c
M src/port/pgstrcasecmp.c
M src/port/pqsignal.c
M src/port/quotes.c
M src/port/random.c
M src/port/sprompt.c
M src/port/srandom.c
M src/port/strlcpy.c
M src/port/thread.c
M src/port/unsetenv.c
M src/port/username.c
M src/port/win32env.c
M src/port/win32error.c
M src/port/win32setlocale.c
M src/port/win32ver.rc
M src/test/examples/testlo.c
M src/test/examples/testlo64.c
M src/test/isolation/isolation_main.c
M src/test/isolation/isolationtester.h
M src/test/isolation/specparse.y
M src/test/isolation/specscanner.l
M src/test/regress/GNUmakefile
M src/test/regress/pg_regress.c
M src/test/regress/pg_regress.h
M src/test/regress/pg_regress_main.c
M src/test/thread/Makefile
M src/test/thread/thread_test.c
M src/timezone/pgtz.c
M src/timezone/pgtz.h
M src/tools/check_bison_recursion.pl
M src/tools/copyright.pl
M src/tools/findoidjoins/Makefile
M src/tools/findoidjoins/findoidjoins.c
M src/tools/ifaddrs/Makefile
M src/tools/version_stamp.pl
M src/tools/win32tzlist.pl
M src/tutorial/complex.source
M src/tutorial/syscat.source

Fix LATERAL references to target table of UPDATE/DELETE.

commit   : 0c051c90082da0b7e5bcaf9aabcbd4f361137cdc    
  
author   : Tom Lane <[email protected]>    
date     : Tue, 7 Jan 2014 15:25:16 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Tue, 7 Jan 2014 15:25:16 -0500    

Click here for diff

I failed to think much about UPDATE/DELETE when implementing LATERAL :-(.  
The implemented behavior ended up being that subqueries in the FROM or  
USING clause (respectively) could access the update/delete target table as  
though it were a lateral reference; which seems fine if they said LATERAL,  
but certainly ought to draw an error if they didn't.  Fix it so you get a  
suitable error when you omit LATERAL.  Per report from Emre Hasegeli.  

M src/backend/parser/analyze.c
M src/backend/parser/parse_clause.c
M src/backend/parser/parse_relation.c
M src/test/regress/expected/join.out
M src/test/regress/sql/join.sql

Silence compiler warning on MSVC.

commit   : f68220df92cb56f0452919f51eeef16262ec8f3b    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Tue, 7 Jan 2014 21:47:54 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Tue, 7 Jan 2014 21:47:54 +0200    

Click here for diff

MSVC doesn't know that elog(ERROR) doesn't return, and gives a warning about  
missing return. Silence that.  
  
Amit Kapila  

M src/backend/utils/cache/relcache.c

Move permissions check from do_pg_start_backup to pg_start_backup

commit   : 9544cc0d657ea09d27667c8c70302b06fbe0121b    
  
author   : Magnus Hagander <[email protected]>    
date     : Tue, 7 Jan 2014 17:47:52 +0100    
  
committer: Magnus Hagander <[email protected]>    
date     : Tue, 7 Jan 2014 17:47:52 +0100    

Click here for diff

And the same for do_pg_stop_backup. The code in do_pg_* is not allowed  
to access the catalogs. For manual base backups, the permissions  
check can be handled in the calling function, and for streaming  
base backups only users with the required permissions can get past  
the authentication step in the first place.  
  
Reported by Antonin Houska, diagnosed by Andres Freund  

M src/backend/access/transam/xlog.c
M src/backend/access/transam/xlogfuncs.c

Avoid including tablespaces inside PGDATA twice in base backups

commit   : b168c5ef2730d0ecaa7462f0b90345b0a3798c16    
  
author   : Magnus Hagander <[email protected]>    
date     : Tue, 7 Jan 2014 17:04:40 +0100    
  
committer: Magnus Hagander <[email protected]>    
date     : Tue, 7 Jan 2014 17:04:40 +0100    

Click here for diff

If a tablespace was crated inside PGDATA it was backed up both as part  
of the PGDATA backup and as the backup of the tablespace. Avoid this  
by skipping any directory inside PGDATA that contains one of the active  
tablespaces.  
  
Dimitri Fontaine and Magnus Hagander  

M src/backend/replication/basebackup.c

Add more use of psprintf()

commit   : edc43458d797a5956f4bf39af18cf62abb0077db    
  
author   : Peter Eisentraut <[email protected]>    
date     : Mon, 6 Jan 2014 21:30:26 -0500    
  
committer: Peter Eisentraut <[email protected]>    
date     : Mon, 6 Jan 2014 21:30:26 -0500    

Click here for diff

M contrib/dblink/dblink.c
M contrib/hstore/hstore_io.c
M contrib/pageinspect/btreefuncs.c
M contrib/pgstattuple/pgstatindex.c
M doc/src/sgml/xtypes.sgml
M src/backend/access/transam/multixact.c
M src/backend/commands/define.c
M src/backend/optimizer/plan/subselect.c
M src/backend/parser/parse_type.c
M src/backend/storage/smgr/md.c
M src/backend/utils/adt/date.c
M src/backend/utils/adt/timestamp.c
M src/backend/utils/fmgr/funcapi.c
M src/test/regress/regress.c
M src/tutorial/complex.c

Remove bogus -K option from pg_dump.

commit   : 10a82cda67731941c18256e009edad4a784a2994    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Mon, 6 Jan 2014 12:30:19 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Mon, 6 Jan 2014 12:30:19 +0200    

Click here for diff

I added it to the getopt call by accident in commit  
691e595dd9c7786d37d73ccd327f8c2b6f0dace6.  
  
Amit Kapila  

M src/bin/pg_dump/pg_dump.c

Cache catalog lookup data across groups in ordered-set aggregates.

commit   : 8b49a6044d06b557047210dba2735081bb037e96    
  
author   : Tom Lane <[email protected]>    
date     : Sun, 5 Jan 2014 12:28:39 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Sun, 5 Jan 2014 12:28:39 -0500    

Click here for diff

The initial commit of ordered-set aggregates just did all the setup work  
afresh each time the aggregate function is started up.  But in a GROUP BY  
query, the catalog lookups need not be repeated for each group, since the  
column datatypes and sort information won't change.  When there are many  
small groups, this makes for a useful, though not huge, performance  
improvement.  Per suggestion from Andrew Gierth.  
  
Profiling of these cases suggests that it might be profitable to avoid  
duplicate lookups within tuplesort startup as well; but changing the  
tuplesort APIs would have much broader impact, so I left that for  
another day.  

M src/backend/utils/adt/orderedsetaggs.c
M src/include/catalog/pg_operator.h

Fix translatability markings in psql, and add defenses against future bugs.

commit   : 92459e7a7f87f91fc3012bea9eef870cf464d91f    
  
author   : Tom Lane <[email protected]>    
date     : Sat, 4 Jan 2014 16:05:16 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Sat, 4 Jan 2014 16:05:16 -0500    

Click here for diff

Several previous commits have added columns to various \d queries without  
updating their translate_columns[] arrays, leading to potentially incorrect  
translations in NLS-enabled builds.  Offenders include commit 893686762  
(added prosecdef to \df+), c9ac00e6e (added description to \dc+) and  
3b17efdfd (added description to \dC+).  Fix those cases back to 9.3 or  
9.2 as appropriate.  
  
Since this is evidently more easily missed than one would like, in HEAD  
also add an Assert that the supplied array is long enough.  This requires  
an API change for printQuery(), so it seems inappropriate for back  
branches, but presumably all future changes will be tested in HEAD anyway.  
  
In HEAD and 9.3, also clean up a whole lot of sloppiness in the emitted  
SQL for \dy (event triggers): lack of translatability due to failing to  
pass words-to-be-translated through gettext_noop(), inadequate schema  
qualification, and sloppy formatting resulting in unnecessarily ugly  
-E output.  
  
Peter Eisentraut and Tom Lane, per bug #8702 from Sergey Burladyan  

M src/bin/psql/describe.c
M src/bin/psql/print.c
M src/bin/psql/print.h
M src/bin/scripts/createlang.c
M src/bin/scripts/droplang.c

Fix header comment for bitncmp().

commit   : 5858cf8ab2c7a186fab050725992d6ef640e38a5    
  
author   : Tom Lane <[email protected]>    
date     : Sat, 4 Jan 2014 14:01:51 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Sat, 4 Jan 2014 14:01:51 -0500    

Click here for diff

The result is an int less than, equal to, or greater than zero, in the  
style of memcmp (and, in fact, exactly the output of memcmp in some cases).  
This comment previously said -1, 1, or 0, which was an overspecification,  
as noted by Emre Hasegeli.  All of the existing callers appear to be fine  
with the actual behavior, so just fix the comment.  
  
In passing, improve infelicitous formatting of some call sites.  

M src/backend/utils/adt/network.c

Fix typo in comment.

commit   : 9929975666904bcad6df5cb8fe73451fd4910621    
  
author   : Tom Lane <[email protected]>    
date     : Sat, 4 Jan 2014 13:48:50 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Sat, 4 Jan 2014 13:48:50 -0500    

Click here for diff

classifyClauses was renamed to classifyConditions somewhere along the  
line, but this comment didn't get the memo.  
  
Ian Barwick  

M contrib/postgres_fdw/postgres_fdw.c

Restore some comments lost during 15732b34e8c8

commit   : 1a3e82a7f94e63979032ee84b2f8b0c93d441fbd    
  
author   : Alvaro Herrera <[email protected]>    
date     : Fri, 3 Jan 2014 13:22:03 -0300    
  
committer: Alvaro Herrera <[email protected]>    
date     : Fri, 3 Jan 2014 13:22:03 -0300    

Click here for diff

Michael Paquier  

M src/backend/catalog/index.c
M src/backend/commands/indexcmds.c

Ooops, should use double not single quotes in StaticAssertStmt().

commit   : a3b4aeecfe9870fd5895cf362cd1e92544ec885a    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 2 Jan 2014 21:54:20 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 2 Jan 2014 21:54:20 -0500    

Click here for diff

That's what I get for testing this on an older compiler.  

M src/backend/postmaster/pgstat.c

Fix calculation of maximum statistics-message size.

commit   : a7ef273e1cebb913cd4a524fcf3b42caa41bd431    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 2 Jan 2014 21:45:47 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 2 Jan 2014 21:45:47 -0500    

Click here for diff

The PGSTAT_NUM_TABENTRIES macro should have been updated when new fields  
were added to struct PgStat_MsgTabstat in commit 644828908, but it wasn't.  
Fix that.  
  
Also, add a static assertion that we didn't overrun the intended size limit  
on stats messages.  This will not necessarily catch every mistake in  
computing the maximum array size for stats messages, but it will catch ones  
that have practical consequences.  (The assertion in fact doesn't complain  
about the aforementioned error in PGSTAT_NUM_TABENTRIES, because that was  
not big enough to cause the array length to increase.)  
  
No back-patch, as there's no actual bug in existing releases; this is just  
in the nature of future-proofing.  
  
Mark Dilger and Tom Lane  

M src/backend/postmaster/pgstat.c
M src/include/pgstat.h

Handle 5-char filenames in SlruScanDirectory

commit   : 638cf09e76d70dd83d8123e7079be6c0532102d2    
  
author   : Alvaro Herrera <[email protected]>    
date     : Thu, 2 Jan 2014 18:17:29 -0300    
  
committer: Alvaro Herrera <[email protected]>    
date     : Thu, 2 Jan 2014 18:17:29 -0300    

Click here for diff

Original users of slru.c were all producing 4-digit filenames, so that  
was all that that code was prepared to handle.  Changes to multixact.c  
in the course of commit 0ac5ad5134f made pg_multixact/members create  
5-digit filenames once a certain threshold was reached, which  
SlruScanDirectory wasn't prepared to deal with; in particular,  
5-digit-name files were not removed during truncation.  Change that  
routine to make it aware of those files, and have it process them just  
like any others.  
  
Right now, some pg_multixact/members directories will contain a mixture  
of 4-char and 5-char filenames.  A future commit is expected fix things  
so that each slru.c user declares the correct maximum width for the  
files it produces, to avoid such unsightly mixtures.  
  
Noticed while investigating bug #8673 reported by Serge Negodyuck.  

M src/backend/access/transam/slru.c

Wrap multixact/members correctly during extension

commit   : a50d97625497b76e3dc7c4aa22cd2c70317ec54d    
  
author   : Alvaro Herrera <[email protected]>    
date     : Thu, 2 Jan 2014 18:17:07 -0300    
  
committer: Alvaro Herrera <[email protected]>    
date     : Thu, 2 Jan 2014 18:17:07 -0300    

Click here for diff

In the 9.2 code for extending multixact/members, the logic was very  
simple because the number of entries in a members page was a proper  
divisor of 2^32, and thus at 2^32 wraparound the logic for page switch  
was identical than at any other page boundary.  In commit 0ac5ad5134f I  
failed to realize this and introduced code that was not able to go over  
the 2^32 boundary.  Fix that by ensuring that when we reach the last  
page of the last segment we correctly zero the initial page of the  
initial segment, using correct uint32-wraparound-safe arithmetic.  
  
Noticed while investigating bug #8673 reported by Serge Negodyuck, as  
diagnosed by Andres Freund.  

M src/backend/access/transam/multixact.c

Handle wraparound during truncation in multixact/members

commit   : 722acf51a0d074d19782ad7e97ebe3fdb63fbb87    
  
author   : Alvaro Herrera <[email protected]>    
date     : Thu, 2 Jan 2014 18:16:54 -0300    
  
committer: Alvaro Herrera <[email protected]>    
date     : Thu, 2 Jan 2014 18:16:54 -0300    

Click here for diff

In pg_multixact/members, relying on modulo-2^32 arithmetic for  
wraparound handling doesn't work all that well.  Because we don't  
explicitely track wraparound of the allocation counter for members, it  
is possible that the "live" area exceeds 2^31 entries; trying to remove  
SLRU segments that are "old" according to the original logic might lead  
to removal of segments still in use.  To fix, have the truncation  
routine use a tailored SlruScanDirectory callback that keeps track of  
the live area in actual use; that way, when the live range exceeds 2^31  
entries, the oldest segments still live will not get removed untimely.  
  
This new SlruScanDir callback needs to take care not to remove segments  
that are "in the future": if new SLRU segments appear while the  
truncation is ongoing, make sure we don't remove them.  This requires  
examination of shared memory state to recheck for false positives, but  
testing suggests that this doesn't cause a problem.  The original coding  
didn't suffer from this pitfall because segments created when truncation  
is running are never considered to be removable.  
  
Per Andres Freund's investigation of bug #8673 reported by Serge  
Negodyuck.  

M src/backend/access/transam/multixact.c
M src/backend/access/transam/slru.c
M src/include/access/slru.h

Aggressively freeze tables when CLUSTER or VACUUM FULL rewrites them.

commit   : 3cff1879f8d03cb729368722ca823a4bf74c0cac    
  
author   : Robert Haas <[email protected]>    
date     : Thu, 2 Jan 2014 15:09:21 -0500    
  
committer: Robert Haas <[email protected]>    
date     : Thu, 2 Jan 2014 15:09:21 -0500    

Click here for diff

We haven't wanted to do this in the past on the grounds that in rare  
cases the original xmin value will be needed for forensic purposes, but  
commit 37484ad2aacef5ec794f4dd3d5cf814475180a78 removes that objection,  
so now we can.  
  
Per extensive discussion, among many people, on pgsql-hackers.  

M doc/src/sgml/ref/vacuum.sgml
M src/backend/access/heap/rewriteheap.c
M src/backend/commands/cluster.c
M src/backend/commands/vacuum.c
M src/include/commands/cluster.h

Fix contrib/pg_upgrade to clean all the cruft made during "make check".

commit   : 4cf81b737d5bb5f695671479c427c78f95c82119    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 2 Jan 2014 14:20:28 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 2 Jan 2014 14:20:28 -0500    

Click here for diff

Although these files get cleaned up if the test runs to completion,  
a failure partway through leaves trash all over the floor.  The Makefile  
ought to be bright enough to get rid of it when you say "make clean".  

M contrib/pg_upgrade/Makefile

Rename walLogHints to wal_log_hints for easier grepping.

commit   : 4b351841fa0b90cb72f5f63c56f06e4511850ac4    
  
author   : Robert Haas <[email protected]>    
date     : Wed, 1 Jan 2014 20:17:00 -0500    
  
committer: Robert Haas <[email protected]>    
date     : Wed, 1 Jan 2014 20:17:00 -0500    

Click here for diff

Michael Paquier  

M src/backend/access/transam/xlog.c
M src/backend/utils/misc/guc.c
M src/include/access/xlog.h

Do not use an empty hostname.

commit   : 7c957ec83eeefa8b6d3179f3af0a5dc338d2252b    
  
author   : Michael Meskes <[email protected]>    
date     : Wed, 1 Jan 2014 12:24:19 +0100    
  
committer: Michael Meskes <[email protected]>    
date     : Wed, 1 Jan 2014 12:24:19 +0100    

Click here for diff

When trying to connect to a given database libecpg should not try using an  
empty hostname if no hostname was given.  

M src/interfaces/ecpg/ecpglib/connect.c

Fix broken support for event triggers as extension members.

commit   : c01bc51f8d596d425d897c833ef11ca3670ea984    
  
author   : Tom Lane <[email protected]>    
date     : Mon, 30 Dec 2013 14:00:02 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Mon, 30 Dec 2013 14:00:02 -0500    

Click here for diff

CREATE EVENT TRIGGER forgot to mark the event trigger as a member of its  
extension, and pg_dump didn't pay any attention anyway when deciding  
whether to dump the event trigger.  Per report from Moshe Jacobson.  
  
Given the obvious lack of testing here, it's rather astonishing that  
ALTER EXTENSION ADD/DROP EVENT TRIGGER work, but they seem to.  

M src/backend/commands/event_trigger.c
M src/bin/pg_dump/pg_dump.c

Fix alphabetization in catalogs.sgml.

commit   : d7ee4311afb14118d340024ac9e4dd5d2a9d6966    
  
author   : Tom Lane <[email protected]>    
date     : Mon, 30 Dec 2013 13:27:51 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Mon, 30 Dec 2013 13:27:51 -0500    

Click here for diff

Some recent patches seem not to have grasped the concept that the catalogs  
are described in alphabetical order.  

M doc/src/sgml/catalogs.sgml

Remove dead code now that orindxpath.c is history.

commit   : f7fbf4b0be509d964041ee13311b9203a035e4ab    
  
author   : Tom Lane <[email protected]>    
date     : Mon, 30 Dec 2013 12:50:31 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Mon, 30 Dec 2013 12:50:31 -0500    

Click here for diff

We don't need make_restrictinfo_from_bitmapqual() anymore at all.  
generate_bitmap_or_paths() doesn't need to be exported, and we can  
drop its rather klugy restriction_only flag.  

M src/backend/optimizer/path/indxpath.c
M src/backend/optimizer/plan/createplan.c
M src/backend/optimizer/util/restrictinfo.c
M src/include/optimizer/paths.h
M src/include/optimizer/restrictinfo.h

Extract restriction OR clauses whether or not they are indexable.

commit   : f343a880d5555faf1dad0286c5632047c8f599ad    
  
author   : Tom Lane <[email protected]>    
date     : Mon, 30 Dec 2013 12:24:37 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Mon, 30 Dec 2013 12:24:37 -0500    

Click here for diff

It's possible to extract a restriction OR clause from a join clause that  
has the form of an OR-of-ANDs, if each sub-AND includes a clause that  
mentions only one specific relation.  While PG has been aware of that idea  
for many years, the code previously only did it if it could extract an  
indexable OR clause.  On reflection, though, that seems a silly limitation:  
adding a restriction clause can be a win by reducing the number of rows  
that have to be filtered at the join step, even if we have to test the  
clause as a plain filter clause during the scan.  This should be especially  
useful for foreign tables, where the change can cut the number of rows that  
have to be retrieved from the foreign server; but testing shows it can win  
even on local tables.  Per a suggestion from Robert Haas.  
  
As a heuristic, I made the code accept an extracted restriction clause  
if its estimated selectivity is less than 0.9, which will probably result  
in accepting extracted clauses just about always.  We might need to tweak  
that later based on experience.  
  
Since the code no longer has even a weak connection to Path creation,  
remove orindxpath.c and create a new file optimizer/util/orclauses.c.  
  
There's some additional janitorial cleanup of now-dead code that needs  
to happen, but it seems like that's a fit subject for a separate commit.  

M src/backend/optimizer/path/Makefile
M src/backend/optimizer/path/allpaths.c
M src/backend/optimizer/path/indxpath.c
D src/backend/optimizer/path/orindxpath.c
M src/backend/optimizer/plan/planmain.c
M src/backend/optimizer/util/Makefile
A src/backend/optimizer/util/orclauses.c
A src/include/optimizer/orclauses.h
M src/include/optimizer/paths.h
M src/test/regress/expected/join.out
M src/test/regress/sql/join.sql

Don't attempt to limit target database for pg_restore.

commit   : 47f50262e7ce5ba37940d8a94198b7a7f4892c0e    
  
author   : Kevin Grittner <[email protected]>    
date     : Sun, 29 Dec 2013 15:17:52 -0600    
  
committer: Kevin Grittner <[email protected]>    
date     : Sun, 29 Dec 2013 15:17:52 -0600    

Click here for diff

There was an apparent attempt to limit the target database for  
pg_restore to version 7.1.0 or later.  Due to a leading zero this  
was interpreted as an octal number, which allowed targets with  
version numbers down to 2.87.36.  The lowest actual release above  
that was 6.0.0, so that was effectively the limit.  
  
Since the success of the restore attempt will depend primarily on  
on what statements were generated by the dump run, we don't want  
pg_restore trying to guess whether a given target should be allowed  
based on version number.  Allow a connection to any version.  Since  
it is very unlikely that anyone would be using a recent version of  
pg_restore to restore to a pre-6.0 database, this has little to no  
practical impact, but it makes the code less confusing to read.  
  
Issue reported and initial patch suggestion from Joel Jacobson  
based on an article by Andrey Karpov reporting on issues found by  
PVS-Studio static code analyzer.  Final patch based on analysis by  
Tom Lane.  Back-patch to all supported branches.  

M src/bin/pg_dump/pg_backup_archiver.c

Undo autoconf 2.69's attempt to #define _DARWIN_USE_64_BIT_INODE.

commit   : ed011d9754fd4b76eac0eaa8c057fcfc0c302a6a    
  
author   : Tom Lane <[email protected]>    
date     : Sun, 29 Dec 2013 12:57:45 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Sun, 29 Dec 2013 12:57:45 -0500    

Click here for diff

Defining this symbol causes OS X 10.5 to use a buggy version of readdir(),  
which can sometimes fail with EINVAL if the previously-fetched directory  
entry has been deleted or renamed.  In later OS X versions that bug has  
been repaired, but we still don't need the #define because it's on by  
default.  So this is just an all-around bad idea, and we can do without it.  

M configure
M configure.in
M src/include/pg_config.h.in

Update grammar

commit   : 71812a98cb8cfbcf9c3376e0c93fcb4c8e373a54    
  
author   : Peter Eisentraut <[email protected]>    
date     : Sat, 28 Dec 2013 20:54:23 -0500    
  
committer: Peter Eisentraut <[email protected]>    
date     : Sat, 28 Dec 2013 20:54:23 -0500    

Click here for diff

From: Etsuro Fujita <[email protected]>  

M src/backend/utils/mmgr/README

Fix whitespace

commit   : b986270bd4bec964d239cd73f7aaf5131a6996fa    
  
author   : Peter Eisentraut <[email protected]>    
date     : Fri, 27 Dec 2013 19:51:49 -0500    
  
committer: Peter Eisentraut <[email protected]>    
date     : Fri, 27 Dec 2013 19:51:49 -0500    

Click here for diff

M src/port/username.c

Properly detect invalid JSON numbers when generating JSON.

commit   : 29dcf7ded5ef8533376689a85c5b242fc7ace01d    
  
author   : Andrew Dunstan <[email protected]>    
date     : Fri, 27 Dec 2013 17:04:00 -0500    
  
committer: Andrew Dunstan <[email protected]>    
date     : Fri, 27 Dec 2013 17:04:00 -0500    

Click here for diff

Instead of looking for characters that aren't valid in JSON numbers, we  
simply pass the output string through the JSON number parser, and if it  
fails the string is quoted. This means among other things that money and  
domains over money will be quoted correctly and generate valid JSON.  
  
Fixes bug #8676 reported by Anderson Cristian da Silva.  
  
Backpatched to 9.2 where JSON generation was introduced.  

M src/backend/utils/adt/json.c

Fix misplaced right paren bugs in pgstatfuncs.c.

commit   : a133bf7031ad5b62281b21dbd6b2097d3d400f0d    
  
author   : Kevin Grittner <[email protected]>    
date     : Fri, 27 Dec 2013 15:26:24 -0600    
  
committer: Kevin Grittner <[email protected]>    
date     : Fri, 27 Dec 2013 15:26:24 -0600    

Click here for diff

The bug would only show up if the C sockaddr structure contained  
zero in the first byte for a valid address; otherwise it would  
fail to fail, which is probably why it went unnoticed for so long.  
  
Patch submitted by Joel Jacobson after seeing an article by Andrey  
Karpov in which he reports finding this through static code  
analysis using PVS-Studio.  While I was at it I moved a definition  
of a local variable referenced in the buggy code to a more local  
context.  
  
Backpatch to all supported branches.  

M src/backend/utils/adt/pgstatfuncs.c

Fix whitespace

commit   : a09e3fd77661e22f5000098e7b0bfcc6751d7c18    
  
author   : Peter Eisentraut <[email protected]>    
date     : Thu, 26 Dec 2013 23:51:56 -0500    
  
committer: Peter Eisentraut <[email protected]>    
date     : Thu, 26 Dec 2013 23:51:56 -0500    

Click here for diff

M src/include/catalog/binary_upgrade.h
M src/port/username.c

Fix inadequately-tested code path in tuplesort_skiptuples().

commit   : 1def747db68b234b54b784c74dfbe329f5478b79    
  
author   : Tom Lane <[email protected]>    
date     : Tue, 24 Dec 2013 17:13:02 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Tue, 24 Dec 2013 17:13:02 -0500    

Click here for diff

Per report from Jeff Davis.  

M src/backend/utils/sort/tuplesort.c

Fix ANALYZE failure on a column that's a domain over a range.

commit   : 4eeda92d86250b702ee6f88fcad2340e5e7d8747    
  
author   : Tom Lane <[email protected]>    
date     : Mon, 23 Dec 2013 22:18:12 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Mon, 23 Dec 2013 22:18:12 -0500    

Click here for diff

Most other range operations seem to work all right on domains,  
but this one not so much, at least not since commit 918eee0c.  
Per bug #8684 from Brett Neumeier.  

M src/backend/utils/adt/rangetypes_typanalyze.c

Revise documentation for new freezing method.

commit   : d43760b624b7cebc35e5f9c60d2e1439cbe9b220    
  
author   : Robert Haas <[email protected]>    
date     : Mon, 23 Dec 2013 20:32:29 -0500    
  
committer: Robert Haas <[email protected]>    
date     : Mon, 23 Dec 2013 20:32:29 -0500    

Click here for diff

Commit 37484ad2aacef5ec794f4dd3d5cf814475180a78 invalidated a good  
chunk of documentation, so patch it up to reflect the new state of  
play.  Along the way, patch remaining documentation references to  
FrozenXID to say instead FrozenTransactionId, so that they match the  
way we actually spell it in the code.  

M doc/src/sgml/config.sgml
M doc/src/sgml/maintenance.sgml
M src/backend/access/common/reloptions.c

Fix portability issue in ordered-set patch.

commit   : cf63c641cae2063a0442d73d49af295301cec61b    
  
author   : Tom Lane <[email protected]>    
date     : Mon, 23 Dec 2013 20:24:07 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Mon, 23 Dec 2013 20:24:07 -0500    

Click here for diff

Overly compact coding in makeOrderedSetArgs() led to a platform dependency:  
if the compiler chose to execute the subexpressions in the wrong order,  
list_length() might get applied to an already-modified List, giving a  
value we didn't want.  Per buildfarm.  

M src/backend/parser/gram.y

Support ordered-set (WITHIN GROUP) aggregates.

commit   : 8d65da1f01c6a4c84fe9c59aeb6b7e3adf870145    
  
author   : Tom Lane <[email protected]>    
date     : Mon, 23 Dec 2013 16:11:35 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Mon, 23 Dec 2013 16:11:35 -0500    

Click here for diff

This patch introduces generic support for ordered-set and hypothetical-set  
aggregate functions, as well as implementations of the instances defined in  
SQL:2008 (percentile_cont(), percentile_disc(), rank(), dense_rank(),  
percent_rank(), cume_dist()).  We also added mode() though it is not in the  
spec, as well as versions of percentile_cont() and percentile_disc() that  
can compute multiple percentile values in one pass over the data.  
  
Unlike the original submission, this patch puts full control of the sorting  
process in the hands of the aggregate's support functions.  To allow the  
support functions to find out how they're supposed to sort, a new API  
function AggGetAggref() is added to nodeAgg.c.  This allows retrieval of  
the aggregate call's Aggref node, which may have other uses beyond the  
immediate need.  There is also support for ordered-set aggregates to  
install cleanup callback functions, so that they can be sure that  
infrastructure such as tuplesort objects gets cleaned up.  
  
In passing, make some fixes in the recently-added support for variadic  
aggregates, and make some editorial adjustments in the recent FILTER  
additions for aggregates.  Also, simplify use of IsBinaryCoercible() by  
allowing it to succeed whenever the target type is ANY or ANYELEMENT.  
It was inconsistent that it dealt with other polymorphic target types  
but not these.  
  
Atri Sharma and Andrew Gierth; reviewed by Pavel Stehule and Vik Fearing,  
and rather heavily editorialized upon by Tom Lane  

M contrib/pg_stat_statements/pg_stat_statements.c
M doc/src/sgml/catalogs.sgml
M doc/src/sgml/func.sgml
M doc/src/sgml/ref/alter_aggregate.sgml
M doc/src/sgml/ref/alter_extension.sgml
M doc/src/sgml/ref/comment.sgml
M doc/src/sgml/ref/create_aggregate.sgml
M doc/src/sgml/ref/drop_aggregate.sgml
M doc/src/sgml/ref/security_label.sgml
M doc/src/sgml/syntax.sgml
M doc/src/sgml/xaggr.sgml
M src/backend/catalog/pg_aggregate.c
M src/backend/commands/aggregatecmds.c
M src/backend/commands/functioncmds.c
M src/backend/executor/execQual.c
M src/backend/executor/functions.c
M src/backend/executor/nodeAgg.c
M src/backend/executor/nodeWindowAgg.c
M src/backend/nodes/copyfuncs.c
M src/backend/nodes/equalfuncs.c
M src/backend/nodes/makefuncs.c
M src/backend/nodes/nodeFuncs.c
M src/backend/nodes/outfuncs.c
M src/backend/nodes/readfuncs.c
M src/backend/optimizer/plan/planagg.c
M src/backend/optimizer/plan/planner.c
M src/backend/optimizer/util/clauses.c
M src/backend/parser/gram.y
M src/backend/parser/parse_agg.c
M src/backend/parser/parse_clause.c
M src/backend/parser/parse_coerce.c
M src/backend/parser/parse_collate.c
M src/backend/parser/parse_expr.c
M src/backend/parser/parse_func.c
M src/backend/utils/adt/Makefile
A src/backend/utils/adt/orderedsetaggs.c
M src/backend/utils/adt/ri_triggers.c
M src/backend/utils/adt/ruleutils.c
M src/backend/utils/cache/lsyscache.c
M src/backend/utils/sort/tuplesort.c
M src/bin/pg_dump/pg_dump.c
M src/include/catalog/catversion.h
M src/include/catalog/pg_aggregate.h
M src/include/catalog/pg_operator.h
M src/include/catalog/pg_proc.h
M src/include/commands/defrem.h
M src/include/fmgr.h
M src/include/nodes/execnodes.h
M src/include/nodes/parsenodes.h
M src/include/nodes/primnodes.h
M src/include/nodes/relation.h
M src/include/parser/kwlist.h
M src/include/parser/parse_agg.h
M src/include/parser/parse_clause.h
M src/include/parser/parse_func.h
M src/include/utils/builtins.h
M src/include/utils/lsyscache.h
M src/include/utils/tuplesort.h
M src/test/regress/expected/aggregates.out
M src/test/regress/expected/create_aggregate.out
M src/test/regress/expected/opr_sanity.out
M src/test/regress/sql/aggregates.sql
M src/test/regress/sql/create_aggregate.sql
M src/test/regress/sql/opr_sanity.sql

Change the way we mark tuples as frozen.

commit   : 37484ad2aacef5ec794f4dd3d5cf814475180a78    
  
author   : Robert Haas <[email protected]>    
date     : Sun, 22 Dec 2013 15:49:09 -0500    
  
committer: Robert Haas <[email protected]>    
date     : Sun, 22 Dec 2013 15:49:09 -0500    

Click here for diff

Instead of changing the tuple xmin to FrozenTransactionId, the combination  
of HEAP_XMIN_COMMITTED and HEAP_XMIN_INVALID, which were previously never  
set together, is now defined as HEAP_XMIN_FROZEN.  A variety of previous  
proposals to freeze tuples opportunistically before vacuum_freeze_min_age  
is reached have foundered on the objection that replacing xmin by  
FrozenTransactionId might hinder debugging efforts when things in this  
area go awry; this patch is intended to solve that problem by keeping  
the XID around (but largely ignoring the value to which it is set).  
  
Third-party code that checks for HEAP_XMIN_INVALID on tuples where  
HEAP_XMIN_COMMITTED might be set will be broken by this change.  To fix,  
use the new accessor macros in htup_details.h rather than consulting the  
bits directly.  HeapTupleHeaderGetXmin has been modified to return  
FrozenTransactionId when the infomask bits indicate that the tuple is  
frozen; use HeapTupleHeaderGetRawXmin when you already know that the  
tuple isn't marked commited or frozen, or want the raw value anyway.  
We currently do this in routines that display the xmin for user consumption,  
in tqual.c where it's known to be safe and important for the avoidance of  
extra cycles, and in the function-caching code for various procedural  
languages, which shouldn't invalidate the cache just because the tuple  
gets frozen.  
  
Robert Haas and Andres Freund  

M contrib/pageinspect/heapfuncs.c
M src/backend/access/common/heaptuple.c
M src/backend/access/heap/heapam.c
M src/backend/commands/sequence.c
M src/backend/commands/vacuumlazy.c
M src/backend/storage/buffer/README
M src/backend/utils/fmgr/fmgr.c
M src/backend/utils/time/combocid.c
M src/backend/utils/time/tqual.c
M src/include/access/heapam_xlog.h
M src/include/access/htup_details.h
M src/include/access/xlog_internal.h
M src/pl/plperl/plperl.c
M src/pl/plpgsql/src/pl_comp.c
M src/pl/plpython/plpy_procedure.c
M src/pl/plpython/plpy_typeio.c
M src/pl/tcl/pltcl.c

Rename wal_log_hintbits to wal_log_hints, per discussion on pgsql-hackers.

commit   : 961bf59fb7a7e4fab751e20e9372de7ab37c5649    
  
author   : Fujii Masao <[email protected]>    
date     : Sat, 21 Dec 2013 03:33:16 +0900    
  
committer: Fujii Masao <[email protected]>    
date     : Sat, 21 Dec 2013 03:33:16 +0900    

Click here for diff

Sawada Masahiko  

M doc/src/sgml/config.sgml
M src/backend/access/heap/visibilitymap.c
M src/backend/access/transam/xlog.c
M src/backend/utils/misc/guc.c
M src/backend/utils/misc/postgresql.conf.sample
M src/bin/pg_controldata/pg_controldata.c
M src/bin/pg_resetxlog/pg_resetxlog.c
M src/include/access/xlog.h
M src/include/access/xlog_internal.h
M src/include/catalog/pg_control.h

Avoid useless palloc during transaction commit

commit   : 6130208e75c98d76b526ac2ac08cedbd17b9f00d    
  
author   : Alvaro Herrera <[email protected]>    
date     : Fri, 20 Dec 2013 12:37:30 -0300    
  
committer: Alvaro Herrera <[email protected]>    
date     : Fri, 20 Dec 2013 12:37:30 -0300    

Click here for diff

We can allocate the initial relations-to-drop array when first needed,  
instead of at function entry; this avoids allocating it when the  
function is not going to do anything, which is most of the time.  
  
Backpatch to 9.3, where this behavior was introduced by commit  
279628a0a7cf5.  
  
There's more that could be done here, such as possible reworking of the  
code to avoid having to palloc anything, but that doesn't sound as  
backpatchable as this relatively minor change.  
  
Per complaint from Noah Misch in  
[email protected]  

M src/backend/catalog/storage.c

pg_prewarm, a contrib module for prewarming relationd data.

commit   : c32afe53c2e87a56e2ff930798a5588db0f7a516    
  
author   : Robert Haas <[email protected]>    
date     : Fri, 20 Dec 2013 08:08:01 -0500    
  
committer: Robert Haas <[email protected]>    
date     : Fri, 20 Dec 2013 08:08:01 -0500    

Click here for diff

Patch by me.  Review by Álvaro Herrera, Amit Kapila, Jeff Janes,  
Gurjeet Singh, and others.  

M contrib/Makefile
A contrib/pg_prewarm/Makefile
A contrib/pg_prewarm/pg_prewarm–1.0.sql
A contrib/pg_prewarm/pg_prewarm.c
A contrib/pg_prewarm/pg_prewarm.control
M doc/src/sgml/contrib.sgml
M doc/src/sgml/filelist.sgml
A doc/src/sgml/pgprewarm.sgml
M src/tools/pgindent/typedefs.list

isolationtester: Ensure stderr is unbuffered, too

commit   : 6eda3e9c27781dec369542a9b20cba7c3d832a5e    
  
author   : Alvaro Herrera <[email protected]>    
date     : Thu, 19 Dec 2013 22:09:30 -0300    
  
committer: Alvaro Herrera <[email protected]>    
date     : Thu, 19 Dec 2013 22:09:30 -0300    

Click here for diff

M src/test/isolation/isolationtester.c

Move pg_upgrade_support global variables to their own include file

commit   : 527fdd9df11eb338fdd372d16f62cd067de5204b    
  
author   : Bruce Momjian <[email protected]>    
date     : Thu, 19 Dec 2013 16:10:01 -0500    
  
committer: Bruce Momjian <[email protected]>    
date     : Thu, 19 Dec 2013 16:10:01 -0500    

Click here for diff

Previously their declarations were spread around to avoid accidental  
access.  

M contrib/pg_upgrade_support/pg_upgrade_support.c
M src/backend/catalog/heap.c
M src/backend/catalog/index.c
M src/backend/catalog/pg_enum.c
M src/backend/catalog/pg_type.c
M src/backend/catalog/toasting.c
M src/backend/commands/typecmds.c
M src/backend/commands/user.c
A src/include/catalog/binary_upgrade.h

Make stdout unbuffered

commit   : 73bcb76b77c2e47dd066a1961309cf950cf19412    
  
author   : Alvaro Herrera <[email protected]>    
date     : Thu, 19 Dec 2013 17:26:27 -0300    
  
committer: Alvaro Herrera <[email protected]>    
date     : Thu, 19 Dec 2013 17:26:27 -0300    

Click here for diff

This ensures that all stdout output is flushed immediately, to match  
stderr.  This eliminates the need for fflush(stdout) calls sprinkled all  
over the place.  
  
Per Daniel Wood in message [email protected]  

M src/test/isolation/isolationtester.c

Optimize updating a row that's locked by same xid

commit   : 13aa6244313df2315b0952a9e7f6e68bb09c9d98    
  
author   : Alvaro Herrera <[email protected]>    
date     : Thu, 19 Dec 2013 16:39:59 -0300    
  
committer: Alvaro Herrera <[email protected]>    
date     : Thu, 19 Dec 2013 16:39:59 -0300    

Click here for diff

Updating or locking a row that was already locked by the same  
transaction under the same Xid caused a MultiXact to be created; but  
this is unnecessary, because there's no usefulness in being able to  
differentiate two locks by the same transaction.  In particular, if a  
transaction executed SELECT FOR UPDATE followed by an UPDATE that didn't  
modify columns of the key, we would dutifully represent the resulting  
combination as a multixact -- even though a single key-update is  
sufficient.  
  
Optimize the case so that only the strongest of both locks/updates is  
represented in Xmax.  This can save some Xmax's from becoming  
MultiXacts, which can be a significant optimization.  
  
This missed optimization opportunity was spotted by Andres Freund while  
investigating a bug reported by Oliver Seemann in message  
CANCipfpfzoYnOz5jj=UZ70_R=CwDHv36dqWSpwsi27vpm1z5sA@mail.gmail.com  
and also directly as a performance regression reported by Dong Ye in  
message  
[email protected]  
Reportedly, this patch fixes the performance regression.  
  
Since the missing optimization was reported as a significant performance  
regression from 9.2, backpatch to 9.3.  
  
Andres Freund, tweaked by Álvaro Herrera  

M src/backend/access/heap/heapam.c

Add tab completion for ALTER SYSTEM SET in psql.

commit   : 084e385a2fc0b596ff6aa0ede8d360a889a6c084    
  
author   : Fujii Masao <[email protected]>    
date     : Fri, 20 Dec 2013 02:33:27 +0900    
  
committer: Fujii Masao <[email protected]>    
date     : Fri, 20 Dec 2013 02:33:27 +0900    

Click here for diff

M src/bin/psql/tab-complete.c

Fix typo in docs for min_recovery_apply_delay.

commit   : f83a75451f96ecf950b6b8e29f487723d481ce1b    
  
author   : Fujii Masao <[email protected]>    
date     : Thu, 19 Dec 2013 19:22:29 +0900    
  
committer: Fujii Masao <[email protected]>    
date     : Thu, 19 Dec 2013 19:22:29 +0900    

Click here for diff

Bernd Helmle  

M doc/src/sgml/recovery-config.sgml

Upgrade to Autoconf 2.69

commit   : 94b899b829657332bda856ac3f06153d09077bd1    
  
author   : Peter Eisentraut <[email protected]>    
date     : Wed, 18 Dec 2013 20:53:23 -0500    
  
committer: Peter Eisentraut <[email protected]>    
date     : Wed, 18 Dec 2013 20:53:23 -0500    

Click here for diff

M configure
M configure.in
M src/include/pg_config.h.in

Fix compiler warning.

commit   : 6bb9d3017c173fa6102010d83ced7ad4409e5a49    
  
author   : Robert Haas <[email protected]>    
date     : Wed, 18 Dec 2013 13:31:35 -0500    
  
committer: Robert Haas <[email protected]>    
date     : Wed, 18 Dec 2013 13:31:35 -0500    

Click here for diff

get_user_name returns const char *, but we were assigning the result  
to a char * variable.  

M contrib/pg_upgrade/pg_upgrade.h
M contrib/pg_upgrade/util.c

Allow on-detach callbacks for dynamic shared memory segments.

commit   : 001a573a2011d605f2a6e10aee9996de8581d099    
  
author   : Robert Haas <[email protected]>    
date     : Wed, 18 Dec 2013 12:57:20 -0500    
  
committer: Robert Haas <[email protected]>    
date     : Wed, 18 Dec 2013 12:57:20 -0500    

Click here for diff

Just as backends must clean up their shared memory state (releasing  
lwlocks, buffer pins, etc.) before exiting, they must also perform  
any similar cleanups related to dynamic shared memory segments they  
have mapped before unmapping those segments.  So add a mechanism to  
ensure that.  
  
Existing on_shmem_exit hooks include both "user level" cleanup such  
as transaction abort and removal of leftover temporary relations and  
also "low level" cleanup that forcibly released leftover shared  
memory resources.  On-detach callbacks should run after the first  
group but before the second group, so create a new before_shmem_exit  
function for registering the early callbacks and keep on_shmem_exit  
for the regular callbacks.  (An earlier draft of this patch added an  
additional argument to on_shmem_exit, but that had a much larger  
footprint and probably a substantially higher risk of breaking third  
party code for no real gain.)  
  
Patch by me, reviewed by KaiGai Kohei and Andres Freund.  

M src/backend/bootstrap/bootstrap.c
M src/backend/catalog/namespace.c
M src/backend/commands/async.c
M src/backend/storage/ipc/dsm.c
M src/backend/storage/ipc/ipc.c
M src/backend/utils/init/postinit.c
M src/include/storage/dsm.h
M src/include/storage/ipc.h

Fix incorrect error message reported for non-existent users

commit   : 613c6d26bd42dd8c2dd0664315be9551475b8864    
  
author   : Bruce Momjian <[email protected]>    
date     : Wed, 18 Dec 2013 12:16:16 -0500    
  
committer: Bruce Momjian <[email protected]>    
date     : Wed, 18 Dec 2013 12:16:16 -0500    

Click here for diff

Previously, lookups of non-existent user names could return "Success";  
it will now return "User does not exist" by resetting errno.  This also  
centralizes the user name lookup code in libpgport.  
  
Report and analysis by Nicolas Marchildon;  patch by me  

M contrib/pg_upgrade/util.c
M src/backend/libpq/auth.c
M src/backend/main/main.c
M src/bin/initdb/initdb.c
M src/bin/psql/command.c
M src/bin/psql/help.c
M src/bin/scripts/clusterdb.c
M src/bin/scripts/common.c
M src/bin/scripts/common.h
M src/bin/scripts/createdb.c
M src/bin/scripts/createlang.c
M src/bin/scripts/createuser.c
M src/bin/scripts/droplang.c
M src/bin/scripts/reindexdb.c
M src/bin/scripts/vacuumdb.c
M src/include/port.h
M src/port/Makefile
A src/port/username.c
M src/tools/msvc/Mkvcbuild.pm

Don't ignore tuple locks propagated by our updates

commit   : 11ac4c73cb89551d7e0d0180b58d82186f072f8d    
  
author   : Alvaro Herrera <[email protected]>    
date     : Wed, 18 Dec 2013 13:31:27 -0300    
  
committer: Alvaro Herrera <[email protected]>    
date     : Wed, 18 Dec 2013 13:31:27 -0300    

Click here for diff

If a tuple was locked by transaction A, and transaction B updated it,  
the new version of the tuple created by B would be locked by A, yet  
visible only to B; due to an oversight in HeapTupleSatisfiesUpdate, the  
lock held by A wouldn't get checked if transaction B later deleted (or  
key-updated) the new version of the tuple.  This might cause referential  
integrity checks to give false positives (that is, allow deletes that  
should have been rejected).  
  
This is an easy oversight to have made, because prior to improved tuple  
locks in commit 0ac5ad5134f it wasn't possible to have tuples created by  
our own transaction that were also locked by remote transactions, and so  
locks weren't even considered in that code path.  
  
It is recommended that foreign keys be rechecked manually in bulk after  
installing this update, in case some referenced rows are missing with  
some referencing row remaining.  
  
Per bug reported by Daniel Wood in  
CAPweHKe5QQ1747X2c0tA=5zf4YnS2xcvGf13Opd-1Mq24rF1cQ@mail.gmail.com  

M src/backend/access/transam/multixact.c
M src/backend/utils/time/tqual.c
M src/include/access/multixact.h
A src/test/isolation/expected/propagate-lock-delete.out
M src/test/isolation/isolation_schedule
A src/test/isolation/specs/propagate-lock-delete.spec

Add ALTER SYSTEM command to edit the server configuration file.

commit   : 65d6e4cb5c62371dae6c236a7e709d503ae6ddf8    
  
author   : Tatsuo Ishii <[email protected]>    
date     : Wed, 18 Dec 2013 23:42:44 +0900    
  
committer: Tatsuo Ishii <[email protected]>    
date     : Wed, 18 Dec 2013 23:42:44 +0900    

Click here for diff

Patch contributed by Amit Kapila. Reviewed by Hari Babu, Masao Fujii,  
Boszormenyi Zoltan, Andres Freund, Greg Smith and others.  

M doc/src/sgml/config.sgml
M doc/src/sgml/ref/allfiles.sgml
A doc/src/sgml/ref/alter_system.sgml
M doc/src/sgml/reference.sgml
M doc/src/sgml/storage.sgml
M src/backend/nodes/copyfuncs.c
M src/backend/nodes/equalfuncs.c
M src/backend/parser/gram.y
M src/backend/replication/basebackup.c
M src/backend/tcop/utility.c
M src/backend/utils/misc/guc-file.l
M src/backend/utils/misc/guc.c
M src/bin/initdb/initdb.c
M src/include/nodes/nodes.h
M src/include/nodes/parsenodes.h
M src/include/pg_config_manual.h
M src/include/storage/lwlock.h
M src/include/utils/guc.h

Comment: COPY comment improvement

commit   : dba5a9dda9adbda16a72c46e1c012ee6552c248a    
  
author   : Bruce Momjian <[email protected]>    
date     : Tue, 17 Dec 2013 12:51:16 -0500    
  
committer: Bruce Momjian <[email protected]>    
date     : Tue, 17 Dec 2013 12:51:16 -0500    

Click here for diff

Etsuro Fujita  

M src/backend/commands/copy.c

Rework tuple freezing protocol

commit   : 3b97e6823b949624afdc3ce4c92b29a80429715f    
  
author   : Alvaro Herrera <[email protected]>    
date     : Mon, 16 Dec 2013 11:29:50 -0300    
  
committer: Alvaro Herrera <[email protected]>    
date     : Mon, 16 Dec 2013 11:29:50 -0300    

Click here for diff

Tuple freezing was broken in connection to MultiXactIds; commit  
8e53ae025de9 tried to fix it, but didn't go far enough.  As noted by  
Noah Misch, freezing a tuple whose Xmax is a multi containing an aborted  
update might cause locks in the multi to go ignored by later  
transactions.  This is because the code depended on a multixact above  
their cutoff point not having any lock-only member older than the cutoff  
point for Xids, which is easily defeated in READ COMMITTED transactions.  
  
The fix for this involves creating a new MultiXactId when necessary.  
But this cannot be done during WAL replay, and moreover multixact  
examination requires using CLOG access routines which are not supposed  
to be used during WAL replay either; so tuple freezing cannot be done  
with the old freeze WAL record.  Therefore, separate the freezing  
computation from its execution, and change the WAL record to carry all  
necessary information.  At WAL replay time, it's easy to re-execute  
freezing because we don't need to re-compute the new infomask/Xmax  
values but just take them from the WAL record.  
  
While at it, restructure the coding to ensure all page changes occur in  
a single critical section without much room for failures.  The previous  
coding wasn't using a critical section, without any explanation as to  
why this was acceptable.  
  
In replication scenarios using the 9.3 branch, standby servers must be  
upgraded before their master, so that they are prepared to deal with the  
new WAL record once the master is upgraded; failure to do so will cause  
WAL replay to die with a PANIC message.  Later upgrade of the standby  
will allow the process to continue where it left off, so there's no  
disruption of the data in the standby in any case.  Standbys know how to  
deal with the old WAL record, so it's okay to keep the master running  
the old code for a while.  
  
In master, the old freeze WAL record is gone, for cleanliness' sake;  
there's no compatibility concern there.  
  
Backpatch to 9.3, where the original bug was introduced and where the  
previous fix was backpatched.  
  
Álvaro Herrera and Andres Freund  

M src/backend/access/heap/heapam.c
M src/backend/access/rmgrdesc/heapdesc.c
M src/backend/access/transam/multixact.c
M src/backend/commands/vacuumlazy.c
M src/include/access/heapam_xlog.h
M src/include/access/multixact.h
M src/include/access/xlog_internal.h

Mark variables 'static' where possible. Move GinFuzzySearchLimit to ginget.c

commit   : 30b96549ab41ce23399256d4ea9723a05c139558    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Mon, 16 Dec 2013 11:27:30 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Mon, 16 Dec 2013 11:27:30 +0200    

Click here for diff

Per "clang -Wmissing-variable-declarations" output, posted by Andres Freund.  
I didn't silence all those warnings, though, only the most obvious cases.  

M src/backend/access/gin/ginget.c
M src/backend/storage/lmgr/lock.c
M src/backend/utils/cache/relfilenodemap.c
M src/backend/utils/init/globals.c
M src/bin/pg_basebackup/pg_basebackup.c
M src/bin/pg_basebackup/pg_receivexlog.c
M src/bin/pg_dump/pg_dump.c

Add "SHIFT_JIS" as an accepted encoding name for locale checking.

commit   : 1f0626ee40f2decd93ca96c6f9e9a9b5edff57ba    
  
author   : Tatsuo Ishii <[email protected]>    
date     : Sun, 15 Dec 2013 10:33:06 +0900    
  
committer: Tatsuo Ishii <[email protected]>    
date     : Sun, 15 Dec 2013 10:33:06 +0900    

Click here for diff

When locale is "ja_JP.SJIS", nl_langinfo(CODESET) returns "SHIFT_JIS"  
on some platforms, at least on RedHat Linux. So the encoding/locale  
match table (encoding_match_list) needs the entry. Otherwise client  
encoding is set to SQL_ASCII.  
  
Back patch to all supported branches.  

M src/port/chklocale.c

Allow empty target list in SELECT.

commit   : 1b4f7f93b4693858cb983af3cd557f6097dab67b    
  
author   : Tom Lane <[email protected]>    
date     : Sat, 14 Dec 2013 20:23:26 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Sat, 14 Dec 2013 20:23:26 -0500    

Click here for diff

This fixes a problem noted as a followup to bug #8648: if a query has a  
semantically-empty target list, e.g. SELECT * FROM zero_column_table,  
ruleutils.c will dump it as a syntactically-empty target list, which was  
not allowed.  There doesn't seem to be any reliable way to fix this by  
hacking ruleutils (note in particular that the originally zero-column table  
might since have had columns added to it); and even if we had such a fix,  
it would do nothing for existing dump files that might contain bad syntax.  
The best bet seems to be to relax the syntactic restriction.  
  
Also, add parse-analysis errors for SELECT DISTINCT with no columns (after  
*-expansion) and RETURNING with no columns.  These cases previously  
produced unexpected behavior because the parsed Query looked like it had  
no DISTINCT or RETURNING clause, respectively.  If anyone ever offers  
a plausible use-case for this, we could work a bit harder on making the  
situation distinguishable.  
  
Arguably this is a bug fix that should be back-patched, but I'm worried  
that there may be client apps or PLs that expect "SELECT ;" to throw a  
syntax error.  The issue doesn't seem important enough to risk changing  
behavior in minor releases.  

M doc/src/sgml/ref/select.sgml
M src/backend/parser/analyze.c
M src/backend/parser/gram.y
M src/backend/parser/parse_clause.c
M src/test/regress/expected/errors.out
M src/test/regress/sql/errors.sql

Fix inherited UPDATE/DELETE with UNION ALL subqueries.

commit   : c03ad5602f529787968fa3201b35c119bbc6d782    
  
author   : Tom Lane <[email protected]>    
date     : Sat, 14 Dec 2013 17:33:53 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Sat, 14 Dec 2013 17:33:53 -0500    

Click here for diff

Fix an oversight in commit b3aaf9081a1a95c245fd605dcf02c91b3a5c3a29: we do  
indeed need to process the planner's append_rel_list when copying RTE  
subqueries, because if any of them were flattenable UNION ALL subqueries,  
the append_rel_list shows which subquery RTEs were pulled up out of which  
other ones.  Without this, UNION ALL subqueries aren't correctly inserted  
into the update plans for inheritance child tables after the first one,  
typically resulting in no update happening for those child table(s).  
Per report from Victor Yegorov.  
  
Experimentation with this case also exposed a fault in commit  
a7b965382cf0cb30aeacb112572718045e6d4be7: if an inherited UPDATE/DELETE  
was proven totally dummy by constraint exclusion, we might arrive at  
add_rtes_to_flat_rtable with root->simple_rel_array being NULL.  This  
should be interpreted as not having any RelOptInfos.  I chose to code  
the guard as a check against simple_rel_array_size, so as to also  
provide some protection against indexing off the end of the array.  
  
Back-patch to 9.2 where the faulty code was added.  

M src/backend/optimizer/plan/planner.c
M src/backend/optimizer/plan/setrefs.c
M src/test/regress/expected/inherit.out
M src/test/regress/sql/inherit.sql

Fix typo

commit   : 60eea3780c40fe7ac0332d83173947199e59f5cd    
  
author   : Alvaro Herrera <[email protected]>    
date     : Fri, 13 Dec 2013 17:26:58 -0300    
  
committer: Alvaro Herrera <[email protected]>    
date     : Fri, 13 Dec 2013 17:26:58 -0300    

Click here for diff

M src/backend/access/transam/multixact.c

Rework MultiXactId cache code

commit   : d881dd6233f4eec6404f003bb08312e9e650e0e2    
  
author   : Alvaro Herrera <[email protected]>    
date     : Fri, 13 Dec 2013 17:16:25 -0300    
  
committer: Alvaro Herrera <[email protected]>    
date     : Fri, 13 Dec 2013 17:16:25 -0300    

Click here for diff

The original performs too poorly; in some scenarios it shows way too  
high while profiling.  Try to make it a bit smarter to avoid excessive  
cosst.  In particular, make it have a maximum size, and have entries be  
sorted in LRU order; once the max size is reached, evict the oldest  
entry to avoid it from growing too large.  
  
Per complaint from Andres Freund in connection with new tuple freezing  
code.  

M src/backend/access/transam/multixact.c

Add HOLD/RESUME_INTERRUPTS in HandleCatchupInterrupt/HandleNotifyInterrupt.

commit   : 2efc6dc256dc71ee876304b51dcad29fafbc37d3    
  
author   : Tom Lane <[email protected]>    
date     : Fri, 13 Dec 2013 14:05:14 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Fri, 13 Dec 2013 14:05:14 -0500    

Click here for diff

This prevents a possible longjmp out of the signal handler if a timeout  
or SIGINT occurs while something within the handler has transiently set  
ImmediateInterruptOK.  For safety we must hold off the timeout or cancel  
error until we're back in mainline, or at least till we reach the end of  
the signal handler when ImmediateInterruptOK was true at entry.  This  
syncs these functions with the logic now present in handle_sig_alarm.  
  
AFAICT there is no live bug here in 9.0 and up, because I don't think we  
currently can wait for any heavyweight lock inside these functions, and  
there is no other code (except read-from-client) that will turn on  
ImmediateInterruptOK.  However, that was not true pre-9.0: in older  
branches ProcessIncomingNotify might block trying to lock pg_listener, and  
then a SIGINT could lead to undesirable control flow.  It might be all  
right anyway given the relatively narrow code ranges in which NOTIFY  
interrupts are enabled, but for safety's sake I'm back-patching this.  

M src/backend/commands/async.c
M src/backend/storage/ipc/sinval.c

Fix more instances of "the the" in comments.

commit   : dde6282500ac650cd0257fc24aeb5688962fddf9    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Fri, 13 Dec 2013 19:58:48 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Fri, 13 Dec 2013 19:58:48 +0200    

Click here for diff

Plus one instance of "to to" in the docs.  

M doc/src/sgml/extend.sgml
M src/backend/access/transam/xlog.c
M src/backend/access/transam/xlogfuncs.c
M src/backend/commands/vacuum.c
M src/backend/replication/walreceiver.c
M src/backend/storage/ipc/procarray.c
M src/backend/utils/cache/relcache.c
M src/pl/plpgsql/src/pl_exec.c

Don't let timeout interrupts happen unless ImmediateInterruptOK is set.

commit   : e8312b4f03315a98a987997e05a6e9d6d8d84ddf    
  
author   : Tom Lane <[email protected]>    
date     : Fri, 13 Dec 2013 11:50:15 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Fri, 13 Dec 2013 11:50:15 -0500    

Click here for diff

Serious oversight in commit 16e1b7a1b7f7ffd8a18713e83c8cd72c9ce48e07:  
we should not allow an interrupt to take control away from mainline code  
except when ImmediateInterruptOK is set.  Just to be safe, let's adopt  
the same save-clear-restore dance that's been used for many years in  
HandleCatchupInterrupt and HandleNotifyInterrupt, so that nothing bad  
happens if a timeout handler invokes code that tests or even manipulates  
ImmediateInterruptOK.  
  
Per report of "stuck spinlock" failures from Christophe Pettus, though  
many other symptoms are possible.  Diagnosis by Andres Freund.  

M src/backend/utils/misc/timeout.c

Add GUC to enable WAL-logging of hint bits, even with checksums disabled.

commit   : 50e547096c4858a68abf09894667a542cc418315    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Fri, 13 Dec 2013 16:26:14 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Fri, 13 Dec 2013 16:26:14 +0200    

Click here for diff

WAL records of hint bit updates is useful to tools that want to examine  
which pages have been modified. In particular, this is required to make  
the pg_rewind tool safe (without checksums).  
  
This can also be used to test how much extra WAL-logging would occur if  
you enabled checksums, without actually enabling them (which you can't  
currently do without re-initdb'ing).  
  
Sawada Masahiko, docs by Samrat Revagade. Reviewed by Dilip Kumar, with  
further changes by me.  

M doc/src/sgml/config.sgml
M src/backend/access/heap/heapam.c
M src/backend/access/heap/visibilitymap.c
M src/backend/access/transam/xlog.c
M src/backend/storage/buffer/bufmgr.c
M src/backend/utils/misc/guc.c
M src/backend/utils/misc/postgresql.conf.sample
M src/bin/pg_controldata/pg_controldata.c
M src/bin/pg_resetxlog/pg_resetxlog.c
M src/include/access/xlog.h
M src/include/access/xlog_internal.h
M src/include/catalog/catversion.h
M src/include/catalog/pg_control.h

Fix double "the" in the documentation

commit   : 56afe8509ec3057e06ebe244e51272511f05decb    
  
author   : Magnus Hagander <[email protected]>    
date     : Fri, 13 Dec 2013 15:01:56 +0100    
  
committer: Magnus Hagander <[email protected]>    
date     : Fri, 13 Dec 2013 15:01:56 +0100    

Click here for diff

Erik Rijkers  

M doc/src/sgml/pgstatstatements.sgml

Fix WAL-logging of setting the visibility map bit.

commit   : a49633d8dc6c66f6b2e92c8598d3dfa2cc72a259    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Fri, 13 Dec 2013 13:52:47 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Fri, 13 Dec 2013 13:52:47 +0200    

Click here for diff

The operation that removes the remaining dead tuples from the page must  
be WAL-logged before the setting of the VM bit. Otherwise, if you replay  
the WAL to between those two records, you end up with the VM bit set, but  
the dead tuples are still there.  
  
Backpatch to 9.3, where this bug was introduced.  

M src/backend/commands/vacuumlazy.c

configure: Allow adding a custom string to PG_VERSION

commit   : 46328916eefc5f9eaf249518e96f68afcd35923b    
  
author   : Peter Eisentraut <[email protected]>    
date     : Thu, 12 Dec 2013 21:53:21 -0500    
  
committer: Peter Eisentraut <[email protected]>    
date     : Thu, 12 Dec 2013 21:53:21 -0500    

Click here for diff

This can be used to mark custom built binaries with an extra version  
string such as a git describe identifier or distribution package release  
version.  
  
From: Oskari Saarenmaa <[email protected]>  

M configure
M configure.in
M doc/src/sgml/installation.sgml

Fix ancient docs/comments thinko: XID comparison is mod 2^32, not 2^31.

commit   : ccca6f56f5e027f28b033e5e2754e9ad18e8c9ae    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 12 Dec 2013 12:39:48 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 12 Dec 2013 12:39:48 -0500    

Click here for diff

Pointed out by Gianni Ciolli.  

M doc/src/sgml/maintenance.sgml
M src/backend/access/transam/transam.c

Improve EXPLAIN to print the grouping columns in Agg and Group nodes.

commit   : f26099057a2818d85edc2a16e2d3161f4bd96bdc    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 12 Dec 2013 11:24:38 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 12 Dec 2013 11:24:38 -0500    

Click here for diff

Per request from Kevin Grittner.  

M doc/src/sgml/ref/explain.sgml
M src/backend/commands/explain.c
M src/test/regress/expected/aggregates.out
M src/test/regress/expected/matview.out
M src/test/regress/expected/union.out
M src/test/regress/expected/window.out

New autovacuum_work_mem parameter

commit   : 8693559cacf1765697c32fc38574af3c19ce61c1    
  
author   : Simon Riggs <[email protected]>    
date     : Thu, 12 Dec 2013 11:42:39 +0000    
  
committer: Simon Riggs <[email protected]>    
date     : Thu, 12 Dec 2013 11:42:39 +0000    

Click here for diff

If autovacuum_work_mem is set, autovacuum workers now use  
this parameter in preference to maintenance_work_mem.  
  
Peter Geoghegan  

M doc/src/sgml/config.sgml
M src/backend/commands/vacuumlazy.c
M src/backend/postmaster/autovacuum.c
M src/backend/utils/misc/guc.c
M src/backend/utils/misc/postgresql.conf.sample
M src/include/postmaster/autovacuum.h

Allow time delayed standbys and recovery

commit   : 36da3cfb457b77a55582f68208d815f11ac1399e    
  
author   : Simon Riggs <[email protected]>    
date     : Thu, 12 Dec 2013 10:53:20 +0000    
  
committer: Simon Riggs <[email protected]>    
date     : Thu, 12 Dec 2013 10:53:20 +0000    

Click here for diff

Set min_recovery_apply_delay to force a delay in recovery apply for commit and  
restore point WAL records. Other records are replayed immediately. Delay is  
measured between WAL record time and local standby time.  
  
Robert Haas, Fabrízio de Royes Mello and Simon Riggs  
Detailed review by Mitsumasa Kondo  

M doc/src/sgml/recovery-config.sgml
M src/backend/access/transam/recovery.conf.sample
M src/backend/access/transam/xlog.c

Fix progress logging when scale factor is large.

commit   : 841a65482d6e198b71a0df987b8b9822608d5ef4    
  
author   : Tatsuo Ishii <[email protected]>    
date     : Thu, 12 Dec 2013 19:01:01 +0900    
  
committer: Tatsuo Ishii <[email protected]>    
date     : Thu, 12 Dec 2013 19:01:01 +0900    

Click here for diff

Integer overflow showed minus percent and minus remaining time something like this.  
  239300000 of 3800000000 tuples (-48%) done (elapsed 226.86 s, remaining -696.10 s).  

M contrib/pgbench/pgbench.c

Display old and new values in pg_resetxlog -n output.

commit   : 108e3992cdae890c9b5b4778c3598fce35eea4ca    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Thu, 12 Dec 2013 11:54:57 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Thu, 12 Dec 2013 11:54:57 +0200    

Click here for diff

For extra clarity.  
  
Rajeev Rastogi, reviewed by Amit Kapila  

M doc/src/sgml/ref/pg_resetxlog.sgml
M src/bin/pg_resetxlog/pg_resetxlog.c

Remove bogus executable permissions on xlog.c.

commit   : 22310b808d45f67db4037a74aa47f44d716a4a83    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 11 Dec 2013 22:12:25 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 11 Dec 2013 22:12:25 -0500    

Click here for diff

Apparently fat-fingered in 1a3d104475ce01326fc00601ed66ac4d658e37e5.  
Noted by Peter Geoghegan.  

M src/backend/access/transam/xlog.c

Add a regression test case for plpython function returning setof RECORD.

commit   : 6bff0e7d92133d50c064d9f652f538891873aa32    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 11 Dec 2013 17:22:47 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 11 Dec 2013 17:22:47 -0500    

Click here for diff

We had coverage for functions returning setof a named composite type,  
but not for anonymous records, which is a somewhat different code path.  
In view of recent crash report from Sergey Konoplev, this seems worth  
testing, though I doubt there's any deterministic bug here today.  

M src/pl/plpython/expected/plpython_setof.out
M src/pl/plpython/sql/plpython_setof.sql

Regression tests for SCHEMA commands

commit   : cf589c9c1f5f7f89018684b763d74d7b02a2504b    
  
author   : Simon Riggs <[email protected]>    
date     : Wed, 11 Dec 2013 20:45:15 +0000    
  
committer: Simon Riggs <[email protected]>    
date     : Wed, 11 Dec 2013 20:45:15 +0000    

Click here for diff

Hari Babu Kommi reviewed by David Rowley  

M src/test/regress/expected/namespace.out
M src/test/regress/expected/privileges.out
M src/test/regress/sql/namespace.sql
M src/test/regress/sql/privileges.sql

Regression tests for ALTER TABLESPACE RENAME,OWNER

commit   : b921a26fb89cf52ec32b6c19a8528524883beeb5    
  
author   : Simon Riggs <[email protected]>    
date     : Wed, 11 Dec 2013 20:42:58 +0000    
  
committer: Simon Riggs <[email protected]>    
date     : Wed, 11 Dec 2013 20:42:58 +0000    

Click here for diff

Hari Babu Kommi reviewed by David Rowley  

M src/test/regress/input/tablespace.source
M src/test/regress/output/tablespace.source

Tweak placement of explicit ANALYZE commands in the regression tests.

commit   : b5e0a2a38401273d3d11b81f4424681db9845882    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 11 Dec 2013 15:08:33 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 11 Dec 2013 15:08:33 -0500    

Click here for diff

Make the COPY test, which loads most of the large static tables used in  
the tests, also explicitly ANALYZE those tables.  This allows us to get  
rid of various ad-hoc, and rather redundant, ANALYZE commands that had  
gotten stuck into various test scripts over time to ensure we got  
consistent plan choices.  (We could have done a database-wide ANALYZE,  
but that would cause stats to get attached to the small static tables  
too, which results in plan changes compared to the historical behavior.  
I'm not sure that's a good idea, so not going that far for now.)  
  
Back-patch to 9.0, since 9.0 and 9.1 are currently sometimes failing  
regression tests for lack of an "ANALYZE tenk1" in the subselect test.  
There's no need for this in 8.4 since we didn't print any plans back  
then.  

M src/test/regress/expected/aggregates.out
M src/test/regress/expected/alter_table.out
M src/test/regress/expected/arrays.out
M src/test/regress/expected/create_index.out
M src/test/regress/expected/join.out
M src/test/regress/input/copy.source
M src/test/regress/output/copy.source
M src/test/regress/sql/aggregates.sql
M src/test/regress/sql/alter_table.sql
M src/test/regress/sql/arrays.sql
M src/test/regress/sql/create_index.sql
M src/test/regress/sql/join.sql

Under wal_level=logical, when saving old tuples, always save OID.

commit   : 60dd40bbda92cb1818d5a2651b9d2ba49afd804c    
  
author   : Robert Haas <[email protected]>    
date     : Wed, 11 Dec 2013 13:17:44 -0500    
  
committer: Robert Haas <[email protected]>    
date     : Wed, 11 Dec 2013 13:17:44 -0500    

Click here for diff

There's no real point in not doing this.  It doesn't cost anything  
in performance or space.  So let's go wild.  
  
Andres Freund, with substantial editing as to style by me.  

M src/backend/access/heap/heapam.c

Add table name to VACUUM statement in matview.c.

commit   : 09df854b8acbba5c1d1dc5cdf30c8e84f59145e2    
  
author   : Kevin Grittner <[email protected]>    
date     : Wed, 11 Dec 2013 08:53:03 -0600    
  
committer: Kevin Grittner <[email protected]>    
date     : Wed, 11 Dec 2013 08:53:03 -0600    

Click here for diff

The test only needs the one table to be vacuumed.  Vacuuming the  
database may affect other tests.  
  
Per gripe from Tom Lane.  Back-patch to 9.3, where the test was  
was added.  

M src/test/regress/expected/matview.out
M src/test/regress/sql/matview.sql

PL/Perl: Add event trigger support

commit   : e5dc4cc24d2e1e94ac572a2c64103710bf15d21e    
  
author   : Peter Eisentraut <[email protected]>    
date     : Wed, 11 Dec 2013 08:11:59 -0500    
  
committer: Peter Eisentraut <[email protected]>    
date     : Wed, 11 Dec 2013 08:11:59 -0500    

Click here for diff

From: Dimitri Fontaine <[email protected]>  

M doc/src/sgml/plperl.sgml
M src/pl/plperl/expected/plperl_trigger.out
M src/pl/plperl/plperl.c
M src/pl/plperl/sql/plperl_trigger.sql

Add a new option, -g, to createuser, to add membership in a role.

commit   : 6bea96dd49619122bdb3fe9ddfd559a82b26ff73    
  
author   : Robert Haas <[email protected]>    
date     : Wed, 11 Dec 2013 07:50:36 -0500    
  
committer: Robert Haas <[email protected]>    
date     : Wed, 11 Dec 2013 07:50:36 -0500    

Click here for diff

Chistopher Browne, reviewed by Sameer Thakur, Amit Kapila, and  
Peter Eisentraut.  

M doc/src/sgml/ref/createuser.sgml
M src/bin/scripts/createuser.c

doc: Fix DocBook table column count declaration

commit   : a06af43695cd51184dacc260aa394685991fe15f    
  
author   : Peter Eisentraut <[email protected]>    
date     : Tue, 10 Dec 2013 21:46:43 -0500    
  
committer: Peter Eisentraut <[email protected]>    
date     : Tue, 10 Dec 2013 21:46:43 -0500    

Click here for diff

This was broken in d6464fdc0a591662e5e5ee1b0303932e89cb027c.  

M doc/src/sgml/pgcrypto.sgml

Add a new reloption, user_catalog_table.

commit   : 66abc2608c7c00fcd449e00a9e23f13f02e65d04    
  
author   : Robert Haas <[email protected]>    
date     : Tue, 10 Dec 2013 19:17:34 -0500    
  
committer: Robert Haas <[email protected]>    
date     : Tue, 10 Dec 2013 19:17:34 -0500    

Click here for diff

When this reloption is set and wal_level=logical is configured,  
we'll record the CIDs stamped by inserts, updates, and deletes to  
the table just as we would for an actual catalog table.  This will  
allow logical decoding to use historical MVCC snapshots to access  
such tables just as they access ordinary catalog tables.  
  
Replication solutions built around the logical decoding machinery  
will likely need to set this operation for their configuration  
tables; it might also be needed by extensions which perform table  
access in their output functions.  
  
Andres Freund, reviewed by myself and others.  

M src/backend/access/common/reloptions.c
M src/backend/commands/tablecmds.c
M src/include/utils/rel.h

Add new wal_level, logical, sufficient for logical decoding.

commit   : e55704d8b2fe522fbc9435acbb5bc59033478bd5    
  
author   : Robert Haas <[email protected]>    
date     : Tue, 10 Dec 2013 18:33:45 -0500    
  
committer: Robert Haas <[email protected]>    
date     : Tue, 10 Dec 2013 18:33:45 -0500    

Click here for diff

When wal_level=logical, we'll log columns from the old tuple as  
configured by the REPLICA IDENTITY facility added in commit  
07cacba983ef79be4a84fcd0e0ca3b5fcb85dd65.  This makes it possible  
a properly-configured logical replication solution to correctly  
follow table updates even if they change the chosen key columns,  
or, with REPLICA IDENTITY FULL, even if the table has no key at  
all.  Note that updates which do not modify the replica identity  
column won't log anything extra, making the choice of a good key  
(i.e. one that will rarely be changed) important to performance  
when wal_level=logical is configured.  
  
Each insert, update, or delete to a catalog table will also log  
the CMIN and/or CMAX values of stamped by the current transaction.  
This is necessary because logical decoding will require access to  
historical snapshots of the catalog in order to decode some data  
types, and the CMIN/CMAX values that we may need in order to judge  
row visibility may have been overwritten by the time we need them.  
  
Andres Freund, reviewed in various versions by myself, Heikki  
Linnakangas, KONDO Mitsumasa, and many others.  

M doc/src/sgml/backup.sgml
M doc/src/sgml/config.sgml
M doc/src/sgml/high-availability.sgml
M src/backend/access/heap/heapam.c
M src/backend/access/rmgrdesc/heapdesc.c
M src/backend/access/rmgrdesc/xlogdesc.c
M src/backend/access/transam/twophase.c
M src/backend/access/transam/xact.c
M src/backend/access/transam/xlog.c
M src/backend/catalog/index.c
M src/backend/commands/trigger.c
M src/backend/postmaster/postmaster.c
M src/backend/utils/cache/relcache.c
M src/backend/utils/misc/postgresql.conf.sample
M src/bin/pg_controldata/pg_controldata.c
M src/include/access/heapam_xlog.h
M src/include/access/xact.h
M src/include/access/xlog.h
M src/include/access/xlog_internal.h
M src/include/utils/rel.h
M src/include/utils/relcache.h
M src/tools/pgindent/typedefs.list

Fix possible crash with nested SubLinks.

commit   : 9ec6199d18d6235cc4b4d5e4e8986e73b55b14d8    
  
author   : Tom Lane <[email protected]>    
date     : Tue, 10 Dec 2013 16:10:17 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Tue, 10 Dec 2013 16:10:17 -0500    

Click here for diff

An expression such as WHERE (... x IN (SELECT ...) ...) IN (SELECT ...)  
could produce an invalid plan that results in a crash at execution time,  
if the planner attempts to flatten the outer IN into a semi-join.  
This happens because convert_testexpr() was not expecting any nested  
SubLinks and would wrongly replace any PARAM_SUBLINK Params belonging  
to the inner SubLink.  (I think the comment denying that this case could  
happen was wrong when written; it's certainly been wrong for quite a long  
time, since very early versions of the semijoin flattening logic.)  
  
Per report from Teodor Sigaev.  Back-patch to all supported branches.  

M src/backend/optimizer/plan/subselect.c
M src/test/regress/expected/subselect.out
M src/test/regress/sql/subselect.sql

Rename TABLE() to ROWS FROM().

commit   : 53685d79813a46c7e3a46ae4b1210f608d41d6ab    
  
author   : Noah Misch <[email protected]>    
date     : Tue, 10 Dec 2013 09:34:37 -0500    
  
committer: Noah Misch <[email protected]>    
date     : Tue, 10 Dec 2013 09:34:37 -0500    

Click here for diff

SQL-standard TABLE() is a subset of UNNEST(); they deal with arrays and  
other collection types.  This feature, however, deals with set-returning  
functions.  Use a different syntax for this feature to keep open the  
possibility of implementing the standard TABLE().  

M doc/src/sgml/queries.sgml
M doc/src/sgml/ref/select.sgml
M src/backend/nodes/copyfuncs.c
M src/backend/nodes/equalfuncs.c
M src/backend/nodes/outfuncs.c
M src/backend/parser/gram.y
M src/backend/parser/parse_clause.c
M src/backend/utils/adt/ruleutils.c
M src/include/nodes/parsenodes.h
M src/test/regress/expected/rangefuncs.out
M src/test/regress/sql/rangefuncs.sql

pgcrypto docs: update cpu type used in duration testing

commit   : 01cc1fecfdecc37649b3996100ab1f03ccc8ab7e    
  
author   : Bruce Momjian <[email protected]>    
date     : Mon, 9 Dec 2013 16:12:24 -0500    
  
committer: Bruce Momjian <[email protected]>    
date     : Mon, 9 Dec 2013 16:12:24 -0500    

Click here for diff

M doc/src/sgml/pgcrypto.sgml

pgcrypto docs: update encryption timings and add relative times

commit   : d6464fdc0a591662e5e5ee1b0303932e89cb027c    
  
author   : Bruce Momjian <[email protected]>    
date     : Mon, 9 Dec 2013 16:10:47 -0500    
  
committer: Bruce Momjian <[email protected]>    
date     : Mon, 9 Dec 2013 16:10:47 -0500    

Click here for diff

Miles Elam  

M doc/src/sgml/pgcrypto.sgml

Fixups for dsm.c's file descriptor handling.

commit   : d9250da032e723d80bb0150b9276cc544df6a087    
  
author   : Robert Haas <[email protected]>    
date     : Mon, 9 Dec 2013 11:12:33 -0500    
  
committer: Robert Haas <[email protected]>    
date     : Mon, 9 Dec 2013 11:12:33 -0500    

Click here for diff

Per complaint from Tom Lane.  

M src/backend/storage/ipc/dsm.c

Fix pg_stat_statements build on 32-bit systems

commit   : 33d3f5594ac0cc4b6df3bf29b39db93bc32f1213    
  
author   : Magnus Hagander <[email protected]>    
date     : Sun, 8 Dec 2013 11:59:07 +0100    
  
committer: Magnus Hagander <[email protected]>    
date     : Sun, 8 Dec 2013 11:59:07 +0100    

Click here for diff

Peter Geoghegan  

M contrib/pg_stat_statements/pg_stat_statements.c

commit   : d6ca510d9dbacceb3444f00fcfbba2c80dca4c8f    
  
author   : Joe Conway <[email protected]>    
date     : Sat, 7 Dec 2013 17:00:26 -0800    
  
committer: Joe Conway <[email protected]>    
date     : Sat, 7 Dec 2013 17:00:26 -0800    

Click here for diff

Previous commit e5de601267d98c5d60df6de8d436685c7105d149 modified dblink  
to ensure client encoding matched the server. However the added  
PQsetClientEncoding() call added significant overhead. Restore original  
performance in the common case where client encoding already matches  
server encoding by doing nothing in that case. Applies to all active  
branches.  
  
Issue reported and work sponsored by Zonar Systems.  

M contrib/dblink/dblink.c

Fix a couple of typos

commit   : 54aa5ef7f2dbe979843daf0c7a0d98f6709da4e6    
  
author   : Magnus Hagander <[email protected]>    
date     : Sat, 7 Dec 2013 23:08:17 +0100    
  
committer: Magnus Hagander <[email protected]>    
date     : Sat, 7 Dec 2013 23:08:17 +0100    

Click here for diff

Noted by Peter Geoghegan  

M doc/src/sgml/pgstatstatements.sgml

SSL: Support ECDH key exchange

commit   : 3164721462d547fa2d15e2a2f07eb086a3590fd5    
  
author   : Peter Eisentraut <[email protected]>    
date     : Sat, 7 Dec 2013 15:11:44 -0500    
  
committer: Peter Eisentraut <[email protected]>    
date     : Sat, 7 Dec 2013 15:11:44 -0500    

Click here for diff

This sets up ECDH key exchange, when compiling against OpenSSL that  
supports EC.  Then the ECDHE-RSA and ECDHE-ECDSA cipher suites can be  
used for SSL connections.  The latter one means that EC keys are now  
usable.  
  
The reason for EC key exchange is that it's faster than DHE and it  
allows to go to higher security levels where RSA will be horribly slow.  
  
There is also new GUC option ssl_ecdh_curve that specifies the curve  
name used for ECDH.  It defaults to "prime256v1", which is the most  
common curve in use in HTTPS.  
  
From: Marko Kreen <[email protected]>  
Reviewed-by: Adrian Klaver <[email protected]>  

M doc/src/sgml/config.sgml
M src/backend/libpq/be-secure.c
M src/backend/utils/misc/guc.c
M src/backend/utils/misc/postgresql.conf.sample

Expose qurey ID in pg_stat_statements view.

commit   : 91484409bdd17f330d10671d388b72d4ef1451d7    
  
author   : Fujii Masao <[email protected]>    
date     : Sun, 8 Dec 2013 02:06:02 +0900    
  
committer: Fujii Masao <[email protected]>    
date     : Sun, 8 Dec 2013 02:06:02 +0900    

Click here for diff

The query ID is the internal hash identifier of the statement,  
and was not available in pg_stat_statements view so far.  
  
Daniel Farina, Sameer Thakur and Peter Geoghegan, reviewed by me.  

M contrib/pg_stat_statements/Makefile
A contrib/pg_stat_statements/pg_stat_statements–1.1–1.2.sql
M contrib/pg_stat_statements/pg_stat_statements–1.1.sql
A contrib/pg_stat_statements/pg_stat_statements–1.2.sql
M contrib/pg_stat_statements/pg_stat_statements.c
M contrib/pg_stat_statements/pg_stat_statements.control
M doc/src/sgml/pgstatstatements.sgml

SSL: Add configuration option to prefer server cipher order

commit   : ef3267523d1ecf53bb6d4ffbeb6a0ae1af84ed47    
  
author   : Peter Eisentraut <[email protected]>    
date     : Sat, 7 Dec 2013 08:04:27 -0500    
  
committer: Peter Eisentraut <[email protected]>    
date     : Sat, 7 Dec 2013 08:04:27 -0500    

Click here for diff

By default, OpenSSL (and SSL/TLS in general) lets the client cipher  
order take priority.  This is OK for browsers where the ciphers were  
tuned, but few PostgreSQL client libraries make the cipher order  
configurable.  So it makes sense to have the cipher order in  
postgresql.conf take priority over client defaults.  
  
This patch adds the setting "ssl_prefer_server_ciphers" that can be  
turned on so that server cipher order is preferred.  Per discussion,  
this now defaults to on.  
  
From: Marko Kreen <[email protected]>  
Reviewed-by: Adrian Klaver <[email protected]>  

M doc/src/sgml/config.sgml
M src/backend/libpq/be-secure.c
M src/backend/utils/misc/guc.c
M src/backend/utils/misc/postgresql.conf.sample

docs: update partition encryption options

commit   : 8fe3d90d34c26083e9856cb134dfe17a5f6999aa    
  
author   : Bruce Momjian <[email protected]>    
date     : Fri, 6 Dec 2013 09:47:39 -0500    
  
committer: Bruce Momjian <[email protected]>    
date     : Fri, 6 Dec 2013 09:47:39 -0500    

Click here for diff

Text from Adam Vande More  

M doc/src/sgml/runtime.sgml

docs: clarify SSL certificate authority chain docs

commit   : fa4add50c4ea97c48881fa8cb3863df80141643c    
  
author   : Bruce Momjian <[email protected]>    
date     : Fri, 6 Dec 2013 09:42:08 -0500    
  
committer: Bruce Momjian <[email protected]>    
date     : Fri, 6 Dec 2013 09:42:08 -0500    

Click here for diff

Previously, the requirements of how intermediate certificates were  
handled and their chain to root certificates was unclear.  

M doc/src/sgml/libpq.sgml
M doc/src/sgml/runtime.sgml

Fix improper abort during update chain locking

commit   : 312bde3d404f770943c992992565c73f0336d21b    
  
author   : Alvaro Herrera <[email protected]>    
date     : Thu, 5 Dec 2013 17:47:51 -0300    
  
committer: Alvaro Herrera <[email protected]>    
date     : Thu, 5 Dec 2013 17:47:51 -0300    

Click here for diff

In 247c76a98909, I added some code to do fine-grained checking of  
MultiXact status of locking/updating transactions when traversing an  
update chain.  There was a thinko in that patch which would have the  
traversing abort, that is return HeapTupleUpdated, when the other  
transaction is a committed lock-only.  In this case we should ignore it  
and return success instead.  Of course, in the case where there is a  
committed update, HeapTupleUpdated is the correct return value.  
  
A user-visible symptom of this bug is that in REPEATABLE READ and  
SERIALIZABLE transaction isolation modes spurious serializability errors  
can occur:  
  ERROR:  could not serialize access due to concurrent update  
  
In order for this to happen, there needs to be a tuple that's key-share-  
locked and also updated, and the update must abort; a subsequent  
transaction trying to acquire a new lock on that tuple would abort with  
the above error.  The reason is that the initial FOR KEY SHARE is seen  
as committed by the new locking transaction, which triggers this bug.  
(If the UPDATE commits, then the serialization error is correctly  
reported.)  
  
When running a query in READ COMMITTED mode, what happens is that the  
locking is aborted by the HeapTupleUpdated return value, then  
EvalPlanQual fetches the newest version of the tuple, which is then the  
only version that gets locked.  (The second time the tuple is checked  
there is no misbehavior on the committed lock-only, because it's not  
checked by the code that traverses update chains; so no bug.) Only the  
newest version of the tuple is locked, not older ones, but this is  
harmless.  
  
The isolation test added by this commit illustrates the desired  
behavior, including the proper serialization errors that get thrown.  
  
Backpatch to 9.3.  

M src/backend/access/heap/heapam.c
A src/test/isolation/expected/multixact-no-forget.out
A src/test/isolation/expected/multixact-no-forget_1.out
M src/test/isolation/isolation_schedule
A src/test/isolation/specs/multixact-no-forget.spec

Clear retry flags properly in replacement OpenSSL sock_write function.

commit   : 74242c23c1c6428c6da09fa37264c7f4f1438738    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 5 Dec 2013 12:48:28 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 5 Dec 2013 12:48:28 -0500    

Click here for diff

Current OpenSSL code includes a BIO_clear_retry_flags() step in the  
sock_write() function.  Either we failed to copy the code correctly, or  
they added this since we copied it.  In any case, lack of the clear step  
appears to be the cause of the server lockup after connection loss reported  
in bug #8647 from Valentine Gogichashvili.  Assume that this is correct  
coding for all OpenSSL versions, and hence back-patch to all supported  
branches.  
  
Diagnosis and patch by Alexander Kukushkin.  

M src/backend/libpq/be-secure.c

Avoid resetting Xmax when it's a multi with an aborted update

commit   : 07aeb1fec571920839822c11851d38ef48952d6c    
  
author   : Alvaro Herrera <[email protected]>    
date     : Thu, 5 Dec 2013 12:21:55 -0300    
  
committer: Alvaro Herrera <[email protected]>    
date     : Thu, 5 Dec 2013 12:21:55 -0300    

Click here for diff

HeapTupleSatisfiesUpdate can very easily "forget" tuple locks while  
checking the contents of a multixact and finding it contains an aborted  
update, by setting the HEAP_XMAX_INVALID bit.  This would lead to  
concurrent transactions not noticing any previous locks held by  
transactions that might still be running, and thus being able to acquire  
subsequent locks they wouldn't be normally able to acquire.  
  
This bug was introduced in commit 1ce150b7bb; backpatch this fix to 9.3,  
like that commit.  
  
This change reverts the change to the delete-abort-savept isolation test  
in 1ce150b7bb, because that behavior change was caused by this bug.  
  
Noticed by Andres Freund while investigating a different issue reported  
by Noah Misch.  

M src/backend/utils/time/tqual.c
M src/test/isolation/expected/delete-abort-savept.out

build: pass EXTRA_REGRESS_OPTS to secondary regression tests

commit   : 86ef4796f5120c55d1a48cfab52e51df8ed271b5    
  
author   : Bruce Momjian <[email protected]>    
date     : Wed, 4 Dec 2013 10:14:45 -0500    
  
committer: Bruce Momjian <[email protected]>    
date     : Wed, 4 Dec 2013 10:14:45 -0500    

Click here for diff

Christoph Berg  

M contrib/pg_upgrade/Makefile
M src/Makefile.global.in
M src/test/isolation/Makefile

doc: split long query into multiple lines

commit   : 5043fc8251fa272177c69b86a8df2cb79d926521    
  
author   : Bruce Momjian <[email protected]>    
date     : Wed, 4 Dec 2013 10:03:13 -0500    
  
committer: Bruce Momjian <[email protected]>    
date     : Wed, 4 Dec 2013 10:03:13 -0500    

Click here for diff

Report from Erik Rijkers  

M doc/src/sgml/advanced.sgml

Fix whitespace

commit   : dfd5151c5800448a2be521797f95e1aa63d87b67    
  
author   : Peter Eisentraut <[email protected]>    
date     : Tue, 3 Dec 2013 22:57:08 -0500    
  
committer: Peter Eisentraut <[email protected]>    
date     : Tue, 3 Dec 2013 22:57:08 -0500    

Click here for diff

M contrib/pg_upgrade/server.c

Don't include unused space in LOG_NEWPAGE records.

commit   : 9e857436ef7dff8fb8a0bf43cfe62650e2be6be9    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Wed, 4 Dec 2013 00:10:47 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Wed, 4 Dec 2013 00:10:47 +0200    

Click here for diff

This is the same trick we use when taking a full page image of a buffer  
passed to XLogInsert.  

M src/backend/access/gin/gininsert.c
M src/backend/access/gist/gist.c
M src/backend/access/heap/heapam.c
M src/backend/access/heap/rewriteheap.c
M src/backend/access/nbtree/nbtree.c
M src/backend/access/nbtree/nbtsort.c
M src/backend/access/spgist/spginsert.c
M src/backend/commands/tablecmds.c
M src/backend/commands/vacuumlazy.c
M src/include/access/heapam_xlog.h
M src/include/access/xlog_internal.h

Fix full-page writes of internal GIN pages.

commit   : 22122c83f1331d03e8317afbfcfbb65bef9c82d2    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Tue, 3 Dec 2013 22:13:16 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Tue, 3 Dec 2013 22:13:16 +0200    

Click here for diff

Insertion to a non-leaf GIN page didn't make a full-page image of the page,  
which is wrong. The code used to do it correctly, but was changed (commit  
853d1c3103fa961ae6219f0281885b345593d101) because the redo-routine didn't  
track incomplete splits correctly when the page was restored from a full  
page image. Of course, that was not right way to fix it, the redo routine  
should've been fixed instead. The redo-routine was surreptitiously fixed  
in 2010 (commit 4016bdef8aded77b4903c457050622a5a1815c16), so all we need  
to do now is revert the code that creates the record to its original form.  
  
This doesn't change the format of the WAL record.  
  
Backpatch to all supported versions.  

M src/backend/access/gin/gindatapage.c
M src/backend/access/gin/ginentrypage.c

C comment: again update comment for pg_fe_sendauth for error cases

commit   : 4a8adfd4d09c7885daf548ecd53d4999f168a174    
  
author   : Bruce Momjian <[email protected]>    
date     : Tue, 3 Dec 2013 11:42:18 -0500    
  
committer: Bruce Momjian <[email protected]>    
date     : Tue, 3 Dec 2013 11:42:18 -0500    

Click here for diff

M src/interfaces/libpq/fe-auth.c

Update C comment for pg_fe_getauthname

commit   : 6a6b7bbb81cd21d0f9aa70b850b791b61fb7e03d    
  
author   : Bruce Momjian <[email protected]>    
date     : Tue, 3 Dec 2013 11:33:46 -0500    
  
committer: Bruce Momjian <[email protected]>    
date     : Tue, 3 Dec 2013 11:33:46 -0500    

Click here for diff

This function no longer takes an argument.  

M src/interfaces/libpq/fe-auth.c

libpq: change PQconndefaults() to ignore invalid service files

commit   : 9e0a97f1c8316e36fa4a8626e0a60792b0fb0c2e    
  
author   : Bruce Momjian <[email protected]>    
date     : Tue, 3 Dec 2013 11:11:56 -0500    
  
committer: Bruce Momjian <[email protected]>    
date     : Tue, 3 Dec 2013 11:11:56 -0500    

Click here for diff

Previously missing or invalid service files returned NULL.  Also fix  
pg_upgrade to report "out of memory" for a null return from  
PQconndefaults().  
  
Patch by Steve Singer, rewritten by me  

M contrib/pg_upgrade/server.c
M doc/src/sgml/libpq.sgml
M src/interfaces/libpq/fe-auth.c
M src/interfaces/libpq/fe-auth.h
M src/interfaces/libpq/fe-connect.c

doc: Refine documentation about recovery command exist status

commit   : 95e3d50539afcdcd4b75b4ac5baa9f8fc05324d9    
  
author   : Peter Eisentraut <[email protected]>    
date     : Mon, 2 Dec 2013 22:31:41 -0500    
  
committer: Peter Eisentraut <[email protected]>    
date     : Mon, 2 Dec 2013 22:31:41 -0500    

Click here for diff

Add more documentation about how different exit codes and signals are  
handled in each case.  
  
Reviewed-by: Peter Geoghegan <[email protected]>  

M doc/src/sgml/backup.sgml
M doc/src/sgml/recovery-config.sgml

Report exit code from external recovery commands properly

commit   : fef88b3fdaa3537c64e3d7df9261bc75ece80d3f    
  
author   : Peter Eisentraut <[email protected]>    
date     : Wed, 13 Nov 2013 06:38:18 -0500    
  
committer: Peter Eisentraut <[email protected]>    
date     : Wed, 13 Nov 2013 06:38:18 -0500    

Click here for diff

When an external recovery command such as restore_command or  
archive_cleanup_command fails, report the exit code properly,  
distinguishing signals and normal exists, using the existing  
wait_result_to_str() facility, instead of just reporting the return  
value from system().  
  
Reviewed-by: Peter Geoghegan <[email protected]>  

M src/backend/access/transam/xlogarchive.c

Fix crash in assign_collations_walker for EXISTS with empty SELECT list.

commit   : 7ab321404c4f721a22e86f36f68fe5e94f65e54d    
  
author   : Tom Lane <[email protected]>    
date     : Mon, 2 Dec 2013 20:28:45 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Mon, 2 Dec 2013 20:28:45 -0500    

Click here for diff

We (I think I, actually) forgot about this corner case while coding  
collation resolution.  Per bug #8648 from Arjen Nienhuis.  

M src/backend/parser/parse_collate.c
M src/test/regress/expected/subselect.out
M src/test/regress/sql/subselect.sql

Update release notes for 9.3.2, 9.2.6, 9.1.11, 9.0.15, 8.4.19.

commit   : 02bb4bbc66ce2ce7ebfcb27a8a9e002ed9cadd2a    
  
author   : Tom Lane <[email protected]>    
date     : Mon, 2 Dec 2013 15:53:55 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Mon, 2 Dec 2013 15:53:55 -0500    

Click here for diff

M doc/src/sgml/release-8.4.sgml
M doc/src/sgml/release-9.0.sgml
M doc/src/sgml/release-9.1.sgml
M doc/src/sgml/release-9.2.sgml
M doc/src/sgml/release-9.3.sgml

doc: update wording of ineffective SET and ABORT commands

commit   : 54916b99f7e97aa6e32a4f265527f7517539d802    
  
author   : Bruce Momjian <[email protected]>    
date     : Mon, 2 Dec 2013 12:51:28 -0500    
  
committer: Bruce Momjian <[email protected]>    
date     : Mon, 2 Dec 2013 12:51:28 -0500    

Click here for diff

Wording by Alvaro Herrera  

M doc/src/sgml/ref/abort.sgml
M doc/src/sgml/ref/rollback.sgml
M doc/src/sgml/ref/set.sgml
M doc/src/sgml/ref/set_constraints.sgml
M doc/src/sgml/ref/set_transaction.sgml

Improve draft release notes.

commit   : b8b7b723f29e39769486545aef61d71edcadff80    
  
author   : Tom Lane <[email protected]>    
date     : Mon, 2 Dec 2013 12:17:46 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Mon, 2 Dec 2013 12:17:46 -0500    

Click here for diff

Per suggestions from Andres Freund.  Also fix spelling of  
Sergey Burladyan's name.  

M doc/src/sgml/release-9.3.sgml

Increase git_changelog's timestamp_slop from 10 min to 1 day.

commit   : 7a1e34d3713c13b3b2c81f0410a6629362b37b00    
  
author   : Tom Lane <[email protected]>    
date     : Mon, 2 Dec 2013 11:33:43 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Mon, 2 Dec 2013 11:33:43 -0500    

Click here for diff

Many committers seem to now be using a work flow in which back-patched  
commits are timestamped minutes or even hours apart in different branches  
(most likely because they commit in one branch before starting work on  
the next one).  git_changelog was failing to merge its reports in such  
cases, so increase the max time it's willing to merge commits across.  
I considered getting rid of the limit altogether, but that produces  
some odd results in terms of how the merged commit gets sorted relative  
to unrelated commits.  

M src/tools/git_changelog

Flag mmap implemenation of dynamic shared memory as resize-capable.

commit   : c6d4b1dd3e9eabca68caea6256ed8bc58dfa0917    
  
author   : Robert Haas <[email protected]>    
date     : Mon, 2 Dec 2013 11:18:54 -0500    
  
committer: Robert Haas <[email protected]>    
date     : Mon, 2 Dec 2013 11:18:54 -0500    

Click here for diff

Error noted by Heikki Linnakangas  

M src/backend/storage/ipc/dsm_impl.c

Make NUM_TOCHAR_prepare and NUM_TOCHAR_finish macros declare "len".

commit   : a8656a3ab02db5b1de0d696dc8cf588efe7c1341    
  
author   : Robert Haas <[email protected]>    
date     : Mon, 2 Dec 2013 10:51:06 -0500    
  
committer: Robert Haas <[email protected]>    
date     : Mon, 2 Dec 2013 10:51:06 -0500    

Click here for diff

Remove the variable from the enclosing scopes so that nothing can be  
relying on it.  The net result of this refactoring is that we get rid  
of a few unnecessary strlen() calls.  
  
Original patch from Greg Jaskiewicz, substantially expanded by me.  

M src/backend/utils/adt/formatting.c

Avoid out-of-bounds read in errfinish if error_stack_depth < 0.

commit   : 9d140f7be2836e3baf6c9dc7989dea69ef693532    
  
author   : Robert Haas <[email protected]>    
date     : Mon, 2 Dec 2013 10:40:33 -0500    
  
committer: Robert Haas <[email protected]>    
date     : Mon, 2 Dec 2013 10:40:33 -0500    

Click here for diff

If errordata_stack_depth < 0, we won't find that out and correct the  
problem until CHECK_STACK_DEPTH() is invoked.  In the meantime,  
elevel will be set based on an invalid read.  This is probably  
harmless in practice, but it seems cleaner this way.  
  
Xi Wang  

M src/backend/utils/error/elog.c

Translation updates

commit   : 3e3520cf7a70aa85f55a7be37924aaa1809a4be3    
  
author   : Peter Eisentraut <[email protected]>    
date     : Mon, 2 Dec 2013 00:09:43 -0500    
  
committer: Peter Eisentraut <[email protected]>    
date     : Mon, 2 Dec 2013 00:09:43 -0500    

Click here for diff

M src/backend/po/de.po
M src/backend/po/fr.po
M src/backend/po/it.po
M src/bin/initdb/po/cs.po
M src/bin/pg_basebackup/po/cs.po
M src/bin/pg_config/po/cs.po
M src/bin/pg_controldata/po/cs.po
M src/bin/pg_ctl/po/cs.po
M src/bin/pg_dump/po/cs.po
M src/bin/pg_resetxlog/po/cs.po
M src/bin/psql/po/cs.po
M src/bin/scripts/po/cs.po
M src/interfaces/ecpg/ecpglib/po/cs.po
M src/interfaces/ecpg/preproc/po/cs.po
M src/interfaces/libpq/po/cs.po
M src/pl/plperl/po/cs.po
M src/pl/plpgsql/src/po/cs.po
M src/pl/plpython/po/cs.po
M src/pl/tcl/po/cs.po

Draft release notes for 9.3.2.

commit   : 23e796de15567e9d31e8f9e8661828179f24a7be    
  
author   : Tom Lane <[email protected]>    
date     : Sun, 1 Dec 2013 18:46:09 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Sun, 1 Dec 2013 18:46:09 -0500    

Click here for diff

I'm putting these up for review before I start to extract the relevant  
subsets for the older branches.  It'll be easier to make any suggested  
wording improvements at this stage.  

M doc/src/sgml/release-9.3.sgml

doc: Disable preface.autolabel in XSLT

commit   : 3c81b5c1d28faaacbd56583ebf00dd5f3db57c31    
  
author   : Peter Eisentraut <[email protected]>    
date     : Sun, 1 Dec 2013 17:13:23 -0500    
  
committer: Peter Eisentraut <[email protected]>    
date     : Sun, 1 Dec 2013 17:13:23 -0500    

Click here for diff

The makes the output more consistent with the existing DSSSL setup.  

M doc/src/sgml/stylesheet-common.xsl

Update time zone data files to tzdata release 2013h.

commit   : 335470251d69c5c63a864c706db02fe173576834    
  
author   : Tom Lane <[email protected]>    
date     : Sun, 1 Dec 2013 14:11:44 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Sun, 1 Dec 2013 14:11:44 -0500    

Click here for diff

DST law changes in Argentina, Brazil, Jordan, Libya, Liechtenstein,  
Morocco, Palestine.  New timezone abbreviations WIB, WIT, WITA for  
Indonesia.  

M src/timezone/data/africa
M src/timezone/data/antarctica
M src/timezone/data/asia
M src/timezone/data/australasia
M src/timezone/data/backward
M src/timezone/data/etcetera
M src/timezone/data/europe
M src/timezone/data/iso3166.tab
M src/timezone/data/leapseconds
M src/timezone/data/northamerica
M src/timezone/data/southamerica
M src/timezone/data/zone.tab
M src/timezone/known_abbrevs.txt
M src/timezone/tznames/Asia.txt

Editorial corrections to the October 2013 minor-release notes.

commit   : 47960354024eac823981d7f264a0cf804b0c42c9    
  
author   : Tom Lane <[email protected]>    
date     : Sat, 30 Nov 2013 16:57:12 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Sat, 30 Nov 2013 16:57:12 -0500    

Click here for diff

This is mostly to fix incorrect migration instructions: since the preceding  
minor releases advised reindexing some GIST indexes, it's important that  
we back-link to that advice rather than earlier instances.  
  
Also improve some bug descriptions and fix a few typos.  
  
No back-patch yet; these files will get copied into the back branches  
later in the release process.  

M doc/src/sgml/release-8.4.sgml
M doc/src/sgml/release-9.0.sgml
M doc/src/sgml/release-9.1.sgml
M doc/src/sgml/release-9.2.sgml
M doc/src/sgml/release-9.3.sgml

pg_upgrade: Handle default_transaction_read_only settings

commit   : e7d56aee2d1805cd9d280c0e6f8c8af80a13aa3e    
  
author   : Bruce Momjian <[email protected]>    
date     : Sat, 30 Nov 2013 16:50:33 -0500    
  
committer: Bruce Momjian <[email protected]>    
date     : Sat, 30 Nov 2013 16:50:33 -0500    

Click here for diff

Setting default_transaction_read_only=true could prevent pg_upgrade from  
completing, so prepend default_transaction_read_only=false to  
PGOPTIONS.  

M contrib/pg_upgrade/option.c

Fix pg_dumpall to work for databases flagged as read-only.

commit   : 4bd371f6f886446b6c0886f088992e6f3d4ab4a2    
  
author   : Kevin Grittner <[email protected]>    
date     : Sat, 30 Nov 2013 11:24:56 -0600    
  
committer: Kevin Grittner <[email protected]>    
date     : Sat, 30 Nov 2013 11:24:56 -0600    

Click here for diff

pg_dumpall's charter is to be able to recreate a database cluster's  
contents in a virgin installation, but it was failing to honor that  
contract if the cluster had any ALTER DATABASE SET  
default_transaction_read_only settings.  By including a SET command  
for the connection for each connection opened by pg_dumpall output,  
errors are avoided and the source cluster is successfully  
recreated.  
  
There was discussion of whether to also set this for the connection  
applying pg_dump output, but it was felt that it was both less  
appropriate in that context, and far easier to work around.  
  
Backpatch to all supported branches.  

M src/bin/pg_dump/pg_dumpall.c

Remove use of obsolescent Autoconf macros

commit   : 34fa72ec9cfc1f5c4b11b67b2ce7eac6caca9fa5    
  
author   : Peter Eisentraut <[email protected]>    
date     : Sat, 30 Nov 2013 09:17:08 -0500    
  
committer: Peter Eisentraut <[email protected]>    
date     : Sat, 30 Nov 2013 09:17:08 -0500    

Click here for diff

Remove the use of the following macros, which are obsolescent according  
to the Autoconf documentation:  
  
- AC_C_CONST  
- AC_C_STRINGIZE  
- AC_C_VOLATILE  
- AC_FUNC_MEMCMP  

M configure
M configure.in
M src/include/c.h
M src/include/pg_config.h.in
M src/include/pg_config.h.win32
D src/port/memcmp.c

doc: Simplify handling of variablelists in XSLT build

commit   : 1eafea5d1bc5cf934eaf96e65115841fe3829986    
  
author   : Peter Eisentraut <[email protected]>    
date     : Fri, 29 Nov 2013 22:42:47 -0500    
  
committer: Peter Eisentraut <[email protected]>    
date     : Fri, 29 Nov 2013 22:42:47 -0500    

Click here for diff

The previously used custom template is no longer necessary because  
parameters provided by the standard style sheet can achieve the same  
outcome.  

M doc/src/sgml/stylesheet-common.xsl
M doc/src/sgml/stylesheet.xsl

Fix a couple of bugs in MultiXactId freezing

commit   : 2393c7d102368717283d7121a6ea8164e902b011    
  
author   : Alvaro Herrera <[email protected]>    
date     : Thu, 28 Nov 2013 19:17:21 -0300    
  
committer: Alvaro Herrera <[email protected]>    
date     : Thu, 28 Nov 2013 19:17:21 -0300    

Click here for diff

Both heap_freeze_tuple() and heap_tuple_needs_freeze() neglected to look  
into a multixact to check the members against cutoff_xid.  This means  
that a very old Xid could survive hidden within a multi, possibly  
outliving its CLOG storage.  In the distant future, this would cause  
clog lookup failures:  
ERROR:  could not access status of transaction 3883960912  
DETAIL:  Could not open file "pg_clog/0E78": No such file or directory.  
  
This mostly was problematic when the updating transaction aborted, since  
in that case the row wouldn't get pruned away earlier in vacuum and the  
multixact could possibly survive for a long time.  In many cases, data  
that is inaccessible for this reason way can be brought back  
heuristically.  
  
As a second bug, heap_freeze_tuple() didn't properly handle multixacts  
that need to be frozen according to cutoff_multi, but whose updater xid  
is still alive.  Instead of preserving the update Xid, it just set Xmax  
invalid, which leads to both old and new tuple versions becoming  
visible.  This is pretty rare in practice, but a real threat  
nonetheless.  Existing corrupted rows, unfortunately, cannot be repaired  
in an automated fashion.  
  
Existing physical replicas might have already incorrectly frozen tuples  
because of different behavior than in master, which might only become  
apparent in the future once pg_multixact/ is truncated; it is  
recommended that all clones be rebuilt after upgrading.  
  
Following code analysis caused by bug report by J Smith in message  
CADFUPgc5bmtv-yg9znxV-vcfkb+JPRqs7m2OesQXaM_4Z1JpdQ@mail.gmail.com  
and privately by F-Secure.  
  
Backpatch to 9.3, where freezing of MultiXactIds was introduced.  
  
Analysis and patch by Andres Freund, with some tweaks by Álvaro.  

M src/backend/access/heap/heapam.c
M src/backend/access/transam/multixact.c

Don't TransactionIdDidAbort in HeapTupleGetUpdateXid

commit   : 1ce150b7bb14105ddc190c5f1acf2ae1a9b2854a    
  
author   : Alvaro Herrera <[email protected]>    
date     : Fri, 29 Nov 2013 16:08:06 -0300    
  
committer: Alvaro Herrera <[email protected]>    
date     : Fri, 29 Nov 2013 16:08:06 -0300    

Click here for diff

It is dangerous to do so, because some code expects to be able to see what's  
the true Xmax even if it is aborted (particularly while traversing HOT  
chains).  So don't do it, and instead rely on the callers to verify for  
abortedness, if necessary.  
  
Several race conditions and bugs fixed in the process.  One isolation test  
changes the expected output due to these.  
  
This also reverts commit c235a6a589b, which is no longer necessary.  
  
Backpatch to 9.3, where this function was introduced.  
  
Andres Freund  

M src/backend/access/heap/heapam.c
M src/backend/access/heap/pruneheap.c
M src/backend/utils/time/tqual.c
M src/test/isolation/expected/delete-abort-savept.out

Truncate pg_multixact/'s contents during crash recovery

commit   : 1df0122daa6510eed4146033379a5055f66f5a8e    
  
author   : Alvaro Herrera <[email protected]>    
date     : Fri, 29 Nov 2013 11:26:41 -0300    
  
committer: Alvaro Herrera <[email protected]>    
date     : Fri, 29 Nov 2013 11:26:41 -0300    

Click here for diff

Commit 9dc842f08 of 8.2 era prevented MultiXact truncation during crash  
recovery, because there was no guarantee that enough state had been  
setup, and because it wasn't deemed to be a good idea to remove data  
during crash recovery anyway.  Since then, due to Hot-Standby, streaming  
replication and PITR, the amount of time a cluster can spend doing crash  
recovery has increased significantly, to the point that a cluster may  
even never come out of it.  This has made not truncating the content of  
pg_multixact/ not defensible anymore.  
  
To fix, take care to setup enough state for multixact truncation before  
crash recovery starts (easy since checkpoints contain the required  
information), and move the current end-of-recovery actions to a new  
TrimMultiXact() function, analogous to TrimCLOG().  
  
At some later point, this should probably done similarly to the way  
clog.c is doing it, which is to just WAL log truncations, but we can't  
do that for the back branches.  
  
Back-patch to 9.0.  8.4 also has the problem, but since there's no hot  
standby there, it's much less pressing.  In 9.2 and earlier, this patch  
is simpler than in newer branches, because multixact access during  
recovery isn't required.  Add appropriate checks to make sure that's not  
happening.  
  
Andres Freund  

M src/backend/access/transam/multixact.c
M src/backend/access/transam/xlog.c
M src/include/access/multixact.h

Fix full-table-vacuum request mechanism for MultiXactIds

commit   : f54106f77e6d71cbb3fa0924095e5142341fde2b    
  
author   : Alvaro Herrera <[email protected]>    
date     : Thu, 28 Nov 2013 16:52:54 -0300    
  
committer: Alvaro Herrera <[email protected]>    
date     : Thu, 28 Nov 2013 16:52:54 -0300    

Click here for diff

While autovacuum dutifully launched anti-multixact-wraparound vacuums  
when the multixact "age" was reached, the vacuum code was not aware that  
it needed to make them be full table vacuums.  As the resulting  
partial-table vacuums aren't capable of actually increasing relminmxid,  
autovacuum continued to launch anti-wraparound vacuums that didn't have  
the intended effect, until age of relfrozenxid caused the vacuum to  
finally be a full table one via vacuum_freeze_table_age.  
  
To fix, introduce logic for multixacts similar to that for plain  
TransactionIds, using the same GUCs.  
  
Backpatch to 9.3, where permanent MultiXactIds were introduced.  
  
Andres Freund, some cleanup by Álvaro  

M src/backend/access/transam/multixact.c
M src/backend/commands/cluster.c
M src/backend/commands/vacuum.c
M src/backend/commands/vacuumlazy.c
M src/include/access/multixact.h
M src/include/commands/vacuum.h

Replace hardcoded 200000000 with autovacuum_freeze_max_age

commit   : 76a31c689c627268067175b5d0687ce0dac9a4f4    
  
author   : Alvaro Herrera <[email protected]>    
date     : Thu, 28 Nov 2013 16:45:29 -0300    
  
committer: Alvaro Herrera <[email protected]>    
date     : Thu, 28 Nov 2013 16:45:29 -0300    

Click here for diff

Parts of the code used autovacuum_freeze_max_age to determine whether  
anti-multixact-wraparound vacuums are necessary, while others used a  
hardcoded 200000000 value.  This leads to problems when  
autovacuum_freeze_max_age is set to a non-default value.  Use the latter  
everywhere.  
  
Backpatch to 9.3, where vacuuming of multixacts was introduced.  
  
Andres Freund  

M src/backend/access/transam/multixact.c

Fix assorted issues in pg_ctl's pgwin32_CommandLine().

commit   : 79193c75f8c78ff494f32cd7b7ee79d7166c225b    
  
author   : Tom Lane <[email protected]>    
date     : Fri, 29 Nov 2013 18:34:07 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Fri, 29 Nov 2013 18:34:07 -0500    

Click here for diff

Ensure that the invocation command for postgres or pg_ctl runservice  
double-quotes the executable's pathname; failure to do this leads to  
trouble when the path contains spaces.  
  
Also, ensure that the path ends in ".exe" in both cases and uses  
backslashes rather than slashes as directory separators.  The latter issue  
is reported to confuse some third-party tools such as Symantec Backup Exec.  
  
Also, rewrite the function to avoid buffer overrun issues by using a  
PQExpBuffer instead of a fixed-size static buffer.  Combinations of  
very long executable pathnames and very long data directory pathnames  
could have caused trouble before, for example.  
  
Back-patch to all active branches, since this code has been like this  
for a long while.  
  
Naoya Anzai and Tom Lane, reviewed by Rajeev Rastogi  

M src/bin/pg_ctl/pg_ctl.c

Be sure to release proc->backendLock after SetupLockInTable() failure.

commit   : 8b151558c837ea5fccccd84adde251eeddde81f0    
  
author   : Tom Lane <[email protected]>    
date     : Fri, 29 Nov 2013 17:35:09 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Fri, 29 Nov 2013 17:35:09 -0500    

Click here for diff

The various places that transferred fast-path locks to the main lock table  
neglected to release the PGPROC's backendLock if SetupLockInTable failed  
due to being out of shared memory.  In most cases this is no big deal since  
ensuing error cleanup would release all held LWLocks anyway.  But there are  
some hot-standby functions that don't consider failure of  
FastPathTransferRelationLocks to be a hard error, and in those cases this  
oversight could lead to system lockup.  For consistency, make all of these  
places look the same as FastPathTransferRelationLocks.  
  
Noted while looking for the cause of Dan Wood's bugs --- this wasn't it,  
but it's a bug anyway.  

M src/backend/storage/lmgr/lock.c

Fix assorted race conditions in the new timeout infrastructure.

commit   : 16e1b7a1b7f7ffd8a18713e83c8cd72c9ce48e07    
  
author   : Tom Lane <[email protected]>    
date     : Fri, 29 Nov 2013 16:41:00 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Fri, 29 Nov 2013 16:41:00 -0500    

Click here for diff

Prevent handle_sig_alarm from losing control partway through due to a query  
cancel (either an asynchronous SIGINT, or a cancel triggered by one of the  
timeout handler functions).  That would at least result in failure to  
schedule any required future interrupt, and might result in actual  
corruption of timeout.c's data structures, if the interrupt happened while  
we were updating those.  
  
We could still lose control if an asynchronous SIGINT arrives just as the  
function is entered.  This wouldn't break any data structures, but it would  
have the same effect as if the SIGALRM interrupt had been silently lost:  
we'd not fire any currently-due handlers, nor schedule any new interrupt.  
To forestall that scenario, forcibly reschedule any pending timer interrupt  
during AbortTransaction and AbortSubTransaction.  We can avoid any extra  
kernel call in most cases by not doing that until we've allowed  
LockErrorCleanup to kill the DEADLOCK_TIMEOUT and LOCK_TIMEOUT events.  
  
Another hazard is that some platforms (at least Linux and *BSD) block a  
signal before calling its handler and then unblock it on return.  When we  
longjmp out of the handler, the unblock doesn't happen, and the signal is  
left blocked indefinitely.  Again, we can fix that by forcibly unblocking  
signals during AbortTransaction and AbortSubTransaction.  
  
These latter two problems do not manifest when the longjmp reaches  
postgres.c, because the error recovery code there kills all pending timeout  
events anyway, and it uses sigsetjmp(..., 1) so that the appropriate signal  
mask is restored.  So errors thrown outside any transaction should be OK  
already, and cleaning up in AbortTransaction and AbortSubTransaction should  
be enough to fix these issues.  (We're assuming that any code that catches  
a query cancel error and doesn't re-throw it will do at least a  
subtransaction abort to clean up; but that was pretty much required already  
by other subsystems.)  
  
Lastly, ProcSleep should not clear the LOCK_TIMEOUT indicator flag when  
disabling that event: if a lock timeout interrupt happened after the lock  
was granted, the ensuing query cancel is still going to happen at the next  
CHECK_FOR_INTERRUPTS, and we want to report it as a lock timeout not a user  
cancel.  
  
Per reports from Dan Wood.  
  
Back-patch to 9.3 where the new timeout handling infrastructure was  
introduced.  We may at some point decide to back-patch the signal  
unblocking changes further, but I'll desist from that until we hear  
actual field complaints about it.  

M src/backend/access/transam/xact.c
M src/backend/postmaster/autovacuum.c
M src/backend/storage/lmgr/proc.c
M src/backend/tcop/postgres.c
M src/backend/utils/misc/timeout.c
M src/include/utils/timeout.h

doc: Enhance documentation of ssl_ciphers setting a bit

commit   : 50107ee7a58f36568997db84df641fde122f3132    
  
author   : Peter Eisentraut <[email protected]>    
date     : Fri, 29 Nov 2013 09:06:28 -0500    
  
committer: Peter Eisentraut <[email protected]>    
date     : Fri, 29 Nov 2013 09:06:28 -0500    

Click here for diff

M doc/src/sgml/config.sgml

doc: Allow selecting web site CSS style sheet in XSLT HTML build

commit   : 384eb1d40db6fe97678cb00e57365e785cb85eff    
  
author   : Peter Eisentraut <[email protected]>    
date     : Thu, 28 Nov 2013 22:45:08 -0500    
  
committer: Peter Eisentraut <[email protected]>    
date     : Thu, 28 Nov 2013 22:45:08 -0500    

Click here for diff

M doc/src/sgml/Makefile
M doc/src/sgml/stylesheet.xsl

Refine our definition of what constitutes a system relation.

commit   : 8e18d04d4daf34b8a557e2dc553a7754b255cd9a    
  
author   : Robert Haas <[email protected]>    
date     : Thu, 28 Nov 2013 20:57:20 -0500    
  
committer: Robert Haas <[email protected]>    
date     : Thu, 28 Nov 2013 20:57:20 -0500    

Click here for diff

Although user-defined relations can't be directly created in  
pg_catalog, it's possible for them to end up there, because you can  
create them in some other schema and then use ALTER TABLE .. SET SCHEMA  
to move them there.  Previously, such relations couldn't afterwards  
be manipulated, because IsSystemRelation()/IsSystemClass() rejected  
all attempts to modify objects in the pg_catalog schema, regardless  
of their origin.  With this patch, they now reject only those  
objects in pg_catalog which were created at initdb-time, allowing  
most operations on user-created tables in pg_catalog to proceed  
normally.  
  
This patch also adds new functions IsCatalogRelation() and  
IsCatalogClass(), which is similar to IsSystemRelation() and  
IsSystemClass() but with a slightly narrower definition: only TOAST  
tables of system catalogs are included, rather than *all* TOAST tables.  
This is currently used only for making decisions about when  
invalidation messages need to be sent, but upcoming logical decoding  
patches will find other uses for this information.  
  
Andres Freund, with some modifications by me.  

M src/backend/access/heap/heapam.c
M src/backend/catalog/aclchk.c
M src/backend/catalog/catalog.c
M src/backend/catalog/heap.c
M src/backend/commands/cluster.c
M src/backend/commands/indexcmds.c
M src/backend/commands/tablecmds.c
M src/backend/commands/trigger.c
M src/backend/optimizer/util/plancat.c
M src/backend/rewrite/rewriteDefine.c
M src/backend/tcop/utility.c
M src/backend/utils/cache/inval.c
M src/include/catalog/catalog.h
M src/test/regress/expected/alter_table.out
M src/test/regress/sql/alter_table.sql

Another gin_desc fix.

commit   : 2fe69cacff4e92201cb3e3de7748f3e1d51d9e25    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Thu, 28 Nov 2013 23:35:50 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Thu, 28 Nov 2013 23:35:50 +0200    

Click here for diff

The number of items inserted was incorrectly printed as if it was a boolean.  

M src/backend/access/rmgrdesc/gindesc.c

Fix gin_desc routine to match the WAL format.

commit   : 97c19e6c38ebc5e300539f6985ef3e05398c8f46    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Thu, 28 Nov 2013 21:54:49 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Thu, 28 Nov 2013 21:54:49 +0200    

Click here for diff

In the GIN incomplete-splits patch, I used BlockIdDatas to store the block  
number of left and right children, when inserting a downlink after a split  
to an internal page posting list page. But gin_desc thought they were stored  
as BlockNumbers.  

M src/backend/access/rmgrdesc/gindesc.c

Fix latent(?) race condition in LockReleaseAll.

commit   : da8a7160893c463690146c7b30220b90c593ec15    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 28 Nov 2013 12:17:46 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 28 Nov 2013 12:17:46 -0500    

Click here for diff

We have for a long time checked the head pointer of each of the backend's  
proclock lists and skipped acquiring the corresponding locktable partition  
lock if the head pointer was NULL.  This was safe enough in the days when  
proclock lists were changed only by the owning backend, but it is pretty  
questionable now that the fast-path patch added cases where backends add  
entries to other backends' proclock lists.  However, we don't really wish  
to revert to locking each partition lock every time, because in simple  
transactions that would add a lot of useless lock/unlock cycles on  
already-heavily-contended LWLocks.  Fortunately, the only way that another  
backend could be modifying our proclock list at this point would be if it  
was promoting a formerly fast-path lock of ours; and any such lock must be  
one that we'd decided not to delete in the previous loop over the locallock  
table.  So it's okay if we miss seeing it in this loop; we'd just decide  
not to delete it again.  However, once we've detected a non-empty list,  
we'd better re-fetch the list head pointer after acquiring the partition  
lock.  This guards against possibly fetching a corrupt-but-non-null pointer  
if pointer fetch/store isn't atomic.  It's not clear if any practical  
architectures are like that, but we've never assumed that before and don't  
wish to start here.  In any case, the situation certainly deserves a code  
comment.  
  
While at it, refactor the partition traversal loop to use a for() construct  
instead of a while() loop with goto's.  
  
Back-patch, just in case the risk is real and not hypothetical.  

M src/backend/storage/lmgr/lock.c

Unbreak buildfarm

commit   : d51a8c52bae6f95af100572a1df94cc3362d2059    
  
author   : Alvaro Herrera <[email protected]>    
date     : Thu, 28 Nov 2013 12:59:45 -0300    
  
committer: Alvaro Herrera <[email protected]>    
date     : Thu, 28 Nov 2013 12:59:45 -0300    

Click here for diff

I removed an intermediate commit before pushing and forgot to test the  
resulting tree :-(  

M src/backend/access/heap/heapam.c

Use a more granular approach to follow update chains

commit   : 247c76a989097f1b4ab6fae898f24e75aa27fc1b    
  
author   : Alvaro Herrera <[email protected]>    
date     : Wed, 27 Nov 2013 17:50:33 -0300    
  
committer: Alvaro Herrera <[email protected]>    
date     : Wed, 27 Nov 2013 17:50:33 -0300    

Click here for diff

Instead of simply checking the KEYS_UPDATED bit, we need to check  
whether each lock held on the future version of the tuple conflicts with  
the lock we're trying to acquire.  
  
Per bug report #8434 by Tomonari Katsumata  

M src/backend/access/heap/heapam.c

Compare Xmin to previous Xmax when locking an update chain

commit   : e4828e9ccba731178dd77aed078db7ceb0e1e8d1    
  
author   : Alvaro Herrera <[email protected]>    
date     : Wed, 27 Nov 2013 17:49:12 -0300    
  
committer: Alvaro Herrera <[email protected]>    
date     : Wed, 27 Nov 2013 17:49:12 -0300    

Click here for diff

Not doing so causes us to traverse an update chain that has been broken  
by concurrent page pruning.  All other code that traverses update chains  
uses this check as one of the cases in which to stop iterating, so  
replicate it here too.  Failure to do so leads to erroneous CLOG,  
subtrans or multixact lookups.  
  
Per discussion following the bug report by J Smith in  
CADFUPgc5bmtv-yg9znxV-vcfkb+JPRqs7m2OesQXaM_4Z1JpdQ@mail.gmail.com  
as diagnosed by Andres Freund.  

M src/backend/access/heap/heapam.c

Don't try to set InvalidXid as page pruning hint

commit   : c235a6a589bbd0a24e54fdb0df28979c9fb09463    
  
author   : Alvaro Herrera <[email protected]>    
date     : Wed, 27 Nov 2013 17:47:16 -0300    
  
committer: Alvaro Herrera <[email protected]>    
date     : Wed, 27 Nov 2013 17:47:16 -0300    

Click here for diff

If a transaction updates/deletes a tuple just before aborting, and a  
concurrent transaction tries to prune the page concurrently, the pruner  
may see HeapTupleSatisfiesVacuum return HEAPTUPLE_DELETE_IN_PROGRESS,  
but a later call to HeapTupleGetUpdateXid() return InvalidXid.  This  
would cause an assertion failure in development builds, but would be  
otherwise Mostly Harmless.  
  
Fix by checking whether the updater Xid is valid before trying to apply  
it as page prune point.  
  
Reported by Andres in [email protected]  

M src/backend/access/heap/pruneheap.c

Cope with heap_fetch failure while locking an update chain

commit   : e518fa7adfc28e0d0a99fe4e5711386d9a5c6532    
  
author   : Alvaro Herrera <[email protected]>    
date     : Wed, 27 Nov 2013 17:45:25 -0300    
  
committer: Alvaro Herrera <[email protected]>    
date     : Wed, 27 Nov 2013 17:45:25 -0300    

Click here for diff

The reason for the fetch failure is that the tuple was removed because  
it was dead; so the failure is innocuous and can be ignored.  Moreover,  
there's no need for further work and we can return success to the caller  
immediately.  EvalPlanQualFetch is doing something very similar to this  
already.  
  
Report and test case from Andres Freund in  
[email protected]  

M src/backend/access/heap/heapam.c

doc: Set chunk.first.sections in XSLT, for consistency with DSSSL output

commit   : b6ecde8ed4799720eaa1c015e325012dbad095fa    
  
author   : Peter Eisentraut <[email protected]>    
date     : Wed, 27 Nov 2013 22:22:40 -0500    
  
committer: Peter Eisentraut <[email protected]>    
date     : Wed, 27 Nov 2013 22:22:40 -0500    

Click here for diff

M doc/src/sgml/stylesheet.xsl

pg_buffercache docs: adjust order of fields

commit   : 9ef780d4d7b4466c8ba9ab5cdcd7d326a35ecbe1    
  
author   : Bruce Momjian <[email protected]>    
date     : Wed, 27 Nov 2013 22:33:45 -0500    
  
committer: Bruce Momjian <[email protected]>    
date     : Wed, 27 Nov 2013 22:33:45 -0500    

Click here for diff

Adjust order of fields to match view order.  
  
Jaime Casanova  

M doc/src/sgml/pgbuffercache.sgml

doc: Put data types in alphabetical order

commit   : a607b6903e90383e408d5085ca9b93a8a22392c1    
  
author   : Peter Eisentraut <[email protected]>    
date     : Wed, 27 Nov 2013 21:50:27 -0500    
  
committer: Peter Eisentraut <[email protected]>    
date     : Wed, 27 Nov 2013 21:50:27 -0500    

Click here for diff

From: Andreas Karlsson <[email protected]>  

M doc/src/sgml/datatype.sgml

Fix stale-pointer problem in fast-path locking logic.

commit   : 7db285afc9cf51763c5f49c453f8d189dca17b9d    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 27 Nov 2013 18:10:00 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 27 Nov 2013 18:10:00 -0500    

Click here for diff

When acquiring a lock in fast-path mode, we must reset the locallock  
object's lock and proclock fields to NULL.  They are not necessarily that  
way to start with, because the locallock could be left over from a failed  
lock acquisition attempt earlier in the transaction.  Failure to do this  
led to all sorts of interesting misbehaviors when LockRelease tried to  
clean up no-longer-related lock and proclock objects in shared memory.  
Per report from Dan Wood.  
  
In passing, modify LockRelease to elog not just Assert if it doesn't find  
lock and proclock objects for a formerly fast-path lock, matching the code  
in FastPathGetRelationLockEntry and LockRefindAndRelease.  This isn't a  
bug but it will help in diagnosing any future bugs in this area.  
  
Also, modify FastPathTransferRelationLocks and FastPathGetRelationLockEntry  
to break out of their loops over the fastpath array once they've found the  
sole matching entry.  This was inconsistently done in some search loops  
and not others.  
  
Improve assorted related comments, too.  
  
Back-patch to 9.2 where the fast-path mechanism was introduced.  

M src/backend/storage/lmgr/lock.c
M src/include/storage/lock.h

Minor correction of READ COMMITTED isolation level docs.

commit   : 89ba815092f9ab0b153aa67328a7c18431d809d7    
  
author   : Kevin Grittner <[email protected]>    
date     : Wed, 27 Nov 2013 14:34:12 -0600    
  
committer: Kevin Grittner <[email protected]>    
date     : Wed, 27 Nov 2013 14:34:12 -0600    

Click here for diff

Per report from AK  

M doc/src/sgml/mvcc.sgml

Minor corrections in lmgr/README.

commit   : 8c84803e14b1ba2025c37dcc1ff1c41dd6264fa0    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 27 Nov 2013 15:07:13 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 27 Nov 2013 15:07:13 -0500    

Click here for diff

Correct an obsolete statement that no backend touches another backend's  
PROCLOCK lists.  This was probably wrong even when written (the deadlock  
checker looks at everybody's lists), and it's certainly quite wrong now  
that fast-path locking can require creation of lock and proclock objects  
on behalf of another backend.  Also improve some statements in the hot  
standby explanation, and do one or two other trivial bits of wordsmithing/  
reformatting.  

M src/backend/storage/lmgr/README

Get rid of the post-recovery cleanup step of GIN page splits.

commit   : 631118fe1e8f66fd15eb0013dd9940d9146a5096    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Wed, 27 Nov 2013 19:21:23 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Wed, 27 Nov 2013 19:21:23 +0200    

Click here for diff

Replace it with an approach similar to what GiST uses: when a page is split,  
the left sibling is marked with a flag indicating that the parent hasn't been  
updated yet. When the parent is updated, the flag is cleared. If an insertion  
steps on a page with the flag set, it will finish split before proceeding  
with the insertion.  
  
The post-recovery cleanup mechanism was never totally reliable, as insertion  
to the parent could fail e.g because of running out of memory or disk space,  
leaving the tree in an inconsistent state.  
  
This also divides the responsibility of WAL-logging more clearly between  
the generic ginbtree.c code, and the parts specific to entry and posting  
trees. There is now a common WAL record format for insertions and deletions,  
which is written by ginbtree.c, followed by tree-specific payload, which is  
returned by the placetopage- and split- callbacks.  

M src/backend/access/gin/ginbtree.c
M src/backend/access/gin/gindatapage.c
M src/backend/access/gin/ginentrypage.c
M src/backend/access/gin/ginxlog.c
M src/backend/access/rmgrdesc/gindesc.c
M src/include/access/gin.h
M src/include/access/gin_private.h
M src/include/access/rmgrlist.h
M src/include/access/xlog_internal.h

More GIN refactoring.

commit   : ce5326eed386959aac7a322880896ddeade7fd52    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Wed, 27 Nov 2013 15:43:05 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Wed, 27 Nov 2013 15:43:05 +0200    

Click here for diff

Separate the insertion payload from the more static portions of GinBtree.  
GinBtree now only contains information related to searching the tree, and  
the information of what to insert is passed separately.  
  
Add root block number to GinBtree, instead of passing it around all the  
functions as argument.  
  
Split off ginFinishSplit() from ginInsertValue(). ginFinishSplit is  
responsible for finding the parent and inserting the downlink to it.  

M src/backend/access/gin/ginbtree.c
M src/backend/access/gin/gindatapage.c
M src/backend/access/gin/ginentrypage.c
M src/backend/access/gin/ginget.c
M src/backend/access/gin/gininsert.c
M src/backend/access/gin/ginxlog.c
M src/include/access/gin_private.h

Fix plpython3 expected output.

commit   : 4118f7e8ede8a3616189b53983aea293fd0b3cb1    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Wed, 27 Nov 2013 14:22:33 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Wed, 27 Nov 2013 14:22:33 +0200    

Click here for diff

I neglected this in the previous commit that updated the plpython2 output,  
which I forgot to "git add" earlier.  
  
As pointed out by Rodolfo Campero and Marko Kreen.  

M src/pl/plpython/expected/plpython_types_3.out

Don't update relfrozenxid if any pages were skipped.

commit   : 82b43f7df2036d06b4410721f77512969846b6d0    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Wed, 27 Nov 2013 13:10:16 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Wed, 27 Nov 2013 13:10:16 +0200    

Click here for diff

Vacuum recognizes that it can update relfrozenxid by checking whether it has  
processed all pages of a relation. Unfortunately it performed that check  
after truncating the dead pages at the end of the relation, and used the new  
number of pages to decide whether all pages have been scanned. If the new  
number of pages happened to be smaller or equal to the number of pages  
scanned, it incorrectly decided that all pages were scanned.  
  
This can lead to relfrozenxid being updated, even though some pages were  
skipped that still contain old XIDs. That can lead to data loss due to xid  
wraparounds with some rows suddenly missing. This likely has escaped notice  
so far because it takes a large number (~2^31) of xids being used to see the  
effect, while a full-table vacuum before that would fix the issue.  
  
The incorrect logic was introduced by commit  
b4b6923e03f4d29636a94f6f4cc2f5cf6298b8c8. Backpatch this fix down to 8.4,  
like that commit.  
  
Andres Freund, with some modifications by me.  

M src/backend/commands/vacuumlazy.c

Documentation fix for ecpg.

commit   : 2390f2b2d3ef708c282846457b6fd837a0c08061    
  
author   : Michael Meskes <[email protected]>    
date     : Wed, 27 Nov 2013 11:03:59 +0100    
  
committer: Michael Meskes <[email protected]>    
date     : Wed, 27 Nov 2013 11:03:59 +0100    

Click here for diff

The latest fixes removed a limitation that was still in the docs, so Zoltan updated the docs, too.  

M doc/src/sgml/ecpg.sgml

ECPG: Fix searching for quoted cursor names case-sensitively.

commit   : 51867a0f9b5c6d15c541e19c202520e95c5950a0    
  
author   : Michael Meskes <[email protected]>    
date     : Wed, 27 Nov 2013 11:02:13 +0100    
  
committer: Michael Meskes <[email protected]>    
date     : Wed, 27 Nov 2013 11:02:13 +0100    

Click here for diff

Patch by Böszörményi Zoltán <[email protected]>  

M src/interfaces/ecpg/preproc/ecpg.addons
M src/interfaces/ecpg/preproc/ecpg.header
M src/interfaces/ecpg/preproc/ecpg.trailer

Add --xlogdir option to pg_basebackup, for specifying the pg_xlog directory.

commit   : d1b88f6b3660753771895a4441b6bb4ccc9bcaac    
  
author   : Fujii Masao <[email protected]>    
date     : Wed, 27 Nov 2013 14:00:16 +0900    
  
committer: Fujii Masao <[email protected]>    
date     : Wed, 27 Nov 2013 14:00:16 +0900    

Click here for diff

Haribabu kommi, slightly modified by me.  

M doc/src/sgml/ref/pg_basebackup.sgml
M src/bin/pg_basebackup/pg_basebackup.c

Fix typo in release note.

commit   : 551c78281b47b8ab12cfc142b8da68db8473e591    
  
author   : Fujii Masao <[email protected]>    
date     : Wed, 27 Nov 2013 13:45:41 +0900    
  
committer: Fujii Masao <[email protected]>    
date     : Wed, 27 Nov 2013 13:45:41 +0900    

Click here for diff

Backpatch to 9.1.  
  
Josh Kupershmidt  

M doc/src/sgml/release-9.1.sgml

Implement information_schema.parameters.parameter_default column

commit   : 85ed91ee7da8f560c3443733cbda2862cd25facd    
  
author   : Peter Eisentraut <[email protected]>    
date     : Tue, 26 Nov 2013 23:18:58 -0500    
  
committer: Peter Eisentraut <[email protected]>    
date     : Tue, 26 Nov 2013 23:18:58 -0500    

Click here for diff

Reviewed-by: Ali Dar <[email protected]>  
Reviewed-by: Amit Khandekar <[email protected]>  
Reviewed-by: Rodolfo Campero <[email protected]>  

M doc/src/sgml/information_schema.sgml
M src/backend/catalog/information_schema.sql
M src/backend/utils/adt/ruleutils.c
M src/include/catalog/catversion.h
M src/include/catalog/pg_proc.h
M src/include/utils/builtins.h
M src/test/regress/expected/create_function_3.out
M src/test/regress/sql/create_function_3.sql

doc: Add id to index in XSLT build

commit   : 3803ff985c7940af32912b158322cce399952e76    
  
author   : Peter Eisentraut <[email protected]>    
date     : Tue, 26 Nov 2013 23:02:40 -0500    
  
committer: Peter Eisentraut <[email protected]>    
date     : Tue, 26 Nov 2013 23:02:40 -0500    

Click here for diff

That way, the HTML file name of the index will be the same as currently  
for the DSSSL build.  

M doc/src/sgml/postgres.sgml

Oops, forgot to "git add" last minute changes to regression test.

commit   : 4c83e0353f2c396e9e89fee564d9a5b868d5c3b2    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Tue, 26 Nov 2013 23:05:28 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Tue, 26 Nov 2013 23:05:28 +0200    

Click here for diff

M src/pl/plpython/expected/plpython_types.out

ECPG: Fix offset to NULL/size indicator array.

commit   : d2542f9270e9587f54a63fd6ffbdd124abc6f80c    
  
author   : Michael Meskes <[email protected]>    
date     : Tue, 26 Nov 2013 17:16:39 +0100    
  
committer: Michael Meskes <[email protected]>    
date     : Tue, 26 Nov 2013 17:16:39 +0100    

Click here for diff

Patch by Boszormenyi Zoltan <[email protected]>  

M src/interfaces/ecpg/ecpglib/data.c

ECPG: Simplify free_variable()

commit   : f641fc86fbe72a84a9d0a32279c4f9941bde6b6a    
  
author   : Michael Meskes <[email protected]>    
date     : Tue, 26 Nov 2013 17:15:44 +0100    
  
committer: Michael Meskes <[email protected]>    
date     : Tue, 26 Nov 2013 17:15:44 +0100    

Click here for diff

Patch by Boszormenyi Zoltan <[email protected]>  

M src/interfaces/ecpg/ecpglib/execute.c

ECPG: Add EXEC SQL CLOSE C to the tests.

commit   : 1ec4c56e76714d3894cfc301212ec98674720e3b    
  
author   : Michael Meskes <[email protected]>    
date     : Tue, 26 Nov 2013 17:15:15 +0100    
  
committer: Michael Meskes <[email protected]>    
date     : Tue, 26 Nov 2013 17:15:15 +0100    

Click here for diff

Patch by Boszormenyi Zoltan <[email protected]>  

M src/interfaces/ecpg/test/expected/sql-binary.c
M src/interfaces/ecpg/test/expected/sql-binary.stderr
M src/interfaces/ecpg/test/expected/sql-fetch.c
M src/interfaces/ecpg/test/expected/sql-fetch.stderr
M src/interfaces/ecpg/test/sql/binary.pgc
M src/interfaces/ecpg/test/sql/fetch.pgc

ECPG: Free the malloc()'ed variables in the test so it comes out clean on Valgrind runs.

commit   : db58e8ff7cec9a14418d6dccd33bbe186d10c1f4    
  
author   : Michael Meskes <[email protected]>    
date     : Tue, 26 Nov 2013 17:14:07 +0100    
  
committer: Michael Meskes <[email protected]>    
date     : Tue, 26 Nov 2013 17:14:07 +0100    

Click here for diff

Patch by Boszormenyi Zoltan <[email protected]>  

M src/interfaces/ecpg/test/expected/preproc-outofscope.c
M src/interfaces/ecpg/test/expected/preproc-outofscope.stderr
M src/interfaces/ecpg/test/preproc/outofscope.pgc

ECPG: Make the preprocessor emit ';' if the variable type for a list of variables is varchar. This fixes this test case:

commit   : b46fa321003e4d07d881c2583eb1126e8fadabdc    
  
author   : Michael Meskes <[email protected]>    
date     : Tue, 26 Nov 2013 17:12:39 +0100    
  
committer: Michael Meskes <[email protected]>    
date     : Tue, 26 Nov 2013 17:12:39 +0100    

Click here for diff

int main(void)  
{  
    exec sql begin declare section;  
    varchar a[50], b[50];  
    exec sql end declare section;  
  
    return 0;  
}  
  
Since varchars are internally turned into custom structs and  
the type name is emitted for these variable declarations,  
the preprocessed code previously had:  
  
struct varchar_1  { ... }  a _,_  struct varchar_2  { ... }  b ;  
  
The comma in the generated C file was a syntax error.  
  
There are no regression test changes since it's not exercised.  
  
Patch by Boszormenyi Zoltan <[email protected]>  

M src/interfaces/ecpg/preproc/ecpg.trailer

Handle domains over arrays like plain arrays in PL/python.

commit   : 37364c63115a52b4dc7ea280aa5b358abd4a9c38    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Tue, 26 Nov 2013 14:22:38 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Tue, 26 Nov 2013 14:22:38 +0200    

Click here for diff

Domains over arrays are now converted to/from python lists when passed as  
arguments or return values. Like regular arrays.  
  
This has some potential to break applications that rely on the old behavior  
that they are passed as strings, but in practice there probably aren't many  
such applications out there.  
  
Rodolfo Campero  

M src/pl/plpython/expected/plpython_types.out
M src/pl/plpython/expected/plpython_types_3.out
M src/pl/plpython/plpy_typeio.c
M src/pl/plpython/sql/plpython_types.sql

Add missing entry for session_preload_libraries in sample config.

commit   : 7cc0ba9f17fdae610187411439e8c01b26da15ac    
  
author   : Jeff Davis <[email protected]>    
date     : Mon, 25 Nov 2013 21:00:37 -0800    
  
committer: Jeff Davis <[email protected]>    
date     : Mon, 25 Nov 2013 21:00:37 -0800    

Click here for diff

The omission was apparently an oversight in the original patch.  

M src/backend/utils/misc/postgresql.conf.sample

Change SET LOCAL/CONSTRAINTS/TRANSACTION and ABORT behavior

commit   : a6542a4b6870a019cd952d055d2e7af2da2fe102    
  
author   : Bruce Momjian <[email protected]>    
date     : Mon, 25 Nov 2013 19:19:40 -0500    
  
committer: Bruce Momjian <[email protected]>    
date     : Mon, 25 Nov 2013 19:19:40 -0500    

Click here for diff

Change SET LOCAL/CONSTRAINTS/TRANSACTION behavior outside of a  
transaction block from error (post-9.3) to warning.  (Was nothing in <=  
9.3.)  Also change ABORT outside of a transaction block from notice to  
warning.  

M doc/src/sgml/ref/abort.sgml
M doc/src/sgml/ref/rollback.sgml
M doc/src/sgml/ref/set.sgml
M doc/src/sgml/ref/set_constraints.sgml
M doc/src/sgml/ref/set_transaction.sgml
M src/backend/access/transam/xact.c
M src/backend/tcop/utility.c
M src/backend/utils/misc/guc.c
M src/include/access/xact.h
M src/test/regress/expected/errors.out
M src/test/regress/expected/guc.out

More improvement to comment parsing in ecpg.

commit   : 05b476c2983a8d38bf6a0254553b4a0776896aa7    
  
author   : Michael Meskes <[email protected]>    
date     : Mon, 25 Nov 2013 15:29:51 +0100    
  
committer: Michael Meskes <[email protected]>    
date     : Mon, 25 Nov 2013 15:29:51 +0100    

Click here for diff

ECPG is not supposed to allow and output nested comments in C. These comments  
are only allowed in the SQL parts and must not be written into the C file.  
Also the different handling of different comments is documented.  

M doc/src/sgml/ecpg.sgml
M src/interfaces/ecpg/preproc/pgc.l

Fix ecpg parsing of sizeof().

commit   : ef8b3b00b55ef1feedb352a8a26f94845b6437dc    
  
author   : Michael Meskes <[email protected]>    
date     : Mon, 25 Nov 2013 15:11:39 +0100    
  
committer: Michael Meskes <[email protected]>    
date     : Mon, 25 Nov 2013 15:11:39 +0100    

Click here for diff

The last fix used the wrong non-terminal to define valid types.  

M src/interfaces/ecpg/preproc/ecpg.trailer

Lessen library-loading log level.

commit   : 559d535819908adfe2d2ca674fb8562bbd133cef    
  
author   : Jeff Davis <[email protected]>    
date     : Sun, 24 Nov 2013 10:50:54 -0800    
  
committer: Jeff Davis <[email protected]>    
date     : Sun, 24 Nov 2013 10:50:54 -0800    

Click here for diff

Previously, messages were emitted at the LOG level every time a  
backend preloaded a library. That was acceptable (though unnecessary)  
for shared_preload_libraries; but it was excessive for  
local_preload_libraries and session_preload_libraries. Reduce to  
DEBUG1.  
  
Also, there was logic in the EXEC_BACKEND case to avoid repeated  
messages for shared_preload_libraries by demoting them to  
DEBUG2. DEBUG1 seems more appropriate there, as well, so eliminate  
that special case.  
  
Peter Geoghegan.  

M src/backend/utils/init/miscinit.c

Fix new and latent bugs with errno handling in secure_read/secure_write.

commit   : 36a3be6540b90c6a5d307c0ed9de2076ce5a821c    
  
author   : Tom Lane <[email protected]>    
date     : Sun, 24 Nov 2013 13:09:38 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Sun, 24 Nov 2013 13:09:38 -0500    

Click here for diff

These functions must be careful that they return the intended value of  
errno to their callers.  There were several scenarios where this might  
not happen:  
  
1. The recent SSL renegotiation patch added a hunk of code that would  
execute after setting errno.  In the first place, it's doubtful that we  
should consider renegotiation to be successfully completed after a failure,  
and in the second, there's no real guarantee that the called OpenSSL  
routines wouldn't clobber errno.  Fix by not executing that hunk except  
during success exit.  
  
2. errno was left in an unknown state in case of an unrecognized return  
code from SSL_get_error().  While this is a "can't happen" case, it seems  
like a good idea to be sure we know what would happen, so reset errno to  
ECONNRESET in such cases.  (The corresponding code in libpq's fe-secure.c  
already did this.)  
  
3. There was an (undocumented) assumption that client_read_ended() wouldn't  
change errno.  While true in the current state of the code, this seems less  
than future-proof.  Add explicit saving/restoring of errno to make sure  
that changes in the called functions won't break things.  
  
I see no need to back-patch, since #1 is new code and the other two issues  
are mostly hypothetical.  
  
Per discussion with Amit Kapila.  

M src/backend/libpq/be-secure.c
M src/backend/tcop/postgres.c

Allow C array definitions to use sizeof().

commit   : 08d1b22b3be2305ad6b83ca275829ff26305f5d7    
  
author   : Michael Meskes <[email protected]>    
date     : Sun, 24 Nov 2013 12:51:21 +0100    
  
committer: Michael Meskes <[email protected]>    
date     : Sun, 24 Nov 2013 12:51:21 +0100    

Click here for diff

When parsing C variable definitions ecpg should allow sizeof() operators as array dimensions.  

M src/interfaces/ecpg/preproc/ecpg.trailer

Distinguish between C and SQL mode for C-style comments.

commit   : 8ac5e88f9fc54c480ed1419c0ce94f54653fe8c3    
  
author   : Michael Meskes <[email protected]>    
date     : Sun, 24 Nov 2013 12:26:00 +0100    
  
committer: Michael Meskes <[email protected]>    
date     : Sun, 24 Nov 2013 12:26:00 +0100    

Click here for diff

SQL standard asks for allowing nested comments, while C does not. Therefore the  
two comments, while mostly similar, have to be parsed seperately.  

M src/interfaces/ecpg/preproc/pgc.l

Defend against bad trigger definitions in contrib/lo's lo_manage() trigger.

commit   : 64d15e424091d8fd2c882356ee4bf07cfc5ff69d    
  
author   : Tom Lane <[email protected]>    
date     : Sat, 23 Nov 2013 22:45:46 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Sat, 23 Nov 2013 22:45:46 -0500    

Click here for diff

This function formerly crashed if called as a statement-level trigger,  
or if a column-name argument wasn't given.  
  
In passing, add the trigger name to all error messages from the function.  
(None of them are expected cases, so this shouldn't pose any compatibility  
risk.)  
  
Marc Cousin, reviewed by Sawada Masahiko  

M contrib/lo/lo.c

PL/Tcl: Add event trigger support

commit   : a5036ca998a6058f60913d43a80badfcbb65f5bb    
  
author   : Peter Eisentraut <[email protected]>    
date     : Sat, 23 Nov 2013 21:32:00 -0500    
  
committer: Peter Eisentraut <[email protected]>    
date     : Sat, 23 Nov 2013 21:32:00 -0500    

Click here for diff

From: Dimitri Fontaine <[email protected]>  

M doc/src/sgml/pltcl.sgml
M src/pl/tcl/expected/pltcl_setup.out
M src/pl/tcl/pltcl.c
M src/pl/tcl/sql/pltcl_setup.sql

Fix array slicing of int2vector and oidvector values.

commit   : 45e02e3232ac7cc5ffe36f7986159b5e0b1f6fdc    
  
author   : Tom Lane <[email protected]>    
date     : Sat, 23 Nov 2013 20:03:56 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Sat, 23 Nov 2013 20:03:56 -0500    

Click here for diff

The previous coding labeled expressions such as pg_index.indkey[1:3] as  
being of int2vector type; which is not right because the subscript bounds  
of such a result don't, in general, satisfy the restrictions of int2vector.  
To fix, implicitly promote the result of slicing int2vector to int2[],  
or oidvector to oid[].  This is similar to what we've done with domains  
over arrays, which is a good analogy because these types are very much  
like restricted domains of the corresponding regular-array types.  
  
A side-effect is that we now also forbid array-element updates on such  
columns, eg while "update pg_index set indkey[4] = 42" would have worked  
before if you were superuser (and corrupted your catalogs irretrievably,  
no doubt) it's now disallowed.  This seems like a good thing since, again,  
some choices of subscripting would've led to results not satisfying the  
restrictions of int2vector.  The case of an array-slice update was  
rejected before, though with a different error message than you get now.  
We could make these cases work in future if we added a cast from int2[]  
to int2vector (with a cast function checking the subscript restrictions)  
but it seems unlikely that there's any value in that.  
  
Per report from Ronan Dunklau.  Back-patch to all supported branches  
because of the crash risks involved.  

M src/backend/parser/parse_node.c
M src/backend/parser/parse_target.c
M src/include/catalog/pg_type.h

Ensure _dosmaperr() actually sets errno correctly.

commit   : f145454d57bc9dfd105f7236a03a00dd25395dd2    
  
author   : Tom Lane <[email protected]>    
date     : Sat, 23 Nov 2013 18:24:26 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Sat, 23 Nov 2013 18:24:26 -0500    

Click here for diff

If logging is enabled, either ereport() or fprintf() might stomp on errno  
internally, causing this function to return the wrong result.  That might  
only end in a misleading error report, but in any code that's examining  
errno to decide what to do next, the consequences could be far graver.  
  
This has been broken since the very first version of this file in 2006  
... it's a bit astonishing that we didn't identify this long ago.  
  
Reported by Amit Kapila, though this isn't his proposed fix.  

M src/port/win32error.c

Fix thinko in SPI_execute_plan() calls

commit   : b7212c9726ee4bdf0ddd938742f03e86d8c431bf    
  
author   : Peter Eisentraut <[email protected]>    
date     : Sat, 23 Nov 2013 09:34:57 -0500    
  
committer: Peter Eisentraut <[email protected]>    
date     : Sat, 23 Nov 2013 09:34:57 -0500    

Click here for diff

Two call sites were apparently thinking that the last argument of  
SPI_execute_plan() is the number of query parameters, but it is actually  
the row limit.  Change the calls to 0, since we don't care about the  
limit there.  The previous code didn't break anything, but it was still  
wrong.  

M src/backend/utils/adt/ruleutils.c

Avoid potential buffer overflow crash

commit   : 4053189d594a5eb1949bba26766fdb0de837e255    
  
author   : Peter Eisentraut <[email protected]>    
date     : Sat, 23 Nov 2013 07:25:37 -0500    
  
committer: Peter Eisentraut <[email protected]>    
date     : Sat, 23 Nov 2013 07:25:37 -0500    

Click here for diff

A pointer to a C string was treated as a pointer to a "name" datum and  
passed to SPI_execute_plan().  This pointer would then end up being  
passed through datumCopy(), which would try to copy the entire 64 bytes  
of name data, thus running past the end of the C string.  Fix by  
converting the string to a proper name structure.  
  
Found by LLVM AddressSanitizer.  

M src/backend/utils/adt/ruleutils.c

Flatten join alias Vars before pulling up targetlist items from a subquery.

commit   : f19e92ed040c2afba2333f0ce547848f4dc4ec21    
  
author   : Tom Lane <[email protected]>    
date     : Fri, 22 Nov 2013 14:37:21 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Fri, 22 Nov 2013 14:37:21 -0500    

Click here for diff

pullup_replace_vars()'s decisions about whether a pulled-up replacement  
expression needs to be wrapped in a PlaceHolderVar depend on the assumption  
that what looks like a Var behaves like a Var.  However, if the Var is a  
join alias reference, later flattening of join aliases might replace the  
Var with something that's not a Var at all, and should have been wrapped.  
  
To fix, do a forcible pass of flatten_join_alias_vars() on the subquery  
targetlist before we start to copy items out of it.  We'll re-run that  
processing on the pulled-up expressions later, but that's harmless.  
  
Per report from Ken Tanzer; the added regression test case is based on his  
example.  This bug has been there since the PlaceHolderVar mechanism was  
invented, but has escaped detection because the circumstances that trigger  
it are fairly narrow.  You need a flattenable query underneath an outer  
join, which contains another flattenable query inside a join of its own,  
with a dangerous expression (a constant or something else non-strict)  
in that one's targetlist.  
  
Having seen this, I'm wondering if it wouldn't be prudent to do all  
alias-variable flattening earlier, perhaps even in the rewriter.  
But that would probably not be a back-patchable change.  

M src/backend/optimizer/prep/prepjointree.c
M src/test/regress/expected/join.out
M src/test/regress/sql/join.sql

Fix quoting in help messages in uuid-ossp extension scripts.

commit   : f29baf92257ae614a2097b4e86b00e8a62802e2e    
  
author   : Tom Lane <[email protected]>    
date     : Fri, 22 Nov 2013 12:07:53 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Fri, 22 Nov 2013 12:07:53 -0500    

Click here for diff

The command we're telling people to type needs to include double-quoting  
around the unfortunately-chosen extension name.  Twiddle the textual  
quoting so that it looks somewhat sane.  Per gripe from roadrunner6.  

M contrib/uuid-ossp/uuid-ossp–1.0.sql
M contrib/uuid-ossp/uuid-ossp–unpackaged–1.0.sql

Fix Hot-Standby initialization of clog and subtrans.

commit   : 98f58a30c1beb6ec0870d6520f49fb40d9d0b566    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Fri, 22 Nov 2013 14:38:59 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Fri, 22 Nov 2013 14:38:59 +0200    

Click here for diff

These bugs can cause data loss on standbys started with hot_standby=on at  
the moment they start to accept read only queries, by marking committed  
transactions as uncommited. The likelihood of such corruptions is small  
unless the primary has a high transaction rate.  
  
5a031a5556ff83b8a9646892715d7fef415b83c3 fixed bugs in HS's startup logic  
by maintaining less state until at least STANDBY_SNAPSHOT_PENDING state  
was reached, missing the fact that both clog and subtrans are written to  
before that. This only failed to fail in common cases because the usage  
of ExtendCLOG in procarray.c was superflous since clog extensions are  
actually WAL logged.  
  
f44eedc3f0f347a856eea8590730769125964597/I then tried to fix the missing  
extensions of pg_subtrans due to the former commit's changes - which are  
not WAL logged - by performing the extensions when switching to a state  
> STANDBY_INITIALIZED and not performing xid assignments before that -  
again missing the fact that ExtendCLOG is unneccessary - but screwed up  
twice: Once because latestObservedXid wasn't updated anymore in that  
state due to the earlier commit and once by having an off-by-one error in  
the loop performing extensions. This means that whenever a  
CLOG_XACTS_PER_PAGE (32768 with default settings) boundary was crossed  
between the start of the checkpoint recovery started from and the first  
xl_running_xact record old transactions commit bits in pg_clog could be  
overwritten if they started and committed in that window.  
  
Fix this mess by not performing ExtendCLOG() in HS at all anymore since  
it's unneeded and evidently dangerous and by performing subtrans  
extensions even before reaching STANDBY_SNAPSHOT_PENDING.  
  
Analysis and patch by Andres Freund. Reported by Christophe Pettus.  
Backpatch down to 9.0, like the previous commit that caused this.  

M src/backend/access/transam/clog.c
M src/backend/storage/ipc/procarray.c

Avoid acquiring spinlock when checking if recovery has finished, for speed.

commit   : 1a3d104475ce01326fc00601ed66ac4d658e37e5    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Fri, 22 Nov 2013 12:53:59 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Fri, 22 Nov 2013 12:53:59 +0200    

Click here for diff

RecoveryIsInProgress() can be called very frequently. During normal  
operation, it just checks a backend-local variable and returns quickly,  
but during hot standby, it checks a spinlock-protected shared variable.  
Those spinlock acquisitions can become a point of contention on a busy  
hot standby system.  
  
Replace the spinlock acquisition with a memory barrier.  
  
Per discussion with Andres Freund, Ants Aasma and Merlin Moncure.  

M src/backend/access/transam/xlog.c

Tweak streamutil.c further to avoid scan-build warning

commit   : f4482a542c30034c7871fd35050128823ef5c6d5    
  
author   : Peter Eisentraut <[email protected]>    
date     : Thu, 21 Nov 2013 21:46:43 -0500    
  
committer: Peter Eisentraut <[email protected]>    
date     : Thu, 21 Nov 2013 21:46:43 -0500    

Click here for diff

The previous change added a new scan-build warning about need_password  
assigned but not read.  

M src/bin/pg_basebackup/streamutil.c

Support multi-argument UNNEST(), and TABLE() syntax for multiple functions.

commit   : 784e762e886e6f72f548da86a27cd2ead87dbd1c    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 21 Nov 2013 19:37:02 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 21 Nov 2013 19:37:02 -0500    

Click here for diff

This patch adds the ability to write TABLE( function1(), function2(), ...)  
as a single FROM-clause entry.  The result is the concatenation of the  
first row from each function, followed by the second row from each  
function, etc; with NULLs inserted if any function produces fewer rows than  
others.  This is believed to be a much more useful behavior than what  
Postgres currently does with multiple SRFs in a SELECT list.  
  
This syntax also provides a reasonable way to combine use of column  
definition lists with WITH ORDINALITY: put the column definition list  
inside TABLE(), where it's clear that it doesn't control the ordinality  
column as well.  
  
Also implement SQL-compliant multiple-argument UNNEST(), by turning  
UNNEST(a,b,c) into TABLE(unnest(a), unnest(b), unnest(c)).  
  
The SQL standard specifies TABLE() with only a single function, not  
multiple functions, and it seems to require an implicit UNNEST() which is  
not what this patch does.  There may be something wrong with that reading  
of the spec, though, because if it's right then the spec's TABLE() is just  
a pointless alternative spelling of UNNEST().  After further review of  
that, we might choose to adopt a different syntax for what this patch does,  
but in any case this functionality seems clearly worthwhile.  
  
Andrew Gierth, reviewed by Zoltán Böszörményi and Heikki Linnakangas, and  
significantly revised by me  

M contrib/pg_stat_statements/pg_stat_statements.c
M doc/src/sgml/func.sgml
M doc/src/sgml/queries.sgml
M doc/src/sgml/ref/select.sgml
M src/backend/access/common/tupdesc.c
M src/backend/catalog/dependency.c
M src/backend/commands/createas.c
M src/backend/commands/explain.c
M src/backend/commands/sequence.c
M src/backend/commands/tablecmds.c
M src/backend/commands/view.c
M src/backend/executor/nodeFunctionscan.c
M src/backend/nodes/copyfuncs.c
M src/backend/nodes/equalfuncs.c
M src/backend/nodes/makefuncs.c
M src/backend/nodes/nodeFuncs.c
M src/backend/nodes/outfuncs.c
M src/backend/nodes/readfuncs.c
M src/backend/optimizer/path/allpaths.c
M src/backend/optimizer/path/costsize.c
M src/backend/optimizer/path/pathkeys.c
M src/backend/optimizer/plan/createplan.c
M src/backend/optimizer/plan/initsplan.c
M src/backend/optimizer/plan/planner.c
M src/backend/optimizer/plan/setrefs.c
M src/backend/optimizer/plan/subselect.c
M src/backend/optimizer/prep/prepjointree.c
M src/backend/optimizer/util/clauses.c
M src/backend/optimizer/util/pathnode.c
M src/backend/parser/gram.y
M src/backend/parser/parse_clause.c
M src/backend/parser/parse_relation.c
M src/backend/parser/parse_type.c
M src/backend/parser/parse_utilcmd.c
M src/backend/rewrite/rewriteHandler.c
M src/backend/utils/adt/ruleutils.c
M src/include/access/tupdesc.h
M src/include/catalog/catversion.h
M src/include/catalog/pg_operator.h
M src/include/nodes/execnodes.h
M src/include/nodes/nodes.h
M src/include/nodes/parsenodes.h
M src/include/nodes/plannodes.h
M src/include/optimizer/pathnode.h
M src/include/optimizer/paths.h
M src/include/parser/parse_relation.h
M src/test/regress/expected/rangefuncs.out
M src/test/regress/sql/rangefuncs.sql

Fix pg_isready to handle -d option properly.

commit   : 38f432898131270e5b64245786cb67f322538bae    
  
author   : Fujii Masao <[email protected]>    
date     : Thu, 21 Nov 2013 21:52:03 +0900    
  
committer: Fujii Masao <[email protected]>    
date     : Thu, 21 Nov 2013 21:52:03 +0900    

Click here for diff

Previously, -d option for pg_isready was broken. When the name of the  
database was specified by -d option, pg_isready failed with an error.  
When the conninfo specified by -d option contained the setting of the  
host name but not Numeric IP address (i.e., hostaddr), pg_isready  
displayed wrong connection message. -d option could not handle a valid  
URI prefix at all. This commit fixes these bugs of pg_isready.  
  
Backpatch to 9.3, where pg_isready was introduced.  
  
Per report from Josh Berkus and Robert Haas.  
Original patch by Fabrízio de Royes Mello, heavily modified by me.  

M src/bin/scripts/pg_isready.c

More GIN refactoring.

commit   : 04eee1fa9ee80dabf7cf4b8b9106897272e9b291    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Wed, 20 Nov 2013 17:00:53 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Wed, 20 Nov 2013 17:00:53 +0200    

Click here for diff

Split off the portion of ginInsertValue that inserts the tuple to current  
level into a separate function, ginPlaceToPage. ginInsertValue's charter  
is now to recurse up the tree to insert the downlink, when a page split is  
required.  
  
This is in preparation for a patch to change the way incomplete splits are  
handled, which will need to do these operations separately. And IMHO makes  
the code more readable anyway.  

M src/backend/access/gin/ginbtree.c

Refactor the internal GIN B-tree interface for forming a downlink.

commit   : 501012631e7d2e1c22f60b11ff8cb62ae021625e    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Wed, 20 Nov 2013 16:57:41 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Wed, 20 Nov 2013 16:57:41 +0200    

Click here for diff

This creates a new gin-btree callback function for creating a downlink for  
a page. Previously, ginxlog.c duplicated the logic used during normal  
operation.  

M src/backend/access/gin/ginbtree.c
M src/backend/access/gin/gindatapage.c
M src/backend/access/gin/ginentrypage.c
M src/backend/access/gin/ginxlog.c
M src/include/access/gin_private.h

Further GIN refactoring.

commit   : 04965ad40e10677ceec94d871a183e73023b238f    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Wed, 20 Nov 2013 16:09:14 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Wed, 20 Nov 2013 16:09:14 +0200    

Click here for diff

Merge some functions that were always called together. Makes the code  
little bit more readable.  

M src/backend/access/gin/ginbtree.c
M src/backend/access/gin/gindatapage.c
M src/backend/access/gin/ginentrypage.c
M src/backend/access/gin/ginget.c
M src/backend/access/gin/gininsert.c
M src/include/access/gin_private.h

ecpg: Split off mmfatal() from mmerror()

commit   : b21de4e7b32f868a23bdc5507898d36cbe146164    
  
author   : Peter Eisentraut <[email protected]>    
date     : Tue, 12 Nov 2013 22:12:08 -0500    
  
committer: Peter Eisentraut <[email protected]>    
date     : Tue, 12 Nov 2013 22:12:08 -0500    

Click here for diff

This allows decorating mmfatal() with noreturn compiler hints, leading  
to better diagnostics.  

M src/interfaces/ecpg/preproc/descriptor.c
M src/interfaces/ecpg/preproc/ecpg.header
M src/interfaces/ecpg/preproc/ecpg.trailer
M src/interfaces/ecpg/preproc/extern.h
M src/interfaces/ecpg/preproc/nls.mk
M src/interfaces/ecpg/preproc/pgc.l
M src/interfaces/ecpg/preproc/type.c
M src/interfaces/ecpg/preproc/type.h
M src/interfaces/ecpg/preproc/variable.c

docs: update page format to specify page checksum field

commit   : 22967d80035427f6e9e31210b7de2e45fafcbc0c    
  
author   : Bruce Momjian <[email protected]>    
date     : Tue, 19 Nov 2013 16:54:42 -0500    
  
committer: Bruce Momjian <[email protected]>    
date     : Tue, 19 Nov 2013 16:54:42 -0500    

Click here for diff

Backpatch to 9.3  
  
Per report from Steffen Hildebrandt  

M doc/src/sgml/storage.sgml

pg_upgrade: avoid ALTER COLUMN TYPE on inherited columns

commit   : dbd786bc4f497210551a7640ee2f6afe877cc3e9    
  
author   : Bruce Momjian <[email protected]>    
date     : Tue, 19 Nov 2013 15:00:49 -0500    
  
committer: Bruce Momjian <[email protected]>    
date     : Tue, 19 Nov 2013 15:00:49 -0500    

Click here for diff

This only affects upgrades from 8.3 currently, and is harmless as the  
child just generates an error in the script, but we should get it right  
in case we ever need this for more complex uses.  
  
Per report from Peter Eisentraut  

M contrib/pg_upgrade/version_old_8_3.c

Add tab completion for \pset in psql.

commit   : b1543cc8a84bc3ca699497286608274c2533fd53    
  
author   : Fujii Masao <[email protected]>    
date     : Tue, 19 Nov 2013 23:44:14 +0900    
  
committer: Fujii Masao <[email protected]>    
date     : Tue, 19 Nov 2013 23:44:14 +0900    

Click here for diff

Pavel Stehule, reviewed by Ian Lawrence Barwick  

M src/bin/psql/tab-complete.c

pg_upgrade: Report full disk better

commit   : bd5a9a50e4946ffc58a632b5717c8cfddd3ea6ce    
  
author   : Peter Eisentraut <[email protected]>    
date     : Mon, 18 Nov 2013 21:49:40 -0500    
  
committer: Peter Eisentraut <[email protected]>    
date     : Mon, 18 Nov 2013 21:49:40 -0500    

Click here for diff

Previously, pg_upgrade would abort copy_file() on a short write without  
setting errno, which the caller would report as an error with the  
message "Success".  We assume ENOSPC in that case, as we do elsewhere in  
the code.  Also set errno in some other error cases in copy_file() to  
avoid bogus "Success" error messages.  
  
This was broken in 6b711cf37c228749b6a8cef50e16e3c587d18dd4, so 9.2 and  
before are OK.  

M contrib/pg_upgrade/file.c

unaccent: Revert patch 9299f6179838cef8aa1123f6fb76f0d3d6f2decc

commit   : 0dbf9a6a91675b99a5097528729c38e7f3015646    
  
author   : Bruce Momjian <[email protected]>    
date     : Mon, 18 Nov 2013 15:54:34 -0500    
  
committer: Bruce Momjian <[email protected]>    
date     : Mon, 18 Nov 2013 15:54:34 -0500    

Click here for diff

The reverted patch to change functions from strict to immutable was  
incorrect and needs additional research.  

M contrib/unaccent/unaccent–1.0.sql
M contrib/unaccent/unaccent–unpackaged–1.0.sql

Spell SQL keywords in uppercase in pg_dump's query.

commit   : fea437681d68a0027091c2d534c69c0965cf06f1    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Mon, 18 Nov 2013 18:33:41 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Mon, 18 Nov 2013 18:33:41 +0200    

Click here for diff

The server won't care, but let's be consistent.  
  
David Rowley.  

M src/bin/pg_dump/pg_dump.c

Replace appendPQExpBuffer(..., <constant>) with appendPQExpBufferStr

commit   : 32ceba3ea730b6b1bd3eca786f72d61945ad42b7    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Mon, 18 Nov 2013 18:29:01 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Mon, 18 Nov 2013 18:29:01 +0200    

Click here for diff

Arguably makes the code a bit more readable, and might give a small  
performance gain.  
  
David Rowley  

M src/bin/pg_dump/dumputils.c
M src/bin/pg_dump/pg_backup_archiver.c
M src/bin/pg_dump/pg_dump.c
M src/bin/pg_dump/pg_dumpall.c
M src/bin/psql/command.c
M src/bin/psql/copy.c
M src/bin/psql/describe.c
M src/bin/psql/tab-complete.c
M src/bin/scripts/clusterdb.c
M src/bin/scripts/createdb.c
M src/bin/scripts/createuser.c
M src/bin/scripts/reindexdb.c
M src/bin/scripts/vacuumdb.c
M src/interfaces/libpq/fe-connect.c
M src/test/isolation/isolationtester.c

Use cstring_to_text_with_len when length is known.

commit   : f1df4731eea6bc05e0769e9cc789e7304722efe4    
  
author   : Robert Haas <[email protected]>    
date     : Mon, 18 Nov 2013 10:17:07 -0500    
  
committer: Robert Haas <[email protected]>    
date     : Mon, 18 Nov 2013 10:17:07 -0500    

Click here for diff

This avoids a potentially-expensive extra call to strlen().  
  
David Rowley  

M contrib/pageinspect/fsmfuncs.c
M src/backend/utils/adt/json.c

Count locked pages that don't need vacuuming as scanned.

commit   : 4c697d8f4845823a8af67788b219ffa4516ad14c    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Mon, 18 Nov 2013 09:51:09 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Mon, 18 Nov 2013 09:51:09 +0200    

Click here for diff

Previously, if VACUUM skipped vacuuming a page because it's pinned, it  
didn't count that page as scanned. However, that meant that relfrozenxid  
was not bumped up either, which prevented anti-wraparound vacuum from  
doing its job.  
  
Report by Миша Тюрин, analysis and patch by Sergey Burladyn and Jeff Janes.  
Backpatch to 9.2, where the skip-locked-pages behavior was introduced.  

M src/backend/commands/vacuumlazy.c

Add make_date() and make_time() functions.

commit   : f901bb50e33ad95593bb68f7b3b55eb2e47607dc    
  
author   : Tom Lane <[email protected]>    
date     : Sun, 17 Nov 2013 15:06:50 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Sun, 17 Nov 2013 15:06:50 -0500    

Click here for diff

Pavel Stehule, reviewed by Jeevan Chalke and Atri Sharma  

M doc/src/sgml/func.sgml
M src/backend/utils/adt/date.c
M src/backend/utils/adt/datetime.c
M src/include/catalog/catversion.h
M src/include/catalog/pg_proc.h
M src/include/utils/date.h
M src/include/utils/datetime.h
M src/test/regress/expected/date.out
M src/test/regress/sql/date.sql

Improve performance of numeric sum(), avg(), stddev(), variance(), etc.

commit   : 69c8fbac201652282e18b0e2e301d4ada991fbde    
  
author   : Tom Lane <[email protected]>    
date     : Sat, 16 Nov 2013 18:46:34 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Sat, 16 Nov 2013 18:46:34 -0500    

Click here for diff

This patch improves performance of most built-in aggregates that formerly  
used a NUMERIC or NUMERIC array as their transition type; this includes  
not only aggregates on numeric inputs, but some aggregates on integer  
inputs where overflow of an int8 value is a possibility.  The code now  
uses a special-purpose data structure to avoid array construction and  
deconstruction overhead, as well as packing and unpacking overhead for  
numeric values.  
  
These aggregates' transition type is now declared as INTERNAL, since  
it doesn't correspond to any SQL data type.  To keep the planner from  
thinking that that means a lot of storage will be used, we make use  
of the just-added pg_aggregate.aggtransspace feature.  The space estimate  
is set to 128 bytes, which is at least in the right ballpark.  
  
Hadi Moshayedi, reviewed by Pavel Stehule and Tomas Vondra  

M src/backend/utils/adt/numeric.c
M src/include/catalog/catversion.h
M src/include/catalog/pg_aggregate.h
M src/include/catalog/pg_proc.h
M src/include/utils/builtins.h
M src/test/regress/expected/aggregates.out
M src/test/regress/sql/aggregates.sql

Allow aggregates to provide estimates of their transition state data size.

commit   : 6cb86143e8e1e855255edc706bce71c6ebfd9a6c    
  
author   : Tom Lane <[email protected]>    
date     : Sat, 16 Nov 2013 16:03:40 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Sat, 16 Nov 2013 16:03:40 -0500    

Click here for diff

Formerly the planner had a hard-wired rule of thumb for guessing the amount  
of space consumed by an aggregate function's transition state data.  This  
estimate is critical to deciding whether it's OK to use hash aggregation,  
and in many situations the built-in estimate isn't very good.  This patch  
adds a column to pg_aggregate wherein a per-aggregate estimate can be  
provided, overriding the planner's default, and infrastructure for setting  
the column via CREATE AGGREGATE.  
  
It may be that additional smarts will be required in future, perhaps even  
a per-aggregate estimation function.  But this is already a step forward.  
  
This is extracted from a larger patch to improve the performance of numeric  
and int8 aggregates.  I (tgl) thought it was worth reviewing and committing  
this infrastructure separately.  In this commit, all built-in aggregates  
are given aggtransspace = 0, so no behavior should change.  
  
Hadi Moshayedi, reviewed by Pavel Stehule and Tomas Vondra  

M doc/src/sgml/catalogs.sgml
M doc/src/sgml/ref/create_aggregate.sgml
M src/backend/catalog/pg_aggregate.c
M src/backend/commands/aggregatecmds.c
M src/backend/commands/define.c
M src/backend/optimizer/util/clauses.c
M src/bin/pg_dump/pg_dump.c
M src/include/catalog/catversion.h
M src/include/catalog/pg_aggregate.h
M src/include/commands/defrem.h
M src/test/regress/expected/create_aggregate.out
M src/test/regress/expected/opr_sanity.out
M src/test/regress/sql/create_aggregate.sql
M src/test/regress/sql/opr_sanity.sql

pg_upgrade: Fix some whitespace oddities

commit   : 55c3d86a2a374f9d8fd88fd947601c1f49a4da08    
  
author   : Peter Eisentraut <[email protected]>    
date     : Sat, 16 Nov 2013 11:35:44 -0500    
  
committer: Peter Eisentraut <[email protected]>    
date     : Sat, 16 Nov 2013 11:35:44 -0500    

Click here for diff

M contrib/pg_upgrade/check.c
M contrib/pg_upgrade/version_old_8_3.c

Remove pgbench's hardwired limit on line length in custom script files.

commit   : 61a07bae47886b8333b9cce882d73d5fdaaec618    
  
author   : Tom Lane <[email protected]>    
date     : Fri, 15 Nov 2013 19:41:09 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Fri, 15 Nov 2013 19:41:09 -0500    

Click here for diff

pgbench formerly failed on lines longer than BUFSIZ, unexpectedly  
splitting them into multiple commands.  Allow it to work with any  
length of input line.  
  
Sawada Masahiko  

M contrib/pgbench/pgbench.c

Fix incorrect loop counts in tidbitmap.c.

commit   : f1f21b2d6fd170faf9824306ef4f4950c32ce49d    
  
author   : Tom Lane <[email protected]>    
date     : Fri, 15 Nov 2013 18:34:14 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Fri, 15 Nov 2013 18:34:14 -0500    

Click here for diff

A couple of places that should have been iterating over WORDS_PER_CHUNK  
words were iterating over WORDS_PER_PAGE words instead.  This thinko  
accidentally failed to fail, because (at least on common architectures  
with default BLCKSZ) WORDS_PER_CHUNK is a bit less than WORDS_PER_PAGE,  
and the extra words being looked at were always zero so nothing happened.  
Still, it's a bug waiting to happen if anybody ever fools with the  
parameters affecting TIDBitmap sizes, and it's a small waste of cycles  
too.  So back-patch to all active branches.  
  
Etsuro Fujita  

M src/backend/nodes/tidbitmap.c

Speed up printing of INSERT statements in pg_dump.

commit   : 97e1ec467099f1e581f491c8a57b7d56d0b9c539    
  
author   : Tom Lane <[email protected]>    
date     : Fri, 15 Nov 2013 18:02:06 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Fri, 15 Nov 2013 18:02:06 -0500    

Click here for diff

In --inserts and especially --column-inserts mode, we can get a useful  
speedup by generating the common prefix of all a table's INSERT commands  
just once, and then printing the prebuilt string for each row.  This avoids  
multiple invocations of fmtId() and other minor fooling around.  
  
David Rowley  

M src/bin/pg_dump/pg_dump.c

Clean up password prompting logic in streamutil.c.

commit   : 3172eea062e779db39df9a48fca0ad7448163f98    
  
author   : Tom Lane <[email protected]>    
date     : Fri, 15 Nov 2013 17:27:41 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Fri, 15 Nov 2013 17:27:41 -0500    

Click here for diff

The previous coding was fairly unreadable and drew double-free warnings  
from clang.  I believe the double free was actually not reachable, because  
PQconnectionNeedsPassword is coded to not return true if a password was  
provided, so that the loop can't iterate more than twice.  Nonetheless  
it seems worth rewriting.  No back-patch since this is just cosmetic.  

M src/bin/pg_basebackup/streamutil.c

Compute correct em_nullable_relids in get_eclass_for_sort_expr().

commit   : f3b3b8d5be00ebcfade3644fca7a80e25fd88a70    
  
author   : Tom Lane <[email protected]>    
date     : Fri, 15 Nov 2013 16:46:18 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Fri, 15 Nov 2013 16:46:18 -0500    

Click here for diff

Bug #8591 from Claudio Freire demonstrates that get_eclass_for_sort_expr  
must be able to compute valid em_nullable_relids for any new equivalence  
class members it creates.  I'd worried about this in the commit message  
for db9f0e1d9a4a0842c814a464cdc9758c3f20b96c, but claimed that it wasn't a  
problem because multi-member ECs should already exist when it runs.  That  
is transparently wrong, though, because this function is also called by  
initialize_mergeclause_eclasses, which runs during deconstruct_jointree.  
The example given in the bug report (which the new regression test item  
is based upon) fails because the COALESCE() expression is first seen by  
initialize_mergeclause_eclasses rather than process_equivalence.  
  
Fixing this requires passing the appropriate nullable_relids set to  
get_eclass_for_sort_expr, and it requires new code to compute that set  
for top-level expressions such as ORDER BY, GROUP BY, etc.  We store  
the top-level nullable_relids in a new field in PlannerInfo to avoid  
computing it many times.  In the back branches, I've added the new  
field at the end of the struct to minimize ABI breakage for planner  
plugins.  There doesn't seem to be a good alternative to changing  
get_eclass_for_sort_expr's API signature, though.  There probably aren't  
any third-party extensions calling that function directly; moreover,  
if there are, they probably need to think about what to pass for  
nullable_relids anyway.  
  
Back-patch to 9.2, like the previous patch in this area.  

M src/backend/nodes/outfuncs.c
M src/backend/optimizer/path/equivclass.c
M src/backend/optimizer/path/pathkeys.c
M src/backend/optimizer/plan/initsplan.c
M src/include/nodes/relation.h
M src/include/optimizer/paths.h
M src/test/regress/expected/join.out
M src/test/regress/sql/join.sql

Prevent leakage of cached plans and execution trees in plpgsql DO blocks.

commit   : c7b849a89645212121da480091f87d11fac82495    
  
author   : Tom Lane <[email protected]>    
date     : Fri, 15 Nov 2013 13:52:03 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Fri, 15 Nov 2013 13:52:03 -0500    

Click here for diff

plpgsql likes to cache query plans and simple-expression execution state  
trees across calls.  This is a considerable win for multiple executions  
of the same function.  However, it's useless for DO blocks, since by  
definition those are executed only once and discarded.  Nonetheless,  
we were allowing a DO block's expression execution trees to survive  
until end of transaction, resulting in a significant intra-transaction  
memory leak, as reported by Yeb Havinga.  Worse, if the DO block exited  
with an error, the compiled form of the block's code was leaked till  
end of session --- along with subsidiary plancache entries.  
  
To fix, make DO blocks keep their expression execution trees in a private  
EState that's deleted at exit from the block, and add a PG_TRY block  
to plpgsql_inline_handler to make sure that memory cleanup happens  
even on error exits.  Also add a regression test covering error handling  
in a DO block, because my first try at this broke that.  (The test is  
not meant to prove that we don't leak memory anymore, though it could  
be used for that with a much larger loop count.)  
  
Ideally we'd back-patch this into all versions supporting DO blocks;  
but the patch needs to add a field to struct PLpgSQL_execstate, and that  
would break ABI compatibility for third-party plugins such as the plpgsql  
debugger.  Given the small number of complaints so far, fixing this in  
HEAD only seems like an acceptable choice.  

M src/pl/plpgsql/src/pl_exec.c
M src/pl/plpgsql/src/pl_handler.c
M src/pl/plpgsql/src/plpgsql.h
M src/test/regress/expected/plpgsql.out
M src/test/regress/sql/plpgsql.sql

Minor comment corrections for sequence hashtable patch.

commit   : 80e3a470ba46bc35fb1ec22d4e97126270f3d2b3    
  
author   : Tom Lane <[email protected]>    
date     : Fri, 15 Nov 2013 12:17:12 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Fri, 15 Nov 2013 12:17:12 -0500    

Click here for diff

There were enough typos in the comments to annoy me ...  

M src/backend/commands/sequence.c

Fix buffer overrun in isolation test program.

commit   : 7cb964acb794078ef033cbf2e3a0e7670c8992a9    
  
author   : Kevin Grittner <[email protected]>    
date     : Fri, 15 Nov 2013 08:27:42 -0600    
  
committer: Kevin Grittner <[email protected]>    
date     : Fri, 15 Nov 2013 08:27:42 -0600    

Click here for diff

Commit 061b88c732952c59741374806e1e41c1ec845d50 saved argv0 to a  
global buffer without ensuring that it was zero terminated,  
allowing references to it to overrun the buffer and access other  
memory.  This probably would not have presented any security risk,  
but could have resulted in very confusing failures if the path to  
the executable was very long.  
  
Reported by David Rowley  

M src/test/isolation/isolation_main.c

doc: Restore proper alphabetical order.

commit   : 71dd54ada9c3d32dfc0eb082ff2023b12abe881a    
  
author   : Robert Haas <[email protected]>    
date     : Fri, 15 Nov 2013 08:44:18 -0500    
  
committer: Robert Haas <[email protected]>    
date     : Fri, 15 Nov 2013 08:44:18 -0500    

Click here for diff

Colin 't Hart  

M doc/src/sgml/reference.sgml

Fix bogus hash table creation.

commit   : 5cb719beeef2e871c9f0b22e799554bf801ac390    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Fri, 15 Nov 2013 14:23:40 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Fri, 15 Nov 2013 14:23:40 +0200    

Click here for diff

Andres Freund  

M src/backend/commands/sequence.c

Use a hash table to store current sequence values.

commit   : 21025d4a5322307bcfef1222f497a3aacb2fc79a    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Fri, 15 Nov 2013 12:29:38 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Fri, 15 Nov 2013 12:29:38 +0200    

Click here for diff

This speeds up nextval() and currval(), when you touch a lot of different  
sequences in the same backend.  
  
David Rowley  

M src/backend/commands/sequence.c

Add a regression test case for \d on an index.

commit   : 982b82d6b1fd007b9357ce198d13a55544888534    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 14 Nov 2013 10:35:15 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 14 Nov 2013 10:35:15 -0500    

Click here for diff

Previous commit shows the need for this.  The coverage isn't really  
thorough, but it's better than nothing.  

M src/test/regress/expected/create_index.out
M src/test/regress/sql/create_index.sql

Fix incorrect column name in psql \d code.

commit   : e694cf25d787354ed04310a14aa508692874dcad    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 14 Nov 2013 10:27:24 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 14 Nov 2013 10:27:24 -0500    

Click here for diff

pg_index.indisreplident had at one time in its development been called  
indisidentity.  describe.c got missed when it was renamed.  
Bug introduced in commit 07cacba983ef79be4a84fcd0e0ca3b5fcb85dd65.  
  
Andres Freund  

M src/bin/psql/describe.c

Fix whitespace

commit   : 87d8378f60cef2206b0d4a09eb773ed416fa58fc    
  
author   : Peter Eisentraut <[email protected]>    
date     : Wed, 13 Nov 2013 21:25:52 -0500    
  
committer: Peter Eisentraut <[email protected]>    
date     : Wed, 13 Nov 2013 21:25:52 -0500    

Click here for diff

M src/tools/msvc/vcregress.pl

Clarify CREATE FUNCTION documentation about handling of typmods.

commit   : 5d924f067c0cc0b15709bdf604e6ac5f33158eb6    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 13 Nov 2013 13:26:33 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 13 Nov 2013 13:26:33 -0500    

Click here for diff

The previous text was a bit misleading, as well as unnecessarily vague  
about what information would be discarded.  Per gripe from Craig Skinner.  

M doc/src/sgml/ref/create_function.sgml

Fix isolation check for MSVC to handle recent changes.

commit   : 869b1e4a678cc6d78a64ed01682ddf8f8debd781    
  
author   : Andrew Dunstan <[email protected]>    
date     : Wed, 13 Nov 2013 12:59:48 -0500    
  
committer: Andrew Dunstan <[email protected]>    
date     : Wed, 13 Nov 2013 12:59:48 -0500    

Click here for diff

M src/tools/msvc/vcregress.pl

Fix relfilenodemap.c's handling of cache invalidations.

commit   : c46c803f8ad4ba80472b280703983ecf8021099e    
  
author   : Robert Haas <[email protected]>    
date     : Wed, 13 Nov 2013 10:52:59 -0500    
  
committer: Robert Haas <[email protected]>    
date     : Wed, 13 Nov 2013 10:52:59 -0500    

Click here for diff

The old code entered a new hash table entry first, then scanned  
pg_class to determine what value to fill in, and then populated the  
entry.  This fails to work properly if a cache invalidation happens  
as a result of opening pg_class.  Repair.  
  
Along the way, get rid of the idea of blowing away the entire hash  
table as a method of processing invalidations.  Instead, just delete  
all the entries one by one.  This is probably not quite as cheap but  
it's simpler, and shouldn't happen often.  
  
Andres Freund  

M src/backend/utils/cache/relfilenodemap.c

docs: clarify MVCC introduction to allow for per-statement snapshots

commit   : cd8115e0090cb04380292f880adcec9c2fc2e0f3    
  
author   : Bruce Momjian <[email protected]>    
date     : Wed, 13 Nov 2013 10:14:05 -0500    
  
committer: Bruce Momjian <[email protected]>    
date     : Wed, 13 Nov 2013 10:14:05 -0500    

Click here for diff

M doc/src/sgml/mvcc.sgml

Free ignorelist after each regression test schedule.

commit   : fe67d252337ef2aba3d4ea06a4aa87cdbc75b933    
  
author   : Kevin Grittner <[email protected]>    
date     : Wed, 13 Nov 2013 09:01:06 -0600    
  
committer: Kevin Grittner <[email protected]>    
date     : Wed, 13 Nov 2013 09:01:06 -0600    

Click here for diff

It's a trivial amount of RAM held until the end of the regression  
test run; but it's probably worth fixing to silence future warnings  
from code analyzers.  
  
This was the only memory leak pointed out by clang's static code  
analysis tool.  

M src/test/regress/pg_regress.c

Fix bug in GIN posting tree root creation.

commit   : 07fca603b56e39c50478b44070fdfb38313cd51c    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Wed, 13 Nov 2013 13:44:46 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Wed, 13 Nov 2013 13:44:46 +0200    

Click here for diff

The root page is filled with as many items as fit, and the rest are inserted  
using normal insertions. However, I fumbled the variable names, and the code  
actually memcpy'd all the items on the page, overflowing the buffer. While  
at it, rename the variable to make the distinction more clear.  
  
Reported by Teodor Sigaev. This bug was introduced by my recent  
refactorings, so no backpatching required.  

M src/backend/access/gin/gindatapage.c

Move variable closer to where it is used

commit   : aa04b323c36931f96159ab1fd6f74f8401ab4c92    
  
author   : Peter Eisentraut <[email protected]>    
date     : Wed, 13 Nov 2013 06:26:27 -0500    
  
committer: Peter Eisentraut <[email protected]>    
date     : Wed, 13 Nov 2013 06:26:27 -0500    

Click here for diff

This avoids an unused variable warning on Windows when building without  
asserts  
  
From: David Rowley <[email protected]>  

M src/backend/utils/cache/relfilenodemap.c

gitattributes: Make syntax compatible with older Git versions

commit   : c0764a542530c7ebf8abd2766d256d49d27e90e8    
  
author   : Peter Eisentraut <[email protected]>    
date     : Tue, 12 Nov 2013 21:58:46 -0500    
  
committer: Peter Eisentraut <[email protected]>    
date     : Tue, 12 Nov 2013 21:58:46 -0500    

Click here for diff

Avoid the use of **, which was only introduced in Git version 1.8.2.  

M .gitattributes

Try again to make pg_isolation_regress work its build directory.

commit   : 061b88c732952c59741374806e1e41c1ec845d50    
  
author   : Robert Haas <[email protected]>    
date     : Tue, 12 Nov 2013 11:23:47 -0500    
  
committer: Robert Haas <[email protected]>    
date     : Tue, 12 Nov 2013 11:23:47 -0500    

Click here for diff

We can't search for the isolationtester binary until after we've set  
up the environment, because otherwise when find_other_exec() tries  
to invoke it with the -V option, it might fail for inability to  
locate a working libpq.  So postpone that step.  
  
Andres Freund  

M src/test/isolation/isolation_main.c

doc: Fix typo.

commit   : 9cab81b5721b1a64c8e31feebbc0ae5efd6ddf71    
  
author   : Robert Haas <[email protected]>    
date     : Tue, 12 Nov 2013 10:23:23 -0500    
  
committer: Robert Haas <[email protected]>    
date     : Tue, 12 Nov 2013 10:23:23 -0500    

Click here for diff

Reported by Thom Brown.  

M doc/src/sgml/backup.sgml

commit   : f1d6875916055914920f657ad88011c5b525f220    
  
author   : Magnus Hagander <[email protected]>    
date     : Tue, 12 Nov 2013 12:53:32 +0100    
  
committer: Magnus Hagander <[email protected]>    
date     : Tue, 12 Nov 2013 12:53:32 +0100    

Click here for diff

Per report from Colin 't Hart  

M README.git

Remove leftovers of IRIX port

commit   : 3626adf26652cdf76a26ae14b2d75cb7801da7a9    
  
author   : Peter Eisentraut <[email protected]>    
date     : Tue, 12 Nov 2013 06:39:36 -0500    
  
committer: Peter Eisentraut <[email protected]>    
date     : Tue, 12 Nov 2013 06:39:36 -0500    

Click here for diff

This removes the remaining pieces of the IRIX port that was removed by  
ea91a6be89575095f61ebf36d67c2df98be093db.  

D src/makefiles/Makefile.irix
D src/template/irix

Fix failure with whole-row reference to a subquery.

commit   : ebefbb5fdeba885bb57d2f2e1eb185a46c9d777d    
  
author   : Tom Lane <[email protected]>    
date     : Mon, 11 Nov 2013 16:36:27 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Mon, 11 Nov 2013 16:36:27 -0500    

Click here for diff

Simple oversight in commit 1cb108efb0e60d87e4adec38e7636b6e8efbeb57 ---  
recursively examining a subquery output column is only sane if the  
original Var refers to a single output column.  Found by Kevin Grittner.  

M src/backend/utils/adt/selfuncs.c

Fix ruleutils pretty-printing to not generate trailing whitespace.

commit   : 0b7e660d6c70f45e06f1b52f255116bcb44624eb    
  
author   : Tom Lane <[email protected]>    
date     : Mon, 11 Nov 2013 13:36:38 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Mon, 11 Nov 2013 13:36:38 -0500    

Click here for diff

The pretty-printing logic in ruleutils.c operates by inserting a newline  
and some indentation whitespace into strings that are already valid SQL.  
This naturally results in leaving some trailing whitespace before the  
newline in many cases; which can be annoying when processing the output  
with other tools, as complained of by Joe Abbate.  We can fix that in  
a pretty localized fashion by deleting any trailing whitespace before  
we append a pretty-printing newline.  In addition, we have to modify the  
code inserted by commit 2f582f76b1945929ff07116cd4639747ce9bb8a1 so that  
we also delete trailing whitespace when transposing items from temporary  
buffers into the main result string, when a temporary item starts with a  
newline.  
  
This results in rather voluminous changes to the regression test results,  
but it's easily verified that they are only removal of trailing whitespace.  
  
Back-patch to 9.3, because the aforementioned commit resulted in many  
more cases of trailing whitespace than had occurred in earlier branches.  

M src/backend/utils/adt/ruleutils.c
M src/test/regress/expected/aggregates.out
M src/test/regress/expected/create_view.out
M src/test/regress/expected/matview.out
M src/test/regress/expected/polymorphism.out
M src/test/regress/expected/rules.out
M src/test/regress/expected/triggers.out
M src/test/regress/expected/updatable_views.out
M src/test/regress/expected/with.out

Re-allow duplicate aliases within aliased JOINs.

commit   : 648bd05b13b3624e494ae2996c2d2e0241cefe87    
  
author   : Tom Lane <[email protected]>    
date     : Mon, 11 Nov 2013 10:42:57 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Mon, 11 Nov 2013 10:42:57 -0500    

Click here for diff

Although the SQL spec forbids duplicate table aliases, historically  
we've allowed queries like  
    SELECT ... FROM tab1 x CROSS JOIN (tab2 x CROSS JOIN tab3 y) z  
on the grounds that the aliased join (z) hides the aliases within it,  
therefore there is no conflict between the two RTEs named "x".  The  
LATERAL patch broke this, on the misguided basis that "x" could be  
ambiguous if tab3 were a LATERAL subquery.  To avoid breaking existing  
queries, it's better to allow this situation and complain only if  
tab3 actually does contain an ambiguous reference.  We need only remove  
the check that was throwing an error, because the column lookup code  
is already prepared to handle ambiguous references.  Per bug #8444.  

M src/backend/parser/parse_clause.c
M src/backend/parser/parse_relation.c
M src/test/regress/expected/join.out
M src/test/regress/sql/join.sql

Don't abort pg_basebackup when receiving empty WAL block

commit   : 705556a631c5908cd3caa0b973be13d994ff63e7    
  
author   : Magnus Hagander <[email protected]>    
date     : Mon, 11 Nov 2013 14:59:55 +0100    
  
committer: Magnus Hagander <[email protected]>    
date     : Mon, 11 Nov 2013 14:59:55 +0100    

Click here for diff

This is a similar fix as c6ec8793aa59d1842082e14b4b4aae7d4bd883fd  
9.2. This should never happen in 9.3 and newer since the special case  
cannot happen there, but this patch synchronizes up the code so there  
is no confusion on why they're different. An empty block is as harmless  
in 9.3 as it was in 9.2, and can safely be ignored.  

M src/bin/pg_basebackup/receivelog.c

Fix whitespace issues found by git diff --check, add gitattributes

commit   : 001e114b8d59f4eaf2a314a2bc5e57078afdf82f    
  
author   : Peter Eisentraut <[email protected]>    
date     : Sun, 10 Nov 2013 09:20:52 -0500    
  
committer: Peter Eisentraut <[email protected]>    
date     : Sun, 10 Nov 2013 09:20:52 -0500    

Click here for diff

Set per file type attributes in .gitattributes to fine-tune whitespace  
checks.  With the associated cleanups, the tree is now clean for git  

A .gitattributes
M configure.in
M contrib/hstore/hstore–1.1–1.2.sql
M contrib/hstore/sql/hstore.sql
M contrib/intarray/bench/bench.pl
M contrib/pgbench/pgbench.c
M contrib/pgcrypto/expected/pgp-encrypt.out
M contrib/pgcrypto/sql/pgp-encrypt.sql
M doc/src/sgml/event-trigger.sgml
M doc/src/sgml/func.sgml
M doc/src/sgml/pgbench.sgml
M doc/src/sgml/ref/select.sgml
M doc/src/sgml/sources.sgml
M doc/src/sgml/syntax.sgml
M src/backend/catalog/aclchk.c
M src/backend/catalog/objectaddress.c
M src/backend/commands/tablecmds.c
M src/backend/nodes/makefuncs.c
M src/backend/optimizer/plan/createplan.c
M src/backend/parser/gram.y
M src/backend/postmaster/bgworker.c
M src/backend/storage/ipc/dsm.c
M src/backend/utils/adt/json.c
M src/backend/utils/cache/relcache.c
M src/backend/utils/error/elog.c
M src/backend/utils/misc/guc.c
M src/backend/utils/misc/postgresql.conf.sample
M src/bin/pg_dump/pg_dump.c
M src/bin/psql/command.c
M src/bin/psql/describe.c
M src/bin/psql/tab-complete.c
M src/include/nodes/execnodes.h
M src/include/nodes/parsenodes.h
M src/interfaces/ecpg/README.dynSQL
M src/interfaces/ecpg/preproc/check_rules.pl
M src/interfaces/ecpg/preproc/parse.pl
M src/interfaces/ecpg/preproc/pgc.l
M src/interfaces/ecpg/test/Makefile
M src/interfaces/ecpg/test/expected/preproc-autoprep.c
M src/interfaces/ecpg/test/expected/preproc-type.c
M src/interfaces/ecpg/test/expected/sql-fetch.c
M src/interfaces/ecpg/test/expected/sql-insupd.c
M src/interfaces/ecpg/test/expected/sql-parser.c
M src/interfaces/ecpg/test/expected/sql-quote.c
M src/interfaces/ecpg/test/preproc/autoprep.pgc
M src/interfaces/ecpg/test/preproc/type.pgc
M src/interfaces/ecpg/test/sql/dyntest.pgc
M src/interfaces/ecpg/test/sql/fetch.pgc
M src/interfaces/ecpg/test/sql/insupd.pgc
M src/interfaces/ecpg/test/sql/parser.pgc
M src/interfaces/ecpg/test/sql/quote.pgc
M src/pl/plperl/expected/plperl_array.out
M src/pl/plperl/sql/plperl_array.sql
M src/pl/plpgsql/src/pl_exec.c
M src/pl/plpgsql/src/pl_gram.y
M src/pl/tcl/expected/pltcl_setup.out
M src/pl/tcl/modules/pltcl_listmod.in
M src/pl/tcl/modules/pltcl_loadmod.in
M src/pl/tcl/sql/pltcl_setup.sql
M src/test/regress/expected/alter_generic.out
M src/test/regress/expected/json.out
M src/test/regress/expected/json_1.out
M src/test/regress/expected/plpgsql.out
M src/test/regress/expected/select_views.out
M src/test/regress/expected/select_views_1.out
M src/test/regress/expected/uuid.out
M src/test/regress/sql/alter_generic.sql
M src/test/regress/sql/json.sql
M src/test/regress/sql/plpgsql.sql
M src/test/regress/sql/select_views.sql
M src/test/regress/sql/uuid.sql
M src/timezone/tznames/Australia.txt
M src/timezone/tznames/Default
M src/timezone/tznames/Etc.txt
M src/tools/RELEASE_CHANGES
M src/tools/copyright.pl
M src/tools/msvc/pgflex.pl
M src/tools/pgindent/pgindent.man

Fix ECPG compiler warning.

commit   : dca09ac53329e92d73f45674957c26d3d7ae5117    
  
author   : Robert Haas <[email protected]>    
date     : Sat, 9 Nov 2013 18:53:57 -0500    
  
committer: Robert Haas <[email protected]>    
date     : Sat, 9 Nov 2013 18:53:57 -0500    

Click here for diff

Commit 9b4d52f2095be96ca238ce41f6963ec56376491f failed to notice  
that pg_regress_ecpg needed updating.  
  
This patch was independently submitted by both David Rowley  
and Andres Freund.  

M src/interfaces/ecpg/test/pg_regress_ecpg.c

Fix race condition in GIN posting tree page deletion.

commit   : ac4ab97ec05ea900db0f14d428cae2e79832e02d    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Fri, 8 Nov 2013 22:21:42 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Fri, 8 Nov 2013 22:21:42 +0200    

Click here for diff

If a page is deleted, and reused for something else, just as a search is  
following a rightlink to it from its left sibling, the search would continue  
scanning whatever the new contents of the page are. That could lead to  
incorrect query results, or even something more curious if the page is  
reused for a different kind of a page.  
  
To fix, modify the search algorithm to lock the next page before releasing  
the previous one, and refrain from deleting pages from the leftmost branch  
of the tree.  
  
Add a new Concurrency section to the README, explaining why this works.  
There is a lot more one could say about concurrency in GIN, but that's for  
another patch.  
  
Backpatch to all supported versions.  

M src/backend/access/gin/README
M src/backend/access/gin/ginbtree.c
M src/backend/access/gin/ginget.c
M src/backend/access/gin/ginvacuum.c
M src/include/access/gin_private.h

doc: Clarify under what circumstances pg_dump needs superuser access.

commit   : 636b868f17a6d38c0f9e099ea8f389a555403f9e    
  
author   : Robert Haas <[email protected]>    
date     : Fri, 8 Nov 2013 15:08:11 -0500    
  
committer: Robert Haas <[email protected]>    
date     : Fri, 8 Nov 2013 15:08:11 -0500    

Click here for diff

Inspired by, but different from, a patch from Ivan Lezhnjov IV  

M doc/src/sgml/backup.sgml

Fix pg_isolation_regress to work outside its build directory.

commit   : 9b4d52f2095be96ca238ce41f6963ec56376491f    
  
author   : Robert Haas <[email protected]>    
date     : Fri, 8 Nov 2013 14:40:41 -0500    
  
committer: Robert Haas <[email protected]>    
date     : Fri, 8 Nov 2013 14:40:41 -0500    

Click here for diff

This makes it possible to, for example, use the isolation tester to  
test a contrib module.  
  
Andres Freund  

M src/test/isolation/isolation_main.c
M src/test/isolation/isolationtester.c
M src/test/regress/pg_regress.c
M src/test/regress/pg_regress.h
M src/test/regress/pg_regress_main.c

Add the notion of REPLICA IDENTITY for a table.

commit   : 07cacba983ef79be4a84fcd0e0ca3b5fcb85dd65    
  
author   : Robert Haas <[email protected]>    
date     : Fri, 8 Nov 2013 12:30:43 -0500    
  
committer: Robert Haas <[email protected]>    
date     : Fri, 8 Nov 2013 12:30:43 -0500    

Click here for diff

Pending patches for logical replication will use this to determine  
which columns of a tuple ought to be considered as its candidate key.  
  
Andres Freund, with minor, mostly cosmetic adjustments by me  

M doc/src/sgml/catalogs.sgml
M doc/src/sgml/ref/alter_table.sgml
M src/backend/catalog/heap.c
M src/backend/catalog/index.c
M src/backend/commands/tablecmds.c
M src/backend/nodes/copyfuncs.c
M src/backend/nodes/equalfuncs.c
M src/backend/parser/gram.y
M src/backend/utils/cache/relcache.c
M src/bin/pg_dump/pg_dump.c
M src/bin/pg_dump/pg_dump.h
M src/bin/psql/describe.c
M src/bin/psql/tab-complete.c
M src/include/catalog/catversion.h
M src/include/catalog/pg_class.h
M src/include/catalog/pg_index.h
M src/include/nodes/nodes.h
M src/include/nodes/parsenodes.h
M src/include/utils/rel.h
A src/test/regress/expected/replica_identity.out
M src/test/regress/parallel_schedule
M src/test/regress/serial_schedule
A src/test/regress/sql/replica_identity.sql

Make contain_volatile_functions/contain_mutable_functions look into SubLinks.

commit   : b97ee66cc1f9319f7b457e7d8a78aab711da2dda    
  
author   : Tom Lane <[email protected]>    
date     : Fri, 8 Nov 2013 11:36:57 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Fri, 8 Nov 2013 11:36:57 -0500    

Click here for diff

This change prevents us from doing inappropriate subquery flattening in  
cases such as dangerous functions hidden inside a sub-SELECT in the  
targetlist of another sub-SELECT.  That could result in unexpected behavior  
due to multiple evaluations of a volatile function, as in a recent  
complaint from Etienne Dube.  It's been questionable from the very  
beginning whether these functions should look into subqueries (as noted in  
their comments), and this case seems to provide proof that they should.  
  
Because the new code only descends into SubLinks, not SubPlans or  
InitPlans, the change only affects the planner's behavior during  
prepjointree processing and not later on --- for example, you can still get  
it to use a volatile function in an indexqual if you wrap the function in  
(SELECT ...).  That's a historical behavior, for sure, but it's reasonable  
given that the executor's evaluation rules for subplans don't depend on  
whether there are volatile functions inside them.  In any case, we need to  
constrain the behavioral change as narrowly as we can to make this  
reasonable to back-patch.  

M src/backend/optimizer/util/clauses.c
M src/test/regress/expected/subselect.out
M src/test/regress/sql/subselect.sql

Fix subtly-wrong volatility checking in BeginCopyFrom().

commit   : 060b22a99a67e01aa097f1a21d2123f166ccdb15    
  
author   : Tom Lane <[email protected]>    
date     : Fri, 8 Nov 2013 08:59:39 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Fri, 8 Nov 2013 08:59:39 -0500    

Click here for diff

contain_volatile_functions() is best applied to the output of  
expression_planner(), not its input, so that insertion of function  
default arguments and constant-folding have been done.  (See comments  
at CheckMutability, for instance.)  It's perhaps unlikely that anyone  
will notice a difference in practice, but still we should do it properly.  
  
In passing, change variable type from Node* to Expr* to reduce the net  
number of casts needed.  
  
Noted while perusing uses of contain_volatile_functions().  

M src/backend/commands/copy.c

Make LOCK_PRINT & PROCLOCK_PRINT expand to ((void) 0) when not in use.

commit   : 20803d7881c3865edede170579f55261140b5d0d    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 7 Nov 2013 19:07:38 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 7 Nov 2013 19:07:38 -0500    

Click here for diff

This avoids warnings from more-anal-than-average compilers, and might  
prevent hidden syntax problems in the future.  
  
Andres Freund  

M src/backend/storage/lmgr/lock.c

Silence benign warnings from clang version 3.0-6ubuntu3.

commit   : b64b5ccb6a9c6877080b8ef86790e738031089d5    
  
author   : Kevin Grittner <[email protected]>    
date     : Thu, 7 Nov 2013 16:35:43 -0600    
  
committer: Kevin Grittner <[email protected]>    
date     : Thu, 7 Nov 2013 16:35:43 -0600    

Click here for diff

M contrib/pg_standby/pg_standby.c
M src/backend/utils/cache/catcache.c

Prevent display of dropped columns in row constraint violation messages.

commit   : c28b289bf365ab11f23460d02a43667f6a8b8bc7    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 7 Nov 2013 14:41:36 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 7 Nov 2013 14:41:36 -0500    

Click here for diff

ExecBuildSlotValueDescription() printed "null" for each dropped column in  
a row being complained of by ExecConstraints().  This has some sanity in  
terms of the underlying implementation, but is of course pretty surprising  
to users.  To fix, we must pass the target relation's descriptor to  
ExecBuildSlotValueDescription(), because the slot descriptor it had been  
using doesn't get labeled with attisdropped markers.  
  
Per bug #8408 from Maxim Boguk.  Back-patch to 9.2 where the feature of  
printing row values in NOT NULL and CHECK constraint violation messages  
was introduced.  
  
Michael Paquier and Tom Lane  

M src/backend/executor/execMain.c
M src/test/regress/expected/alter_table.out
M src/test/regress/sql/alter_table.sql

Fix generation of MergeAppend plans for optimized min/max on expressions.

commit   : 5e900bc00f77da8d5c28812c49f48858755fba44    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 7 Nov 2013 13:13:12 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 7 Nov 2013 13:13:12 -0500    

Click here for diff

Before jamming a desired targetlist into a plan node, one really ought to  
make sure the plan node can handle projections, and insert a buffering  
Result plan node if not.  planagg.c forgot to do this, which is a hangover  
from the days when it only dealt with IndexScan plan types.  MergeAppend  
doesn't project though, not to mention that it gets unhappy if you remove  
its possibly-resjunk sort columns.  The code accidentally failed to fail  
for cases in which the min/max argument was a simple Var, because the new  
targetlist would be equivalent to the original "flat" tlist anyway.  
For any more complex case, it's been broken since 9.1 where we introduced  
the ability to optimize min/max using MergeAppend, as reported by Raphael  
Bauduin.  Fix by duplicating the logic from grouping_planner that decides  
whether we need a Result node.  
  
In 9.2 and 9.1, this requires back-porting the tlist_same_exprs() function  
introduced in commit 4387cf956b9eb13aad569634e0c4df081d76e2e3, else we'd  
uselessly add a Result node in cases that worked before.  It's rather  
tempting to back-patch that whole commit so that we can avoid extra Result  
nodes in mainline cases too; but I'll refrain, since that code hasn't  
really seen all that much field testing yet.  

M src/backend/optimizer/plan/planagg.c
M src/test/regress/expected/inherit.out
M src/test/regress/sql/inherit.sql

Fix setting of right bound at GIN page split.

commit   : fde7172d932bc0c6e62be50293876916efada016    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Thu, 7 Nov 2013 19:36:52 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Thu, 7 Nov 2013 19:36:52 +0200    

Click here for diff

Broken by my refactoring.  

M src/backend/access/gin/gindatapage.c

Add #ifdef guards for some POSIX error symbols that Windows doesn't like.

commit   : 8dace66e0735ca39b779922d02c24ea2686e6521    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 6 Nov 2013 20:22:42 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 6 Nov 2013 20:22:42 -0500    

Click here for diff

Per buildfarm results.  It looks like the older the Windows version, the  
more errno codes it hasn't got ...  

M src/backend/utils/error/elog.c

Be more robust when strerror() doesn't give a useful result.

commit   : 8e68816cc2567642c6fcca4eaac66c25e0ae5ced    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 6 Nov 2013 15:50:17 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 6 Nov 2013 15:50:17 -0500    

Click here for diff

glibc, at least, is capable of returning "???" instead of anything useful  
if it doesn't like the setting of LC_CTYPE.  If this happens, or in the  
previously-known case of strerror() returning an empty string, try to  
print the C macro name for the error code ("EACCES" etc).  Only if we  
don't have the error code in our compiled-in list of popular error codes  
(which covers most though not quite all of what's called out in the POSIX  
spec) will we fall back to printing a numeric error code.  This should  
simplify debugging.  
  
Note that this functionality is currently only provided for %m in backend  
ereport/elog messages.  That may be sufficient, since we don't fool with the  
locale environment in frontend clients, but it's foreseeable that we might  
want similar code in libpq for instance.  
  
There was some talk of back-patching this, but let's see how the buildfarm  
likes it first.  It seems likely that at least some of the POSIX-defined  
error code symbols don't exist on all platforms.  I don't want to clutter  
the entire list with #ifdefs, but we may need more than are here now.  
  
MauMau, edited by me  

M src/backend/utils/error/elog.c

Support default arguments and named-argument notation for window functions.

commit   : bb45c640411af61279bea044f8d108f9da96b735    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 6 Nov 2013 13:26:30 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 6 Nov 2013 13:26:30 -0500    

Click here for diff

These things didn't work because the planner omitted to do the necessary  
preprocessing of a WindowFunc's argument list.  Add the few dozen lines  
of code needed to handle that.  
  
Although this sounds like a feature addition, it's really a bug fix because  
the default-argument case was likely to crash previously, due to lack of  
checking of the number of supplied arguments in the built-in window  
functions.  It's not a security issue because there's no way for a  
non-superuser to create a window function definition with defaults that  
refers to a built-in C function, but nonetheless people might be annoyed  
that it crashes rather than producing a useful error message.  So  
back-patch as far as the patch applies easily, which turns out to be 9.2.  
I'll put a band-aid in earlier versions as a separate patch.  
  
(Note that these features still don't work for aggregates, and fixing that  
case will be harder since we represent aggregate arg lists as target lists  
not bare expression lists.  There's no crash risk though because CREATE  
AGGREGATE doesn't accept defaults, and we reject named-argument notation  
when parsing an aggregate call.)  

M doc/src/sgml/syntax.sgml
M src/backend/optimizer/util/clauses.c
M src/backend/parser/parse_func.c
M src/backend/utils/adt/ruleutils.c
M src/test/regress/expected/window.out
M src/test/regress/sql/window.sql

Keep heap open until new heap generated in RMV.

commit   : 5829082a57be8bcbc5f75cd28d935730b783c6d2    
  
author   : Kevin Grittner <[email protected]>    
date     : Wed, 6 Nov 2013 12:27:52 -0600    
  
committer: Kevin Grittner <[email protected]>    
date     : Wed, 6 Nov 2013 12:27:52 -0600    

Click here for diff

Early close became apparent when invalidation messages were  
processed in a new location under CLOBBER_CACHE_ALWAYS builds, due  
to additional locking.  
  
Back-patch to 9.3  

M src/backend/commands/matview.c

Fix missing argument and function prototypes.

commit   : 0ea53256a856693dc8e8e1ce5ce26b3438d2e341    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Wed, 6 Nov 2013 11:20:52 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Wed, 6 Nov 2013 11:20:52 +0200    

Click here for diff

Not sure how I missed these in previous commit.  

M src/backend/access/gin/gininsert.c
M src/include/access/gin_private.h

Misc GIN refactoring.

commit   : ecaa4708e5dde5e9f72cdb066780acb4b12ee0ec    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Wed, 6 Nov 2013 10:31:38 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Wed, 6 Nov 2013 10:31:38 +0200    

Click here for diff

Merge the isEnoughSpace and placeToPage functions in the b-tree interface  
into one function that tries to put a tuple on page, and returns false if  
it doesn't fit.  
  
Move createPostingTree function to gindatapage.c, and change its contract  
so that it can be passed more items than fit on the root page. It's in a  
better position than the callers to know how many items fit.  
  
Move ginMergeItemPointers out of gindatapage.c, into a separate file.  
  
These changes make no difference now, but reduce the footprint of Alexander  
Korotkov's upcoming patch to pack item pointers more tightly.  

M src/backend/access/gin/Makefile
M src/backend/access/gin/README
M src/backend/access/gin/ginbtree.c
M src/backend/access/gin/gindatapage.c
M src/backend/access/gin/ginentrypage.c
M src/backend/access/gin/gininsert.c
A src/backend/access/gin/ginpostinglist.c
M src/backend/access/gin/ginvacuum.c
M src/include/access/gin_private.h

Improve the error message given for modifying a window with frame clause.

commit   : 920c8261d58c10de7e68d99c8dd21a9650928d59    
  
author   : Tom Lane <[email protected]>    
date     : Tue, 5 Nov 2013 21:58:08 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Tue, 5 Nov 2013 21:58:08 -0500    

Click here for diff

For rather inscrutable reasons, SQL:2008 disallows copying-and-modifying a  
window definition that has any explicit framing clause.  The error message  
we gave for this only made sense if the referencing window definition  
itself contains an explicit framing clause, which it might well not.  
Moreover, in the context of an OVER clause it's not exactly obvious that  
"OVER (windowname)" implies copy-and-modify while "OVER windowname" does  
not.  This has led to multiple complaints, eg bug #5199 from Iliya  
Krapchatov.  Change to a hopefully more intelligible error message, and  
in the case where we have just "OVER (windowname)", add a HINT suggesting  
that omitting the parentheses will fix it.  Also improve the related  
documentation.  Back-patch to all supported branches.  

M doc/src/sgml/syntax.sgml
M src/backend/parser/parse_clause.c

Revert commit 0725065b37b8b0e9074a624a8d3e3ac1844fc820.

commit   : d4e6133c681f0038861e5cf8707302bd80917fa0    
  
author   : Tom Lane <[email protected]>    
date     : Tue, 5 Nov 2013 17:51:58 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Tue, 5 Nov 2013 17:51:58 -0500    

Click here for diff

The previous commit was intended to make psql show the full path name when  
doing a \s (history save), but it was very badly implemented and would show  
confusing if not outright wrong information in many situations; for  
instance if the path name given to \s is absolute, or if \cd commands  
involving relative paths have been issued.  Consensus seems to be that  
we don't especially need this functionality in \s, and certainly not in \s  
alone.  So revert rather than trying to fix it up.  Per gripe from  
Ian Barwick.  
  
Although the bogus behavior exists in all supported versions, I'm not  
back-patching, because the work created for translators (by change of  
a translatable message) would probably outweigh the value of what is  
after all a mostly-cosmetic change.  

M src/bin/psql/command.c
M src/bin/psql/settings.h

Lock relation used to generate fresh data for RMV.

commit   : 2636ecf78b608f7faf1a0a7ff9b56fa54b7710db    
  
author   : Kevin Grittner <[email protected]>    
date     : Tue, 5 Nov 2013 15:36:33 -0600    
  
committer: Kevin Grittner <[email protected]>    
date     : Tue, 5 Nov 2013 15:36:33 -0600    

Click here for diff

The relation should not be accessible to any other process, but it  
should be locked for consistency.  Since this is not known to  
cause any bug, it will not be back-patch, at least for now.  
  
Per report from Andres Freund  

M src/backend/commands/matview.c

Fix some obsolete information in src/backend/optimizer/README.

commit   : 6331de1d44f01d408aa48c5c996bae8932f7a072    
  
author   : Tom Lane <[email protected]>    
date     : Tue, 5 Nov 2013 11:31:35 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Tue, 5 Nov 2013 11:31:35 -0500    

Click here for diff

Constant quals aren't handled the same way they used to be.  Also,  
add mention of a couple more major steps in grouping_planner.  
Per complaint a couple months back from Etsuro Fujita.  

M src/backend/optimizer/README

Fix breakage of MV column name list usage.

commit   : 732758db4c8226b74a6ea7a90bc8c3cd15f5fe86    
  
author   : Kevin Grittner <[email protected]>    
date     : Mon, 4 Nov 2013 14:31:07 -0600    
  
committer: Kevin Grittner <[email protected]>    
date     : Mon, 4 Nov 2013 14:31:07 -0600    

Click here for diff

Per bug report from Tomonari Katsumata.  
  
Back-patch to 9.3.  

M src/backend/rewrite/rewriteDefine.c
M src/test/regress/expected/matview.out
M src/test/regress/sql/matview.sql

Fix format code used to print dsm request sizes.

commit   : dddc34408aa6ca535e89cb26653014bb019bc263    
  
author   : Robert Haas <[email protected]>    
date     : Mon, 4 Nov 2013 11:22:03 -0500    
  
committer: Robert Haas <[email protected]>    
date     : Mon, 4 Nov 2013 11:22:03 -0500    

Click here for diff

Per report from Peter Eisentraut.  

M src/backend/storage/ipc/dsm.c
M src/backend/storage/ipc/dsm_impl.c

Fix parsing of xlog file name in pg_receivexlog.

commit   : 2103430179c6be37d68364c84d68d5211472f528    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Mon, 4 Nov 2013 10:51:37 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Mon, 4 Nov 2013 10:51:37 +0200    

Click here for diff

The parsing of WAL filenames of segments larger than > 255 was broken,  
making pg_receivexlog unable to restart streaming after stopping it.  
  
The bug was introduced by the changes in 9.3 to represent WAL segment number  
as a 64-bit integer instead of two ints, log and seg. To fix, replace the  
plain sscanf call with XLogFromFileName macro, which does the conversion  
from log+seg to a 64-bit integer correcly.  
  
Reported by Mika Eloranta.  

M src/bin/pg_basebackup/pg_receivexlog.c

Get rid of more cases of the "must detoast before output function" meme.

commit   : e36ce0c7f7b329b25f92cf440fd88fcc695de101    
  
author   : Tom Lane <[email protected]>    
date     : Sun, 3 Nov 2013 11:55:37 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Sun, 3 Nov 2013 11:55:37 -0500    

Click here for diff

I missed that json.c was doing this too, because for some bizarre reason  
it wasn't doing it adjacent to the output function call.  

M src/backend/utils/adt/json.c

Prevent memory leaks from accumulating across printtup() calls.

commit   : b006f4ddb988568081f8290fac77f9402b137120    
  
author   : Tom Lane <[email protected]>    
date     : Sun, 3 Nov 2013 11:33:05 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Sun, 3 Nov 2013 11:33:05 -0500    

Click here for diff

Historically, printtup() has assumed that it could prevent memory leakage  
by pfree'ing the string result of each output function and manually  
managing detoasting of toasted values.  This amounts to assuming that  
datatype output functions never leak any memory internally; an assumption  
we've already decided to be bogus elsewhere, for example in COPY OUT.  
range_out in particular is known to leak multiple kilobytes per call, as  
noted in bug #8573 from Godfried Vanluffelen.  While we could go in and fix  
that leak, it wouldn't be very notationally convenient, and in any case  
there have been and undoubtedly will again be other leaks in other output  
functions.  So what seems like the best solution is to run the output  
functions in a temporary memory context that can be reset after each row,  
as we're doing in COPY OUT.  Some quick experimentation suggests this is  
actually a tad faster than the retail pfree's anyway.  
  
This patch fixes all the variants of printtup, except for debugtup()  
which is used in standalone mode.  It doesn't seem worth worrying  
about query-lifespan leaks in standalone mode, and fixing that case  
would be a bit tedious since debugtup() doesn't currently have any  
startup or shutdown functions.  
  
While at it, remove manual detoast management from several other  
output-function call sites that had copied it from printtup().  This  
doesn't make a lot of difference right now, but in view of recent  
discussions about supporting "non-flattened" Datums, we're going to  
want that code gone eventually anyway.  
  
Back-patch to 9.2 where range_out was introduced.  We might eventually  
decide to back-patch this further, but in the absence of known major  
leaks in older output functions, I'll refrain for now.  

M src/backend/access/common/printtup.c
M src/backend/bootstrap/bootstrap.c
M src/backend/executor/spi.c
M src/backend/utils/adt/rowtypes.c

Changed test case slightly so it doesn't have an unused typedef.

commit   : 84a05d479e7d1287caaca24a36b30d62cdc78924    
  
author   : Michael Meskes <[email protected]>    
date     : Sun, 3 Nov 2013 15:37:34 +0100    
  
committer: Michael Meskes <[email protected]>    
date     : Sun, 3 Nov 2013 15:37:34 +0100    

Click here for diff

M src/interfaces/ecpg/test/expected/preproc-define.c
M src/interfaces/ecpg/test/expected/preproc-define.stderr
M src/interfaces/ecpg/test/preproc/define.pgc

Acquire appropriate locks when rewriting during RMV.

commit   : 2a781d57dcd027df32d15ee2378b84d0c4d005d1    
  
author   : Kevin Grittner <[email protected]>    
date     : Sat, 2 Nov 2013 19:18:08 -0500    
  
committer: Kevin Grittner <[email protected]>    
date     : Sat, 2 Nov 2013 19:18:08 -0500    

Click here for diff

Since the query has not been freshly parsed when executing REFRESH  
MATERIALIZED VIEW, locks must be explicitly taken before rewrite.  
  
Backpatch to 9.3.  
  
Andres Freund  

M src/backend/commands/matview.c

Fix subquery reference to non-populated MV in CMV.

commit   : be420fa02e69f084a0eeac6d2cb5424551aad495    
  
author   : Kevin Grittner <[email protected]>    
date     : Sat, 2 Nov 2013 18:38:17 -0500    
  
committer: Kevin Grittner <[email protected]>    
date     : Sat, 2 Nov 2013 18:38:17 -0500    

Click here for diff

A subquery reference to a matview should be allowed by CREATE  
MATERIALIZED VIEW WITH NO DATA, just like a direct reference is.  
  
Per bug report from Laurent Sartran.  
  
Backpatch to 9.3.  

M src/backend/executor/execMain.c
M src/test/regress/expected/matview.out
M src/test/regress/sql/matview.sql

Retry after buffer locking failure during SPGiST index creation.

commit   : 24ace4053d42e2c48af8c15d598622e488fb9502    
  
author   : Tom Lane <[email protected]>    
date     : Sat, 2 Nov 2013 16:45:42 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Sat, 2 Nov 2013 16:45:42 -0400    

Click here for diff

The original coding thought this case was impossible, but it can happen  
if the bgwriter or checkpointer processes decide to write out an index  
page while creation is still proceeding, leading to a bogus "unexpected  
spgdoinsert() failure" error.  Problem reported by Jonathan S. Katz.  
  
Teodor Sigaev  

M src/backend/access/spgist/spgdoinsert.c
M src/backend/access/spgist/spginsert.c

Ensure all files created for a single BufFile have the same resource owner.

commit   : bffd1ce92cb4e3e44c3c0ff8cdd4a5a2a8be5e3c    
  
author   : Tom Lane <[email protected]>    
date     : Fri, 1 Nov 2013 16:09:48 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Fri, 1 Nov 2013 16:09:48 -0400    

Click here for diff

Callers expect that they only have to set the right resource owner when  
creating a BufFile, not during subsequent operations on it.  While we could  
insist this be fixed at the caller level, it seems more sensible for the  
BufFile to take care of it.  Without this, some temp files belonging to  
a BufFile can go away too soon, eg at the end of a subtransaction,  
leading to errors or crashes.  
  
Reported and fixed by Andres Freund.  Back-patch to all active branches.  

M src/backend/storage/file/buffile.c

Remove CTimeZone/HasCTZSet, root and branch.

commit   : 45f64f1bbf19283795762df6a54f9aa74fee05f7    
  
author   : Tom Lane <[email protected]>    
date     : Fri, 1 Nov 2013 13:57:31 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Fri, 1 Nov 2013 13:57:31 -0400    

Click here for diff

These variables no longer have any useful purpose, since there's no reason  
to special-case brute force timezones now that we have a valid  
session_timezone setting for them.  Remove the variables, and remove the  
SET/SHOW TIME ZONE code that deals with them.  
  
The user-visible impact of this is that SHOW TIME ZONE will now show a  
POSIX-style zone specification, in the form "<+-offset>-+offset", rather  
than an interval value when a brute-force zone has been set.  While perhaps  
less intuitive, this is a better definition than before because it's  
actually possible to give that string back to SET TIME ZONE and get the  
same behavior, unlike what used to happen.  
  
We did not previously mention the angle-bracket syntax when describing  
POSIX timezone specifications; add some documentation so that people  
can figure out what these strings do.  (There's still quite a lot of  
undocumented functionality there, but anybody who really cares can  
go read the POSIX spec to find out about it.  In practice most people  
seem to prefer Olsen-style city names anyway.)  

M doc/src/sgml/datatype.sgml
M doc/src/sgml/ref/set.sgml
M src/backend/commands/variable.c
M src/backend/utils/init/globals.c
M src/include/miscadmin.h
M src/test/regress/expected/horology.out

Remove internal uses of CTimeZone/HasCTZSet.

commit   : 1c8a7f617fd1d38cb0540266e4fca6835f61005a    
  
author   : Tom Lane <[email protected]>    
date     : Fri, 1 Nov 2013 12:51:27 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Fri, 1 Nov 2013 12:51:27 -0400    

Click here for diff

The only remaining places where we actually look at CTimeZone/HasCTZSet  
are abstime2tm() and timestamp2tm().  Now that session_timezone is always  
valid, we can remove these special cases.  The caller-visible impact of  
this is that these functions now always return a valid zone abbreviation  
if requested, whereas before they'd return a NULL pointer if a brute-force  
timezone was in use.  In the existing code, the only place I can find that  
changes behavior is to_char(), whose TZ format code will now print  
something useful rather than nothing for such zones.  (In the places where  
the returned zone abbreviation is passed to EncodeDateTime, the lack of  
visible change is because we've chosen the abbreviation used for these  
zones to match what EncodeTimezone would have printed.)  
  
It's likely that there is now a fair amount of removable dead code around  
the call sites, namely anything that's meant to cope with getting a NULL  
timezone abbreviation, but I've not made an effort to root that out.  
  
This could be back-patched if we decide we'd like to fix to_char()'s  
behavior in the back branches, but there doesn't seem to be much  
enthusiasm for that at present.  

M src/backend/utils/adt/nabstime.c
M src/backend/utils/adt/timestamp.c
M src/test/regress/expected/horology.out

Fix some odd behaviors when using a SQL-style simple GMT offset timezone.

commit   : 631dc390f49909a5c8ebd6002cfb2bcee5415a9d    
  
author   : Tom Lane <[email protected]>    
date     : Fri, 1 Nov 2013 12:13:18 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Fri, 1 Nov 2013 12:13:18 -0400    

Click here for diff

Formerly, when using a SQL-spec timezone setting with a fixed GMT offset  
(called a "brute force" timezone in the code), the session_timezone  
variable was not updated to match the nominal timezone; rather, all code  
was expected to ignore session_timezone if HasCTZSet was true.  This is  
of course obviously fragile, though a search of the code finds only  
timeofday() failing to honor the rule.  A bigger problem was that  
DetermineTimeZoneOffset() supposed that if its pg_tz parameter was  
pointer-equal to session_timezone, then HasCTZSet should override the  
parameter.  This would cause datetime input containing an explicit zone  
name to be treated as referencing the brute-force zone instead, if the  
zone name happened to match the session timezone that had prevailed  
before installing the brute-force zone setting (as reported in bug #8572).  
The same malady could affect AT TIME ZONE operators.  
  
To fix, set up session_timezone so that it matches the brute-force zone  
specification, which we can do using the POSIX timezone definition syntax  
"<abbrev>offset", and get rid of the bogus lookaside check in  
DetermineTimeZoneOffset().  Aside from fixing the erroneous behavior in  
datetime parsing and AT TIME ZONE, this will cause the timeofday() function  
to print its result in the user-requested time zone rather than some  
previously-set zone.  It might also affect results in third-party  
extensions, if there are any that make use of session_timezone without  
considering HasCTZSet, but in all cases the new behavior should be saner  
than before.  
  
Back-patch to all supported branches.  

M src/backend/commands/variable.c
M src/backend/utils/adt/datetime.c
M src/include/pgtime.h
M src/test/regress/expected/horology.out
M src/test/regress/sql/horology.sql
M src/timezone/pgtz.c

Use appendStringInfoString instead of appendStringInfo where possible.

commit   : cacbdd78106526d7c4f11f90b538f96ba8696fb0    
  
author   : Robert Haas <[email protected]>    
date     : Thu, 31 Oct 2013 10:55:59 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Thu, 31 Oct 2013 10:55:59 -0400    

Click here for diff

This shaves a few cycles, and generally seems like good programming  
practice.  
  
David Rowley  

M contrib/cube/cube.c
M contrib/dblink/dblink.c
M contrib/pg_trgm/trgm_regexp.c
M contrib/postgres_fdw/deparse.c
M contrib/postgres_fdw/postgres_fdw.c
M contrib/tablefunc/tablefunc.c
M src/backend/access/rmgrdesc/clogdesc.c
M src/backend/access/rmgrdesc/dbasedesc.c
M src/backend/access/rmgrdesc/gindesc.c
M src/backend/access/rmgrdesc/gistdesc.c
M src/backend/access/rmgrdesc/heapdesc.c
M src/backend/access/rmgrdesc/mxactdesc.c
M src/backend/access/rmgrdesc/nbtdesc.c
M src/backend/access/rmgrdesc/relmapdesc.c
M src/backend/access/rmgrdesc/seqdesc.c
M src/backend/access/rmgrdesc/smgrdesc.c
M src/backend/access/rmgrdesc/spgdesc.c
M src/backend/access/rmgrdesc/standbydesc.c
M src/backend/access/rmgrdesc/tblspcdesc.c
M src/backend/access/rmgrdesc/xactdesc.c
M src/backend/access/rmgrdesc/xlogdesc.c
M src/backend/access/transam/xlog.c
M src/backend/catalog/objectaddress.c
M src/backend/commands/explain.c
M src/backend/commands/tsearchcmds.c
M src/backend/nodes/outfuncs.c
M src/backend/tcop/postgres.c
M src/backend/utils/adt/regproc.c
M src/backend/utils/adt/ri_triggers.c
M src/backend/utils/adt/ruleutils.c
M src/backend/utils/adt/xml.c
M src/backend/utils/fmgr/dfmgr.c
M src/backend/utils/misc/guc.c

Avoid too-large shift on 32-bit Windows.

commit   : 343bb134ea20d3b7286c620c15a067da79cab724    
  
author   : Robert Haas <[email protected]>    
date     : Wed, 30 Oct 2013 09:13:42 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Wed, 30 Oct 2013 09:13:42 -0400    

Click here for diff

Apparently, shifts greater than or equal to the width of the type  
are undefined, and can surprisingly produce a non-zero value.  
  
Amit Kapila, with a comment by me.  

M src/backend/storage/ipc/dsm_impl.c

Fix old typo in comment.

commit   : 6756c8ad305f78a1d27875c3d40d3bf271cf4789    
  
author   : Tom Lane <[email protected]>    
date     : Tue, 29 Oct 2013 15:34:18 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Tue, 29 Oct 2013 15:34:18 -0400    

Click here for diff

NFAs have children, but their individual states don't.  

M src/include/regex/regguts.h

Prevent using strncpy with src == dest in TupleDescInitEntry.

commit   : 9a9473f3cce1a21c25d6cc7569710e832d2b180b    
  
author   : Tom Lane <[email protected]>    
date     : Mon, 28 Oct 2013 20:49:24 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Mon, 28 Oct 2013 20:49:24 -0400    

Click here for diff

The C and POSIX standards state that strncpy's behavior is undefined when  
source and destination areas overlap.  While it remains dubious whether any  
implementations really misbehave when the pointers are exactly equal, some  
platforms are now starting to force the issue by complaining when an  
undefined call occurs.  (In particular OS X 10.9 has been seen to dump core  
here, though the exact set of circumstances needed to trigger that remain  
elusive.  Similar behavior can be expected to be optional on Linux and  
other platforms in the near future.)  So tweak the code to explicitly do  
nothing when nothing need be done.  
  
Back-patch to all active branches.  In HEAD, this also lets us get rid of  
an exception in valgrind.supp.  
  
Per discussion of a report from Matthias Schmitt.  

M src/backend/access/common/tupdesc.c
M src/tools/valgrind.supp

Modify dynamic shared memory code to use Size rather than uint64.

commit   : d2aecaea15556f9986759f3455609bcafb0a3992    
  
author   : Robert Haas <[email protected]>    
date     : Mon, 28 Oct 2013 12:12:06 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Mon, 28 Oct 2013 12:12:06 -0400    

Click here for diff

This is more consistent with what we do elsewhere.  

M src/backend/storage/ipc/dsm.c
M src/backend/storage/ipc/dsm_impl.c
M src/include/storage/dsm.h
M src/include/storage/dsm_impl.h

Work around NetBSD shell issue in pg_upgrade test script.

commit   : c737a2e5641a324d3987750b73928c481a5254a0    
  
author   : Andrew Dunstan <[email protected]>    
date     : Mon, 28 Oct 2013 11:45:50 -0400    
  
committer: Andrew Dunstan <[email protected]>    
date     : Mon, 28 Oct 2013 11:45:50 -0400    

Click here for diff

The NetBSD shell apparently returns non-zero from an unset command if  
the variable is already unset. This matters when, as in pg_upgrade's  
test.sh, we are working under 'set -e'. To protect against this, we  
first set the PG variables to an empty string before unsetting them  
completely.  
  
Error found on buildfarm member coypu, solution from Rémi Zara.  

M contrib/pg_upgrade/test.sh

Improve documentation about usage of FDW validator functions.

commit   : c2b51cf1903d5ed5e962ed68b4a4eeb40fe037db    
  
author   : Tom Lane <[email protected]>    
date     : Mon, 28 Oct 2013 10:28:35 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Mon, 28 Oct 2013 10:28:35 -0400    

Click here for diff

SGML documentation, as well as code comments, failed to note that an FDW's  
validator will be applied to foreign-table options for foreign tables using  
the FDW.  
  
Etsuro Fujita  

M doc/src/sgml/ref/alter_foreign_data_wrapper.sgml
M doc/src/sgml/ref/create_foreign_data_wrapper.sgml
M src/backend/commands/foreigncmds.c

Suppress duplicate-index-entry warning introduced by previous commit.

commit   : 438df52df9bf7ade0c042e73e9c83c0a58adb5bb    
  
author   : Tom Lane <[email protected]>    
date     : Mon, 28 Oct 2013 10:00:28 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Mon, 28 Oct 2013 10:00:28 -0400    

Click here for diff

We don't need two index entries for lo_create pointing at the same section.  
It's a bit pedantic for the toolchain to warn about this, but warn it does.  

M doc/src/sgml/lobj.sgml

Add large object functions catering to SQL callers.

commit   : c50b7c09d852b6dc292bf24c72a0ffcac6cb2cab    
  
author   : Noah Misch <[email protected]>    
date     : Sun, 27 Oct 2013 22:42:46 -0400    
  
committer: Noah Misch <[email protected]>    
date     : Sun, 27 Oct 2013 22:42:46 -0400    

Click here for diff

With these, one need no longer manipulate large object descriptors and  
extract numeric constants from header files in order to read and write  
large object contents from SQL.  
  
Pavel Stehule, reviewed by Rushabh Lathia.  

M doc/src/sgml/func.sgml
M doc/src/sgml/lobj.sgml
M src/backend/libpq/be-fsstubs.c
M src/include/catalog/catversion.h
M src/include/catalog/pg_proc.h
M src/include/libpq/be-fsstubs.h
M src/test/regress/input/largeobject.source
M src/test/regress/output/largeobject.source
M src/test/regress/output/largeobject_1.source

Use unaligned output in selected regression queries to reduce diff noise.

commit   : 9c339eb4f853e44c462f53587f69e4a11e89c09b    
  
author   : Tom Lane <[email protected]>    
date     : Sat, 26 Oct 2013 11:24:04 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Sat, 26 Oct 2013 11:24:04 -0400    

Click here for diff

The rules regression test prints all known views and rules, which is a set  
that changes regularly.  Previously, a change in one rule would frequently  
lead to whitespace changes across the entire output of this query, which is  
painful to verify and causes undesirable conflicts between unrelated patch  
sets.  Use \a mode to improve matters.  Also use \t mode to suppress the  
total-rows count, which was also a source of unnecessary patch conflicts.  
  
Likewise modify the output mode for the list of indexed tables generated  
in sanity_check.sql.  There might be other places where we should use this  
idea, but these are the ones that have caused the most problems.  
  
Andres Freund  

M src/test/regress/expected/rules.out
M src/test/regress/expected/sanity_check.out
M src/test/regress/sql/rules.sql
M src/test/regress/sql/sanity_check.sql

Improve pqexpbuffer.c to use modern vsnprintf implementations efficiently.

commit   : 9f9d9b51f068a19ad243fd8fe500c9970999db9b    
  
author   : Tom Lane <[email protected]>    
date     : Fri, 25 Oct 2013 17:42:26 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Fri, 25 Oct 2013 17:42:26 -0400    

Click here for diff

When using a C99-compliant vsnprintf, we can use its report of the required  
buffer size to avoid making multiple loops through the formatting logic.  
This is similar to the changes recently made in stringinfo.c, but we can't  
use psprintf.c here because in libpq we don't want to exit() on error.  
(The behavior pqexpbuffer.c has historically used is to mark the  
PQExpBuffer as "broken", ie empty, if it runs into any fatal problem.)  
  
To avoid duplicating code more than necessary, I refactored  
printfPQExpBuffer and appendPQExpBuffer to share a subroutine that's  
very similar to psprintf.c's pvsnprintf in spirit.  

M src/interfaces/libpq/pqexpbuffer.c

Suppress -0 in the C field of lines computed by line_construct_pts().

commit   : 43fe90f66a0b200f6c32507428349afb45f661ca    
  
author   : Tom Lane <[email protected]>    
date     : Fri, 25 Oct 2013 15:55:15 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Fri, 25 Oct 2013 15:55:15 -0400    

Click here for diff

It's not entirely clear why some PPC machines are generating -0 here, since  
the underlying computation should be exactly 0 - 0.  Perhaps there's some  
wider-than-nominal-precision calculations happening?  Anyway, the best way  
to avoid platform-dependent results seems to be to explicitly reset -0 to  
regular zero.  

M src/backend/utils/adt/geo_ops.c

Revert "Tweak "line" test to avoid negative zeros on some platforms"

commit   : 1f7a47912af2206698d14650f2149fa951b8ce07    
  
author   : Tom Lane <[email protected]>    
date     : Fri, 25 Oct 2013 15:50:31 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Fri, 25 Oct 2013 15:50:31 -0400    

Click here for diff

This reverts commit a0a546f0d94ec6cbb3cd6b1c82f58d801046615f.  
It seems better to tweak the code to suppress -0 results during  
line_construct_pts(), which I'll do in the next commit.  

M src/test/regress/expected/line.out
M src/test/regress/sql/line.sql

Tweak "line" test to avoid negative zeros on some platforms

commit   : a0a546f0d94ec6cbb3cd6b1c82f58d801046615f    
  
author   : Peter Eisentraut <[email protected]>    
date     : Fri, 25 Oct 2013 07:08:40 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Fri, 25 Oct 2013 07:08:40 -0400    

Click here for diff

M src/test/regress/expected/line.out
M src/test/regress/sql/line.sql

Ignore SIGSYS during initdb.

commit   : 5e1e47c7c00d01d1b2fd3a4354f48be427a30f67    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 24 Oct 2013 21:51:00 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 24 Oct 2013 21:51:00 -0400    

Click here for diff

This prevents the recently-added probe for shm_open() from crashing  
on platforms that are impolite enough to deliver a signal rather than  
returning ENOSYS for an unimplemented kernel call.  At least on the  
one known example (HPUX 10.20), ignoring SIGSYS does result in the  
desired behavior of getting an ENOSYS error return instead.  
  
Per discussion, we might later wish to do this in the backend as well,  
but for now it seems sufficient to do it in initdb.  

M src/bin/initdb/initdb.c

Use improved vsnprintf calling logic in more places.

commit   : 3147acd63e0135aff9a6c4b01d861251925d97d9    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 24 Oct 2013 21:43:57 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 24 Oct 2013 21:43:57 -0400    

Click here for diff

When we are using a C99-compliant vsnprintf implementation (which should be  
most places, these days) it is worth the trouble to make use of its report  
of how large the buffer needs to be to succeed.  This patch adjusts  
stringinfo.c and some miscellaneous usages in pg_dump to do that, relying  
on the logic recently added in libpgcommon's psprintf.c.  Since these  
places want to know the number of bytes written once we succeed, modify the  
API of pvsnprintf() to report that.  
  
There remains near-duplicate logic in pqexpbuffer.c, but since that code  
is in libpq, psprintf.c's approach of exit()-on-error isn't appropriate  
for use there.  Also note that I didn't bother touching the multitude  
of places that call (v)snprintf without any attempt to provide a resizable  
buffer.  
  
Release-note-worthy incompatibility: the API of appendStringInfoVA()  
changed.  If there's any third-party code that's calling that directly,  
it will need tweaking along the same lines as in this patch.  
  
David Rowley and Tom Lane  

M src/backend/lib/stringinfo.c
M src/backend/utils/error/elog.c
M src/bin/pg_dump/pg_backup_archiver.c
M src/bin/pg_dump/pg_backup_tar.c
M src/common/psprintf.c
M src/include/lib/stringinfo.h
M src/include/utils/palloc.h
M src/pl/plpython/plpy_elog.c

Increase the number of different values used when seeding random().

commit   : 98c50656cac2e6b873419fd09569a9119c02148c    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Thu, 24 Oct 2013 16:55:22 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Thu, 24 Oct 2013 16:55:22 +0300    

Click here for diff

When a backend process is forked, we initialize the system's random number  
generator with srandom(). The seed used is derived from the backend's pid  
and the timestamp. However, we only used the microseconds part of the  
timestamp, and it was XORed with the pid, so the total range of different  
seed values chosen was 0-999999. That's quite limited.  
  
Change the code to also use the seconds part of the timestamp in the seed,  
and shift the microseconds so that all 32 bits of the seed are used.  
  
Honza Horak  

M src/backend/postmaster/postmaster.c

Improve documentation of random() function.

commit   : 75fdcec14543b60cc0c67483d8cc47d5c7adf1a8    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Thu, 24 Oct 2013 15:39:30 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Thu, 24 Oct 2013 15:39:30 +0300    

Click here for diff

Move random() and setseed() to a separate table, to have them grouped  
together. Also add a notice that random() is not cryptographically secure.  
  
Original patch by Honza Horak, although I didn't use his version.  

M doc/src/sgml/func.sgml

Plug memory leak when reloading config file.

commit   : 138184adc5f7c60c184972e4d23f8cdb32aed77d    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Thu, 24 Oct 2013 15:21:50 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Thu, 24 Oct 2013 15:21:50 +0300    

Click here for diff

The absolute path to config file was not pfreed. There are probably more  
small leaks here and there in the config file reload code and assign hooks,  
and in practice no-one reloads the config files frequently enough for it to  
be a problem, but this one is trivial enough that might as well fix it.  
  
Backpatch to 9.3 where the leak was introduced.  

M src/backend/utils/misc/guc-file.l

Fix memory leak when an empty ident file is reloaded.

commit   : bb598456dcdad5080f6dee980bc5cc94d2e9f574    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Thu, 24 Oct 2013 14:03:26 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Thu, 24 Oct 2013 14:03:26 +0300    

Click here for diff

Hari Babu  

M src/backend/libpq/hba.c

Fix typos in comments.

commit   : 4d6d425ab8d9b00c097d8bb8ce85302ea62887a3    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Thu, 24 Oct 2013 11:50:02 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Thu, 24 Oct 2013 11:50:02 +0300    

Click here for diff

M src/backend/access/transam/xlogreader.c

Simplify tab completion rules for views and foreign tables.

commit   : 5c4dd2cd9a26cadb3e5234badf2a5eedf89423a2    
  
author   : Robert Haas <[email protected]>    
date     : Wed, 23 Oct 2013 13:16:25 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Wed, 23 Oct 2013 13:16:25 -0400    

Click here for diff

Since an increasing number of views and foreign tables are now able  
to be updated, complete with any table, view, or foreign table in  
the relevant contexts.  This avoids the need to use a complex  
query that may be both confusing to end-users and nonperformant  
to construct the list of possible completions.  
  
Dean Rasheed, persuant to a complaint from Bernd Helme and a  
suggestion from Peter Eisentraut  

M src/bin/psql/tab-complete.c

Fix two bugs in setting the vm bit of empty pages.

commit   : 83eb54001cb69d6ee8f0813c4e280be876823068    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Wed, 23 Oct 2013 14:03:54 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Wed, 23 Oct 2013 14:03:54 +0300    

Click here for diff

Use a critical section when setting the all-visible flag on an empty page,  
and WAL-logging it. log_newpage_buffer() contains an assertion that it  
must be called inside a critical section, and it's the right thing to do  
when modifying a buffer anyway.  
  
Also, the page should be marked dirty before calling log_newpage_buffer(),  
per the comment in log_newpage_buffer() and src/backend/access/transam/README.  
  
Patch by Andres Freund, in response to my report. Backpatch to 9.2, like  
the patch that introduced these bugs (a6370fd9).  

M src/backend/commands/vacuumlazy.c

Suppress a couple of compiler warnings seen with older gcc versions.

commit   : 5f1ab4610102a73c124000788585c1af2a36284b    
  
author   : Tom Lane <[email protected]>    
date     : Tue, 22 Oct 2013 21:31:57 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Tue, 22 Oct 2013 21:31:57 -0400    

Click here for diff

To wit,  
bgworker.c: In function `RegisterDynamicBackgroundWorker':  
bgworker.c:761: warning: `generation' might be used uninitialized in this function  
dsm_impl.c: In function `dsm_impl_op':  
dsm_impl.c:197: warning: control reaches end of non-void function  
  
Neither of these represent actual bugs, but we may as well tweak the code  
so that more compilers can tell that.  This won't change the generated code  
on compilers that do recognize that the cases are unreachable.  

M src/backend/postmaster/bgworker.c
M src/backend/storage/ipc/dsm_impl.c

Replace pg_asprintf() with psprintf().

commit   : 2c66f9924c1162bfba27c77004ccf42fb6ea188d    
  
author   : Tom Lane <[email protected]>    
date     : Tue, 22 Oct 2013 19:40:26 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Tue, 22 Oct 2013 19:40:26 -0400    

Click here for diff

This eliminates an awkward coding pattern that's also unnecessarily  
inconsistent with backend coding.  psprintf() is now the thing to  
use everywhere.  

M contrib/oid2name/oid2name.c
M contrib/pg_upgrade/check.c
M contrib/pg_upgrade/tablespace.c
M contrib/pg_upgrade/util.c
M src/backend/utils/adt/format_type.c
M src/bin/initdb/initdb.c
M src/bin/pg_ctl/pg_ctl.c
M src/bin/pg_dump/compress_io.c
M src/bin/pg_dump/pg_dump.c
M src/bin/psql/command.c
M src/bin/psql/common.c
M src/bin/psql/copy.c
M src/bin/psql/input.c
M src/bin/psql/startup.c
M src/bin/psql/tab-complete.c
M src/common/psprintf.c
M src/include/common/fe_memutils.h
M src/test/isolation/isolationtester.c
M src/test/regress/pg_regress.c

Get rid of use of asprintf() in favor of a more portable implementation.

commit   : 09a89cb5fc29b47c26d151e82293fd3bef592b7b    
  
author   : Tom Lane <[email protected]>    
date     : Tue, 22 Oct 2013 18:42:13 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Tue, 22 Oct 2013 18:42:13 -0400    

Click here for diff

asprintf(), aside from not being particularly portable, has a fundamentally  
badly-designed API; the psprintf() function that was added in passing in  
the previous patch has a much better API choice.  Moreover, the NetBSD  
implementation that was borrowed for the previous patch doesn't work with  
non-C99-compliant vsnprintf, which is something we still have to cope with  
on some platforms; and it depends on va_copy which isn't all that portable  
either.  Get rid of that code in favor of an implementation similar to what  
we've used for many years in stringinfo.c.  Also, move it into libpgcommon  
since it's not really libpgport material.  
  
I think this patch will be enough to turn the buildfarm green again, but  
there's still cosmetic work left to do, namely get rid of pg_asprintf()  
in favor of using psprintf().  That will come in a followon patch.  

M configure
M configure.in
M src/backend/libpq/auth.c
M src/backend/utils/init/miscinit.c
M src/backend/utils/mmgr/mcxt.c
M src/bin/psql/large_obj.c
M src/common/Makefile
M src/common/fe_memutils.c
A src/common/psprintf.c
M src/include/pg_config.h.in
M src/include/port.h
M src/include/port/win32.h
M src/include/utils/palloc.h
M src/interfaces/ecpg/test/expected/pgtypeslib-dt_test2.c
M src/interfaces/ecpg/test/pgtypeslib/dt_test2.pgc
M src/interfaces/libpq/fe-auth.c
D src/port/asprintf.c
M src/tools/msvc/Mkvcbuild.pm

Make use of psprintf() in recent changes

commit   : 586a8fc75bf266214d635cdcf527176b80f808ea    
  
author   : Peter Eisentraut <[email protected]>    
date     : Tue, 22 Oct 2013 07:04:41 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Tue, 22 Oct 2013 07:04:41 -0400    

Click here for diff

M src/backend/utils/adt/geo_ops.c
M src/backend/utils/error/elog.c

Adjust cube.out expected output for new test queries.

commit   : 36f4c7843cf3d201279855ed9a6ebc1deb3c9463    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Tue, 22 Oct 2013 09:28:30 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Tue, 22 Oct 2013 09:28:30 +0300    

Click here for diff

Previous commit modified the test case, but I didn't update cube.out  
expected output file in previous commit because it was not needed by the  
platforms I have easy access to. Buildfarm animal 'dugong', running  
"Debian 4.0 icc 10.1.011 ia64", has now gone red because of that, so update  
it now.  
  
Also adjust cube_3.out. According to git history, it was added to support  
64-bit MinGW. There is no such animal in the buildfarm, so I'm doing this  
blindly, but it was added quite recently so maybe someone still cares.  

M contrib/cube/expected/cube.out
M contrib/cube/expected/cube_3.out

Fix blatantly broken record_image_cmp() logic for pass-by-value fields.

commit   : 28858811472f316f73eba0e564837088fc8c6ccd    
  
author   : Tom Lane <[email protected]>    
date     : Tue, 22 Oct 2013 00:38:53 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Tue, 22 Oct 2013 00:38:53 -0400    

Click here for diff

Doesn't anybody here pay attention to compiler warnings?  

M src/backend/utils/adt/rowtypes.c

Extend cube on-disk format to pack points more tightly.

commit   : 08612f45a0e236bd01db3fc96cc1fa7bfabc927c    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Mon, 21 Oct 2013 20:59:42 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Mon, 21 Oct 2013 20:59:42 +0300    

Click here for diff

If the lower left and upper right corners of a cube are the same, set a  
flag in the cube header, and only store one copy of the coordinates. That  
cuts the on-disk size into half for the common case that the cube datatype  
is used to represent points rather than boxes.  
  
The new format is backwards-compatible with the old one, so pg_upgrade  
still works. However, to get the space savings, the data needs to be  
rewritten. A simple VACUUM FULL or REINDEX is not enough, as the old  
Datums will just be moved to the new heap/index as is. A pg_dump and  
reload, or something similar like casting to text and back, will do the  
trick.  
  
This patch deliberately doesn't update all the alternative expected output  
files, as I don't have access to machines that produce those outputs. I'm  
not sure if they are still relevant, but if they are, the buildfarm will  
tell us and produce the diff required to fix it. If none of the buildfarm  
animals need them, they should be removed altogether.  
  
Patch by Stas Kelvich.  

M contrib/cube/cube.c
M contrib/cube/cubedata.h
M contrib/cube/cubeparse.y
M contrib/cube/expected/cube_1.out
M contrib/cube/expected/cube_2.out
M contrib/cube/sql/cube.sql

doc: Improve setup for documentation building with FOP

commit   : a5963efa8f2b46700c0591281c57aeea3d429c34    
  
author   : Peter Eisentraut <[email protected]>    
date     : Wed, 11 Sep 2013 10:20:27 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Wed, 11 Sep 2013 10:20:27 -0400    

Click here for diff

Add a makefile rule for building PDFs with FOP.  Two new build targets  
in doc/src/sgml are postgres-A4-fop.pdf and postgres-US-fop.pdf.  
  
Run .fo output through xmllint for reformatting, so that errors are  
easier to find.  (The default output has hardly any line breaks, so you  
might be looking for an error in column 20000.)  
  
Set some XSLT parameters to optimize for building with FOP.  
  
Remove some redundant or somewhat useless chapterinfo/author  
information, because it renders strangely with the FO stylesheet.  
  
Reviewed-by: Álvaro Herrera <[email protected]>  

M doc/src/sgml/Makefile
M doc/src/sgml/geqo.sgml
M doc/src/sgml/nls.sgml
M doc/src/sgml/stylesheet-fo.xsl

Consistently use unsigned arithmetic for alignment calculations.

commit   : 709170b790c11b4012004a6baf11a0fc6ec950de    
  
author   : Noah Misch <[email protected]>    
date     : Sun, 20 Oct 2013 21:04:52 -0400    
  
committer: Noah Misch <[email protected]>    
date     : Sun, 20 Oct 2013 21:04:52 -0400    

Click here for diff

This avoids an assumption about the signed number representation.  It is  
anticipated to have no functional changes on supported configurations;  
many two's complement assumptions remain elsewhere.  
  
Per a suggestion from Andres Freund.  

M src/backend/access/hash/hashfunc.c
M src/include/access/tupmacs.h
M src/include/c.h

Add libpgcommon to backend gettext source files

commit   : 713a9f210d5cf5d94cc420b01eef5183569402e0    
  
author   : Peter Eisentraut <[email protected]>    
date     : Sat, 19 Oct 2013 13:49:05 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Sat, 19 Oct 2013 13:49:05 -0400    

Click here for diff

This ought to have been done when libpgcommon was split off from  
libpgport.  

M src/backend/nls.mk

Add *.pot to .gitignore

commit   : 07bf70356c4a22939dfd89f3fb48d1a50c901e13    
  
author   : Peter Eisentraut <[email protected]>    
date     : Sat, 19 Oct 2013 10:56:52 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Sat, 19 Oct 2013 10:56:52 -0400    

Click here for diff

M .gitignore

Move rmtree() from libpgport to libpgcommon

commit   : 2e6bc4b806ca92433932b34c019293a201f03e11    
  
author   : Peter Eisentraut <[email protected]>    
date     : Sat, 19 Oct 2013 10:20:51 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Sat, 19 Oct 2013 10:20:51 -0400    

Click here for diff

It requires pgfnames() from libpgcommon.  

M src/bin/initdb/nls.mk
M src/common/Makefile
A src/common/rmtree.c
M src/port/dirmod.c
M src/tools/msvc/Mkvcbuild.pm

Move pgfnames() from libpgport to libpgcommon

commit   : ba7c5975adea74c6f17bdb0e0427ad85962092a2    
  
author   : Peter Eisentraut <[email protected]>    
date     : Fri, 18 Oct 2013 21:28:15 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Fri, 18 Oct 2013 21:28:15 -0400    

Click here for diff

It requires pstrdup() from libpgcommon.  

M src/bin/initdb/nls.mk
M src/common/Makefile
A src/common/pgfnames.c
M src/port/dirmod.c
M src/tools/msvc/Mkvcbuild.pm

Allow only some columns of a view to be auto-updateable.

commit   : cab5dc5daf2f6f5da0ce79deb399633b4bb443b5    
  
author   : Robert Haas <[email protected]>    
date     : Fri, 18 Oct 2013 10:35:36 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Fri, 18 Oct 2013 10:35:36 -0400    

Click here for diff

Previously, unless all columns were auto-updateable, we wouldn't  
inserts, updates, or deletes, or at least not without a rule or trigger;  
now, we'll allow inserts and updates that target only the auto-updateable  
columns, and deletes even if there are no auto-updateable columns at  
all provided the view definition is otherwise suitable.  
  
Dean Rasheed, reviewed by Marko Tiikkaja  

M doc/src/sgml/ref/create_view.sgml
M src/backend/commands/tablecmds.c
M src/backend/commands/view.c
M src/backend/rewrite/rewriteHandler.c
M src/backend/utils/adt/misc.c
M src/include/rewrite/rewriteHandler.h
M src/test/regress/expected/updatable_views.out
M src/test/regress/sql/updatable_views.sql

Provide a reliable mechanism for terminating a background worker.

commit   : 523beaa11bdf6a9864e8978b467ed586b792c9ca    
  
author   : Robert Haas <[email protected]>    
date     : Fri, 18 Oct 2013 10:21:25 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Fri, 18 Oct 2013 10:21:25 -0400    

Click here for diff

Although previously-introduced APIs allow the process that registers a  
background worker to obtain the worker's PID, there's no way to prevent  
a worker that is not currently running from being restarted.  This  
patch introduces a new API TerminateBackgroundWorker() that prevents  
the background worker from being restarted, terminates it if it is  
currently running, and causes it to be unregistered if or when it is  
not running.  
  
Patch by me.  Review by Michael Paquier and KaiGai Kohei.  

M doc/src/sgml/bgworker.sgml
M src/backend/postmaster/bgworker.c
M src/backend/postmaster/postmaster.c
M src/include/postmaster/bgworker.h
M src/include/postmaster/bgworker_internals.h

Fix for lack of va_copy() on certain Windows versions

commit   : c2316dcda1cd057d7d4a56e3a51e3f8f0527e906    
  
author   : Peter Eisentraut <[email protected]>    
date     : Fri, 18 Oct 2013 08:29:18 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Fri, 18 Oct 2013 08:29:18 -0400    

Click here for diff

Based-on-patch-by: David Rowley <[email protected]>  

M src/include/port/win32.h

Add libpgport to isolationtester on MSVC

commit   : 595a6a035008cfa76faa2f284e91704f18673d13    
  
author   : Peter Eisentraut <[email protected]>    
date     : Fri, 18 Oct 2013 09:54:41 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Fri, 18 Oct 2013 09:54:41 -0400    

Click here for diff

From: Asif Naeem <[email protected]>  

M src/tools/msvc/Mkvcbuild.pm

Switch order of libpgport and libpgcommon in MSVC build as well

commit   : 3c093b4ad267bbba1bc1e403719dddb881d2696e    
  
author   : Peter Eisentraut <[email protected]>    
date     : Fri, 18 Oct 2013 08:15:20 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Fri, 18 Oct 2013 08:15:20 -0400    

Click here for diff

M src/tools/msvc/Mkvcbuild.pm

Remove IRIX port.

commit   : ea91a6be89575095f61ebf36d67c2df98be093db    
  
author   : Robert Haas <[email protected]>    
date     : Fri, 18 Oct 2013 08:14:21 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Fri, 18 Oct 2013 08:14:21 -0400    

Click here for diff

Development of IRIX has been discontinued, and support is scheduled  
to end in December of 2013.  Therefore, there will be no supported  
versions of this operating system by the time PostgreSQL 9.4 is  
released.  Furthermore, we have no maintainer for this platform.  

M configure
M configure.in
M doc/src/sgml/dfunc.sgml
M doc/src/sgml/installation.sgml
M src/Makefile.shlib
D src/backend/port/dynloader/irix.c
D src/backend/port/dynloader/irix.h
M src/backend/utils/adt/float.c
D src/include/port/irix.h
M src/include/storage/s_lock.h

Switch dependency order of libpgcommon and libpgport

commit   : f39418e9b36987ce1dac0c55da1452e43ec46e15    
  
author   : Peter Eisentraut <[email protected]>    
date     : Thu, 17 Oct 2013 21:52:54 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Thu, 17 Oct 2013 21:52:54 -0400    

Click here for diff

Continuing 63f32f3416a8b4f8e057dc184e8e8eae734ccc8a, libpgcommon should  
depend on libpgport, but not vice versa.  But wait_result_to_str() in  
wait_error.c depends on pstrdup() in libpgcommon.  So move exec.c and  
wait_error.c from libpgport to libpgcommon.  Also switch the link order  
in the place that's actually used by the failing ecpg builds.  
  
The function declarations have been left in port.h for now.  That should  
perhaps be separated sometime.  

M src/Makefile.global.in
M src/bin/initdb/nls.mk
M src/bin/pg_config/nls.mk
M src/bin/pg_ctl/nls.mk
M src/bin/pg_dump/nls.mk
M src/bin/psql/nls.mk
M src/common/Makefile
R099 src/port/exec.c src/common/exec.c
R098 src/port/wait_error.c src/common/wait_error.c
M src/port/Makefile
M src/tools/msvc/Mkvcbuild.pm

doc: Configure TOC generation in XSLT HTML build

commit   : ed632ab21e9c638328498a85ccf77452645943bb    
  
author   : Peter Eisentraut <[email protected]>    
date     : Thu, 17 Oct 2013 22:00:27 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Thu, 17 Oct 2013 22:00:27 -0400    

Click here for diff

The default table of contents in the XSLT HTML build is much too big and  
deep.  Configure it to look more like the one that is currently being  
produced by the DSSSL build.  

M doc/src/sgml/stylesheet.xsl

Remove spinlock support for SINIX, Sun3, and NS32K.

commit   : 81051a86bcecdc681592725139fe610b2c1d1428    
  
author   : Robert Haas <[email protected]>    
date     : Thu, 17 Oct 2013 12:02:05 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Thu, 17 Oct 2013 12:02:05 -0400    

Click here for diff

All of these platforms are very much obsolete.  
  
As far as I can determine, the last version of SINIX, later renamed  
Reliant, occurred some time between 2002 and 2005.  
  
The last release of SunOS that would run on a sun3 was released in  
November of 1991; the last release of OpenBSD which supported that  
platform was in 2001.  The highest clock speed of any processor in  
the family was 25MHz.  
  
The NS32K (national semiconductor 320xx) architecture was retired  
in 1990.  
  
Support can be re-added if a maintainer emerges for any of these  
platforms, but it seems unlikely.  
  
Reviewed by Andres Freund.  

M doc/src/sgml/installation.sgml
M src/backend/storage/lmgr/s_lock.c
M src/include/storage/s_lock.h

Return valid json when converting an empty hstore.

commit   : bbe4deac1b98594206a024c9e91d664b3c3410d9    
  
author   : Andrew Dunstan <[email protected]>    
date     : Thu, 17 Oct 2013 11:09:55 -0400    
  
committer: Andrew Dunstan <[email protected]>    
date     : Thu, 17 Oct 2013 11:09:55 -0400    

Click here for diff

Oskari Saarenmaa.  

M contrib/hstore/hstore_io.c

Silence compiler warning when SSL not in use

commit   : 86029b31e5c71be5f9aceba0da2c609496435418    
  
author   : Alvaro Herrera <[email protected]>    
date     : Thu, 17 Oct 2013 11:27:02 -0300    
  
committer: Alvaro Herrera <[email protected]>    
date     : Thu, 17 Oct 2013 11:27:02 -0300    

Click here for diff

Per Jaime Casanova and Vik Fearing  

M src/backend/libpq/be-secure.c

Allow 5+ digit years for non-ISO timestamp/date strings, where appropriate

commit   : 7778ddc7a2d5b006edbfa69cdb44b8d8c24ec1ff    
  
author   : Bruce Momjian <[email protected]>    
date     : Wed, 16 Oct 2013 13:22:55 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Wed, 16 Oct 2013 13:22:55 -0400    

Click here for diff

Report from Haribabu Kommi  

M src/backend/utils/adt/datetime.c
M src/test/regress/expected/timestamptz.out
M src/test/regress/sql/timestamptz.sql

initdb: Suppress dynamic shared memory when probing for max_connections.

commit   : d41ab71712a4457ed39d5471b23949872ac91def    
  
author   : Robert Haas <[email protected]>    
date     : Wed, 16 Oct 2013 09:41:03 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Wed, 16 Oct 2013 09:41:03 -0400    

Click here for diff

This might not be the right long-term solution here, but it will  
hopefully turn the buildfarm green again.  
  
Oversight noted by Andres Freund  

M src/bin/initdb/initdb.c

Switch order of -lpgport and -lpgcommon

commit   : 63f32f3416a8b4f8e057dc184e8e8eae734ccc8a    
  
author   : Peter Eisentraut <[email protected]>    
date     : Tue, 15 Oct 2013 23:03:42 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Tue, 15 Oct 2013 23:03:42 -0400    

Click here for diff

Conceptually, libpgcommon can depend on libpgport, but not the other way  
around.  In the past, this might not have mattered, but it's needed now  
for asprintf.  

M src/Makefile.global.in

doc: Enable book index in XSLT builds

commit   : 90c7b7d16bb3a90fc9168ff8942fbf78308e727d    
  
author   : Peter Eisentraut <[email protected]>    
date     : Tue, 15 Oct 2013 22:54:36 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Tue, 15 Oct 2013 22:54:36 -0400    

Click here for diff

The XSLT toolchain requires an empty <index> element where the index is  
supposed to appear.  Add that with conditionals to hide it from the  
DSSSL build.  

M doc/src/sgml/Makefile
M doc/src/sgml/filelist.sgml
M doc/src/sgml/postgres.sgml

docs: correct 9.1 and 9.2 release note mention of timeline switch fix

commit   : f918c52f65aa28fb8c00d3f7078ff7b4788929dc    
  
author   : Bruce Momjian <[email protected]>    
date     : Tue, 15 Oct 2013 10:34:05 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Tue, 15 Oct 2013 10:34:05 -0400    

Click here for diff

Backpatch through 9.1.  
  
KONDO Mitsumasa  

M doc/src/sgml/release-9.1.sgml
M doc/src/sgml/release-9.2.sgml

In dsm_impl_windows, don't error out when the segment already exists.

commit   : e5158613676d940cf71ecfb5c73ac933746ac847    
  
author   : Robert Haas <[email protected]>    
date     : Mon, 14 Oct 2013 11:48:49 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Mon, 14 Oct 2013 11:48:49 -0400    

Click here for diff

This is the behavior of the other implementations, and the behavior  
expected by the callers of this function.  
  
Amit Kapila  

M src/backend/storage/ipc/dsm_impl.c

Fix details missed by dynamic shared memory patch.

commit   : 05a0283e7a48ffdca96cb6dd94fa5bae06e29bd1    
  
author   : Robert Haas <[email protected]>    
date     : Mon, 14 Oct 2013 08:00:26 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Mon, 14 Oct 2013 08:00:26 -0400    

Click here for diff

Additional documentation update, and a comment fix.  
  
Both issues reported by Amit Kapila.  

M doc/src/sgml/storage.sgml
M src/backend/utils/resowner/resowner.c

Translation updates to fix build failures

commit   : 382b694175e9dfda98c508cedc70b7b4d1bcfb19    
  
author   : Peter Eisentraut <[email protected]>    
date     : Sun, 13 Oct 2013 22:13:43 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Sun, 13 Oct 2013 22:13:43 -0400    

Click here for diff

Now that msgfmt is run with -c by default, older versions of gettext are  
complaining about the PO headers Last-Translator and Language-Team  
still having their default values.  Newer gettext versions fail to catch  
this because of a bug (https://savannah.gnu.org/bugs/?40261), which is  
why this hasn't been noticed before.  
  
Copy updated versions of affected translation files from the  
pgtranslations repository, were those files have been fixed.  

M src/bin/pg_basebackup/po/zh_CN.po
M src/interfaces/ecpg/ecpglib/po/cs.po
M src/pl/plperl/po/cs.po
M src/pl/tcl/po/cs.po

Add asprintf.c

commit   : 4aeceb4683575bccf9417452a01171a4c0596cc7    
  
author   : Peter Eisentraut <[email protected]>    
date     : Sun, 13 Oct 2013 21:56:47 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Sun, 13 Oct 2013 21:56:47 -0400    

Click here for diff

Forgotten in 5b6d08cd2992922b667564a49f19580f11676050  

A src/port/asprintf.c

Attempt to fix MSVC build for asprintf addition

commit   : d3d3975836f88443f07e3cc059c2dd21f09df165    
  
author   : Peter Eisentraut <[email protected]>    
date     : Sun, 13 Oct 2013 21:55:17 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Sun, 13 Oct 2013 21:55:17 -0400    

Click here for diff

M src/tools/msvc/Mkvcbuild.pm

Add use of asprintf()

commit   : 5b6d08cd2992922b667564a49f19580f11676050    
  
author   : Peter Eisentraut <[email protected]>    
date     : Sun, 13 Oct 2013 00:09:18 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Sun, 13 Oct 2013 00:09:18 -0400    

Click here for diff

Add asprintf(), pg_asprintf(), and psprintf() to simplify string  
allocation and composition.  Replacement implementations taken from  
NetBSD.  
  
Reviewed-by: Álvaro Herrera <[email protected]>  
Reviewed-by: Asif Naeem <[email protected]>  

M configure
M configure.in
M contrib/adminpack/adminpack.c
M contrib/oid2name/oid2name.c
M contrib/pg_upgrade/check.c
M contrib/pg_upgrade/tablespace.c
M contrib/pg_upgrade/util.c
M contrib/pg_upgrade/version_old_8_3.c
M contrib/spi/refint.c
M contrib/spi/timetravel.c
M src/backend/bootstrap/bootstrap.c
M src/backend/catalog/catalog.c
M src/backend/commands/tablespace.c
M src/backend/libpq/auth.c
M src/backend/optimizer/plan/subselect.c
M src/backend/parser/gram.y
M src/backend/postmaster/postmaster.c
M src/backend/utils/adt/cash.c
M src/backend/utils/adt/dbsize.c
M src/backend/utils/adt/misc.c
M src/backend/utils/fmgr/dfmgr.c
M src/backend/utils/fmgr/fmgr.c
M src/backend/utils/init/miscinit.c
M src/backend/utils/misc/guc.c
M src/backend/utils/mmgr/mcxt.c
M src/bin/initdb/initdb.c
M src/bin/pg_ctl/pg_ctl.c
M src/bin/pg_dump/compress_io.c
M src/bin/pg_dump/pg_dump.c
M src/bin/psql/command.c
M src/bin/psql/common.c
M src/bin/psql/copy.c
M src/bin/psql/input.c
M src/bin/psql/large_obj.c
M src/bin/psql/startup.c
M src/bin/psql/tab-complete.c
M src/common/fe_memutils.c
M src/common/relpath.c
M src/include/common/fe_memutils.h
M src/include/pg_config.h.in
M src/include/port.h
M src/include/utils/palloc.h
M src/interfaces/ecpg/test/expected/pgtypeslib-dt_test2.c
M src/interfaces/ecpg/test/pgtypeslib/dt_test2.pgc
M src/interfaces/libpq/fe-auth.c
M src/test/isolation/isolationtester.c
M src/test/regress/pg_regress.c

Tweak "line" test to avoid platform-specific floating-point output

commit   : a53dee43fe585e673658b01e7354892dcede957e    
  
author   : Peter Eisentraut <[email protected]>    
date     : Sat, 12 Oct 2013 21:17:59 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Sat, 12 Oct 2013 21:17:59 -0400    

Click here for diff

M src/test/regress/expected/line.out
M src/test/regress/sql/line.sql

Fix several possibly non-portable gaffs in record_image_ops.

commit   : 4cbb646334b3b998a29abef0d57608d42097e6c9    
  
author   : Kevin Grittner <[email protected]>    
date     : Fri, 11 Oct 2013 13:02:52 -0500    
  
committer: Kevin Grittner <[email protected]>    
date     : Fri, 11 Oct 2013 13:02:52 -0500    

Click here for diff

Sparc machines in the buildfarm were made happy by the previous  
fix, but PowerPC machines still are still failing.  Hopefully this  
will cure that.  

M src/backend/utils/adt/rowtypes.c

Use $(PERL) to invoke duplicate_oids

commit   : ada01014d4739120361fb96e3f91e2fd6791d6b8    
  
author   : Alvaro Herrera <[email protected]>    
date     : Thu, 10 Oct 2013 23:42:11 -0300    
  
committer: Alvaro Herrera <[email protected]>    
date     : Thu, 10 Oct 2013 23:42:11 -0300    

Click here for diff

Per buildfarm failure reported by smilodon  

M src/backend/catalog/Makefile

Rework SSL renegotiation code

commit   : 31cf1a1a43c45e53d9bb3134c07f92e722f097f9    
  
author   : Alvaro Herrera <[email protected]>    
date     : Thu, 10 Oct 2013 23:45:20 -0300    
  
committer: Alvaro Herrera <[email protected]>    
date     : Thu, 10 Oct 2013 23:45:20 -0300    

Click here for diff

The existing renegotiation code was home for several bugs: it might  
erroneously report that renegotiation had failed; it might try to  
execute another renegotiation while the previous one was pending; it  
failed to terminate the connection if the renegotiation never actually  
took place; if a renegotiation was started, the byte count was reset,  
even if the renegotiation wasn't completed (this isn't good from a  
security perspective because it means continuing to use a session that  
should be considered compromised due to volume of data transferred.)  
  
The new code is structured to avoid these pitfalls: renegotiation is  
started a little earlier than the limit has expired; the handshake  
sequence is retried until it has actually returned successfully, and no  
more than that, but if it fails too many times, the connection is  
closed.  The byte count is reset only when the renegotiation has  
succeeded, and if the renegotiation byte count limit expires, the  
connection is terminated.  
  
This commit only touches the master branch, because some of the changes  
are controversial.  If everything goes well, a back-patch might be  
considered.  
  
Per discussion started by message  
[email protected]  

M src/backend/libpq/be-secure.c
M src/backend/utils/misc/guc.c
M src/include/libpq/libpq-be.h

doc: Move check-tabs target into html target

commit   : 956f2db49006ea236994c61b0fe31759e2304a24    
  
author   : Peter Eisentraut <[email protected]>    
date     : Thu, 10 Oct 2013 21:53:34 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Thu, 10 Oct 2013 21:53:34 -0400    

Click here for diff

The previous plan of having the check-tabs target a prerequisite of  
"all" and "distprep" caused make distcheck to fail because make -q  
distprep would never be satisfied.  Put check-tabs into the html target  
instead, so it is only called when a build actually happens.  

M doc/src/sgml/Makefile

doc: Fix table column number declaration

commit   : 8238d1ed8f9682e74f4bb7d0bcdef8bae57efdf1    
  
author   : Peter Eisentraut <[email protected]>    
date     : Thu, 10 Oct 2013 21:17:31 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Thu, 10 Oct 2013 21:17:31 -0400    

Click here for diff

M doc/src/sgml/pgcrypto.sgml

doc: Handle additional character entities for SGML/XML conversion

commit   : 92c2d2ba3adc966d2eada6e792bdbf80cf7345a4    
  
author   : Peter Eisentraut <[email protected]>    
date     : Thu, 10 Oct 2013 21:14:33 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Thu, 10 Oct 2013 21:14:33 -0400    

Click here for diff

M doc/src/sgml/Makefile

Remove maintainer-check target, fold into normal build

commit   : 5dd41f3574871757e6b8e2a16b3e736fee36c20d    
  
author   : Peter Eisentraut <[email protected]>    
date     : Wed, 11 Sep 2013 14:34:28 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Wed, 11 Sep 2013 14:34:28 -0400    

Click here for diff

make maintainer-check was obscure and rarely called in practice, and  
many breakages were missed.  Fold everything that make maintainer-check  
used to do into the normal build.  Specifically:  
  
- Call duplicate_oids when genbki.pl is called.  
  
- Check for tabs in SGML files when the documentation is built.  
  
- Run msgfmt with the -c option during the regular build.  Add an  
  additional configure check to see whether we are using the GNU  
  version.  (make maintainer-check probably used to fail with non-GNU  
  msgfmt.)  
  
Keep maintainer-check as around as phony target for the time being in  
case anyone is calling it.  But it won't do anything anymore.  

M GNUmakefile.in
M config/programs.m4
M configure
M doc/Makefile
M doc/src/Makefile
M doc/src/sgml/Makefile
M src/Makefile.global.in
M src/backend/catalog/Makefile
M src/backend/common.mk
M src/include/Makefile
M src/nls-global.mk

Replace duplicate_oids with Perl implementation

commit   : 3dc543b3d84f048ca563af1bc98092f1e01e4a81    
  
author   : Peter Eisentraut <[email protected]>    
date     : Wed, 11 Sep 2013 14:47:44 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Wed, 11 Sep 2013 14:47:44 -0400    

Click here for diff

It is more portable, more robust, and more readable.  
  
From: Andrew Dunstan <[email protected]>  

M src/include/catalog/duplicate_oids

Update regression tests for line type patch

commit   : 083b86e71bd39549927db6a4007b0073a98e5a00    
  
author   : Peter Eisentraut <[email protected]>    
date     : Thu, 10 Oct 2013 19:59:15 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Thu, 10 Oct 2013 19:59:15 -0400    

Click here for diff

Erroneously omitted in 261c7d4b653bc3e44c31fd456d94f292caa50d8f  

M src/test/regress/expected/geometry_1.out
M src/test/regress/expected/geometry_2.out

initdb: Select working dynamic shared memory implementation.

commit   : 7195fb3cec9a7cf60f203edfa224ec632f16a101    
  
author   : Robert Haas <[email protected]>    
date     : Thu, 10 Oct 2013 19:38:56 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Thu, 10 Oct 2013 19:38:56 -0400    

Click here for diff

If POSIX shared memory is supported and works, we prefer it.  
Otherwise, we prefer System V, except on Windows, where we use  
the implementation specific to that platform.  

M src/bin/initdb/initdb.c

Fix bug in record_image_ops on big endian machines.

commit   : 15e46fd1dd77d908d73c48d601694a6809d18976    
  
author   : Kevin Grittner <[email protected]>    
date     : Thu, 10 Oct 2013 11:23:31 -0500    
  
committer: Kevin Grittner <[email protected]>    
date     : Thu, 10 Oct 2013 11:23:31 -0500    

Click here for diff

The buildfarm pointed out the problem.  
  
Fix based on suggestion by Robert Haas.  

M src/backend/utils/adt/rowtypes.c

json_typeof function.

commit   : 4d212bac1752e1bad6f3aa6242061c393ae93a0a    
  
author   : Andrew Dunstan <[email protected]>    
date     : Thu, 10 Oct 2013 12:21:59 -0400    
  
committer: Andrew Dunstan <[email protected]>    
date     : Thu, 10 Oct 2013 12:21:59 -0400    

Click here for diff

Andrew Tipton.  

M doc/src/sgml/func.sgml
M src/backend/utils/adt/json.c
M src/include/catalog/catversion.h
M src/include/catalog/pg_proc.h
M src/include/utils/json.h
M src/test/regress/expected/json.out
M src/test/regress/expected/json_1.out
M src/test/regress/sql/json.sql

commit   : 4b7b9a790405f5826ddfc7e9884805edd5396d75    
  
author   : Robert Haas <[email protected]>    
date     : Thu, 10 Oct 2013 10:56:19 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Thu, 10 Oct 2013 10:56:19 -0400    

Click here for diff

Per buildfarm.  

M src/backend/storage/ipc/dsm_impl.c

pg_upgrade: Split off pg_fatal() from pg_log()

commit   : 264aa14a2f687eba8c8cc2a5b6cbd6397973da98    
  
author   : Peter Eisentraut <[email protected]>    
date     : Tue, 1 Oct 2013 21:24:56 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Tue, 1 Oct 2013 21:24:56 -0400    

Click here for diff

This allows decorating pg_fatal() with noreturn compiler hints, leading  
to better diagnostics.  
  
Reviewed-by: Marko Tiikkaja <[email protected]>  

M contrib/pg_upgrade/check.c
M contrib/pg_upgrade/controldata.c
M contrib/pg_upgrade/exec.c
M contrib/pg_upgrade/file.c
M contrib/pg_upgrade/function.c
M contrib/pg_upgrade/info.c
M contrib/pg_upgrade/option.c
M contrib/pg_upgrade/page.c
M contrib/pg_upgrade/parallel.c
M contrib/pg_upgrade/pg_upgrade.c
M contrib/pg_upgrade/pg_upgrade.h
M contrib/pg_upgrade/relfilenode.c
M contrib/pg_upgrade/server.c
M contrib/pg_upgrade/tablespace.c
M contrib/pg_upgrade/util.c
M contrib/pg_upgrade/version.c
M contrib/pg_upgrade/version_old_8_3.c

Revive line type

commit   : 261c7d4b653bc3e44c31fd456d94f292caa50d8f    
  
author   : Peter Eisentraut <[email protected]>    
date     : Wed, 9 Oct 2013 01:09:18 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Wed, 9 Oct 2013 01:09:18 -0400    

Click here for diff

Change the input/output format to {A,B,C}, to match the internal  
representation.  
  
Complete the implementations of line_in, line_out, line_recv, line_send.  
Remove comments and error messages about the line type not being  
implemented.  Add regression tests for existing line operators and  
functions.  
  
Reviewed-by: rui hua <[email protected]>  
Reviewed-by: Álvaro Herrera <[email protected]>  
Reviewed-by: Jeevan Chalke <[email protected]>  

M doc/src/sgml/datatype.sgml
M doc/src/sgml/func.sgml
M src/backend/utils/adt/geo_ops.c
M src/include/catalog/pg_type.h
M src/include/utils/geo_decls.h
M src/test/regress/expected/geometry.out
A src/test/regress/expected/line.out
M src/test/regress/expected/sanity_check.out
M src/test/regress/output/misc.source
M src/test/regress/parallel_schedule
M src/test/regress/serial_schedule
M src/test/regress/sql/geometry.sql
A src/test/regress/sql/line.sql

Allow dynamic allocation of shared memory segments.

commit   : 0ac5e5a7e152504c71ce2168acc9cef7fde7893c    
  
author   : Robert Haas <[email protected]>    
date     : Wed, 9 Oct 2013 21:05:02 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Wed, 9 Oct 2013 21:05:02 -0400    

Click here for diff

Patch by myself and Amit Kapila.  Design help from Noah Misch.  Review  
by Andres Freund.  

M configure
M configure.in
M doc/src/sgml/config.sgml
M src/backend/port/sysv_shmem.c
M src/backend/storage/ipc/Makefile
A src/backend/storage/ipc/dsm.c
A src/backend/storage/ipc/dsm_impl.c
M src/backend/storage/ipc/ipci.c
M src/backend/utils/misc/guc.c
M src/backend/utils/misc/postgresql.conf.sample
M src/backend/utils/resowner/resowner.c
M src/bin/initdb/initdb.c
M src/include/pg_config.h.in
A src/include/portability/mem.h
A src/include/storage/dsm.h
A src/include/storage/dsm_impl.h
M src/include/storage/lwlock.h
M src/include/utils/resowner_private.h

Add record_image_ops opclass for matview concurrent refresh.

commit   : f566515192461acd8d9c232f48ddac3fc965cfd8    
  
author   : Kevin Grittner <[email protected]>    
date     : Wed, 9 Oct 2013 14:26:09 -0500    
  
committer: Kevin Grittner <[email protected]>    
date     : Wed, 9 Oct 2013 14:26:09 -0500    

Click here for diff

REFRESH MATERIALIZED VIEW CONCURRENTLY was broken for any matview  
containing a column of a type without a default btree operator  
class.  It also did not produce results consistent with a non-  
concurrent REFRESH or a normal view if any column was of a type  
which allowed user-visible differences between values which  
compared as equal according to the type's default btree opclass.  
Concurrent matview refresh was modified to use the new operators  
to solve these problems.  
  
Documentation was added for record comparison, both for the  
default btree operator class for record, and the newly added  
operators.  Regression tests now check for proper behavior both  
for a matview with a box column and a matview containing a citext  
column.  
  
Reviewed by Steve Singer, who suggested some of the doc language.  

M contrib/citext/expected/citext.out
M contrib/citext/expected/citext_1.out
M contrib/citext/sql/citext.sql
M doc/src/sgml/func.sgml
M src/backend/commands/matview.c
M src/backend/utils/adt/rowtypes.c
M src/include/catalog/catversion.h
M src/include/catalog/pg_amop.h
M src/include/catalog/pg_amproc.h
M src/include/catalog/pg_opclass.h
M src/include/catalog/pg_operator.h
M src/include/catalog/pg_opfamily.h
M src/include/catalog/pg_proc.h
M src/include/utils/builtins.h
M src/test/regress/expected/matview.out
M src/test/regress/expected/opr_sanity.out
M src/test/regress/sql/matview.sql

doc: fix typo in release notes

commit   : 1cccce50f374cfc6081850aedce8eb0f8b274bc5    
  
author   : Bruce Momjian <[email protected]>    
date     : Wed, 9 Oct 2013 08:44:52 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Wed, 9 Oct 2013 08:44:52 -0400    

Click here for diff

Backpatch through 8.4  
  
Per suggestion by Amit Langote  

M doc/src/sgml/release-8.4.sgml
M doc/src/sgml/release-9.0.sgml
M doc/src/sgml/release-9.1.sgml
M doc/src/sgml/release-9.2.sgml

Centralize effective_cache_size default setting

commit   : 0c6b67507631fd9f563e0329da418060f45ac1f0    
  
author   : Bruce Momjian <[email protected]>    
date     : Wed, 9 Oct 2013 08:33:12 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Wed, 9 Oct 2013 08:33:12 -0400    

Click here for diff

M src/backend/bootstrap/bootstrap.c
M src/backend/postmaster/postmaster.c
M src/backend/tcop/postgres.c
M src/backend/utils/misc/guc.c

Adjust the effective_cache_size default for standalone backends

commit   : 96dfa6ec0d809bb49f3472921b3ed941d9bd1b8c    
  
author   : Bruce Momjian <[email protected]>    
date     : Tue, 8 Oct 2013 23:53:39 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Tue, 8 Oct 2013 23:53:39 -0400    

Click here for diff

M src/backend/postmaster/postmaster.c
M src/backend/tcop/postgres.c

Again move function where we set effective_cache_size's default

commit   : 6b82f78ff95d7d4201d44359dad41882e7111960    
  
author   : Bruce Momjian <[email protected]>    
date     : Tue, 8 Oct 2013 23:12:45 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Tue, 8 Oct 2013 23:12:45 -0400    

Click here for diff

M src/backend/bootstrap/bootstrap.c
M src/backend/postmaster/postmaster.c

Move new effective_cache_size function

commit   : cbafd6618af9f10e89ed05ff82dac69e65a70307    
  
author   : Bruce Momjian <[email protected]>    
date     : Tue, 8 Oct 2013 22:41:23 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Tue, 8 Oct 2013 22:41:23 -0400    

Click here for diff

Previously set_default_effective_cache_size() could not handle fork,  
non-fork, and bootstrap cases.  

M src/backend/bootstrap/bootstrap.c
M src/backend/postmaster/postmaster.c

Fix C comment in check_effective_cache_size()

commit   : bf46524b3136928bfe61c782a950a30638bbd159    
  
author   : Bruce Momjian <[email protected]>    
date     : Tue, 8 Oct 2013 19:25:26 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Tue, 8 Oct 2013 19:25:26 -0400    

Click here for diff

M src/backend/optimizer/path/costsize.c

doc: Fix typo in effective_cache_size patch

commit   : 3e5a9eee8a8afb729ea393fd0fa6c6495241f6bb    
  
author   : Bruce Momjian <[email protected]>    
date     : Tue, 8 Oct 2013 19:02:35 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Tue, 8 Oct 2013 19:02:35 -0400    

Click here for diff

M doc/src/sgml/config.sgml

Allow drop-index-concurrently-1 test to run at any isolation level.

commit   : 31a877f18bdf60dd1dfe92e7502469ed4c40d75b    
  
author   : Kevin Grittner <[email protected]>    
date     : Tue, 8 Oct 2013 16:55:12 -0500    
  
committer: Kevin Grittner <[email protected]>    
date     : Tue, 8 Oct 2013 16:55:12 -0500    

Click here for diff

It previously reported failure at REPEATABLE READ and SERIALIZABLE  
transaction isolation levels for make installcheck.  

M src/test/isolation/expected/drop-index-concurrently-1.out
A src/test/isolation/expected/drop-index-concurrently-1_2.out
M src/test/isolation/specs/drop-index-concurrently-1.spec

Update postgres.conf.sample for effective_cache_size's new default

commit   : 6648775028a85bc024f37eab5e572510977008b1    
  
author   : Bruce Momjian <[email protected]>    
date     : Tue, 8 Oct 2013 12:50:05 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Tue, 8 Oct 2013 12:50:05 -0400    

Click here for diff

M src/backend/utils/misc/postgresql.conf.sample

docs: clarify references to md5 hash and md5 crypt in pgcrypto docs

commit   : 9c29138c7514406341d20ef106009f9278daf857    
  
author   : Bruce Momjian <[email protected]>    
date     : Tue, 8 Oct 2013 12:24:02 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Tue, 8 Oct 2013 12:24:02 -0400    

Click here for diff

Suggestion from Richard Neill  

M doc/src/sgml/pgcrypto.sgml

unaccent: mark unaccent() functions as immutable

commit   : 9299f6179838cef8aa1123f6fb76f0d3d6f2decc    
  
author   : Bruce Momjian <[email protected]>    
date     : Tue, 8 Oct 2013 12:20:36 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Tue, 8 Oct 2013 12:20:36 -0400    

Click here for diff

Suggestion from Pavel Stehule  

M contrib/unaccent/unaccent–1.0.sql
M contrib/unaccent/unaccent–unpackaged–1.0.sql

Auto-tune effective_cache size to be 4x shared buffers

commit   : ee1e5662d8d8330726eaef7d3110cb7add24d058    
  
author   : Bruce Momjian <[email protected]>    
date     : Tue, 8 Oct 2013 12:12:24 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Tue, 8 Oct 2013 12:12:24 -0400    

Click here for diff

M doc/src/sgml/config.sgml
M src/backend/optimizer/path/costsize.c
M src/backend/postmaster/postmaster.c
M src/backend/utils/misc/guc.c
M src/include/optimizer/cost.h
M src/include/utils/guc.h
M src/test/regress/expected/join.out
M src/test/regress/sql/join.sql

Additional instructions on minor release note creation.

commit   : d29a03192615b55593af4a89283f5b5c72f13afe    
  
author   : Bruce Momjian <[email protected]>    
date     : Tue, 8 Oct 2013 10:29:43 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Tue, 8 Oct 2013 10:29:43 -0400    

Click here for diff

M src/tools/RELEASE_CHANGES

Update instructions on creating minor release notes.

commit   : a2883241e90d10d165f42aff02634093765fdd19    
  
author   : Bruce Momjian <[email protected]>    
date     : Tue, 8 Oct 2013 09:48:29 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Tue, 8 Oct 2013 09:48:29 -0400    

Click here for diff

M src/tools/RELEASE_CHANGES

docs: update release notes for 8.4.18, 9.0.14, 9.1.10, 9.2.5, 9.3.1

commit   : 1732ce4906c54937c5f36860e9f1493f693d5ba7    
  
author   : Bruce Momjian <[email protected]>    
date     : Mon, 7 Oct 2013 21:35:02 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Mon, 7 Oct 2013 21:35:02 -0400    

Click here for diff

M doc/src/sgml/release-8.4.sgml
M doc/src/sgml/release-9.0.sgml
M doc/src/sgml/release-9.1.sgml
M doc/src/sgml/release-9.2.sgml
M doc/src/sgml/release-9.3.sgml

TYPEALIGN doesn't work on int64 on 32-bit platforms.

commit   : 5962519b362d28ef02bc8ec135b9bf9b9a168263    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Tue, 8 Oct 2013 01:59:57 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Tue, 8 Oct 2013 01:59:57 +0300    

Click here for diff

The TYPEALIGN macro, and the related ones like MAXALIGN, don't work with  
values larger than intptr_t, because TYPEALIGN casts the argument to  
intptr_t to do the arithmetic. That's not a problem when dealing with  
pointers or lengths or offsets related to pointers, but the XLogInsert  
scaling patch added a call to MAXALIGN with an XLogRecPtr argument.  
  
To fix, add wider variants of the macros, called TYPEALIGN64 and MAXALIGN64,  
which are just like the existing variants but work with uint64 instead of  
intptr_t.  
  
Report and patch by David Rowley, analysis by Andres Freund.  

M src/backend/access/transam/xlog.c
M src/include/c.h

Fix bugs in SSI tuple locking.

commit   : 81fbbfe3352d3965ee3d8eaafe164b2335c43f72    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Mon, 7 Oct 2013 23:57:40 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Mon, 7 Oct 2013 23:57:40 +0300    

Click here for diff

1. In heap_hot_search_buffer(), the PredicateLockTuple() call is passed  
wrong offset number. heapTuple->t_self is set to the tid of the first  
tuple in the chain that's visited, not the one actually being read.  
  
2. CheckForSerializableConflictIn() uses the tuple's t_ctid field  
instead of t_self to check for exiting predicate locks on the tuple. If  
the tuple was updated, but the updater rolled back, t_ctid points to the  
aborted dead tuple.  
  
Reported by Hannu Krosing. Backpatch to 9.1.  

M src/backend/access/heap/heapam.c
M src/backend/storage/lmgr/predicate.c

Translation updates

commit   : 0b109c822b599d64ff042e5535d9268b27e70969    
  
author   : Peter Eisentraut <[email protected]>    
date     : Mon, 7 Oct 2013 16:27:04 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Mon, 7 Oct 2013 16:27:04 -0400    

Click here for diff

M src/backend/po/es.po
M src/backend/po/it.po
M src/backend/po/zh_TW.po
M src/bin/initdb/po/cs.po
M src/bin/initdb/po/zh_CN.po
M src/bin/pg_basebackup/nls.mk
M src/bin/pg_basebackup/po/cs.po
A src/bin/pg_basebackup/po/zh_CN.po
M src/bin/pg_config/po/ko.po
M src/bin/pg_config/po/nb.po
M src/bin/pg_config/po/ro.po
M src/bin/pg_config/po/ta.po
M src/bin/pg_config/po/tr.po
M src/bin/pg_config/po/zh_CN.po
M src/bin/pg_config/po/zh_TW.po
M src/bin/pg_controldata/po/cs.po
M src/bin/pg_controldata/po/zh_CN.po
M src/bin/pg_ctl/po/cs.po
M src/bin/pg_ctl/po/zh_CN.po
M src/bin/pg_ctl/po/zh_TW.po
M src/bin/pg_dump/po/cs.po
M src/bin/pg_dump/po/zh_CN.po
M src/bin/pg_resetxlog/po/cs.po
M src/bin/pg_resetxlog/po/zh_CN.po
M src/bin/psql/po/cs.po
M src/bin/psql/po/zh_CN.po
M src/bin/psql/po/zh_TW.po
M src/bin/scripts/po/cs.po
M src/bin/scripts/po/zh_CN.po
M src/interfaces/ecpg/ecpglib/po/de.po
M src/interfaces/ecpg/ecpglib/po/fr.po
M src/interfaces/ecpg/ecpglib/po/ja.po
M src/interfaces/ecpg/ecpglib/po/tr.po
M src/interfaces/ecpg/ecpglib/po/zh_CN.po
M src/interfaces/ecpg/preproc/po/ko.po
M src/interfaces/ecpg/preproc/po/tr.po
M src/interfaces/ecpg/preproc/po/zh_TW.po
M src/interfaces/libpq/po/cs.po
M src/interfaces/libpq/po/it.po
M src/interfaces/libpq/po/zh_CN.po
M src/interfaces/libpq/po/zh_TW.po
M src/pl/plperl/po/ro.po
M src/pl/plperl/po/zh_TW.po
M src/pl/plpgsql/src/po/ro.po
M src/pl/plpgsql/src/po/zh_CN.po
M src/pl/plpgsql/src/po/zh_TW.po
M src/pl/plpython/po/ro.po
M src/pl/tcl/po/de.po
M src/pl/tcl/po/fr.po
M src/pl/tcl/po/ja.po
M src/pl/tcl/po/ro.po
M src/pl/tcl/po/tr.po
M src/pl/tcl/po/zh_CN.po
M src/pl/tcl/po/zh_TW.po

Make DISCARD SEQUENCES also discard the last used sequence.

commit   : 16a906f535082fcf3d8c6732d8e941e037bc6d5e    
  
author   : Robert Haas <[email protected]>    
date     : Mon, 7 Oct 2013 15:55:56 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Mon, 7 Oct 2013 15:55:56 -0400    

Click here for diff

Otherwise, we access already-freed memory.  Oops.  
  
Report by Michael Paquier.  Fix by me.  

M src/backend/commands/sequence.c
M src/test/regress/expected/sequence.out
M src/test/regress/sql/sequence.sql

plpgsql: Add new option print_strict_params.

commit   : 689746c045b169edbc694d6cf9176fe5f6c0b264    
  
author   : Robert Haas <[email protected]>    
date     : Mon, 7 Oct 2013 15:38:49 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Mon, 7 Oct 2013 15:38:49 -0400    

Click here for diff

This option provides more detailed error messages when STRICT is used  
and the number of rows returned is not one.  
  
Marko Tiikkaja, reviewed by Ian Lawrence Barwick  

M doc/src/sgml/plpgsql.sgml
M src/pl/plpgsql/src/pl_comp.c
M src/pl/plpgsql/src/pl_exec.c
M src/pl/plpgsql/src/pl_gram.y
M src/pl/plpgsql/src/pl_handler.c
M src/pl/plpgsql/src/pl_scanner.c
M src/pl/plpgsql/src/plpgsql.h
M src/test/regress/expected/plpgsql.out
M src/test/regress/sql/plpgsql.sql

Eliminate xmin from hash tag for predicate locks on heap tuples.

commit   : c01262a82484106111a81dca8c922fd5670b644d    
  
author   : Kevin Grittner <[email protected]>    
date     : Mon, 7 Oct 2013 14:16:54 -0500    
  
committer: Kevin Grittner <[email protected]>    
date     : Mon, 7 Oct 2013 14:16:54 -0500    

Click here for diff

If a tuple was frozen while its predicate locks mattered,  
read-write dependencies could be missed, resulting in failure to  
detect conflicts which could lead to anomalies in committed  
serializable transactions.  
  
This field was added to the tag when we still thought that it was  
necessary to carry locks forward to a new version of an updated  
row.  That was later proven to be unnecessary, which allowed  
simplification of the code, but elimination of xmin from the tag  
was missed at the time.  
  
Per report and analysis by Heikki Linnakangas.  
Backpatch to 9.1.  

M src/backend/storage/lmgr/predicate.c
M src/include/storage/predicate_internals.h

Document support for VPATH builds of extensions.

commit   : 2e1cb733f96cff04f6c9116c166fec54bc1e18c6    
  
author   : Andrew Dunstan <[email protected]>    
date     : Sun, 6 Oct 2013 22:57:16 -0400    
  
committer: Andrew Dunstan <[email protected]>    
date     : Sun, 6 Oct 2013 22:57:16 -0400    

Click here for diff

Cédric Villemain and me.  

M doc/src/sgml/extend.sgml

pgbench: Comment on thread timing hazards.

commit   : 7db0dc0eac4512253c2ec0e6bea60ecd2d7bea27    
  
author   : Noah Misch <[email protected]>    
date     : Sun, 6 Oct 2013 09:56:43 -0400    
  
committer: Noah Misch <[email protected]>    
date     : Sun, 6 Oct 2013 09:56:43 -0400    

Click here for diff

Reviewed by Fabien COELHO.  

M contrib/pgbench/pgbench.c

Fix various bugs in postmaster SIGKILL processing

commit   : bf2617981ceb88bdcd3cba58308d68f0c4ea3de2    
  
author   : Alvaro Herrera <[email protected]>    
date     : Sat, 5 Oct 2013 23:24:50 -0300    
  
committer: Alvaro Herrera <[email protected]>    
date     : Sat, 5 Oct 2013 23:24:50 -0300    

Click here for diff

Clamp the minimum sleep time during immediate shutdown or crash to a  
minimum of zero, not a maximum of one second.  The previous code could  
result in a negative sleep time, leading to failure in select() calls.  
  
Also, on crash recovery, reset AbortStartTime as soon as SIGKILL is sent  
or abort processing has commenced instead of waiting until the startup  
process completes.  Reset AbortStartTime as soon as SIGKILL is sent,  
too, to avoid doing that repeatedly.  
  
Per trouble report from Jeff Janes on  
CAMkU=1xd3=wFqZwwuXPWe4BQs3h1seYo8LV9JtSjW5RodoPxMg@mail.gmail.com  
  
Author: MauMau  

M src/backend/postmaster/postmaster.c

pgbench: Elaborate latency reporting.

commit   : 2d6c0f10ef4f34d757e49a9815c22045d8ba6980    
  
author   : Noah Misch <[email protected]>    
date     : Sat, 5 Oct 2013 17:33:38 -0400    
  
committer: Noah Misch <[email protected]>    
date     : Sat, 5 Oct 2013 17:33:38 -0400    

Click here for diff

Isolate transaction latency (elapsed time between submitting first  
command and receiving response to last command) from client-side delays  
pertaining to the --rate schedule.  Under --rate, report schedule lag as  
defined in the documentation.  Report latency standard deviation  
whenever we collect the measurements to do so.  All of these changes  
affect --progress messages and the final report.  
  
Fabien COELHO, reviewed by Pavel Stehule.  

M contrib/pgbench/pgbench.c
M doc/src/sgml/pgbench.sgml

pgbench: Remove stray use of "float" math.

commit   : 8e00a3850d4a7729a112967c204fa95b40cc54ca    
  
author   : Noah Misch <[email protected]>    
date     : Sat, 5 Oct 2013 17:19:37 -0400    
  
committer: Noah Misch <[email protected]>    
date     : Sat, 5 Oct 2013 17:19:37 -0400    

Click here for diff

Oversight in commit 4a87f308b33457670f9ab4bc622678e5d285b9c2.  
  
Fabien COELHO  

M contrib/pgbench/pgbench.c

commit   : 85fa8293ad5621eaa747fbb62681b40d1b15dfa7    
  
author   : Bruce Momjian <[email protected]>    
date     : Sat, 5 Oct 2013 10:18:02 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Sat, 5 Oct 2013 10:18:02 -0400    

Click here for diff

Mention that link mode uses less disk space, and uses junction points on  
Windows.  
  
Backpatch to 9.3.  

M doc/src/sgml/pgupgrade.sgml

add multixact-no-deadlock to schedule

commit   : 1310d4cab21c250f666a173690671cf95eead6b7    
  
author   : Alvaro Herrera <[email protected]>    
date     : Fri, 4 Oct 2013 14:25:30 -0300    
  
committer: Alvaro Herrera <[email protected]>    
date     : Fri, 4 Oct 2013 14:25:30 -0300    

Click here for diff

M src/test/isolation/isolation_schedule

Make some isolationtester specs more complete

commit   : 46d89546546eff837909ce0dbbb3301a97f01145    
  
author   : Alvaro Herrera <[email protected]>    
date     : Fri, 4 Oct 2013 14:24:46 -0300    
  
committer: Alvaro Herrera <[email protected]>    
date     : Fri, 4 Oct 2013 14:24:46 -0300    

Click here for diff

Also, make sure they pass on all transaction isolation levels.  

M src/test/isolation/expected/fk-deadlock2_1.out
M src/test/isolation/expected/fk-deadlock2_2.out
M src/test/isolation/expected/fk-deadlock_1.out
D src/test/isolation/expected/fk-deadlock_2.out
M src/test/isolation/expected/lock-update-delete.out
A src/test/isolation/expected/lock-update-delete_1.out
M src/test/isolation/expected/lock-update-traversal.out
M src/test/isolation/specs/lock-update-delete.spec
M src/test/isolation/specs/lock-update-traversal.spec

isolationtester: Allow tuples to be returned in more places

commit   : 4f0777ba0fcfc8274b69f39de10f8d905b9f89ba    
  
author   : Alvaro Herrera <[email protected]>    
date     : Fri, 4 Oct 2013 10:32:48 -0300    
  
committer: Alvaro Herrera <[email protected]>    
date     : Fri, 4 Oct 2013 10:32:48 -0300    

Click here for diff

Previously, isolationtester would forbid returning tuples in  
session-specific teardown (but not global teardown), as well as in  
global setup.  Allow these places to return tuples, too.  

M src/test/isolation/isolationtester.c

Issue error on SET outside transaction block in some cases

commit   : a54141aebcafa02cba5204596758dadbbeb0f78e    
  
author   : Bruce Momjian <[email protected]>    
date     : Fri, 4 Oct 2013 13:50:28 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Fri, 4 Oct 2013 13:50:28 -0400    

Click here for diff

Issue error for SET LOCAL/CONSTRAINTS/TRANSACTION outside a transaction  
block, as they have no effect.  
  
Per suggestion from Morten Hustveit  

M doc/src/sgml/ref/set.sgml
M doc/src/sgml/ref/set_constraints.sgml
M doc/src/sgml/ref/set_transaction.sgml
M src/backend/tcop/utility.c
M src/backend/utils/misc/guc.c
M src/include/utils/guc.h
M src/test/regress/expected/guc.out

doc: Add missing words to bgworker docs.

commit   : 4655b607f34836ae19f262bfdfe95c0be74d920c    
  
author   : Robert Haas <[email protected]>    
date     : Fri, 4 Oct 2013 11:13:50 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Fri, 4 Oct 2013 11:13:50 -0400    

Click here for diff

Maciek Sakrejda  

M doc/src/sgml/bgworker.sgml

Fix silly thinko in ResetSequenceCaches.

commit   : 0f1ef79095762e8e3e908592f0cf37c53da54028    
  
author   : Robert Haas <[email protected]>    
date     : Thu, 3 Oct 2013 20:17:51 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Thu, 3 Oct 2013 20:17:51 -0400    

Click here for diff

Report from Kevin Hale Boyes.  

M src/backend/commands/sequence.c

Add DISCARD SEQUENCES command.

commit   : d90ced8bb22194cbb45f58beb0961251103aeff5    
  
author   : Robert Haas <[email protected]>    
date     : Thu, 3 Oct 2013 16:17:18 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Thu, 3 Oct 2013 16:17:18 -0400    

Click here for diff

DISCARD ALL will now discard cached sequence information, as well.  
  
Fabrízio de Royes Mello, reviewed by Zoltán Böszörményi, with some  
further tweaks by me.  

M doc/src/sgml/ref/discard.sgml
M src/backend/commands/discard.c
M src/backend/commands/sequence.c
M src/backend/parser/gram.y
M src/backend/tcop/utility.c
M src/bin/psql/tab-complete.c
M src/include/commands/sequence.h
M src/include/nodes/parsenodes.h
M src/test/regress/expected/sequence.out
M src/test/regress/sql/sequence.sql

psql: Make \pset without arguments show all settings.

commit   : c64e68fd9f1132fec563fb5de53dc3bcccb5fc3b    
  
author   : Robert Haas <[email protected]>    
date     : Thu, 3 Oct 2013 15:18:02 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Thu, 3 Oct 2013 15:18:02 -0400    

Click here for diff

Gilles Darold, reviewed by Pavel Stehule  

M doc/src/sgml/ref/psql-ref.sgml
M src/bin/psql/command.c
M src/bin/psql/help.c
M src/test/regress/expected/psql.out
M src/test/regress/sql/psql.sql

Minor GIN code refactoring.

commit   : c2b175b94851e59765cc87243d8faf923e3d820b    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Thu, 3 Oct 2013 11:47:17 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Thu, 3 Oct 2013 11:47:17 +0300    

Click here for diff

It makes for cleaner code to have separate Get/Add functions for PostingItems  
and ItemPointers.  A few callsites that have to deal with both types need to  
be duplicated because of this, but all the callers have to know which one  
they're dealing with anyway. Overall, this reduces the amount of casting  
required.  
  
Extracted from Alexander Korotkov's larger patch to change the data page  
format.  

M src/backend/access/gin/gindatapage.c
M src/backend/access/gin/ginget.c
M src/backend/access/gin/ginvacuum.c
M src/backend/access/gin/ginxlog.c
M src/include/access/gin_private.h

doc: Correct psycopg URL

commit   : 627882d0d8ad34c336b98ceb4eb90940fcd392cc    
  
author   : Peter Eisentraut <[email protected]>    
date     : Wed, 2 Oct 2013 21:33:26 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Wed, 2 Oct 2013 21:33:26 -0400    

Click here for diff

M doc/src/sgml/external-projects.sgml

psql: Set up cancel handler later

commit   : 9099e4afe0e4101bc79f078be3e15639a048e633    
  
author   : Peter Eisentraut <[email protected]>    
date     : Wed, 2 Oct 2013 21:05:08 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Wed, 2 Oct 2013 21:05:08 -0400    

Click here for diff

The cancel handler was uselessly set up even before the first connection  
was opened.  By setting it up afterwards, the user can use Ctrl+C to  
abort psql if the initial connection attempt hangs.  
  
Reviewed-by: Dean Rasheed <[email protected]>  
Reviewed-by: Ryan Kelly <[email protected]>  

M src/bin/psql/startup.c

doc: fix hstore_to_json_loose() doc wording

commit   : eb5d87e5f3b827f5b26fe551006655d80c063d66    
  
author   : Bruce Momjian <[email protected]>    
date     : Wed, 2 Oct 2013 19:25:24 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Wed, 2 Oct 2013 19:25:24 -0400    

Click here for diff

M doc/src/sgml/hstore.sgml

Fix copy/paste error

commit   : 542131c9e75b6d7bd068e514dae0e2b5ac708203    
  
author   : Magnus Hagander <[email protected]>    
date     : Wed, 2 Oct 2013 16:42:36 +0200    
  
committer: Magnus Hagander <[email protected]>    
date     : Wed, 2 Oct 2013 16:42:36 +0200    

Click here for diff

M doc/src/sgml/ref/pg_receivexlog.sgml

Adjust C comments that would be wrap-able.

commit   : d50f2812108af287879c72b8cc5856d7db5b72b6    
  
author   : Bruce Momjian <[email protected]>    
date     : Tue, 1 Oct 2013 19:44:53 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Tue, 1 Oct 2013 19:44:53 -0400    

Click here for diff

M src/backend/utils/adt/datetime.c

Add WaitForLockers in lmgr, refactoring index.c code

commit   : 15732b34e8c856bf94469b78ab49446430a9c203    
  
author   : Alvaro Herrera <[email protected]>    
date     : Fri, 27 Sep 2013 11:46:33 -0300    
  
committer: Alvaro Herrera <[email protected]>    
date     : Fri, 27 Sep 2013 11:46:33 -0300    

Click here for diff

This is in support of a future REINDEX CONCURRENTLY feature.  
  
Michael Paquier  

M src/backend/catalog/index.c
M src/backend/commands/indexcmds.c
M src/backend/storage/lmgr/lmgr.c
M src/include/storage/lmgr.h

Remove broken PGXS code for pg_xlogdump

commit   : dddc91ddd33d5db07463f2f3f3a044ab98042cf1    
  
author   : Alvaro Herrera <[email protected]>    
date     : Tue, 1 Oct 2013 17:36:15 -0300    
  
committer: Alvaro Herrera <[email protected]>    
date     : Tue, 1 Oct 2013 17:36:15 -0300    

Click here for diff

With the PGXS boilerplate in place, pg_xlogdump currently fails with an  
ominous error message that certain targets cannot be built because  
certain files do not exist.  Remove that and instead throw a quick error  
message alerting the user of the actual problem, which should be easier  
to diagnose that the statu quo.  
  
Andres Freund  

M contrib/pg_xlogdump/Makefile

Add missing condition for pg_depend in hstore migration script.

commit   : 7ce569babddf7bc76657390032cb6cf6793476cc    
  
author   : Andrew Dunstan <[email protected]>    
date     : Mon, 30 Sep 2013 11:33:54 -0400    
  
committer: Andrew Dunstan <[email protected]>    
date     : Mon, 30 Sep 2013 11:33:54 -0400    

Click here for diff

Error noted by Andres Freund.  

M contrib/hstore/hstore–1.1–1.2.sql

Ensure installation dirs are built before contents are installed (v2)

commit   : eebdea08bb6c185dd7e7542f35565a2c12ab1342    
  
author   : Andrew Dunstan <[email protected]>    
date     : Mon, 30 Sep 2013 10:17:30 -0400    
  
committer: Andrew Dunstan <[email protected]>    
date     : Mon, 30 Sep 2013 10:17:30 -0400    

Click here for diff

Push dependency on installdirs down to individual targets.  
  
Christoph Berg  

M src/makefiles/pgxs.mk

In bms_add_member(), use repalloc() if the bms needs to be enlarged.

commit   : ee01d848f39400c8524c66944ada6fde47894978    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Mon, 30 Sep 2013 16:37:00 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Mon, 30 Sep 2013 16:37:00 +0300    

Click here for diff

Previously bms_add_member() would palloc a whole-new copy of the existing  
set, copy the words, and pfree the old one. repalloc() is potentially much  
faster, and more importantly, this is less surprising if CurrentMemoryContext  
is not the same as the context the old set is in. bms_add_member() still  
allocates a new bitmapset in CurrentMemoryContext if NULL is passed as  
argument, but that is a lot less likely to induce bugs.  
  
Nicholas White.  

M src/backend/nodes/bitmapset.c

Fix snapshot leak if lo_open called on non-existent object.

commit   : 357f7521384df34c697b3544115622520a6a0e9f    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Mon, 30 Sep 2013 11:29:09 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Mon, 30 Sep 2013 11:29:09 +0300    

Click here for diff

lo_open registers the currently active snapshot, and checks if the  
large object exists after that. Normally, snapshots registered by lo_open  
are unregistered at end of transaction when the lo descriptor is closed, but  
if we error out before the lo descriptor is added to the list of open  
descriptors, it is leaked. Fix by moving the snapshot registration to after  
checking if the large object exists.  
  
Reported by Pavel Stehule. Backpatch to 8.4. The snapshot registration  
system was introduced in 8.4, so prior versions are not affected (and not  
supported, anyway).  

M src/backend/storage/large_object/inv_api.c

Correct comment of pgbench "filler" columns.

commit   : 514b3194e80ec71bdbc92798ea946d7b51ea7ac2    
  
author   : Fujii Masao <[email protected]>    
date     : Mon, 30 Sep 2013 12:35:54 +0900    
  
committer: Fujii Masao <[email protected]>    
date     : Mon, 30 Sep 2013 12:35:54 +0900    

Click here for diff

Pavan Deolasee  

M contrib/pgbench/pgbench.c

Fix makefile broken by hstore fix.

commit   : 42bf7fc1de4d25c92b244fabe1a6b1cbec99f151    
  
author   : Andrew Dunstan <[email protected]>    
date     : Sun, 29 Sep 2013 22:46:55 -0400    
  
committer: Andrew Dunstan <[email protected]>    
date     : Sun, 29 Sep 2013 22:46:55 -0400    

Click here for diff

M contrib/hstore/Makefile

Use a new hstore extension version for added json functions.

commit   : a18167510f4c385329697588ce5132cbf95779c3    
  
author   : Andrew Dunstan <[email protected]>    
date     : Sun, 29 Sep 2013 17:41:56 -0400    
  
committer: Andrew Dunstan <[email protected]>    
date     : Sun, 29 Sep 2013 17:41:56 -0400    

Click here for diff

This should have been done when the json functionality was added to  
hstore in 9.3.0. To handle this correctly, the upgrade script therefore  
uses conditional logic by using plpgsql in a DO statement to add the two  
new functions and the new cast. If hstore_to_json_loose is detected as  
already present and dependent on the hstore extension nothing is done.  
This will require that the database be loaded with plpgsql.  
  
People who have installed the earlier and spurious 1.1 version of hstore  
will need to do:  
  
	ALTER EXTENSION hstore UPDATE;  
  
to pick up the new functions properly.  

A contrib/hstore/hstore–1.1–1.2.sql
R100 contrib/hstore/hstore–1.1.sql contrib/hstore/hstore–1.2.sql
M contrib/hstore/hstore.control

Ensure installation dirs are built before contents are installed.

commit   : d942f9d9283f831fc74ed3cf60e6c8362274b36e    
  
author   : Andrew Dunstan <[email protected]>    
date     : Sun, 29 Sep 2013 16:12:58 -0400    
  
committer: Andrew Dunstan <[email protected]>    
date     : Sun, 29 Sep 2013 16:12:58 -0400    

Click here for diff

Cédric Villemain  

M src/makefiles/pgxs.mk

Allow printf-style padding specifications in log_line_prefix.

commit   : 4334639f4bb9fb88c13b8dd5faca22b207248504    
  
author   : Robert Haas <[email protected]>    
date     : Thu, 26 Sep 2013 17:54:20 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Thu, 26 Sep 2013 17:54:20 -0400    

Click here for diff

David Rowley, after a suggestion from Heikki Linnakangas.  Reviewed by  
Albe Laurenz, and further edited by me.  

M doc/src/sgml/config.sgml
M src/backend/utils/error/elog.c

Fix erroneous statements about multiply specified JSON columns.

commit   : d70f8d5f1b8bfa62a34b79445faae39acdb0363d    
  
author   : Andrew Dunstan <[email protected]>    
date     : Thu, 26 Sep 2013 17:39:28 -0400    
  
committer: Andrew Dunstan <[email protected]>    
date     : Thu, 26 Sep 2013 17:39:28 -0400    

Click here for diff

The behaviour in json_populate_record() and json_populate_recordset()  
was changed during development but the docs were not.  

M doc/src/sgml/func.sgml

Fix spurious warning after vacuuming a page on a table with no indexes.

commit   : adaba2751f617c0045f72d2ac2d5402cc184fb29    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Thu, 26 Sep 2013 11:24:40 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Thu, 26 Sep 2013 11:24:40 +0300    

Click here for diff

There is a rare race condition, when a transaction that inserted a tuple  
aborts while vacuum is processing the page containing the inserted tuple.  
Vacuum prunes the page first, which normally removes any dead tuples, but  
if the inserting transaction aborts right after that, the loop after  
pruning will see a dead tuple and remove it instead. That's OK, but if the  
page is on a table with no indexes, and the page becomes completely empty  
after removing the dead tuple (or tuples) on it, it will be immediately  
marked as all-visible. That's OK, but the sanity check in vacuum would  
throw a warning because it thinks that the page contains dead tuples and  
was nevertheless marked as all-visible, even though it just vacuumed away  
the dead tuples and so it doesn't actually contain any.  
  
Spotted this while reading the code. It's difficult to hit the race  
condition otherwise, but can be done by putting a breakpoint after the  
heap_page_prune() call.  
  
Backpatch all the way to 8.4, where this code first appeared.  

M src/backend/commands/vacuumlazy.c

pgbench: Correct for bias in --rate schedule generation.

commit   : c2df45a37cd9e32815fe2786cbb3ef905daaa7d2    
  
author   : Noah Misch <[email protected]>    
date     : Wed, 25 Sep 2013 23:09:50 -0400    
  
committer: Noah Misch <[email protected]>    
date     : Wed, 25 Sep 2013 23:09:50 -0400    

Click here for diff

Previous code gave a mean delay 0.44% below target.  This change also  
has the effect of increasing the maximum possible delay.  
  
Fabien COELHO  

M contrib/pgbench/pgbench.c

Plug memory leak in range_cmp function.

commit   : 77ae7f7c356064f5355e004b95f485358dfc1360    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Wed, 25 Sep 2013 16:02:00 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Wed, 25 Sep 2013 16:02:00 +0300    

Click here for diff

B-tree operators are not allowed to leak memory into the current memory  
context. Range_cmp leaked detoasted copies of the arguments. That caused  
a quick out-of-memory error when creating an index on a range column.  
  
Reported by Marian Krucina, bug #8468.  

M src/backend/utils/adt/rangetypes.c

Fix pgindent comment breakage

commit   : b2fc4d6142033e361dee91388d9515be3633763c    
  
author   : Alvaro Herrera <[email protected]>    
date     : Tue, 24 Sep 2013 18:19:14 -0300    
  
committer: Alvaro Herrera <[email protected]>    
date     : Tue, 24 Sep 2013 18:19:14 -0300    

Click here for diff

M src/backend/access/heap/visibilitymap.c

Use @libdir@ in both of regress/{input,output}/security_label.source

commit   : b43b64caea4457c3a901e88e910f7e8badb5035f    
  
author   : Noah Misch <[email protected]>    
date     : Mon, 23 Sep 2013 16:00:13 -0400    
  
committer: Noah Misch <[email protected]>    
date     : Mon, 23 Sep 2013 16:00:13 -0400    

Click here for diff

Though @libdir@ almost always matches @abs_builddir@ in this context,  
the test could only fail if they differed.  Back-patch to 9.1, where the  
test was introduced.  
  
Hamid Quddus Akhtar  

M src/test/regress/output/security_label.source

pgbench: Tweak documentation.

commit   : 825da2aba8ae7a5824e9fb3823125c5c755ea568    
  
author   : Noah Misch <[email protected]>    
date     : Mon, 23 Sep 2013 15:49:21 -0400    
  
committer: Noah Misch <[email protected]>    
date     : Mon, 23 Sep 2013 15:49:21 -0400    

Click here for diff

Fabien COELHO  

M contrib/pgbench/pgbench.c
M doc/src/sgml/pgbench.sgml

doc: Clarify that file_fdw options require values.

commit   : 54990af616ebb31fb1ae04e8aaf332d483a9e3a5    
  
author   : Robert Haas <[email protected]>    
date     : Mon, 23 Sep 2013 14:57:01 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Mon, 23 Sep 2013 14:57:01 -0400    

Click here for diff

Mike Blackwell and Robert Haas  

M doc/src/sgml/file-fdw.sgml

Don't allow system columns in CHECK constraints, except tableoid.

commit   : ba3d39c96921c96de114f6c22a9572bff24708b5    
  
author   : Robert Haas <[email protected]>    
date     : Mon, 23 Sep 2013 13:31:22 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Mon, 23 Sep 2013 13:31:22 -0400    

Click here for diff

Previously, arbitray system columns could be mentioned in table  
constraints, but they were not correctly checked at runtime, because  
the values weren't actually set correctly in the tuple.  Since it  
seems easy enough to initialize the table OID properly, do that,  
and continue allowing that column, but disallow the rest unless and  
until someone figures out a way to make them work properly.  
  
No back-patch, because this doesn't seem important enough to take the  
risk of destabilizing the back branches.  In fact, this will pose a  
dump-and-reload hazard for those upgrading from previous versions:  
constraints that were accepted before but were not correctly enforced  
will now either be enforced correctly or not accepted at all.  Either  
could result in restore failures, but in practice I think very few  
users will notice the difference, since the use case is pretty  
marginal anyway and few users will be relying on features that have  
not historically worked.  
  
Amit Kapila, reviewed by Rushabh Lathia, with doc changes by me.  

M doc/src/sgml/ref/create_table.sgml
M src/backend/commands/copy.c
M src/backend/commands/tablecmds.c
M src/backend/executor/nodeModifyTable.c
M src/backend/parser/parse_relation.c
M src/test/regress/input/constraints.source
M src/test/regress/output/constraints.source

pg_upgrade: more C comment fixes

commit   : ff2a1f5e84ee9984b33ee31e6fb9c6f2760a820e    
  
author   : Bruce Momjian <[email protected]>    
date     : Mon, 23 Sep 2013 11:12:09 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Mon, 23 Sep 2013 11:12:09 -0400    

Click here for diff

M contrib/pg_upgrade/version_old_8_3.c

pg_upgrade: fix C comment typo

commit   : f7cf5fa262f8be1bc75f390708ceed26d25f1e7d    
  
author   : Bruce Momjian <[email protected]>    
date     : Mon, 23 Sep 2013 11:06:11 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Mon, 23 Sep 2013 11:06:11 -0400    

Click here for diff

M contrib/pg_upgrade/version_old_8_3.c

Fix SSL deadlock risk in libpq

commit   : b37c90f11e3c239b999f98ffd3bbea6b8253fffa    
  
author   : Stephen Frost <[email protected]>    
date     : Mon, 23 Sep 2013 08:33:41 -0400    
  
committer: Stephen Frost <[email protected]>    
date     : Mon, 23 Sep 2013 08:33:41 -0400    

Click here for diff

In libpq, we set up and pass to OpenSSL callback routines to handle  
locking.  When we run out of SSL connections, we try to clean things  
up by de-registering the hooks.  Unfortunately, we had a few calls  
into the OpenSSL library after these hooks were de-registered during  
SSL cleanup which lead to deadlocking.  This moves the thread callback  
cleanup to be after all SSL-cleanup related OpenSSL library calls.  
I've been unable to reproduce the deadlock with this fix.  
  
In passing, also move the close_SSL call to be after unlocking our  
ssl_config mutex when in a failure state.  While it looks pretty  
unlikely to be an issue, it could have resulted in deadlocks if we  
ended up in this code path due to something other than SSL_new  
failing.  Thanks to Heikki for pointing this out.  
  
Back-patch to all supported versions; note that the close_SSL issue  
only goes back to 9.0, so that hunk isn't included in the 8.4 patch.  
  
Initially found and reported by Vesa-Matti J Kari; many thanks to  
both Heikki and Andres for their help running down the specific  
issue and reviewing the patch.  

M src/interfaces/libpq/fe-secure.c

Fix two timeline handling bugs in pg_receivexlog.

commit   : b882246e3ab4382b3c9f58e5f85dd8c9e3eb594f    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Mon, 23 Sep 2013 10:17:52 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Mon, 23 Sep 2013 10:17:52 +0300    

Click here for diff

When a timeline history file is fetched from server, it is initially created  
with a temporary file name, and renamed to place. However, the temporary  
file name was constructed using an uninitialized buffer. Usually that meant  
that the file was created in current directory instead of the target, which  
usually goes unnoticed, but if the target is on a different filesystem than  
the current dir, the rename() would fail. Fix that.  
  
The second issue is that pg_receivexlog would not take .partial files into  
account when determining when scanning the target directory for existing  
WAL files. If the timeline has switched in the server several times in the  
last WAL segment, and pg_receivexlog is restarted, it would choose a too  
old starting point. That's not a problem as long as the old WAL segment  
exists in the server and can be streamed over, but will cause a failure if  
it's not.  
  
Backpatch to 9.3, where this timeline handling code was written.  
  
Analysed by Andrew Gierth, bug #8453, based on a bug report on IRC.  

M src/bin/pg_basebackup/pg_receivexlog.c
M src/bin/pg_basebackup/receivelog.c

Fix compiler warning in WaitForBackgroundWorkerStartup().

commit   : 496439d943565bdb6cb2eef534cce551c30e8a0f    
  
author   : Robert Haas <[email protected]>    
date     : Thu, 19 Sep 2013 13:00:17 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Thu, 19 Sep 2013 13:00:17 -0400    

Click here for diff

Per complaint from Andrew Gierth.  

M src/backend/postmaster/bgworker.c

Fix typo in comment.

commit   : 6e5f6e59134c4829060321b875e86c538adc0914    
  
author   : Fujii Masao <[email protected]>    
date     : Thu, 19 Sep 2013 01:58:32 +0900    
  
committer: Fujii Masao <[email protected]>    
date     : Thu, 19 Sep 2013 01:58:32 +0900    

Click here for diff

Ian Lawrence Barwick  

M src/bin/psql/command.c

Documentation correction.

commit   : eb3b79ffd4c456b49325df0002dbc4cb6a3741e7    
  
author   : Robert Haas <[email protected]>    
date     : Wed, 18 Sep 2013 09:05:10 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Wed, 18 Sep 2013 09:05:10 -0400    

Click here for diff

Etsuro Fujita  

M doc/src/sgml/advanced.sgml

Typo fix.

commit   : 86a174bff0730791c5c262d646d4fe28c2485be1    
  
author   : Robert Haas <[email protected]>    
date     : Wed, 18 Sep 2013 08:57:44 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Wed, 18 Sep 2013 08:57:44 -0400    

Click here for diff

Etsuro Fujita  

M src/backend/access/spgist/spgtextproc.c

Remove `proc` argument from LockCheckConflicts

commit   : 1247ea28cbc834bd6750b569537baff4e35edf79    
  
author   : Alvaro Herrera <[email protected]>    
date     : Mon, 16 Sep 2013 22:14:14 -0300    
  
committer: Alvaro Herrera <[email protected]>    
date     : Mon, 16 Sep 2013 22:14:14 -0300    

Click here for diff

This has been unused since commit 8563ccae2caf.  
  
Noted by Antonin Houska  

M src/backend/storage/lmgr/lock.c
M src/backend/storage/lmgr/proc.c
M src/include/storage/lock.h

Rename various "freeze multixact" variables

commit   : dd778e9d888454fdd2c25c66fc268ba9844eb125    
  
author   : Alvaro Herrera <[email protected]>    
date     : Mon, 16 Sep 2013 15:45:00 -0300    
  
committer: Alvaro Herrera <[email protected]>    
date     : Mon, 16 Sep 2013 15:45:00 -0300    

Click here for diff

It seems to make more sense to use "cutoff multixact" terminology  
throughout the backend code; "freeze" is associated with replacing of an  
Xid with FrozenTransactionId, which is not what we do for MultiXactIds.  
  
Andres Freund  
Some adjustments by Álvaro Herrera  

M src/backend/access/heap/heapam.c
M src/backend/access/heap/rewriteheap.c
M src/backend/access/transam/multixact.c
M src/backend/commands/cluster.c
M src/backend/commands/dbcommands.c
M src/backend/commands/vacuum.c
M src/backend/commands/vacuumlazy.c
M src/backend/postmaster/autovacuum.c
M src/include/access/rewriteheap.h
M src/include/commands/cluster.h
M src/include/commands/vacuum.h

Add a GUC to report whether data page checksums are enabled.

commit   : 0892ecbc015930dde2cee9ad464b9b70fdb7667e    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Mon, 16 Sep 2013 14:36:01 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Mon, 16 Sep 2013 14:36:01 +0300    

Click here for diff

Bernd Helmle  

M doc/src/sgml/config.sgml
M src/backend/access/transam/xlog.c
M src/backend/utils/misc/guc.c

Fix typos

commit   : cdeb79adcfb2e46efd4f76c39184dd452ae1acd0    
  
author   : Peter Eisentraut <[email protected]>    
date     : Sun, 15 Sep 2013 11:01:14 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Sun, 15 Sep 2013 11:01:14 -0400    

Click here for diff

M doc/src/sgml/config.sgml
M doc/src/sgml/ref/pg_dump.sgml

Ignore interrupts during quickdie().

commit   : d41cb869aad493178777b6e6e8d1425535349acb    
  
author   : Noah Misch <[email protected]>    
date     : Wed, 11 Sep 2013 20:10:15 -0400    
  
committer: Noah Misch <[email protected]>    
date     : Wed, 11 Sep 2013 20:10:15 -0400    

Click here for diff

Once the administrator has called for an immediate shutdown or a backend  
crash has triggered a reinitialization, no mere SIGINT or SIGTERM should  
change that course.  Such derailment remains possible when the signal  
arrives before quickdie() blocks signals.  That being a narrow race  
affecting most PostgreSQL signal handlers in some way, leave it for  
another patch.  Back-patch this to all supported versions.  

M src/backend/tcop/postgres.c

Create index on srt table in citext regression tests.

commit   : a49d0b75ce41a5480777f0957d5119cb2f393414    
  
author   : Kevin Grittner <[email protected]>    
date     : Wed, 11 Sep 2013 16:53:23 -0500    
  
committer: Kevin Grittner <[email protected]>    
date     : Wed, 11 Sep 2013 16:53:23 -0500    

Click here for diff

Comments and the tests make clear that the intent is to test with  
and without an index, but there was no index.  

M contrib/citext/expected/citext.out
M contrib/citext/expected/citext_1.out
M contrib/citext/sql/citext.sql

commit   : f0e86930dd56f2da00101d5384cbb51ada3730da    
  
author   : Bruce Momjian <[email protected]>    
date     : Tue, 10 Sep 2013 21:34:01 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Tue, 10 Sep 2013 21:34:01 -0400    

Click here for diff

Albe Laurenz  

M contrib/fuzzystrmatch/dmetaphone.c

docs: Update libpq and testlo examples

commit   : 2885006afc81aaabf3a32a873bbed99282f5a978    
  
author   : Bruce Momjian <[email protected]>    
date     : Tue, 10 Sep 2013 21:03:11 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Tue, 10 Sep 2013 21:03:11 -0400    

Click here for diff

Josh Kupershmidt  

M doc/src/sgml/libpq.sgml
M doc/src/sgml/lobj.sgml

Add comment for VARSIZE_ANY_EXHDR macro

commit   : 0f59f4a645ec92e580baa4c8feb9f285a8279a15    
  
author   : Bruce Momjian <[email protected]>    
date     : Tue, 10 Sep 2013 20:18:53 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Tue, 10 Sep 2013 20:18:53 -0400    

Click here for diff

Gurjeet Singh  

M src/include/postgres.h

psql: fix \copy stdin trailing space requirement

commit   : d8a5608d4ac9d4b74772980666cc6626bd18c3ff    
  
author   : Bruce Momjian <[email protected]>    
date     : Tue, 10 Sep 2013 19:36:10 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Tue, 10 Sep 2013 19:36:10 -0400    

Click here for diff

Previously a trailing space was required for \copy ... stdin:  
  
	copy foo from stdin ;  
  
Etsuro Fujita  

M src/bin/psql/copy.c

commit   : 601f48076f8036a223f631692db83ec661f785a6    
  
author   : Bruce Momjian <[email protected]>    
date     : Tue, 10 Sep 2013 19:07:06 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Tue, 10 Sep 2013 19:07:06 -0400    

Click here for diff

"No rows" previously only honored the tuples-only option.  
  
Per report from Eli Mesika  

M src/bin/psql/print.c

Remove leftover function prototype.

commit   : 71129b6fc5a7f1a7615f9ee07ee55994217de994    
  
author   : Fujii Masao <[email protected]>    
date     : Wed, 11 Sep 2013 01:32:24 +0900    
  
committer: Fujii Masao <[email protected]>    
date     : Wed, 11 Sep 2013 01:32:24 +0900    

Click here for diff

The prototype for inval_twophase_postcommit wasn't removed when it's definition  
was removed in efc16ea520679d713d98a2c7bf1453c4ff7b91ec / the initial HS commit.  
  
Andres Freund  

M src/include/utils/inval.h

Show schemas in information_schema.schemata that the current has access to

commit   : b34f8f409bec4921d260ac84668917f5fff04319    
  
author   : Peter Eisentraut <[email protected]>    
date     : Mon, 9 Sep 2013 22:25:37 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Mon, 9 Sep 2013 22:25:37 -0400    

Click here for diff

Before, it would only show schemas that the current user owns.  Per  
discussion, the new behavior is more useful and consistent for PostgreSQL.  

M doc/src/sgml/information_schema.sgml
M src/backend/catalog/information_schema.sql

Introduce InvalidCommandId.

commit   : 71901ab6daaad65c0168c05e016e4208efe5b71a    
  
author   : Robert Haas <[email protected]>    
date     : Mon, 9 Sep 2013 16:25:29 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Mon, 9 Sep 2013 16:25:29 -0400    

Click here for diff

This allows a 32-bit field to represent an *optional* command ID  
without a separate flag bit.  
  
Andres Freund  

M src/backend/access/transam/xact.c
M src/include/c.h

Return error if allocation of new element was not possible.

commit   : 9c68834bfc2ab6e782f56ee3dc7b4949857b8729    
  
author   : Michael Meskes <[email protected]>    
date     : Sun, 8 Sep 2013 12:59:43 +0200    
  
committer: Michael Meskes <[email protected]>    
date     : Sun, 8 Sep 2013 12:59:43 +0200    

Click here for diff

Found by Coverity.  

M src/interfaces/ecpg/pgtypeslib/numeric.c

Close file to no leak file descriptor memory. Found by Coverity.

commit   : 579dae5bc0b87dfa53d0caa0ac57f0f5e739544f    
  
author   : Michael Meskes <[email protected]>    
date     : Sun, 8 Sep 2013 12:49:54 +0200    
  
committer: Michael Meskes <[email protected]>    
date     : Sun, 8 Sep 2013 12:49:54 +0200    

Click here for diff

M src/interfaces/ecpg/preproc/pgc.l

intarray: return empty zero-dimensional array for an empty array

commit   : c155f654b4f755b4111bd9adb60559fe22526a10    
  
author   : Bruce Momjian <[email protected]>    
date     : Sat, 7 Sep 2013 11:44:33 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Sat, 7 Sep 2013 11:44:33 -0400    

Click here for diff

Previously a one-dimensional empty array was returned, but its text  
representation matched a zero-dimensional array, and there is no way to  
dump/reload a one-dimensional empty array.  
  
BACKWARD INCOMPATIBILITY  
  
Per report from elein  

M contrib/intarray/_int_tool.c

Don't VALGRIND_PRINTF() each query string.

commit   : b8104730c8eae1f81ccbc8673bbd2a3566e660ae    
  
author   : Noah Misch <[email protected]>    
date     : Fri, 6 Sep 2013 19:42:00 -0400    
  
committer: Noah Misch <[email protected]>    
date     : Fri, 6 Sep 2013 19:42:00 -0400    

Click here for diff

Doing so was helpful for some Valgrind usage and distracting for other  
usage.  One can achieve the same effect by changing log_statement and  
pointing both PostgreSQL and Valgrind logging to stderr.  
  
Per gripe from Andres Freund.  

M src/backend/tcop/postgres.c

commit   : 277607d600fb71e25082b94302ca1716403cd0bc    
  
author   : Kevin Grittner <[email protected]>    
date     : Thu, 5 Sep 2013 14:03:43 -0500    
  
committer: Kevin Grittner <[email protected]>    
date     : Thu, 5 Sep 2013 14:03:43 -0500    

Click here for diff

Commit 95ef6a344821655ce4d0a74999ac49dd6af6d342 removed the  
ability to create rules on an individual column as of 7.3, but  
left some residual code which has since been useless.  This cleans  
up that dead code without any change in behavior other than  
dropping the useless column from the catalog.  

M doc/src/sgml/catalogs.sgml
M src/backend/rewrite/rewriteDefine.c
M src/backend/rewrite/rewriteHandler.c
M src/backend/rewrite/rewriteManip.c
M src/backend/utils/adt/ruleutils.c
M src/backend/utils/cache/relcache.c
M src/include/catalog/catversion.h
M src/include/catalog/pg_rewrite.h
M src/include/rewrite/prs2lock.h
M src/include/rewrite/rewriteManip.h
M src/tools/pgindent/typedefs.list

Make catalog cache hash tables resizeable.

commit   : 20cb18db4668b016748fbb5fcb1422bc3e0d52d1    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Thu, 5 Sep 2013 19:47:56 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Thu, 5 Sep 2013 19:47:56 +0300    

Click here for diff

If the hash table backing a catalog cache becomes too full (fillfactor > 2),  
enlarge it. A new buckets array, double the size of the old, is allocated,  
and all entries in the old hash are moved to the right bucket in the new  
hash.  
  
This has two benefits. First, cache lookups don't get so expensive when  
there are lots of entries in a cache, like if you access hundreds of  
thousands of tables. Second, we can make the (initial) sizes of the caches  
much smaller, which saves memory.  
  
This patch dials down the initial sizes of the catcaches. The new sizes are  
chosen so that a backend that only runs a few basic queries still won't need  
to enlarge any of them.  

M src/backend/utils/cache/catcache.c
M src/backend/utils/cache/syscache.c
M src/include/utils/catcache.h

Revert WAL posix_fallocate() patches.

commit   : b1892aaeaaf34d8d1637221fc1cbda82ac3fcd71    
  
author   : Jeff Davis <[email protected]>    
date     : Wed, 4 Sep 2013 23:43:41 -0700    
  
committer: Jeff Davis <[email protected]>    
date     : Wed, 4 Sep 2013 23:43:41 -0700    

Click here for diff

This reverts commit 269e780822abb2e44189afaccd6b0ee7aefa7ddd  
and commit 5b571bb8c8d2bea610e01ae1ee7bc05adcfff528.  
  
Unfortunately, the initial patch had insufficient performance testing,  
and resulted in a regression.  
  
Per report by Thom Brown.  

M configure
M configure.in
M src/backend/access/transam/xlog.c
M src/include/pg_config.h.in
M src/include/pg_config.h.win32

Improve Range Types and Exclusion Constraints example.

commit   : be6fcb671e4291654391fba475f4b555d2da74f3    
  
author   : Jeff Davis <[email protected]>    
date     : Wed, 4 Sep 2013 23:30:27 -0700    
  
committer: Jeff Davis <[email protected]>    
date     : Wed, 4 Sep 2013 23:30:27 -0700    

Click here for diff

Make the examples self-contained to avoid confusion. Per bug report  
8367 from KOIZUMI Satoru.  

M doc/src/sgml/rangetypes.sgml

Add GUC descriptions for compile-time postgresql.conf settings

commit   : f5c2f5a8f6645a7da720a5f24efdbe8a1183a06c    
  
author   : Bruce Momjian <[email protected]>    
date     : Wed, 4 Sep 2013 17:44:04 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Wed, 4 Sep 2013 17:44:04 -0400    

Click here for diff

Previous text was "No description available".  
  
Tianyin Xu  

M src/backend/utils/misc/guc.c

Remove dead URL mention in OSX startup script

commit   : 66d85c5356ac32d1bf1fe13ea36ef81e21de82c2    
  
author   : Bruce Momjian <[email protected]>    
date     : Wed, 4 Sep 2013 17:04:12 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Wed, 4 Sep 2013 17:04:12 -0400    

Click here for diff

Backpatch to 9.3.  
  
Per suggestion from Gavan Schneider  

M contrib/start-scripts/osx/PostgreSQL

Keep heavily-contended fields in XLogCtlInsert on different cache lines.

commit   : 375d8526f2900d0c377f44532f6d09ee06531f67    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Wed, 4 Sep 2013 23:14:33 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Wed, 4 Sep 2013 23:14:33 +0300    

Click here for diff

Performance testing shows that if the insertpos_lck spinlock and the fields  
that it protects are on the same cache line with other variables that are  
frequently accessed, the false sharing can hurt performance a lot. Keep  
them apart by adding some padding.  

M src/backend/access/transam/xlog.c
M src/include/pg_config_manual.h

Expose fsync_fname as a public API.

commit   : cc52d5b33ff5df29de57dcae9322214cfe9c8464    
  
author   : Robert Haas <[email protected]>    
date     : Wed, 4 Sep 2013 11:15:00 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Wed, 4 Sep 2013 11:15:00 -0400    

Click here for diff

Andres Freund  

M src/backend/storage/file/copydir.c
M src/backend/storage/file/fd.c
M src/include/storage/fd.h

Update comments concerning PGC_S_TEST.

commit   : 0c66a223774dec62edb5281a47e72fe480a8f7aa    
  
author   : Tom Lane <[email protected]>    
date     : Tue, 3 Sep 2013 18:56:22 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Tue, 3 Sep 2013 18:56:22 -0400    

Click here for diff

This GUC context value was once only used by ALTER DATABASE SET and  
ALTER USER SET.  That's not true anymore, though, so rewrite the  
comments to be a bit more general.  
  
Patch in HEAD only, since this is just an internal documentation issue.  

M src/backend/commands/tablespace.c
M src/backend/utils/cache/ts_cache.c
M src/include/utils/guc.h

Don't fail for bad GUCs in CREATE FUNCTION with check_function_bodies off.

commit   : 546f7c2e38531469eb3cff62256fde8606330c67    
  
author   : Tom Lane <[email protected]>    
date     : Tue, 3 Sep 2013 18:32:20 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Tue, 3 Sep 2013 18:32:20 -0400    

Click here for diff

The previous coding attempted to activate all the GUC settings specified  
in SET clauses, so that the function validator could operate in the GUC  
environment expected by the function body.  However, this is problematic  
when restoring a dump, since the SET clauses might refer to database  
objects that don't exist yet.  We already have the parameter  
check_function_bodies that's meant to prevent forward references in  
function definitions from breaking dumps, so let's change CREATE FUNCTION  
to not install the SET values if check_function_bodies is off.  
  
Authors of function validators were already advised not to make any  
"context sensitive" checks when check_function_bodies is off, if indeed  
they're checking anything at all in that mode.  But extend the  
documentation to point out the GUC issue in particular.  
  
(Note that we still check the SET clauses to some extent; the behavior  
with !check_function_bodies is now approximately equivalent to what ALTER  
DATABASE/ROLE have been doing for awhile with context-dependent GUCs.)  
  
This problem can be demonstrated in all active branches, so back-patch  
all the way.  

M doc/src/sgml/plhandler.sgml
M src/backend/catalog/pg_proc.c
M src/test/regress/expected/guc.out
M src/test/regress/sql/guc.sql

Allow aggregate functions to be VARIADIC.

commit   : 0d3f4406dfa00d848711fdb4af53be663ffc7d0f    
  
author   : Tom Lane <[email protected]>    
date     : Tue, 3 Sep 2013 17:08:38 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Tue, 3 Sep 2013 17:08:38 -0400    

Click here for diff

There's no inherent reason why an aggregate function can't be variadic  
(even VARIADIC ANY) if its transition function can handle the case.  
Indeed, this patch to add the feature touches none of the planner or  
executor, and little of the parser; the main missing stuff was DDL and  
pg_dump support.  
  
It is true that variadic aggregates can create the same sort of ambiguity  
about parameters versus ORDER BY keys that was complained of when we  
(briefly) had both one- and two-argument forms of string_agg().  However,  
the policy formed in response to that discussion only said that we'd not  
create any built-in aggregates with varying numbers of arguments, not that  
we shouldn't allow users to do it.  So the logical extension of that is  
we can allow users to make variadic aggregates as long as we're wary about  
shipping any such in core.  
  
In passing, this patch allows aggregate function arguments to be named, to  
the extent of remembering the names in pg_proc and dumping them in pg_dump.  
You can't yet call an aggregate using named-parameter notation.  That seems  
like a likely future extension, but it'll take some work, and it's not what  
this patch is really about.  Likewise, there's still some work needed to  
make window functions handle VARIADIC fully, but I left that for another  
day.  
  
initdb forced because of new aggvariadic field in Aggref parse nodes.  

M doc/src/sgml/ref/alter_aggregate.sgml
M doc/src/sgml/ref/alter_extension.sgml
M doc/src/sgml/ref/comment.sgml
M doc/src/sgml/ref/create_aggregate.sgml
M doc/src/sgml/ref/drop_aggregate.sgml
M doc/src/sgml/ref/security_label.sgml
M doc/src/sgml/syntax.sgml
M doc/src/sgml/xaggr.sgml
M src/backend/catalog/pg_aggregate.c
M src/backend/commands/aggregatecmds.c
M src/backend/commands/functioncmds.c
M src/backend/executor/nodeAgg.c
M src/backend/executor/nodeWindowAgg.c
M src/backend/nodes/copyfuncs.c
M src/backend/nodes/equalfuncs.c
M src/backend/nodes/outfuncs.c
M src/backend/nodes/readfuncs.c
M src/backend/parser/gram.y
M src/backend/parser/parse_agg.c
M src/backend/parser/parse_func.c
M src/backend/tcop/utility.c
M src/backend/utils/adt/ruleutils.c
M src/bin/pg_dump/pg_dump.c
M src/bin/psql/describe.c
M src/include/catalog/catversion.h
M src/include/catalog/pg_aggregate.h
M src/include/commands/defrem.h
M src/include/nodes/primnodes.h
M src/include/parser/parse_agg.h
M src/test/regress/expected/aggregates.out
M src/test/regress/expected/create_aggregate.out
M src/test/regress/expected/opr_sanity.out
M src/test/regress/sql/aggregates.sql
M src/test/regress/sql/create_aggregate.sql
M src/test/regress/sql/opr_sanity.sql

Update obsolete comment

commit   : 8b290f3115db5bbe85176160c7cabe0d927dcc37    
  
author   : Alvaro Herrera <[email protected]>    
date     : Tue, 3 Sep 2013 16:52:11 -0400    
  
committer: Alvaro Herrera <[email protected]>    
date     : Tue, 3 Sep 2013 16:52:11 -0400    

Click here for diff

M src/include/storage/relfilenode.h

Docs: wording improvements in discussion of timestamp arithmetic.

commit   : 7489eb4d3b7fef2c2eaeb66e3bcb3fb74385b44d    
  
author   : Tom Lane <[email protected]>    
date     : Tue, 3 Sep 2013 16:28:56 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Tue, 3 Sep 2013 16:28:56 -0400    

Click here for diff

I started out just to fix the broken markup in commit  
1c2085766187031eaeaae7db4785b9e1d4241988, but got distracted by  
copy-editing.  I see Bruce already fixed the markup, but I'll  
commit the wordsmithing anyway.  

M doc/src/sgml/func.sgml

doc: Fix SGML markup for date patch

commit   : b642bc55fa869160ba8d1b63dacf99e43fdadbb1    
  
author   : Bruce Momjian <[email protected]>    
date     : Tue, 3 Sep 2013 16:06:24 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Tue, 3 Sep 2013 16:06:24 -0400    

Click here for diff

M doc/src/sgml/func.sgml

Docs: add paragraph about date/timestamp subtraction

commit   : 1c2085766187031eaeaae7db4785b9e1d4241988    
  
author   : Bruce Momjian <[email protected]>    
date     : Tue, 3 Sep 2013 13:24:39 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Tue, 3 Sep 2013 13:24:39 -0400    

Click here for diff

per suggestion from Francisco Olart  

M doc/src/sgml/func.sgml

docs: Clarify that we also support Solaris versions greater than 10.

commit   : 9d323bda2ede5d4e42fdc6934188dd7a76a04d54    
  
author   : Robert Haas <[email protected]>    
date     : Tue, 3 Sep 2013 11:16:37 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Tue, 3 Sep 2013 11:16:37 -0400    

Click here for diff

MauMau  

M doc/src/sgml/runtime.sgml

Fix thinko in worker_spi, count(*) returns a bigint. Thanks RhodiumToad

commit   : cfa1cd711c2648e0beab50448c5a71ef91a3e1cb    
  
author   : Greg Stark <[email protected]>    
date     : Tue, 3 Sep 2013 13:27:34 +0100    
  
committer: Greg Stark <[email protected]>    
date     : Tue, 3 Sep 2013 13:27:34 +0100    

Click here for diff

M contrib/worker_spi/worker_spi.c

Fix typo in comment.

commit   : a93bdfc711399716328ce0811d600411b1314306    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Tue, 3 Sep 2013 13:17:09 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Tue, 3 Sep 2013 13:17:09 +0300    

Click here for diff

Also line-wrap an over-wide line in a comment that's ignored by pgindent.  

M src/backend/replication/syncrep.c

Update time zone data files to tzdata release 2013d.

commit   : 79daaa3e812c7600ef30ef3e6ba5e75cab18f212    
  
author   : Tom Lane <[email protected]>    
date     : Mon, 2 Sep 2013 15:06:21 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Mon, 2 Sep 2013 15:06:21 -0400    

Click here for diff

DST law changes in Israel, Morocco, Palestine, Paraguay.  
Historical corrections for Macquarie Island.  

M src/timezone/data/africa
M src/timezone/data/antarctica
M src/timezone/data/asia
M src/timezone/data/australasia
M src/timezone/data/europe
M src/timezone/data/iso3166.tab
M src/timezone/data/southamerica
M src/timezone/data/zone.tab

Fix relfrozenxid query in docs to include TOAST tables.

commit   : f002dc3d4d6600a4095daf83a9584f19d0bd5844    
  
author   : Andrew Dunstan <[email protected]>    
date     : Mon, 2 Sep 2013 14:38:12 -0400    
  
committer: Andrew Dunstan <[email protected]>    
date     : Mon, 2 Sep 2013 14:38:12 -0400    

Click here for diff

The original query ignored TOAST tables which could result in tables  
needing a vacuum not being reported.  
  
Backpatch to all live branches.  

M doc/src/sgml/maintenance.sgml

Translation updates

commit   : 6a007fa1ebf1da54b09963be565c122b1b938126    
  
author   : Peter Eisentraut <[email protected]>    
date     : Mon, 2 Sep 2013 02:28:21 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Mon, 2 Sep 2013 02:28:21 -0400    

Click here for diff

M src/backend/nls.mk
M src/backend/po/de.po
M src/backend/po/es.po
M src/backend/po/fr.po
M src/backend/po/pl.po
M src/backend/po/ru.po
D src/backend/po/tr.po
M src/bin/initdb/nls.mk
M src/bin/initdb/po/es.po
D src/bin/initdb/po/ko.po
M src/bin/initdb/po/pl.po
D src/bin/initdb/po/ro.po
D src/bin/initdb/po/sv.po
D src/bin/initdb/po/ta.po
D src/bin/initdb/po/tr.po
D src/bin/initdb/po/zh_TW.po
M src/bin/pg_basebackup/nls.mk
M src/bin/pg_basebackup/po/es.po
M src/bin/pg_basebackup/po/pl.po
D src/bin/pg_basebackup/po/zh_CN.po
M src/bin/pg_config/po/es.po
M src/bin/pg_config/po/sv.po
M src/bin/pg_controldata/nls.mk
M src/bin/pg_controldata/po/es.po
D src/bin/pg_controldata/po/ko.po
M src/bin/pg_controldata/po/pl.po
D src/bin/pg_controldata/po/ro.po
D src/bin/pg_controldata/po/sv.po
D src/bin/pg_controldata/po/ta.po
D src/bin/pg_controldata/po/tr.po
D src/bin/pg_controldata/po/zh_TW.po
M src/bin/pg_ctl/nls.mk
M src/bin/pg_ctl/po/es.po
D src/bin/pg_ctl/po/ko.po
M src/bin/pg_ctl/po/pl.po
M src/bin/pg_ctl/po/sv.po
D src/bin/pg_ctl/po/ta.po
D src/bin/pg_ctl/po/tr.po
M src/bin/pg_dump/nls.mk
M src/bin/pg_dump/po/es.po
D src/bin/pg_dump/po/ko.po
M src/bin/pg_dump/po/pl.po
D src/bin/pg_dump/po/sv.po
D src/bin/pg_dump/po/tr.po
D src/bin/pg_dump/po/zh_TW.po
M src/bin/pg_resetxlog/nls.mk
M src/bin/pg_resetxlog/po/es.po
D src/bin/pg_resetxlog/po/ko.po
M src/bin/pg_resetxlog/po/pl.po
D src/bin/pg_resetxlog/po/ro.po
D src/bin/pg_resetxlog/po/sv.po
D src/bin/pg_resetxlog/po/ta.po
D src/bin/pg_resetxlog/po/tr.po
D src/bin/pg_resetxlog/po/zh_TW.po
M src/bin/psql/nls.mk
M src/bin/psql/po/es.po
M src/bin/psql/po/pl.po
D src/bin/psql/po/sv.po
D src/bin/psql/po/tr.po
M src/bin/scripts/nls.mk
M src/bin/scripts/po/es.po
D src/bin/scripts/po/ko.po
M src/bin/scripts/po/pl.po
D src/bin/scripts/po/ro.po
D src/bin/scripts/po/sv.po
D src/bin/scripts/po/ta.po
D src/bin/scripts/po/tr.po
D src/bin/scripts/po/zh_TW.po
M src/interfaces/ecpg/ecpglib/po/es.po
M src/interfaces/ecpg/preproc/po/es.po
M src/interfaces/libpq/nls.mk
M src/interfaces/libpq/po/es.po
D src/interfaces/libpq/po/ko.po
M src/interfaces/libpq/po/pl.po
M src/interfaces/libpq/po/ru.po
D src/interfaces/libpq/po/sv.po
D src/interfaces/libpq/po/ta.po
M src/pl/plperl/po/es.po
M src/pl/plpgsql/src/nls.mk
M src/pl/plpgsql/src/po/es.po
D src/pl/plpgsql/src/po/ko.po
M src/pl/plpython/nls.mk
M src/pl/plpython/po/es.po
D src/pl/plpython/po/tr.po
D src/pl/plpython/po/zh_TW.po
M src/pl/tcl/po/es.po

Update "Using EXPLAIN" documentation examples using current code.

commit   : 244c8b466a743d1ec18a7d841bf42669699b3b56    
  
author   : Tom Lane <[email protected]>    
date     : Sun, 1 Sep 2013 19:43:02 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Sun, 1 Sep 2013 19:43:02 -0400    

Click here for diff

It seems like a good idea to update these examples since some fairly  
basic planner behaviors have changed in 9.3; notably that the startup cost  
for an indexscan plan node is no longer invariably estimated at 0.00.  

M doc/src/sgml/perform.sgml

Update 9.3 release notes.

commit   : f49f8de074c37d7af5441f79e5569b9e463d0b09    
  
author   : Tom Lane <[email protected]>    
date     : Sat, 31 Aug 2013 23:53:24 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Sat, 31 Aug 2013 23:53:24 -0400    

Click here for diff

Some corrections, a lot of copy-editing.  
  
Set projected release date as 2013-09-09.  

M doc/src/sgml/release-9.3.sgml

Improve regression test for #8410.

commit   : abd3f8ca4b84707adba2e6d69413c724715cceb3    
  
author   : Tom Lane <[email protected]>    
date     : Fri, 30 Aug 2013 21:40:21 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Fri, 30 Aug 2013 21:40:21 -0400    

Click here for diff

The previous version of the query disregarded the result of the MergeAppend  
instead of checking its results.  
  
Andres Freund  

M src/test/regress/expected/inherit.out
M src/test/regress/sql/inherit.sql

Add test case for bug #8410.

commit   : ac2d0e464aef5bbef1308abf0154986b3982714d    
  
author   : Tom Lane <[email protected]>    
date     : Fri, 30 Aug 2013 19:27:40 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Fri, 30 Aug 2013 19:27:40 -0400    

Click here for diff

Per Andres Freund.  

M src/test/regress/expected/inherit.out
M src/test/regress/sql/inherit.sql

Reset the binary heap in MergeAppend rescans.

commit   : 8e2b71d2d0381f7acc820a2400580a1e3a6add8c    
  
author   : Tom Lane <[email protected]>    
date     : Fri, 30 Aug 2013 19:15:21 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Fri, 30 Aug 2013 19:15:21 -0400    

Click here for diff

Failing to do so can cause queries to return wrong data, error out or crash.  
This requires adding a new binaryheap_reset() method to binaryheap.c,  
but that probably should have been there anyway.  
  
Per bug #8410 from Terje Elde.  Diagnosis and patch by Andres Freund.  

M src/backend/executor/nodeMergeAppend.c
M src/backend/lib/binaryheap.c
M src/include/lib/binaryheap.h

Make error wording more consistent

commit   : 9381cb5229da1f3556909585b38ada347d798161    
  
author   : Alvaro Herrera <[email protected]>    
date     : Thu, 29 Aug 2013 12:33:50 -0400    
  
committer: Alvaro Herrera <[email protected]>    
date     : Thu, 29 Aug 2013 12:33:50 -0400    

Click here for diff

M src/backend/postmaster/postmaster.c

Use a non-locking initial test in TAS_SPIN on x86_64.

commit   : b03d196be055450c7260749f17347c2d066b4254    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Thu, 29 Aug 2013 13:48:59 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Thu, 29 Aug 2013 13:48:59 +0300    

Click here for diff

Testing done in 2011 by Tom Lane concluded that this is a win on Intel Xeons  
and AMD Opterons, but it was not changed back then, because of an old  
comment in tas() that suggested that it's a huge loss on older Opterons.  
However, didn't have separate TAS() and TAS_SPIN() macros back then, so the  
comment referred to doing a non-locked initial test even on the first  
access, in uncontended case. I don't have access to older Opterons, but I'm  
pretty sure that doing an initial unlocked test is unlikely to be a loss  
while spinning, even though it might be for the first access.  
  
We probably should do the same on 32-bit x86, but I'm afraid of changing it  
without any testing. Hence just add a note to the x86 implementation  
suggesting that we probably should do the same there.  

M src/include/storage/s_lock.h

Allow discovery of whether a dynamic background worker is running.

commit   : 090d0f2050647958865cb495dff74af7257d2bb4    
  
author   : Robert Haas <[email protected]>    
date     : Wed, 28 Aug 2013 14:08:13 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Wed, 28 Aug 2013 14:08:13 -0400    

Click here for diff

Using the infrastructure provided by this patch, it's possible either  
to wait for the startup of a dynamically-registered background worker,  
or to poll the status of such a worker without waiting.  In either  
case, the current PID of the worker process can also be obtained.  
As usual, worker_spi is updated to demonstrate the new functionality.  
  
Patch by me.  Review by Andres Freund.  

M contrib/worker_spi/worker_spi–1.0.sql
M contrib/worker_spi/worker_spi.c
M doc/src/sgml/bgworker.sgml
M src/backend/commands/async.c
M src/backend/postmaster/bgworker.c
M src/backend/postmaster/postmaster.c
M src/backend/storage/ipc/procsignal.c
M src/include/miscadmin.h
M src/include/postmaster/bgworker.h
M src/include/postmaster/bgworker_internals.h
M src/include/postmaster/postmaster.h
M src/include/storage/procsignal.h

Partially restore comments discussing enum renumbering hazards.

commit   : c9e2e2db5c2090a880028fd8c1debff474640f50    
  
author   : Robert Haas <[email protected]>    
date     : Wed, 28 Aug 2013 13:21:08 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Wed, 28 Aug 2013 13:21:08 -0400    

Click here for diff

As noted by Tom Lane, commit 813fb0315587d32e3b77af1051a0ef517d187763  
was overly optimistic about how safe it is to concurrently change  
enumsortorder values under MVCC catalog scan semantics.  Restore  
some of the previous text, with hopefully-correct adjustments for  
the new state of play.  

M src/backend/catalog/pg_enum.c

Accept multiple -I, -P, -T and -n options in pg_restore.

commit   : da85fb4747ac0b7f787ef7a402adea2747e32d8e    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Wed, 28 Aug 2013 09:43:34 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Wed, 28 Aug 2013 09:43:34 +0300    

Click here for diff

We already did this for -t (--table) in 9.3, but missed the other similar  
options. For consistency, allow all of them to be specified multiple times.  
  
Unfortunately it's too late to sneak this into 9.3, so commit to master  
only.  

M doc/src/sgml/ref/pg_restore.sgml
M src/bin/pg_dump/pg_backup.h
M src/bin/pg_dump/pg_backup_archiver.c
M src/bin/pg_dump/pg_restore.c

Initialize cached OID to Invalid in new hash entries

commit   : e246cfc95f020b5fcb20a1fb946efe77113edf00    
  
author   : Alvaro Herrera <[email protected]>    
date     : Tue, 27 Aug 2013 14:53:17 -0400    
  
committer: Alvaro Herrera <[email protected]>    
date     : Tue, 27 Aug 2013 14:53:17 -0400    

Click here for diff

Andres Freund; bug detected by valgrind  

M src/backend/utils/cache/relfilenodemap.c

Fix some "translator:" comments mangled by pgindent

commit   : 673b527534893a4a8adb3cdef52fc645c13598ce    
  
author   : Alvaro Herrera <[email protected]>    
date     : Tue, 27 Aug 2013 13:33:37 -0400    
  
committer: Alvaro Herrera <[email protected]>    
date     : Tue, 27 Aug 2013 13:33:37 -0400    

Click here for diff

M src/bin/psql/describe.c
M src/interfaces/ecpg/ecpglib/error.c

doc: Explain that ereport doesn't return for ERROR or higher levels.

commit   : 8d00ab630668a15e86b584b39187ef3bf3154511    
  
author   : Robert Haas <[email protected]>    
date     : Mon, 26 Aug 2013 14:27:43 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Mon, 26 Aug 2013 14:27:43 -0400    

Click here for diff

Christophe Pettus  

M doc/src/sgml/sources.sgml

Account better for planning cost when choosing whether to use custom plans.

commit   : 2aac3399aef47e40d688f3eee3f92b6deea2f974    
  
author   : Tom Lane <[email protected]>    
date     : Sat, 24 Aug 2013 15:14:17 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Sat, 24 Aug 2013 15:14:17 -0400    

Click here for diff

The previous coding in plancache.c essentially used 10% of the estimated  
runtime as its cost estimate for planning.  This can be pretty bogus,  
especially when the estimated runtime is very small, such as in a simple  
expression plan created by plpgsql, or a simple INSERT ... VALUES.  
  
While we don't have a really good handle on how planning time compares  
to runtime, it seems reasonable to use an estimate based on the number of  
relations referenced in the query, with a rather large multiplier.  This  
patch uses 1000 * cpu_operator_cost * (nrelations + 1), so that even a  
trivial query will be charged 1000 * cpu_operator_cost for planning.  
This should address the problem reported by Marc Cousin and others that  
9.2 and up prefer custom plans in cases where the planning time greatly  
exceeds what can be saved.  

M src/backend/utils/cache/plancache.c

Don't crash when pg_xlog is empty and pg_basebackup -x is used

commit   : db4ef737606e340479d68f63f33bc7d21f937ca7    
  
author   : Magnus Hagander <[email protected]>    
date     : Sat, 24 Aug 2013 17:11:31 +0200    
  
committer: Magnus Hagander <[email protected]>    
date     : Sat, 24 Aug 2013 17:11:31 +0200    

Click here for diff

The backup will not work (without a logarchive, and that's the whole  
point of -x) in this case, this patch just changes it to throw an  
error instead of crashing when this happens.  
  
Noticed and diagnosed by TAKATSUKA Haruka  

M src/backend/replication/basebackup.c

In locate_grouping_columns(), don't expect an exact match of Var typmods.

commit   : fcf9ecad575302fe3b9fe7cd269c9c153817b16c    
  
author   : Tom Lane <[email protected]>    
date     : Fri, 23 Aug 2013 17:30:53 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Fri, 23 Aug 2013 17:30:53 -0400    

Click here for diff

It's possible that inlining of SQL functions (or perhaps other changes?)  
has exposed typmod information not known at parse time.  In such cases,  
Vars generated by query_planner might have valid typmod values while the  
original grouping columns only have typmod -1.  This isn't a semantic  
problem since the behavior of grouping only depends on type not typmod,  
but it breaks locate_grouping_columns' use of tlist_member to locate the  
matching entry in query_planner's result tlist.  
  
We can fix this without an excessive amount of new code or complexity by  
relying on the fact that locate_grouping_columns only gets called when  
make_subplanTargetList has set need_tlist_eval == false, and that can only  
happen if all the grouping columns are simple Vars.  Therefore we only need  
to search the sub_tlist for a matching Var, and we can reasonably define a  
"match" as being a match of the Var identity fields  
varno/varattno/varlevelsup.  The code still Asserts that vartype matches,  
but ignores vartypmod.  
  
Per bug #8393 from Evan Martin.  The added regression test case is  
basically the same as his example.  This has been broken for a very long  
time, so back-patch to all supported branches.  

M src/backend/optimizer/plan/planner.c
M src/backend/optimizer/util/tlist.c
M src/include/optimizer/tlist.h
M src/test/regress/expected/rangefuncs.out
M src/test/regress/sql/rangefuncs.sql

Fix hash table size estimation error in choose_hashed_distinct().

commit   : 3454876314f0711894599f56e42ac99082b4e38f    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 21 Aug 2013 13:38:16 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 21 Aug 2013 13:38:16 -0400    

Click here for diff

We should account for the per-group hashtable entry overhead when  
considering whether to use a hash aggregate to implement DISTINCT.  The  
comparable logic in choose_hashed_grouping() gets this right, but I think  
I omitted it here in the mistaken belief that there would be no overhead  
if there were no aggregate functions to be evaluated.  This can result in  
more than 2X underestimate of the hash table size, if the tuples being  
aggregated aren't very wide.  Per report from Tomas Vondra.  
  
This bug is of long standing, but per discussion we'll only back-patch into  
9.3.  Changing the estimation behavior in stable branches seems to carry too  
much risk of destabilizing plan choices for already-tuned applications.  

M src/backend/optimizer/plan/planner.c

docs: Remove second 'trim' index reference

commit   : 5dcc48c2c76cf4b2b17c8e14fe3e588ae0c8eff3    
  
author   : Bruce Momjian <[email protected]>    
date     : Wed, 21 Aug 2013 07:32:43 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Wed, 21 Aug 2013 07:32:43 -0400    

Click here for diff

Per suggestion from Vik Fearing  

M doc/src/sgml/func.sgml

Unconditionally use the WSA equivalents of Socket error constants.

commit   : 73838b5251ec64d1c90d5df0d0be7a5c19cfae12    
  
author   : Andrew Dunstan <[email protected]>    
date     : Tue, 20 Aug 2013 14:11:36 -0400    
  
committer: Andrew Dunstan <[email protected]>    
date     : Tue, 20 Aug 2013 14:11:36 -0400    

Click here for diff

This change will only apply to mingw compilers, and has been found  
necessary by late versions of the mingw-w64 compiler. It's the same as  
what is done elsewhere for the Microsoft compilers.  
  
If this doesn't upset older compilers in the buildfarm, it will be  
backpatched to 9.1.  
  
Problem reported by Michael Cronenworth, although not his patch.  

M src/include/port/win32.h

commit   : b3cc173e19b98317936f26a3404266bce3b5ef70    
  
author   : Bruce Momjian <[email protected]>    
date     : Tue, 20 Aug 2013 09:39:01 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Tue, 20 Aug 2013 09:39:01 -0400    

Click here for diff

Backpatch to 9.3.  
  
Pavel Stehule  

M doc/src/sgml/release-9.3.sgml

Be more wary of unwanted whitespace in pgstat_reset_remove_files().

commit   : 20fe87075349a205d5b6a2f4b97c2bad4e8a961c    
  
author   : Tom Lane <[email protected]>    
date     : Mon, 19 Aug 2013 19:36:04 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Mon, 19 Aug 2013 19:36:04 -0400    

Click here for diff

sscanf isn't the easiest thing to use for exact pattern checks ...  
also, don't use strncmp where strcmp will do.  

M src/backend/postmaster/pgstat.c

Fix removal of files in pgstats directories

commit   : f9b50b7c18c8ce7de1fee59409fe23c58d438190    
  
author   : Alvaro Herrera <[email protected]>    
date     : Mon, 19 Aug 2013 17:48:17 -0400    
  
committer: Alvaro Herrera <[email protected]>    
date     : Mon, 19 Aug 2013 17:48:17 -0400    

Click here for diff

Instead of deleting all files in stats_temp_directory and the permanent  
directory on a crash, only remove those files that match the pattern of  
files we actually write in them, to avoid possibly clobbering existing  
unrelated contents of the temporary directory.  Per complaint from Jeff  
Janes, and subsequent discussion, starting at message  
CAMkU=1z9+7RsDODnT4=cDFBRBp8wYQbd_qsLcMtKEf-oFwuOdQ@mail.gmail.com  
  
Also, fix a bug in the same routine to avoid removing files from the  
permanent directory twice (instead of once from that directory and then  
from the temporary directory), also per report from Jeff Janes, in  
message  
CAMkU=1wbk947=-pAosDMX5VC+sQw9W4ttq6RM9rXu=MjNeEQKA@mail.gmail.com  

M src/backend/postmaster/pgstat.c

Rename the "fast_promote" file to just "promote".

commit   : 3619a20d33517399d4e234a78e6078c601ffba01    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Mon, 19 Aug 2013 20:57:53 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Mon, 19 Aug 2013 20:57:53 +0300    

Click here for diff

This keeps the usual trigger file name unchanged from 9.2, avoiding nasty  
issues if you use a pre-9.3 pg_ctl binary with a 9.3 server or vice versa.  
The fallback behavior of creating a full checkpoint before starting up is now  
triggered by a file called "fallback_promote". That can be useful for  
debugging purposes, but we don't expect any users to have to resort to that  
and we might want to remove that in the future, which is why the fallback  
mechanism is undocumented.  

M src/backend/access/transam/xlog.c
M src/bin/pg_ctl/pg_ctl.c

Fix qual-clause-misplacement issues with pulled-up LATERAL subqueries.

commit   : c64de21e9625acad57e2caf8f22435e1617fb1ce    
  
author   : Tom Lane <[email protected]>    
date     : Mon, 19 Aug 2013 13:19:25 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Mon, 19 Aug 2013 13:19:25 -0400    

Click here for diff

In an example such as  
SELECT * FROM  
  i LEFT JOIN LATERAL (SELECT * FROM j WHERE i.n = j.n) j ON true;  
it is safe to pull up the LATERAL subquery into its parent, but we must  
then treat the "i.n = j.n" clause as a qual clause of the LEFT JOIN.  The  
previous coding in deconstruct_recurse mistakenly labeled the clause as  
"is_pushed_down", resulting in wrong semantics if the clause were applied  
at the join node, as per an example submitted awhile ago by Jeremy Evans.  
To fix, postpone processing of such clauses until we return back up to  
the appropriate recursion depth in deconstruct_recurse.  
  
In addition, tighten the is-safe-to-pull-up checks in is_simple_subquery;  
we previously missed the possibility that the LATERAL subquery might itself  
contain an outer join that makes lateral references in lower quals unsafe.  
  
A regression test case equivalent to Jeremy's example was already in my  
commit of yesterday, but was giving the wrong results because of this  
bug.  This patch fixes the expected output for that, and also adds a  
test case for the second problem.  

M src/backend/optimizer/README
M src/backend/optimizer/plan/initsplan.c
M src/backend/optimizer/prep/prepjointree.c
M src/test/regress/expected/join.out
M src/test/regress/sql/join.sql

Fix pg_upgrade failure from servers older than 9.3

commit   : 78e1220104227c86b4b49d0fc123db7fa596d43d    
  
author   : Alvaro Herrera <[email protected]>    
date     : Mon, 19 Aug 2013 12:33:07 -0400    
  
committer: Alvaro Herrera <[email protected]>    
date     : Mon, 19 Aug 2013 12:33:07 -0400    

Click here for diff

When upgrading from servers of versions 9.2 and older, and MultiXactIds  
have been used in the old server beyond the first page (that is, 2048  
multis or more in the default 8kB-page build), pg_upgrade would set the  
next multixact offset to use beyond what has been allocated in the new  
cluster.  This would cause a failure the first time the new cluster  
needs to use this value, because the pg_multixact/offsets/ file wouldn't  
exist or wouldn't be large enough.  To fix, ensure that the transient  
server instances launched by pg_upgrade extend the file as necessary.  
  
Per report from Jesse Denardo in  
CANiVXAj4c88YqipsyFQPboqMudnjcNTdB3pqe8ReXqAFQ=HXyA@mail.gmail.com  

M src/backend/access/transam/multixact.c
M src/backend/access/transam/slru.c
M src/include/access/slru.h

release notes: remove username from 9.3 major item

commit   : 1bc5935b67c77f27bf653089e757476cfb4245e1    
  
author   : Bruce Momjian <[email protected]>    
date     : Mon, 19 Aug 2013 12:26:22 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Mon, 19 Aug 2013 12:26:22 -0400    

Click here for diff

Etsuro Fujita  

M doc/src/sgml/release-9.3.sgml

Translation updates

commit   : a2f2e902b8e1b391c1f33ea7ac2b925355448ef3    
  
author   : Peter Eisentraut <[email protected]>    
date     : Sun, 18 Aug 2013 23:36:20 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Sun, 18 Aug 2013 23:36:20 -0400    

Click here for diff

M src/backend/po/de.po
M src/backend/po/fr.po
M src/backend/po/it.po
M src/backend/po/ja.po
M src/backend/po/pt_BR.po
M src/backend/po/ru.po
M src/bin/initdb/po/fr.po
M src/bin/initdb/po/ja.po
M src/bin/initdb/po/pt_BR.po
M src/bin/pg_basebackup/po/de.po
M src/bin/pg_basebackup/po/fr.po
M src/bin/pg_basebackup/po/ja.po
M src/bin/pg_basebackup/po/pt_BR.po
M src/bin/pg_config/po/fr.po
M src/bin/pg_config/po/ja.po
M src/bin/pg_controldata/po/fr.po
M src/bin/pg_controldata/po/ja.po
M src/bin/pg_controldata/po/pt_BR.po
M src/bin/pg_ctl/po/fr.po
M src/bin/pg_ctl/po/ja.po
M src/bin/pg_ctl/po/pt_BR.po
M src/bin/pg_dump/po/de.po
M src/bin/pg_dump/po/fr.po
M src/bin/pg_dump/po/it.po
M src/bin/pg_dump/po/ja.po
M src/bin/pg_dump/po/pt_BR.po
M src/bin/pg_dump/po/ru.po
M src/bin/pg_resetxlog/po/de.po
M src/bin/pg_resetxlog/po/fr.po
M src/bin/pg_resetxlog/po/it.po
M src/bin/pg_resetxlog/po/ja.po
M src/bin/pg_resetxlog/po/pt_BR.po
M src/bin/pg_resetxlog/po/ru.po
M src/bin/psql/po/fr.po
M src/bin/psql/po/ja.po
M src/bin/psql/po/pt_BR.po
M src/bin/scripts/po/de.po
M src/bin/scripts/po/fr.po
M src/bin/scripts/po/it.po
M src/bin/scripts/po/ja.po
M src/bin/scripts/po/pt_BR.po
M src/bin/scripts/po/ru.po
M src/interfaces/ecpg/preproc/po/ja.po
M src/interfaces/libpq/po/de.po
M src/interfaces/libpq/po/fr.po
M src/interfaces/libpq/po/it.po
M src/interfaces/libpq/po/ja.po
M src/interfaces/libpq/po/pt_BR.po
M src/interfaces/libpq/po/ru.po
M src/pl/plpgsql/src/po/fr.po
M src/pl/plpgsql/src/po/ja.po

Remove relcache entry invalidation in REFRESH MATERIALIZED VIEW.

commit   : 28154bb23b8f4a080c030b4f326e3a6fd351f9c8    
  
author   : Kevin Grittner <[email protected]>    
date     : Sun, 18 Aug 2013 16:19:22 -0500    
  
committer: Kevin Grittner <[email protected]>    
date     : Sun, 18 Aug 2013 16:19:22 -0500    

Click here for diff

This was added as part of the attempt to support unlogged matviews  
along with a populated status.  It got missed when unlogged  
support was removed pre-commit.  
  
Noticed by Noah Misch.  Back-patched to 9.3 branch.  

M src/backend/commands/matview.c

libpq: Report strerror on pthread_mutex_lock() failure

commit   : fe885c6e36667f2fbbf98d1f2f9657ee32acb1c1    
  
author   : Peter Eisentraut <[email protected]>    
date     : Sat, 17 Aug 2013 21:46:32 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Sat, 17 Aug 2013 21:46:32 -0400    

Click here for diff

M src/interfaces/libpq/fe-secure.c

Fix thinko in comment.

commit   : f1d5fce7cf11d596b2617a5696fd8eb5ebff2b33    
  
author   : Tom Lane <[email protected]>    
date     : Sat, 17 Aug 2013 20:36:29 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Sat, 17 Aug 2013 20:36:29 -0400    

Click here for diff

M src/backend/optimizer/util/restrictinfo.c

Fix planner problems with LATERAL references in PlaceHolderVars.

commit   : 9e7e29c75ad441450f9b8287bd51c13521641e3b    
  
author   : Tom Lane <[email protected]>    
date     : Sat, 17 Aug 2013 20:22:37 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Sat, 17 Aug 2013 20:22:37 -0400    

Click here for diff

The planner largely failed to consider the possibility that a  
PlaceHolderVar's expression might contain a lateral reference to a Var  
coming from somewhere outside the PHV's syntactic scope.  We had a previous  
report of a problem in this area, which I tried to fix in a quick-hack way  
in commit 4da6439bd8553059766011e2a42c6e39df08717f, but Antonin Houska  
pointed out that there were still some problems, and investigation turned  
up other issues.  This patch largely reverts that commit in favor of a more  
thoroughly thought-through solution.  The new theory is that a PHV's  
ph_eval_at level cannot be higher than its original syntactic level.  If it  
contains lateral references, those don't change the ph_eval_at level, but  
rather they create a lateral-reference requirement for the ph_eval_at join  
relation.  The code in joinpath.c needs to handle that.  
  
Another issue is that createplan.c wasn't handling nested PlaceHolderVars  
properly.  
  
In passing, push knowledge of lateral-reference checks for join clauses  
into join_clause_is_movable_to.  This is mainly so that FDWs don't need  
to deal with it.  
  
This patch doesn't fix the original join-qual-placement problem reported by  
Jeremy Evans (and indeed, one of the new regression test cases shows the  
wrong answer because of that).  But the PlaceHolderVar problems need to be  
fixed before that issue can be addressed, so committing this separately  
seems reasonable.  

M contrib/postgres_fdw/postgres_fdw.c
M src/backend/nodes/copyfuncs.c
M src/backend/nodes/equalfuncs.c
M src/backend/nodes/outfuncs.c
M src/backend/optimizer/README
M src/backend/optimizer/path/allpaths.c
M src/backend/optimizer/path/costsize.c
M src/backend/optimizer/path/indxpath.c
M src/backend/optimizer/path/joinpath.c
M src/backend/optimizer/path/joinrels.c
M src/backend/optimizer/path/orindxpath.c
M src/backend/optimizer/path/tidpath.c
M src/backend/optimizer/plan/analyzejoins.c
M src/backend/optimizer/plan/createplan.c
M src/backend/optimizer/plan/initsplan.c
M src/backend/optimizer/plan/planmain.c
M src/backend/optimizer/prep/prepjointree.c
M src/backend/optimizer/util/placeholder.c
M src/backend/optimizer/util/relnode.c
M src/backend/optimizer/util/restrictinfo.c
M src/backend/optimizer/util/var.c
M src/include/nodes/relation.h
M src/include/optimizer/restrictinfo.h
M src/test/regress/expected/join.out
M src/test/regress/sql/join.sql

release notes: update 9.3 major feature list

commit   : 175ec8de470fa5212797d672a2e5f1c79842a9ec    
  
author   : Bruce Momjian <[email protected]>    
date     : Fri, 16 Aug 2013 18:01:05 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Fri, 16 Aug 2013 18:01:05 -0400    

Click here for diff

Backpatch to 9.3.  

M doc/src/sgml/release-9.3.sgml

release notes: Update to 9.3 git current

commit   : e91f2bb3ee8bb1f4be5bbfe0e43815e47b49aa3f    
  
author   : Bruce Momjian <[email protected]>    
date     : Fri, 16 Aug 2013 16:54:18 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Fri, 16 Aug 2013 16:54:18 -0400    

Click here for diff

Backpatch to 9.3, of course.  

M doc/src/sgml/release-9.3.sgml

Move more bgworker code to bgworker.c; also, some renaming.

commit   : 2dee7998f93062e2ae7fcc9048ff170e528d1724    
  
author   : Robert Haas <[email protected]>    
date     : Fri, 16 Aug 2013 15:14:54 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Fri, 16 Aug 2013 15:14:54 -0400    

Click here for diff

Per discussion on pgsql-hackers.  
  
Michael Paquier, slightly modified by me.  Original suggestion  
from Amit Kapila.  

M src/backend/postmaster/bgworker.c
M src/backend/postmaster/postmaster.c
M src/include/postmaster/bgworker_internals.h

pg_upgrade: shut down server after auth failure

commit   : ac76ec27b933a4f0e1c6840ab1aaef770ed14395    
  
author   : Bruce Momjian <[email protected]>    
date     : Fri, 16 Aug 2013 11:09:09 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Fri, 16 Aug 2013 11:09:09 -0400    

Click here for diff

Register atexit() server shutdown if pg_ctl successfully started the  
server, but we can't connect to it.  
  
Backpatch to 9.3.  
  
Pavel Raiskup  

M contrib/pg_upgrade/server.c

Fix typo in comment.

commit   : 05cbce6f30b9037f035f76f5cdf45fca3e9dd012    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Fri, 16 Aug 2013 16:25:52 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Fri, 16 Aug 2013 16:25:52 +0300    

Click here for diff

M src/backend/libpq/auth.c

Don't allow ALTER MATERIALIZED VIEW ADD UNIQUE.

commit   : 3f78b1715c8c1d6655d169e6c8ac384c9a01ac60    
  
author   : Kevin Grittner <[email protected]>    
date     : Thu, 15 Aug 2013 13:14:48 -0500    
  
committer: Kevin Grittner <[email protected]>    
date     : Thu, 15 Aug 2013 13:14:48 -0500    

Click here for diff

Was accidentally allowed, but not documented and lacked support  
for rename or drop once created.  
  
Per report from Noah Misch.  

M src/backend/commands/tablecmds.c

Add tab completion for \dx in psql

commit   : 62e28b3e41353dd79802113b3e9f2a81246146f0    
  
author   : Magnus Hagander <[email protected]>    
date     : Thu, 15 Aug 2013 18:24:25 +0200    
  
committer: Magnus Hagander <[email protected]>    
date     : Thu, 15 Aug 2013 18:24:25 +0200    

Click here for diff

M src/bin/psql/tab-complete.c

Treat timeline IDs as unsigned in replication parser

commit   : 229fb58d4ff6fc4cd61fc5045edeb25f7fc4800e    
  
author   : Peter Eisentraut <[email protected]>    
date     : Wed, 14 Aug 2013 23:18:49 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Wed, 14 Aug 2013 23:18:49 -0400    

Click here for diff

Timeline IDs are unsigned ints everywhere, except the replication parser  
treated them as signed ints.  

M src/backend/replication/repl_gram.y
M src/backend/replication/repl_scanner.l

Improve error message when view is not updatable

commit   : 32f7c0ae1725031e8ed3620e06e94007a171d6d5    
  
author   : Peter Eisentraut <[email protected]>    
date     : Wed, 14 Aug 2013 23:00:34 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Wed, 14 Aug 2013 23:00:34 -0400    

Click here for diff

Avoid using the term "updatable" in confusing ways.  Suggest a trigger  
first, before a rule.  

M src/backend/executor/execMain.c
M src/backend/rewrite/rewriteHandler.c
M src/test/regress/expected/updatable_views.out

Remove ph_may_need from PlaceHolderInfo, with attendant simplifications.

commit   : 1b1d3d92c3ec1179c65756f60a1eb477793488ea    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 14 Aug 2013 18:38:32 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 14 Aug 2013 18:38:32 -0400    

Click here for diff

The planner logic that attempted to make a preliminary estimate of the  
ph_needed levels for PlaceHolderVars seems to be completely broken by  
lateral references.  Fortunately, the potential join order optimization  
that this code supported seems to be of relatively little value in  
practice; so let's just get rid of it rather than trying to fix it.  
  
Getting rid of this allows fairly substantial simplifications in  
placeholder.c, too, so planning in such cases should be a bit faster.  
  
Issue noted while pursuing bugs reported by Jeremy Evans and Antonin  
Houska, though this doesn't in itself fix either of their reported cases.  
What this does do is prevent an Assert crash in the kind of query  
illustrated by the added regression test.  (I'm not sure that the plan for  
that query is stable enough across platforms to be usable as a regression  
test output ... but we'll soon find out from the buildfarm.)  
  
Back-patch to 9.3.  The problem case can't arise without LATERAL, so  
no need to touch older branches.  

M src/backend/nodes/copyfuncs.c
M src/backend/nodes/equalfuncs.c
M src/backend/nodes/outfuncs.c
M src/backend/optimizer/plan/analyzejoins.c
M src/backend/optimizer/plan/initsplan.c
M src/backend/optimizer/util/placeholder.c
M src/include/nodes/relation.h
M src/include/optimizer/placeholder.h
M src/test/regress/expected/join.out
M src/test/regress/sql/join.sql

docs: document TRIM "comma" syntax

commit   : 5368a23eeb1f530d7c683b207074901c1a5417c4    
  
author   : Bruce Momjian <[email protected]>    
date     : Wed, 14 Aug 2013 17:26:36 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Wed, 14 Aug 2013 17:26:36 -0400    

Click here for diff

This syntax is supported by the parser, but is non-standard.  
  
_Not_ backpatched to 9.3 in case we change our minds.  

M doc/src/sgml/func.sgml

Remove Assert that matview is not in system schema from REFRESH.

commit   : e2cd368678e6bcf95d0f66c12e470d163b7a27b6    
  
author   : Kevin Grittner <[email protected]>    
date     : Wed, 14 Aug 2013 12:36:55 -0500    
  
committer: Kevin Grittner <[email protected]>    
date     : Wed, 14 Aug 2013 12:36:55 -0500    

Click here for diff

We don't want to prevent an extension which creates a matview from  
being installed in pg_catalog.  
  
Issue was raised by Hitoshi Harada.  
Backpatched to 9.3.  

M src/backend/commands/matview.c

Update Emacs configuration

commit   : 5e3e8e4daaefba47ad7a8b82320531992470b5df    
  
author   : Peter Eisentraut <[email protected]>    
date     : Tue, 13 Aug 2013 20:08:44 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Tue, 13 Aug 2013 20:08:44 -0400    

Click here for diff

Update emacs.samples with new configuration snippets that match pgindent  
et al. formatting more accurately and follow Emacs Lisp best practices  
better.  
  
Add .dir-locals.el with a subset of that configuration for casual  
editing and viewing.  
  
Reviewed-by: Dimitri Fontaine <[email protected]>  
Reviewed-by: Noah Misch <[email protected]>  

A .dir-locals.el
M src/tools/editors/emacs.samples

Emit a log message if output is about to be redirected away from stderr.

commit   : 3d5282c6f0edbdcb78dd2a6e8068f829fcb2882f    
  
author   : Tom Lane <[email protected]>    
date     : Tue, 13 Aug 2013 15:24:52 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Tue, 13 Aug 2013 15:24:52 -0400    

Click here for diff

We've seen multiple cases of people looking at the postmaster's original  
stderr output to try to diagnose problems, not realizing/remembering that  
their logging configuration is set up to send log messages somewhere else.  
This seems particularly likely to happen in prepackaged distributions,  
since many packagers patch the code to change the factory-standard logging  
configuration to something more in line with their platform conventions.  
  
In hopes of reducing confusion, emit a LOG message about this at the point  
in startup where we are about to switch log output away from the original  
stderr, providing a pointer to where to look instead.  This message will  
appear as the last thing in the original stderr output.  (We might later  
also try to emit such link messages when logging parameters are changed  
on-the-fly; but that case seems to be both noticeably harder to do nicely,  
and much less frequently a problem in practice.)  
  
Per discussion, back-patch to 9.3 but not further.  

M src/backend/postmaster/postmaster.c
M src/backend/postmaster/syslogger.c
M src/backend/utils/error/elog.c
M src/backend/utils/misc/guc.c
M src/include/utils/elog.h

9.3 release notes: move foreign table item

commit   : b52cd9d022fee0b653af7e586f2053abaf19f20b    
  
author   : Bruce Momjian <[email protected]>    
date     : Tue, 13 Aug 2013 12:49:24 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Tue, 13 Aug 2013 12:49:24 -0400    

Click here for diff

Move item about foreign data wrappers supporting inserts/updates/deletes  
to object manipulation.  
  
From Etsuro Fujita  

M doc/src/sgml/release-9.3.sgml

pg_dump: avoid schema qualification for ALTER ... OWNER

commit   : 808f8f5d6da5c79ed10bbe9f721215279a81d1eb    
  
author   : Bruce Momjian <[email protected]>    
date     : Tue, 13 Aug 2013 11:45:56 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Tue, 13 Aug 2013 11:45:56 -0400    

Click here for diff

We already use search_path to specify the schema, so there is no need  
for pg_dump to schema-qualify the name.  Also remove dead code.  

M src/bin/pg_dump/pg_backup_archiver.c

PL/Python: Adjust the regression tests for Python 3.3

commit   : 527ea66849c5cb02a3ebaef6c6c25d1b312a9521    
  
author   : Peter Eisentraut <[email protected]>    
date     : Sun, 11 Aug 2013 09:17:04 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Sun, 11 Aug 2013 09:17:04 -0400    

Click here for diff

Similar to 2cfb1c6f77734db81b6e74bcae630f93b94f69be, the order in which  
dictionary elements are printed is not reliable.  This reappeared in the  
tests of the string representation of result objects.  Reduce the test  
case to one result set column so that there is no question of order.  

M src/pl/plpython/expected/plpython_spi.out
M src/pl/plpython/sql/plpython_spi.sql

docs: mention Julian is midnight _UTC_ (Yes, there was no UTC back then, but we compute it that way.) Backpatch to 9.3.

commit   : f738156f516518b89d7ed20e357fc03b25184420    
  
author   : Bruce Momjian <[email protected]>    
date     : Fri, 9 Aug 2013 21:46:13 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Fri, 9 Aug 2013 21:46:13 -0400    

Click here for diff

M doc/src/sgml/func.sgml

Docs: Document to_*() Julian values are integers Backpatch to 9.3. Per request from Marc Dahn

commit   : 72039b1d8d476184b47d8023d059dda2ff307a93    
  
author   : Bruce Momjian <[email protected]>    
date     : Fri, 9 Aug 2013 19:25:51 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Fri, 9 Aug 2013 19:25:51 -0400    

Click here for diff

M doc/src/sgml/func.sgml

Document how auto_explain.log_timing can be changed.

commit   : 0e65755c08110c4f4d7f08914d4511028e13517d    
  
author   : Fujii Masao <[email protected]>    
date     : Fri, 9 Aug 2013 22:13:28 +0900    
  
committer: Fujii Masao <[email protected]>    
date     : Fri, 9 Aug 2013 22:13:28 +0900    

Click here for diff

M doc/src/sgml/auto-explain.sgml

Message punctuation and pluralization fixes

commit   : 072457b360ad550236d99a6ab1264e447248aba9    
  
author   : Peter Eisentraut <[email protected]>    
date     : Fri, 9 Aug 2013 07:59:53 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Fri, 9 Aug 2013 07:59:53 -0400    

Click here for diff

M src/backend/access/transam/multixact.c
M src/backend/access/transam/xlog.c
M src/backend/utils/adt/json.c
M src/backend/utils/adt/jsonfuncs.c
M src/test/regress/expected/json.out
M src/test/regress/expected/json_1.out

Message style improvements

commit   : 9d775d8894665ef0bb254a85005f9351545fac13    
  
author   : Peter Eisentraut <[email protected]>    
date     : Wed, 7 Aug 2013 22:48:40 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Wed, 7 Aug 2013 22:48:40 -0400    

Click here for diff

M src/backend/parser/parse_utilcmd.c
M src/backend/port/sysv_shmem.c
M src/backend/postmaster/bgworker.c
M src/backend/postmaster/postmaster.c
M src/backend/utils/adt/jsonfuncs.c
M src/backend/utils/misc/guc.c

Fix assertion failure by an immediate shutdown.

commit   : 91c3613d3748d881706c3e60d8221ea92833ac1a    
  
author   : Fujii Masao <[email protected]>    
date     : Thu, 8 Aug 2013 02:48:53 +0900    
  
committer: Fujii Masao <[email protected]>    
date     : Thu, 8 Aug 2013 02:48:53 +0900    

Click here for diff

In PM_WAIT_DEAD_END state, checkpointer process must be dead already.  
But an immediate shutdown could make postmaster's state machine  
transition to PM_WAIT_DEAD_END state even if checkpointer process is  
still running,  and which caused assertion failure. This bug was introduced  
in commit 457d6cf049c57cabe9b46ea13f26138040a214ec.  
  
This patch ensures that postmaster's state machine doesn't transition to  
PM_WAIT_DEAD_END state in an immediate shutdown while checkpointer  
process is running.  

M src/backend/postmaster/postmaster.c

pgtest: allow passing parameters, e.g. -s/--silent Previously only -n was recognized.

commit   : f347f26807862522309a2b15e332518df3e5e6f0    
  
author   : Bruce Momjian <[email protected]>    
date     : Mon, 5 Aug 2013 19:59:52 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Mon, 5 Aug 2013 19:59:52 -0400    

Click here for diff

M src/tools/pgtest

Simplify query_planner's API by having it return the top-level RelOptInfo.

commit   : 3ced8837db2cd602422bb36102cec73289691d40    
  
author   : Tom Lane <[email protected]>    
date     : Mon, 5 Aug 2013 15:00:57 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Mon, 5 Aug 2013 15:00:57 -0400    

Click here for diff

Formerly, query_planner returned one or possibly two Paths for the topmost  
join relation, so that grouping_planner didn't see the join RelOptInfo  
(at least not directly; it didn't have any hesitation about examining  
cheapest_path->parent, though).  However, correct selection of the Paths  
involved a significant amount of coupling between query_planner and  
grouping_planner, a problem which has gotten worse over time.  It seems  
best to give up on this API choice and instead return the topmost  
RelOptInfo explicitly.  Then grouping_planner can pull out the Paths it  
wants from the rel's path list.  In this way we can remove all knowledge  
of grouping behaviors from query_planner.  
  
The only real benefit of the old way is that in the case of an empty  
FROM clause, we never made any RelOptInfos at all, just a Path.  Now  
we have to gin up a dummy RelOptInfo to represent the empty FROM clause.  
That's not a very big deal though.  
  
While at it, simplify query_planner's API a bit more by having the caller  
set up root->tuple_fraction and root->limit_tuples, rather than passing  
those values as separate parameters.  Since query_planner no longer does  
anything with either value, requiring it to fill the PlannerInfo fields  
seemed pretty arbitrary.  
  
This patch just rearranges code; it doesn't (intentionally) change any  
behaviors.  Followup patches will do more interesting things.  

M src/backend/optimizer/README
M src/backend/optimizer/plan/planagg.c
M src/backend/optimizer/plan/planmain.c
M src/backend/optimizer/plan/planner.c
M src/backend/optimizer/prep/prepjointree.c
M src/backend/optimizer/util/relnode.c
M src/include/optimizer/pathnode.h
M src/include/optimizer/planmain.h

Various cleanups for REFRESH MATERIALIZED VIEW CONCURRENTLY.

commit   : 841c29c8b3be98ee30486ee245ebee782d4dedd4    
  
author   : Kevin Grittner <[email protected]>    
date     : Mon, 5 Aug 2013 09:57:56 -0500    
  
committer: Kevin Grittner <[email protected]>    
date     : Mon, 5 Aug 2013 09:57:56 -0500    

Click here for diff

Open and lock each index before checking definition in RMVC.  The  
ExclusiveLock on the related table is not viewed as sufficient to  
ensure that no changes are made to the index definition, and  
invalidation messages from other backends might have been missed.  
Additionally, use RelationGetIndexExpressions() and check for NIL  
rather than doing our own loop.  
  
Protect against redefinition of tid and rowvar operators in RMVC.  
While working on this, noticed that the fixes for bugs found during  
the CF made the UPDATE statement useless, since no rows could  
qualify for that treatment any more.  Ripping out code to support  
the UPDATE statement simplified the operator cleanups.  
  
Change slightly confusing local field name.  
  
Use meaningful alias names on queries in refresh_by_match_merge().  
  
Per concerns of raised by Andres Freund and comments and  
suggestions from Noah Misch.  Some additional issues remain, which  
will be addressed separately.  

M src/backend/commands/matview.c

Make sure float4in/float8in accept all standard spellings of "infinity".

commit   : 221e92f64c6e136e550ec2592aac3ae0d4623209    
  
author   : Tom Lane <[email protected]>    
date     : Sat, 3 Aug 2013 12:39:47 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Sat, 3 Aug 2013 12:39:47 -0400    

Click here for diff

The C99 and POSIX standards require strtod() to accept all these spellings  
(case-insensitively): "inf", "+inf", "-inf", "infinity", "+infinity",  
"-infinity".  However, pre-C99 systems might accept only some or none of  
these, and apparently Windows still doesn't accept "inf".  To avoid  
surprising cross-platform behavioral differences, manually check for each  
of these spellings if strtod() fails.  We were previously handling just  
"infinity" and "-infinity" that way, but since C99 is most of the world  
now, it seems likely that applications are expecting all these spellings  
to work.  
  
Per bug #8355 from Basil Peace.  It turns out this fix won't actually  
resolve his problem, because Python isn't being this careful; but that  
doesn't mean we shouldn't be.  

M src/backend/utils/adt/float.c

Fix old visibility bug in HeapTupleSatisfiesDirty

commit   : 706f9dd914c64a41e06b5fbfd62d6d6dab43eeb8    
  
author   : Alvaro Herrera <[email protected]>    
date     : Fri, 2 Aug 2013 14:34:56 -0400    
  
committer: Alvaro Herrera <[email protected]>    
date     : Fri, 2 Aug 2013 14:34:56 -0400    

Click here for diff

If a tuple is locked but not updated by a concurrent transaction,  
HeapTupleSatisfiesDirty would return that transaction's Xid in xmax,  
causing callers to wait on it, when it is not necessary (in fact, if the  
other transaction had used a multixact instead of a plain Xid to mark  
the tuple, HeapTupleSatisfiesDirty would have behave differently and  
*not* returned the Xmax).  
  
This bug was introduced in commit 3f7fbf85dc5b42, dated December 1998,  
so it's almost 15 years old now.  However, it's hard to see this  
misbehave, because before we had NOWAIT the only consequence of this is  
that transactions would wait for slightly more time than necessary; so  
it's not surprising that this hasn't been reported yet.  
  
Craig Ringer and Andres Freund  

M src/backend/utils/time/tqual.c

Fix crash in error report of invalid tuple lock

commit   : 88c556680ca3faa40f7428c7705455d744a9859e    
  
author   : Alvaro Herrera <[email protected]>    
date     : Fri, 2 Aug 2013 12:49:03 -0400    
  
committer: Alvaro Herrera <[email protected]>    
date     : Fri, 2 Aug 2013 12:49:03 -0400    

Click here for diff

My tweak of these error messages in commit c359a1b082 contained the  
thinko that a query would always have rowMarks set for a query  
containing a locking clause.  Not so: when declaring a cursor, for  
instance, rowMarks isn't set at the point we're checking, so we'd be  
dereferencing a NULL pointer.  
  
The fix is to pass the lock strength to the function raising the error,  
instead of trying to reverse-engineer it.  The result not only is more  
robust, but it also seems cleaner overall.  
  
Per report from Robert Haas.  

M src/backend/optimizer/plan/planner.c
M src/backend/parser/analyze.c
M src/include/parser/analyze.h
M src/test/regress/expected/matview.out
M src/test/regress/expected/portals.out
M src/test/regress/expected/union.out
M src/test/regress/sql/matview.sql
M src/test/regress/sql/portals.sql
M src/test/regress/sql/union.sql

Fix typo in comment.

commit   : 05ee328d66b700832cff61f59894ced7878fbfdb    
  
author   : Robert Haas <[email protected]>    
date     : Fri, 2 Aug 2013 09:15:42 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Fri, 2 Aug 2013 09:15:42 -0400    

Click here for diff

Etsuro Fujita  

M src/backend/storage/buffer/bufmgr.c

pg_test_fsync: expand ops/sec display Expand ops/sec by two digits to maintain alignment on servers with fast I/O subsystems, e.g. can now display < 10M ops/sec with consistent alignment.

commit   : 43f6388931fa71d7c2885fa54804c7cdff7d9f62    
  
author   : Bruce Momjian <[email protected]>    
date     : Fri, 2 Aug 2013 00:45:19 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Fri, 2 Aug 2013 00:45:19 -0400    

Click here for diff

M contrib/pg_test_fsync/pg_test_fsync.c

Improve handling of pthread_mutex_lock error case

commit   : 8359ed806f3300b79f110f1ac216c58c0732d05c    
  
author   : Stephen Frost <[email protected]>    
date     : Thu, 1 Aug 2013 15:42:07 -0400    
  
committer: Stephen Frost <[email protected]>    
date     : Thu, 1 Aug 2013 15:42:07 -0400    

Click here for diff

We should really be reporting a useful error along with returning  
a valid return code if pthread_mutex_lock() throws an error for  
some reason.  Add that and back-patch to 9.0 as the prior patch.  
  
Pointed out by Alvaro Herrera  

M src/interfaces/libpq/fe-secure.c

Improve comments for IncrementalMaintenance DML enabling functions.

commit   : f31c149f13e4495051e014bab6fbe5e8ec4f56f1    
  
author   : Kevin Grittner <[email protected]>    
date     : Thu, 1 Aug 2013 14:31:09 -0500    
  
committer: Kevin Grittner <[email protected]>    
date     : Thu, 1 Aug 2013 14:31:09 -0500    

Click here for diff

Move the static functions after the comment and expand the comment.  
  
Per complaint from Andres Freund, although using different comment  
text.  

M src/backend/commands/matview.c

commit   : 149e38e5ee02731d505946ced0f7bfc547c0e374    
  
author   : Robert Haas <[email protected]>    
date     : Thu, 1 Aug 2013 12:20:31 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Thu, 1 Aug 2013 12:20:31 -0400    

Click here for diff

Per gripes by Amit Kapila.  

M src/backend/postmaster/bgworker.c
M src/include/postmaster/bgworker.h

Remove SnapshotNow and HeapTupleSatisfiesNow.

commit   : 813fb0315587d32e3b77af1051a0ef517d187763    
  
author   : Robert Haas <[email protected]>    
date     : Thu, 1 Aug 2013 10:46:19 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Thu, 1 Aug 2013 10:46:19 -0400    

Click here for diff

We now use MVCC catalog scans, and, per discussion, have eliminated  
all other remaining uses of SnapshotNow, so that we can now get rid of  
it.  This will break third-party code which is still using it, which  
is intentional, as we want such code to be updated to do things the  
new way.  

M src/backend/catalog/index.c
M src/backend/catalog/pg_enum.c
M src/backend/commands/cluster.c
M src/backend/utils/time/tqual.c
M src/include/utils/tqual.h

Add locking around SSL_context usage in libpq

commit   : aad2a630b1b163038ea904e16a59e409020f5828    
  
author   : Stephen Frost <[email protected]>    
date     : Thu, 1 Aug 2013 01:15:45 -0400    
  
committer: Stephen Frost <[email protected]>    
date     : Thu, 1 Aug 2013 01:15:45 -0400    

Click here for diff

I've been working with Nick Phillips on an issue he ran into when  
trying to use threads with SSL client certificates.  As it turns out,  
the call in initialize_SSL() to SSL_CTX_use_certificate_chain_file()  
will modify our SSL_context without any protection from other threads  
also calling that function or being at some other point and trying to  
read from SSL_context.  
  
To protect against this, I've written up the attached (based on an  
initial patch from Nick and much subsequent discussion) which puts  
locks around SSL_CTX_use_certificate_chain_file() and all of the other  
users of SSL_context which weren't already protected.  
  
Nick Phillips, much reworked by Stephen Frost  
  
Back-patch to 9.0 where we started loading the cert directly instead of  
using a callback.  

M src/interfaces/libpq/fe-secure.c

Allow a context to be passed in for error handling

commit   : ddef1a39c6798ffae899acd08ff92329dd304085    
  
author   : Stephen Frost <[email protected]>    
date     : Thu, 1 Aug 2013 01:07:20 -0400    
  
committer: Stephen Frost <[email protected]>    
date     : Thu, 1 Aug 2013 01:07:20 -0400    

Click here for diff

As pointed out by Tom Lane, we can allow other users of the error  
handler callbacks to provide their own memory context by adding  
the context to use to ErrorData and using that instead of explicitly  
using ErrorContext.  
  
This then allows GetErrorContextStack() to be called from inside  
exception handlers, so modify plpgsql to take advantage of that and  
add an associated regression test for it.  

M src/backend/utils/error/elog.c
M src/include/utils/elog.h
M src/pl/plpgsql/src/pl_gram.y
M src/test/regress/expected/plpgsql.out
M src/test/regress/sql/plpgsql.sql

Fix mis-indented lines

commit   : a59516b6311a6c2acc89448c94913ebae598f02a    
  
author   : Alvaro Herrera <[email protected]>    
date     : Wed, 31 Jul 2013 17:57:15 -0400    
  
committer: Alvaro Herrera <[email protected]>    
date     : Wed, 31 Jul 2013 17:57:15 -0400    

Click here for diff

Per Coverity  

M src/backend/utils/misc/guc-file.l

Fix a couple of inconsequential typos in new header

commit   : 3142cf6dd5c0308633e36fabbd13bb51bdec1ff2    
  
author   : Alvaro Herrera <[email protected]>    
date     : Wed, 31 Jul 2013 17:57:00 -0400    
  
committer: Alvaro Herrera <[email protected]>    
date     : Wed, 31 Jul 2013 17:57:00 -0400    

Click here for diff

M src/include/postmaster/bgworker_internals.h

pg_dump/pg_dumpall: remove unnecessary SQL trailing semicolons Patch by Ian Lawrence Barwick

commit   : 8eb29194fc1711308804e8d4238a002a1cd35afe    
  
author   : Bruce Momjian <[email protected]>    
date     : Wed, 31 Jul 2013 11:37:17 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Wed, 31 Jul 2013 11:37:17 -0400    

Click here for diff

M src/bin/pg_dump/pg_dump.c
M src/bin/pg_dump/pg_dumpall.c

Fix regexp_matches() handling of zero-length matches.

commit   : d074b4e50d11768ab6da696b13d40ec05e4823fb    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 31 Jul 2013 11:31:22 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 31 Jul 2013 11:31:22 -0400    

Click here for diff

We'd find the same match twice if it was of zero length and not immediately  
adjacent to the previous match.  replace_text_regexp() got similar cases  
right, so adjust this search logic to match that.  Note that even though  
the regexp_split_to_xxx() functions share this code, they did not display  
equivalent misbehavior, because the second match would be considered  
degenerate and ignored.  
  
Jeevan Chalke, with some cosmetic changes by me.  

M src/backend/utils/adt/regexp.c
M src/backend/utils/adt/varlena.c
M src/test/regress/expected/strings.out
M src/test/regress/sql/strings.sql

Fix typo in comment.

commit   : c876fb42417739dbb19540ef61f6cd75752eb16e    
  
author   : Fujii Masao <[email protected]>    
date     : Wed, 31 Jul 2013 22:53:20 +0900    
  
committer: Fujii Masao <[email protected]>    
date     : Wed, 31 Jul 2013 22:53:20 +0900    

Click here for diff

Hitoshi Harada  

M src/backend/storage/ipc/sinvaladt.c

Fix inaccurate description of tablespace.

commit   : ee08a78a8104ce4e98ce67dc404b9d6ee3a1425a    
  
author   : Fujii Masao <[email protected]>    
date     : Wed, 31 Jul 2013 22:35:12 +0900    
  
committer: Fujii Masao <[email protected]>    
date     : Wed, 31 Jul 2013 22:35:12 +0900    

Click here for diff

Currently we don't need to update the pg_tablespace catalog  
after redefining the symbolic links to the tablespaces  
because pg_tablespace.spclocation column was removed in  
PostgreSQL 9.2.  
  
Back patch to 9.2 where pg_tablespace.spclocation was removed.  
  
Ian Barwick, with minor change by me.  

M doc/src/sgml/manage-ag.sgml

Restore REINDEX constraint validation.

commit   : 16f38f72ab2b8a3b2d45ba727d213bb31111cea4    
  
author   : Noah Misch <[email protected]>    
date     : Tue, 30 Jul 2013 18:36:52 -0400    
  
committer: Noah Misch <[email protected]>    
date     : Tue, 30 Jul 2013 18:36:52 -0400    

Click here for diff

Refactoring as part of commit 8ceb24568054232696dddc1166a8563bc78c900a  
had the unintended effect of making REINDEX TABLE and REINDEX DATABASE  
no longer validate constraints enforced by the indexes in question;  
REINDEX INDEX still did so.  Indexes marked invalid remained so, and  
constraint violations arising from data corruption went undetected.  
Back-patch to 9.0, like the causative commit.  

M src/backend/commands/indexcmds.c
M src/test/regress/expected/create_index.out
M src/test/regress/sql/create_index.sql

pg_upgrade: clarify C comment about Windows thread struct pointers Backpatch to 9.3 to keep source trees consistent.

commit   : 000b65fd2b9fa0880a255043f50f562b8e8287b0    
  
author   : Bruce Momjian <[email protected]>    
date     : Tue, 30 Jul 2013 09:23:31 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Tue, 30 Jul 2013 09:23:31 -0400    

Click here for diff

M contrib/pg_upgrade/parallel.c

Sync ECPG with WITH ORDINALITY changes

commit   : 69b7d59a744134e33bbe51dab44dd4113c83b7fb    
  
author   : Greg Stark <[email protected]>    
date     : Mon, 29 Jul 2013 23:43:44 +0100    
  
committer: Greg Stark <[email protected]>    
date     : Mon, 29 Jul 2013 23:43:44 +0100    

Click here for diff

M src/interfaces/ecpg/preproc/parse.pl
M src/interfaces/ecpg/preproc/parser.c
M src/interfaces/ecpg/test/expected/sql-parser.c
M src/interfaces/ecpg/test/expected/sql-parser.stderr
M src/interfaces/ecpg/test/sql/parser.pgc

Add SQL Standard WITH ORDINALITY support for UNNEST (and any other SRF)

commit   : c62736cc37f6812d1ebb41ea5a86ffe60564a1f0    
  
author   : Greg Stark <[email protected]>    
date     : Mon, 29 Jul 2013 16:38:01 +0100    
  
committer: Greg Stark <[email protected]>    
date     : Mon, 29 Jul 2013 16:38:01 +0100    

Click here for diff

Author: Andrew Gierth, David Fetter  
Reviewers: Dean Rasheed, Jeevan Chalke, Stephen Frost  

M doc/src/sgml/func.sgml
M doc/src/sgml/ref/select.sgml
M src/backend/access/common/tupdesc.c
M src/backend/executor/nodeFunctionscan.c
M src/backend/nodes/copyfuncs.c
M src/backend/nodes/equalfuncs.c
M src/backend/nodes/makefuncs.c
M src/backend/nodes/outfuncs.c
M src/backend/nodes/readfuncs.c
M src/backend/optimizer/plan/createplan.c
M src/backend/optimizer/util/clauses.c
M src/backend/parser/gram.y
M src/backend/parser/parse_relation.c
M src/backend/parser/parser.c
M src/backend/utils/adt/ruleutils.c
M src/include/access/tupdesc.h
M src/include/nodes/execnodes.h
M src/include/nodes/parsenodes.h
M src/include/nodes/plannodes.h
M src/include/parser/kwlist.h
M src/test/regress/expected/rangefuncs.out
M src/test/regress/sql/rangefuncs.sql

Fix contrib/cube and contrib/seg to build with bison 3.0.

commit   : 55cbfa5366b78d93cd1ff8c4c622b552985344f6    
  
author   : Tom Lane <[email protected]>    
date     : Mon, 29 Jul 2013 10:42:37 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Mon, 29 Jul 2013 10:42:37 -0400    

Click here for diff

These modules used the YYPARSE_PARAM macro, which has been deprecated  
by the bison folk since 1.875, and which they finally removed in 3.0.  
Adjust the code to use the replacement facility, %parse-param, which  
is a much better solution anyway since it allows specification of the  
type of the extra parser parameter.  We can thus get rid of a lot of  
unsightly casting.  
  
Back-patch to all active branches, since somebody might try to build  
a back branch with up-to-date tools.  

M contrib/cube/cube.c
M contrib/cube/cubeparse.y
M contrib/cube/cubescan.l
M contrib/seg/seg.c
M contrib/seg/segparse.y
M contrib/seg/segscan.l

Message style improvements

commit   : 626092a2e1784479b17810956b4654acf5b5ec11    
  
author   : Peter Eisentraut <[email protected]>    
date     : Sun, 28 Jul 2013 06:59:09 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Sun, 28 Jul 2013 06:59:09 -0400    

Click here for diff

M src/backend/access/transam/timeline.c
M src/backend/access/transam/xlog.c
M src/backend/replication/walreceiver.c
M src/backend/replication/walsender.c

pg_upgrade: fix -j race condition on Windows Pg_Upgrade cannot write the command string to the log file and then call system() to write to the same file without causing occasional file-share errors on Windows. So instead, write the command string to the log file after system(), in those cases. Backpatch to 9.3.

commit   : 815fcd050fbe18976c51af59116d60a6be5f3e41    
  
author   : Bruce Momjian <[email protected]>    
date     : Sat, 27 Jul 2013 15:00:58 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Sat, 27 Jul 2013 15:00:58 -0400    

Click here for diff

M contrib/pg_upgrade/exec.c

pg_upgrade docs: don't use cluster for binary/lib In a few cases, pg_upgrade said old/new cluster location when it meant old/new Postgres install location, so fix those. Per private email report

commit   : 5691de6c95836e0cef3a2fbb3ce61ce80ddecc69    
  
author   : Bruce Momjian <[email protected]>    
date     : Fri, 26 Jul 2013 13:52:01 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Fri, 26 Jul 2013 13:52:01 -0400    

Click here for diff

M doc/src/sgml/pgupgrade.sgml

Prevent leakage of SPI tuple tables during subtransaction abort.

commit   : 3d13623d75d3206c8f009353415043a191ebab39    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 25 Jul 2013 16:45:43 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 25 Jul 2013 16:45:43 -0400    

Click here for diff

plpgsql often just remembers SPI-result tuple tables in local variables,  
and has no mechanism for freeing them if an ereport(ERROR) causes an escape  
out of the execution function whose local variable it is.  In the original  
coding, that wasn't a problem because the tuple table would be cleaned up  
when the function's SPI context went away during transaction abort.  
However, once plpgsql grew the ability to trap exceptions, repeated  
trapping of errors within a function could result in significant  
intra-function-call memory leakage, as illustrated in bug #8279 from  
Chad Wagner.  
  
We could fix this locally in plpgsql with a bunch of PG_TRY/PG_CATCH  
coding, but that would be tedious, probably slow, and prone to bugs of  
omission; moreover it would do nothing for similar risks elsewhere.  
What seems like a better plan is to make SPI itself responsible for  
freeing tuple tables at subtransaction abort.  This patch attacks the  
problem that way, keeping a list of live tuple tables within each SPI  
function context.  Currently, such freeing is automatic for tuple tables  
made within the failed subtransaction.  We might later add a SPI call to  
mark a tuple table as not to be freed this way, allowing callers to opt  
out; but until someone exhibits a clear use-case for such behavior, it  
doesn't seem worth bothering.  
  
A very useful side-effect of this change is that SPI_freetuptable() can  
now defend itself against bad calls, such as duplicate free requests;  
this should make things more robust in many places.  (In particular,  
this reduces the risks involved if a third-party extension contains  
now-redundant SPI_freetuptable() calls in error cleanup code.)  
  
Even though the leakage problem is of long standing, it seems imprudent  
to back-patch this into stable branches, since it does represent an API  
semantics change for SPI users.  We'll patch this in 9.3, but live with  
the leakage in older branches.  

M doc/src/sgml/spi.sgml
M src/backend/executor/spi.c
M src/include/executor/spi.h
M src/include/executor/spi_priv.h
M src/pl/plpgsql/src/pl_exec.c
M src/pl/plpython/plpy_cursorobject.c
M src/pl/plpython/plpy_spi.c

pgstattuple: Doc update for previous commit.

commit   : fd27b999196959bd20d777a1010c786feb1586c2    
  
author   : Robert Haas <[email protected]>    
date     : Thu, 25 Jul 2013 16:36:49 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Thu, 25 Jul 2013 16:36:49 -0400    

Click here for diff

In my previous change to make pgstattuple use SnapshotDirty rather  
than SnapshotNow, I failed to notice that the documenation also  
needed to be updated to match.  Fix.  

M doc/src/sgml/pgstattuple.sgml

Change currtid functions to use an MVCC snapshot, not SnapshotNow.

commit   : ed93feb80891b131e9676e962256cc2b18aa5e78    
  
author   : Robert Haas <[email protected]>    
date     : Thu, 25 Jul 2013 16:32:02 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Thu, 25 Jul 2013 16:32:02 -0400    

Click here for diff

This has a slight performance cost, but the only known consumers  
of these functions, known at the SQL level as currtid and currtid2,  
is pgsql-odbc; whose usage, we hope, is not sufficiently intensive  
to make this a problem.  
  
Per discussion.  

M src/backend/utils/adt/tid.c

pgstattuple: Use SnapshotDirty, not SnapshotNow.

commit   : 80c79ab2a8d63bc6c83269b29c1ba993c8077d3a    
  
author   : Robert Haas <[email protected]>    
date     : Thu, 25 Jul 2013 16:16:42 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Thu, 25 Jul 2013 16:16:42 -0400    

Click here for diff

Tuples belonging to uncommitted transactions should not be  
counted as dead.  
  
This is arguably a bug fix that should be back-patched, but  
as no one ever noticed until it came time to try to get rid  
of SnapshotNow, I'm only doing this in master for now.  

M contrib/pgstattuple/pgstattuple.c

Don't use SnapshotNow in get_actual_variable_range.

commit   : 3483f4332de73e038db64be0614219b64fd3c971    
  
author   : Robert Haas <[email protected]>    
date     : Thu, 25 Jul 2013 14:30:00 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Thu, 25 Jul 2013 14:30:00 -0400    

Click here for diff

Instead, use the active snapshot.  Per Tom Lane, this function is  
most interested in knowing the range of tuples our scan will actually  
see.  
  
This is another step towards full removal of SnapshotNow.  

M src/backend/utils/adt/selfuncs.c

Fix configure probe for sys/ucred.h.

commit   : 1b09630fce1dfd4116eaaf154766a8a435168193    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 25 Jul 2013 11:39:08 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 25 Jul 2013 11:39:08 -0400    

Click here for diff

The configure script's test for <sys/ucred.h> did not work on OpenBSD,  
because on that platform <sys/param.h> has to be included first.  
As a result, socket peer authentication was disabled on that platform.  
Problem introduced in commit be4585b1c27ac5dbdd0d61740d18f7ad9a00e268.  
  
Andres Freund, slightly simplified by me.  

M configure
M configure.in

pg_upgrade: adjust umask() calls Since pg_upgrade -j on Windows uses threads, calling umask() before/after opening a file via fopen_priv() is no longer possible, so set umask() as we enter the thread-creating loop, and reset it on exit. Also adjust internal fopen_priv() calls to just use fopen(). Backpatch to 9.3beta.

commit   : 76a7650c40efeeb35be7a60f27ce151ad4e473a2    
  
author   : Bruce Momjian <[email protected]>    
date     : Thu, 25 Jul 2013 11:33:15 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Thu, 25 Jul 2013 11:33:15 -0400    

Click here for diff

M contrib/pg_upgrade/dump.c
M contrib/pg_upgrade/exec.c

Improvements to GetErrorContextStack()

commit   : 9bd0feeba85fae411e01798d5a5d76b70333e38e    
  
author   : Stephen Frost <[email protected]>    
date     : Thu, 25 Jul 2013 09:41:55 -0400    
  
committer: Stephen Frost <[email protected]>    
date     : Thu, 25 Jul 2013 09:41:55 -0400    

Click here for diff

As GetErrorContextStack() borrowed setup and tear-down code from other  
places, it was less than clear that it must only be called as a  
top-level entry point into the error system and can't be called by an  
exception handler (unlike the rest of the error system, which is set up  
to be reentrant-safe).  
  
Being called from an exception handler is outside the charter of  
GetErrorContextStack(), so add a bit more protection against it,  
improve the comments addressing why we have to set up an errordata  
stack for this function at all, and add a few more regression tests.  
  
Lack of clarity pointed out by Tom Lane; all bugs are mine.  

M src/backend/utils/error/elog.c
M src/test/regress/expected/plpgsql.out
M src/test/regress/sql/plpgsql.sql

pg_upgrade: fix initialization of thread argument Reorder initialization of thread argument marker to it happens before reap_child() is called. Backpatch to 9.3.

commit   : e4c6cccd8cbb96e0f64d81bde2136041492d4312    
  
author   : Bruce Momjian <[email protected]>    
date     : Wed, 24 Jul 2013 22:01:14 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Wed, 24 Jul 2013 22:01:14 -0400    

Click here for diff

M contrib/pg_upgrade/parallel.c

Add GET DIAGNOSTICS ... PG_CONTEXT in PL/PgSQL

commit   : 831283256796d1c20858862b568d73e505eb4a84    
  
author   : Stephen Frost <[email protected]>    
date     : Wed, 24 Jul 2013 18:53:27 -0400    
  
committer: Stephen Frost <[email protected]>    
date     : Wed, 24 Jul 2013 18:53:27 -0400    

Click here for diff

This adds the ability to get the call stack as a string from within a  
PL/PgSQL function, which can be handy for logging to a table, or to  
include in a useful message to an end-user.  
  
Pavel Stehule, reviewed by Rushabh Lathia and rather heavily whacked  
around by Stephen Frost.  

M doc/src/sgml/plpgsql.sgml
M src/backend/utils/error/elog.c
M src/include/utils/elog.h
M src/pl/plpgsql/src/pl_exec.c
M src/pl/plpgsql/src/pl_funcs.c
M src/pl/plpgsql/src/pl_gram.y
M src/pl/plpgsql/src/pl_scanner.c
M src/pl/plpgsql/src/plpgsql.h
M src/test/regress/expected/plpgsql.out
M src/test/regress/sql/plpgsql.sql

Improve ilist.h's support for deletion of slist elements during iteration.

commit   : fa2fad3c06bfde03594ff38d53acdf9a60c56bb2    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 24 Jul 2013 17:41:55 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 24 Jul 2013 17:41:55 -0400    

Click here for diff

Previously one had to use slist_delete(), implying an additional scan of  
the list, making this infrastructure considerably less efficient than  
traditional Lists when deletion of element(s) in a long list is needed.  
Modify the slist_foreach_modify() macro to support deleting the current  
element in O(1) time, by keeping a "prev" pointer in addition to "cur"  
and "next".  Although this makes iteration with this macro a bit slower,  
no real harm is done, since in any scenario where you're not going to  
delete the current list element you might as well just use slist_foreach  
instead.  Improve the comments about when to use each macro.  
  
Back-patch to 9.3 so that we'll have consistent semantics in all branches  
that provide ilist.h.  Note this is an ABI break for callers of  
slist_foreach_modify().  
  
Andres Freund and Tom Lane  

M src/backend/lib/ilist.c
M src/backend/postmaster/bgworker.c
M src/backend/postmaster/pgstat.c
M src/backend/postmaster/postmaster.c
M src/include/lib/ilist.h
M src/include/postmaster/bgworker_internals.h

pg_upgrade: more Windows parallel/-j fixes More fixes to handle Windows thread parameter passing. Backpatch to 9.3 beta. Patch originally from Andrew Dunstan

commit   : 910d3a458c15c1b4cc518ba480be2f712f42f179    
  
author   : Bruce Momjian <[email protected]>    
date     : Wed, 24 Jul 2013 13:15:47 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Wed, 24 Jul 2013 13:15:47 -0400    

Click here for diff

M contrib/pg_upgrade/parallel.c
M contrib/pg_upgrade/test.sh

commit   : d7de6a4790a8e2d61e985b7273557ee8fb7ffbc0    
  
author   : Bruce Momjian <[email protected]>    
date     : Wed, 24 Jul 2013 10:00:37 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Wed, 24 Jul 2013 10:00:37 -0400    

Click here for diff

M contrib/pg_upgrade/parallel.c

Fix booltestsel() for case where we have NULL stats but not MCV stats.

commit   : b32a25c3d5292c800c0468097b9a63e931a0af0f    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 24 Jul 2013 00:44:09 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 24 Jul 2013 00:44:09 -0400    

Click here for diff

In a boolean column that contains mostly nulls, ANALYZE might not find  
enough non-null values to populate the most-common-values stats,  
but it would still create a pg_statistic entry with stanullfrac set.  
The logic in booltestsel() for this situation did the wrong thing for  
"col IS NOT TRUE" and "col IS NOT FALSE" tests, forgetting that null  
values would satisfy these tests (so that the true selectivity would  
be close to one, not close to zero).  Per bug #8274.  
  
Fix by Andrew Gierth, some comment-smithing by me.  

M src/backend/utils/adt/selfuncs.c

Move strip_implicit_coercions() from optimizer to nodeFuncs.c.

commit   : 10a509d82956dee14eb2011bd266cd3c728ae188    
  
author   : Tom Lane <[email protected]>    
date     : Tue, 23 Jul 2013 18:21:19 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Tue, 23 Jul 2013 18:21:19 -0400    

Click here for diff

Use of this function has spread into the parser and rewriter, so it seems  
like time to pull it out of the optimizer and put it into the more central  
nodeFuncs module.  This eliminates the need to #include optimizer/clauses.h  
in most of the calling files, demonstrating that this function was indeed a  
bit outside the normal code reference patterns.  

M src/backend/nodes/nodeFuncs.c
M src/backend/optimizer/util/clauses.c
M src/backend/parser/parse_clause.c
M src/backend/parser/parse_relation.c
M src/backend/rewrite/rewriteHandler.c
M src/backend/utils/adt/ruleutils.c
M src/include/nodes/nodeFuncs.h
M src/include/optimizer/clauses.h

Further hacking on ruleutils' new column-alias-assignment code.

commit   : ef655663c5069231e054c3514c3ee9b15b8a4f13    
  
author   : Tom Lane <[email protected]>    
date     : Tue, 23 Jul 2013 17:54:18 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Tue, 23 Jul 2013 17:54:18 -0400    

Click here for diff

After further thought about implicit coercions appearing in a joinaliasvars  
list, I realized that they represent an additional reason why we might need  
to reference the join output column directly instead of referencing an  
underlying column.  Consider SELECT x FROM t1 LEFT JOIN t2 USING (x) where  
t1.x is of type date while t2.x is of type timestamptz.  The merged output  
variable is of type timestamptz, but it won't go to null when t2 does,  
therefore neither t1.x nor t2.x is a valid substitute reference.  
  
The code in get_variable() actually gets this case right, since it knows  
it shouldn't look through a coercion, but we failed to ensure that the  
unqualified output column name would be globally unique.  To fix, modify  
the code that trawls for a dangerous situation so that it actually scans  
through an unnamed join's joinaliasvars list to see if there are any  
non-simple-Var entries.  

M src/backend/utils/adt/ruleutils.c
M src/test/regress/expected/create_view.out
M src/test/regress/sql/create_view.sql

Check for NULL result from strdup

commit   : bb686c9a865dc15a704e6a96367b3d7bfe79df6f    
  
author   : Alvaro Herrera <[email protected]>    
date     : Tue, 23 Jul 2013 17:23:28 -0400    
  
committer: Alvaro Herrera <[email protected]>    
date     : Tue, 23 Jul 2013 17:23:28 -0400    

Click here for diff

Per Coverity Scan  

M src/interfaces/libpq/fe-secure.c

Change post-rewriter representation of dropped columns in joinaliasvars.

commit   : a7cd853b75d01666135ca87353cee83b99d06b9b    
  
author   : Tom Lane <[email protected]>    
date     : Tue, 23 Jul 2013 16:23:01 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Tue, 23 Jul 2013 16:23:01 -0400    

Click here for diff

It's possible to drop a column from an input table of a JOIN clause in a  
view, if that column is nowhere actually referenced in the view.  But it  
will still be there in the JOIN clause's joinaliasvars list.  We used to  
replace such entries with NULL Const nodes, which is handy for generation  
of RowExpr expansion of a whole-row reference to the view.  The trouble  
with that is that it can't be distinguished from the situation after  
subquery pull-up of a constant subquery output expression below the JOIN.  
Instead, replace such joinaliasvars with null pointers (empty expression  
trees), which can't be confused with pulled-up expressions.  expandRTE()  
still emits the old convention, though, for convenience of RowExpr  
generation and to reduce the risk of breaking extension code.  
  
In HEAD and 9.3, this patch also fixes a problem with some new code in  
ruleutils.c that was failing to cope with implicitly-casted joinaliasvars  
entries, as per recent report from Feike Steenbergen.  That oversight was  
because of an inadequate description of the data structure in parsenodes.h,  
which I've now corrected.  There were some pre-existing oversights of the  
same ilk elsewhere, which I believe are now all fixed.  

M src/backend/optimizer/util/var.c
M src/backend/parser/parse_relation.c
M src/backend/parser/parse_target.c
M src/backend/rewrite/rewriteHandler.c
M src/backend/utils/adt/ruleutils.c
M src/include/nodes/parsenodes.h
M src/test/regress/expected/create_view.out
M src/test/regress/sql/create_view.sql

Tweak FOR UPDATE/SHARE error message wording (again)

commit   : c359a1b0823f798fc419adea5da7991845c915aa    
  
author   : Alvaro Herrera <[email protected]>    
date     : Tue, 23 Jul 2013 14:03:09 -0400    
  
committer: Alvaro Herrera <[email protected]>    
date     : Tue, 23 Jul 2013 14:03:09 -0400    

Click here for diff

In commit 0ac5ad5134 I changed some error messages from "FOR  
UPDATE/SHARE" to a rather long gobbledygook which nobody liked.  Then,  
in commit cb9b66d31 I changed them again, but the alternative chosen  
there was deemed suboptimal by Peter Eisentraut, who in message  
[email protected] proposed an alternative  
involving a dynamically-constructed string based on the actual locking  
strength specified in the SQL command.  This patch implements that  
suggestion.  

M src/backend/optimizer/plan/initsplan.c
M src/backend/optimizer/plan/planner.c
M src/backend/parser/analyze.c
M src/include/parser/analyze.h

Use InvalidSnapshot, now SnapshotNow, as the default snapshot.

commit   : 765ad89be36f699e2d65238c1f0458a1ab7e4d8b    
  
author   : Robert Haas <[email protected]>    
date     : Tue, 23 Jul 2013 10:58:32 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Tue, 23 Jul 2013 10:58:32 -0400    

Click here for diff

As far as I can determine, there's no code in the core distribution  
that fails to explicitly set the snapshot of a scan or executor  
state.  If there is any such code, this will probably cause it to  
seg fault; friendlier suggestions were discussed on pgsql-hackers,  
but there was no consensus that anything more than this was  
needed.  
  
This is another step towards the hoped-for complete removal of  
SnapshotNow.  

M src/backend/access/index/genam.c
M src/backend/executor/execUtils.c

Additional regression tests for ALTER OPERATOR FAMILY.

commit   : e6055061c524698918ab0b7a0c51b822c03ef1fa    
  
author   : Robert Haas <[email protected]>    
date     : Tue, 23 Jul 2013 08:53:21 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Tue, 23 Jul 2013 08:53:21 -0400    

Click here for diff

Robins Tharakan, reviewed by Szymon Guz  

M src/test/regress/expected/alter_generic.out
M src/test/regress/sql/alter_generic.sql

ecpg: Move function prototype into header file

commit   : 9feeef92fb9b73371e3f299ba444f86b4ef7e26f    
  
author   : Peter Eisentraut <[email protected]>    
date     : Mon, 22 Jul 2013 21:02:56 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Mon, 22 Jul 2013 21:02:56 -0400    

Click here for diff

PGTYPEStimestamp_defmt_scan() was declared twice inside different .c  
files, with slightly different prototypes.  Move it into a header file  
and correct the prototype.  

M src/interfaces/ecpg/pgtypeslib/dt.h
M src/interfaces/ecpg/pgtypeslib/dt_common.c
M src/interfaces/ecpg/pgtypeslib/timestamp.c

doc: Remove tab from SGML file

commit   : 2f1fa75a0c9327f1202b80c78ece1d33534bfd10    
  
author   : Peter Eisentraut <[email protected]>    
date     : Mon, 22 Jul 2013 21:02:12 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Mon, 22 Jul 2013 21:02:12 -0400    

Click here for diff

M doc/src/sgml/func.sgml

Add --rate option.

commit   : fc9f4e9f8c981bbc050e5566cf558112c938da2c    
  
author   : Tatsuo Ishii <[email protected]>    
date     : Tue, 23 Jul 2013 08:40:22 +0900    
  
committer: Tatsuo Ishii <[email protected]>    
date     : Tue, 23 Jul 2013 08:40:22 +0900    

Click here for diff

This controls the target transaction rate to certain tps, rather than  
maximum. Patch contributed by Fabien COELHO, reviewed by Greg Smith,  
and slight editing by me.  

M contrib/pgbench/pgbench.c
M doc/src/sgml/pgbench.sgml

Fix cache flush hazard in ExecRefreshMatView.

commit   : 21e28e4531e761e7cdf1b9a0bbf0c06f6107686a    
  
author   : Robert Haas <[email protected]>    
date     : Mon, 22 Jul 2013 18:10:05 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Mon, 22 Jul 2013 18:10:05 -0400    

Click here for diff

Andres Freund  

M src/backend/commands/matview.c

pgrowlocks: Use GetActiveSnapshot() rather than SnapshotNow.

commit   : 2e44770fa39051f404f7d94fed557b359b1dba3c    
  
author   : Robert Haas <[email protected]>    
date     : Mon, 22 Jul 2013 16:01:17 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Mon, 22 Jul 2013 16:01:17 -0400    

Click here for diff

Per discussion, it's desirable to eliminate all remaining uses of  
SnapshotNow, because it has unpleasant semantics: race conditions  
can result in seeing multiple versions of a concurrently updated  
row, or none at all.  By using GetActiveSnapshot() here, callers  
will see exactly those rows that would have been visible if the  
invoking query had scanned the table using, for example, a SELECT  
statement.  
  
This is slightly different from the old behavior, because commits  
that happen concurrently with the scan will not affect the results.  
In REPEATABLE READ or SERIALIZABLE modes, where transaction  
snapshots are used, commits that have happened since the start of  
the transaction will also not affect the results.  It is hoped  
that this minor incompatibility will be thought an improvement,  
or at least no worse than what we did before.  

M contrib/pgrowlocks/pgrowlocks.c

Remove bgw_sighup and bgw_sigterm.

commit   : f40a318eeaed0c66fcb2ddd442006e54bf49c634    
  
author   : Robert Haas <[email protected]>    
date     : Mon, 22 Jul 2013 14:13:00 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Mon, 22 Jul 2013 14:13:00 -0400    

Click here for diff

Per discussion on pgsql-hackers, these aren't really needed.  Interim  
versions of the background worker patch had the worker starting with  
signals already unblocked, which would have made this necessary.  
But the final version does not, so we don't really need it; and it  
doesn't work well with the new facility for starting dynamic background  
workers, so just rip it out.  
  
Also per discussion on pgsql-hackers, back-patch this change to 9.3.  
It's best to get the API break out of the way before we do an  
official release of this facility, to avoid more pain for extension  
authors later.  

M contrib/worker_spi/worker_spi.c
M doc/src/sgml/bgworker.sgml
M src/backend/postmaster/bgworker.c
M src/backend/postmaster/postmaster.c
M src/include/postmaster/bgworker.h

Adjust HeapTupleSatisfies* routines to take a HeapTuple.

commit   : 0518eceec3a1cc2b71da04e839f05f555fdd8567    
  
author   : Robert Haas <[email protected]>    
date     : Mon, 22 Jul 2013 13:26:33 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Mon, 22 Jul 2013 13:26:33 -0400    

Click here for diff

Previously, these functions took a HeapTupleHeader, but upcoming  
patches for logical replication will introduce new a new snapshot  
type under which the tuple's TID will be used to lookup (CMIN, CMAX)  
for visibility determination purposes.  This makes that information  
available.  Code churn is minimal since HeapTupleSatisfiesVisibility  
took the HeapTuple anyway, and deferenced it before calling the  
satisfies function.  
  
Independently of logical replication, this allows t_tableOid and  
t_self to be cross-checked via assertions in tqual.c.  This seems  
like a useful way to make sure that all callers are setting these  
values properly, which has been previously put forward as  
desirable.  
  
Andres Freund, reviewed by Álvaro Herrera  

M contrib/pgrowlocks/pgrowlocks.c
M src/backend/access/heap/heapam.c
M src/backend/access/heap/pruneheap.c
M src/backend/catalog/index.c
M src/backend/commands/analyze.c
M src/backend/commands/cluster.c
M src/backend/commands/vacuumlazy.c
M src/backend/executor/nodeBitmapHeapscan.c
M src/backend/storage/lmgr/predicate.c
M src/backend/utils/time/tqual.c
M src/include/utils/snapshot.h
M src/include/utils/tqual.h

Silence compiler warning on an unused variable

commit   : 0aeb5ae2041520f02cabbc7083aec46733689bce    
  
author   : Alvaro Herrera <[email protected]>    
date     : Mon, 22 Jul 2013 13:15:13 -0400    
  
committer: Alvaro Herrera <[email protected]>    
date     : Mon, 22 Jul 2013 13:15:13 -0400    

Click here for diff

Also, tweak wording in comments (per Andres) and documentation (myself)  
to point out that it's the database's default tablespace that can be  
passed as 0, not DEFAULTTABLESPACE_OID.  Robert Haas noticed the bug in  
the code, but didn't update the accompanying prose.  

M doc/src/sgml/func.sgml
M src/backend/utils/adt/dbsize.c
M src/backend/utils/cache/relfilenodemap.c

Add infrastructure for mapping relfilenodes to relation OIDs.

commit   : f01d1ae3a104019d6d68aeff85c4816a275130b3    
  
author   : Robert Haas <[email protected]>    
date     : Mon, 22 Jul 2013 10:34:34 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Mon, 22 Jul 2013 10:34:34 -0400    

Click here for diff

Future patches are expected to introduce logical replication that  
works by decoding WAL.  WAL contains relfilenodes rather than relation  
OIDs, so this infrastructure will be needed to find the relation OID  
based on WAL contents.  
  
If logical replication does not make it into this release, we probably  
should consider reverting this, since it will add some overhead to DDL  
operations that create new relations.  One additional index insert per  
pg_class row is not a large overhead, but it's more than zero.  
Another way of meeting the needs of logical replication would be to  
the relation OID to WAL, but that would burden DML operations, not  
only DDL.  
  
Andres Freund, with some changes by me.  Design review, in earlier  
versions, by Álvaro Herrera.  

M doc/src/sgml/func.sgml
M src/backend/utils/adt/dbsize.c
M src/backend/utils/cache/Makefile
M src/backend/utils/cache/inval.c
A src/backend/utils/cache/relfilenodemap.c
M src/backend/utils/cache/relmapper.c
M src/include/catalog/catversion.h
M src/include/catalog/indexing.h
M src/include/catalog/pg_proc.h
M src/include/utils/builtins.h
A src/include/utils/relfilenodemap.h
M src/include/utils/relmapper.h
M src/test/regress/expected/alter_table.out
M src/test/regress/sql/alter_table.sql

Fix error handling in PLy_spi_execute_fetch_result().

commit   : b3b10c39038c20457ef058c7f4e5589c28a84f1c    
  
author   : Tom Lane <[email protected]>    
date     : Sat, 20 Jul 2013 12:44:37 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Sat, 20 Jul 2013 12:44:37 -0400    

Click here for diff

If an error is thrown out of the datatype I/O functions called by this  
function, we need to do subtransaction cleanup, which the previous coding  
entirely failed to do.  Fortunately, both existing callers of this function  
already have proper cleanup logic, so re-throwing the exception is enough.  
  
Also, postpone creation of the resultset tupdesc until after the I/O  
conversions are complete, so that we won't leak memory in TopMemoryContext  
when such an error happens.  

M src/pl/plpython/plpy_spi.c

Clean up new JSON API typedefs

commit   : ff41a5de0995f01a98b6fbc3a0c774b9a53e609a    
  
author   : Peter Eisentraut <[email protected]>    
date     : Sat, 20 Jul 2013 06:38:31 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Sat, 20 Jul 2013 06:38:31 -0400    

Click here for diff

The new JSON API uses a bit of an unusual typedef scheme, where for  
example OkeysState is a pointer to okeysState.  And that's not applied  
consistently either.  Change that to the more usual PostgreSQL style  
where struct typedefs are upper case, and use pointers explicitly.  

M src/backend/utils/adt/json.c
M src/backend/utils/adt/jsonfuncs.c
M src/include/utils/jsonapi.h

Fix HeapTupleSatisfiesVacuum on aborted updater xacts

commit   : 6737aa72ba7621d4db8e09210c65eecafc42b616    
  
author   : Alvaro Herrera <[email protected]>    
date     : Fri, 19 Jul 2013 18:35:07 -0400    
  
committer: Alvaro Herrera <[email protected]>    
date     : Fri, 19 Jul 2013 18:35:07 -0400    

Click here for diff

By using only the macro that checks infomask bits  
HEAP_XMAX_IS_LOCKED_ONLY to verify whether a multixact is not an  
updater, and not the full HeapTupleHeaderIsOnlyLocked, it would come to  
the wrong result in case of a multixact containing an aborted update;  
therefore returning the wrong result code.  This would cause predicate.c  
to break completely (as in bug report #8273 from David Leverton), and  
certain index builds would misbehave.  As far as I can tell, other  
callers of the bogus routine would make harmless mistakes or not be  
affected by the difference at all; so this was a pretty narrow case.  
  
Also, no other user of the HEAP_XMAX_IS_LOCKED_ONLY macro is as  
careless; they all check specifically for the HEAP_XMAX_IS_MULTI case,  
and they all verify whether the updater is InvalidXid before concluding  
that it's a valid updater.  So there doesn't seem to be any similar bug.  

M src/backend/utils/time/tqual.c

doc: Fix typos in conversion names.

commit   : c8fb821afc2ce37b48b678251480b52e6b116868    
  
author   : Robert Haas <[email protected]>    
date     : Fri, 19 Jul 2013 10:23:12 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Fri, 19 Jul 2013 10:23:12 -0400    

Click here for diff

David Christensen  

M doc/src/sgml/func.sgml

Initialize day of year value.

commit   : a2c1c3308f33a293152e65bbc0d25e7976dde23d    
  
author   : Michael Meskes <[email protected]>    
date     : Fri, 19 Jul 2013 08:59:20 +0200    
  
committer: Michael Meskes <[email protected]>    
date     : Fri, 19 Jul 2013 08:59:20 +0200    

Click here for diff

There are cases where the day of year value in struct tm is used, but it never  
got calculated. Problem found by Coverity scan.  

M src/interfaces/ecpg/pgtypeslib/timestamp.c
M src/interfaces/ecpg/test/expected/pgtypeslib-dt_test.c
M src/interfaces/ecpg/test/expected/pgtypeslib-dt_test.stderr
M src/interfaces/ecpg/test/expected/pgtypeslib-dt_test.stdout
M src/interfaces/ecpg/test/pgtypeslib/dt_test.pgc

Add checks for valid multibyte character length in UtfToLocal, LocalToUtf.

commit   : d9f37e6661ec654f7252bfc23e084c9e2ca5db14    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 18 Jul 2013 21:55:38 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 18 Jul 2013 21:55:38 -0400    

Click here for diff

This is mainly to suppress "uninitialized variable" warnings from very  
recent versions of gcc.  But it seems like a good robustness thing anyway,  
not to mention that we might someday decide to support 6-byte UTF8.  
  
Per report from Karol Trzcionka.  No back-patch since there's no reason  
at the moment to think this is more than cosmetic.  

M src/backend/utils/mb/conv.c

Fix regex match failures for backrefs combined with non-greedy quantifiers.

commit   : e2bd904955e2221eddf01110b1f25002de2aaa83    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 18 Jul 2013 21:22:37 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 18 Jul 2013 21:22:37 -0400    

Click here for diff

An ancient logic error in cfindloop() could cause the regex engine to fail  
to find matches that begin later than the start of the string.  This  
function is only used when the regex pattern contains a back reference,  
and so far as we can tell the error is only reachable if the pattern is  
non-greedy (i.e. its first quantifier uses the ? modifier).  Furthermore,  
the actual match must begin after some potential match that satisfies the  
DFA but then fails the back-reference's match test.  
  
Reported and fixed by Jeevan Chalke, with cosmetic adjustments by me.  

M src/backend/regex/regexec.c
M src/test/regress/expected/regex.out
M src/test/regress/sql/regex.sql

WITH CHECK OPTION support for auto-updatable VIEWs

commit   : 4cbe3ac3e86790d05c569de4585e5075a62a9b41    
  
author   : Stephen Frost <[email protected]>    
date     : Thu, 18 Jul 2013 17:10:16 -0400    
  
committer: Stephen Frost <[email protected]>    
date     : Thu, 18 Jul 2013 17:10:16 -0400    

Click here for diff

For simple views which are automatically updatable, this patch allows  
the user to specify what level of checking should be done on records  
being inserted or updated.  For 'LOCAL CHECK', new tuples are validated  
against the conditionals of the view they are being inserted into, while  
for 'CASCADED CHECK' the new tuples are validated against the  
conditionals for all views involved (from the top down).  
  
This option is part of the SQL specification.  
  
Dean Rasheed, reviewed by Pavel Stehule  

M doc/src/sgml/ref/alter_view.sgml
M doc/src/sgml/ref/create_view.sgml
M src/backend/access/common/reloptions.c
M src/backend/catalog/information_schema.sql
M src/backend/catalog/sql_features.txt
M src/backend/commands/tablecmds.c
M src/backend/commands/view.c
M src/backend/executor/execMain.c
M src/backend/executor/nodeModifyTable.c
M src/backend/nodes/copyfuncs.c
M src/backend/nodes/equalfuncs.c
M src/backend/nodes/nodeFuncs.c
M src/backend/nodes/outfuncs.c
M src/backend/nodes/readfuncs.c
M src/backend/optimizer/plan/createplan.c
M src/backend/optimizer/plan/planner.c
M src/backend/parser/gram.y
M src/backend/rewrite/rewriteHandler.c
M src/bin/pg_dump/pg_dump.c
M src/bin/pg_dump/pg_dump.h
M src/include/catalog/catversion.h
M src/include/commands/view.h
M src/include/executor/executor.h
M src/include/nodes/execnodes.h
M src/include/nodes/nodes.h
M src/include/nodes/parsenodes.h
M src/include/nodes/plannodes.h
M src/include/optimizer/planmain.h
M src/include/rewrite/rewriteHandler.h
M src/include/utils/rel.h
M src/test/regress/expected/create_view.out
M src/test/regress/expected/updatable_views.out
M src/test/regress/sql/updatable_views.sql

Fix typo in update scripts for some contrib modules.

commit   : 6f9e39bc9993c18686f0950f9b9657c7c97c7450    
  
author   : Fujii Masao <[email protected]>    
date     : Fri, 19 Jul 2013 04:13:01 +0900    
  
committer: Fujii Masao <[email protected]>    
date     : Fri, 19 Jul 2013 04:13:01 +0900    

Click here for diff

M contrib/dblink/dblink–1.0–1.1.sql
M contrib/hstore/hstore–1.0–1.1.sql
M contrib/pageinspect/pageinspect–1.0–1.1.sql
M contrib/pg_stat_statements/pg_stat_statements–1.0–1.1.sql
M contrib/pg_trgm/pg_trgm–1.0–1.1.sql
M contrib/pgrowlocks/pgrowlocks–1.0–1.1.sql

Fix pgstattuple functions to use regclass-type as the argument.

commit   : 1dc118660b8f12d3bdec94b6f6e1068966ca62e9    
  
author   : Fujii Masao <[email protected]>    
date     : Fri, 19 Jul 2013 03:50:20 +0900    
  
committer: Fujii Masao <[email protected]>    
date     : Fri, 19 Jul 2013 03:50:20 +0900    

Click here for diff

This allows us to specify the target relation with several expressions,  
'relname', 'schemaname.relname' and OID in all pgstattuple functions.  
pgstatindex() and pg_relpages() could not accept OID as the argument  
so far.  
  
Per discussion on -hackers, we decided to keep two types of interfaces,  
with regclass-type and TEXT-type argument, for each pgstattuple  
function because of the backward-compatibility issue. The functions  
which have TEXT-type argument will be deprecated in the future release.  
  
Patch by Satoshi Nagayasu, reviewed by Rushabh Lathia and Fujii Masao.  

M contrib/pgstattuple/Makefile
M contrib/pgstattuple/expected/pgstattuple.out
M contrib/pgstattuple/pgstatindex.c
A contrib/pgstattuple/pgstattuple–1.1–1.2.sql
R075 contrib/pgstattuple/pgstattuple–1.1.sql contrib/pgstattuple/pgstattuple–1.2.sql
M contrib/pgstattuple/pgstattuple.control
M contrib/pgstattuple/sql/pgstattuple.sql
M doc/src/sgml/pgstattuple.sgml

Move checking an explicit VARIADIC "any" argument into the parser.

commit   : d26888bc4d1e539a82f21382b0000fe5bbf889d9    
  
author   : Andrew Dunstan <[email protected]>    
date     : Thu, 18 Jul 2013 11:52:12 -0400    
  
committer: Andrew Dunstan <[email protected]>    
date     : Thu, 18 Jul 2013 11:52:12 -0400    

Click here for diff

This is more efficient and simpler . It does mean that an untyped NULL  
can no longer be used in such cases, which should be mentioned in  
Release Notes, but doesn't seem a terrible loss. The workaround is to  
cast the NULL to some array type.  
  
Pavel Stehule, reviewed by Jeevan Chalke.  

M src/backend/catalog/pg_aggregate.c
M src/backend/parser/parse_func.c
M src/backend/utils/adt/ruleutils.c
M src/backend/utils/adt/varlena.c
M src/include/parser/parse_func.h
M src/test/regress/expected/text.out
M src/test/regress/sql/text.sql

Fix direct access to Relation->rd_indpred.

commit   : 405a468b02dd80a069b95c4eb9838cb6a562eddd    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 18 Jul 2013 01:01:53 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 18 Jul 2013 01:01:53 -0400    

Click here for diff

Should use RelationGetIndexPredicate(), since rd_indpred is just a cache  
that is not computed until/unless demanded.  Per buildfarm failure on  
CLOBBER_CACHE_ALWAYS animals; diagnosis and fix by Hitoshi Harada.  

M src/backend/commands/matview.c

doc: Remove tab from SGML file

commit   : e8b1d1befeab17453eb2977e83a45649e6ed8790    
  
author   : Peter Eisentraut <[email protected]>    
date     : Wed, 17 Jul 2013 19:41:45 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Wed, 17 Jul 2013 19:41:45 -0400    

Click here for diff

M doc/src/sgml/pgbench.sgml

Fix a few problems in barrier.h.

commit   : 89779bf2c8f9aa480e0ceb8883f93e9d65c43a6e    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 17 Jul 2013 18:37:39 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 17 Jul 2013 18:37:39 -0400    

Click here for diff

On HPPA, implement pg_memory_barrier() as pg_compiler_barrier(), which  
should be correct since this arch doesn't do memory access reordering,  
and is anyway better than the completely-nonfunctional-on-this-arch  
dummy_spinlock code.  (But note this patch only fixes things for gcc,  
not for builds with HP's compiler.)  
  
Also, fix incorrect default definition of pg_memory_barrier as a macro  
requiring an argument.  
  
Also, fix incorrect spelling of "#elif" as "#else if" in icc code path  
(spotted by pgindent).  
  
This doesn't come close to fixing all of the functional and stylistic  
deficiencies in barrier.h, but at least it un-breaks my personal build.  
Now that we're actually using barriers in the code, this file is going  
to need some serious attention.  

M src/include/storage/barrier.h

Fix variable names mentioned in comment to match the code.

commit   : 107cbc90a7564b6cd773c56ad3da8b66c7377df5    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Wed, 17 Jul 2013 23:27:15 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Wed, 17 Jul 2013 23:27:15 +0300    

Click here for diff

Also, in another comment, explain why holding an insertion slot is a  
critical section.  
  
Per review by Amit Kapila.  

M src/backend/access/transam/xlog.c

Fix assert failure at end of recovery, broken by XLogInsert scaling patch.

commit   : 59c02a36f0ef317958b2d14313b5c8e41cfd9be6    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Wed, 17 Jul 2013 22:57:48 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Wed, 17 Jul 2013 22:57:48 +0300    

Click here for diff

Initialization of the first XLOG buffer at end-of-recovery was broken for  
the case that the last read WAL record ended at a page boundary. Instead of  
trying to copy the last full xlog page to the buffer cache in that case,  
just set shared state so that the next page is initialized when the first  
WAL record after startup is inserted. (that's what we did in earlier  
version, too)  
  
To make the shared state required for that case less surprising, replace the  
XLogCtl->curridx variable, which was the index of the latest initialized  
buffer, with an XLogRecPtr of how far the buffers have been initialized.  
That also allows us to get rid of the XLogRecEndPtrToBufIdx macro.  
  
While we're at it, make a similar change for XLogCtl->Write.curridx, getting  
rid of that variable and calculating the next buffer to write from  
XLogCtl->LogwrtResult instead.  

M src/backend/access/transam/xlog.c

Fix end-of-loop optimization in pglz_find_match() function.

commit   : 3f2adace1ec025908b5189f0773b4eaab3d228d5    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Wed, 17 Jul 2013 20:24:28 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Wed, 17 Jul 2013 20:24:28 +0300    

Click here for diff

After the recent pglz optimization patch, the next/prev pointers in the  
hash table are never NULL, INVALID_ENTRY_PTR is used to represent invalid  
entries instead. The end-of-loop check in pglz_find_match() function didn't  
get the memo. The result was the same from a correctness point of view, but  
because the NULL-check would never fail, the tiny optimization turned into  
a pessimization.  
  
Reported by Stephen Frost, using Coverity scanner.  

M src/backend/utils/adt/pg_lzcompress.c

Fix typo in previous pgbench --progress patch.

commit   : 750f43685b1b88d4281074940cdcea0e328593aa    
  
author   : Fujii Masao <[email protected]>    
date     : Thu, 18 Jul 2013 01:20:05 +0900    
  
committer: Fujii Masao <[email protected]>    
date     : Thu, 18 Jul 2013 01:20:05 +0900    

Click here for diff

M contrib/pgbench/pgbench.c
M doc/src/sgml/pgbench.sgml

Use correct parameter name for view_option_value

commit   : f2719f6975398727ed492ecbcb2028bd134e5f6b    
  
author   : Stephen Frost <[email protected]>    
date     : Wed, 17 Jul 2013 10:50:39 -0400    
  
committer: Stephen Frost <[email protected]>    
date     : Wed, 17 Jul 2013 10:50:39 -0400    

Click here for diff

The documentation for ALTER VIEW had a minor copy-and-paste error in  
defining the parameters.  Noticed when reviewing the WITH CHECK OPTION  
patch.  
  
Backpatch to 9.2 where this was first introduced.  

M doc/src/sgml/ref/alter_view.sgml

Fix systable_recheck_tuple() for MVCC scan snapshots.

commit   : ffcf654547ef38555203e6d716f47b7065a0a87d    
  
author   : Noah Misch <[email protected]>    
date     : Tue, 16 Jul 2013 20:16:32 -0400    
  
committer: Noah Misch <[email protected]>    
date     : Tue, 16 Jul 2013 20:16:32 -0400    

Click here for diff

Since this function assumed non-MVCC snapshots, it broke when commit  
568d4138c646cd7cd8a837ac244ef2caf27c6bb8 switched its one caller from  
SnapshotNow scans to MVCC-snapshot scans.  
  
Reviewed by Robert Haas, Tom Lane and Andres Freund.  

M src/backend/access/index/genam.c

Implement the FILTER clause for aggregate function calls.

commit   : b560ec1b0d7b910ce13edc51ffaafaca72136e3b    
  
author   : Noah Misch <[email protected]>    
date     : Tue, 16 Jul 2013 20:15:36 -0400    
  
committer: Noah Misch <[email protected]>    
date     : Tue, 16 Jul 2013 20:15:36 -0400    

Click here for diff

This is SQL-standard with a few extensions, namely support for  
subqueries and outer references in clause expressions.  
  
catversion bump due to change in Aggref and WindowFunc.  
  
David Fetter, reviewed by Dean Rasheed.  

M contrib/pg_stat_statements/pg_stat_statements.c
M doc/src/sgml/keywords.sgml
M doc/src/sgml/ref/select.sgml
M doc/src/sgml/syntax.sgml
M src/backend/executor/execQual.c
M src/backend/executor/execUtils.c
M src/backend/executor/functions.c
M src/backend/executor/nodeAgg.c
M src/backend/executor/nodeWindowAgg.c
M src/backend/nodes/copyfuncs.c
M src/backend/nodes/equalfuncs.c
M src/backend/nodes/makefuncs.c
M src/backend/nodes/nodeFuncs.c
M src/backend/nodes/outfuncs.c
M src/backend/nodes/readfuncs.c
M src/backend/optimizer/path/costsize.c
M src/backend/optimizer/plan/planagg.c
M src/backend/optimizer/util/clauses.c
M src/backend/parser/gram.y
M src/backend/parser/parse_agg.c
M src/backend/parser/parse_collate.c
M src/backend/parser/parse_expr.c
M src/backend/parser/parse_func.c
M src/backend/utils/adt/ruleutils.c
M src/include/catalog/catversion.h
M src/include/nodes/execnodes.h
M src/include/nodes/parsenodes.h
M src/include/nodes/primnodes.h
M src/include/parser/kwlist.h
M src/include/parser/parse_func.h
M src/include/parser/parse_node.h
M src/test/regress/expected/aggregates.out
M src/test/regress/expected/window.out
M src/test/regress/sql/aggregates.sql
M src/test/regress/sql/window.sql

Comment on why planagg.c punts "MIN(x ORDER BY y)".

commit   : 7a8e9f298e7b8158296e1ea72ca8987323c10edf    
  
author   : Noah Misch <[email protected]>    
date     : Tue, 16 Jul 2013 20:14:37 -0400    
  
committer: Noah Misch <[email protected]>    
date     : Tue, 16 Jul 2013 20:14:37 -0400    

Click here for diff

M src/backend/optimizer/plan/planagg.c

Add --progress option to show progress report

commit   : 4a87f308b33457670f9ab4bc622678e5d285b9c2    
  
author   : Tatsuo Ishii <[email protected]>    
date     : Wed, 17 Jul 2013 08:05:37 +0900    
  
committer: Tatsuo Ishii <[email protected]>    
date     : Wed, 17 Jul 2013 08:05:37 +0900    

Click here for diff

Patch contributed by Fabien COELHO, reviewed by KONDO Mitsumasa.  

M contrib/pgbench/pgbench.c
M doc/src/sgml/pgbench.sgml

Add support for REFRESH MATERIALIZED VIEW CONCURRENTLY.

commit   : cc1965a99bf87005f431804bbda0f723887a04d6    
  
author   : Kevin Grittner <[email protected]>    
date     : Tue, 16 Jul 2013 12:55:44 -0500    
  
committer: Kevin Grittner <[email protected]>    
date     : Tue, 16 Jul 2013 12:55:44 -0500    

Click here for diff

This allows reads to continue without any blocking while a REFRESH  
runs.  The new data appears atomically as part of transaction  
commit.  
  
Review questioned the Assert that a matview was not a system  
relation.  This will be addressed separately.  
  
Reviewed by Hitoshi Harada, Robert Haas, Andres Freund.  
Merged after review with security patch f3ab5d4.  

M doc/src/sgml/mvcc.sgml
M doc/src/sgml/ref/refresh_materialized_view.sgml
M src/backend/commands/cluster.c
M src/backend/commands/matview.c
M src/backend/commands/tablecmds.c
M src/backend/executor/execMain.c
M src/backend/executor/nodeModifyTable.c
M src/backend/nodes/copyfuncs.c
M src/backend/nodes/equalfuncs.c
M src/backend/parser/gram.y
M src/bin/psql/tab-complete.c
M src/include/commands/cluster.h
M src/include/commands/matview.h
M src/include/nodes/parsenodes.h
M src/test/regress/expected/matview.out
M src/test/regress/sql/matview.sql

Allow background workers to be started dynamically.

commit   : 7f7485a0cde92aa4ba235a1ffe4dda0ca0b6cc9a    
  
author   : Robert Haas <[email protected]>    
date     : Tue, 16 Jul 2013 13:02:15 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Tue, 16 Jul 2013 13:02:15 -0400    

Click here for diff

There is a new API, RegisterDynamicBackgroundWorker, which allows  
an ordinary user backend to register a new background writer during  
normal running.  This means that it's no longer necessary for all  
background workers to be registered during processing of  
shared_preload_libraries, although the option of registering workers  
at that time remains available.  
  
When a background worker exits and will not be restarted, the  
slot previously used by that background worker is automatically  
released and becomes available for reuse.  Slots used by background  
workers that are configured for automatic restart can't (yet) be  
released without shutting down the system.  
  
This commit adds a new source file, bgworker.c, and moves some  
of the existing control logic for background workers there.  
Previously, there was little enough logic that it made sense to  
keep everything in postmaster.c, but not any more.  
  
This commit also makes the worker_spi contrib module into an  
extension and adds a new function, worker_spi_launch, which can  
be used to demonstrate the new facility.  

M contrib/worker_spi/Makefile
A contrib/worker_spi/worker_spi–1.0.sql
M contrib/worker_spi/worker_spi.c
A contrib/worker_spi/worker_spi.control
M doc/src/sgml/bgworker.sgml
M src/backend/postmaster/Makefile
A src/backend/postmaster/bgworker.c
M src/backend/postmaster/postmaster.c
M src/backend/storage/ipc/ipci.c
M src/include/postmaster/bgworker.h
A src/include/postmaster/bgworker_internals.h
M src/include/storage/lwlock.h
M src/include/storage/pmsignal.h

Fix PQconninfoParse error message handling

commit   : 233bfe06735411f08d231764dfd3a6fcf7aef9a3    
  
author   : Peter Eisentraut <[email protected]>    
date     : Mon, 15 Jul 2013 20:04:14 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Mon, 15 Jul 2013 20:04:14 -0400    

Click here for diff

The returned error message already includes a newline, but the callers  
were adding their own when printing it out.  

M src/bin/pg_basebackup/streamutil.c
M src/bin/pg_dump/pg_dumpall.c
M src/bin/scripts/pg_isready.c
M src/interfaces/libpq/test/uri-regress.c

Check get_tle_by_resno() result before deref

commit   : 4ed22e891f9915b02b753ee8763a8f2438234fc6    
  
author   : Stephen Frost <[email protected]>    
date     : Mon, 15 Jul 2013 14:53:17 -0400    
  
committer: Stephen Frost <[email protected]>    
date     : Mon, 15 Jul 2013 14:53:17 -0400    

Click here for diff

When creating a sort to support a group by, we need to look up the  
target entry in the target list by the resno using get_tle_by_resno().  
This particular code-path didn't check the result prior to attempting  
to dereference it, while all other callers did.  While I can't see a  
way for this usage of get_tle_by_resno() to fail (you can't ask for  
a column to be sorted on which isn't included in the group by), it's  
probably best to check that we didn't end up with a NULL somehow  
anyway than risk the segfault.  
  
I'm willing to back-patch this if others feel it's necessary, but my  
guess is new features are what might tickle this rather than anything  
existing.  
  
Missing check spotted by the Coverity scanner.  

M src/backend/optimizer/plan/createplan.c

Tab completion for \lo_import

commit   : 4403a9d7913043d99de9e13a9b54c57ed0c4501c    
  
author   : Robert Haas <[email protected]>    
date     : Mon, 15 Jul 2013 14:29:17 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Mon, 15 Jul 2013 14:29:17 -0400    

Click here for diff

Josh Kupershmidt  

M src/bin/psql/tab-complete.c

Assert that syscache lookups don't happen outside transactions.

commit   : 42c80c696e9c8323841180029cc62741c21bd356    
  
author   : Robert Haas <[email protected]>    
date     : Mon, 15 Jul 2013 13:31:36 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Mon, 15 Jul 2013 13:31:36 -0400    

Click here for diff

Andres Freund  

M src/backend/utils/cache/catcache.c

Regression tests for LOCK TABLE.

commit   : ac33c7e2c1304dffcf107065d7fc04232a8a94fa    
  
author   : Robert Haas <[email protected]>    
date     : Mon, 15 Jul 2013 12:29:34 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Mon, 15 Jul 2013 12:29:34 -0400    

Click here for diff

Robins Tharakan, reviewed by Szymon Guz, substantially revised by me.  

A src/test/regress/expected/lock.out
M src/test/regress/parallel_schedule
M src/test/regress/serial_schedule
A src/test/regress/sql/lock.sql

vacuumlo: Use a cursor to limit client-side memory usage.

commit   : 67ccbb080d87a5379dffc1cdff046c4caf534a6c    
  
author   : Robert Haas <[email protected]>    
date     : Mon, 15 Jul 2013 10:48:44 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Mon, 15 Jul 2013 10:48:44 -0400    

Click here for diff

This prevents the client from gobbling up too much memory when the  
number of large objects to be removed is very large.  
  
Andrew Dunstan, reviewed by Josh Kupershmidt  

M contrib/vacuumlo/vacuumlo.c

Correct off-by-one when reading from pipe

commit   : 03010366b6fb61aac0998f234478cc745ff97b0c    
  
author   : Stephen Frost <[email protected]>    
date     : Mon, 15 Jul 2013 10:42:27 -0400    
  
committer: Stephen Frost <[email protected]>    
date     : Mon, 15 Jul 2013 10:42:27 -0400    

Click here for diff

In pg_basebackup.c:reached_end_position(), we're reading from an  
internal pipe with our own background process but we're possibly  
reading more bytes than will actually fit into our buffer due to  
an off-by-one error.  As we're reading from an internal pipe  
there's no real risk here, but it's good form to not depend on  
such convenient arrangements.  
  
Bug spotted by the Coverity scanner.  
  
Back-patch to 9.2 where this showed up.  

M src/bin/pg_basebackup/pg_basebackup.c

Check version before allocating PQExpBuffer

commit   : 3355443fb188b86d59ca90912d5456b427c29116    
  
author   : Stephen Frost <[email protected]>    
date     : Sun, 14 Jul 2013 21:17:59 -0400    
  
committer: Stephen Frost <[email protected]>    
date     : Sun, 14 Jul 2013 21:17:59 -0400    

Click here for diff

In pg_dump.c:getEventTriggers, check what major version we are on  
before calling createPQExpBuffer() to avoid leaking that bit of  
memory.  
  
Leak discovered by the Coverity scanner.  
  
Back-patch to 9.3 where support for dumping event triggers was  
added.  

M src/bin/pg_dump/pg_dump.c

Document the OVER keyword as being unreserved.

commit   : 01337d46eb34503b81b989885d0aa3e25da5a96d    
  
author   : Noah Misch <[email protected]>    
date     : Sun, 14 Jul 2013 19:49:02 -0400    
  
committer: Noah Misch <[email protected]>    
date     : Sun, 14 Jul 2013 19:49:02 -0400    

Click here for diff

It became so in commit 5893ffa79c03824f34ae3d37f211381fd1c17283.  
  
David Fetter, extracted from a larger patch.  

M doc/src/sgml/keywords.sgml

Fix resource leak in initdb -X option

commit   : 5461d36b5b7d99e237b2f63a7975e6430727cb0b    
  
author   : Stephen Frost <[email protected]>    
date     : Sun, 14 Jul 2013 17:44:29 -0400    
  
committer: Stephen Frost <[email protected]>    
date     : Sun, 14 Jul 2013 17:44:29 -0400    

Click here for diff

When creating the symlink for the xlog directory, free the string  
which stores the link location.  Not really an issue but it doesn't  
hurt to be good about this- prior cleanups have fixed similar  
issues.  
  
Leak found by the Coverity scanner.  
  
Not back-patching as I don't see it being worth the code churn.  

M src/bin/initdb/initdb.c

Be sure to close() file descriptor on error case

commit   : cec62efd0e551a56635b47ea4185ec27a6840de7    
  
author   : Stephen Frost <[email protected]>    
date     : Sun, 14 Jul 2013 17:30:43 -0400    
  
committer: Stephen Frost <[email protected]>    
date     : Sun, 14 Jul 2013 17:30:43 -0400    

Click here for diff

In receivelog.c:writeTimeLineHistoryFile(), we were not properly  
closing the open'd file descriptor in error cases.  While this  
wouldn't matter much if we were about to exit due to such an  
error, that's not the case with pg_receivexlog as it can be a  
long-running process and these errors are non-fatal.  
  
This resource leak was found by the Coverity scanner.  
  
Back-patch to 9.3 where this issue first appeared.  

M src/bin/pg_basebackup/receivelog.c

Ensure 64bit arithmetic when calculating tapeSpace

commit   : 273dcd16282c8014a14a9ecbf467459b8702e745    
  
author   : Stephen Frost <[email protected]>    
date     : Sun, 14 Jul 2013 16:26:16 -0400    
  
committer: Stephen Frost <[email protected]>    
date     : Sun, 14 Jul 2013 16:26:16 -0400    

Click here for diff

In tuplesort.c:inittapes(), we calculate tapeSpace by first figuring  
out how many 'tapes' we can use (maxTapes) and then multiplying the  
result by the tape buffer overhead for each.  Unfortunately, when  
we are on a system with an 8-byte long, we allow work_mem to be  
larger than 2GB and that allows maxTapes to be large enough that the  
32bit arithmetic can overflow when multiplied against the buffer  
overhead.  
  
When this overflow happens, we end up adding the overflow to the  
amount of space available, causing the amount of memory allocated to  
be larger than work_mem.  
  
Note that to reach this point, you have to set work mem to at least  
24GB and be sorting a set which is at least that size.  Given that a  
user who can set work_mem to 24GB could also set it even higher, if  
they were looking to run the system out of memory, this isn't  
considered a security issue.  
  
This overflow risk was found by the Coverity scanner.  
  
Back-patch to all supported branches, as this issue has existed  
since before 8.4.  

M src/backend/utils/sort/tuplesort.c

pg_isready: Message improvement

commit   : 1f75a5f9c1307257c7682f2968a835435fd2b4b2    
  
author   : Peter Eisentraut <[email protected]>    
date     : Sun, 14 Jul 2013 15:53:56 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Sun, 14 Jul 2013 15:53:56 -0400    

Click here for diff

M src/bin/scripts/pg_isready.c

pg_receivexlog - Exit on failure to parse

commit   : d368a301b3a4bf5fec17e81c630adddeac80a7fc    
  
author   : Stephen Frost <[email protected]>    
date     : Sun, 14 Jul 2013 15:31:23 -0400    
  
committer: Stephen Frost <[email protected]>    
date     : Sun, 14 Jul 2013 15:31:23 -0400    

Click here for diff

In streamutil.c:GetConnection(), upgrade failure to parse the  
connection string to an exit(1) instead of simply returning NULL.  
Most callers already immediately exited, but pg_receivexlog would  
loop on this case, continually trying to re-parse the connection  
string (which can't be changed after pg_receivexlog has started).  
  
GetConnection() was already expected to exit(1) in some cases  
(eg: failure to allocate memory or if unable to determine the  
integer_datetimes flag), so this change shouldn't surprise anyone.  
  
Began looking at this due to the Coverity scanner complaining that  
we were leaking err_msg in this case- no longer an issue since we  
just exit(1) immediately.  

M src/bin/pg_basebackup/streamutil.c

During parallel pg_dump, free commands from master

commit   : 234e4cf6e1eac2f0e514379a2a533ffb71b33732    
  
author   : Stephen Frost <[email protected]>    
date     : Sun, 14 Jul 2013 14:35:26 -0400    
  
committer: Stephen Frost <[email protected]>    
date     : Sun, 14 Jul 2013 14:35:26 -0400    

Click here for diff

The command strings read by the child processes during parallel  
pg_dump, after being read and handled, were not being free'd.  
This patch corrects this relatively minor memory leak.  
  
Leak found by the Coverity scanner.  
  
Back patch to 9.3 where parallel pg_dump was introduced.  

M src/bin/pg_dump/parallel.c

Add session_preload_libraries configuration parameter

commit   : 070518ddab2c94afea119f2b1944c05d16792b07    
  
author   : Peter Eisentraut <[email protected]>    
date     : Wed, 12 Jun 2013 22:28:24 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Wed, 12 Jun 2013 22:28:24 -0400    

Click here for diff

This is like shared_preload_libraries except that it takes effect at  
backend start and can be changed without a full postmaster restart.  It  
is like local_preload_libraries except that it is still only settable by  
a superuser.  This can be a better way to load modules such as  
auto_explain.  
  
Since there are now three preload parameters, regroup the documentation  
a bit.  Put all parameters into one section, explain common  
functionality only once, update the descriptions to reflect current and  
future realities.  
  
Reviewed-by: Dimitri Fontaine <[email protected]>  

M doc/src/sgml/auto-explain.sgml
M doc/src/sgml/config.sgml
M src/backend/tcop/postgres.c
M src/backend/utils/init/miscinit.c
M src/backend/utils/misc/guc.c
M src/include/miscadmin.h
M src/include/utils/guc_tables.h

Switch user ID to the object owner when populating a materialized view.

commit   : f3ab5d46960023cf8a9df3751ab9748ce01a46a0    
  
author   : Noah Misch <[email protected]>    
date     : Fri, 12 Jul 2013 18:21:22 -0400    
  
committer: Noah Misch <[email protected]>    
date     : Fri, 12 Jul 2013 18:21:22 -0400    

Click here for diff

This makes superuser-issued REFRESH MATERIALIZED VIEW safe regardless of  
the object's provenance.  REINDEX is an earlier example of this pattern.  
As a downside, functions called from materialized views must tolerate  
running in a security-restricted operation.  CREATE MATERIALIZED VIEW  
need not change user ID.  Nonetheless, avoid creation of materialized  
views that will invariably fail REFRESH by making it, too, start a  
security-restricted operation.  
  
Back-patch to 9.3 so materialized views have this from the beginning.  
  
Reviewed by Kevin Grittner.  

M doc/src/sgml/ref/create_materialized_view.sgml
M src/backend/commands/createas.c
M src/backend/commands/matview.c

Make comments reflect that omission of SPI_gettypmod() is intentional.

commit   : 448fee2e238ae4797e68d7d15b49f2fc52691547    
  
author   : Noah Misch <[email protected]>    
date     : Fri, 12 Jul 2013 18:07:46 -0400    
  
committer: Noah Misch <[email protected]>    
date     : Fri, 12 Jul 2013 18:07:46 -0400    

Click here for diff

M src/backend/executor/spi.c
M src/pl/plpgsql/src/pl_exec.c

pg_dump: Formatting cleanup of new messages

commit   : e852c5df2ded8b076693d0c0632dcbda107be89e    
  
author   : Peter Eisentraut <[email protected]>    
date     : Thu, 11 Jul 2013 21:48:09 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Thu, 11 Jul 2013 21:48:09 -0400    

Click here for diff

M src/bin/pg_dump/parallel.c
M src/bin/pg_dump/pg_backup_directory.c

commit   : 886c05d8e8642572af25fee23f414bd31f2e7f3e    
  
author   : Bruce Momjian <[email protected]>    
date     : Thu, 11 Jul 2013 09:43:22 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Thu, 11 Jul 2013 09:43:22 -0400    

Click here for diff

M doc/src/sgml/pgupgrade.sgml

commit   : f02b14f787980ac5b2f25407e5cd771e6b1a1dfc    
  
author   : Peter Eisentraut <[email protected]>    
date     : Wed, 10 Jul 2013 22:40:41 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Wed, 10 Jul 2013 22:40:41 -0400    

Click here for diff

From: Ian Lawrence Barwick <[email protected]>  

M doc/src/sgml/maintenance.sgml

Add coverage/ to .gitignore

commit   : a87416db3b3d76d3b7095c23b08e1899ec2b203d    
  
author   : Peter Eisentraut <[email protected]>    
date     : Tue, 9 Jul 2013 21:12:17 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Tue, 9 Jul 2013 21:12:17 -0400    

Click here for diff

M .gitignore

Fix lack of message pluralization

commit   : 8dead08c54826e5927bf7a07caa94a86e6981aa0    
  
author   : Peter Eisentraut <[email protected]>    
date     : Tue, 9 Jul 2013 20:49:44 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Tue, 9 Jul 2013 20:49:44 -0400    

Click here for diff

M src/backend/postmaster/postmaster.c

Fix memory barrier support on icc on ia64, 2nd attempt.

commit   : e5592c61adb0766eaee53ec07d2f05783d1c6548    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Tue, 9 Jul 2013 11:31:26 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Tue, 9 Jul 2013 11:31:26 +0300    

Click here for diff

Itanium doesn't have the mfence instruction - that's a 386 thing. Use the  
"mf" instruction instead.  
  
This reverts the previous commit to add "#include <emmintrinsic.h>"; the  
problem was not with a missing #include.  

M src/include/storage/barrier.h

Add #include needed for _mm_mfence() intrinsic on ia64.

commit   : 6052bceba5b4cb3d4ae814185d5035307ecabb65    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Tue, 9 Jul 2013 10:23:18 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Tue, 9 Jul 2013 10:23:18 +0300    

Click here for diff

Hopefully this fixes the build failure on buildfarm member dugong.  

M src/include/storage/barrier.h

Fix bool abuse

commit   : 7888c61238ca082404cf8348a69e2b66bf9f4e96    
  
author   : Peter Eisentraut <[email protected]>    
date     : Mon, 8 Jul 2013 22:42:39 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Mon, 8 Jul 2013 22:42:39 -0400    

Click here for diff

path_encode's "closed" argument used to take three values: TRUE, FALSE,  
or -1, while being of type bool.  Replace that with a three-valued enum  
for more clarity.  

M src/backend/utils/adt/geo_ops.c

Fix mention of htup.h in pageinspect docs

commit   : 12fbe2b3dd9c712532541c6a89cd26b1974c66f2    
  
author   : Alvaro Herrera <[email protected]>    
date     : Mon, 8 Jul 2013 17:11:55 -0400    
  
committer: Alvaro Herrera <[email protected]>    
date     : Mon, 8 Jul 2013 17:11:55 -0400    

Click here for diff

It's htup_details.h now.  
  
Jeff Janes  

M doc/src/sgml/pageinspect.sgml

Fix Windows build.

commit   : f489470f8abee19ec0788afad92cf192c132271e    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Mon, 8 Jul 2013 17:28:48 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Mon, 8 Jul 2013 17:28:48 +0300    

Click here for diff

Was broken by my xloginsert scaling patch. XLogCtl global variable needs  
to be initialized in each process, as it's not inherited by fork() on  
Windows.  

M src/backend/access/transam/xlog.c

Fix pg_test_fsync, broken by xloginsert scaling patch.

commit   : b5ed21998c13f09fd733c87a224e3fe27e41d34d    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Mon, 8 Jul 2013 13:01:11 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Mon, 8 Jul 2013 13:01:11 +0300    

Click here for diff

I didn't realize that ALIGNOF_XLOG_BUFFER was used in pg_test_fsync.  

M contrib/pg_test_fsync/pg_test_fsync.c

Improve scalability of WAL insertions.

commit   : 9a20a9b21baa819df1760b36f3c36f25d11fc27b    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Mon, 8 Jul 2013 11:23:56 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Mon, 8 Jul 2013 11:23:56 +0300    

Click here for diff

This patch replaces WALInsertLock with a number of WAL insertion slots,  
allowing multiple backends to insert WAL records to the WAL buffers  
concurrently. This is particularly useful for parallel loading large amounts  
of data on a system with many CPUs.  
  
This has one user-visible change: switching to a new WAL segment with  
pg_switch_xlog() now fills the remaining unused portion of the segment with  
zeros. This potentially adds some overhead, but it has been a very common  
practice by DBA's to clear the "tail" of the segment with an external  
pg_clearxlogtail utility anyway, to make the WAL files compress better.  
With this patch, it's no longer necessary to do that.  
  
This patch adds a new GUC, xloginsert_slots, to tune the number of WAL  
insertion slots. Performance testing suggests that the default, 8, works  
pretty well for all kinds of worklods, but I left the GUC in place to allow  
others with different hardware to test that easily. We might want to remove  
that before release.  
  
Reviewed by Andres Freund.  

M src/backend/access/transam/xlog.c
M src/backend/storage/lmgr/spin.c
M src/backend/utils/misc/guc.c
M src/include/access/xlog.h
M src/include/access/xlogdefs.h
M src/include/storage/lwlock.h

Fix planning of parameterized appendrel paths with expensive join quals.

commit   : 5372275b4b5fc183c6c6dd4517cfd74d5b641446    
  
author   : Tom Lane <[email protected]>    
date     : Sun, 7 Jul 2013 22:37:24 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Sun, 7 Jul 2013 22:37:24 -0400    

Click here for diff

The code in set_append_rel_pathlist() for building parameterized paths  
for append relations (inheritance and UNION ALL combinations) supposed  
that the cheapest regular path for a child relation would still be cheapest  
when reparameterized.  Which might not be the case, particularly if the  
added join conditions are expensive to compute, as in a recent example from  
Jeff Janes.  Fix it to compare child path costs *after* reparameterizing.  
We can short-circuit that if the cheapest pre-existing path is already  
parameterized correctly, which seems likely to be true often enough to be  
worth checking for.  
  
Back-patch to 9.2 where parameterized paths were introduced.  

M src/backend/optimizer/path/allpaths.c
M src/test/regress/expected/union.out
M src/test/regress/sql/union.sql

pg_isready: Make --help output more consistent with other utilities

commit   : 9b2543a4018c7f746bdb8d379c4ebc89c7d5f831    
  
author   : Peter Eisentraut <[email protected]>    
date     : Sun, 7 Jul 2013 16:01:29 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Sun, 7 Jul 2013 16:01:29 -0400    

Click here for diff

M src/bin/scripts/pg_isready.c

pg_resetxlog: Make --help consistent with man page

commit   : e714d03142a87d572d95f70099537ef8ffd13508    
  
author   : Peter Eisentraut <[email protected]>    
date     : Sun, 7 Jul 2013 15:56:23 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Sun, 7 Jul 2013 15:56:23 -0400    

Click here for diff

Use "MXID" as placeholder for -m option, instead of just "XID".  

M src/bin/pg_resetxlog/pg_resetxlog.c

commit   : 27aa1b960a8562163610bc5e3c1437c55badb090    
  
author   : Bruce Momjian <[email protected]>    
date     : Sun, 7 Jul 2013 15:57:26 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Sun, 7 Jul 2013 15:57:26 -0400    

Click here for diff

M doc/src/sgml/pgupgrade.sgml

Fix include-guard

commit   : 5a348fe077916048cfba3eab3f8210583a6bcb14    
  
author   : Magnus Hagander <[email protected]>    
date     : Sun, 7 Jul 2013 13:36:20 +0200    
  
committer: Magnus Hagander <[email protected]>    
date     : Sun, 7 Jul 2013 13:36:20 +0200    

Click here for diff

Looks like a cut/paste error in the original addition of the file.  
  
Andres Freund  

M src/include/utils/attoptcache.h

pgbench: Silence compiler warning

commit   : 55f100efc67a0054db586c1804760fb18cfc7b79    
  
author   : Peter Eisentraut <[email protected]>    
date     : Sun, 7 Jul 2013 07:25:39 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Sun, 7 Jul 2013 07:25:39 -0400    

Click here for diff

Explicitly ignore return value from write(), to silence warning.  This  
warning only appeared under --disable-thread-safety.  

M contrib/pgbench/pgbench.c

PL/Python: Make regression tests pass with older Python versions

commit   : 8182ffde5aa09d8378caa599d70e0d4e02ea8d7d    
  
author   : Peter Eisentraut <[email protected]>    
date     : Sat, 6 Jul 2013 20:36:19 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Sat, 6 Jul 2013 20:36:19 -0400    

Click here for diff

Avoid output formatting differences by printing str() instead of repr()  
of the value.  

M src/pl/plpython/expected/plpython_types.out
M src/pl/plpython/expected/plpython_types_3.out
M src/pl/plpython/sql/plpython_types.sql

Handle posix_fallocate() errors.

commit   : 5b571bb8c8d2bea610e01ae1ee7bc05adcfff528    
  
author   : Jeff Davis <[email protected]>    
date     : Sat, 6 Jul 2013 13:46:04 -0700    
  
committer: Jeff Davis <[email protected]>    
date     : Sat, 6 Jul 2013 13:46:04 -0700    

Click here for diff

On some platforms, posix_fallocate() is available but may still return  
EINVAL if the underlying filesystem does not support it.  So, in case  
of an error, fall through to the alternate implementation that just  
writes zeros.  
  
Per buildfarm failure and analysis by Tom Lane.  

M src/backend/access/transam/xlog.c

Also escape double quotes for ECPG's #line statement.

commit   : 43c3aab123560b326bab894c44b667e2bdddc0e4    
  
author   : Michael Meskes <[email protected]>    
date     : Sat, 6 Jul 2013 22:08:53 +0200    
  
committer: Michael Meskes <[email protected]>    
date     : Sat, 6 Jul 2013 22:08:53 +0200    

Click here for diff

M src/interfaces/ecpg/preproc/output.c

Rename a function to avoid naming conflict in parallel regression tests.

commit   : 0cd787802f84583c4086b1af0a74015f230dfb70    
  
author   : Tom Lane <[email protected]>    
date     : Sat, 6 Jul 2013 11:16:50 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Sat, 6 Jul 2013 11:16:50 -0400    

Click here for diff

Commit 31a891857a128828d47d93c63e041f3b69cbab70 added some tests in  
plpgsql.sql that used a function rather unthinkingly named "foo()".  
However, rangefuncs.sql has some much older tests that create a function  
of that name, and since these test scripts run in parallel, there is a  
chance of failures if the timing is just right.  Use another name to  
avoid that.  Per buildfarm (failure seen today on "hamerkop", but  
probably it's happened before and not been noticed).  

M src/test/regress/expected/plpgsql.out
M src/test/regress/sql/plpgsql.sql

PL/Python: Convert numeric to Decimal

commit   : 7919398bac8bacd75ec5d763ce8b15ffaaa3e071    
  
author   : Peter Eisentraut <[email protected]>    
date     : Fri, 5 Jul 2013 22:41:25 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Fri, 5 Jul 2013 22:41:25 -0400    

Click here for diff

The old implementation converted PostgreSQL numeric to Python float,  
which was always considered a shortcoming.  Now numeric is converted to  
the Python Decimal object.  Either the external cdecimal module or the  
standard library decimal module are supported.  
  
From: Szymon Guz <[email protected]>  
From: Ronan Dunklau <[email protected]>  
Reviewed-by: Steve Singer <[email protected]>  

M doc/src/sgml/plpython.sgml
M src/pl/plpython/expected/plpython_types.out
M src/pl/plpython/expected/plpython_types_3.out
M src/pl/plpython/plpy_typeio.c
M src/pl/plpython/sql/plpython_types.sql

Update messages, comments and documentation for materialized views.

commit   : 02d2b694ee42a9e241d37ce67df122fff43d5bb9    
  
author   : Noah Misch <[email protected]>    
date     : Fri, 5 Jul 2013 15:25:51 -0400    
  
committer: Noah Misch <[email protected]>    
date     : Fri, 5 Jul 2013 15:25:51 -0400    

Click here for diff

All instances of the verbiage lagging the code.  Back-patch to 9.3,  
where materialized views were introduced.  

M doc/src/sgml/maintenance.sgml
M src/backend/access/heap/tuptoaster.c
M src/backend/catalog/aclchk.c
M src/backend/catalog/heap.c
M src/backend/commands/comment.c
M src/backend/commands/indexcmds.c
M src/backend/commands/seclabel.c
M src/backend/commands/tablecmds.c
M src/backend/commands/typecmds.c
M src/backend/commands/vacuum.c
M src/backend/parser/parse_utilcmd.c
M src/backend/rewrite/rewriteDefine.c
M src/bin/pg_dump/common.c
M src/pl/tcl/pltcl.c
M src/test/regress/expected/create_table_like.out

Use posix_fallocate() for new WAL files, where available.

commit   : 269e780822abb2e44189afaccd6b0ee7aefa7ddd    
  
author   : Jeff Davis <[email protected]>    
date     : Fri, 5 Jul 2013 12:30:29 -0700    
  
committer: Jeff Davis <[email protected]>    
date     : Fri, 5 Jul 2013 12:30:29 -0700    

Click here for diff

This function is more efficient than actually writing out zeroes to  
the new file, per microbenchmarks by Jon Nelson. Also, it may reduce  
the likelihood of WAL file fragmentation.  
  
Jon Nelson, with review by Andres Freund, Greg Smith and me.  

M configure
M configure.in
M src/backend/access/transam/xlog.c
M src/include/pg_config.h.in
M src/include/pg_config.h.win32

Remove stray | character

commit   : 8800d8061dd151d6556f5f8d58f8211fd830169f    
  
author   : Magnus Hagander <[email protected]>    
date     : Fri, 5 Jul 2013 16:21:08 +0200    
  
committer: Magnus Hagander <[email protected]>    
date     : Fri, 5 Jul 2013 16:21:08 +0200    

Click here for diff

Erikjan Rijkers  

M doc/src/sgml/ref/copy.sgml

Fix spelling error

commit   : c3cb14de334e2c513d63a57387d217ee59cfb66d    
  
author   : Magnus Hagander <[email protected]>    
date     : Fri, 5 Jul 2013 16:19:16 +0200    
  
committer: Magnus Hagander <[email protected]>    
date     : Fri, 5 Jul 2013 16:19:16 +0200    

Click here for diff

Reported by Kevin Hale Boyes  

M doc/src/sgml/config.sgml

Expose the estimation of number of changed tuples since last analyze

commit   : c87ff71f374652936a6089215a30998492b14d52    
  
author   : Magnus Hagander <[email protected]>    
date     : Fri, 5 Jul 2013 15:02:09 +0200    
  
committer: Magnus Hagander <[email protected]>    
date     : Fri, 5 Jul 2013 15:02:09 +0200    

Click here for diff

This value, now pg_stat_all_tables.n_mod_since_analyze, was already  
tracked and used by autovacuum, but not exposed to the user.  
  
Mark Kirkwood, review by Laurenz Albe  

M doc/src/sgml/monitoring.sgml
M src/backend/catalog/system_views.sql
M src/backend/utils/adt/pgstatfuncs.c
M src/include/catalog/catversion.h
M src/include/catalog/pg_proc.h
M src/test/regress/expected/rules.out

Apploed patch by MauMau <[email protected]> to escape filenames in #line statements.

commit   : 9ce9dfdb999960aa7596bb219db02ccdbe2da855    
  
author   : Michael Meskes <[email protected]>    
date     : Fri, 5 Jul 2013 11:07:16 +0200    
  
committer: Michael Meskes <[email protected]>    
date     : Fri, 5 Jul 2013 11:07:16 +0200    

Click here for diff

M src/interfaces/ecpg/preproc/output.c

Use type "int64" for memory accounting in tuplesort.c/tuplestore.c.

commit   : 79e0f87a15643efa9a94e011da509746dbb96798    
  
author   : Noah Misch <[email protected]>    
date     : Thu, 4 Jul 2013 23:09:54 -0400    
  
committer: Noah Misch <[email protected]>    
date     : Thu, 4 Jul 2013 23:09:54 -0400    

Click here for diff

Commit 263865a48973767ce8ed7b7788059a38a24a9f37 switched tuplesort.c and  
tuplestore.c variables representing memory usage from type "long" to  
type "Size".  This was unnecessary; I thought doing so avoided overflow  
scenarios on 64-bit Windows, but guc.c already limited work_mem so as to  
prevent the overflow.  It was also incomplete, not touching the logic  
that assumed a signed data type.  Change the affected variables to  
"int64".  This is perfect for 64-bit platforms, and it reduces the need  
to contemplate platform-specific overflow scenarios.  It also puts us  
close to being able to support work_mem over 2 GiB on 64-bit Windows.  
  
Per report from Andres Freund.  

M src/backend/utils/sort/tuplesort.c
M src/backend/utils/sort/tuplestore.c
M src/include/utils/tuplesort.h

Fix typo in comment.

commit   : 7842d41df56ab8ad9aff76bc5bd8e96c3d215cde    
  
author   : Fujii Masao <[email protected]>    
date     : Fri, 5 Jul 2013 02:47:49 +0900    
  
committer: Fujii Masao <[email protected]>    
date     : Fri, 5 Jul 2013 02:47:49 +0900    

Click here for diff

Michael Paquier  

M src/backend/access/heap/tuptoaster.c

Add C comment about \copy bug in CSV mode Comment: This code erroneously assumes '\.' on a line alone inside a quoted CSV string terminates the \copy. http://www.postgresql.org/message-id/[email protected]

commit   : 361b94c4b98b85b19b850cff37be76d1f6d4f8f7    
  
author   : Bruce Momjian <[email protected]>    
date     : Thu, 4 Jul 2013 13:09:52 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Thu, 4 Jul 2013 13:09:52 -0400    

Click here for diff

M src/bin/psql/copy.c

Add contrib function references in the doc index Backpatch to 9.3. Idea from Craig Ringer

commit   : 20a1b9e71b18ba823858597dfd445174451ff5e7    
  
author   : Bruce Momjian <[email protected]>    
date     : Thu, 4 Jul 2013 11:33:08 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Thu, 4 Jul 2013 11:33:08 -0400    

Click here for diff

M doc/src/sgml/dblink.sgml
M doc/src/sgml/earthdistance.sgml
M doc/src/sgml/fuzzystrmatch.sgml
M doc/src/sgml/hstore.sgml
M doc/src/sgml/intagg.sgml
M doc/src/sgml/intarray.sgml
M doc/src/sgml/isn.sgml
M doc/src/sgml/ltree.sgml
M doc/src/sgml/pageinspect.sgml
M doc/src/sgml/pgbuffercache.sgml
M doc/src/sgml/pgcrypto.sgml
M doc/src/sgml/pgfreespacemap.sgml
M doc/src/sgml/pgrowlocks.sgml
M doc/src/sgml/pgstatstatements.sgml
M doc/src/sgml/pgstattuple.sgml
M doc/src/sgml/pgtrgm.sgml
M doc/src/sgml/sslinfo.sgml
M doc/src/sgml/tablefunc.sgml
M doc/src/sgml/uuid-ossp.sgml
M doc/src/sgml/xml2.sgml

Add new GUC, max_worker_processes, limiting number of bgworkers.

commit   : 6bc8ef0b7f1f1df3998745a66e1790e27424aa0c    
  
author   : Robert Haas <[email protected]>    
date     : Thu, 4 Jul 2013 11:24:24 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Thu, 4 Jul 2013 11:24:24 -0400    

Click here for diff

In 9.3, there's no particular limit on the number of bgworkers;  
instead, we just count up the number that are actually registered,  
and use that to set MaxBackends.  However, that approach causes  
problems for Hot Standby, which needs both MaxBackends and the  
size of the lock table to be the same on the standby as on the  
master, yet it may not be desirable to run the same bgworkers in  
both places.  9.3 handles that by failing to notice the problem,  
which will probably work fine in nearly all cases anyway, but is  
not theoretically sound.  
  
A further problem with simply counting the number of registered  
workers is that new workers can't be registered without a  
postmaster restart.  This is inconvenient for administrators,  
since bouncing the postmaster causes an interruption of service.  
Moreover, there are a number of applications for background  
processes where, by necessity, the background process must be  
started on the fly (e.g. parallel query).  While this patch  
doesn't actually make it possible to register new background  
workers after startup time, it's a necessary prerequisite.  
  
Patch by me.  Review by Michael Paquier.  

M doc/src/sgml/bgworker.sgml
M doc/src/sgml/config.sgml
M src/backend/access/rmgrdesc/xlogdesc.c
M src/backend/access/transam/xlog.c
M src/backend/postmaster/postmaster.c
M src/backend/storage/lmgr/proc.c
M src/backend/utils/init/globals.c
M src/backend/utils/init/postinit.c
M src/backend/utils/misc/guc.c
M src/backend/utils/misc/postgresql.conf.sample
M src/bin/pg_controldata/pg_controldata.c
M src/bin/pg_resetxlog/pg_resetxlog.c
M src/include/access/xlog_internal.h
M src/include/catalog/pg_control.h
M src/include/miscadmin.h

docs: Clarify flag dependencies for background workers.

commit   : 5cbe935c9d6046f5600ff2e083b4bae6ee1f4aa2    
  
author   : Robert Haas <[email protected]>    
date     : Thu, 4 Jul 2013 11:11:56 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Thu, 4 Jul 2013 11:11:56 -0400    

Click here for diff

BGWORKER_BACKEND_DATABASE_CONNECTION can only be used if  
BGWORKER_SHMEM_ACCESS is also used.  
  
Michael Paquier, with some tweaks by me.  

M doc/src/sgml/bgworker.sgml

doc: Fix typo in event trigger documentation

commit   : 0d1795680d57d5997c244410e4d8a2eca22ae903    
  
author   : Peter Eisentraut <[email protected]>    
date     : Thu, 4 Jul 2013 10:27:33 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Thu, 4 Jul 2013 10:27:33 -0400    

Click here for diff

From: Dimitri Fontaine <[email protected]>  

M doc/src/sgml/event-trigger.sgml

doc: Add event trigger C API documentation

commit   : 0fe21ad8aab03172d4ac2e790479f17edcd3dbbe    
  
author   : Peter Eisentraut <[email protected]>    
date     : Wed, 3 Jul 2013 21:06:20 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Wed, 3 Jul 2013 21:06:20 -0400    

Click here for diff

From: Dimitri Fontaine <[email protected]>  

M doc/src/sgml/event-trigger.sgml

Install all a Makefile's extension controls, not just the first.

commit   : 82b0102650cf85268145a46f0ab488bacf6599a1    
  
author   : Andrew Dunstan <[email protected]>    
date     : Wed, 3 Jul 2013 19:03:31 -0400    
  
committer: Andrew Dunstan <[email protected]>    
date     : Wed, 3 Jul 2013 19:03:31 -0400    

Click here for diff

Bug introduced by commit 6697aa2bc25c83b88d6165340348a31328c35de6 and  
reported by Robert Haas.  

M src/makefiles/pgxs.mk

Get rid of pg_class.reltoastidxid.

commit   : 2ef085d0e6960f5087c97266a7211d37ddaa9f68    
  
author   : Fujii Masao <[email protected]>    
date     : Thu, 4 Jul 2013 03:24:09 +0900    
  
committer: Fujii Masao <[email protected]>    
date     : Thu, 4 Jul 2013 03:24:09 +0900    

Click here for diff

Treat TOAST index just the same as normal one and get the OID  
of TOAST index from pg_index but not pg_class.reltoastidxid.  
This change allows us to handle multiple TOAST indexes, and  
which is required infrastructure for upcoming  
REINDEX CONCURRENTLY feature.  
  
Patch by Michael Paquier, reviewed by Andres Freund and me.  

M contrib/pg_upgrade/info.c
M doc/src/sgml/catalogs.sgml
M doc/src/sgml/diskusage.sgml
M doc/src/sgml/monitoring.sgml
M src/backend/access/heap/tuptoaster.c
M src/backend/catalog/heap.c
M src/backend/catalog/index.c
M src/backend/catalog/system_views.sql
M src/backend/commands/cluster.c
M src/backend/commands/tablecmds.c
M src/backend/rewrite/rewriteDefine.c
M src/backend/utils/adt/dbsize.c
M src/bin/pg_dump/pg_dump.c
M src/include/access/tuptoaster.h
M src/include/catalog/catversion.h
M src/include/catalog/pg_class.h
M src/test/regress/expected/oidjoins.out
M src/test/regress/expected/rules.out
M src/test/regress/sql/oidjoins.sql
M src/test/regress/sql/rules.sql
M src/tools/findoidjoins/README

pg_buffercache: document column meanings Improve documentation for usagecount and relforknumber. Backpatch to 9.3. Suggestion from Satoshi Nagayasu

commit   : f71939cd1ac765ba618115f40de4d9c47955a9ef    
  
author   : Bruce Momjian <[email protected]>    
date     : Wed, 3 Jul 2013 14:19:44 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Wed, 3 Jul 2013 14:19:44 -0400    

Click here for diff

M doc/src/sgml/pgbuffercache.sgml

Revert "Hopefully-portable regression tests for CREATE/ALTER/DROP COLLATION."

commit   : f33c53ec5b27a90a0f00ac27d4e5178fcc33168f    
  
author   : Robert Haas <[email protected]>    
date     : Wed, 3 Jul 2013 13:27:50 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Wed, 3 Jul 2013 13:27:50 -0400    

Click here for diff

This reverts commit 263645305b8f14a3821e04dffa96fa7c1bc2ae86.  
  
The buildfarm is sad.  

M src/test/regress/expected/collate.out
M src/test/regress/sql/collate.sql

Hopefully-portable regression tests for CREATE/ALTER/DROP COLLATION.

commit   : 263645305b8f14a3821e04dffa96fa7c1bc2ae86    
  
author   : Robert Haas <[email protected]>    
date     : Wed, 3 Jul 2013 12:24:26 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Wed, 3 Jul 2013 12:24:26 -0400    

Click here for diff

The collate.linux.utf8 test covers some of the same territory, but  
isn't portable and so probably does not get run often, or on  
non-Linux platforms.  If this approach turns out to be sufficiently  
portable, we may want to look at trimming the redundant tests out  
of that file to avoid duplication.  
  
Robins Tharakan, reviewed by Michael Paquier and Fabien Coelho,  
with further changes and cleanup by me.  

M src/test/regress/expected/collate.out
M src/test/regress/sql/collate.sql

Fix handling of auto-updatable views on inherited tables.

commit   : 5530a826434a8d4bc6ba7387d05aa14755406199    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 3 Jul 2013 12:26:19 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 3 Jul 2013 12:26:19 -0400    

Click here for diff

An INSERT into such a view should work just like an INSERT into its base  
table, ie the insertion should go directly into that table ... not be  
duplicated into each child table, as was happening before, per bug #8275  
from Rushabh Lathia.  On the other hand, the current behavior for  
UPDATE/DELETE seems reasonable: the update/delete traverses the child  
tables, or not, depending on whether the view specifies ONLY or not.  
Add some regression tests covering this area.  
  
Dean Rasheed  

M src/backend/rewrite/rewriteHandler.c
M src/test/regress/expected/updatable_views.out
M src/test/regress/sql/updatable_views.sql

Unbreak postmaster restart-after-crash sequence

commit   : 620935ad088d4779ed7fa65f38a876b30e01dee4    
  
author   : Alvaro Herrera <[email protected]>    
date     : Wed, 3 Jul 2013 11:04:21 -0400    
  
committer: Alvaro Herrera <[email protected]>    
date     : Wed, 3 Jul 2013 11:04:21 -0400    

Click here for diff

In patch 82233ce7ea42, AbortStartTime wasn't being reset appropriately  
after the restart sequence, causing subsequent iterations through  
ServerLoop to malfunction.  

M src/backend/postmaster/postmaster.c

Regression tests for LISTEN/NOTIFY/UNLISTEN/pg_notify.

commit   : 00a7767fcc2e4d90e3b4cacb87974ec5a0f32b8c    
  
author   : Robert Haas <[email protected]>    
date     : Wed, 3 Jul 2013 11:06:45 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Wed, 3 Jul 2013 11:06:45 -0400    

Click here for diff

Robins Tharakan, reviewed by Szymon Guz  

A src/test/regress/expected/async.out
M src/test/regress/parallel_schedule
M src/test/regress/serial_schedule
A src/test/regress/sql/async.sql

Additional regression tests for CREATE OPERATOR.

commit   : ada3e776c2a4825ed0387e4bcf335139b101ca98    
  
author   : Robert Haas <[email protected]>    
date     : Wed, 3 Jul 2013 10:48:26 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Wed, 3 Jul 2013 10:48:26 -0400    

Click here for diff

Robins Tharakan, reviewed by Szymon Guz  

M src/test/regress/expected/create_operator.out
M src/test/regress/sql/create_operator.sql

Expose object name error fields in PL/pgSQL.

commit   : 7cd9b1371d8b18d063dc38bc4fa7b30bd92c07a3    
  
author   : Noah Misch <[email protected]>    
date     : Wed, 3 Jul 2013 07:29:23 -0400    
  
committer: Noah Misch <[email protected]>    
date     : Wed, 3 Jul 2013 07:29:23 -0400    

Click here for diff

Specifically, permit attaching them to the error in RAISE and retrieving  
them from a caught error in GET STACKED DIAGNOSTICS.  RAISE enforces  
nothing about the content of the fields; for its purposes, they are just  
additional string fields.  Consequently, clarify in the protocol and  
libpq documentation that the usual relationships between error fields,  
like a schema name appearing wherever a table name appears, are not  
universal.  This freedom has other applications; consider a FDW  
propagating an error from an RDBMS having no schema support.  
  
Back-patch to 9.3, where core support for the error fields was  
introduced.  This prevents the confusion of having a release where libpq  
exposes the fields and PL/pgSQL does not.  
  
Pavel Stehule, lexical revisions by Noah Misch.  

M doc/src/sgml/libpq.sgml
M doc/src/sgml/plpgsql.sgml
M doc/src/sgml/protocol.sgml
M src/pl/plpgsql/src/pl_exec.c
M src/pl/plpgsql/src/pl_funcs.c
M src/pl/plpgsql/src/pl_gram.y
M src/pl/plpgsql/src/pl_scanner.c
M src/pl/plpgsql/src/plpgsql.h
M src/test/regress/expected/plpgsql.out
M src/test/regress/sql/plpgsql.sql

doc: Remove i18ngurus.com link

commit   : 69e4fd4541979209d3bd238508d46d64c8ad46df    
  
author   : Peter Eisentraut <[email protected]>    
date     : Tue, 2 Jul 2013 20:32:09 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Tue, 2 Jul 2013 20:32:09 -0400    

Click here for diff

The web site is dead, and the Wayback Machine shows that it didn't have  
much useful content before.  

M doc/src/sgml/charset.sgml

Add #include to make header file independent

commit   : d86485268535c80426e5fbf2831704b2f8253c13    
  
author   : Peter Eisentraut <[email protected]>    
date     : Tue, 2 Jul 2013 20:19:52 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Tue, 2 Jul 2013 20:19:52 -0400    

Click here for diff

M src/include/catalog/pg_db_role_setting.h

commit   : 5ecfa1f6a338760723ba57ea6e132844ddefe19d    
  
author   : Peter Eisentraut <[email protected]>    
date     : Tue, 2 Jul 2013 20:12:58 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Tue, 2 Jul 2013 20:12:58 -0400    

Click here for diff

M doc/src/sgml/ref/create_event_trigger.sgml
M doc/src/sgml/ref/create_trigger.sgml
M doc/src/sgml/ref/create_view.sgml

pg_restore: Error about incompatible options

commit   : 614ce64f6c78a73861785e65d80deec8d280a5e9    
  
author   : Peter Eisentraut <[email protected]>    
date     : Tue, 2 Jul 2013 20:07:35 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Tue, 2 Jul 2013 20:07:35 -0400    

Click here for diff

This mirrors the equivalent error cases in pg_dump.  

M src/bin/pg_dump/pg_restore.c

Add support for multiple kinds of external toast datums.

commit   : 3682025015390a8e802e0752589162db7bd70b5d    
  
author   : Robert Haas <[email protected]>    
date     : Tue, 2 Jul 2013 13:35:14 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Tue, 2 Jul 2013 13:35:14 -0400    

Click here for diff

To that end, support tags rather than lengths for external datums.  
As an example of how this can be used, add support or "indirect"  
tuples which point to some externally allocated memory containing  
a toast tuple.  Similar infrastructure could be used for other  
purposes, including, perhaps, support for alternative compression  
algorithms.  
  
Andres Freund, reviewed by Hitoshi Harada and myself  

M src/backend/access/heap/tuptoaster.c
M src/include/access/tuptoaster.h
M src/include/postgres.h
A src/test/regress/expected/indirect_toast.out
M src/test/regress/input/create_function_1.source
M src/test/regress/output/create_function_1.source
M src/test/regress/parallel_schedule
M src/test/regress/regress.c
M src/test/regress/serial_schedule
A src/test/regress/sql/indirect_toast.sql

Mention extra_float_digits in floating point docs

commit   : 148326b9940c6f3aa554df83a70c7d4563f67d86    
  
author   : Alvaro Herrera <[email protected]>    
date     : Tue, 2 Jul 2013 12:21:16 -0400    
  
committer: Alvaro Herrera <[email protected]>    
date     : Tue, 2 Jul 2013 12:21:16 -0400    

Click here for diff

Make it easier for readers of the FP docs to find out about possibly  
truncated values.  
  
Per complaint from Tom Duffey in message  
[email protected]  
  
Author: Albe Laurenz  
Reviewed by: Abhijit Menon-Sen  

M doc/src/sgml/config.sgml
M doc/src/sgml/datatype.sgml

Silence compiler warning in assertion-enabled builds.

commit   : d2e71ff7573e67fc0a263d0ba6fe2ffbc175d1ad    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Tue, 2 Jul 2013 17:23:42 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Tue, 2 Jul 2013 17:23:42 +0300    

Click here for diff

With -Wtype-limits, gcc correctly points out that size_t can never be < 0.  
Backpatch to 9.3 and 9.2. It's been like this forever, but in <= 9.1 you got  
a lot other warnings with -Wtype-limits anyway (at least with my version of  
gcc).  
  
Andres Freund  

M src/pl/plpython/plpy_procedure.c

pg_upgrade: revert changing '' to "" On the command line, GUC option strings are handled by the guc parser, not by the shell parser, so '' is the proper way to represent a zero-length string. This reverts commit 3132a9b7ab3d76c15f88cfa29792fd888e7a959e.

commit   : cce5d851ed773dd01bfb0ba3e653636fb8f40f32    
  
author   : Bruce Momjian <[email protected]>    
date     : Tue, 2 Jul 2013 10:29:27 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Tue, 2 Jul 2013 10:29:27 -0400    

Click here for diff

M contrib/pg_upgrade/server.c

Use an MVCC snapshot, rather than SnapshotNow, for catalog scans.

commit   : 568d4138c646cd7cd8a837ac244ef2caf27c6bb8    
  
author   : Robert Haas <[email protected]>    
date     : Tue, 2 Jul 2013 09:47:01 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Tue, 2 Jul 2013 09:47:01 -0400    

Click here for diff

SnapshotNow scans have the undesirable property that, in the face of  
concurrent updates, the scan can fail to see either the old or the new  
versions of the row.  In many cases, we work around this by requiring  
DDL operations to hold AccessExclusiveLock on the object being  
modified; in some cases, the existing locking is inadequate and random  
failures occur as a result.  This commit doesn't change anything  
related to locking, but will hopefully pave the way to allowing lock  
strength reductions in the future.  
  
The major issue has held us back from making this change in the past  
is that taking an MVCC snapshot is significantly more expensive than  
using a static special snapshot such as SnapshotNow.  However, testing  
of various worst-case scenarios reveals that this problem is not  
severe except under fairly extreme workloads.  To mitigate those  
problems, we avoid retaking the MVCC snapshot for each new scan;  
instead, we take a new snapshot only when invalidation messages have  
been processed.  The catcache machinery already requires that  
invalidation messages be sent before releasing the related heavyweight  
lock; else other backends might rely on locally-cached data rather  
than scanning the catalog at all.  Thus, making snapshot reuse  
dependent on the same guarantees shouldn't break anything that wasn't  
already subtly broken.  
  
Patch by me.  Review by Michael Paquier and Andres Freund.  

M contrib/dblink/dblink.c
M contrib/sepgsql/label.c
M doc/src/sgml/indexam.sgml
M src/backend/access/heap/heapam.c
M src/backend/access/index/genam.c
M src/backend/access/nbtree/README
M src/backend/access/rmgrdesc/xactdesc.c
M src/backend/bootstrap/bootstrap.c
M src/backend/catalog/aclchk.c
M src/backend/catalog/catalog.c
M src/backend/catalog/dependency.c
M src/backend/catalog/heap.c
M src/backend/catalog/index.c
M src/backend/catalog/namespace.c
M src/backend/catalog/objectaddress.c
M src/backend/catalog/pg_collation.c
M src/backend/catalog/pg_constraint.c
M src/backend/catalog/pg_conversion.c
M src/backend/catalog/pg_db_role_setting.c
M src/backend/catalog/pg_depend.c
M src/backend/catalog/pg_enum.c
M src/backend/catalog/pg_inherits.c
M src/backend/catalog/pg_largeobject.c
M src/backend/catalog/pg_range.c
M src/backend/catalog/pg_shdepend.c
M src/backend/commands/cluster.c
M src/backend/commands/comment.c
M src/backend/commands/dbcommands.c
M src/backend/commands/extension.c
M src/backend/commands/functioncmds.c
M src/backend/commands/indexcmds.c
M src/backend/commands/opclasscmds.c
M src/backend/commands/proclang.c
M src/backend/commands/seclabel.c
M src/backend/commands/tablecmds.c
M src/backend/commands/tablespace.c
M src/backend/commands/trigger.c
M src/backend/commands/tsearchcmds.c
M src/backend/commands/typecmds.c
M src/backend/commands/user.c
M src/backend/commands/vacuum.c
M src/backend/executor/nodeBitmapHeapscan.c
M src/backend/postmaster/autovacuum.c
M src/backend/postmaster/pgstat.c
M src/backend/rewrite/rewriteDefine.c
M src/backend/rewrite/rewriteHandler.c
M src/backend/rewrite/rewriteRemove.c
M src/backend/rewrite/rewriteSupport.c
M src/backend/storage/large_object/inv_api.c
M src/backend/utils/adt/dbsize.c
M src/backend/utils/adt/regproc.c
M src/backend/utils/adt/ruleutils.c
M src/backend/utils/cache/catcache.c
M src/backend/utils/cache/evtcache.c
M src/backend/utils/cache/inval.c
M src/backend/utils/cache/relcache.c
M src/backend/utils/cache/syscache.c
M src/backend/utils/cache/ts_cache.c
M src/backend/utils/cache/typcache.c
M src/backend/utils/init/postinit.c
M src/backend/utils/time/snapmgr.c
M src/bin/pg_dump/pg_dump.c
M src/include/access/heapam.h
M src/include/access/relscan.h
M src/include/catalog/objectaccess.h
M src/include/catalog/pg_db_role_setting.h
M src/include/storage/sinval.h
M src/include/utils/snapmgr.h
M src/include/utils/syscache.h

Fix regression test make dependencies

commit   : 384f933046dc9e9a2b416f5f7b3be30b93587c63    
  
author   : Peter Eisentraut <[email protected]>    
date     : Mon, 1 Jul 2013 21:10:36 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Mon, 1 Jul 2013 21:10:36 -0400    

Click here for diff

The dependencies on the spi and dummy_seclabel contrib modules were  
incomplete, because they did not pick up automatically generated  
dependencies on header files.  This will manifest itself especially when  
switching major versions, where the contrib modules would not be  
recompiled to contain the new version number, leading to regression test  
failures.  
  
To fix this, use the submake approach already in use elsewhere, so that  
the contrib modules are built using their full rules.  

M src/test/regress/GNUmakefile

pg_dump docs: use escaped double-quotes, for Windows On Unix, you can embed double-quotes in single-quotes, and via versa. However, on Windows, you can only escape double-quotes in double-quotes, so use that in the pg_dump -t/table example. Backpatch to 9.3. Report from Mike Toews

commit   : 605b4c5a6b4708d9a72c205cb5b14b5f57bd53a8    
  
author   : Bruce Momjian <[email protected]>    
date     : Mon, 1 Jul 2013 14:52:56 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Mon, 1 Jul 2013 14:52:56 -0400    

Click here for diff

M doc/src/sgml/ref/pg_dump.sgml

Add a convenience routine makeFuncCall to reduce duplication.

commit   : 0d22987ae9fe5dc9861e314f1609c8b69d61bbfc    
  
author   : Robert Haas <[email protected]>    
date     : Mon, 1 Jul 2013 14:41:33 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Mon, 1 Jul 2013 14:41:33 -0400    

Click here for diff

David Fetter and Andrew Gierth, reviewed by Jeevan Chalke  

M src/backend/nodes/makefuncs.c
M src/backend/parser/gram.y
M src/backend/parser/parse_utilcmd.c
M src/include/nodes/makefuncs.h
M src/include/nodes/parsenodes.h

pg_upgrade: use "" rather than '', for Windows If we ever support unix sockets on Windows, we should use "" rather than '' for zero-length strings on the command-line, so use that.

commit   : 3132a9b7ab3d76c15f88cfa29792fd888e7a959e    
  
author   : Bruce Momjian <[email protected]>    
date     : Mon, 1 Jul 2013 14:45:45 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Mon, 1 Jul 2013 14:45:45 -0400    

Click here for diff

M contrib/pg_upgrade/server.c

Add timezone offset output option to to_char() Add ability for to_char() to output the timezone's UTC offset (OF). We already have the ability to return the timezone abbeviation (TZ/tz). Per request from Andrew Dunstan

commit   : 7408c5d29b53fbeae0d88ab8121a42c3b4d9ed64    
  
author   : Bruce Momjian <[email protected]>    
date     : Mon, 1 Jul 2013 13:40:18 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Mon, 1 Jul 2013 13:40:18 -0400    

Click here for diff

M doc/src/sgml/func.sgml
M src/backend/utils/adt/formatting.c

Improve support for building PGXS modules with VPATH.

commit   : 6697aa2bc25c83b88d6165340348a31328c35de6    
  
author   : Andrew Dunstan <[email protected]>    
date     : Mon, 1 Jul 2013 12:53:05 -0400    
  
committer: Andrew Dunstan <[email protected]>    
date     : Mon, 1 Jul 2013 12:53:05 -0400    

Click here for diff

A VPATH build will be performed when the module's make file path is not  
the current directory or when USE_VPATH is set.  
  
This will assist packagers and others who prefer to build without  
polluting the source directories.  
  
There is still a bit of work to do here, notably documentation, but it's  
probably a good idea to commit what we have so far and let people test  
it out on their modules.  
  
Cédric Villemain, with an addition from me.  

M src/Makefile.global.in
M src/makefiles/pgxs.mk

Update LSB URL in pg_ctl Update Linux Standard Base Core Specification 3.1 URL mention in pg_ctl comments.

commit   : 6d432152b9e5627532c52d6f1c9959cb3be52e29    
  
author   : Bruce Momjian <[email protected]>    
date     : Mon, 1 Jul 2013 12:46:13 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Mon, 1 Jul 2013 12:46:13 -0400    

Click here for diff

M src/bin/pg_ctl/pg_ctl.c

Remove undocumented -h (help) option The -h option was not supported by many tools, and not documented, so remove them for consistency from pg_upgrade, pg_test_fsync, and pg_test_timing.

commit   : 06b804377cc5628f24ff37de719995a65f6f5928    
  
author   : Bruce Momjian <[email protected]>    
date     : Mon, 1 Jul 2013 12:40:02 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Mon, 1 Jul 2013 12:40:02 -0400    

Click here for diff

M contrib/pg_test_fsync/pg_test_fsync.c
M contrib/pg_test_timing/pg_test_timing.c
M src/bin/pg_ctl/pg_ctl.c
M src/bin/psql/startup.c

Optimize pglz compressor for small inputs.

commit   : 031cc55bbea6b3a6b67c700498a78fb1d4399476    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Mon, 1 Jul 2013 11:00:14 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Mon, 1 Jul 2013 11:00:14 +0300    

Click here for diff

The pglz compressor has a significant startup cost, because it has to  
initialize to zeros the history-tracking hash table. On a 64-bit system, the  
hash table was 64kB in size. While clearing memory is pretty fast, for very  
short inputs the relative cost of that was quite large.  
  
This patch alleviates that in two ways. First, instead of storing pointers  
in the hash table, store 16-bit indexes into the hist_entries array. That  
slashes the size of the hash table to 1/2 or 1/4 of the original, depending  
on the pointer width. Secondly, adjust the size of the hash table based on  
input size. For very small inputs, you don't need a large hash table to  
avoid collisions.  
  
Review by Amit Kapila.  

M src/backend/utils/adt/pg_lzcompress.c

Retry short writes when flushing WAL.

commit   : 79ce29c734c6a652b2f7193bda537cff0c8eb8c1    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Mon, 1 Jul 2013 09:36:00 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Mon, 1 Jul 2013 09:36:00 +0300    

Click here for diff

We don't normally bother retrying when the number of bytes written by  
write() is short of what was requested. It is generally assumed that a  
write() to disk doesn't return short, unless you run out of disk space.  
While writing the WAL, however, it seems prudent to try a bit harder,  
because a failure leads to PANIC. The write() is also much larger than most  
write()s in the backend (up to wal_buffers), so there's more room for  
surprises.  
  
Also retry on EINTR. All signals used in the backend are flagged SA_RESTART  
nowadays, so it shouldn't happen, but better to be defensive.  

M src/backend/access/transam/xlog.c

Fix cpluspluscheck in checksum code

commit   : 129759d6a539059cde85d0dad19992ff45da3bb4    
  
author   : Peter Eisentraut <[email protected]>    
date     : Sun, 30 Jun 2013 10:25:43 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Sun, 30 Jun 2013 10:25:43 -0400    

Click here for diff

C++ is more picky about comparing signed and unsigned integers.  

M src/include/storage/checksum_impl.h

ecpg: Consistently use mm_strdup()

commit   : 14a85031b16239708d4f208528709153779c590d    
  
author   : Peter Eisentraut <[email protected]>    
date     : Sat, 29 Jun 2013 22:14:56 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Sat, 29 Jun 2013 22:14:56 -0400    

Click here for diff

mm_strdup() is provided to check errors from strdup(), but some places  
were failing to use it.  

M src/interfaces/ecpg/preproc/ecpg.addons
M src/interfaces/ecpg/preproc/ecpg.c
M src/interfaces/ecpg/preproc/ecpg.trailer

Inline ginCompareItemPointers function for speed.

commit   : ee6556555b237c0feeb175e7ea7ce23af959e7ba    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Sat, 29 Jun 2013 12:54:02 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Sat, 29 Jun 2013 12:54:02 +0300    

Click here for diff

ginCompareItemPointers function is called heavily in gin index scans -  
inlining it speeds up some kind of queries a lot.  

M src/backend/access/gin/gindatapage.c
M src/include/access/gin_private.h

Change errcode for lock_timeout to match NOWAIT

commit   : d51b271059ba736f71c5372f713d907f711208ec    
  
author   : Simon Riggs <[email protected]>    
date     : Sat, 29 Jun 2013 00:57:25 +0100    
  
committer: Simon Riggs <[email protected]>    
date     : Sat, 29 Jun 2013 00:57:25 +0100    

Click here for diff

Set errcode to ERRCODE_LOCK_NOT_AVAILABLE  
  
Zoltán Bsöszörményi  

M src/backend/tcop/postgres.c

ALTER TABLE ... ALTER CONSTRAINT for FKs

commit   : f177cbfe676dc2c7ca2b206c54d6bf819feeea8b    
  
author   : Simon Riggs <[email protected]>    
date     : Sat, 29 Jun 2013 00:27:30 +0100    
  
committer: Simon Riggs <[email protected]>    
date     : Sat, 29 Jun 2013 00:27:30 +0100    

Click here for diff

Allow constraint attributes to be altered,  
so the default setting of NOT DEFERRABLE  
can be altered to DEFERRABLE and back.  
  
Review by Abhijit Menon-Sen  

M doc/src/sgml/ref/alter_table.sgml
M src/backend/commands/tablecmds.c
M src/backend/parser/gram.y
M src/include/nodes/parsenodes.h
M src/test/regress/expected/foreign_key.out
M src/test/regress/sql/foreign_key.sql

Assert that ALTER TABLE subcommands have pass set

commit   : 2f74e4ec50dc625605e9a7afd63bd8a48c981d9e    
  
author   : Simon Riggs <[email protected]>    
date     : Sat, 29 Jun 2013 00:26:46 +0100    
  
committer: Simon Riggs <[email protected]>    
date     : Sat, 29 Jun 2013 00:26:46 +0100    

Click here for diff

M src/backend/commands/tablecmds.c

pg_upgrade: pass username to analyze script If -U (user) is specified, pass the username into the created analyze script. Per request from Ray Stell

commit   : f85136106d87f54e87635736dfe1b8227b6803ad    
  
author   : Bruce Momjian <[email protected]>    
date     : Fri, 28 Jun 2013 19:11:51 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Fri, 28 Jun 2013 19:11:51 -0400    

Click here for diff

M contrib/pg_upgrade/check.c
M contrib/pg_upgrade/option.c
M contrib/pg_upgrade/pg_upgrade.h

pg_upgrade: remove -h option -h (help) is not needed; pg_upgrade already supports --help and -?, which is consistent with other tools.

commit   : e029275cdeb39cd2178ac23e2fcc65520f7b7b9c    
  
author   : Bruce Momjian <[email protected]>    
date     : Fri, 28 Jun 2013 18:10:13 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Fri, 28 Jun 2013 18:10:13 -0400    

Click here for diff

M contrib/pg_upgrade/option.c
M doc/src/sgml/pgupgrade.sgml

pg_upgrade: trim down --help and doc option descriptions Previous code had old/new prefixes on option values, e.g. --old-datadir=OLDDATADIR. Remove them, for simplicity; now: --old-datadir=DATADIR. Also update docs to do the same.

commit   : fb771f9086aab3018b652e1d8e5207208311bb23    
  
author   : Bruce Momjian <[email protected]>    
date     : Fri, 28 Jun 2013 18:01:46 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Fri, 28 Jun 2013 18:01:46 -0400    

Click here for diff

M contrib/pg_upgrade/option.c
M doc/src/sgml/pgupgrade.sgml

Send SIGKILL to children if they don't die quickly in immediate shutdown

commit   : 82233ce7ea42d6ba519aaec63008aff49da6c7af    
  
author   : Alvaro Herrera <[email protected]>    
date     : Fri, 28 Jun 2013 17:20:53 -0400    
  
committer: Alvaro Herrera <[email protected]>    
date     : Fri, 28 Jun 2013 17:20:53 -0400    

Click here for diff

On immediate shutdown, or during a restart-after-crash sequence,  
postmaster used to send SIGQUIT (and then abandon ship if shutdown); but  
this is not a good strategy if backends don't die because of that  
signal.  (This might happen, for example, if a backend gets tangled  
trying to malloc() due to gettext(), as in an example illustrated by  
MauMau.)  This causes problems when later trying to restart the server,  
because some processes are still attached to the shared memory segment.  
  
Instead of just abandoning such backends to their fates, we now have  
postmaster hang around for a little while longer, send a SIGKILL after  
some reasonable waiting period, and then exit.  This makes immediate  
shutdown more reliable.  
  
There is disagreement on whether it's best for postmaster to exit after  
sending SIGKILL, or to stick around until all children have reported  
death.  If this controversy is resolved differently than what this patch  
implements, it's an easy change to make.  
  
Bug reported by MauMau in message 20DAEA8949EC4E2289C6E8E58560DEC0@maumau  
  
MauMau and Álvaro Herrera  

M doc/src/sgml/runtime.sgml
M src/backend/postmaster/postmaster.c
M src/port/kill.c

pg_upgrade: change -u to -U, for consistency Change -u (user) option to -U, for consistency with other tools like pg_dump and psql. Also expand --user to --username, again for consistency. BACKWARD INCOMPATIBILITY

commit   : 457d6cf049c57cabe9b46ea13f26138040a214ec    
  
author   : Bruce Momjian <[email protected]>    
date     : Fri, 28 Jun 2013 17:27:02 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Fri, 28 Jun 2013 17:27:02 -0400    

Click here for diff

M contrib/pg_upgrade/option.c
M doc/src/sgml/pgupgrade.sgml

Make the OVER keyword unreserved.

commit   : 5893ffa79c03824f34ae3d37f211381fd1c17283    
  
author   : Robert Haas <[email protected]>    
date     : Fri, 28 Jun 2013 10:18:00 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Fri, 28 Jun 2013 10:18:00 -0400    

Click here for diff

This results in a slightly less specific error message when OVER  
is used in a context where we don't accept window functions, but  
per discussion, it's worth it to get the benefit of not needing  
to reserve this keyword any more.  This same refactoring will  
also let us avoid reserving some other keywords that we expect  
to add in upcoming patches (specifically, IGNORE, RESPECT, and  
FILTER).  
  
Troels Nielsen, with minor changes by me  

M src/backend/parser/gram.y
M src/include/parser/kwlist.h
M src/test/regress/expected/window.out

Define Trap and TrapMacro even in non-cassert builds.

commit   : 5ee73525d57380a55b5c87f8df1c30bd32fb98b3    
  
author   : Robert Haas <[email protected]>    
date     : Fri, 28 Jun 2013 09:30:38 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Fri, 28 Jun 2013 09:30:38 -0400    

Click here for diff

In some cases, the use of these macros may be preferable to Assert()  
or AssertMacro(), since this way the caller can set the trap message.  
  
Andres Freund and Robert Haas  

M src/include/c.h

Track spinlock delay in microsecond granularity.

commit   : 9e0bc7c1e84d7fffb93130f2b7d079a0853329ed    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Fri, 28 Jun 2013 12:30:55 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Fri, 28 Jun 2013 12:30:55 +0300    

Click here for diff

On many platforms the OS will round the sleep time to millisecond  
resolution, but there is no reason for us to pre-emptively round the  
argument to pg_usleep.  
  
When the delay was measured in milliseconds and started from 1 ms, it  
sometimes took many attempts until the logic that increases the delay by  
multiplying with a random value between 1 and 2 actually managed to bump it  
from 1 ms to 2 ms. That lead to a sequence of 1 ms waits until the delay  
started to increase. This wasn't really a problem but it looked odd if you  
observed the waits. There is no measurable difference in performance, but  
it's more readable this way.  
  
Jeff Janes  

M src/backend/storage/lmgr/s_lock.c

Update pg_resetxlog's documentation on multixacts

commit   : 9db4ad44eb02326bbe8eeaf7d1dd452844764a20    
  
author   : Alvaro Herrera <[email protected]>    
date     : Thu, 27 Jun 2013 15:31:04 -0400    
  
committer: Alvaro Herrera <[email protected]>    
date     : Thu, 27 Jun 2013 15:31:04 -0400    

Click here for diff

I added some more functionality to it in 0ac5ad5134f27 but neglected to  
add it to the docs.  
  
Per Peter Eisentraut in message  
[email protected]  

M doc/src/sgml/ref/pg_resetxlog.sgml
M src/bin/pg_resetxlog/pg_resetxlog.c

Document relminmxid and datminmxid

commit   : 863fad1bcc9de52381e117bfecc89dfb4a52f84a    
  
author   : Alvaro Herrera <[email protected]>    
date     : Thu, 27 Jun 2013 15:20:33 -0400    
  
committer: Alvaro Herrera <[email protected]>    
date     : Thu, 27 Jun 2013 15:20:33 -0400    

Click here for diff

I introduced these new fields in 0ac5ad5134f27 but neglected to add them  
to the system catalogs section of the docs.  
  
Per Thom Brown in message  
CAA-aLv7UiO=Whiq3MVbsEqSyQRthuX8Tb_RLyBuQt0KQBp=6EQ@mail.gmail.com  

M doc/src/sgml/catalogs.sgml

Permit super-MaxAllocSize allocations with MemoryContextAllocHuge().

commit   : 263865a48973767ce8ed7b7788059a38a24a9f37    
  
author   : Noah Misch <[email protected]>    
date     : Thu, 27 Jun 2013 14:53:57 -0400    
  
committer: Noah Misch <[email protected]>    
date     : Thu, 27 Jun 2013 14:53:57 -0400    

Click here for diff

The MaxAllocSize guard is convenient for most callers, because it  
reduces the need for careful attention to overflow, data type selection,  
and the SET_VARSIZE() limit.  A handful of callers are happy to navigate  
those hazards in exchange for the ability to allocate a larger chunk.  
Introduce MemoryContextAllocHuge() and repalloc_huge().  Use this in  
tuplesort.c and tuplestore.c, enabling internal sorts of up to INT_MAX  
tuples, a factor-of-48 increase.  In particular, B-tree index builds can  
now benefit from much-larger maintenance_work_mem settings.  
  
Reviewed by Stephen Frost, Simon Riggs and Jeff Janes.  

M src/backend/utils/mmgr/aset.c
M src/backend/utils/mmgr/mcxt.c
M src/backend/utils/sort/tuplesort.c
M src/backend/utils/sort/tuplestore.c
M src/include/utils/memutils.h
M src/include/utils/palloc.h
M src/include/utils/tuplesort.h

Mark index-constraint comments with correct dependency in pg_dump.

commit   : 9ef86cd994e9f2a684996df994d4657e84a6c0bb    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 27 Jun 2013 13:54:50 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 27 Jun 2013 13:54:50 -0400    

Click here for diff

When there's a comment on an index that was created with UNIQUE or PRIMARY  
KEY constraint syntax, we need to label the comment as depending on the  
constraint not the index, since only the constraint object actually appears  
in the dump.  This incorrect dependency can lead to parallel pg_restore  
trying to restore the comment before the index has been created, per bug  
#8257 from Lloyd Albin.  
  
This patch fixes pg_dump to produce the right dependency in dumps made  
in the future.  Usually we also try to hack pg_restore to work around  
bogus dependencies, so that existing (wrong) dumps can still be restored in  
parallel mode; but that doesn't seem practical here since there's no easy  
way to relate the constraint dump entry to the comment after the fact.  
  
Andres Freund  

M src/bin/pg_dump/pg_dump.c

Expect EWOULDBLOCK from a non-blocking connect() call only on Windows.

commit   : a099482c86d85299f1942b2919721a23da37724e    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 27 Jun 2013 12:36:44 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 27 Jun 2013 12:36:44 -0400    

Click here for diff

On Unix-ish platforms, EWOULDBLOCK may be the same as EAGAIN, which is  
*not* a success return, at least not on Linux.  We need to treat it as a  
failure to avoid giving a misleading error message.  Per the Single Unix  
Spec, only EINPROGRESS and EINTR returns indicate that the connection  
attempt is in progress.  
  
On Windows, on the other hand, EWOULDBLOCK (WSAEWOULDBLOCK) is the expected  
case.  We must accept EINPROGRESS as well because Cygwin will return that,  
and it doesn't seem worth distinguishing Cygwin from native Windows here.  
It's not very clear whether EINTR can occur on Windows, but let's leave  
that part of the logic alone in the absence of concrete trouble reports.  
  
Also, remove the test for errno == 0, effectively reverting commit  
da9501bddb42222dc33c031b1db6ce2133bcee7b, which AFAICS was just a thinko;  
or at best it might have been a workaround for a platform-specific bug,  
which we can hope is gone now thirteen years later.  In any case, since  
libpq makes no effort to reset errno to zero before calling connect(),  
it seems unlikely that that test has ever reliably done anything useful.  
  
Andres Freund and Tom Lane  

M src/interfaces/libpq/fe-connect.c

Fixed incorrect description of EXEC SQL VAR command.

commit   : a2769a4e2137bda5f3ad2834fbb5f353f86cab40    
  
author   : Michael Meskes <[email protected]>    
date     : Thu, 27 Jun 2013 16:00:32 +0200    
  
committer: Michael Meskes <[email protected]>    
date     : Thu, 27 Jun 2013 16:00:32 +0200    

Click here for diff

Thanks to MauMau <[email protected]> for finding and fixing this.  

M doc/src/sgml/ecpg.sgml

pgbench: Fix inadvertent inconsistency in help message.

commit   : 682d977f816e7fa7f29c723666248a8c3ac09bd6    
  
author   : Robert Haas <[email protected]>    
date     : Thu, 27 Jun 2013 10:33:04 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Thu, 27 Jun 2013 10:33:04 -0400    

Click here for diff

Per report from Fujii Masao.  

M contrib/pgbench/pgbench.c

pgbench: Add long options for all existing short options.

commit   : 79cddb18419778be3202c971b3f21cdd90f7b719    
  
author   : Robert Haas <[email protected]>    
date     : Thu, 27 Jun 2013 08:52:13 -0400    
  
committer: Robert Haas <[email protected]>    
date     : Thu, 27 Jun 2013 08:52:13 -0400    

Click here for diff

Fabien Coelho, reviewed by Fabrízio de Royes Mello, with some further  
changes by me  

M contrib/pgbench/pgbench.c
M doc/src/sgml/pgbench.sgml

Tweak wording in sequence-function docs to avoid PDF build failures.

commit   : a03ae56e40d7b401ebf93f5732e89ef8cb5237f9    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 27 Jun 2013 00:23:37 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 27 Jun 2013 00:23:37 -0400    

Click here for diff

Adjust the wording in the first para of "Sequence Manipulation Functions"  
so that neither of the link phrases in it break across line boundaries,  
in either A4- or US-page-size PDF output.  This fixes a reported build  
failure for the 9.3beta2 A4 PDF docs, and future-proofs this particular  
para against causing similar problems in future.  (Perhaps somebody will  
fix this issue in the SGML/TeX documentation tool chain someday, but I'm  
not holding my breath.)  
  
Back-patch to all supported branches, since the same problem could rise up  
to bite us in future updates if anyone changes anything earlier than this  
in func.sgml.  

M doc/src/sgml/func.sgml

Cooperate with the Valgrind instrumentation framework.

commit   : 19085116eeecfde0a3fc1611eaffccc35bcec204    
  
author   : Noah Misch <[email protected]>    
date     : Wed, 26 Jun 2013 20:00:08 -0400    
  
committer: Noah Misch <[email protected]>    
date     : Wed, 26 Jun 2013 20:00:08 -0400    

Click here for diff

Valgrind "client requests" in aset.c and mcxt.c teach Valgrind and its  
Memcheck tool about the PostgreSQL allocator.  This makes Valgrind  
roughly as sensitive to memory errors involving palloc chunks as it is  
to memory errors involving malloc chunks.  Further client requests in  
PageAddItem() and printtup() verify that all bits being added to a  
buffer page or furnished to an output function are predictably-defined.  
Those tests catch failures of C-language functions to fully initialize  
the bits of a Datum, which in turn stymie optimizations that rely on  
_equalConst().  Define the USE_VALGRIND symbol in pg_config_manual.h to  
enable these additions.  An included "suppression file" silences nominal  
errors we don't plan to fix.  
  
Reviewed in earlier versions by Peter Geoghegan and Korry Douglas.  

M src/backend/access/common/printtup.c
M src/backend/storage/page/bufpage.c
M src/backend/tcop/postgres.c
M src/backend/utils/mmgr/aset.c
M src/backend/utils/mmgr/mcxt.c
M src/include/pg_config_manual.h
A src/include/utils/memdebug.h
A src/tools/valgrind.supp

Refactor aset.c and mcxt.c in preparation for Valgrind cooperation.

commit   : a855148a29b786b179308b3bd5c59fe5b67110d8    
  
author   : Noah Misch <[email protected]>    
date     : Wed, 26 Jun 2013 19:56:03 -0400    
  
committer: Noah Misch <[email protected]>    
date     : Wed, 26 Jun 2013 19:56:03 -0400    

Click here for diff

Move some repeated debugging code into functions and store intermediates  
in variables where not presently necessary.  No code-generation changes  
in a production build, and no functional changes.  This simplifies and  
focuses the main patch.  

M src/backend/utils/mmgr/aset.c
M src/backend/utils/mmgr/mcxt.c

Initialize pad bytes in GinFormTuple().

commit   : 1d96bb96024c51f5a445f85ec45ce2e9bbd08c56    
  
author   : Noah Misch <[email protected]>    
date     : Wed, 26 Jun 2013 19:55:15 -0400    
  
committer: Noah Misch <[email protected]>    
date     : Wed, 26 Jun 2013 19:55:15 -0400    

Click here for diff

Every other core buffer page consumer initializes the bytes it furnishes  
to PageAddItem().  For consistency, do the same here.  No back-patch;  
regardless, we couldn't count on the fix so long as binary upgrade can  
carry forward affected index builds.  

M src/backend/access/gin/ginentrypage.c

Document effect of constant folding on CASE.

commit   : d53f7cf11658a3252a6fddf308b992b751379f09    
  
author   : Noah Misch <[email protected]>    
date     : Wed, 26 Jun 2013 19:51:56 -0400    
  
committer: Noah Misch <[email protected]>    
date     : Wed, 26 Jun 2013 19:51:56 -0400    

Click here for diff

Back-patch to all supported versions.  
  
Laurenz Albe  

M doc/src/sgml/func.sgml

Renovate display of non-ASCII messages on Windows.

commit   : 5f538ad004aa00cf0881f179f0cde789aad4f47e    
  
author   : Noah Misch <[email protected]>    
date     : Wed, 26 Jun 2013 11:17:33 -0400    
  
committer: Noah Misch <[email protected]>    
date     : Wed, 26 Jun 2013 11:17:33 -0400    

Click here for diff

GNU gettext selects a default encoding for the messages it emits in a  
platform-specific manner; it uses the Windows ANSI code page on Windows  
and follows LC_CTYPE on other platforms.  This is inconvenient for  
PostgreSQL server processes, so realize consistent cross-platform  
behavior by calling bind_textdomain_codeset() on Windows each time we  
permanently change LC_CTYPE.  This primarily affects SQL_ASCII databases  
and processes like the postmaster that do not attach to a database,  
making their behavior consistent with PostgreSQL on non-Windows  
platforms.  Messages from SQL_ASCII databases use the encoding implied  
by the database LC_CTYPE, and messages from non-database processes use  
LC_CTYPE from the postmaster system environment.  PlatformEncoding  
becomes unused, so remove it.  
  
Make write_console() prefer WriteConsoleW() to write() regardless of the  
encodings in use.  In this situation, write() will invariably mishandle  
non-ASCII characters.  
  
elog.c has assumed that messages conform to the database encoding.  
While usually true, this does not hold for SQL_ASCII and MULE_INTERNAL.  
Introduce MessageEncoding to track the actual encoding of message text.  
The present consumers are Windows-specific code for converting messages  
to UTF16 for use in system interfaces.  This fixes the appearance in  
Windows event logs and consoles of translated messages from SQL_ASCII  
processes like the postmaster.  Note that SQL_ASCII inherently disclaims  
a strong notion of encoding, so non-ASCII byte sequences interpolated  
into messages by %s may yet yield a nonsensical message.  MULE_INTERNAL  
has similar problems at present, albeit for a different reason: its lack  
of libiconv support or a conversion to UTF8.  
  
Consequently, one need no longer restart Windows with a different  
Windows ANSI code page to broadly test backend logging under a given  
language.  Changing the user's locale ("Format") is enough.  Several  
accounts can simultaneously run postmasters under different locales, all  
correctly logging localized messages to Windows event logs and consoles.  
  
Alexander Law and Noah Misch  

M src/backend/main/main.c
M src/backend/utils/adt/pg_locale.c
M src/backend/utils/error/elog.c
M src/backend/utils/init/postinit.c
M src/backend/utils/mb/encnames.c
M src/backend/utils/mb/mbutils.c
M src/include/mb/pg_wchar.h
M src/include/port.h
M src/port/chklocale.c

pg_receivexlog: Fix logic error

commit   : 2c1031bd8602f749a81672015811f365a129acff    
  
author   : Peter Eisentraut <[email protected]>    
date     : Tue, 25 Jun 2013 23:50:14 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Tue, 25 Jun 2013 23:50:14 -0400    

Click here for diff

The code checking the WAL file name contained a logic error and wouldn't  
actually catch some bad names.  

M src/bin/pg_basebackup/pg_receivexlog.c

Avoid inconsistent type declaration

commit   : 4ca50e071024421e3b75bf7e48fda08141360636    
  
author   : Alvaro Herrera <[email protected]>    
date     : Tue, 25 Jun 2013 16:36:29 -0400    
  
committer: Alvaro Herrera <[email protected]>    
date     : Tue, 25 Jun 2013 16:36:29 -0400    

Click here for diff

Clang 3.3 correctly complains that a variable of type enum  
MultiXactStatus cannot hold a value of -1, which makes sense.  Change  
the declared type of the variable to int instead, and apply casting as  
necessary to avoid the warning.  
  
Per notice from Andres Freund  

M src/backend/access/heap/heapam.c

Properly dump dropped foreign table cols in binary-upgrade mode.

commit   : 81166a2f7e1e792a746c907fe9e0318cc736311a    
  
author   : Andrew Dunstan <[email protected]>    
date     : Tue, 25 Jun 2013 13:46:34 -0400    
  
committer: Andrew Dunstan <[email protected]>    
date     : Tue, 25 Jun 2013 13:46:34 -0400    

Click here for diff

In binary upgrade mode, we need to recreate and then drop dropped  
columns so that all the columns get the right attribute number. This is  
true for foreign tables as well as for native tables. For foreign  
tables we have been getting the first part right but not the second,  
leading to bogus columns in the upgraded database. Fix this all the way  
back to 9.1, where foreign tables were introduced.  

M src/bin/pg_dump/pg_dump.c

Support clean switchover.

commit   : 985bd7d49726c9f178558491d31a570d47340459    
  
author   : Fujii Masao <[email protected]>    
date     : Wed, 26 Jun 2013 02:14:37 +0900    
  
committer: Fujii Masao <[email protected]>    
date     : Wed, 26 Jun 2013 02:14:37 +0900    

Click here for diff

In replication, when we shutdown the master, walsender tries to send  
all the outstanding WAL records to the standby, and then to exit. This  
basically means that all the WAL records are fully synced between  
two servers after the clean shutdown of the master. So, after  
promoting the standby to new master, we can restart the stopped  
master as new standby without the need for a fresh backup from  
new master.  
  
But there was one problem so far: though walsender tries to send all  
the outstanding WAL records, it doesn't wait for them to be replicated  
to the standby. Then, before receiving all the WAL records,  
walreceiver can detect the closure of connection and exit. We cannot  
guarantee that there is no missing WAL in the standby after clean  
shutdown of the master. In this case, backup from new master is  
required when restarting the stopped master as new standby.  
  
This patch fixes this problem. It just changes walsender so that it  
waits for all the outstanding WAL records to be replicated to the  
standby before closing the replication connection.  
  
Per discussion, this is a fix that needs to get backpatched rather than  
new feature. So, back-patch to 9.1 where enough infrastructure for  
this exists.  
  
Patch by me, reviewed by Andres Freund.  

M src/backend/replication/walsender.c

Reverting previous commit, pending investigation of sporadic seg faults from various build farm members.

commit   : 4f14c86d7434376b95477aeeb07fcc7272f4c47d    
  
author   : Simon Riggs <[email protected]>    
date     : Mon, 24 Jun 2013 21:19:55 +0100    
  
committer: Simon Riggs <[email protected]>    
date     : Mon, 24 Jun 2013 21:19:55 +0100    

Click here for diff

M doc/src/sgml/ref/alter_table.sgml
M src/backend/commands/tablecmds.c
M src/backend/parser/gram.y
M src/include/nodes/parsenodes.h
M src/test/regress/expected/foreign_key.out
M src/test/regress/sql/foreign_key.sql

ALTER TABLE ... ALTER CONSTRAINT for FKs

commit   : b577a57d4113bcbd1a7900b78b3e41df528c9a35    
  
author   : Simon Riggs <[email protected]>    
date     : Mon, 24 Jun 2013 20:07:41 +0100    
  
committer: Simon Riggs <[email protected]>    
date     : Mon, 24 Jun 2013 20:07:41 +0100    

Click here for diff

Allow constraint attributes to be altered,  
so the default setting of NOT DEFERRABLE  
can be altered to DEFERRABLE and back.  
  
Review by Abhijit Menon-Sen  

M doc/src/sgml/ref/alter_table.sgml
M src/backend/commands/tablecmds.c
M src/backend/parser/gram.y
M src/include/nodes/parsenodes.h
M src/test/regress/expected/foreign_key.out
M src/test/regress/sql/foreign_key.sql

Translation updates

commit   : ce18b011596389cbff1589494411643f995b0421    
  
author   : Peter Eisentraut <[email protected]>    
date     : Mon, 24 Jun 2013 14:16:15 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Mon, 24 Jun 2013 14:16:15 -0400    

Click here for diff

M src/backend/po/de.po
M src/backend/po/es.po
M src/backend/po/it.po
M src/backend/po/ru.po
M src/backend/po/zh_CN.po
M src/bin/initdb/po/es.po
M src/bin/pg_basebackup/po/cs.po
M src/bin/pg_basebackup/po/de.po
M src/bin/pg_basebackup/po/it.po
M src/bin/pg_basebackup/po/ru.po
M src/bin/pg_controldata/po/de.po
M src/bin/pg_controldata/po/es.po
M src/bin/pg_controldata/po/ru.po
M src/bin/pg_ctl/po/de.po
M src/bin/pg_ctl/po/es.po
M src/bin/pg_ctl/po/ru.po
M src/bin/pg_dump/po/es.po
M src/bin/pg_dump/po/it.po
M src/bin/pg_dump/po/ru.po
M src/bin/pg_resetxlog/po/de.po
M src/bin/pg_resetxlog/po/ru.po
M src/bin/psql/po/de.po
M src/bin/psql/po/es.po
M src/bin/psql/po/it.po
M src/bin/psql/po/ru.po
M src/bin/scripts/po/es.po
M src/bin/scripts/po/it.po
M src/bin/scripts/po/ru.po

Add a comment warning against use of pg_usleep() for long sleeps.

commit   : 8c1a71d36f5d667f3c2236e0e015a48f809ca240    
  
author   : Tom Lane <[email protected]>    
date     : Sun, 23 Jun 2013 14:43:10 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Sun, 23 Jun 2013 14:43:10 -0400    

Click here for diff

Follow-up to commit 873ab97219caabeb2f7b390268a4fe01e2b7518c, in which  
I noted that WaitLatch was a better solution in the commit log message,  
but neglected to add any documentation in the code.  

M src/port/pgsleep.c

Ensure no xid gaps during Hot Standby startup

commit   : 1f09121b4edee8b4d4cdd4ee0a8cffacee7b85f7    
  
author   : Simon Riggs <[email protected]>    
date     : Sun, 23 Jun 2013 11:05:02 +0100    
  
committer: Simon Riggs <[email protected]>    
date     : Sun, 23 Jun 2013 11:05:02 +0100    

Click here for diff

In some cases with higher numbers of subtransactions  
it was possible for us to incorrectly initialize  
subtrans leading to complaints of missing pages.  
  
Bug report by Sergey Konoplev  
Analysis and fix by Andres Freund  

M src/backend/access/transam/xlog.c
M src/backend/storage/ipc/procarray.c
M src/include/storage/procarray.h

doc: Fix date in EPUB manifest

commit   : dab1603e5238d3abce9f7a3a7b9450888cc07c70    
  
author   : Peter Eisentraut <[email protected]>    
date     : Fri, 21 Jun 2013 22:48:06 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Fri, 21 Jun 2013 22:48:06 -0400    

Click here for diff

If there is no <date> element, the publication date for the EPUB  
manifest is taken from the copyright year.  But something like  
"1996-2013" is not a legal date specification.  So the EPUB output  
currently fails epubcheck.  
  
Put in a separate <date> element with the current year.  Put it in  
legal.sgml, because copyright.pl already instructs to update that  
manually, so it hopefully won't be missed.  

M doc/src/sgml/legal.sgml

Clarify terminology standalone backend vs. single-user mode

commit   : 7dfd5cd21c0091e467b16b31a10e20bbedd0a836    
  
author   : Peter Eisentraut <[email protected]>    
date     : Thu, 20 Jun 2013 23:03:18 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Thu, 20 Jun 2013 23:03:18 -0400    

Click here for diff

Most of the documentation uses "single-user mode", so use that in the  
code as well.  Adjust the documentation to match the new error message  
wording.  Also add a documentation index entry for "single-user mode".  
  
Based-on-patch-by: Jeff Janes <[email protected]>  

M doc/src/sgml/maintenance.sgml
M doc/src/sgml/ref/postgres-ref.sgml
M src/backend/access/transam/varsup.c

Further update CREATE FUNCTION documentation about argument names

commit   : 4c54e87a86d6e73aa3a3b7710fa3db33297792d4    
  
author   : Peter Eisentraut <[email protected]>    
date     : Wed, 19 Jun 2013 22:25:13 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Wed, 19 Jun 2013 22:25:13 -0400    

Click here for diff

More languages than SQL and PL/pgSQL actually support parameter names.  

M doc/src/sgml/ref/create_function.sgml

initdb: Add blank line before output about checksums

commit   : 8df54b9fad9b7954b71c63b86a6c587fc6748099    
  
author   : Peter Eisentraut <[email protected]>    
date     : Tue, 18 Jun 2013 21:56:13 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Tue, 18 Jun 2013 21:56:13 -0400    

Click here for diff

This maintains the logical grouping of the output better.  

M src/bin/initdb/initdb.c

Support TB (terabyte) memory unit in GUC variables.

commit   : bab54e383dd102001753366d3c124f706c7967dd    
  
author   : Fujii Masao <[email protected]>    
date     : Thu, 20 Jun 2013 08:17:14 +0900    
  
committer: Fujii Masao <[email protected]>    
date     : Thu, 20 Jun 2013 08:17:14 +0900    

Click here for diff

Patch by Simon Riggs, reviewed by Jeff Janes and me.  

M doc/src/sgml/config.sgml
M src/backend/utils/misc/guc.c
M src/backend/utils/misc/postgresql.conf.sample

Modernize entab source code Remove halt.c, improve comments, rename manual page file.

commit   : f979599b2068f036405f1b51a9c4260619b06941    
  
author   : Bruce Momjian <[email protected]>    
date     : Wed, 19 Jun 2013 12:31:23 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Wed, 19 Jun 2013 12:31:23 -0400    

Click here for diff

M src/tools/entab/Makefile
R096 src/tools/entab/entab.man src/tools/entab/entab.1
M src/tools/entab/entab.c
D src/tools/entab/halt.c

Fix the create_index regression test for Danish collation.

commit   : 8791627b8f9a9ce44603beec447bc6f18bfd9a36    
  
author   : Kevin Grittner <[email protected]>    
date     : Wed, 19 Jun 2013 10:36:45 -0500    
  
committer: Kevin Grittner <[email protected]>    
date     : Wed, 19 Jun 2013 10:36:45 -0500    

Click here for diff

In Danish collations, there are letter combinations which sort  
higher than 'Z'.  A test for values > 'WA' was picking up rows  
where the value started with 'AA', causing the test to fail.  
  
Backpatch to 9.2, where the failing test was added.  
  
Per report from Svenne Krap and analysis by Jeff Janes  

M src/test/regress/expected/create_index.out
M src/test/regress/sql/create_index.sql

Fix docs on lock level for ALTER TABLE VALIDATE

commit   : 073d7cb513f5de44530f4bdbaaa4b5d4cce5f984    
  
author   : Simon Riggs <[email protected]>    
date     : Tue, 18 Jun 2013 12:09:39 +0100    
  
committer: Simon Riggs <[email protected]>    
date     : Tue, 18 Jun 2013 12:09:39 +0100    

Click here for diff

ALTER TABLE .. VALIDATE CONSTRAINT previously  
gave incorrect details about lock levels and  
therefore incomplete reasons to use the option.  
  
Initial bug report and fix from Marko Tiikkaja  
Reworded by me to include comments by Kevin Grittner  

M doc/src/sgml/ref/alter_table.sgml

psql: Re-allow -1 together with -c or -l

commit   : c3c86ae2aff67676a49ec84240f1d6a482f359cb    
  
author   : Peter Eisentraut <[email protected]>    
date     : Mon, 17 Jun 2013 21:53:33 -0400    
  
committer: Peter Eisentraut <[email protected]>    
date     : Mon, 17 Jun 2013 21:53:33 -0400    

Click here for diff

M src/bin/psql/startup.c

Add buffer_std flag to MarkBufferDirtyHint().

commit   : b8fd1a09f382f04c41128fded4d56da2127ce92d    
  
author   : Jeff Davis <[email protected]>    
date     : Mon, 17 Jun 2013 08:02:12 -0700    
  
committer: Jeff Davis <[email protected]>    
date     : Mon, 17 Jun 2013 08:02:12 -0700    

Click here for diff

MarkBufferDirtyHint() writes WAL, and should know if it's got a  
standard buffer or not. Currently, the only callers where buffer_std  
is false are related to the FSM.  
  
In passing, rename XLOG_HINT to XLOG_FPI, which is more descriptive.  
  
Back-patch to 9.3.  

M src/backend/access/hash/hash.c
M src/backend/access/heap/pruneheap.c
M src/backend/access/nbtree/nbtinsert.c
M src/backend/access/nbtree/nbtree.c
M src/backend/access/nbtree/nbtutils.c
M src/backend/access/rmgrdesc/xlogdesc.c
M src/backend/access/transam/xlog.c
M src/backend/commands/sequence.c
M src/backend/storage/buffer/bufmgr.c
M src/backend/storage/freespace/freespace.c
M src/backend/storage/freespace/fsmpage.c
M src/backend/utils/time/tqual.c
M src/include/access/xlog.h
M src/include/catalog/pg_control.h
M src/include/storage/bufmgr.h

Fix description of archive format which pg_restore -j supports.

commit   : 2bc4ab4f9c2ed8d94c22c41fce05f97838f2fc42    
  
author   : Fujii Masao <[email protected]>    
date     : Sun, 16 Jun 2013 09:38:18 +0900    
  
committer: Fujii Masao <[email protected]>    
date     : Sun, 16 Jun 2013 09:38:18 +0900    

Click here for diff

M doc/src/sgml/ref/pg_restore.sgml

Use WaitLatch, not pg_usleep, for delaying in pg_sleep().

commit   : a64ca63e59c11d8fe6db24eee3d82b61db7c2c83    
  
author   : Tom Lane <[email protected]>    
date     : Sat, 15 Jun 2013 16:22:29 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Sat, 15 Jun 2013 16:22:29 -0400    

Click here for diff

This avoids platform-dependent behavior wherein pg_sleep() might fail to be  
interrupted by statement timeout, query cancel, SIGTERM, etc.  Also, since  
there's no reason to wake up once a second any more, we can reduce the  
power consumption of a sleeping backend a tad.  
  
Back-patch to 9.3, since use of SA_RESTART for SIGALRM makes this a bigger  
issue than it used to be.  

M src/backend/utils/adt/misc.c

Fix pg_restore -l with the directory archive to display the correct format name.

commit   : f69aece6f475b08a6ec60f80531eefc0005d9e9b    
  
author   : Fujii Masao <[email protected]>    
date     : Sun, 16 Jun 2013 05:07:02 +0900    
  
committer: Fujii Masao <[email protected]>    
date     : Sun, 16 Jun 2013 05:07:02 +0900    

Click here for diff

Back-patch to 9.1 where the directory archive was introduced.  

M src/bin/pg_dump/pg_backup_archiver.c

Use SA_RESTART for all signals, including SIGALRM.

commit   : 873ab97219caabeb2f7b390268a4fe01e2b7518c    
  
author   : Tom Lane <[email protected]>    
date     : Sat, 15 Jun 2013 15:39:51 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Sat, 15 Jun 2013 15:39:51 -0400    

Click here for diff

The exclusion of SIGALRM dates back to Berkeley days, when Postgres used  
SIGALRM in only one very short stretch of code.  Nowadays, allowing it to  
interrupt kernel calls doesn't seem like a very good idea, since its use  
for statement_timeout means SIGALRM could occur anyplace in the code, and  
there are far too many call sites where we aren't prepared to deal with  
EINTR failures.  When third-party code is taken into consideration, it  
seems impossible that we ever could be fully EINTR-proof, so better to  
use SA_RESTART always and deal with the implications of that.  One such  
implication is that we should not assume pg_usleep() will be terminated  
early by a signal.  Therefore, long sleeps should probably be replaced  
by WaitLatch operations where practical.  
  
Back-patch to 9.3 so we can get some beta testing on this change.  

M src/backend/port/sysv_sema.c
M src/port/pqsignal.c

Be consistent about #define'ing configure symbols as "1" not empty.

commit   : 5242fefb471d1fb2d0f35a33bde3570e19acd4b1    
  
author   : Tom Lane <[email protected]>    
date     : Sat, 15 Jun 2013 14:11:43 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Sat, 15 Jun 2013 14:11:43 -0400    

Click here for diff

This is just neatnik-ism, since all the tests in the code are #ifdefs,  
but we shouldn't specify symbols as "Define to 1 ..." and then not  
actually define them that way.  

M config/c-library.m4
M configure
M configure.in
M src/include/pg_config.h.win32

Add :client_id automatic variable for custom pgbench scripts.

commit   : b23160889c963dfe23d8cf1f9be64fb3c535a2d6    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Fri, 14 Jun 2013 23:31:44 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Fri, 14 Jun 2013 23:31:44 +0300    

Click here for diff

This makes it easier to write custom scripts that have different logic for  
each client.  
  
Gurjeet Singh, with some changes by me.  

M contrib/pgbench/pgbench.c
M doc/src/sgml/pgbench.sgml

Update RELEASE_CHANGES to describe library version bumping more fully.

commit   : 46e1434f3db21cdc05dea42b4e060d2078ff5b87    
  
author   : Tom Lane <[email protected]>    
date     : Fri, 14 Jun 2013 14:53:23 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Fri, 14 Jun 2013 14:53:23 -0400    

Click here for diff

M src/tools/RELEASE_CHANGES

Stamp shared-library minor version numbers for 9.4.

commit   : 8a3f0894a477c09c626abed273be80afdc6b13ac    
  
author   : Tom Lane <[email protected]>    
date     : Fri, 14 Jun 2013 14:49:46 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Fri, 14 Jun 2013 14:49:46 -0400    

Click here for diff

M src/interfaces/ecpg/compatlib/Makefile
M src/interfaces/ecpg/ecpglib/Makefile
M src/interfaces/ecpg/pgtypeslib/Makefile
M src/interfaces/ecpg/preproc/Makefile
M src/interfaces/libpq/Makefile
M src/tools/msvc/Mkvcbuild.pm

Stamp HEAD as 9.4devel.

commit   : 58ae1f457708205e3ea29eb99bde65402a0fcfa7    
  
author   : Tom Lane <[email protected]>    
date     : Fri, 14 Jun 2013 14:41:28 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Fri, 14 Jun 2013 14:41:28 -0400    

Click here for diff

Let the hacking begin ...  

M configure
M configure.in
M doc/bug.template
M src/include/pg_config.h.win32
M src/interfaces/libpq/libpq.rc.in
M src/port/win32ver.rc
M src/tools/git_changelog
M src/tools/version_stamp.pl