PostgreSQL 9.3.0 commit log

Stamp 9.3.0.

commit   : da645b3a73580ac30cf02e932b42d06157b98229    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Mon, 2 Sep 2013 16:53:17 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Mon, 2 Sep 2013 16:53:17 -0400    

Click here for diff

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

Update time zone data files to tzdata release 2013d.

commit   : e3d02a10ec1831216f6d63a48e390a53a01b0927    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Mon, 2 Sep 2013 15:06:21 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
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   : 4e1e5d3bad9d51e5695c8a42612343662e886a64    
  
author   : Andrew Dunstan <andrew@dunslane.net>    
date     : Mon, 2 Sep 2013 14:37:53 -0400    
  
committer: Andrew Dunstan <andrew@dunslane.net>    
date     : Mon, 2 Sep 2013 14:37:53 -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   : c7ef895f697627f60c51f44d8a9d64431840b4da    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Mon, 2 Sep 2013 02:28:21 -0400    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
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   : b9a06c9329822259bab45f34ecc6a5839f0ffc53    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sun, 1 Sep 2013 19:43:02 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
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   : 3234a64f454cf9f2f6b8df24a551bec0ecfdd74b    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sat, 31 Aug 2013 23:53:33 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sat, 31 Aug 2013 23:53:33 -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   : 3c2a425da71d56edade2d7e2734305e8af778c9a    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Fri, 30 Aug 2013 21:40:21 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
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   : ce58aad2ba13885e2c5fa50e31ee5945e883096b    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Fri, 30 Aug 2013 19:27:40 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
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   : 16e8e36cebba8909ec01ca259f32e8dd40090657    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Fri, 30 Aug 2013 19:15:21 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
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   : dfed97b744a4706d7c7b410667c0c5bc92d0eb8d    
  
author   : Alvaro Herrera <alvherre@alvh.no-ip.org>    
date     : Thu, 29 Aug 2013 12:33:50 -0400    
  
committer: Alvaro Herrera <alvherre@alvh.no-ip.org>    
date     : Thu, 29 Aug 2013 12:33:50 -0400    

Click here for diff

M src/backend/postmaster/postmaster.c

Unconditionally use the WSA equivalents of Socket error constants.

commit   : e536d47ab7eb447ef0be849a8b2e06ae9080017c    
  
author   : Andrew Dunstan <andrew@dunslane.net>    
date     : Mon, 26 Aug 2013 14:58:14 -0400    
  
committer: Andrew Dunstan <andrew@dunslane.net>    
date     : Mon, 26 Aug 2013 14:58:14 -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.  
  
Backpatch of commit 73838b5251e.  
  
Problem reported by Michael Cronenworth, although not his patch.  

M src/include/port/win32.h

Account better for planning cost when choosing whether to use custom plans.

commit   : a5f11e24a4d1afb213c780812a3df14c04d7f845    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sat, 24 Aug 2013 15:14:21 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sat, 24 Aug 2013 15:14:21 -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   : 3cf89057b5bced4478a285e0b49e321996b40044    
  
author   : Magnus Hagander <magnus@hagander.net>    
date     : Sat, 24 Aug 2013 17:11:31 +0200    
  
committer: Magnus Hagander <magnus@hagander.net>    
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   : c19617d5355e41074623bbb7c3efda532c20f637    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Fri, 23 Aug 2013 17:30:56 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Fri, 23 Aug 2013 17:30:56 -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   : e6d3f5b35edad5452936bf4842167fa00c8b64b8    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Wed, 21 Aug 2013 13:38:20 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Wed, 21 Aug 2013 13:38:20 -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

commit   : c9d7c192c06d0dd998067494c3be291ea6a52745    
  
author   : Bruce Momjian <bruce@momjian.us>    
date     : Tue, 20 Aug 2013 09:39:00 -0400    
  
committer: Bruce Momjian <bruce@momjian.us>    
date     : Tue, 20 Aug 2013 09:39:00 -0400    

Click here for diff

Backpatch to 9.3.  
  
Pavel Stehule  

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

Stamp 9.3rc1.

commit   : ce52c6fe243665e0f4d84414f9341b9719415551    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Mon, 19 Aug 2013 19:45:10 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Mon, 19 Aug 2013 19:45:10 -0400    

Click here for diff

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

Be more wary of unwanted whitespace in pgstat_reset_remove_files().

commit   : 59bc4a43ec588d25fe976774bd1194f1b90251fa    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Mon, 19 Aug 2013 19:36:06 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Mon, 19 Aug 2013 19:36:06 -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   : db5b49cdd4f481828b227f03b373fbc9bde4301a    
  
author   : Alvaro Herrera <alvherre@alvh.no-ip.org>    
date     : Mon, 19 Aug 2013 17:48:17 -0400    
  
committer: Alvaro Herrera <alvherre@alvh.no-ip.org>    
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   : 38c69237c21186038f6902373a0f06af1c2f7cfb    
  
author   : Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Mon, 19 Aug 2013 20:57:53 +0300    
  
committer: Heikki Linnakangas <heikki.linnakangas@iki.fi>    
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   : b19e5a696ab28be5d55949048194922152091aa1    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Mon, 19 Aug 2013 13:19:28 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Mon, 19 Aug 2013 13:19:28 -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   : b3c55ae0daf230555cb1932ac2c903c3fe7643db    
  
author   : Alvaro Herrera <alvherre@alvh.no-ip.org>    
date     : Mon, 19 Aug 2013 12:33:07 -0400    
  
committer: Alvaro Herrera <alvherre@alvh.no-ip.org>    
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   : 064eb5098be5ee74a9dfb6bf090fea699a1be45f    
  
author   : Bruce Momjian <bruce@momjian.us>    
date     : Mon, 19 Aug 2013 12:26:22 -0400    
  
committer: Bruce Momjian <bruce@momjian.us>    
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   : 3e5dd599666f00b45311e42433ba68d0b9b89aed    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Sun, 18 Aug 2013 23:36:20 -0400    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
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   : 5a91ea7a000295a7898f96cad6f0c3c288d41039    
  
author   : Kevin Grittner <kgrittn@postgresql.org>    
date     : Sun, 18 Aug 2013 16:24:59 -0500    
  
committer: Kevin Grittner <kgrittn@postgresql.org>    
date     : Sun, 18 Aug 2013 16:24:59 -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   : 7c8de5d3e587a31279771f32291a5d4b94bd2514    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Sat, 17 Aug 2013 21:46:32 -0400    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
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   : 8820b502367de2669a8d3ed02a1cc485dd84fc4b    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sat, 17 Aug 2013 20:36:29 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
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   : 517db4945560358a82b9152d01cfad3bbd2af17e    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sat, 17 Aug 2013 20:22:41 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sat, 17 Aug 2013 20:22:41 -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   : 2505aaed7be290018f999f6e9250c24b26db97d0    
  
author   : Bruce Momjian <bruce@momjian.us>    
date     : Fri, 16 Aug 2013 18:01:04 -0400    
  
committer: Bruce Momjian <bruce@momjian.us>    
date     : Fri, 16 Aug 2013 18:01:04 -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   : c359ff298a537f9f481ca7928c655b84c17e5456    
  
author   : Bruce Momjian <bruce@momjian.us>    
date     : Fri, 16 Aug 2013 16:54:18 -0400    
  
committer: Bruce Momjian <bruce@momjian.us>    
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

Rename some bgworker functions as we've done in master.

commit   : 8e2eca46dbd3bb8efa56ef0aebd60eadcbcc5dd4    
  
author   : Robert Haas <rhaas@postgresql.org>    
date     : Fri, 16 Aug 2013 15:28:03 -0400    
  
committer: Robert Haas <rhaas@postgresql.org>    
date     : Fri, 16 Aug 2013 15:28:03 -0400    

Click here for diff

Commit 2dee7998f93062e2ae7fcc9048ff170e528d1724 renames these  
functions in master, for consistency; per discussion, backport  
just the renaming portion of that commit to 9.3 to keep the  
branches in sync.  
  
Michael Paquier  

M src/backend/postmaster/postmaster.c

pg_upgrade: shut down server after auth failure

commit   : ae3c8c57cbaa8d88be61dc26f7b5c138c3c98dd7    
  
author   : Bruce Momjian <bruce@momjian.us>    
date     : Fri, 16 Aug 2013 11:09:09 -0400    
  
committer: Bruce Momjian <bruce@momjian.us>    
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

Don't allow ALTER MATERIALIZED VIEW ADD UNIQUE.

commit   : cdcddc4a5a06952eafc65907c25c21510c7d54c0    
  
author   : Kevin Grittner <kgrittn@postgresql.org>    
date     : Thu, 15 Aug 2013 13:16:45 -0500    
  
committer: Kevin Grittner <kgrittn@postgresql.org>    
date     : Thu, 15 Aug 2013 13:16:45 -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   : d2fa20acdd67db00b48fcc4b9a13b998c1c8bb54    
  
author   : Magnus Hagander <magnus@hagander.net>    
date     : Thu, 15 Aug 2013 18:24:25 +0200    
  
committer: Magnus Hagander <magnus@hagander.net>    
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   : 3ed990b6ffe18e794b5020a5e5e841aacd72524e    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Wed, 14 Aug 2013 23:18:49 -0400    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
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   : 9e3f42ff3f6af6b4474340175572c76fe35d9e3b    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Wed, 14 Aug 2013 23:00:34 -0400    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
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   : 6c5f68ea1a836f8c5cf9711f24d285067e67f23f    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Wed, 14 Aug 2013 18:38:36 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Wed, 14 Aug 2013 18:38:36 -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

Remove Assert that matview is not in system schema from REFRESH.

commit   : 85052376a8cc4bbbfc08a50ca3bd137c1e3cda9a    
  
author   : Kevin Grittner <kgrittn@postgresql.org>    
date     : Wed, 14 Aug 2013 12:43:01 -0500    
  
committer: Kevin Grittner <kgrittn@postgresql.org>    
date     : Wed, 14 Aug 2013 12:43:01 -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

Emit a log message if output is about to be redirected away from stderr.

commit   : 6d8186ff779fd46f0251eb252e7489fd38ab793b    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Tue, 13 Aug 2013 15:24:56 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Tue, 13 Aug 2013 15:24:56 -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   : 7cf5540c831460476d24566845422b8c81bd6581    
  
author   : Bruce Momjian <bruce@momjian.us>    
date     : Tue, 13 Aug 2013 12:51:26 -0400    
  
committer: Bruce Momjian <bruce@momjian.us>    
date     : Tue, 13 Aug 2013 12:51:26 -0400    

Click here for diff

Move item about foreign data wrappers supporting inserts/updates/deletes  
to object manipulation.  
  
Backpatch to 9.3.  
  
From Etsuro Fujita  

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

PL/Python: Adjust the regression tests for Python 3.3

commit   : 7f288a23484971dca7f75d866d0f1edb332fbc4b    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Sun, 11 Aug 2013 09:17:04 -0400    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
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   : 2edaee01129f3494be71c7bbc7e5414ae0c37501    
  
author   : Bruce Momjian <bruce@momjian.us>    
date     : Fri, 9 Aug 2013 21:46:13 -0400    
  
committer: Bruce Momjian <bruce@momjian.us>    
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   : 95b5f5e1e75b22b1aa741b7545435d2af16f78d5    
  
author   : Bruce Momjian <bruce@momjian.us>    
date     : Fri, 9 Aug 2013 19:25:51 -0400    
  
committer: Bruce Momjian <bruce@momjian.us>    
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   : 646cbc1f01b3104fb8e9ad68ea4df16bd9b4e16f    
  
author   : Fujii Masao <fujii@postgresql.org>    
date     : Fri, 9 Aug 2013 22:14:26 +0900    
  
committer: Fujii Masao <fujii@postgresql.org>    
date     : Fri, 9 Aug 2013 22:14:26 +0900    

Click here for diff

M doc/src/sgml/auto-explain.sgml

Message punctuation and pluralization fixes

commit   : 595f52f8171e9805c5753510a180faeb68165055    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Fri, 9 Aug 2013 07:59:53 -0400    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
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   : 92d003fcbfb73eebf0c1782dbd53c6e2f14d5cc4    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Wed, 7 Aug 2013 22:48:40 -0400    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
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/postmaster.c
M src/backend/utils/adt/jsonfuncs.c
M src/backend/utils/misc/guc.c

Make sure float4in/float8in accept all standard spellings of "infinity".

commit   : b5a20ab3e0310103ff11337faeed3c521f5eb917    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sat, 3 Aug 2013 12:39:51 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sat, 3 Aug 2013 12:39:51 -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   : 69fdc9577b09dce732153c33c2484dac7d506ad9    
  
author   : Alvaro Herrera <alvherre@alvh.no-ip.org>    
date     : Fri, 2 Aug 2013 14:34:56 -0400    
  
committer: Alvaro Herrera <alvherre@alvh.no-ip.org>    
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   : 0009462e985b90d07dc430bb3c4f1e6f57e0c318    
  
author   : Alvaro Herrera <alvherre@alvh.no-ip.org>    
date     : Fri, 2 Aug 2013 12:49:03 -0400    
  
committer: Alvaro Herrera <alvherre@alvh.no-ip.org>    
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/portals.out
M src/test/regress/expected/union.out
M src/test/regress/sql/portals.sql
M src/test/regress/sql/union.sql

Improve handling of pthread_mutex_lock error case

commit   : 820739cba95622033527f60467a264db0ee91f76    
  
author   : Stephen Frost <sfrost@snowman.net>    
date     : Thu, 1 Aug 2013 15:42:07 -0400    
  
committer: Stephen Frost <sfrost@snowman.net>    
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

Add locking around SSL_context usage in libpq

commit   : 55754380f36d098551bd55dd49e27f64dd1c8d2f    
  
author   : Stephen Frost <sfrost@snowman.net>    
date     : Thu, 1 Aug 2013 01:15:45 -0400    
  
committer: Stephen Frost <sfrost@snowman.net>    
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

Fix mis-indented lines

commit   : 603c4a90c15f601ccf44cad3d3b04b39e4dc34eb    
  
author   : Alvaro Herrera <alvherre@alvh.no-ip.org>    
date     : Wed, 31 Jul 2013 17:57:15 -0400    
  
committer: Alvaro Herrera <alvherre@alvh.no-ip.org>    
date     : Wed, 31 Jul 2013 17:57:15 -0400    

Click here for diff

Per Coverity  

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

Fix regexp_matches() handling of zero-length matches.

commit   : 5d9951a65037fe2b7bdca8ed20c8775594672e34    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Wed, 31 Jul 2013 11:31:26 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Wed, 31 Jul 2013 11:31:26 -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 inaccurate description of tablespace.

commit   : fe136ba6fc31760efe7ac53e662395a71a92dc03    
  
author   : Fujii Masao <fujii@postgresql.org>    
date     : Wed, 31 Jul 2013 22:36:39 +0900    
  
committer: Fujii Masao <fujii@postgresql.org>    
date     : Wed, 31 Jul 2013 22:36:39 +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   : 9a78f66fdccbc85442f992f2928b4a58ae451208    
  
author   : Noah Misch <noah@leadboat.com>    
date     : Tue, 30 Jul 2013 18:36:52 -0400    
  
committer: Noah Misch <noah@leadboat.com>    
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   : e243e3a42887f82be6dc5a6bf6e8534a733b8bc8    
  
author   : Bruce Momjian <bruce@momjian.us>    
date     : Tue, 30 Jul 2013 09:23:31 -0400    
  
committer: Bruce Momjian <bruce@momjian.us>    
date     : Tue, 30 Jul 2013 09:23:31 -0400    

Click here for diff

M contrib/pg_upgrade/parallel.c

Fix contrib/cube and contrib/seg to build with bison 3.0.

commit   : 8cbf8dfcaf9972b723dc48359df5be0a364b2e5f    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Mon, 29 Jul 2013 10:42:41 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Mon, 29 Jul 2013 10:42:41 -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   : faee8f1a714f24e85ba5fa1018b22f9681b5d657    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Sun, 28 Jul 2013 06:59:09 -0400    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
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/postmaster/postmaster.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   : d83940a7f60f48292b3ae58dfda81b146eab1c50    
  
author   : Bruce Momjian <bruce@momjian.us>    
date     : Sat, 27 Jul 2013 15:00:58 -0400    
  
committer: Bruce Momjian <bruce@momjian.us>    
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   : 61edd524017c4a3fa5f35e72e49f70f058be7a99    
  
author   : Bruce Momjian <bruce@momjian.us>    
date     : Fri, 26 Jul 2013 13:52:01 -0400    
  
committer: Bruce Momjian <bruce@momjian.us>    
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   : 89bb2c76e4fec135df19e0d4e3135a3cf7a44a8a    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 25 Jul 2013 16:45:47 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 25 Jul 2013 16:45:47 -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

Fix configure probe for sys/ucred.h.

commit   : 7f0bc6b448e70f18b9ff35be3a90444542d09d08    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 25 Jul 2013 11:39:11 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 25 Jul 2013 11:39:11 -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   : 830d0e0edd73c015ca07423c402a3b1f79118d8f    
  
author   : Bruce Momjian <bruce@momjian.us>    
date     : Thu, 25 Jul 2013 11:33:14 -0400    
  
committer: Bruce Momjian <bruce@momjian.us>    
date     : Thu, 25 Jul 2013 11:33:14 -0400    

Click here for diff

M contrib/pg_upgrade/dump.c
M contrib/pg_upgrade/exec.c

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   : b48f1dc2d35279b0814d60c24e488df2c295bb85    
  
author   : Bruce Momjian <bruce@momjian.us>    
date     : Wed, 24 Jul 2013 22:01:14 -0400    
  
committer: Bruce Momjian <bruce@momjian.us>    
date     : Wed, 24 Jul 2013 22:01:14 -0400    

Click here for diff

M contrib/pg_upgrade/parallel.c

Improve ilist.h's support for deletion of slist elements during iteration.

commit   : cf707aa70da6729a00593c49d5eb8a35ab27dd11    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Wed, 24 Jul 2013 17:42:03 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Wed, 24 Jul 2013 17:42:03 -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/pgstat.c
M src/include/lib/ilist.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   : 4a67a9ac13495d69b4d3b560b63cafda9318b4f4    
  
author   : Bruce Momjian <bruce@momjian.us>    
date     : Wed, 24 Jul 2013 13:15:47 -0400    
  
committer: Bruce Momjian <bruce@momjian.us>    
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   : 38afb907afccb4fac10f367a77c421172c04685d    
  
author   : Bruce Momjian <bruce@momjian.us>    
date     : Wed, 24 Jul 2013 10:00:37 -0400    
  
committer: Bruce Momjian <bruce@momjian.us>    
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   : 808d1f8122223a19d7796e2b50878b1b42450263    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Wed, 24 Jul 2013 00:44:09 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
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

Further hacking on ruleutils' new column-alias-assignment code.

commit   : 7f5cfe914de49130d86b2e1e9636b7135e577ef1    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Tue, 23 Jul 2013 17:54:24 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Tue, 23 Jul 2013 17:54:24 -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   : 5ef42547c3c55a0d743ea3fabe165ce3bcc3d3c8    
  
author   : Alvaro Herrera <alvherre@alvh.no-ip.org>    
date     : Tue, 23 Jul 2013 17:38:32 -0400    
  
committer: Alvaro Herrera <alvherre@alvh.no-ip.org>    
date     : Tue, 23 Jul 2013 17:38:32 -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   : b81d0691b9c6cc249511b92bb4b96f3a99a91eb0    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Tue, 23 Jul 2013 16:23:04 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Tue, 23 Jul 2013 16:23:04 -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   : 5712eeb2e7cf8e4236acffd4a403e7f14a48866f    
  
author   : Alvaro Herrera <alvherre@alvh.no-ip.org>    
date     : Tue, 23 Jul 2013 14:03:09 -0400    
  
committer: Alvaro Herrera <alvherre@alvh.no-ip.org>    
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  
1373937980.20441.8.camel@vanquo.pezone.net 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

Back-patch bgworker API changes to 9.3.

commit   : 026bc46da33ab6a6f720b0d0500e8a95d075ab92    
  
author   : Robert Haas <rhaas@postgresql.org>    
date     : Mon, 22 Jul 2013 15:41:44 -0400    
  
committer: Robert Haas <rhaas@postgresql.org>    
date     : Mon, 22 Jul 2013 15:41:44 -0400    

Click here for diff

Commit 7f7485a0cde92aa4ba235a1ffe4dda0ca0b6cc9a made these changes  
in master; per discussion, backport the API changes (but not the  
functional changes), so that people don't get used to the 9.3 API  
only to see it get broken in the next release.  There are already  
some people coding to the original 9.3 API, and this will cause  
minor breakage, but there will be even more if we wait until next  
year to roll out these changes.  

M contrib/worker_spi/worker_spi.c
M doc/src/sgml/bgworker.sgml
M src/backend/postmaster/postmaster.c
M src/include/postmaster/bgworker.h

Remove bgw_sighup and bgw_sigterm.

commit   : 295f9bbf1d2d1e985471bd523c7c9bfd3d134759    
  
author   : Robert Haas <rhaas@postgresql.org>    
date     : Mon, 22 Jul 2013 14:13:00 -0400    
  
committer: Robert Haas <rhaas@postgresql.org>    
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/postmaster.c
M src/include/postmaster/bgworker.h

Fix error handling in PLy_spi_execute_fetch_result().

commit   : 15b9bdf4d46e5b2858c7666dd4a39040aa12e668    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sat, 20 Jul 2013 12:44:37 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
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   : ef8321a57d38c00592614a6d8f0872a721d301c3    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Sat, 20 Jul 2013 06:38:31 -0400    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
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   : 0b3859f3b607b375cfabb0a95bb4c58a4c1b37ee    
  
author   : Alvaro Herrera <alvherre@alvh.no-ip.org>    
date     : Fri, 19 Jul 2013 18:35:07 -0400    
  
committer: Alvaro Herrera <alvherre@alvh.no-ip.org>    
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   : a9f8fe06bc38c9eb3e99191590713de903a91cfa    
  
author   : Robert Haas <rhaas@postgresql.org>    
date     : Fri, 19 Jul 2013 10:23:12 -0400    
  
committer: Robert Haas <rhaas@postgresql.org>    
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   : 24780e00d2bb10c6942edf579b60186ec469c77b    
  
author   : Michael Meskes <meskes@postgresql.org>    
date     : Fri, 19 Jul 2013 08:59:20 +0200    
  
committer: Michael Meskes <meskes@postgresql.org>    
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

Fix regex match failures for backrefs combined with non-greedy quantifiers.

commit   : f8463fba2434d083bb699d1cc8a7d7159d614a7b    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 18 Jul 2013 21:22:43 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 18 Jul 2013 21:22:43 -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

Use correct parameter name for view_option_value

commit   : dd8ea2eb5e996f3f3dfd928e20aa2462c4bd9c63    
  
author   : Stephen Frost <sfrost@snowman.net>    
date     : Wed, 17 Jul 2013 10:50:39 -0400    
  
committer: Stephen Frost <sfrost@snowman.net>    
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 PQconninfoParse error message handling

commit   : bdbb1d673834ef7af16d97158d9d0006b17949f7    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Mon, 15 Jul 2013 20:04:14 -0400    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
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

Correct off-by-one when reading from pipe

commit   : 22b7f5c5aa1dc2909e110b171b03d6e0c85dcd43    
  
author   : Stephen Frost <sfrost@snowman.net>    
date     : Mon, 15 Jul 2013 10:42:27 -0400    
  
committer: Stephen Frost <sfrost@snowman.net>    
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   : 8126bfb5b5f0b413455edd23ff3bf08d83f1cddc    
  
author   : Stephen Frost <sfrost@snowman.net>    
date     : Sun, 14 Jul 2013 21:17:59 -0400    
  
committer: Stephen Frost <sfrost@snowman.net>    
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

Be sure to close() file descriptor on error case

commit   : b68a1fc7ff1a50a7282e8edff7c51333274c3334    
  
author   : Stephen Frost <sfrost@snowman.net>    
date     : Sun, 14 Jul 2013 17:25:47 -0400    
  
committer: Stephen Frost <sfrost@snowman.net>    
date     : Sun, 14 Jul 2013 17:25:47 -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   : e9010b992640d1dbf212cbbab40a00093515f16f    
  
author   : Stephen Frost <sfrost@snowman.net>    
date     : Sun, 14 Jul 2013 16:42:58 -0400    
  
committer: Stephen Frost <sfrost@snowman.net>    
date     : Sun, 14 Jul 2013 16:42:58 -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   : 5ab811106b58b06242047ee5dc69001bc983c3a1    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Sun, 14 Jul 2013 15:53:56 -0400    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
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   : f5acde9380e164eab10b2dc3281bb1c07f690803    
  
author   : Stephen Frost <sfrost@snowman.net>    
date     : Sun, 14 Jul 2013 15:31:23 -0400    
  
committer: Stephen Frost <sfrost@snowman.net>    
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   : 8839e7362c68470f8db66acdfa60b95a1c5312cf    
  
author   : Stephen Frost <sfrost@snowman.net>    
date     : Sun, 14 Jul 2013 14:35:26 -0400    
  
committer: Stephen Frost <sfrost@snowman.net>    
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

Switch user ID to the object owner when populating a materialized view.

commit   : fb7c0ac42e1a8e3cde74e83e2c758ada8c62a35e    
  
author   : Noah Misch <noah@leadboat.com>    
date     : Fri, 12 Jul 2013 18:21:22 -0400    
  
committer: Noah Misch <noah@leadboat.com>    
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

pg_dump: Formatting cleanup of new messages

commit   : 7484f89daa33477e0027a86ae772f44fa99224ed    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Thu, 11 Jul 2013 21:48:09 -0400    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
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   : 02e61a8488de1ac559306db888901f8fa6db0755    
  
author   : Bruce Momjian <bruce@momjian.us>    
date     : Thu, 11 Jul 2013 09:43:19 -0400    
  
committer: Bruce Momjian <bruce@momjian.us>    
date     : Thu, 11 Jul 2013 09:43:19 -0400    

Click here for diff

M doc/src/sgml/pgupgrade.sgml

commit   : 583435d079767a73e1e7581bc354387c49e208ad    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Wed, 10 Jul 2013 22:40:41 -0400    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
date     : Wed, 10 Jul 2013 22:40:41 -0400    

Click here for diff

From: Ian Lawrence Barwick <barwick@gmail.com>  

M doc/src/sgml/maintenance.sgml

Fix lack of message pluralization

commit   : bf470b37cc7c9e018e9f789996ef45e35b442487    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Tue, 9 Jul 2013 20:49:44 -0400    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
date     : Tue, 9 Jul 2013 20:49:44 -0400    

Click here for diff

M src/backend/postmaster/postmaster.c

Fixed incorrect description of EXEC SQL VAR command.

commit   : d0450f1fa60e1d3485e7ec52bdc5e51a03b00cfa    
  
author   : Michael Meskes <meskes@postgresql.org>    
date     : Thu, 27 Jun 2013 16:00:32 +0200    
  
committer: Michael Meskes <meskes@postgresql.org>    
date     : Thu, 27 Jun 2013 16:00:32 +0200    

Click here for diff

Thanks to MauMau <maumau307@gmail.com> for finding and fixing this.  

M doc/src/sgml/ecpg.sgml

Fix mention of htup.h in pageinspect docs

commit   : 469feb7afb5ee9958c50a8b3000df027a1be8e19    
  
author   : Alvaro Herrera <alvherre@alvh.no-ip.org>    
date     : Mon, 8 Jul 2013 17:11:55 -0400    
  
committer: Alvaro Herrera <alvherre@alvh.no-ip.org>    
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 planning of parameterized appendrel paths with expensive join quals.

commit   : 8b6191e1d5e48d521c42d5f6bdbf8413874f7206    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sun, 7 Jul 2013 22:37:28 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sun, 7 Jul 2013 22:37:28 -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   : 95b4e8761e3aac9d27c59b89eb3ca5c90d93f9da    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Sun, 7 Jul 2013 16:01:29 -0400    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
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   : 8ca0e6870c4534f3cc36899f613928b5557c22be    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Sun, 7 Jul 2013 15:56:23 -0400    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
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   : bf8d8ddc08b9573d1b6ed2ef24c83db5fef18d8c    
  
author   : Bruce Momjian <bruce@momjian.us>    
date     : Sun, 7 Jul 2013 15:57:24 -0400    
  
committer: Bruce Momjian <bruce@momjian.us>    
date     : Sun, 7 Jul 2013 15:57:24 -0400    

Click here for diff

M doc/src/sgml/pgupgrade.sgml

Fix include-guard

commit   : 9f8830dbe203e1dde3e8aea594e4a23577e4d340    
  
author   : Magnus Hagander <magnus@hagander.net>    
date     : Sun, 7 Jul 2013 13:36:20 +0200    
  
committer: Magnus Hagander <magnus@hagander.net>    
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

Also escape double quotes for ECPG's #line statement.

commit   : 7428a260f6ad32f3f02a98842f6f09fd8092d393    
  
author   : Michael Meskes <meskes@postgresql.org>    
date     : Sat, 6 Jul 2013 22:08:53 +0200    
  
committer: Michael Meskes <meskes@postgresql.org>    
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   : e407192c937d993be1a4f5636a1afa57cf492f6f    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sat, 6 Jul 2013 11:16:53 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sat, 6 Jul 2013 11:16:53 -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

Applied patch by MauMau <maumau307@gmail.com> to escape filenames in #line statements.

commit   : 7d114fb46fd2b88cfab05f8e36ba9e9762cd576a    
  
author   : Michael Meskes <meskes@postgresql.org>    
date     : Fri, 5 Jul 2013 11:07:16 +0200    
  
committer: Michael Meskes <meskes@postgresql.org>    
date     : Fri, 5 Jul 2013 11:07:16 +0200    

Click here for diff

M src/interfaces/ecpg/preproc/output.c

Update messages, comments and documentation for materialized views.

commit   : cf183732d2b2bda2f6fd927481f787ecb1f054fa    
  
author   : Noah Misch <noah@leadboat.com>    
date     : Fri, 5 Jul 2013 15:25:51 -0400    
  
committer: Noah Misch <noah@leadboat.com>    
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

Remove stray | character

commit   : 462b562ab294dc15d6a578ebf424020f0a54e835    
  
author   : Magnus Hagander <magnus@hagander.net>    
date     : Fri, 5 Jul 2013 16:21:08 +0200    
  
committer: Magnus Hagander <magnus@hagander.net>    
date     : Fri, 5 Jul 2013 16:21:08 +0200    

Click here for diff

Erikjan Rijkers  

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

Add contrib function references in the doc index Backpatch to 9.3. Idea from Craig Ringer

commit   : 8b4c798973033156db58dbca3b605e1045cc587d    
  
author   : Bruce Momjian <bruce@momjian.us>    
date     : Thu, 4 Jul 2013 11:33:08 -0400    
  
committer: Bruce Momjian <bruce@momjian.us>    
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

docs: Clarify flag dependencies for background workers.

commit   : cdaf7bde971b592839cbc3794ead1740d1a2125a    
  
author   : Robert Haas <rhaas@postgresql.org>    
date     : Thu, 4 Jul 2013 11:11:56 -0400    
  
committer: Robert Haas <rhaas@postgresql.org>    
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   : f960fae017635a8c212ccd2168f091ea73564150    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Thu, 4 Jul 2013 10:27:33 -0400    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
date     : Thu, 4 Jul 2013 10:27:33 -0400    

Click here for diff

From: Dimitri Fontaine <dimitri@2ndQuadrant.fr>  

M doc/src/sgml/event-trigger.sgml

doc: Add event trigger C API documentation

commit   : 775a9f3025b16dcc9804cca82e744f41e1523a6e    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Wed, 3 Jul 2013 21:06:20 -0400    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
date     : Wed, 3 Jul 2013 21:06:20 -0400    

Click here for diff

From: Dimitri Fontaine <dimitri@2ndQuadrant.fr>  

M doc/src/sgml/event-trigger.sgml

pg_buffercache: document column meanings Improve documentation for usagecount and relforknumber. Backpatch to 9.3 Suggestion from Satoshi Nagayasu

commit   : d3cc1b2ff087cd68f281dad33743640dffbe01d1    
  
author   : Bruce Momjian <bruce@momjian.us>    
date     : Wed, 3 Jul 2013 14:25:06 -0400    
  
committer: Bruce Momjian <bruce@momjian.us>    
date     : Wed, 3 Jul 2013 14:25:06 -0400    

Click here for diff

M doc/src/sgml/pgbuffercache.sgml

Fix handling of auto-updatable views on inherited tables.

commit   : 654b702a1c01fa047a363a887f957886503ea67c    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Wed, 3 Jul 2013 12:26:33 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Wed, 3 Jul 2013 12:26:33 -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

Expose object name error fields in PL/pgSQL.

commit   : c21bb48d6fc1827e117e2667e0a5d9d96d984f46    
  
author   : Noah Misch <noah@leadboat.com>    
date     : Wed, 3 Jul 2013 07:29:23 -0400    
  
committer: Noah Misch <noah@leadboat.com>    
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

commit   : a74a977fb0ea535aeae06fe67ee1f9491c30b619    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Tue, 2 Jul 2013 20:32:09 -0400    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
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

commit   : 7f3cd29f8f2bd447a34748afa6dedeeba5d463db    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Tue, 2 Jul 2013 20:12:58 -0400    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
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

Mention extra_float_digits in floating point docs

commit   : 061c7a3c7adbf366707dd4c7fdfdb606d00b0dd7    
  
author   : Alvaro Herrera <alvherre@alvh.no-ip.org>    
date     : Tue, 2 Jul 2013 12:21:16 -0400    
  
committer: Alvaro Herrera <alvherre@alvh.no-ip.org>    
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  
F0E0F874-C86F-48D1-AA2A-0C5365BF5118@trillitech.com  
  
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   : ae8fc624066398b8a14a97c5f950ddc844657d24    
  
author   : Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Tue, 2 Jul 2013 17:23:42 +0300    
  
committer: Heikki Linnakangas <heikki.linnakangas@iki.fi>    
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_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   : 4d6ae6aaec5744f734735b9ab8acf29a4e97f151    
  
author   : Bruce Momjian <bruce@momjian.us>    
date     : Mon, 1 Jul 2013 14:52:56 -0400    
  
committer: Bruce Momjian <bruce@momjian.us>    
date     : Mon, 1 Jul 2013 14:52:56 -0400    

Click here for diff

M doc/src/sgml/ref/pg_dump.sgml

Fix cpluspluscheck in checksum code

commit   : 95ffbce9a197a434bc1d5bd42268f05d3bfa8168    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Sun, 30 Jun 2013 10:25:43 -0400    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
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

Change errcode for lock_timeout to match NOWAIT

commit   : 452d0c21825dd52c10af4538d850991bf6a00e38    
  
author   : Simon Riggs <simon@2ndQuadrant.com>    
date     : Sat, 29 Jun 2013 00:57:25 +0100    
  
committer: Simon Riggs <simon@2ndQuadrant.com>    
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

Update pg_resetxlog's documentation on multixacts

commit   : 5e1ed63ac2ccb3d8e605ce2e428816c8487fe683    
  
author   : Alvaro Herrera <alvherre@alvh.no-ip.org>    
date     : Thu, 27 Jun 2013 15:31:04 -0400    
  
committer: Alvaro Herrera <alvherre@alvh.no-ip.org>    
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  
1367112171.32604.4.camel@vanquo.pezone.net  

M doc/src/sgml/ref/pg_resetxlog.sgml
M src/bin/pg_resetxlog/pg_resetxlog.c

Document relminmxid and datminmxid

commit   : deac50021beded05ab98f973b6a66a58e42a06f9    
  
author   : Alvaro Herrera <alvherre@alvh.no-ip.org>    
date     : Thu, 27 Jun 2013 15:20:33 -0400    
  
committer: Alvaro Herrera <alvherre@alvh.no-ip.org>    
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

Mark index-constraint comments with correct dependency in pg_dump.

commit   : fc469af248a32560f6959b4ed29dc38477ab0ab0    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 27 Jun 2013 13:54:55 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 27 Jun 2013 13:54:55 -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   : 0b173ced93ee7a0da0d38fa13926e7ec4925075e    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 27 Jun 2013 12:36:44 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
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

Tweak wording in sequence-function docs to avoid PDF build failures.

commit   : 4b2deb72564a35c54c01323f91ca3a6be56b02bc    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 27 Jun 2013 00:23:37 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
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

Document effect of constant folding on CASE.

commit   : 40265e3446b0c037510bb05dfe80e4131e77b754    
  
author   : Noah Misch <noah@leadboat.com>    
date     : Wed, 26 Jun 2013 19:51:56 -0400    
  
committer: Noah Misch <noah@leadboat.com>    
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

pg_receivexlog: Fix logic error

commit   : dc22b34f86a29d393c6407861a6865e88736c22c    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Tue, 25 Jun 2013 23:50:14 -0400    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
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   : cb687c751c8d2e9eb097339f8920ca8fcf29fc47    
  
author   : Alvaro Herrera <alvherre@alvh.no-ip.org>    
date     : Tue, 25 Jun 2013 16:36:29 -0400    
  
committer: Alvaro Herrera <alvherre@alvh.no-ip.org>    
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   : a20d7c3bc3517e0c390a08d4f589fded953c9710    
  
author   : Andrew Dunstan <andrew@dunslane.net>    
date     : Tue, 25 Jun 2013 13:46:10 -0400    
  
committer: Andrew Dunstan <andrew@dunslane.net>    
date     : Tue, 25 Jun 2013 13:46:10 -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   : 0b958f3efcfcc3d9b0e39d550b705a28763bc9e2    
  
author   : Fujii Masao <fujii@postgresql.org>    
date     : Wed, 26 Jun 2013 02:18:26 +0900    
  
committer: Fujii Masao <fujii@postgresql.org>    
date     : Wed, 26 Jun 2013 02:18:26 +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

Stamp 9.3beta2.

commit   : 09bd2acbe5ac866ce93d7c0e6ed90b426a576f1b    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Mon, 24 Jun 2013 14:55:41 -0400    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
date     : Mon, 24 Jun 2013 14:55:41 -0400    

Click here for diff

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

Translation updates

commit   : 060ffab6b9f3e684c3a36b74af7bff4c1cfc4bc2    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Mon, 24 Jun 2013 14:16:15 -0400    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
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

Ensure no xid gaps during Hot Standby startup

commit   : 7b2c9d682957418778dfb7217a536c5a99635a2b    
  
author   : Simon Riggs <simon@2ndQuadrant.com>    
date     : Sun, 23 Jun 2013 11:09:24 +0100    
  
committer: Simon Riggs <simon@2ndQuadrant.com>    
date     : Sun, 23 Jun 2013 11:09:24 +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   : 0b5a5c8e05e6ebc5923375b056885c6e9934ee31    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Fri, 21 Jun 2013 22:48:06 -0400    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
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

Further update CREATE FUNCTION documentation about argument names

commit   : b3b2ea4ad799f5b0e9e0711d23a884102f2d9a66    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Wed, 19 Jun 2013 22:25:13 -0400    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
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   : 75555da10bbf9b8d7e4c8f509255331a7e20865b    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Tue, 18 Jun 2013 21:56:13 -0400    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
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

Fix the create_index regression test for Danish collation.

commit   : 854ebd0f5fb069a6c96e14cff4965350fb5374a6    
  
author   : Kevin Grittner <kgrittn@postgresql.org>    
date     : Wed, 19 Jun 2013 10:37:39 -0500    
  
committer: Kevin Grittner <kgrittn@postgresql.org>    
date     : Wed, 19 Jun 2013 10:37:39 -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   : 0ae1bf8c1be7eccc54792a9c211345f97a11f78e    
  
author   : Simon Riggs <simon@2ndQuadrant.com>    
date     : Tue, 18 Jun 2013 12:10:10 +0100    
  
committer: Simon Riggs <simon@2ndQuadrant.com>    
date     : Tue, 18 Jun 2013 12:10:10 +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   : 7558c1c00a2195e9de88121e2af5119b609a8600    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Mon, 17 Jun 2013 21:53:33 -0400    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
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   : 20723ce80121d99b07c93e5bb9b32b7e09d75231    
  
author   : Jeff Davis <jdavis@postgresql.org>    
date     : Mon, 17 Jun 2013 08:02:12 -0700    
  
committer: Jeff Davis <jdavis@postgresql.org>    
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   : 7b5d712d08df978d7345a7bbf14786ce3879f317    
  
author   : Fujii Masao <fujii@postgresql.org>    
date     : Sun, 16 Jun 2013 09:39:16 +0900    
  
committer: Fujii Masao <fujii@postgresql.org>    
date     : Sun, 16 Jun 2013 09:39:16 +0900    

Click here for diff

M doc/src/sgml/ref/pg_restore.sgml

Use WaitLatch, not pg_usleep, for delaying in pg_sleep().

commit   : c38b64c2959662298f23ad5d86246009e7853b75    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sat, 15 Jun 2013 16:22:29 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
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   : fc02d2b245e82a385785bb4a0f49d8b617680779    
  
author   : Fujii Masao <fujii@postgresql.org>    
date     : Sun, 16 Jun 2013 05:12:39 +0900    
  
committer: Fujii Masao <fujii@postgresql.org>    
date     : Sun, 16 Jun 2013 05:12:39 +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   : 61f3ada319038e7597c81f7f454982852bf02de3    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sat, 15 Jun 2013 15:39:51 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
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

Avoid deadlocks during insertion into SP-GiST indexes.

commit   : e472b921406407794bab911c64655b8b82375196    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Fri, 14 Jun 2013 14:26:43 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Fri, 14 Jun 2013 14:26:43 -0400    

Click here for diff

SP-GiST's original scheme for avoiding deadlocks during concurrent index  
insertions doesn't work, as per report from Hailong Li, and there isn't any  
evident way to make it work completely.  We could possibly lock individual  
inner tuples instead of their whole pages, but preliminary experimentation  
suggests that the performance penalty would be huge.  Instead, if we fail  
to get a buffer lock while descending the tree, just restart the tree  
descent altogether.  We keep the old tuple positioning rules, though, in  
hopes of reducing the number of cases where this can happen.  
  
Teodor Sigaev, somewhat edited by Tom Lane  

M src/backend/access/spgist/README
M src/backend/access/spgist/spgdoinsert.c
M src/backend/access/spgist/spginsert.c
M src/include/access/spgist_private.h

Remove special-case treatment of LOG severity level in standalone mode.

commit   : c62866eeafd52822ec61a0d2db9428c05e97d3cc    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 13 Jun 2013 23:15:15 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 13 Jun 2013 23:15:15 -0400    

Click here for diff

elog.c has historically treated LOG messages as low-priority during  
bootstrap and standalone operation.  This has led to confusion and even  
masked a bug, because the normal expectation of code authors is that  
elog(LOG) will put something into the postmaster log, and that wasn't  
happening during initdb.  So get rid of the special-case rule and make  
the priority order the same as it is in normal operation.  To keep from  
cluttering initdb's output and the behavior of a standalone backend,  
tweak the severity level of three messages routinely issued by xlog.c  
during startup and shutdown so that they won't appear in these cases.  
Per my proposal back in December.  

M src/backend/access/transam/xlog.c
M src/backend/utils/error/elog.c

Refactor checksumming code to make it easier to use externally.

commit   : f04216341dd1cc235e975f93ac806d9d3729a344    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 13 Jun 2013 22:35:56 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 13 Jun 2013 22:35:56 -0400    

Click here for diff

pg_filedump and other external utility programs are likely to want to be  
able to check Postgres page checksums.  To avoid messy duplication of code,  
move the checksumming functionality into an exported header file, much as  
we did awhile back for the CRC code.  
  
In passing, get rid of an unportable assumption that a static char[] array  
will be word-aligned, and do some other minor code beautification.  

M src/backend/storage/buffer/bufmgr.c
M src/backend/storage/page/bufpage.c
M src/backend/storage/page/checksum.c
M src/include/storage/checksum.h
A src/include/storage/checksum_impl.h

PL/Python: Fix type mixup

commit   : fa2fc066f34f1b631b5f92f11e7cda9f60a25330    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Thu, 13 Jun 2013 21:42:42 -0400    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
date     : Thu, 13 Jun 2013 21:42:42 -0400    

Click here for diff

Memory was allocated based on the sizeof a type that was not the type of  
the pointer that the result was being assigned to.  The types happen to  
be of the same size, but it's still wrong.  

M src/pl/plpython/plpy_typeio.c

Only install a portal's ResourceOwner if it actually has one.

commit   : 629b3e96dd64fa081d8b4610c5a723ef68af09d7    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 13 Jun 2013 13:11:29 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 13 Jun 2013 13:11:29 -0400    

Click here for diff

In most scenarios a portal without a ResourceOwner is dead and not subject  
to any further execution, but a portal for a cursor WITH HOLD remains in  
existence with no ResourceOwner after the creating transaction is over.  
In this situation, if we attempt to "execute" the portal directly to fetch  
data from it, we were setting CurrentResourceOwner to NULL, leading to a  
segfault if the datatype output code did anything that required a resource  
owner (such as trying to fetch system catalog entries that weren't already  
cached).  The case appears to be impossible to provoke with stock libpq,  
but psqlODBC at least is able to cause it when working with held cursors.  
  
Simplest fix is to just skip the assignment to CurrentResourceOwner, so  
that any resources used by the data output operations will be managed by  
the transaction-level resource owner instead.  For consistency I changed  
all the places that install a portal's resowner as current, even though  
some of them are probably not reachable with a held cursor's portal.  
  
Per report from Joshua Berry (with thanks to Hiroshi Inoue for developing  
a self-contained test case).  Back-patch to all supported versions.  

M src/backend/commands/portalcmds.c
M src/backend/tcop/pquery.c

Avoid reading past datum end when parsing JSON.

commit   : 66008564f8ce570f7ad6368fbde2138e946d328b    
  
author   : Noah Misch <noah@leadboat.com>    
date     : Wed, 12 Jun 2013 19:51:12 -0400    
  
committer: Noah Misch <noah@leadboat.com>    
date     : Wed, 12 Jun 2013 19:51:12 -0400    

Click here for diff

Several loops in the JSON parser examined a byte in memory just before  
checking whether its address was in-bounds, so they could read one byte  
beyond the datum's allocation.  A SIGSEGV is possible.  New in 9.3, so  
no back-patch.  

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

Avoid reading below the start of a stack variable in tokenize_file().

commit   : 3a5d0c55338e6beb4c01ed5fadb1462e90db7545    
  
author   : Noah Misch <noah@leadboat.com>    
date     : Wed, 12 Jun 2013 19:50:52 -0400    
  
committer: Noah Misch <noah@leadboat.com>    
date     : Wed, 12 Jun 2013 19:50:52 -0400    

Click here for diff

We would wrongly overwrite the prior stack byte if it happened to  
contain '\n' or '\r'.  New in 9.3, so no back-patch.  

M src/backend/libpq/hba.c

Don't pass oidvector by value.

commit   : 813895e4acfa646c6c0405a0a8c5d05637f42865    
  
author   : Noah Misch <noah@leadboat.com>    
date     : Wed, 12 Jun 2013 19:50:37 -0400    
  
committer: Noah Misch <noah@leadboat.com>    
date     : Wed, 12 Jun 2013 19:50:37 -0400    

Click here for diff

Since the structure ends with a flexible array, doing so truncates any  
vector having more than one element.  New in 9.3, so no back-patch.  

M src/backend/commands/alter.c
M src/backend/commands/functioncmds.c
M src/include/commands/defrem.h

Observe array length in HaveVirtualXIDsDelayingChkpt().

commit   : fb435f40d5e34f85076a0af56b2f3bf7b86122b8    
  
author   : Noah Misch <noah@leadboat.com>    
date     : Wed, 12 Jun 2013 19:50:14 -0400    
  
committer: Noah Misch <noah@leadboat.com>    
date     : Wed, 12 Jun 2013 19:50:14 -0400    

Click here for diff

Since commit f21bb9cfb5646e1793dcc9c0ea697bab99afa523, this function  
ignores the caller-provided length and loops until it finds a  
terminator, which GetVirtualXIDsDelayingChkpt() never adds.  Restore the  
previous loop control logic.  In passing, revert the addition of an  
unused variable by the same commit, presumably a debugging relic.  

M src/backend/access/transam/xlog.c
M src/backend/storage/ipc/procarray.c

Don't use ordinary NULL-terminated strings as Name datums.

commit   : ff53890f687c7f6b2a10db6661e9c32faf832636    
  
author   : Noah Misch <noah@leadboat.com>    
date     : Wed, 12 Jun 2013 19:49:50 -0400    
  
committer: Noah Misch <noah@leadboat.com>    
date     : Wed, 12 Jun 2013 19:49:50 -0400    

Click here for diff

Consumers are entitled to read the full 64 bytes pertaining to a Name;  
using a shorter NULL-terminated string leads to reading beyond the end  
its allocation; a SIGSEGV is possible.  Use the frequent idiom of  
copying to a NameData on the stack.  New in 9.3, so no back-patch.  

M src/backend/commands/alter.c
M src/backend/commands/event_trigger.c

Improve updatability checking for views and foreign tables.

commit   : dc3eb5638349e74a6628130a5101ce866455f4a3    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Wed, 12 Jun 2013 17:52:54 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Wed, 12 Jun 2013 17:52:54 -0400    

Click here for diff

Extend the FDW API (which we already changed for 9.3) so that an FDW can  
report whether specific foreign tables are insertable/updatable/deletable.  
The default assumption continues to be that they're updatable if the  
relevant executor callback function is supplied by the FDW, but finer  
granularity is now possible.  As a test case, add an "updatable" option to  
contrib/postgres_fdw.  
  
This patch also fixes the information_schema views, which previously did  
not think that foreign tables were ever updatable, and fixes  
view_is_auto_updatable() so that a view on a foreign table can be  
auto-updatable.  
  
initdb forced due to changes in information_schema views and the functions  
they rely on.  This is a bit unfortunate to do post-beta1, but if we don't  
change this now then we'll have another API break for FDWs when we do  
change it.  
  
Dean Rasheed, somewhat editorialized on by Tom Lane  

M contrib/postgres_fdw/expected/postgres_fdw.out
M contrib/postgres_fdw/option.c
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/postgres-fdw.sgml
M src/backend/catalog/information_schema.sql
M src/backend/executor/execMain.c
M src/backend/rewrite/rewriteHandler.c
M src/backend/utils/adt/misc.c
M src/include/catalog/catversion.h
M src/include/catalog/pg_proc.h
M src/include/foreign/fdwapi.h
M src/include/rewrite/rewriteHandler.h
M src/include/utils/builtins.h

Fix unescaping of JSON Unicode escapes, especially for non-UTF8.

commit   : 78ed8e03c67d7333708f5c1873ec1d239ae2d7e0    
  
author   : Andrew Dunstan <andrew@dunslane.net>    
date     : Wed, 12 Jun 2013 13:35:24 -0400    
  
committer: Andrew Dunstan <andrew@dunslane.net>    
date     : Wed, 12 Jun 2013 13:35:24 -0400    

Click here for diff

Per discussion  on -hackers. We treat Unicode escapes when unescaping  
them similarly to the way we treat them in PostgreSQL string literals.  
Escapes in the ASCII range are always accepted, no matter what the  
database encoding. Escapes for higher code points are only processed in  
UTF8 databases, and attempts to process them in other databases will  
result in an error. \u0000 is never unescaped, since it would result in  
an impermissible null byte.  

M doc/src/sgml/func.sgml
M src/backend/utils/adt/json.c
M src/test/regress/expected/json.out
A src/test/regress/expected/json_1.out
M src/test/regress/sql/json.sql

Improve description of loread/lowrite.

commit   : c1d729b419ee876c32ddf4ac3a85fa89a6b4a89b    
  
author   : Robert Haas <rhaas@postgresql.org>    
date     : Wed, 12 Jun 2013 12:20:59 -0400    
  
committer: Robert Haas <rhaas@postgresql.org>    
date     : Wed, 12 Jun 2013 12:20:59 -0400    

Click here for diff

Patch by me, reviewed by Tatsuo Ishii.  

M doc/src/sgml/lobj.sgml

Fix cache flush hazard in cache_record_field_properties().

commit   : e262755bfc97f31442cc0def8098b1a7d2913355    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Tue, 11 Jun 2013 17:26:42 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Tue, 11 Jun 2013 17:26:42 -0400    

Click here for diff

We need to increment the refcount on the composite type's cached tuple  
descriptor while we do lookups of its column types.  Otherwise a cache  
flush could occur and release the tuple descriptor before we're done with  
it.  This fails reliably with -DCLOBBER_CACHE_ALWAYS, but the odds of a  
failure in a production build seem rather low (since the pfree'd descriptor  
typically wouldn't get scribbled on immediately).  That may explain the  
lack of any previous reports.  Buildfarm issue noted by Christian Ullrich.  
  
Back-patch to 9.1 where the bogus code was added.  

M src/backend/utils/cache/typcache.c

Add description that loread()/lowrite() are corresponding to lo_read()/lo_write() in libpq to avoid confusion.

commit   : ecdec470e7a39316df185d387aeaeceab7155ada    
  
author   : Tatsuo Ishii <ishii@postgresql.org>    
date     : Tue, 11 Jun 2013 14:25:58 +0900    
  
committer: Tatsuo Ishii <ishii@postgresql.org>    
date     : Tue, 11 Jun 2013 14:25:58 +0900    

Click here for diff

M doc/src/sgml/lobj.sgml

Fix pg_isready to handle conninfo properly.

commit   : 941c4ece98d08113b557bc8e7dbd8a9ac0ffac3e    
  
author   : Fujii Masao <fujii@postgresql.org>    
date     : Tue, 11 Jun 2013 03:03:16 +0900    
  
committer: Fujii Masao <fujii@postgresql.org>    
date     : Tue, 11 Jun 2013 03:03:16 +0900    

Click here for diff

pg_isready displays the host name and the port number that it uses to connect  
to the server. So far, pg_isready didn't use the conninfo specified in -d option  
for calculating those host name and port number. This can lead to wrong display  
to a user. This commit changes pg_isready so that it uses the conninfo for that  
calculation.  
  
Original patch by Phil Sorber, modified by me.  

M src/bin/scripts/pg_isready.c

Fix ordering of obj id for Rules and EventTriggers in pg_dump.

commit   : 33a4466f767be8b153ef1ef78433ad9b1867dab8    
  
author   : Joe Conway <mail@joeconway.com>    
date     : Sun, 9 Jun 2013 17:30:39 -0700    
  
committer: Joe Conway <mail@joeconway.com>    
date     : Sun, 9 Jun 2013 17:30:39 -0700    

Click here for diff

getSchemaData() must identify extension member objects and mark them  
as not to be dumped. This must happen after reading all objects that can be  
direct members of extensions, but before we begin to process table subsidiary  
objects. Both rules and event triggers were wrong in this regard.  
  
Backport rules portion of patch to 9.1 -- event triggers do not exist prior to 9.3.  
Suggested fix by Tom Lane, initial complaint and patch by me.  

M src/bin/pg_dump/common.c

Tweak postgres_fdw regression test so autovacuum doesn't change results.

commit   : e0b451e43250558b3c1ac830e067b39e25e0e348    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sun, 9 Jun 2013 19:41:52 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sun, 9 Jun 2013 19:41:52 -0400    

Click here for diff

Autovacuum occurring while the test runs could allow some of the inserts to  
go into recycled space, thus changing the output ordering of later queries.  
While we could complicate those queries to force sorting of their output  
rows, it doesn't seem like that would make the test better in any  
meaningful way, and conceivably it could hide unexpected diffs.  Instead,  
tweak the affected queries so that the inserted rows aren't updated by the  
following UPDATE.  Per buildfarm.  

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

Remove unnecessary restrictions about RowExprs in transformAExprIn().

commit   : a4424c57c3da52efa212b21521abff4bf129b19e    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sun, 9 Jun 2013 18:39:20 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sun, 9 Jun 2013 18:39:20 -0400    

Click here for diff

When the existing code here was written, it made sense to special-case  
RowExprs because that was the only way that we could handle row comparisons  
at all.  Now that we have record_eq() and arrays of composites, the generic  
logic for "scalar" types will in fact work on RowExprs too, so there's no  
reason to throw error for combinations of RowExprs and other ways of  
forming composite values, nor to ignore the possibility of using a  
ScalarArrayOpExpr.  But keep using the old logic when comparing two  
RowExprs, for consistency with the main transformAExprOp() logic.  (This  
allows some cases with not-quite-identical rowtypes to succeed, so we might  
get push-back if we removed it.)  Per bug #8198 from Rafal Rzepecki.  
  
Back-patch to all supported branches, since this works fine as far back as  
8.4.  
  
Rafal Rzepecki and Tom Lane  

M src/backend/parser/parse_expr.c
M src/test/regress/expected/rowtypes.out
M src/test/regress/sql/rowtypes.sql

Remove ALTER DEFAULT PRIVILEGES' requirement of schema CREATE permissions.

commit   : f3839ea117fba6fdb69c75a1fe145aa86a4c8ae3    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sun, 9 Jun 2013 15:26:40 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sun, 9 Jun 2013 15:26:40 -0400    

Click here for diff

Per discussion, this restriction isn't needed for any real security reason,  
and it seems to confuse people more often than it helps them.  It could  
also result in some database states being unrestorable.  So just drop it.  
  
Back-patch to 9.0, where ALTER DEFAULT PRIVILEGES was introduced.  

M doc/src/sgml/ref/alter_default_privileges.sgml
M src/backend/catalog/aclchk.c

Remove fixed limit on the number of concurrent AllocateFile() requests.

commit   : 007556bf08e6153c442fe3742adb3685fca3a0e0    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sun, 9 Jun 2013 13:46:54 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sun, 9 Jun 2013 13:46:54 -0400    

Click here for diff

AllocateFile(), AllocateDir(), and some sister routines share a small array  
for remembering requests, so that the files can be closed on transaction  
failure.  Previously that array had a fixed size, MAX_ALLOCATED_DESCS (32).  
While historically that had seemed sufficient, Steve Toutant pointed out  
that this meant you couldn't scan more than 32 file_fdw foreign tables in  
one query, because file_fdw depends on the COPY code which uses  
AllocateFile().  There are probably other cases, or will be in the future,  
where this nonconfigurable limit impedes users.  
  
We can't completely remove any such limit, at least not without a lot of  
work, since each such request requires a kernel file descriptor and most  
platforms limit the number we can have.  (In principle we could  
"virtualize" these descriptors, as fd.c already does for the main VFD pool,  
but not without an additional layer of overhead and a lot of notational  
impact on the calling code.)  But we can at least let the array size be  
configurable.  Hence, change the code to allow up to max_safe_fds/2  
allocated file requests.  On modern platforms this should allow several  
hundred concurrent file_fdw scans, or more if one increases the value of  
max_files_per_process.  To go much further than that, we'd need to do some  
more work on the data structure, since the current code for closing  
requests has potentially O(N^2) runtime; but it should still be all right  
for request counts in this range.  
  
Back-patch to 9.1 where contrib/file_fdw was introduced.  

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

Don't downcase non-ascii identifier chars in multi-byte encodings.

commit   : d535136b5d60b19f7ffa777b97ed301739c15a9d    
  
author   : Andrew Dunstan <andrew@dunslane.net>    
date     : Sat, 8 Jun 2013 10:00:09 -0400    
  
committer: Andrew Dunstan <andrew@dunslane.net>    
date     : Sat, 8 Jun 2013 10:00:09 -0400    

Click here for diff

Long-standing code has called tolower() on identifier character bytes  
with the high bit set. This is clearly an error and produces junk output  
when the encoding is multi-byte. This patch therefore restricts this  
activity to cases where there is a character with the high bit set AND  
the encoding is single-byte.  
  
There have been numerous gripes about this, most recently from Martin  
Schäfer.  
  
Backpatch to all live releases.  

M src/backend/parser/scansup.c

Handle Unicode surrogate pairs correctly when processing JSON.

commit   : 94e3311b97448324d67ba9a527854271373329d9    
  
author   : Andrew Dunstan <andrew@dunslane.net>    
date     : Sat, 8 Jun 2013 09:12:48 -0400    
  
committer: Andrew Dunstan <andrew@dunslane.net>    
date     : Sat, 8 Jun 2013 09:12:48 -0400    

Click here for diff

In 9.2, Unicode escape sequences are not analysed at all other than  
to make sure that they are in the form \uXXXX. But in 9.3 many of the  
new operators and functions try to turn JSON text values into text in  
the server encoding, and this includes de-escaping Unicode escape  
sequences. This processing had not taken into account the possibility  
that this might contain a surrogate pair to designate a character  
outside the BMP. That is now handled correctly.  
  
This also enforces correct use of surrogate pairs, something that is not  
done by the type's input routines. This fact is noted in the docs.  

M doc/src/sgml/func.sgml
M src/backend/utils/adt/json.c
M src/test/regress/expected/json.out
M src/test/regress/sql/json.sql

doc: Fix <synopsis> in <term> markup

commit   : c99d5d1bcc137c15058458bbdcdd2789b56e4c66    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Fri, 7 Jun 2013 22:00:59 -0400    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
date     : Fri, 7 Jun 2013 22:00:59 -0400    

Click here for diff

Although the DTD technically allows this, the resulting HTML is invalid  
because it puts block elements inside inline elements.  DocBook 5.0 also  
doesn't allow it anymore, so it's fair to assume that this was never  
really intended to work.  Replace <synopsis> with <literal>, which is  
the markup used elsewhere in the documentation in similar cases.  

M doc/src/sgml/textsearch.sgml

Correct the documentation of pg_rewrite.ev_attr.

commit   : 734fbbd1d2d1babfbd195414e2445024ad549ae3    
  
author   : Kevin Grittner <kgrittn@postgresql.org>    
date     : Fri, 7 Jun 2013 08:04:22 -0500    
  
committer: Kevin Grittner <kgrittn@postgresql.org>    
date     : Fri, 7 Jun 2013 08:04:22 -0500    

Click here for diff

It claimed the value was always zero; it is really always -1.  
  
Per report from Hari Babu  

M doc/src/sgml/catalogs.sgml

Minor docs wordsmithing.

commit   : 7b1e893acd4b7637de93631781f82e0f6834b621    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Fri, 7 Jun 2013 00:08:02 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Fri, 7 Jun 2013 00:08:02 -0400    

Click here for diff

Swap the order of a couple of phrases to clarify what the adjective  
"subsequent" applies to.  
  
Joshua Tolley  

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

doc: Clarify description of VALUES command

commit   : 58617e4dc131561f4b6ba492d6a404b05bd0b968    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Thu, 6 Jun 2013 21:03:04 -0400    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
date     : Thu, 6 Jun 2013 21:03:04 -0400    

Click here for diff

Greg Smith  

M doc/src/sgml/queries.sgml

Fix typo in comment.

commit   : f73cb5567c2e27d9a02c7ddba9da8d8557cf08dd    
  
author   : Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Thu, 6 Jun 2013 18:25:26 +0300    
  
committer: Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Thu, 6 Jun 2013 18:25:26 +0300    

Click here for diff

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

Ensure that XLOG_HEAP2_VISIBLE always targets an initialized page.

commit   : a6370fd9ed3dbad6070b789eae916d6a037e4773    
  
author   : Robert Haas <rhaas@postgresql.org>    
date     : Thu, 6 Jun 2013 10:03:37 -0400    
  
committer: Robert Haas <rhaas@postgresql.org>    
date     : Thu, 6 Jun 2013 10:03:37 -0400    

Click here for diff

Andres Freund  

M src/backend/commands/vacuumlazy.c

commit   : e2c84bc9f5f1f2f9570c882d10c2cbdf6fe9e47d    
  
author   : Bruce Momjian <bruce@momjian.us>    
date     : Thu, 6 Jun 2013 10:13:55 -0400    
  
committer: Bruce Momjian <bruce@momjian.us>    
date     : Thu, 6 Jun 2013 10:13:55 -0400    

Click here for diff

M doc/src/sgml/pgupgrade.sgml

Prevent pushing down WHERE clauses into unsafe UNION/INTERSECT nests.

commit   : 964c0d0f80e485dd3a4073e073ddfd9bfdda90b2    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Wed, 5 Jun 2013 23:44:02 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Wed, 5 Jun 2013 23:44:02 -0400    

Click here for diff

The planner is aware that it mustn't push down upper-level quals into  
subqueries if the quals reference subquery output columns that contain  
set-returning functions or volatile functions, or are non-DISTINCT outputs  
of a DISTINCT ON subquery.  However, it missed making this check when  
there were one or more levels of UNION or INTERSECT above the dangerous  
expression.  This could lead to "set-valued function called in context that  
cannot accept a set" errors, as seen in bug #8213 from Eric Soroos, or to  
silently wrong answers in the other cases.  
  
To fix, refactor the checks so that we make the column-is-unsafe checks  
during subquery_is_pushdown_safe(), which already has to recursively  
inspect all arms of a set-operation tree.  This makes  
qual_is_pushdown_safe() considerably simpler, at the cost that we will  
spend some cycles checking output columns that possibly aren't referenced  
in any upper qual.  But the cases where this code gets executed at all  
are already nontrivial queries, so it's unlikely anybody will notice any  
slowdown of planning.  
  
This has been broken since commit 05f916e6add9726bf4ee046e4060c1b03c9961f2,  
which makes the bug over ten years old.  A bit surprising nobody noticed it  
before now.  

M src/backend/optimizer/path/allpaths.c
M src/test/regress/expected/union.out
M src/test/regress/sql/union.sql

Update SQL features list

commit   : a3bd6096bdc6db70ec267116ba52a4cccbd34c2a    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Wed, 5 Jun 2013 22:05:18 -0400    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
date     : Wed, 5 Jun 2013 22:05:18 -0400    

Click here for diff

M src/backend/catalog/sql_features.txt

Put analyze_keyword back in explain_option_name production.

commit   : 3f783c882712db5a5e0056f271ff765edeb2571a    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Wed, 5 Jun 2013 13:32:53 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Wed, 5 Jun 2013 13:32:53 -0400    

Click here for diff

In commit 2c92edad48796119c83d7dbe6c33425d1924626d, I broke "EXPLAIN  
(ANALYZE)" syntax, because I mistakenly thought that ANALYZE/ANALYSE were  
only partially reserved and thus would be included in NonReservedWord;  
but actually they're fully reserved so they still need to be called out  
here.  
  
A nicer solution would be to demote these words to type_func_name_keyword  
status (they can't be less than that because of "VACUUM [ANALYZE] ColId").  
While that works fine so far as the core grammar is concerned, it breaks  
ECPG's grammar for reasons I don't have time to isolate at the moment.  
So do this for the time being.  
  
Per report from Kevin Grittner.  Back-patch to 9.0, like the previous  
commit.  

M src/backend/parser/gram.y

Provide better message when CREATE EXTENSION can't find a target schema.

commit   : 530acda4dabe26a4345eccd28a92dd23b1e7a94a    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Tue, 4 Jun 2013 17:22:29 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Tue, 4 Jun 2013 17:22:29 -0400    

Click here for diff

The new message (and SQLSTATE) matches the corresponding error cases in  
namespace.c.  
  
This was thought to be a "can't happen" case when extension.c was written,  
so we didn't think hard about how to report it.  But it definitely can  
happen in 9.2 and later, since we no longer require search_path to contain  
any valid schema names.  It's probably also possible in 9.1 if search_path  
came from a noninteractive source.  So, back-patch to all releases  
containing this code.  
  
Per report from Sean Chittenden, though this isn't exactly his patch.  

M src/backend/commands/extension.c

Add ARM64 (aarch64) support to s_lock.h.

commit   : 5c7603c318872a42e1665b228f68fdf58714d945    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Tue, 4 Jun 2013 15:42:02 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Tue, 4 Jun 2013 15:42:02 -0400    

Click here for diff

Use the same gcc atomic functions as we do on newer ARM chips.  
(Basically this is a copy and paste of the __arm__ code block,  
but omitting the SWPB option since that definitely won't work.)  
  
Back-patch to 9.2.  The patch would work further back, but we'd also  
need to update config.guess/config.sub in older branches to make them  
build out-of-the-box, and there hasn't been demand for it.  
  
Mark Salter  

M src/include/storage/s_lock.h

Fix memory leak in LogStandbySnapshot().

commit   : dbc6eb1f4b840d252031419d4bf694316812124f    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Tue, 4 Jun 2013 14:58:46 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Tue, 4 Jun 2013 14:58:46 -0400    

Click here for diff

The array allocated by GetRunningTransactionLocks() needs to be pfree'd  
when we're done with it.  Otherwise we leak some memory during each  
checkpoint, if wal_level = hot_standby.  This manifests as memory bloat  
in the checkpointer process, or in bgwriter in versions before we made  
the checkpointer separate.  
  
Reported and fixed by Naoya Anzai.  Back-patch to 9.0 where the issue  
was introduced.  
  
In passing, improve comments for GetRunningTransactionLocks(), and add  
an Assert that we didn't overrun the palloc'd array.  

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

Fix off-by-one in pg_xlogdump -r option.

commit   : 79e15c7d86d3f781cc390a5a04db18254ce97b79    
  
author   : Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Tue, 4 Jun 2013 18:51:43 +0300    
  
committer: Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Tue, 4 Jun 2013 18:51:43 +0300    

Click here for diff

Because of the bug, -r would not accept the rmgr with the highest ID.  

M contrib/pg_xlogdump/pg_xlogdump.c

Add semicolons to eval'd strings to hide a minor Perl behavioral change.

commit   : 035a5e1e8c346efe25df6be4627b5f24cc3736b1    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Mon, 3 Jun 2013 14:19:26 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Mon, 3 Jun 2013 14:19:26 -0400    

Click here for diff

"eval q{foo}" used to complain that the error was on line 2 of the eval'd  
string, because eval internally tacked on "\n;" so that the end of the  
erroneous command was indeed on line 2.  But as of Perl 5.18 it more  
sanely says that the error is on line 1.  To avoid Perl-version-dependent  
regression test results, use "eval q{foo;}" instead in the two places  
where this matters.  Per buildfarm.  
  
Since people might try to use newer Perl versions with older PG releases,  
back-patch as far as 9.0 where these test cases were added.  

M src/pl/plperl/expected/plperl.out
M src/pl/plperl/expected/plperl_init.out
M src/pl/plperl/sql/plperl.sql
M src/pl/plperl/sql/plperl_init.sql

Put back allow_system_table_mods check in heap_create().

commit   : 15386281a62071f322155b74cb32c2fea92e8350    
  
author   : Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Mon, 3 Jun 2013 17:22:31 +0300    
  
committer: Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Mon, 3 Jun 2013 17:22:31 +0300    

Click here for diff

This reverts commit a475c6036752c26dca538632b68fd2cc592976b7.  
  
Erik Rijkers reported back in January 2013 that after the patch, if you do  
"pg_dump -t myschema.mytable" to dump a single table, and restore that in  
a database where myschema does not exist, the table is silently created in  
pg_catalog instead. That is because pg_dump uses  
"SET search_path=myschema, pg_catalog" to set schema the table is created  
in. While allow_system_table_mods is not a very elegant solution to this,  
we can't leave it as it is, so for now, revert it back to the way it was  
previously.  

M src/backend/bootstrap/bootparse.y
M src/backend/catalog/heap.c
M src/backend/catalog/index.c
M src/include/catalog/heap.h

Additional spelling corrections

commit   : f129615fe72f70868a86862b663dd7d78dd5cb71    
  
author   : Stephen Frost <sfrost@snowman.net>    
date     : Mon, 3 Jun 2013 08:40:27 -0400    
  
committer: Stephen Frost <sfrost@snowman.net>    
date     : Mon, 3 Jun 2013 08:40:27 -0400    

Click here for diff

A few more minor spelling corrections, no functional changes.  
  
Thom Brown  

M src/backend/access/hash/README
M src/backend/access/nbtree/README
M src/backend/utils/adt/windowfuncs.c
M src/interfaces/libpq/fe-exec.c

Code review of recycling WAL segments in a restartpoint.

commit   : e1e2bb34f1237cbec396bcaa795f0fa955af0e72    
  
author   : Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Mon, 3 Jun 2013 09:25:12 +0300    
  
committer: Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Mon, 3 Jun 2013 09:25:12 +0300    

Click here for diff

Seems cleaner to get the currently-replayed TLI in the same call to  
GetXLogReplayRecPtr that we get the WAL position. Make it more clear in the  
comment what the code does when recovery has already ended  
(RecoveryInProgress() will set ThisTimeLineID in that case). Finally, make  
resetting ThisTimeLineID afterwards more explicit.  

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

Allow type_func_name_keywords in some places where they weren't before.

commit   : 2c92edad48796119c83d7dbe6c33425d1924626d    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sun, 2 Jun 2013 20:09:20 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sun, 2 Jun 2013 20:09:20 -0400    

Click here for diff

This change makes type_func_name_keywords less reserved than they were  
before, by allowing them for role names, language names, EXPLAIN and COPY  
options, and SET values for GUCs; which are all places where few if any  
actual keywords could appear instead, so no new ambiguities are introduced.  
  
The main driver for this change is to allow "COPY ... (FORMAT BINARY)"  
to work without quoting the word "binary".  That is an inconsistency that  
has been complained of repeatedly over the years (at least by Pavel Golub,  
Kurt Lidl, and Simon Riggs); but we hadn't thought of any non-ugly solution  
until now.  
  
Back-patch to 9.0 where the COPY (FORMAT BINARY) syntax was introduced.  

M src/backend/parser/gram.y

Another man page whitespace fix

commit   : 22b36412c73fdae960cc6bef58eb16a26d14b700    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Sat, 1 Jun 2013 22:22:02 -0400    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
date     : Sat, 1 Jun 2013 22:22:02 -0400    

Click here for diff

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

Fix whitespace issues in the man pages

commit   : 93874ce064836e45220978e2656cbf62eba766ed    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Sat, 1 Jun 2013 22:03:02 -0400    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
date     : Sat, 1 Jun 2013 22:03:02 -0400    

Click here for diff

See 00b0c73f1f2b98a7d09de63aaa14d6498ac521ae for an explanation.  

M doc/src/sgml/ref/alter_view.sgml
M doc/src/sgml/ref/create_event_trigger.sgml
M doc/src/sgml/ref/create_view.sgml
M doc/src/sgml/ref/refresh_materialized_view.sgml
M doc/src/sgml/ref/select.sgml

Fix unportable usage of isspace().

commit   : a149d8bd56edc2f06643118ed8aac8bce6ebad6d    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sat, 1 Jun 2013 13:58:23 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sat, 1 Jun 2013 13:58:23 -0400    

Click here for diff

Must cast char argument to unsigned to avoid doing the wrong thing  
with high-bit-set characters.  Oversight in commit  
30b5ede7157e34e77c7914b8ecfd55aa8da6edc3.  

M src/bin/pg_basebackup/pg_basebackup.c

Minor spelling fixes

commit   : c9fc28a7f12e27d530e2657c9dc6080fbfbe8a14    
  
author   : Stephen Frost <sfrost@snowman.net>    
date     : Sat, 1 Jun 2013 10:18:59 -0400    
  
committer: Stephen Frost <sfrost@snowman.net>    
date     : Sat, 1 Jun 2013 10:18:59 -0400    

Click here for diff

Fix a few spelling mistakes.  
  
Per bug report #8193 from Lajos Veres.  

M contrib/pg_upgrade/relfilenode.c
M src/backend/access/transam/xlogreader.c
M src/backend/utils/adt/tsrank.c
M src/tools/pgindent/typedefs.list

Post-pgindent cleanup

commit   : 551938ae2284975b53d665fa8a82a7e1f3514dda    
  
author   : Stephen Frost <sfrost@snowman.net>    
date     : Sat, 1 Jun 2013 09:38:15 -0400    
  
committer: Stephen Frost <sfrost@snowman.net>    
date     : Sat, 1 Jun 2013 09:38:15 -0400    

Click here for diff

Make slightly better decisions about indentation than what pgindent  
is capable of.  Mostly breaking out long function calls into one  
line per argument, with a few other minor adjustments.  
  
No functional changes- all whitespace.  
pgindent ran cleanly (didn't change anything) after.  
Passes all regressions.  

M contrib/hstore/hstore_io.c
M contrib/pg_upgrade/info.c
M contrib/pg_upgrade/pg_upgrade.c
M contrib/pg_upgrade/relfilenode.c
M contrib/pgbench/pgbench.c
M src/backend/access/gist/gistbuild.c
M src/backend/access/heap/heapam.c
M src/backend/access/transam/multixact.c
M src/backend/access/transam/xlog.c
M src/backend/commands/event_trigger.c
M src/backend/commands/tablecmds.c
M src/backend/commands/trigger.c
M src/interfaces/ecpg/pgtypeslib/timestamp.c

doc: Remove paragraph about typesetting conventions

commit   : dedf7e9919a2dc42370c0b218728e1556985de6a    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Fri, 31 May 2013 22:42:27 -0400    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
date     : Fri, 31 May 2013 22:42:27 -0400    

Click here for diff

They no longer match reality with the web site style sheets, and it is  
difficult to keep the up to date in a CSS world.  

M doc/src/sgml/notation.sgml

Don't emit non-canonical empty arrays in array_remove().

commit   : 97c4d9b7c71519d9dc281394af2c4bcb28bdf136    
  
author   : Noah Misch <noah@leadboat.com>    
date     : Fri, 31 May 2013 21:50:59 -0400    
  
committer: Noah Misch <noah@leadboat.com>    
date     : Fri, 31 May 2013 21:50:59 -0400    

Click here for diff

Dean Rasheed  

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

Add new source files to nls.mk

commit   : 01497e738e58b0a5d87706353f28eccc5bea9591    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Fri, 31 May 2013 20:03:39 -0400    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
date     : Fri, 31 May 2013 20:03:39 -0400    

Click here for diff

M src/bin/pg_dump/nls.mk
M src/bin/scripts/nls.mk

doc: Fix claim that query is passed as ASCII text

commit   : eff8055afb7c89c2d2629d35b074ca617a3c2310    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Thu, 30 May 2013 21:09:27 -0400    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
date     : Thu, 30 May 2013 21:09:27 -0400    

Click here for diff

Ian Lawrence Barwick  

M doc/src/sgml/arch-dev.sgml

Remove whitespace from end of lines

commit   : 8b5a3998a104ef5918b50e207be0aa86e085d49d    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Thu, 30 May 2013 21:05:07 -0400    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
date     : Thu, 30 May 2013 21:05:07 -0400    

Click here for diff

M doc/src/sgml/maintenance.sgml
M doc/src/sgml/ref/create_table.sgml
M doc/src/sgml/ref/notify.sgml
M doc/src/sgml/ref/pg_dump.sgml
M src/Makefile.global.in
M src/backend/catalog/system_views.sql
M src/test/regress/expected/json.out
M src/test/regress/sql/json.sql
M src/tools/msvc/Mkvcbuild.pm
M src/tools/pgindent/perltidyrc
M src/tools/pgindent/pgindent
M src/tools/pgindent/pgindent.man

Minor spell checking

commit   : d7eb6f46de900f6664918cda3b5e6f922a0a2356    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Thu, 30 May 2013 20:56:58 -0400    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
date     : Thu, 30 May 2013 20:56:58 -0400    

Click here for diff

M src/backend/replication/walreceiver.c

postgresql.conf.sample: Improve whitespace

commit   : 97a11fd0e3055ab82d562930b38027b054e6c8e0    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Wed, 29 May 2013 22:00:13 -0400    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
date     : Wed, 29 May 2013 22:00:13 -0400    

Click here for diff

M src/backend/utils/misc/postgresql.conf.sample

pgindent run for release 9.3 This is the first run of the Perl-based pgindent script. Also update pgindent instructions.

commit   : 9af4159fce6654aa0e081b00d02bca40b978745c    
  
author   : Bruce Momjian <bruce@momjian.us>    
date     : Wed, 29 May 2013 16:58:43 -0400    
  
committer: Bruce Momjian <bruce@momjian.us>    
date     : Wed, 29 May 2013 16:58:43 -0400    

Click here for diff

M contrib/btree_gist/btree_bit.c
M contrib/btree_gist/btree_text.c
M contrib/btree_gist/btree_ts.c
M contrib/btree_gist/btree_utils_num.c
M contrib/btree_gist/btree_utils_var.c
M contrib/dblink/dblink.c
M contrib/file_fdw/file_fdw.c
M contrib/hstore/hstore_io.c
M contrib/oid2name/oid2name.c
M contrib/pg_archivecleanup/pg_archivecleanup.c
M contrib/pg_standby/pg_standby.c
M contrib/pg_test_timing/pg_test_timing.c
M contrib/pg_trgm/trgm_op.c
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/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_xlogdump/compat.c
M contrib/pg_xlogdump/pg_xlogdump.c
M contrib/pg_xlogdump/rmgrdesc.c
M contrib/pg_xlogdump/rmgrdesc.h
M contrib/pgbench/pgbench.c
M contrib/pgcrypto/imath.h
M contrib/pgcrypto/pgp.h
M contrib/pgrowlocks/pgrowlocks.c
M contrib/pgstattuple/pgstatindex.c
M contrib/postgres_fdw/connection.c
M contrib/postgres_fdw/postgres_fdw.c
M contrib/postgres_fdw/postgres_fdw.h
M contrib/sepgsql/hooks.c
M contrib/sepgsql/label.c
M contrib/sepgsql/proc.c
M contrib/sepgsql/relation.c
M contrib/sepgsql/schema.c
M contrib/unaccent/unaccent.c
M contrib/vacuumlo/vacuumlo.c
M contrib/worker_spi/worker_spi.c
M src/backend/access/gin/ginbtree.c
M src/backend/access/gist/gistbuild.c
M src/backend/access/gist/gistget.c
M src/backend/access/gist/gistutil.c
M src/backend/access/gist/gistxlog.c
M src/backend/access/hash/hashinsert.c
M src/backend/access/hash/hashsearch.c
M src/backend/access/heap/heapam.c
M src/backend/access/heap/rewriteheap.c
M src/backend/access/heap/visibilitymap.c
M src/backend/access/nbtree/nbtpage.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/spgtextproc.c
M src/backend/access/transam/multixact.c
M src/backend/access/transam/timeline.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/namespace.c
M src/backend/catalog/objectaccess.c
M src/backend/catalog/objectaddress.c
M src/backend/catalog/pg_constraint.c
M src/backend/catalog/pg_enum.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/storage.c
M src/backend/commands/aggregatecmds.c
M src/backend/commands/alter.c
M src/backend/commands/async.c
M src/backend/commands/cluster.c
M src/backend/commands/copy.c
M src/backend/commands/createas.c
M src/backend/commands/dbcommands.c
M src/backend/commands/event_trigger.c
M src/backend/commands/explain.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/proclang.c
M src/backend/commands/sequence.c
M src/backend/commands/tablecmds.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/executor/execMain.c
M src/backend/executor/execQual.c
M src/backend/executor/functions.c
M src/backend/executor/nodeLockRows.c
M src/backend/executor/nodeModifyTable.c
M src/backend/executor/nodeSeqscan.c
M src/backend/executor/spi.c
M src/backend/lib/binaryheap.c
M src/backend/libpq/auth.c
M src/backend/libpq/hba.c
M src/backend/libpq/pqcomm.c
M src/backend/main/main.c
M src/backend/optimizer/geqo/geqo_cx.c
M src/backend/optimizer/geqo/geqo_px.c
M src/backend/optimizer/path/allpaths.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/plan/analyzejoins.c
M src/backend/optimizer/plan/initsplan.c
M src/backend/optimizer/plan/planagg.c
M src/backend/optimizer/plan/planner.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/analyze.c
M src/backend/parser/check_keywords.pl
M src/backend/parser/parse_agg.c
M src/backend/parser/parse_clause.c
M src/backend/parser/parse_expr.c
M src/backend/parser/parse_relation.c
M src/backend/parser/parse_target.c
M src/backend/parser/parse_utilcmd.c
M src/backend/port/sysv_shmem.c
M src/backend/postmaster/autovacuum.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/syslogger.c
M src/backend/regex/regc_nfa.c
M src/backend/regex/regprefix.c
M src/backend/replication/basebackup.c
M src/backend/replication/libpqwalreceiver/libpqwalreceiver.c
M src/backend/replication/syncrep.c
M src/backend/replication/walreceiver.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/storage/buffer/bufmgr.c
M src/backend/storage/buffer/localbuf.c
M src/backend/storage/ipc/procarray.c
M src/backend/storage/ipc/standby.c
M src/backend/storage/lmgr/lock.c
M src/backend/storage/lmgr/predicate.c
M src/backend/storage/lmgr/proc.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/smgr/smgr.c
M src/backend/tcop/postgres.c
M src/backend/tcop/pquery.c
M src/backend/tsearch/ts_selfuncs.c
M src/backend/utils/adt/array_typanalyze.c
M src/backend/utils/adt/arrayfuncs.c
M src/backend/utils/adt/date.c
M src/backend/utils/adt/datetime.c
M src/backend/utils/adt/formatting.c
M src/backend/utils/adt/json.c
M src/backend/utils/adt/jsonfuncs.c
M src/backend/utils/adt/misc.c
M src/backend/utils/adt/numeric.c
M src/backend/utils/adt/pg_locale.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/rangetypes_selfuncs.c
M src/backend/utils/adt/rangetypes_spgist.c
M src/backend/utils/adt/rangetypes_typanalyze.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/selfuncs.c
M src/backend/utils/adt/timestamp.c
M src/backend/utils/adt/tsquery_rewrite.c
M src/backend/utils/adt/varlena.c
M src/backend/utils/adt/xml.c
M src/backend/utils/cache/catcache.c
M src/backend/utils/cache/evtcache.c
M src/backend/utils/cache/plancache.c
M src/backend/utils/cache/relcache.c
M src/backend/utils/cache/syscache.c
M src/backend/utils/error/elog.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/mbutils.c
M src/backend/utils/mb/wchar.c
M src/backend/utils/misc/guc.c
M src/backend/utils/resowner/resowner.c
M src/backend/utils/sort/tuplestore.c
M src/backend/utils/time/tqual.c
M src/bin/initdb/initdb.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/bin/pg_basebackup/streamutil.c
M src/bin/pg_ctl/pg_ctl.c
M src/bin/pg_dump/parallel.c
M src/bin/pg_dump/parallel.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_dump.c
M src/bin/pg_dump/pg_dump.h
M src/bin/pg_resetxlog/pg_resetxlog.c
M src/bin/pgevent/pgevent.c
M src/bin/psql/command.c
M src/bin/psql/copy.c
M src/bin/psql/create_help.pl
M src/bin/psql/describe.c
M src/bin/psql/print.c
M src/bin/psql/startup.c
M src/bin/psql/tab-complete.c
M src/bin/scripts/pg_isready.c
M src/common/fe_memutils.c
M src/common/relpath.c
M src/include/access/gist.h
M src/include/access/heapam.h
M src/include/access/heapam_xlog.h
M src/include/access/htup_details.h
M src/include/access/multixact.h
M src/include/access/rmgr.h
M src/include/access/sysattr.h
M src/include/access/timeline.h
M src/include/access/xlog.h
M src/include/access/xlog_internal.h
M src/include/c.h
M src/include/catalog/heap.h
M src/include/catalog/indexing.h
M src/include/catalog/objectaccess.h
M src/include/catalog/objectaddress.h
M src/include/catalog/pg_class.h
M src/include/catalog/pg_constraint.h
M src/include/catalog/pg_control.h
M src/include/catalog/pg_enum.h
M src/include/catalog/pg_event_trigger.h
M src/include/catalog/pg_operator.h
M src/include/catalog/pg_proc.h
M src/include/catalog/pg_statistic.h
M src/include/commands/alter.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/dbcommands.h
M src/include/commands/defrem.h
M src/include/commands/event_trigger.h
M src/include/commands/extension.h
M src/include/commands/matview.h
M src/include/commands/proclang.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/user.h
M src/include/commands/view.h
M src/include/common/fe_memutils.h
M src/include/common/relpath.h
M src/include/lib/binaryheap.h
M src/include/libpq/hba.h
M src/include/libpq/libpq.h
M src/include/libpq/pqcomm.h
M src/include/mb/pg_wchar.h
M src/include/miscadmin.h
M src/include/nodes/parsenodes.h
M src/include/nodes/primnodes.h
M src/include/nodes/relation.h
M src/include/optimizer/planner.h
M src/include/parser/parse_node.h
M src/include/parser/parse_relation.h
M src/include/port.h
M src/include/port/win32.h
M src/include/postgres.h
M src/include/postmaster/bgworker.h
M src/include/postmaster/postmaster.h
M src/include/replication/walreceiver.h
M src/include/rewrite/rewriteDefine.h
M src/include/rewrite/rewriteManip.h
M src/include/storage/bufpage.h
M src/include/storage/large_object.h
M src/include/storage/predicate_internals.h
M src/include/storage/relfilenode.h
M src/include/storage/standby.h
M src/include/tcop/utility.h
M src/include/utils/builtins.h
M src/include/utils/elog.h
M src/include/utils/evtcache.h
M src/include/utils/guc_tables.h
M src/include/utils/jsonapi.h
M src/include/utils/palloc.h
M src/include/utils/plancache.h
M src/include/utils/rel.h
M src/include/utils/reltrigger.h
M src/interfaces/ecpg/compatlib/informix.c
M src/interfaces/ecpg/ecpglib/typename.c
M src/interfaces/ecpg/pgtypeslib/datetime.c
M src/interfaces/ecpg/pgtypeslib/interval.c
M src/interfaces/ecpg/pgtypeslib/numeric.c
M src/interfaces/ecpg/pgtypeslib/timestamp.c
M src/interfaces/ecpg/preproc/type.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-print.c
M src/interfaces/libpq/fe-protocol3.c
M src/interfaces/libpq/libpq-events.h
M src/pl/plperl/plperl.c
M src/pl/plperl/plperl.h
M src/pl/plperl/plperl_helpers.h
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_util.c
M src/port/pgcheckdir.c
M src/port/pqsignal.c
M src/port/sprompt.c
M src/port/wait_error.c
M src/test/isolation/isolationtester.h
M src/timezone/zic.c
M src/tools/copyright.pl
M src/tools/git_changelog
M src/tools/msvc/Install.pm
M src/tools/msvc/MSBuildProject.pm
M src/tools/msvc/Mkvcbuild.pm
M src/tools/msvc/Project.pm
M src/tools/msvc/Solution.pm
M src/tools/msvc/VCBuildProject.pm
M src/tools/msvc/vcregress.pl
M src/tools/pginclude/pgcheckdefines
M src/tools/pgindent/README
M src/tools/pgindent/pgindent
M src/tools/pgindent/typedefs.list

Document auto_explain.log_timing.

commit   : 07ab261ef3a9575a4a2bd3045b222d7b3dee2c46    
  
author   : Robert Haas <rhaas@postgresql.org>    
date     : Wed, 29 May 2013 07:11:21 -0400    
  
committer: Robert Haas <rhaas@postgresql.org>    
date     : Wed, 29 May 2013 07:11:21 -0400    

Click here for diff

Tomas Vondra  

M doc/src/sgml/auto-explain.sgml

pg_upgrade docs: mention need to set parameters for vacuumdb.

commit   : f80e55054bb40421ee414558818cf944a6b48b7e    
  
author   : Bruce Momjian <bruce@momjian.us>    
date     : Tue, 28 May 2013 22:54:28 -0400    
  
committer: Bruce Momjian <bruce@momjian.us>    
date     : Tue, 28 May 2013 22:54:28 -0400    

Click here for diff

M doc/src/sgml/pgupgrade.sgml

Documentation fix for ALTER TYPE .. RENAME

commit   : 05624220c413eba1d7da38586dfb9aa6a8e9623d    
  
author   : Stephen Frost <sfrost@snowman.net>    
date     : Mon, 27 May 2013 11:12:54 -0400    
  
committer: Stephen Frost <sfrost@snowman.net>    
date     : Mon, 27 May 2013 11:12:54 -0400    

Click here for diff

The documentation for ALTER TYPE .. RENAME claimed to support a  
RESTRICT/CASCADE option at the 'type' level, which wasn't implemented  
and doesn't make a whole lot of sense to begin with.  What is supported,  
and previously undocumented, is  
  
ALTER TYPE .. RENAME ATTRIBUTE .. RESTRICT/CASCADE.  
  
I've updated the documentation and back-patched this to 9.1 where it was  
first introduced.  

M doc/src/sgml/ref/alter_type.sgml

Remove pageinspect--1.0.sql

commit   : 230e92c82b9b911ea743dce7ab7a1abcd0250f30    
  
author   : Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Fri, 24 May 2013 08:00:34 -0400    
  
committer: Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Fri, 24 May 2013 08:00:34 -0400    

Click here for diff

We're not installing it anymore.  
  
Michael Paquier  

M contrib/pageinspect/Makefile
D contrib/pageinspect/pageinspect–1.0.sql

Fix typo in comment.

commit   : 6eb971bd64073d5208ad7c51aa36b75089d55bef    
  
author   : Robert Haas <rhaas@postgresql.org>    
date     : Thu, 23 May 2013 11:34:30 -0400    
  
committer: Robert Haas <rhaas@postgresql.org>    
date     : Thu, 23 May 2013 11:34:30 -0400    

Click here for diff

Pavan Deolasee  

M src/include/replication/syncrep.h

Print line number correctly in COPY.

commit   : e2ef289363f52b9dd5950c88a65803b585d86ad8    
  
author   : Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Thu, 23 May 2013 07:49:59 -0400    
  
committer: Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Thu, 23 May 2013 07:49:59 -0400    

Click here for diff

When COPY uses the multi-insert method to insert a batch of tuples into the  
heap at a time, incorrect line number was printed if something went wrong in  
inserting the index tuples (primary key failure, for exampl), or processing  
after row triggers.  
  
Fixes bug #8173 reported by Lloyd Albin. Backpatch to 9.2, where the multi-  
insert code was added.  

M src/backend/commands/copy.c

9.3 release notes: improve cached plan mention Per suggestion from Tom Lane.

commit   : bc41ef4791eb44709f18c1678957509e23abdf98    
  
author   : Bruce Momjian <bruce@momjian.us>    
date     : Tue, 21 May 2013 16:42:24 -0400    
  
committer: Bruce Momjian <bruce@momjian.us>    
date     : Tue, 21 May 2013 16:42:24 -0400    

Click here for diff

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

After fast promotion use CHECKPOINT_FORCE

commit   : 22a27ef113d50cad73097c0be247f06d6527363c    
  
author   : Simon Riggs <simon@2ndQuadrant.com>    
date     : Tue, 21 May 2013 21:27:12 +0100    
  
committer: Simon Riggs <simon@2ndQuadrant.com>    
date     : Tue, 21 May 2013 21:27:12 +0100    

Click here for diff

Not necessary for correctness, just to make  
log_checkpoints output look less singular.  
  
Requested by Fujii Masao  

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

Maintain ThisTimeLineID correctly in checkpointer

commit   : 75a192638f93636a144a02461baae90b9fe98fd7    
  
author   : Simon Riggs <simon@2ndQuadrant.com>    
date     : Tue, 21 May 2013 21:17:04 +0100    
  
committer: Simon Riggs <simon@2ndQuadrant.com>    
date     : Tue, 21 May 2013 21:17:04 +0100    

Click here for diff

checkpointer needs to reset ThisTimeLineID after  
a restartpoint to allow installing/recycling new  
WAL files. If recovery has already ended this  
would leave ThisTimeLineID set incorrectly and  
so we must reset it otherwise later checkpoints  
do not have the correct timeline.  
  
Bug report by Heikki Linnakangas.  
Further investigation by Heikki and myself.  

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

9.3 release notes: fix SGML markup for DROP TABLE IF EXISTS

commit   : 8955dac2518b47cf902c22e972426309217c7d8a    
  
author   : Bruce Momjian <bruce@momjian.us>    
date     : Tue, 21 May 2013 08:06:32 -0400    
  
committer: Bruce Momjian <bruce@momjian.us>    
date     : Tue, 21 May 2013 08:06:32 -0400    

Click here for diff

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

9.3 release docs: fix DROP TABLE IF EXISTS Patch from Joe Abbate.

commit   : efc7952c89f3079c86156fae313255eadcd4a5e7    
  
author   : Bruce Momjian <bruce@momjian.us>    
date     : Mon, 20 May 2013 22:38:37 -0400    
  
committer: Bruce Momjian <bruce@momjian.us>    
date     : Mon, 20 May 2013 22:38:37 -0400    

Click here for diff

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

Documentation spell checking and markup improvements

commit   : 256f6ba78a379733ff05d3c3d2239ca7fc56fb9e    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Mon, 20 May 2013 21:13:13 -0400    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
date     : Mon, 20 May 2013 21:13:13 -0400    

Click here for diff

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/gin.sgml
M doc/src/sgml/hstore.sgml
M doc/src/sgml/indexam.sgml
M doc/src/sgml/information_schema.sgml
M doc/src/sgml/install-windows.sgml
M doc/src/sgml/libpq.sgml
M doc/src/sgml/ltree.sgml
M doc/src/sgml/mvcc.sgml
M doc/src/sgml/perform.sgml
M doc/src/sgml/pgtestfsync.sgml
M doc/src/sgml/planstats.sgml
M doc/src/sgml/plperl.sgml
M doc/src/sgml/plpgsql.sgml
M doc/src/sgml/postgres-fdw.sgml
M doc/src/sgml/protocol.sgml
M doc/src/sgml/ref/copy.sgml
M doc/src/sgml/ref/create_table.sgml
M doc/src/sgml/ref/create_type.sgml
M doc/src/sgml/ref/explain.sgml
M doc/src/sgml/ref/lock.sgml
M doc/src/sgml/ref/pg_basebackup.sgml
M doc/src/sgml/ref/pg_dump.sgml
M doc/src/sgml/regress.sgml
M doc/src/sgml/release-9.3.sgml
M doc/src/sgml/sepgsql.sgml
M doc/src/sgml/wal.sgml

Fix escaping in generated recovery.conf file.

commit   : 30b5ede7157e34e77c7914b8ecfd55aa8da6edc3    
  
author   : Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Mon, 20 May 2013 19:34:27 +0300    
  
committer: Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Mon, 20 May 2013 19:34:27 +0300    

Click here for diff

In the primary_conninfo line that "pg_basebackup -R" generates, single  
quotes in parameter values need to be escaped into \\'; the libpq parser  
requires the quotes to be escaped into \', and recovery.conf parser requires  
the \ to be escaped into \\.  
  
Also, don't quote parameter values unnecessarily, to make the connection  
string prettier. Most options in a libpq connection string don't need  
quoting.  
  
Reported by Hari Babu, closer analysis by Zoltan Boszormenyi, although I  
didn't use his patch.  

M src/bin/pg_basebackup/pg_basebackup.c

Clarify documentation of EXPLAIN (TIMING OFF) option.

commit   : 2af0971f35a4a7b87312b83782d9bb0cc6a40ad0    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sun, 19 May 2013 22:03:32 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sun, 19 May 2013 22:03:32 -0400    

Click here for diff

Clarify that this option doesn't suppress measurement of the statement's  
total runtime.  
  
Greg Smith  

M doc/src/sgml/ref/explain.sgml
M src/backend/commands/explain.c

Init crash recovery using the latest available TLI

commit   : d4337a0dcbd29e5b11c2157f808916de62de05e4    
  
author   : Simon Riggs <simon@2ndQuadrant.com>    
date     : Sun, 19 May 2013 17:31:07 +0100    
  
committer: Simon Riggs <simon@2ndQuadrant.com>    
date     : Sun, 19 May 2013 17:31:07 +0100    

Click here for diff

This simplifies the handling of crashes after fast promotion and various  
minor cases that can exist in short timing windows around that case.  
  
Broad fix to bug reported by Michael Paquier on -hackers,  
approach prompted by Heikki Linnakangas  

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

Emit msg correctly for timeline-crossing crash

commit   : 1781744cfcfeed6e3ad2e4d52dbd475a95be03a0    
  
author   : Simon Riggs <simon@2ndQuadrant.com>    
date     : Sun, 19 May 2013 17:00:18 +0100    
  
committer: Simon Riggs <simon@2ndQuadrant.com>    
date     : Sun, 19 May 2013 17:00:18 +0100    

Click here for diff

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

Remove single space on end of a line in xlog.c

commit   : c94dff4c3c18595a9d6d8a97020145c1155de473    
  
author   : Simon Riggs <simon@2ndQuadrant.com>    
date     : Sun, 19 May 2013 15:38:47 +0100    
  
committer: Simon Riggs <simon@2ndQuadrant.com>    
date     : Sun, 19 May 2013 15:38:47 +0100    

Click here for diff

Michael Paquier  

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

Remove unused regression test files.

commit   : d0cab7903bf695bf305bd4c01f99e0e28d233d91    
  
author   : Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Sat, 18 May 2013 22:30:20 +0300    
  
committer: Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Sat, 18 May 2013 22:30:20 +0300    

Click here for diff

euc_* and mule_internal test cases were identical to the ones in  
src/test/mb. sql_ascii didn't exist elsewhere, but has been broken since  
2001, and doesn't seem very interesting anyway. drop.sql hasn't been used  
since 2000, when regress.sh was removed.  

D src/test/regress/expected/euc_cn.out
D src/test/regress/expected/euc_jp.out
D src/test/regress/expected/euc_kr.out
D src/test/regress/expected/euc_tw.out
D src/test/regress/expected/mule_internal.out
D src/test/regress/expected/sql_ascii.out
D src/test/regress/sql/drop.sql
D src/test/regress/sql/euc_cn.sql
D src/test/regress/sql/euc_jp.sql
D src/test/regress/sql/euc_kr.sql
D src/test/regress/sql/euc_tw.sql
D src/test/regress/sql/mule_internal.sql
D src/test/regress/sql/sql_ascii.sql

release docs: mention PL/pgSQL as supporting event triggers in PG 9.3

commit   : f472012a3257d022dd36c6b5e30ad8d223d0ccea    
  
author   : Bruce Momjian <bruce@momjian.us>    
date     : Sat, 18 May 2013 11:01:55 -0400    
  
committer: Bruce Momjian <bruce@momjian.us>    
date     : Sat, 18 May 2013 11:01:55 -0400    

Click here for diff

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

Fix crash when trying to display a NOTIFY rule action.

commit   : 403bd6a18b8ec5aeee51c08360441c3c3c239d8f    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 16 May 2013 16:47:26 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 16 May 2013 16:47:26 -0400    

Click here for diff

Fixes oversight in commit 2ffa740be9d96a3743ecb7e42391c53d0760c65a.  
Per report from Josh Kupershmidt.  
  
I think we've broken this case before, so let's add a regression test  
this time.  

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

Fix fd.c to preserve errno where needed.

commit   : 6563fb2b45146852601e63828308fe04fb03b9e9    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 16 May 2013 15:04:31 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 16 May 2013 15:04:31 -0400    

Click here for diff

PathNameOpenFile failed to ensure that the correct value of errno was  
returned to its caller after a failure (because it incorrectly supposed  
that free() can never change errno).  In some cases this would result  
in a user-visible failure because an expected ENOENT errno was replaced  
with something else.  Bogus EINVAL failures have been observed on OS X,  
for example.  
  
There were also a couple of places that could mangle an important value  
of errno if FDDEBUG was defined.  While the usefulness of that debug  
support is highly debatable, we might as well make it safe to use,  
so add errno save/restore logic to the DO_DB macro.  
  
Per bug #8167 from Nelson Minar, diagnosed by RhodiumToad.  
Back-patch to all supported branches.  

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

Fix some uses of "the quick brown fox".

commit   : e7bfc7e42cebf80507f9c9965dc4a572e9fb76a4    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 16 May 2013 12:30:41 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 16 May 2013 12:30:41 -0400    

Click here for diff

If we're going to quote a well-known pangram, we should quote it  
accurately.  Per gripe from Thom Brown.  

M doc/src/sgml/func.sgml
M src/test/regress/expected/strings.out
M src/test/regress/sql/strings.sql

Allow CREATE FOREIGN TABLE to include SERIAL columns.

commit   : b14206862278347a379f2bb72d92d16fb9dcea45    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Wed, 15 May 2013 19:03:29 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Wed, 15 May 2013 19:03:29 -0400    

Click here for diff

The behavior is that the required sequence is created locally, which is  
appropriate because the default expression will be evaluated locally.  
Per gripe from Brad Nicholson that this case was refused with a confusing  
error message.  We could have improved the error message but it seems  
better to just allow the case.  
  
Also, remove ALTER TABLE's arbitrary prohibition against being applied to  
foreign tables, which was pretty inconsistent considering we allow it for  
views, sequences, and other relation types that aren't even called tables.  
This is needed to avoid breaking pg_dump, which sometimes emits column  
defaults using separate ALTER TABLE commands.  (I think this can happen  
even when the default is not associated with a sequence, so that was a  
pre-existing bug once we allowed column defaults for foreign tables.)  

M contrib/postgres_fdw/expected/postgres_fdw.out
M contrib/postgres_fdw/sql/postgres_fdw.sql
M src/backend/commands/sequence.c
M src/backend/commands/tablecmds.c

doc: Add \dm command to psql man page

commit   : a2a480af889b5d9abce4181e49b6398f0e24b808    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Tue, 14 May 2013 21:12:34 -0400    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
date     : Tue, 14 May 2013 21:12:34 -0400    

Click here for diff

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

doc: Fix some whitespace issues in the man pages

commit   : a9bb274f902987b271e2f0dd844fb610de4f024b    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Mon, 13 May 2013 21:59:39 -0400    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
date     : Mon, 13 May 2013 21:59:39 -0400    

Click here for diff

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

pg_upgrade: Replace tabs in output string constants by spaces

commit   : d2b920cded4db973a7b69a628e109f2aee63012a    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Mon, 13 May 2013 21:42:19 -0400    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
date     : Mon, 13 May 2013 21:42:19 -0400    

Click here for diff

M contrib/pg_upgrade/function.c

doc: Fix order of options on pgbench man page

commit   : bd1710248795a495547a96f16d16592ad45f6943    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Mon, 13 May 2013 21:37:01 -0400    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
date     : Mon, 13 May 2013 21:37:01 -0400    

Click here for diff

M doc/src/sgml/pgbench.sgml

Fix handling of OID wraparound while in standalone mode.

commit   : e9c336c78638c191642b18628c306d1c1573fb12    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Mon, 13 May 2013 15:40:16 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Mon, 13 May 2013 15:40:16 -0400    

Click here for diff

If OID wraparound should occur while in standalone mode (unlikely but  
possible), we want to advance the counter to FirstNormalObjectId not  
FirstBootstrapObjectId.  Otherwise, user objects might be created with OIDs  
in the system-reserved range.  That isn't immediately harmful but it poses  
a risk of conflicts during future pg_upgrade operations.  
  
Noted by Andres Freund.  Back-patch to all supported branches, since all of  
them are supported sources for pg_upgrade operations.  

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

Fix handling of strict non-set functions with NULLs in set-valued inputs.

commit   : 904af8db8a99409257db1eed0b056c8098e9013c    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sun, 12 May 2013 13:08:12 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sun, 12 May 2013 13:08:12 -0400    

Click here for diff

In a construct like "select plain_function(set_returning_function(...))",  
the plain function is applied to each output row of the SRF successively.  
If some of the SRF outputs are NULL, and the plain function is strict,  
you'd expect to get NULL results for such rows ... but what actually  
happened was that such rows were omitted entirely from the result set.  
This was due to confusion of this case with what should happen for nested  
set-returning functions; a strict SRF is indeed supposed to yield an empty  
set for null input.  Per bug #8150 from Erwin Brandstetter.  
  
Although this has been broken forever, we're not back-patching because  
of the possibility that some apps out there expect the incorrect behavior.  
This change should be listed as a possible incompatibility in the 9.3  
release notes.  

M src/backend/executor/execQual.c
M src/test/regress/expected/arrays.out
M src/test/regress/sql/arrays.sql

pgbench: Fix order of options in --help output

commit   : f0ed3a8a99b052d2d5e0b6153a8907b90c486636    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Sat, 11 May 2013 21:57:54 -0400    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
date     : Sat, 11 May 2013 21:57:54 -0400    

Click here for diff

M contrib/pgbench/pgbench.c

pg_xlogdump: Improve --help output

commit   : a4fd3366a6555a065f1be9f127110c9f642323b9    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Sat, 11 May 2013 21:55:37 -0400    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
date     : Sat, 11 May 2013 21:55:37 -0400    

Click here for diff

M contrib/pg_xlogdump/pg_xlogdump.c

Fix to_number() to correctly ignore thousands separator when it's '.'.

commit   : 35d50b527a9f99e22a317269ceb00491397d0e00    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sat, 11 May 2013 16:35:03 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sat, 11 May 2013 16:35:03 -0400    

Click here for diff

The existing code in NUM_numpart_from_char has hard-wired logic to treat  
'.' as decimal point, even when we're using a locale-aware format string  
and the locale says that '.' is the thousands separator.  This results in  
clearly wrong answers in FM mode (where we must be able to identify the  
decimal point location), as per bug report from Patryk Kordylewski.  
  
Since the initialization code in NUM_prepare_locale already sets up  
Np->decimal as either the locale decimal-point string or "." depending  
on which decimal-point format code was used, there's really no need to  
have any extra logic at all in NUM_numpart_from_char: we only need to  
test for a match to Np->decimal.  
  
(Note: AFAICS there's nothing in here that explicitly checks for thousands  
separators --- rather, any unmatched character is silently skipped over.  
That's pretty bogus IMO but it's not the issue being complained of.)  
  
This is a longstanding bug, but it's possible that some existing apps  
are depending on '.' being recognized as decimal point even when using  
a D format code.  Hence, no back-patch.  We should probably list this  
as a potential incompatibility in the 9.3 release notes.  

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

Fix buildfarm incompatibility in updated pg_upgrade test script.

commit   : 8cade04c105f2d31c941bee9716a304f93a41351    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sat, 11 May 2013 16:14:19 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sat, 11 May 2013 16:14:19 -0400    

Click here for diff

Looks like some versions of the buildfarm script try to set the port via  
--port in $EXTRA_REGRESS_OPTS.  Override that ...  

M contrib/pg_upgrade/test.sh

Make pg_upgrade's test script attempt to select a non-conflicting port.

commit   : 7e2b1c03ce24e8fefa2080c0f1f8cfbb86ce664e    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sat, 11 May 2013 14:22:18 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sat, 11 May 2013 14:22:18 -0400    

Click here for diff

Previously, the port number used in this test script was hard-wired at  
pg_upgrade's default of 50432; which is not so great because parallel build  
runs might conflict.  Commit 3d53173e20d151341f894f79d556768c845ba3e4  
removed this setting for the postmasters started by the script proper  
(not by pg_upgrade), which didn't do anything to fix that problem and also  
guaranteed a failure if there was a live postmaster at the build's default  
port number.  Instead, select a non-conflicting temporary port number in  
the same way that pg_regress.c does.  (Its method isn't entirely  
bulletproof, but given the lack of complaints I'm not going to worry  
about that today.)  
  
In passing, unset MAKEFLAGS and MAKELEVEL to avoid problems with the  
script's internal invocations of make, for the same reason pg_regress.c  
does: it could cause problems in a parallel make.  

M contrib/pg_upgrade/test.sh

Update CREATE FUNCTION documentation about argument names.

commit   : c263f16a20a12ee63bbf0c4769d87db3184709eb    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sat, 11 May 2013 12:07:47 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sat, 11 May 2013 12:07:47 -0400    

Click here for diff

The 9.2 patch that added argument name support in SQL-language functions  
missed updating a parenthetical comment about that in the CREATE FUNCTION  
reference page.  Noted by Erwin Brandstetter.  

M doc/src/sgml/ref/create_function.sgml

Guard against input_rows == 0 in estimate_num_groups().

commit   : 69cc60dcfd0fb643cd2fe3ce66d4389858bfdeb5    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Fri, 10 May 2013 17:15:30 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Fri, 10 May 2013 17:15:30 -0400    

Click here for diff

This case doesn't normally happen, because the planner usually clamps  
all row estimates to at least one row; but I found that it can arise  
when dealing with relations excluded by constraints.  Without a defense,  
estimate_num_groups() can return zero, which leads to divisions by zero  
inside the planner as well as assertion failures in the executor.  
  
An alternative fix would be to change set_dummy_rel_pathlist() to make  
the size estimate for a dummy relation 1 row instead of 0, but that seemed  
pretty ugly; and probably someday we'll want to drop the convention that  
the minimum rowcount estimate is 1 row.  
  
Back-patch to 8.4, as the problem can be demonstrated that far back.  

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

Fix pgp_pub_decrypt() so it works for secret keys with passwords.

commit   : 477b5a0e24f3b62a470f9684e22e36a2c7735274    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Fri, 10 May 2013 13:06:48 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Fri, 10 May 2013 13:06:48 -0400    

Click here for diff

Per report from Keith Fiske.  
  
Marko Kreen  

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

Fix management of fn_extra caching during repeated GiST index scans.

commit   : 91715e82932665c6e125d100eeaa1b6debf73e7b    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 9 May 2013 23:08:19 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 9 May 2013 23:08:19 -0400    

Click here for diff

Commit d22a09dc70f9830fa78c1cd1a3a453e4e473d354 introduced official support  
for GiST consistentFns that want to cache data using the FmgrInfo fn_extra  
pointer: the idea was to preserve the cached values across gistrescan(),  
whereas formerly they'd been leaked.  However, there was an oversight in  
that, namely that multiple scan keys might reference the same column's  
consistentFn; the code would result in propagating the same cache value  
into multiple scan keys, resulting in crashes or wrong answers.  Use a  
separate array instead to ensure that each scan key keeps its own state.  
  
Per bug #8143 from Joel Roller.  Back-patch to 9.2 where the bug was  
introduced.  

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

Update key words table for 9.3

commit   : cda7acee5f30bfdca6cfaeacfc4fb695f8c8d5d8    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Thu, 9 May 2013 22:26:04 -0400    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
date     : Thu, 9 May 2013 22:26:04 -0400    

Click here for diff

M doc/src/sgml/keywords.sgml

Remove make_keywords

commit   : bd98852cbd19083ea46a90056666e087f1bb0d67    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Thu, 9 May 2013 22:21:43 -0400    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
date     : Thu, 9 May 2013 22:21:43 -0400    

Click here for diff

It is not used anymore.  

D src/tools/make_keywords

Use pg_dump's --quote-all-identifiers option in pg_upgrade.

commit   : 1c36700e9e3cfb96fde636def87cafb57299f4da    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 9 May 2013 17:34:34 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 9 May 2013 17:34:34 -0400    

Click here for diff

This helps guard against changes in the set of reserved keywords from  
one version to another.  In theory it should only be an issue if we  
de-reserve a keyword in a newer release, since that can create the type  
of problem shown in bug #8128.  
  
Back-patch to 9.1 where the --quote-all-identifiers option was added.  

M contrib/pg_upgrade/dump.c

pg_upgrade docs: give tips on automation

commit   : df9d764186cf6082376e25fe04050ad39462312d    
  
author   : Bruce Momjian <bruce@momjian.us>    
date     : Thu, 9 May 2013 16:05:26 -0400    
  
committer: Bruce Momjian <bruce@momjian.us>    
date     : Thu, 9 May 2013 16:05:26 -0400    

Click here for diff

Document that post-upgrade steps are likely to be the same for all  
clusters with the same DDL/schemas;  this should help automated  
upgrades.  

M doc/src/sgml/pgupgrade.sgml

Update collate.linux.utf8.out for ruleutils.c line-wrapping changes.

commit   : 284e28f2280a8f69014df689ae5e2843eebd7c59    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Wed, 8 May 2013 22:47:33 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Wed, 8 May 2013 22:47:33 -0400    

Click here for diff

Missed in commit 62e666400dddf605b9b6d9a7ac2918711b5c5629.  

M src/test/regress/expected/collate.linux.utf8.out

Better fix for permissions tests in excluded subqueries.

commit   : a7b965382cf0cb30aeacb112572718045e6d4be7    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Wed, 8 May 2013 16:59:09 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Wed, 8 May 2013 16:59:09 -0400    

Click here for diff

This reverts the code changes in 50c137487c96e629e0e5372bb3d1b5f1a2f71a88,  
which turned out to induce crashes and not completely fix the problem  
anyway.  That commit only considered single subqueries that were excluded  
by constraint-exclusion logic, but actually the problem also exists for  
subqueries that are appendrel members (ie part of a UNION ALL list).  In  
such cases we can't add a dummy subpath to the appendrel's AppendPath list  
without defeating the logic that recognizes when an appendrel is completely  
excluded.  Instead, fix the problem by having setrefs.c scan the rangetable  
an extra time looking for subqueries that didn't get into the plan tree.  
(This approach depends on the 9.2 change that made set_subquery_pathlist  
generate dummy paths for excluded single subqueries, so that the exclusion  
behavior is the same for single subqueries and appendrel members.)  
  
Note: it turns out that the appendrel form of the missed-permissions-checks  
bug exists as far back as 8.4.  However, since the practical effect of that  
bug seems pretty minimal, consensus is to not attempt to fix it in the back  
branches, at least not yet.  Possibly we could back-port this patch once  
it's gotten a reasonable amount of testing in HEAD.  For the moment I'm  
just going to revert the previous patch in 9.2.  

M src/backend/optimizer/path/allpaths.c
M src/backend/optimizer/plan/createplan.c
M src/backend/optimizer/plan/setrefs.c
M src/test/regress/expected/privileges.out
M src/test/regress/sql/privileges.sql

The data structure used in unaccent is a trie, not suffix tree.

commit   : 4b06c1820a1b96769ea7447a0fc8e0edabbf57f5    
  
author   : Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Wed, 8 May 2013 20:57:42 +0300    
  
committer: Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Wed, 8 May 2013 20:57:42 +0300    

Click here for diff

Fix the term used in variable and struct names, and comments.  
  
Alexander Korotkov  

M contrib/unaccent/unaccent.c

Fix walsender failure at promotion.

commit   : 2ffa66f4975c99e52984f7ee81b47d137b5b4751    
  
author   : Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Wed, 8 May 2013 20:10:17 +0300    
  
committer: Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Wed, 8 May 2013 20:10:17 +0300    

Click here for diff

If a standby server has a cascading standby server connected to it, it's  
possible that WAL has already been sent up to the next WAL page boundary,  
splitting a WAL record in the middle, when the first standby server is  
promoted. Don't throw an assertion failure or error in walsender if that  
happens.  
  
Also, fix a variant of the same bug in pg_receivexlog: if it had already  
received WAL on previous timeline up to a segment boundary, when the  
upstream standby server is promoted so that the timeline switch record falls  
on the previous segment, pg_receivexlog would miss the segment containing  
the timeline switch. To fix that, have walsender send the position of the  
timeline switch at end-of-streaming, in addition to the next timeline's ID.  
It was previously assumed that the switch happened exactly where the  
streaming stopped.  
  
Note: this is an incompatible change in the streaming protocol. You might  
get an error if you try to stream over timeline switches, if the client is  
running 9.3beta1 and the server is more recent. It should be fine after a  
reconnect, however.  
  
Reported by Fujii Masao.  

M doc/src/sgml/protocol.sgml
M src/backend/access/transam/xlog.c
M src/backend/replication/libpqwalreceiver/libpqwalreceiver.c
M src/backend/replication/walreceiverfuncs.c
M src/backend/replication/walsender.c
M src/bin/pg_basebackup/pg_receivexlog.c
M src/bin/pg_basebackup/receivelog.c

Use the term "radix tree" instead of "suffix tree" for SP-GiST text opclass.

commit   : cb953d8b1bf7386ff20300cd80b29b7e8657dcbd    
  
author   : Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Wed, 8 May 2013 14:29:28 +0300    
  
committer: Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Wed, 8 May 2013 14:29:28 +0300    

Click here for diff

What we have implemented is a radix tree (or a radix trie or a patricia  
trie), but the docs and code comments incorrectly called it a "suffix tree".  
  
Alexander Korotkov  

M doc/src/sgml/indices.sgml
M doc/src/sgml/spgist.sgml
M src/backend/access/spgist/README
M src/backend/access/spgist/spgtextproc.c
M src/include/catalog/pg_proc.h
M src/test/regress/expected/create_index.out
M src/test/regress/expected/sanity_check.out
M src/test/regress/output/misc.source
M src/test/regress/sql/create_index.sql

commit   : 20c00ca668f2c5ca4e7e7afd1bd8faa0909ee527    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Tue, 7 May 2013 21:23:21 -0400    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
date     : Tue, 7 May 2013 21:23:21 -0400    

Click here for diff

Karl O. Pinc  

M doc/src/sgml/ddl.sgml
M doc/src/sgml/extend.sgml

Stress that backup_label file is critical in the docs.

commit   : 7f03a791fa131eb20c6df07740522163d8b3c94e    
  
author   : Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Tue, 7 May 2013 16:55:04 +0300    
  
committer: Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Tue, 7 May 2013 16:55:04 +0300    

Click here for diff

It is surprisingly common mistake to leave out backup_label file from a base  
backup. Say more explicitly that it must be included.  
  
Jeff Janes, with minor rewording by me.  

M doc/src/sgml/backup.sgml

Stamp 9.3beta1.

commit   : 817a89423f429a6a8b36847ee499f5b6be39c3be    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Mon, 6 May 2013 16:57:06 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Mon, 6 May 2013 16:57:06 -0400    

Click here for diff

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

Desultory copy-editing of the 9.3 release notes.

commit   : f1ff90cfb1c5168cd442593de62b419ac9ab6469    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Mon, 6 May 2013 16:02:37 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Mon, 6 May 2013 16:02:37 -0400    

Click here for diff

I had time for a quick review of the notes, so here are some fixes.  

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

Move materialized views' is-populated status into their pg_class entries.

commit   : 1d6c72a55b23554cfb946527dc77f9d80044ae2c    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Mon, 6 May 2013 13:26:51 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Mon, 6 May 2013 13:26:51 -0400    

Click here for diff

Previously this state was represented by whether the view's disk file had  
zero or nonzero size, which is problematic for numerous reasons, since it's  
breaking a fundamental assumption about heap storage.  This was done to  
allow unlogged matviews to revert to unpopulated status after a crash  
despite our lack of any ability to update catalog entries post-crash.  
However, this poses enough risk of future problems that it seems better to  
not support unlogged matviews until we can find another way.  Accordingly,  
revert that choice as well as a number of existing kluges forced by it  
in favor of creating a pg_class.relispopulated flag column.  

M doc/src/sgml/catalogs.sgml
M doc/src/sgml/func.sgml
M src/backend/catalog/heap.c
M src/backend/catalog/system_views.sql
M src/backend/commands/cluster.c
M src/backend/commands/createas.c
M src/backend/commands/matview.c
M src/backend/commands/vacuumlazy.c
M src/backend/utils/adt/dbsize.c
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/include/catalog/catversion.h
M src/include/catalog/heap.h
M src/include/catalog/pg_class.h
M src/include/catalog/pg_proc.h
M src/include/commands/matview.h
M src/include/utils/builtins.h
M src/include/utils/rel.h
M src/test/regress/expected/matview.out
M src/test/regress/expected/rules.out
M src/test/regress/sql/matview.sql

Back out some recent translation updates.

commit   : 5da5798004e90b14332918e7db702271442d465d    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Mon, 6 May 2013 12:28:13 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Mon, 6 May 2013 12:28:13 -0400    

Click here for diff

Very old versions of msgfmt choke on these specific messages, for reasons  
that are unclear at the moment.  Remove them so that we can ship a beta  
release and not get complaints from testers (these messages will just go  
untranslated, instead, and we're hardly at 100% coverage anyway).  
Peter Eisentraut will look for a better fix later.  

M src/backend/po/de.po
M src/bin/pg_basebackup/po/cs.po

Disallow unlogged materialized views.

commit   : 3223b25ff737c2bf4a642c0deb7be2b30bfecc6e    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Mon, 6 May 2013 11:57:05 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Mon, 6 May 2013 11:57:05 -0400    

Click here for diff

The initial implementation of this feature was really unsupportable,  
because it's relying on the physical size of an on-disk file to carry the  
relation's populated/unpopulated state, which is at least a modularity  
violation and could have serious long-term consequences.  We could say that  
an unlogged matview goes to empty on crash, but not everybody likes that  
definition, so let's just remove the feature for 9.3.  We can add it back  
when we have a less klugy implementation.  
  
I left the grammar and tab-completion support for CREATE UNLOGGED  
MATERIALIZED VIEW in place, since it's harmless and allows delivering a  
more specific error message about the unsupported feature.  
  
I'm committing this separately to ease identification of what should be  
reverted when/if we are able to re-enable the feature.  

M doc/src/sgml/ref/create_materialized_view.sgml
M src/backend/parser/analyze.c
M src/test/regress/expected/matview.out
M src/test/regress/sql/matview.sql

9.3 release notes: use "restoration"

commit   : c29866073ba3aab67d78c0d19ecdf790f36a8e1a    
  
author   : Bruce Momjian <bruce@momjian.us>    
date     : Mon, 6 May 2013 10:57:23 -0400    
  
committer: Bruce Momjian <bruce@momjian.us>    
date     : Mon, 6 May 2013 10:57:23 -0400    

Click here for diff

Andrew Dunstan  

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

9.3 release notes: Add cache of local locks

commit   : 2fbffc0ddf1e6c7cd8744d8ae26f7daba902d631    
  
author   : Bruce Momjian <bruce@momjian.us>    
date     : Mon, 6 May 2013 10:56:27 -0400    
  
committer: Bruce Momjian <bruce@momjian.us>    
date     : Mon, 6 May 2013 10:56:27 -0400    

Click here for diff

Mention this also helps in the restoring of pg_dumps.  
  
Jeff Janes  

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

9.3 release notes: update from Amit Kapila

commit   : c750aa90f2cd411bea9ee3844bb41ff50a0eb436    
  
author   : Bruce Momjian <bruce@momjian.us>    
date     : Mon, 6 May 2013 10:47:10 -0400    
  
committer: Bruce Momjian <bruce@momjian.us>    
date     : Mon, 6 May 2013 10:47:10 -0400    

Click here for diff

No need to mention wal_receiver_status_interval.  

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

Execute SET TRANSACTION SNAPSHOT during pg_dump Previous coding set the SQL buffer but never executed

commit   : b2ad82dafaae29975dd12e8c43cf2edaa0f23f4b    
  
author   : Simon Riggs <simon@2ndQuadrant.com>    
date     : Mon, 6 May 2013 15:37:17 +0100    
  
committer: Simon Riggs <simon@2ndQuadrant.com>    
date     : Mon, 6 May 2013 15:37:17 +0100    

Click here for diff

Bug noted by me during beta testing  

M src/bin/pg_dump/pg_dump.c

Revert idea of zer-padding padding session id in log_line_prefix

commit   : 8b06e6aba8773df8040b357a1cb058879ed2d94f    
  
author   : Bruce Momjian <bruce@momjian.us>    
date     : Mon, 6 May 2013 08:59:39 -0400    
  
committer: Bruce Momjian <bruce@momjian.us>    
date     : Mon, 6 May 2013 08:59:39 -0400    

Click here for diff

Removal of doc adjustment and release note mention as well.  

M doc/src/sgml/config.sgml
M doc/src/sgml/release-9.3.sgml
M src/backend/utils/error/elog.c

Translation updates

commit   : 539ecc92415a51bccb0805348a2a414a8e8ab7e7    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Sun, 5 May 2013 22:34:23 -0400    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
date     : Sun, 5 May 2013 22:34:23 -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
A src/backend/po/it.po
M src/backend/po/ja.po
A src/backend/po/pl.po
M src/backend/po/pt_BR.po
A src/backend/po/ru.po
M src/backend/po/zh_CN.po
M src/backend/po/zh_TW.po
M src/bin/initdb/nls.mk
M src/bin/initdb/po/cs.po
M src/bin/initdb/po/de.po
M src/bin/initdb/po/es.po
M src/bin/initdb/po/fr.po
M src/bin/initdb/po/it.po
M src/bin/initdb/po/ja.po
A src/bin/initdb/po/pl.po
M src/bin/initdb/po/pt_BR.po
M src/bin/initdb/po/ru.po
M src/bin/initdb/po/zh_CN.po
M src/bin/pg_basebackup/nls.mk
A src/bin/pg_basebackup/po/cs.po
M src/bin/pg_basebackup/po/de.po
M src/bin/pg_basebackup/po/es.po
M src/bin/pg_basebackup/po/fr.po
A src/bin/pg_basebackup/po/it.po
M src/bin/pg_basebackup/po/ja.po
A src/bin/pg_basebackup/po/pl.po
A src/bin/pg_basebackup/po/pt_BR.po
A src/bin/pg_basebackup/po/ru.po
A src/bin/pg_basebackup/po/zh_CN.po
M src/bin/pg_config/nls.mk
A src/bin/pg_config/po/cs.po
M src/bin/pg_config/po/de.po
M src/bin/pg_config/po/es.po
M src/bin/pg_config/po/fr.po
M src/bin/pg_config/po/it.po
M src/bin/pg_config/po/ja.po
A src/bin/pg_config/po/pl.po
M src/bin/pg_config/po/pt_BR.po
M src/bin/pg_config/po/ru.po
M src/bin/pg_config/po/zh_CN.po
M src/bin/pg_controldata/nls.mk
A src/bin/pg_controldata/po/cs.po
M src/bin/pg_controldata/po/de.po
M src/bin/pg_controldata/po/es.po
M src/bin/pg_controldata/po/fr.po
M src/bin/pg_controldata/po/it.po
M src/bin/pg_controldata/po/ja.po
A src/bin/pg_controldata/po/pl.po
M src/bin/pg_controldata/po/pt_BR.po
M src/bin/pg_controldata/po/ru.po
M src/bin/pg_controldata/po/zh_CN.po
M src/bin/pg_ctl/nls.mk
A src/bin/pg_ctl/po/cs.po
M src/bin/pg_ctl/po/de.po
M src/bin/pg_ctl/po/es.po
M src/bin/pg_ctl/po/fr.po
M src/bin/pg_ctl/po/it.po
M src/bin/pg_ctl/po/ja.po
A src/bin/pg_ctl/po/pl.po
M src/bin/pg_ctl/po/pt_BR.po
M src/bin/pg_ctl/po/ru.po
M src/bin/pg_ctl/po/sv.po
M src/bin/pg_ctl/po/zh_CN.po
M src/bin/pg_dump/nls.mk
A src/bin/pg_dump/po/cs.po
M src/bin/pg_dump/po/de.po
M src/bin/pg_dump/po/es.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
A src/bin/pg_dump/po/pl.po
M src/bin/pg_dump/po/pt_BR.po
A src/bin/pg_dump/po/ru.po
M src/bin/pg_dump/po/zh_CN.po
M src/bin/pg_resetxlog/nls.mk
A src/bin/pg_resetxlog/po/cs.po
M src/bin/pg_resetxlog/po/de.po
M src/bin/pg_resetxlog/po/es.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
A src/bin/pg_resetxlog/po/pl.po
M src/bin/pg_resetxlog/po/pt_BR.po
M src/bin/pg_resetxlog/po/ru.po
M src/bin/pg_resetxlog/po/zh_CN.po
M src/bin/psql/nls.mk
M src/bin/psql/po/cs.po
M src/bin/psql/po/de.po
M src/bin/psql/po/es.po
M src/bin/psql/po/fr.po
A src/bin/psql/po/it.po
M src/bin/psql/po/ja.po
A src/bin/psql/po/pl.po
M src/bin/psql/po/pt_BR.po
A src/bin/psql/po/ru.po
M src/bin/psql/po/zh_CN.po
M src/bin/psql/po/zh_TW.po
M src/bin/scripts/nls.mk
M src/bin/scripts/po/cs.po
M src/bin/scripts/po/de.po
M src/bin/scripts/po/es.po
M src/bin/scripts/po/fr.po
M src/bin/scripts/po/it.po
M src/bin/scripts/po/ja.po
A src/bin/scripts/po/pl.po
M src/bin/scripts/po/pt_BR.po
A src/bin/scripts/po/ru.po
M src/bin/scripts/po/zh_CN.po
M src/interfaces/ecpg/ecpglib/nls.mk
A src/interfaces/ecpg/ecpglib/po/cs.po
M src/interfaces/ecpg/ecpglib/po/de.po
M src/interfaces/ecpg/ecpglib/po/es.po
M src/interfaces/ecpg/ecpglib/po/fr.po
M src/interfaces/ecpg/ecpglib/po/it.po
A src/interfaces/ecpg/ecpglib/po/pl.po
M src/interfaces/ecpg/ecpglib/po/pt_BR.po
A src/interfaces/ecpg/ecpglib/po/ru.po
M src/interfaces/ecpg/ecpglib/po/zh_CN.po
M src/interfaces/ecpg/preproc/nls.mk
A src/interfaces/ecpg/preproc/po/cs.po
M src/interfaces/ecpg/preproc/po/de.po
M src/interfaces/ecpg/preproc/po/es.po
M src/interfaces/ecpg/preproc/po/fr.po
M src/interfaces/ecpg/preproc/po/it.po
A src/interfaces/ecpg/preproc/po/pl.po
M src/interfaces/ecpg/preproc/po/pt_BR.po
A src/interfaces/ecpg/preproc/po/ru.po
M src/interfaces/ecpg/preproc/po/zh_CN.po
M src/interfaces/libpq/nls.mk
M src/interfaces/libpq/po/cs.po
M src/interfaces/libpq/po/de.po
M src/interfaces/libpq/po/es.po
M src/interfaces/libpq/po/fr.po
M src/interfaces/libpq/po/it.po
M src/interfaces/libpq/po/ja.po
A src/interfaces/libpq/po/pl.po
M src/interfaces/libpq/po/pt_BR.po
M src/interfaces/libpq/po/ru.po
M src/interfaces/libpq/po/tr.po
M src/interfaces/libpq/po/zh_CN.po
M src/interfaces/libpq/po/zh_TW.po
M src/pl/plperl/nls.mk
A src/pl/plperl/po/cs.po
M src/pl/plperl/po/de.po
M src/pl/plperl/po/es.po
M src/pl/plperl/po/fr.po
M src/pl/plperl/po/it.po
M src/pl/plperl/po/ja.po
A src/pl/plperl/po/pl.po
M src/pl/plperl/po/pt_BR.po
M src/pl/plperl/po/ro.po
A src/pl/plperl/po/ru.po
M src/pl/plperl/po/tr.po
M src/pl/plperl/po/zh_CN.po
M src/pl/plpgsql/src/nls.mk
A src/pl/plpgsql/src/po/cs.po
M src/pl/plpgsql/src/po/de.po
M src/pl/plpgsql/src/po/es.po
M src/pl/plpgsql/src/po/fr.po
M src/pl/plpgsql/src/po/it.po
M src/pl/plpgsql/src/po/ja.po
M src/pl/plpgsql/src/po/pl.po
M src/pl/plpgsql/src/po/pt_BR.po
M src/pl/plpgsql/src/po/ro.po
A src/pl/plpgsql/src/po/ru.po
M src/pl/plpgsql/src/po/zh_CN.po
M src/pl/plpython/nls.mk
A src/pl/plpython/po/cs.po
M src/pl/plpython/po/de.po
M src/pl/plpython/po/es.po
M src/pl/plpython/po/fr.po
M src/pl/plpython/po/it.po
M src/pl/plpython/po/ja.po
A src/pl/plpython/po/pl.po
M src/pl/plpython/po/pt_BR.po
M src/pl/plpython/po/ro.po
A src/pl/plpython/po/ru.po
M src/pl/plpython/po/zh_CN.po
M src/pl/tcl/nls.mk
A src/pl/tcl/po/cs.po
M src/pl/tcl/po/de.po
M src/pl/tcl/po/es.po
M src/pl/tcl/po/fr.po
M src/pl/tcl/po/it.po
A src/pl/tcl/po/pl.po
M src/pl/tcl/po/pt_BR.po
A src/pl/tcl/po/ru.po
M src/pl/tcl/po/zh_CN.po

Improve behavior of \watch with non-tuple-returning commands.

commit   : 626e6eda4f605788110bfc5fa95760305f7eb749    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sat, 4 May 2013 16:41:22 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sat, 4 May 2013 16:41:22 -0400    

Click here for diff

Print the command tag if we get PGRES_COMMAND_OK, and throw an error for  
other cases.  Per gripe from Michael Paquier.  
  
In passing, add an fflush(), just to be real sure the output appears  
before we sleep.  

M src/bin/psql/command.c

docs: Improve log_line_prefix session_id query

commit   : 083d8fa79dbd693f48c1c195bf4f2af3d1e7dc67    
  
author   : Bruce Momjian <bruce@momjian.us>    
date     : Sat, 4 May 2013 13:23:04 -0400    
  
committer: Bruce Momjian <bruce@momjian.us>    
date     : Sat, 4 May 2013 13:23:04 -0400    

Click here for diff

M doc/src/sgml/config.sgml

docs: log_line_prefix session id fix

commit   : f87f214b7c09e20d954fae887809c41cc5ca68df    
  
author   : Bruce Momjian <bruce@momjian.us>    
date     : Sat, 4 May 2013 13:15:54 -0400    
  
committer: Bruce Momjian <bruce@momjian.us>    
date     : Sat, 4 May 2013 13:15:54 -0400    

Click here for diff

Restore 4-byte designation for docs.  Fix 9.3 doc query to properly pad  
to four digits.  
  
Backpatch to all active branches  
  
Per suggestions from Ian Lawrence Barwick  

M doc/src/sgml/config.sgml

9.3 docs: wording fixes

commit   : 75d1406a194d16823e786a8d5094abd1e7e5661b    
  
author   : Bruce Momjian <bruce@momjian.us>    
date     : Sat, 4 May 2013 11:52:18 -0400    
  
committer: Bruce Momjian <bruce@momjian.us>    
date     : Sat, 4 May 2013 11:52:18 -0400    

Click here for diff

From Erik Rijkers  

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

docs: fix log_line_prefix session id docs

commit   : 262a3629971bdf61c309843b385a58d97bf4badb    
  
author   : Bruce Momjian <bruce@momjian.us>    
date     : Sat, 4 May 2013 11:05:16 -0400    
  
committer: Bruce Momjian <bruce@momjian.us>    
date     : Sat, 4 May 2013 11:05:16 -0400    

Click here for diff

Backpatch to 9.2.  
  
Report from Ian Lawrence Barwick  

M doc/src/sgml/config.sgml

9.3 release notes: adjustments

commit   : c008ca6015732da09416381710066540cbfa735b    
  
author   : Bruce Momjian <bruce@momjian.us>    
date     : Sat, 4 May 2013 10:44:49 -0400    
  
committer: Bruce Momjian <bruce@momjian.us>    
date     : Sat, 4 May 2013 10:44:49 -0400    

Click here for diff

Fixes from Peter Geoghegan, Ian Lawrence Barwick, Marti Raudsepp  

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

9.3 release notes: move compatibility items into their own section

commit   : 2497dc0867afd5b51d50e090fce2e828baadc8c3    
  
author   : Bruce Momjian <bruce@momjian.us>    
date     : Fri, 3 May 2013 21:11:35 -0400    
  
committer: Bruce Momjian <bruce@momjian.us>    
date     : Fri, 3 May 2013 21:11:35 -0400    

Click here for diff

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

9.3 release notes: Add markup for pg_backup_start_time()

commit   : 1136d7a74d9feeab556a970b4b1e548e05f92a70    
  
author   : Bruce Momjian <bruce@momjian.us>    
date     : Fri, 3 May 2013 20:55:03 -0400    
  
committer: Bruce Momjian <bruce@momjian.us>    
date     : Fri, 3 May 2013 20:55:03 -0400    

Click here for diff

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

commit   : 15f27aebbb688495da8a77a1ae67ded38f569829    
  
author   : Bruce Momjian <bruce@momjian.us>    
date     : Fri, 3 May 2013 19:40:23 -0400    
  
committer: Bruce Momjian <bruce@momjian.us>    
date     : Fri, 3 May 2013 19:40:23 -0400    

Click here for diff

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

9.3 release notes: add markup for text

commit   : 14c7a74b6ebe4743b79e4f500503ffaa8c8a8638    
  
author   : Bruce Momjian <bruce@momjian.us>    
date     : Fri, 3 May 2013 14:48:12 -0400    
  
committer: Bruce Momjian <bruce@momjian.us>    
date     : Fri, 3 May 2013 14:48:12 -0400    

Click here for diff

Still need to add links for new features.  

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

Improve SPI documentation about null-flags arrays.

commit   : c091c431979c182bc835b345655c1c162479aeb3    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Fri, 3 May 2013 14:39:28 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Fri, 3 May 2013 14:39:28 -0400    

Click here for diff

Clarify the description of nulls[] arguments, and use the same wording  
for all SPI functions with this type of argument.  Per gripe from Yuriy  
Rusinov.  

M doc/src/sgml/spi.sgml

9.3 release notes: update for current commits

commit   : 5fcf944c2303232826be49c09943849480719936    
  
author   : Bruce Momjian <bruce@momjian.us>    
date     : Fri, 3 May 2013 13:30:58 -0400    
  
committer: Bruce Momjian <bruce@momjian.us>    
date     : Fri, 3 May 2013 13:30:58 -0400    

Click here for diff

Also, remove broken link in release.sgml.  

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

9.3 release notes: suggested improvements from Jeff Janes and Josh Berkus

commit   : c8f61ebdc6e0a260efeef432239d4d2e8202a30d    
  
author   : Bruce Momjian <bruce@momjian.us>    
date     : Thu, 2 May 2013 19:14:20 -0400    
  
committer: Bruce Momjian <bruce@momjian.us>    
date     : Thu, 2 May 2013 19:14:20 -0400    

Click here for diff

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

Prevent (auto)vacuum from truncating first page of populated matview.

commit   : b69ec7cc990fd8da75ed4c232899503217d7b9ae    
  
author   : Kevin Grittner <kgrittn@postgresql.org>    
date     : Thu, 2 May 2013 17:33:03 -0500    
  
committer: Kevin Grittner <kgrittn@postgresql.org>    
date     : Thu, 2 May 2013 17:33:03 -0500    

Click here for diff

Per report from Fujii Masao, with regression test using his example.  

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

pg_test_fsync: update output to show usecs/op clearer

commit   : 095018bc32b70eff95bdf3c2959e6eef09dcfa6a    
  
author   : Bruce Momjian <bruce@momjian.us>    
date     : Thu, 2 May 2013 10:27:06 -0400    
  
committer: Bruce Momjian <bruce@momjian.us>    
date     : Thu, 2 May 2013 10:27:06 -0400    

Click here for diff

M contrib/pg_test_fsync/pg_test_fsync.c

Use correct length to convert json unicode escapes.

commit   : 5f8b4319b94476de715ffef9183227ac6f4925c0    
  
author   : Andrew Dunstan <andrew@dunslane.net>    
date     : Wed, 1 May 2013 18:47:18 -0400    
  
committer: Andrew Dunstan <andrew@dunslane.net>    
date     : Wed, 1 May 2013 18:47:18 -0400    

Click here for diff

Bug reported on IRC - fix due to Andrew Gierth.  

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

Fix permission tests for views/tables proven empty by constraint exclusion.

commit   : 50c137487c96e629e0e5372bb3d1b5f1a2f71a88    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Wed, 1 May 2013 18:26:50 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Wed, 1 May 2013 18:26:50 -0400    

Click here for diff

A view defined as "select <something> where false" had the curious property  
that the system wouldn't check whether users had the privileges necessary  
to select from it.  More generally, permissions checks could be skipped  
for tables referenced in sub-selects or views that were proven empty by  
constraint exclusion (although some quick testing suggests this seldom  
happens in cases of practical interest).  This happened because the planner  
failed to include rangetable entries for such tables in the finished plan.  
  
This was noticed in connection with erroneous handling of materialized  
views, but actually the issue is quite unrelated to matviews.  Therefore,  
revert commit 200ba1667b3a8d7a9d559d2f05f83d209c9d8267 in favor of a more  
direct test for the real problem.  
  
Back-patch to 9.2 where the bug was introduced (by commit  
7741dd6590073719688891898e85f0cb73453159).  

M src/backend/optimizer/path/allpaths.c
M src/backend/optimizer/plan/createplan.c
M src/test/regress/expected/matview.out
M src/test/regress/expected/privileges.out
M src/test/regress/sql/matview.sql
M src/test/regress/sql/privileges.sql

Add regression test for bug fixed by recent refactoring.

commit   : 200ba1667b3a8d7a9d559d2f05f83d209c9d8267    
  
author   : Kevin Grittner <kgrittn@postgresql.org>    
date     : Tue, 30 Apr 2013 15:02:43 -0500    
  
committer: Kevin Grittner <kgrittn@postgresql.org>    
date     : Tue, 30 Apr 2013 15:02:43 -0500    

Click here for diff

Test case by Andres Freund for bug fixed by Tom Lane's refactoring  
in commit 5194024d72f33fb209e10f9ab0ada7cc67df45b7  

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

Fix pg_upgrade for 9.3 with data checksums. Previous changes misconstrued pg_upgrade internals causing build farm breakages.

commit   : 87d3b35a1ca31a9d947a8f919a6006679216dff0    
  
author   : Simon Riggs <simon@2ndQuadrant.com>    
date     : Tue, 30 Apr 2013 15:49:24 +0100    
  
committer: Simon Riggs <simon@2ndQuadrant.com>    
date     : Tue, 30 Apr 2013 15:49:24 +0100    

Click here for diff

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

Revert previous temporary patch

commit   : be475a2473b18a62a02d56c44047e16b54aac54d    
  
author   : Simon Riggs <simon@2ndQuadrant.com>    
date     : Tue, 30 Apr 2013 15:32:10 +0100    
  
committer: Simon Riggs <simon@2ndQuadrant.com>    
date     : Tue, 30 Apr 2013 15:32:10 +0100    

Click here for diff

M contrib/pg_upgrade/controldata.c

Temporarily silence pg_upgrade's checksums check

commit   : 28377213bb6550cc5035b0ba258b518f80c1aaae    
  
author   : Simon Riggs <simon@2ndQuadrant.com>    
date     : Tue, 30 Apr 2013 14:34:47 +0100    
  
committer: Simon Riggs <simon@2ndQuadrant.com>    
date     : Tue, 30 Apr 2013 14:34:47 +0100    

Click here for diff

M contrib/pg_upgrade/controldata.c

Bump PG_CONTROL_VERSION to 937

commit   : ceabfb20f9a7aadbb09ee1a276726fc309a39300    
  
author   : Simon Riggs <simon@2ndQuadrant.com>    
date     : Tue, 30 Apr 2013 13:27:47 +0100    
  
committer: Simon Riggs <simon@2ndQuadrant.com>    
date     : Tue, 30 Apr 2013 13:27:47 +0100    

Click here for diff

M src/include/catalog/pg_control.h

Record data_checksum_version in control file. The value is not used anywhere in code, but will allow future changes to the checksum version should that become necessary in the future.

commit   : 443951748ce4c94b001877c7cf88b0ee969c79e7    
  
author   : Simon Riggs <simon@2ndQuadrant.com>    
date     : Tue, 30 Apr 2013 12:27:12 +0100    
  
committer: Simon Riggs <simon@2ndQuadrant.com>    
date     : Tue, 30 Apr 2013 12:27:12 +0100    

Click here for diff

M src/backend/access/transam/xlog.c
M src/backend/bootstrap/bootstrap.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/bufpage.h

Ensure we MarkBufferDirty before visibilitymap_set() logs the heap page and sets the LSN. Otherwise a checkpoint could occur between those actions and leave us in an inconsistent state.

commit   : 730924397c8151c3cf34e633211cd0fe4a0db112    
  
author   : Simon Riggs <simon@2ndQuadrant.com>    
date     : Tue, 30 Apr 2013 08:15:49 +0100    
  
committer: Simon Riggs <simon@2ndQuadrant.com>    
date     : Tue, 30 Apr 2013 08:15:49 +0100    

Click here for diff

Jeff Davis  

M src/backend/commands/vacuumlazy.c

Compiler optimizations for page checksum code.

commit   : fdea2530bd4afb3d512cb9700b1d8cd603fab0e7    
  
author   : Simon Riggs <simon@2ndQuadrant.com>    
date     : Tue, 30 Apr 2013 06:59:26 +0100    
  
committer: Simon Riggs <simon@2ndQuadrant.com>    
date     : Tue, 30 Apr 2013 06:59:26 +0100    

Click here for diff

Ants Aasma and Jeff Davis  

M config/c-compiler.m4
M configure
M configure.in
M src/Makefile.global.in
M src/backend/storage/page/Makefile

pg_upgrade: Remove PGPORT handling from test suite

commit   : 3d53173e20d151341f894f79d556768c845ba3e4    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Mon, 29 Apr 2013 22:17:29 -0400    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
date     : Mon, 29 Apr 2013 22:17:29 -0400    

Click here for diff

This code was left over from when pg_upgrade paid attention to PGPORT.  
Now it would only affects the regression test run before the test run of  
pg_upgrade.  You can still set PGPORT for that, but there is no reason  
to have the test driver default it to 50432.  

M contrib/pg_upgrade/test.sh

Revert "pg_ctl: Add idempotent option"

commit   : 187ca5e8e90baacc2d36c8bd0b08040f33c07fa1    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Mon, 29 Apr 2013 21:55:12 -0400    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
date     : Mon, 29 Apr 2013 21:55:12 -0400    

Click here for diff

This reverts commit 87306184580c9c49717b00d48a2f9e717f21e0a8.  The  
behavior in certain cases is still being debated, and it's too late to  
solve this before beta.  

M contrib/start-scripts/linux
M doc/src/sgml/ref/pg_ctl-ref.sgml
M src/bin/pg_ctl/pg_ctl.c

Postpone creation of pathkeys lists to fix bug #8049.

commit   : db9f0e1d9a4a0842c814a464cdc9758c3f20b96c    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Mon, 29 Apr 2013 14:49:01 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Mon, 29 Apr 2013 14:49:01 -0400    

Click here for diff

This patch gets rid of the concept of, and infrastructure for,  
non-canonical PathKeys; we now only ever create canonical pathkey lists.  
  
The need for non-canonical pathkeys came from the desire to have  
grouping_planner initialize query_pathkeys and related pathkey lists before  
calling query_planner.  However, since query_planner didn't actually *do*  
anything with those lists before they'd been made canonical, we can get rid  
of the whole mess by just not creating the lists at all until the point  
where we formerly canonicalized them.  
  
There are several ways in which we could implement that without making  
query_planner itself deal with grouping/sorting features (which are  
supposed to be the province of grouping_planner).  I chose to add a  
callback function to query_planner's API; other alternatives would have  
required adding more fields to PlannerInfo, which while not bad in itself  
would create an ABI break for planner-related plugins in the 9.2 release  
series.  This still breaks ABI for anything that calls query_planner  
directly, but it seems somewhat unlikely that there are any such plugins.  
  
I had originally conceived of this change as merely a step on the way to  
fixing bug #8049 from Teun Hoogendoorn; but it turns out that this fixes  
that bug all by itself, as per the added regression test.  The reason is  
that now get_eclass_for_sort_expr is adding the ORDER BY expression at the  
end of EquivalenceClass creation not the start, and so anything that is in  
a multi-member EquivalenceClass has already been created with correct  
em_nullable_relids.  I am suspicious that there are related scenarios in  
which we still need to teach get_eclass_for_sort_expr to compute correct  
nullable_relids, but am not eager to risk destabilizing either 9.2 or 9.3  
to fix bugs that are only hypothetical.  So for the moment, do this and  
stop here.  
  
Back-patch to 9.2 but not to earlier branches, since they don't exhibit  
this bug for lack of join-clause-movement logic that depends on  
em_nullable_relids being correct.  (We might have to revisit that choice  
if any related bugs turn up.)  In 9.2, don't change the signature of  
make_pathkeys_for_sortclauses nor remove canonicalize_pathkeys, so as  
not to risk more plugin breakage than we have to.  

M src/backend/nodes/equalfuncs.c
M src/backend/optimizer/README
M src/backend/optimizer/path/equivclass.c
M src/backend/optimizer/path/pathkeys.c
M src/backend/optimizer/plan/planagg.c
M src/backend/optimizer/plan/planmain.c
M src/backend/optimizer/plan/planner.c
M src/include/nodes/relation.h
M src/include/optimizer/paths.h
M src/include/optimizer/planmain.h
M src/test/regress/expected/join.out
M src/test/regress/sql/join.sql

Ensure ANALYZE phase is not skipped because of canceled truncate.

commit   : 5fc893760f60d57aca30163796db1abe516b3fac    
  
author   : Kevin Grittner <kgrittn@postgresql.org>    
date     : Mon, 29 Apr 2013 13:05:26 -0500    
  
committer: Kevin Grittner <kgrittn@postgresql.org>    
date     : Mon, 29 Apr 2013 13:05:26 -0500    

Click here for diff

Patch b19e4250b45e91c9cbdd18d35ea6391ab5961c8d attempted to  
preserve existing behavior regarding statistics generation in the  
case that a truncation attempt was canceled due to lock conflicts.  
It failed to do this accurately in two regards: (1) autovacuum had  
previously generated statistics if the truncate attempt failed to  
initially get the lock rather than having started the attempt, and  
(2) the VACUUM ANALYZE command had always generated statistics.  
  
Both of these changes were unintended, and are reverted by this  
patch.  On review, there seems to be consensus that the previous  
failure to generate statistics when the truncate was terminated  
was more an unfortunate consequence of how that effort was  
previously terminated than a feature we want to keep; so this  
patch generates statistics even when an autovacuum truncation  
attempt terminates early.  Another unintended change which is kept  
on the basis that it is an improvement is that when a VACUUM  
command is truncating, it will the new heuristic for avoiding  
blocking other processes, rather than keeping an  
AccessExclusiveLock on the table for however long the truncation  
takes.  
  
Per multiple reports, with some renaming per patch by Jeff Janes.  
  
Backpatch to 9.0, where problem was created.  

M src/backend/commands/vacuumlazy.c

Attempt to fix error recovery in COPY BOTH mode.

commit   : 91fa8532f4053468acc08534a6aac516ccde47b7    
  
author   : Robert Haas <rhaas@postgresql.org>    
date     : Mon, 29 Apr 2013 06:29:32 -0400    
  
committer: Robert Haas <rhaas@postgresql.org>    
date     : Mon, 29 Apr 2013 06:29:32 -0400    

Click here for diff

Previously, libpq and the backend had opposite ideas about whether  
it was necessary for the client to send a CopyDone message after  
receiving an ErrorResponse, making it impossible to cleanly exit  
COPY BOTH mode.  Fix libpq so that works correctly, adopting the  
backend's notion that an ErrorResponse kills the copy in both  
directions.  
  
Adjust receivelog.c to avoid a degradation in the quality of the  
resulting error messages.  libpqwalreceiver.c is already doing  
the right thing, so no adjustment needed there.  
  
Add an explicit statement to the documentation explaining how  
this part of the protocol is supposed to work, in the hopes of  
avoiding future confusion in this area.  
  
Since the consequences of all this confusion are very limited,  
especially in the back-branches where no client ever attempts  
to exit COPY BOTH mode without closing the connection entirely,  
no back-patch.  

M doc/src/sgml/protocol.sgml
M src/bin/pg_basebackup/receivelog.c
M src/interfaces/libpq/fe-protocol3.c

Introduce new page checksum algorithm and module. Isolate checksum calculation to its own module, so that bufpage knows little if anything about the details of the calculation.

commit   : 43e7a668499b8a69a62cc539a0fbe6983384339c    
  
author   : Simon Riggs <simon@2ndQuadrant.com>    
date     : Mon, 29 Apr 2013 09:05:27 +0100    
  
committer: Simon Riggs <simon@2ndQuadrant.com>    
date     : Mon, 29 Apr 2013 09:05:27 +0100    

Click here for diff

This implementation is a modified FNV-1a hash checksum, details  
of which are given in the new checksum.c header comments.  
  
Basic implementation only, so we fix the output value.  
  
Later related commits will add version numbers to pg_control,  
compiler optimization flags and memory barriers.  
  
Ants Aasma, reviewed by Jeff Davis and Simon Riggs  

M src/backend/storage/page/Makefile
M src/backend/storage/page/bufpage.c
A src/backend/storage/page/checksum.c
A src/include/storage/checksum.h

Editorialize a bit on new ProcessUtility() API.

commit   : f8db76e875099e5e49f5cd729a673e84c0b0471b    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sun, 28 Apr 2013 00:18:45 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sun, 28 Apr 2013 00:18:45 -0400    

Click here for diff

Choose a saner ordering of parameters (adding a new input param after  
the output params seemed a bit random), update the function's header  
comment to match reality (cmon folks, is this really that hard?),  
get rid of useless and sloppily-defined distinction between  
PROCESS_UTILITY_SUBCOMMAND and PROCESS_UTILITY_GENERATED.  

M contrib/pg_stat_statements/pg_stat_statements.c
M contrib/sepgsql/hooks.c
M src/backend/commands/extension.c
M src/backend/commands/schemacmds.c
M src/backend/commands/trigger.c
M src/backend/executor/functions.c
M src/backend/executor/spi.c
M src/backend/tcop/pquery.c
M src/backend/tcop/utility.c
M src/include/tcop/utility.h

Fix unsafe event-trigger coding in ProcessUtility().

commit   : 5525e6c40bbda351a19b48317eba0f79aa32e447    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sat, 27 Apr 2013 23:11:28 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sat, 27 Apr 2013 23:11:28 -0400    

Click here for diff

We mustn't run any of the event-trigger support code when handling  
utility statements like START TRANSACTION or ABORT, because that code  
may need to refresh event-trigger cache data, which requires being  
inside a valid transaction.  (This mistake explains the consistent  
build failures exhibited by the CLOBBER_CACHE_ALWAYS buildfarm members,  
as well as some irreproducible failures on other members.)  
  
The least messy fix seems to be to break standard_ProcessUtility into two  
functions, one that handles all the statements not supported by event  
triggers, and one that contains the event-trigger support code and handles  
the statements that are supported by event triggers.  
  
This change also fixes several inconsistencies, such as four cases where  
support had been installed for "ddl_event_start" but not "ddl_event_end"  
triggers, plus the fact that InvokeDDLCommandEventTriggersIfSupported()  
paid no mind to isCompleteQuery.  
  
Dimitri Fontaine and Tom Lane  

M src/backend/tcop/utility.c

pg_dump: Improve message formatting

commit   : bbb4db4e04d4691d7bc42fa19995aee3e80fe2dc    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Sat, 27 Apr 2013 23:06:37 -0400    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
date     : Sat, 27 Apr 2013 23:06:37 -0400    

Click here for diff

M src/bin/pg_dump/pg_dump.c

Incidental cleanup of matviews code.

commit   : 5194024d72f33fb209e10f9ab0ada7cc67df45b7    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sat, 27 Apr 2013 17:48:57 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sat, 27 Apr 2013 17:48:57 -0400    

Click here for diff

Move checking for unscannable matviews into ExecOpenScanRelation, which is  
a better place for it first because the open relation is already available  
(saving a relcache lookup cycle), and second because this eliminates the  
problem of telling the difference between rangetable entries that will or  
will not be scanned by the query.  In particular we can get rid of the  
not-terribly-well-thought-out-or-implemented isResultRel field that the  
initial matviews patch added to RangeTblEntry.  
  
Also get rid of entirely unnecessary scannability check in the rewriter,  
and a bogus decision about whether RefreshMatViewStmt requires a parse-time  
snapshot.  
  
catversion bump due to removal of a RangeTblEntry field, which changes  
stored rules.  

M src/backend/commands/createas.c
M src/backend/commands/matview.c
M src/backend/executor/execMain.c
M src/backend/executor/execUtils.c
M src/backend/executor/nodeBitmapHeapscan.c
M src/backend/executor/nodeForeignscan.c
M src/backend/executor/nodeIndexonlyscan.c
M src/backend/executor/nodeIndexscan.c
M src/backend/executor/nodeSeqscan.c
M src/backend/executor/nodeTidscan.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/analyze.c
M src/backend/rewrite/rewriteHandler.c
M src/include/catalog/catversion.h
M src/include/executor/executor.h
M src/include/nodes/parsenodes.h

Improve message about failed transaction log archiving

commit   : f5d576c6d278a61beec282b9b276a3a3cb2aec50    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Fri, 26 Apr 2013 22:43:54 -0400    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
date     : Fri, 26 Apr 2013 22:43:54 -0400    

Click here for diff

The old phrasing appeared to imply that the failure was terminal.  
Improve that by indicating that archiving will be tried again later.  

M src/backend/postmaster/pgarch.c

Update config.guess and config.sub

commit   : b53b603c919dd37444da0f15e8867c707ce1a03a    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Fri, 26 Apr 2013 22:13:03 -0400    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
date     : Fri, 26 Apr 2013 22:13:03 -0400    

Click here for diff

M config/config.guess
M config/config.sub

Fix collation assignment for aggregates with ORDER BY.

commit   : 41a2760f611d1b3c1e67f755baf0a052b5cec9af    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Fri, 26 Apr 2013 15:48:24 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Fri, 26 Apr 2013 15:48:24 -0400    

Click here for diff

ORDER BY expressions were being treated the same as regular aggregate  
arguments for purposes of collation determination, but really they should  
not affect the aggregate's collation at all; only collations of the  
aggregate's regular arguments should affect it.  
  
In many cases this mistake would lead to incorrectly throwing a "collation  
conflict" error; but in some cases the corrected code will silently assign  
a different collation to the aggregate than before, for example  
	agg(foo ORDER BY bar COLLATE "x")  
which will now use foo's collation rather than "x" for the aggregate.  
Given this risk and the lack of field complaints about the issue, it  
doesn't seem prudent to back-patch.  
  
In passing, rearrange code in assign_collations_walker so that we don't  
need multiple copies of the standard logic for computing collation of a  
node with children.  (Previously, CaseExpr duplicated the standard logic,  
and we would have needed a third copy for Aggref without this change.)  
  
Andrew Gierth and David Fetter  

M src/backend/parser/parse_collate.c
M src/test/regress/expected/collate.out
M src/test/regress/sql/collate.sql

Ensure that user created rows in extension tables get dumped if the table is explicitly requested, either with a -t/--table switch of the table itself, or by -n/--schema switch of the schema containing the extension table. Patch reviewed by Vibhor Kumar and Dimitri Fontaine.

commit   : b42ea7981ce1e7484951a22662937541066d8647    
  
author   : Joe Conway <mail@joeconway.com>    
date     : Fri, 26 Apr 2013 11:50:00 -0700    
  
committer: Joe Conway <mail@joeconway.com>    
date     : Fri, 26 Apr 2013 11:50:00 -0700    

Click here for diff

Backpatched to 9.1 when the extension management facility was added.  

M src/bin/pg_dump/pg_dump.c

libpq: Fix a few bits that didn't get the memo about COPY BOTH.

commit   : 5eb7c4d364c8733d20d7fc8a453a145ee6da10cf    
  
author   : Robert Haas <rhaas@postgresql.org>    
date     : Fri, 26 Apr 2013 08:57:47 -0400    
  
committer: Robert Haas <rhaas@postgresql.org>    
date     : Fri, 26 Apr 2013 08:57:47 -0400    

Click here for diff

There's probably no real bug here at present, so not backpatching.  
But it seems good to make these bits consistent with the rest of  
libpq, so as to avoid future surprises.  
  
Patch by me.  Review by Tom Lane.  

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

Avoid deadlock between concurrent CREATE INDEX CONCURRENTLY commands.

commit   : c3d09b3bd23f5f65b5eb8124a3c7592dad85a50c    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 25 Apr 2013 16:58:05 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 25 Apr 2013 16:58:05 -0400    

Click here for diff

There was a high probability of two or more concurrent C.I.C. commands  
deadlocking just before completion, because each would wait for the others  
to release their reference snapshots.  Fix by releasing the snapshot  
before waiting for other snapshots to go away.  
  
Per report from Paul Hinze.  Back-patch to all active branches.  

M src/backend/commands/indexcmds.c

Fix typo in comment.

commit   : 447b3174f58be808e81408b2166b41d898292ab3    
  
author   : Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Thu, 25 Apr 2013 14:03:10 +0300    
  
committer: Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Thu, 25 Apr 2013 14:03:10 +0300    

Click here for diff

Peter Geoghegan  

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

pg_basebackup: Add missing newlines at end of lines

commit   : 6cf84628342ca859a15c9b1576fdbebc3575a0d2    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Wed, 24 Apr 2013 22:51:10 -0400    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
date     : Wed, 24 Apr 2013 22:51:10 -0400    

Click here for diff

M src/bin/pg_basebackup/receivelog.c

initdb: Improve some messages

commit   : 4c0343d4af716813388a585390f5660c17a848f9    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Wed, 24 Apr 2013 22:50:33 -0400    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
date     : Wed, 24 Apr 2013 22:50:33 -0400    

Click here for diff

M src/bin/initdb/initdb.c

PL/pgSQL doc: Add example for RETURN QUERY

commit   : 4d67961110d17768021bac2c00fd395942d03170    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Tue, 23 Apr 2013 22:46:36 -0400    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
date     : Tue, 23 Apr 2013 22:46:36 -0400    

Click here for diff

Erwin Brandstetter and Pavel Stěhule  

M doc/src/sgml/plpgsql.sgml

Add missing #include.

commit   : 0c1a160a68b89f5b2c31eac458ca2d62a622a524    
  
author   : Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Wed, 24 Apr 2013 19:11:25 +0300    
  
committer: Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Wed, 24 Apr 2013 19:11:25 +0300    

Click here for diff

On non-Windows systems, sys/time.h was pulled in by portability/instr_time.h,  
which pulled in time.h. We certainly should include time.h directly, since  
we're using time(2), but the indirect include masked the problem on most  
platforms.  
  
Andres Freund  

M src/bin/psql/command.c

Fix assertion failure for REFRESH MATERIALIZED VIEW in PL.

commit   : 63e20041a2b5f98fdfe6b32af9550ca54ff8649f    
  
author   : Kevin Grittner <kgrittn@postgresql.org>    
date     : Wed, 24 Apr 2013 08:39:06 -0500    
  
committer: Kevin Grittner <kgrittn@postgresql.org>    
date     : Wed, 24 Apr 2013 08:39:06 -0500    

Click here for diff

This was due to incomplete implementation of rowcount reporting  
for RMV, which was due to initial waffling on whether it should  
be provided.  It seems unlikely to be a useful or universally  
available  number as more sophisticated techniques for maintaining  
matviews are added, so remove the partial support rather than  
completing it.  
  
Per report of Jeevan Chalke, but with a different fix  

M src/backend/executor/spi.c

Make fast promotion the default promotion mode. Continue to allow a request for synchronous checkpoints as a mechanism in case of problems.

commit   : 2317a63328cd9d1c22d02218c6959f340b63d98f    
  
author   : Simon Riggs <simon@2ndQuadrant.com>    
date     : Wed, 24 Apr 2013 12:21:18 +0100    
  
committer: Simon Riggs <simon@2ndQuadrant.com>    
date     : Wed, 24 Apr 2013 12:21:18 +0100    

Click here for diff

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

9.3 release notes: adjustments per Alvaro

commit   : 173c252bb2d9549fa091f606264e8da65672d5f4    
  
author   : Bruce Momjian <bruce@momjian.us>    
date     : Tue, 23 Apr 2013 23:21:09 -0400    
  
committer: Bruce Momjian <bruce@momjian.us>    
date     : Tue, 23 Apr 2013 23:21:09 -0400    

Click here for diff

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

9.3 release note updates from Dean Rasheed, Jov, Heikki Linnakangas, Erikjan Rijkers

commit   : 2d3edce6b32b6c9a37c14684d63e457f1bd5c55a    
  
author   : Bruce Momjian <bruce@momjian.us>    
date     : Tue, 23 Apr 2013 17:06:17 -0400    
  
committer: Bruce Momjian <bruce@momjian.us>    
date     : Tue, 23 Apr 2013 17:06:17 -0400    

Click here for diff

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

Remove prototype for cube(text) function that doesn't exist anymore.

commit   : cc7b0c2553a69eee914783a1cf0f34a2cbbf9afe    
  
author   : Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Tue, 23 Apr 2013 13:48:14 +0300    
  
committer: Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Tue, 23 Apr 2013 13:48:14 +0300    

Click here for diff

Adrian Schreyer  

M contrib/cube/cube.c

9.3 release notes: add diacritics

commit   : 98a1e7a735886b38bb0cc3bac5e96cffbf245de1    
  
author   : Bruce Momjian <bruce@momjian.us>    
date     : Mon, 22 Apr 2013 17:17:00 -0400    
  
committer: Bruce Momjian <bruce@momjian.us>    
date     : Mon, 22 Apr 2013 17:17:00 -0400    

Click here for diff

Alvaro Herrera  

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

9.3 release notes: adjustments per Alvaro and Robert

commit   : e35388451bb7c32be2783d700bd8076e08514c2c    
  
author   : Bruce Momjian <bruce@momjian.us>    
date     : Mon, 22 Apr 2013 16:05:06 -0400    
  
committer: Bruce Momjian <bruce@momjian.us>    
date     : Mon, 22 Apr 2013 16:05:06 -0400    

Click here for diff

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

Mention in docs that you can create SP-GiST indexes on range types.

commit   : ae7363999ff36a6857b968ffee8487519273709b    
  
author   : Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Mon, 22 Apr 2013 21:51:14 +0300    
  
committer: Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Mon, 22 Apr 2013 21:51:14 +0300    

Click here for diff

This is new in 9.3devel.  

M doc/src/sgml/rangetypes.sgml

9.3 release notes: apply fixes suggested by Alvaro

commit   : 4f8799a948a6b701e23de692237094c83146d3b6    
  
author   : Bruce Momjian <bruce@momjian.us>    
date     : Mon, 22 Apr 2013 14:33:28 -0400    
  
committer: Bruce Momjian <bruce@momjian.us>    
date     : Mon, 22 Apr 2013 14:33:28 -0400    

Click here for diff

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

9.3 release notes: update streaming replication speedups

commit   : beaa823bea8663779b12ce896e40038dd4796eaa    
  
author   : Bruce Momjian <bruce@momjian.us>    
date     : Mon, 22 Apr 2013 10:22:43 -0400    
  
committer: Bruce Momjian <bruce@momjian.us>    
date     : Mon, 22 Apr 2013 10:22:43 -0400    

Click here for diff

Andres Freund  

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

doc: Improve example formatting

commit   : e7d5ffe8ea9883f1b472036dfc098d555f5cd3ea    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Sun, 21 Apr 2013 22:21:29 -0400    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
date     : Sun, 21 Apr 2013 22:21:29 -0400    

Click here for diff

Erwin Brandstetter  

M doc/src/sgml/plpgsql.sgml

doc: Fix syntax in example

commit   : 53ecfddcebbf607badc678e294bf977334b79327    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Sun, 21 Apr 2013 22:16:12 -0400    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
date     : Sun, 21 Apr 2013 22:16:12 -0400    

Click here for diff

LANGUAGE 'plpgsql' no longer works.  The single quotes need to be  
removed.  
  
Erwin Brandstetter  

M doc/src/sgml/plpgsql.sgml

In 9.3 release notes, split up items

commit   : c3ab4ea27d5e2cd341fc189eb413909f177d835e    
  
author   : Bruce Momjian <bruce@momjian.us>    
date     : Sun, 21 Apr 2013 21:05:31 -0400    
  
committer: Bruce Momjian <bruce@momjian.us>    
date     : Sun, 21 Apr 2013 21:05:31 -0400    

Click here for diff

Split log shipping speed improvement and fail-over speed improvement items.  
  
Per request from Simon  

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

9.3 release note adjustments per request from Andres Freund

commit   : 4be535e2e44025975814937818c899fed7aafca3    
  
author   : Bruce Momjian <bruce@momjian.us>    
date     : Sun, 21 Apr 2013 10:08:58 -0400    
  
committer: Bruce Momjian <bruce@momjian.us>    
date     : Sun, 21 Apr 2013 10:08:58 -0400    

Click here for diff

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

Remove 9.3 item about fixing DROP INDEX CONCURRENTLY

commit   : 1f2236edd1876a8718453f7d4e8e7fdef378c91e    
  
author   : Bruce Momjian <bruce@momjian.us>    
date     : Sun, 21 Apr 2013 09:16:23 -0400    
  
committer: Bruce Momjian <bruce@momjian.us>    
date     : Sun, 21 Apr 2013 09:16:23 -0400    

Click here for diff

Already fixed in back branch.  

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

9.3 release note fixes

commit   : ac96e6a8c2c5477344e78840e689e39e7b7b3cf1    
  
author   : Bruce Momjian <bruce@momjian.us>    
date     : Sun, 21 Apr 2013 09:14:34 -0400    
  
committer: Bruce Momjian <bruce@momjian.us>    
date     : Sun, 21 Apr 2013 09:14:34 -0400    

Click here for diff

Move commit_delay, fix Zoltan's name, and adjust range type histogram  
text.  

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

Adjust 9.3 release notes per request from Simon

commit   : 864ec2f0cd5dd2ba5a7b40cc150cecb3010f739c    
  
author   : Bruce Momjian <bruce@momjian.us>    
date     : Sun, 21 Apr 2013 09:05:16 -0400    
  
committer: Bruce Momjian <bruce@momjian.us>    
date     : Sun, 21 Apr 2013 09:05:16 -0400    

Click here for diff

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

Reorder 9.3 release note items

commit   : ef3defcf0d507abb75d9e9696f11b44f4fc09291    
  
author   : Bruce Momjian <bruce@momjian.us>    
date     : Sun, 21 Apr 2013 00:57:18 -0400    
  
committer: Bruce Momjian <bruce@momjian.us>    
date     : Sun, 21 Apr 2013 00:57:18 -0400    

Click here for diff

Typo fix from David Fetter.  

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

More 9.3 release note reorderings

commit   : f0922cbdcc54a11ea7eef955763aab4d540bf22f    
  
author   : Bruce Momjian <bruce@momjian.us>    
date     : Sat, 20 Apr 2013 17:31:06 -0400    
  
committer: Bruce Momjian <bruce@momjian.us>    
date     : Sat, 20 Apr 2013 17:31:06 -0400    

Click here for diff

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

Fix Gilles Darold's name in 9.3 release notes.

commit   : 488eb9055d3135268fdb401953f395885829d2f4    
  
author   : Bruce Momjian <bruce@momjian.us>    
date     : Sat, 20 Apr 2013 17:09:10 -0400    
  
committer: Bruce Momjian <bruce@momjian.us>    
date     : Sat, 20 Apr 2013 17:09:10 -0400    

Click here for diff

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

Fix longstanding race condition in plancache.c.

commit   : ac63dca607e8e22247defbc8fe03b6baa3628c42    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sat, 20 Apr 2013 16:59:21 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sat, 20 Apr 2013 16:59:21 -0400    

Click here for diff

When creating or manipulating a cached plan for a transaction control  
command (particularly ROLLBACK), we must not perform any catalog accesses,  
since we might be in an aborted transaction.  However, plancache.c busily  
saved or examined the search_path for every cached plan.  If we were  
unlucky enough to do this at a moment where the path's expansion into  
schema OIDs wasn't already cached, we'd do some catalog accesses; and with  
some more bad luck such as an ill-timed signal arrival, that could lead to  
crashes or Assert failures, as exhibited in bug #8095 from Nachiket Vaidya.  
Fortunately, there's no real need to consider the search path for such  
commands, so we can just skip the relevant steps when the subject statement  
is a TransactionStmt.  This is somewhat related to bug #5269, though the  
failure happens during initial cached-plan creation rather than  
revalidation.  
  
This bug has been there since the plan cache was invented, so back-patch  
to all supported branches.  

M src/backend/utils/cache/plancache.c

Reorder some 9.3 release item entries

commit   : 61b962345dd87276452922a5dbc21836266b43e0    
  
author   : Bruce Momjian <bruce@momjian.us>    
date     : Sat, 20 Apr 2013 16:50:56 -0400    
  
committer: Bruce Momjian <bruce@momjian.us>    
date     : Sat, 20 Apr 2013 16:50:56 -0400    

Click here for diff

More to go.  

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

Push 9.3 release SGML file

commit   : 22f956f50cac33287daf76d79890057ba2fb3789    
  
author   : Bruce Momjian <bruce@momjian.us>    
date     : Sat, 20 Apr 2013 16:32:32 -0400    
  
committer: Bruce Momjian <bruce@momjian.us>    
date     : Sat, 20 Apr 2013 16:32:32 -0400    

Click here for diff

Forgotten in previous commit.  

A doc/src/sgml/release-9.3.sgml

Publish draft 9.3 release notes

commit   : e9a35c2082e638c34567db1b5738f355475811d6    
  
author   : Bruce Momjian <bruce@momjian.us>    
date     : Sat, 20 Apr 2013 16:29:58 -0400    
  
committer: Bruce Momjian <bruce@momjian.us>    
date     : Sat, 20 Apr 2013 16:29:58 -0400    

Click here for diff

No links added yet.  

M doc/src/sgml/filelist.sgml
M doc/src/sgml/release.sgml

doc: Mention SATA alongside IDE for Linux

commit   : 540ec93e33c4eea7da502e8a4e76e5de4b994ac1    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Sat, 20 Apr 2013 15:56:22 -0400    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
date     : Sat, 20 Apr 2013 15:56:22 -0400    

Click here for diff

suggested by Jov  

M doc/src/sgml/wal.sgml

Clean up references to SQL92

commit   : cc26ea9fe2e41e73c955ea75bea7a77fbd062d64    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Sat, 20 Apr 2013 11:04:41 -0400    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
date     : Sat, 20 Apr 2013 11:04:41 -0400    

Click here for diff

In most cases, these were just references to the SQL standard in  
general.  In a few cases, a contrast was made between SQL92 and later  
standards -- those have been kept unchanged.  

M src/backend/catalog/pg_operator.c
M src/backend/executor/execMain.c
M src/backend/parser/gram.y
M src/backend/parser/parse_relation.c
M src/backend/parser/parse_utilcmd.c
M src/backend/tcop/pquery.c
M src/backend/utils/adt/date.c
M src/backend/utils/adt/datetime.c
M src/backend/utils/adt/float.c
M src/backend/utils/adt/like_match.c
M src/backend/utils/adt/numeric.c
M src/backend/utils/adt/timestamp.c
M src/backend/utils/adt/varlena.c
M src/include/nodes/parsenodes.h
M src/include/utils/date.h
M src/include/utils/timestamp.h
M src/interfaces/ecpg/preproc/pgc.l
M src/test/regress/expected/boolean.out
M src/test/regress/expected/case.out
M src/test/regress/expected/strings.out
M src/test/regress/input/constraints.source
M src/test/regress/output/constraints.source
M src/test/regress/sql/boolean.sql
M src/test/regress/sql/case.sql
M src/test/regress/sql/strings.sql

Improve error message when an FDW doesn't support WHERE CURRENT OF.

commit   : 6e481ebff6368cb0ab5351a5ef3463747c35af22    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Fri, 19 Apr 2013 16:14:56 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Fri, 19 Apr 2013 16:14:56 -0400    

Click here for diff

If an FDW fails to take special measures with a CurrentOfExpr, we will  
end up trying to execute it as an ordinary qual, which was being treated  
as a purely internal failure condition.  Provide a more user-oriented  
error message for such cases.  

M src/backend/executor/execQual.c

Don't try to pass -I switch to postmaster in contrib/start-scripts/linux.

commit   : 3353583d7ecf7c9f8bc5966ed0a2537dec71ffdc    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Fri, 19 Apr 2013 13:28:45 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Fri, 19 Apr 2013 13:28:45 -0400    

Click here for diff

Undo thinko in commit 87306184580c9c49717b00d48a2f9e717f21e0a8.  
Per bug #8098 from Catherine Devlin.  

M contrib/start-scripts/linux

Fix typo in comment.

commit   : 4580a4bd2c858acf85c578609b8373d730a04534    
  
author   : Robert Haas <rhaas@postgresql.org>    
date     : Fri, 19 Apr 2013 09:32:49 -0400    
  
committer: Robert Haas <rhaas@postgresql.org>    
date     : Fri, 19 Apr 2013 09:32:49 -0400    

Click here for diff

Fabrízio de Royes Mello  

M contrib/hstore/crc32.c

Standardize spelling of "nonblocking"

commit   : acd5803053eb5ff6ad055ac1f7670625f1d111e0    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Thu, 18 Apr 2013 23:35:19 -0400    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
date     : Thu, 18 Apr 2013 23:35:19 -0400    

Click here for diff

Only adjusted the user-exposed messages and documentation,  not all  
source code comments.  

M doc/src/sgml/indexam.sgml
M doc/src/sgml/mvcc.sgml
M src/backend/libpq/pqcomm.c
M src/backend/postmaster/postmaster.c
M src/interfaces/libpq/fe-auth.c
M src/interfaces/libpq/fe-connect.c

pg_upgrade: Add checksum C comment

commit   : 5286963066ce7420d80882528b5f07c28f39eacf    
  
author   : Bruce Momjian <bruce@momjian.us>    
date     : Wed, 17 Apr 2013 17:39:14 -0400    
  
committer: Bruce Momjian <bruce@momjian.us>    
date     : Wed, 17 Apr 2013 17:39:14 -0400    

Click here for diff

We might eventually allow checksum to no-checksum upgrades.  

M contrib/pg_upgrade/controldata.c

sepgsql: Minor improvement to test script, doc fix.

commit   : f050457978f4f8deb1ac850439bf7c46c818f4ae    
  
author   : Robert Haas <rhaas@postgresql.org>    
date     : Wed, 17 Apr 2013 09:55:24 -0400    
  
committer: Robert Haas <rhaas@postgresql.org>    
date     : Wed, 17 Apr 2013 09:55:24 -0400    

Click here for diff

KaiGai Kohei  

M contrib/sepgsql/test_sepgsql
M doc/src/sgml/sepgsql.sgml

sepgsql: One more getObjectIdentity in lieu of getObjectDescription.

commit   : 0bf5c548d64b66b92197c6d8490b9b131ba02269    
  
author   : Robert Haas <rhaas@postgresql.org>    
date     : Wed, 17 Apr 2013 09:52:25 -0400    
  
committer: Robert Haas <rhaas@postgresql.org>    
date     : Wed, 17 Apr 2013 09:52:25 -0400    

Click here for diff

KaiGai Kohei, based on a suggestion from Álvaro Herrera  

M contrib/sepgsql/expected/label.out
M contrib/sepgsql/expected/misc.out
M contrib/sepgsql/proc.c

doc: Update PQgetssl() documentation

commit   : b9bdaf3964a1fbd32e6140eb180dfa82ff1d8f23    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Tue, 16 Apr 2013 21:42:10 -0400    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
date     : Tue, 16 Apr 2013 21:42:10 -0400    

Click here for diff

The return type of PQgetssl() was changed from SSL* to void* a long time  
ago, but the documentation was not updated.  

M doc/src/sgml/libpq.sgml

pgindent: add newline to die() so script line number is not reported on failure.

commit   : d61dddba37c27b1b5157b493bd04913c23ade7c2    
  
author   : Bruce Momjian <bruce@momjian.us>    
date     : Tue, 16 Apr 2013 10:30:31 -0400    
  
committer: Bruce Momjian <bruce@momjian.us>    
date     : Tue, 16 Apr 2013 10:30:31 -0400    

Click here for diff

M src/tools/pgindent/pgindent

Remove some unused and seldom used fields from RelationAmInfo.

commit   : 87ae9e72654ddddf25433b8a178e9268cf03f5b5    
  
author   : Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Tue, 16 Apr 2013 15:01:21 +0300    
  
committer: Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Tue, 16 Apr 2013 15:01:21 +0300    

Click here for diff

This saves some memory from each index relcache entry. At least on a 64-bit  
machine, it saves just enough to shrink a typical relcache entry's memory  
usage from 2k to 1k. That's nice if you have a lot of backends and a lot of  
indexes.  

M src/backend/access/index/indexam.c
M src/include/utils/rel.h

Fix function return type confusion

commit   : c74d586d2fc8aeaa303d8c60a8a9d959fdc5e791    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Mon, 15 Apr 2013 22:33:24 -0400    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
date     : Mon, 15 Apr 2013 22:33:24 -0400    

Click here for diff

When parse_hba_line's return type was changed from bool to a pointer,  
the MANDATORY_AUTH_ARG macro wasn't adjusted.  

M src/backend/libpq/hba.c

Mark json IO and extraction functions immutable.

commit   : d788121aba3425b5d52fe20cc9facb6aca1294ce    
  
author   : Andrew Dunstan <andrew@dunslane.net>    
date     : Mon, 15 Apr 2013 21:46:25 -0400    
  
committer: Andrew Dunstan <andrew@dunslane.net>    
date     : Mon, 15 Apr 2013 21:46:25 -0400    

Click here for diff

Per complaint from Hubert Depesz Lubaczewski.  
  
Catalog version bumped.  

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

Correct handling of NULL arguments in json funcs.

commit   : 728ec9731fb0b3f2de8ce66a394b71c64930f445    
  
author   : Andrew Dunstan <andrew@dunslane.net>    
date     : Mon, 15 Apr 2013 16:20:21 -0400    
  
committer: Andrew Dunstan <andrew@dunslane.net>    
date     : Mon, 15 Apr 2013 16:20:21 -0400    

Click here for diff

Per gripe from Tom Lane.  

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

Improve GiST index search performance for trigram regex queries.

commit   : 410bed2ab8c3864d7f34f9694d080adcaf446352    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Mon, 15 Apr 2013 12:49:29 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Mon, 15 Apr 2013 12:49:29 -0400    

Click here for diff

The initial coding just descended the index if any of the target trigrams  
were possibly present at the next level down.  But actually we can apply  
trigramsMatchGraph() so as to take advantage of AND requirements when there  
are some.  The input data might contain false positive matches, but that  
can only result in a false positive result, not false negative, so it's  
safe to do it this way.  
  
Alexander Korotkov  

M contrib/pg_trgm/trgm_gist.c

Add serial comma

commit   : e08fdf13107b6685047cf055c7966845c8c96f90    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Sun, 14 Apr 2013 11:12:30 -0400    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
date     : Sun, 14 Apr 2013 11:12:30 -0400    

Click here for diff

M src/backend/rewrite/rewriteHandler.c
M src/test/regress/expected/updatable_views.out

pg_ctl: Add idempotent option

commit   : 87306184580c9c49717b00d48a2f9e717f21e0a8    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Sat, 13 Apr 2013 23:42:42 -0400    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
date     : Sat, 13 Apr 2013 23:42:42 -0400    

Click here for diff

This changes the behavior of the start and stop actions to exit  
successfully if the server was already started or stopped.  
  
This changes the default behavior of the start action:  Before, if the  
server was already running, it would print a message and succeed.  Now,  
that situation will result in an error.  When running in idempotent  
mode, no message is printed and pg_ctl exits successfully.  
  
It was considered to just make the idempotent behavior the default and  
only option, but pg_upgrade needs the old behavior.  

M contrib/start-scripts/linux
M doc/src/sgml/ref/pg_ctl-ref.sgml
M src/bin/pg_ctl/pg_ctl.c

Fix sporadic rebuilds for .pc files

commit   : ba66752d278818b6b8797aec2e36cccf727db055    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Fri, 12 Apr 2013 22:45:51 -0400    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
date     : Fri, 12 Apr 2013 22:45:51 -0400    

Click here for diff

The build of .pc (pkg-config) files depends on all makefiles in use, and  
in dependency tracking mode, the previous coding ended up including  
/dev/null as a makefile.  Apparently, on some platforms the modification  
time of /dev/null changes sporadically, and so the .pc files would end  
up being rebuilt every so often.  Fix that by changing the makefile code  
to do without using /dev/null.  

M src/Makefile.global.in

Clean up the mess around EXPLAIN and materialized views.

commit   : 0b337904213337db5026ef0a756a447588023935    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Fri, 12 Apr 2013 19:25:20 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Fri, 12 Apr 2013 19:25:20 -0400    

Click here for diff

Revert the matview-related changes in explain.c's API, as per recent  
complaint from Robert Haas.  The reason for these appears to have been  
principally some ill-considered choices around having intorel_startup do  
what ought to be parse-time checking, plus a poor arrangement for passing  
it the view parsetree it needs to store into pg_rewrite when creating a  
materialized view.  Do the latter by having parse analysis stick a copy  
into the IntoClause, instead of doing it at runtime.  (On the whole,  
I seriously question the choice to represent CREATE MATERIALIZED VIEW as a  
variant of SELECT INTO/CREATE TABLE AS, because that means injecting even  
more complexity into what was already a horrid legacy kluge.  However,  
I didn't go so far as to rethink that choice ... yet.)  
  
I also moved several error checks into matview parse analysis, and  
made the check for external Params in a matview more accurate.  
  
In passing, clean things up a bit more around interpretOidsOption(),  
and fix things so that we can use that to force no-oids for views,  
sequences, etc, thereby eliminating the need to cons up "oids = false"  
options when creating them.  
  
catversion bump due to change in IntoClause.  (I wonder though if we  
really need readfuncs/outfuncs support for IntoClause anymore.)  

M src/backend/commands/createas.c
M src/backend/commands/explain.c
M src/backend/commands/prepare.c
M src/backend/commands/sequence.c
M src/backend/commands/tablecmds.c
M src/backend/commands/typecmds.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/parser/analyze.c
M src/backend/parser/gram.y
M src/backend/parser/parse_clause.c
M src/backend/parser/parse_param.c
M src/backend/parser/parse_relation.c
M src/backend/parser/parse_utilcmd.c
M src/include/catalog/catversion.h
M src/include/commands/createas.h
M src/include/commands/explain.h
M src/include/commands/tablecmds.h
M src/include/nodes/primnodes.h
M src/include/parser/parse_clause.h
M src/include/parser/parse_param.h
M src/include/parser/parse_relation.h

pgindent: improve error messages

commit   : 5003f94f661d3eff0c44774576fe2f1ae202da86    
  
author   : Bruce Momjian <bruce@momjian.us>    
date     : Fri, 12 Apr 2013 15:25:33 -0400    
  
committer: Bruce Momjian <bruce@momjian.us>    
date     : Fri, 12 Apr 2013 15:25:33 -0400    

Click here for diff

per suggestion from Gurjeet Singh  

M src/tools/pgindent/pgindent

pgindent: fix downloading of BSD indent binary

commit   : 8daa4e960e15eb31e141585968c91cc666889585    
  
author   : Bruce Momjian <bruce@momjian.us>    
date     : Fri, 12 Apr 2013 11:42:27 -0400    
  
committer: Bruce Momjian <bruce@momjian.us>    
date     : Fri, 12 Apr 2013 11:42:27 -0400    

Click here for diff

Also fix accessing pgentab binary and tar.  
  
Gurjeet Singh  

M src/tools/pgindent/pgindent

sepgsql: Enforce db_procedure:{execute} permission.

commit   : f8a54e936bdf4c31b395a2ab7d7bc98eefa6dbad    
  
author   : Robert Haas <rhaas@postgresql.org>    
date     : Fri, 12 Apr 2013 08:55:56 -0400    
  
committer: Robert Haas <rhaas@postgresql.org>    
date     : Fri, 12 Apr 2013 08:55:56 -0400    

Click here for diff

To do this, we add an additional object access hook type,  
OAT_FUNCTION_EXECUTE.  
  
KaiGai Kohei  

M contrib/sepgsql/expected/label.out
M contrib/sepgsql/expected/misc.out
M contrib/sepgsql/hooks.c
M contrib/sepgsql/label.c
M contrib/sepgsql/proc.c
M contrib/sepgsql/sepgsql-regtest.te
M contrib/sepgsql/sepgsql.h
M contrib/sepgsql/sql/label.sql
M contrib/sepgsql/sql/misc.sql
M doc/src/sgml/sepgsql.sgml
M src/backend/catalog/objectaccess.c
M src/backend/executor/execQual.c
M src/backend/executor/nodeAgg.c
M src/backend/executor/nodeWindowAgg.c
M src/backend/tcop/fastpath.c
M src/include/catalog/objectaccess.h

Minor wording corrections for object-access hook stuff.

commit   : d017bf41a32d08885f00a274603ed2e50816fe7f    
  
author   : Robert Haas <rhaas@postgresql.org>    
date     : Fri, 12 Apr 2013 08:39:38 -0400    
  
committer: Robert Haas <rhaas@postgresql.org>    
date     : Fri, 12 Apr 2013 08:39:38 -0400    

Click here for diff

KaiGai Kohei  

M src/backend/catalog/objectaccess.c
M src/include/catalog/objectaccess.h

sepgql: Use getObjectIdentity rather than getObjectDescription.

commit   : b620fdabba3fd3c00587fb586f74eb7dc6eca223    
  
author   : Robert Haas <rhaas@postgresql.org>    
date     : Fri, 12 Apr 2013 08:35:55 -0400    
  
committer: Robert Haas <rhaas@postgresql.org>    
date     : Fri, 12 Apr 2013 08:35:55 -0400    

Click here for diff

KaiGai Kohei, based on a suggestion from Álvaro Herrera  

M contrib/sepgsql/database.c
M contrib/sepgsql/dml.c
M contrib/sepgsql/expected/alter.out
M contrib/sepgsql/expected/ddl.out
M contrib/sepgsql/proc.c
M contrib/sepgsql/relation.c
M contrib/sepgsql/schema.c

Document that git_changelog needs updating for major version stamping.

commit   : be55f3b85966034028a8f162b8a6ca1deca66103    
  
author   : Bruce Momjian <bruce@momjian.us>    
date     : Thu, 11 Apr 2013 12:27:02 -0400    
  
committer: Bruce Momjian <bruce@momjian.us>    
date     : Thu, 11 Apr 2013 12:27:02 -0400    

Click here for diff

M src/tools/RELEASE_CHANGES

Remove quotes around SQL statement in error message

commit   : 6cd18a88b604ec2a9940d894f36e1bfdb22daf78    
  
author   : Alvaro Herrera <alvherre@alvh.no-ip.org>    
date     : Thu, 11 Apr 2013 12:00:09 -0300    
  
committer: Alvaro Herrera <alvherre@alvh.no-ip.org>    
date     : Thu, 11 Apr 2013 12:00:09 -0300    

Click here for diff

M src/backend/commands/event_trigger.c
M src/test/regress/expected/event_trigger.out

Fix confusion between ObjectType and ObjectClass

commit   : 6a76edb1880d99744453dd275f30e0361281caab    
  
author   : Alvaro Herrera <alvherre@alvh.no-ip.org>    
date     : Thu, 11 Apr 2013 11:59:47 -0300    
  
committer: Alvaro Herrera <alvherre@alvh.no-ip.org>    
date     : Thu, 11 Apr 2013 11:59:47 -0300    

Click here for diff

Per report by Will Leinweber and Peter Eisentraut  

M src/backend/catalog/dependency.c
M src/backend/commands/event_trigger.c
M src/include/commands/event_trigger.h

doc: Update DTrace information

commit   : 82b55c9769ac1ae6146ab34b6e5fe49251e79a90    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Wed, 10 Apr 2013 23:05:13 -0400    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
date     : Wed, 10 Apr 2013 23:05:13 -0400    

Click here for diff

The old web site link no longer worked, and some information was  
outdated.  

M doc/src/sgml/monitoring.sgml

Update the description for the graphical installers

commit   : d334b337b41e0c2e660324af2502dc9a5a691a02    
  
author   : Magnus Hagander <magnus@hagander.net>    
date     : Wed, 10 Apr 2013 21:37:49 +0200    
  
committer: Magnus Hagander <magnus@hagander.net>    
date     : Wed, 10 Apr 2013 21:37:49 +0200    

Click here for diff

Remove references to "one click", as we're not supposed to call  
them that anymore.  

M doc/src/sgml/install-windows.sgml
M doc/src/sgml/pgupgrade.sgml

Fix SIGUSR1 handling by unconnected bgworkers

commit   : f62ab623adc63023c6aee22e2a6fe190439ca0c3    
  
author   : Alvaro Herrera <alvherre@alvh.no-ip.org>    
date     : Wed, 10 Apr 2013 16:01:16 -0300    
  
committer: Alvaro Herrera <alvherre@alvh.no-ip.org>    
date     : Wed, 10 Apr 2013 16:01:16 -0300    

Click here for diff

Latch activity was not being detected by non-database-connected workers; the  
SIGUSR1 signal handler which is normally in charge of that was set to SIG_IGN.  
Create a simple handler to call latch_sigusr1_handler instead.  
  
Robert Haas (bug report and suggested fix)  

M src/backend/postmaster/postmaster.c

Fix SIGHUP handling by unconnected bgworkers

commit   : 61a7d576f2a287ef59071da9d9d7a0cd473ed98b    
  
author   : Alvaro Herrera <alvherre@alvh.no-ip.org>    
date     : Wed, 10 Apr 2013 15:59:45 -0300    
  
committer: Alvaro Herrera <alvherre@alvh.no-ip.org>    
date     : Wed, 10 Apr 2013 15:59:45 -0300    

Click here for diff

Add a SignalUnconnectedWorkers() call so that non-database-connected background  
workers are also notified when postmaster is SIGHUPped.  Previously, only  
database-connected workers were.  
  
Michael Paquier (bug report and fix)  

M src/backend/postmaster/postmaster.c

Make contrib/pg_trgm also support regex searches with GiST indexes.

commit   : 6f5b8beb64d481c28a483090d10099c8d619c797    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Wed, 10 Apr 2013 13:30:14 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Wed, 10 Apr 2013 13:30:14 -0400    

Click here for diff

This wasn't addressed in the original patch, but it doesn't take very  
much additional code to cover the case, so let's get it done.  
  
Since pg_trgm 1.1 hasn't been released yet, I just changed the definition  
of what's in it, rather than inventing a 1.2.  

M contrib/pg_trgm/expected/pg_trgm.out
M contrib/pg_trgm/pg_trgm–1.0–1.1.sql
M contrib/pg_trgm/pg_trgm–1.1.sql
M contrib/pg_trgm/sql/pg_trgm.sql
M contrib/pg_trgm/trgm.h
M contrib/pg_trgm/trgm_gin.c
M contrib/pg_trgm/trgm_gist.c
M contrib/pg_trgm/trgm_op.c
M contrib/pg_trgm/trgm_regexp.c
M doc/src/sgml/pgtrgm.sgml

Make worker_spi sample code more complete

commit   : e543631f3c162ab5f6020b1d0209e0353ca2229a    
  
author   : Alvaro Herrera <alvherre@alvh.no-ip.org>    
date     : Wed, 10 Apr 2013 13:29:25 -0300    
  
committer: Alvaro Herrera <alvherre@alvh.no-ip.org>    
date     : Wed, 10 Apr 2013 13:29:25 -0300    

Click here for diff

Make use of some GUC variables, and add SIGHUP handling to reload  
the config file.  Patch submitted by Guillaume Lelarge.  
  
Also, report to pg_stat_activity.  Per report from Marc Cousin, add  
setting of statement start time.  

M contrib/worker_spi/worker_spi.c

Fix hstore_to_json_loose example in docs.

commit   : 66c01707c6ac9ce7cc7a7e45d0892f6506f1680b    
  
author   : Andrew Dunstan <andrew@dunslane.net>    
date     : Wed, 10 Apr 2013 09:26:46 -0400    
  
committer: Andrew Dunstan <andrew@dunslane.net>    
date     : Wed, 10 Apr 2013 09:26:46 -0400    

Click here for diff

Marti Raudsepp.  

M doc/src/sgml/hstore.sgml

Remove duplicate initialization in XLogReadRecord.

commit   : 4cff7b9dd6d39ed5f6bb3914870c7d0602f88242    
  
author   : Robert Haas <rhaas@postgresql.org>    
date     : Tue, 9 Apr 2013 23:58:02 -0400    
  
committer: Robert Haas <rhaas@postgresql.org>    
date     : Tue, 9 Apr 2013 23:58:02 -0400    

Click here for diff

Per a note from Dickson S. Guedes.  

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

Create a distinction between a populated matview and a scannable one.

commit   : 52e6e33ab495cb2b0e694ee480ba7c6394315053    
  
author   : Kevin Grittner <kgrittn@postgresql.org>    
date     : Tue, 9 Apr 2013 13:02:49 -0500    
  
committer: Kevin Grittner <kgrittn@postgresql.org>    
date     : Tue, 9 Apr 2013 13:02:49 -0500    

Click here for diff

The intent was that being populated would, long term, be just one  
of the conditions which could affect whether a matview was  
scannable; being populated should be necessary but not always  
sufficient to scan the relation.  Since only CREATE and REFRESH  
currently determine the scannability, names and comments  
accidentally conflated these concepts, leading to confusion.  
  
Also add missing locking for the SQL function which allows a  
test for scannability, and fix a modularity violatiion.  
  
Per complaints from Tom Lane, although its not clear that these  
will satisfy his concerns.  Hopefully this will at least better  
frame the discussion.  

M src/backend/commands/cluster.c
M src/backend/commands/createas.c
M src/backend/commands/matview.c
M src/backend/executor/execMain.c
M src/backend/rewrite/rewriteHandler.c
M src/backend/utils/adt/dbsize.c
M src/backend/utils/cache/relcache.c
M src/bin/pg_dump/pg_dump.c
M src/include/commands/matview.h
M src/include/utils/rel.h

Adjust ExplainOneQuery_hook_type to take a DestReceiver argument.

commit   : 0bf42a5f3b62cde41cb366d3442585429c6d9c50    
  
author   : Robert Haas <rhaas@postgresql.org>    
date     : Tue, 9 Apr 2013 10:13:38 -0400    
  
committer: Robert Haas <rhaas@postgresql.org>    
date     : Tue, 9 Apr 2013 10:13:38 -0400    

Click here for diff

The materialized views patch adjusted ExplainOneQuery to take an  
additional DestReceiver argument, but failed to add a matching  
argument to the definition of ExplainOneQuery_hook.  This is a  
problem for users of the hook that want to call ExplainOnePlan.  
Fix by adding the missing argument.  

M src/backend/commands/explain.c
M src/include/commands/explain.h

Support indexing of regular-expression searches in contrib/pg_trgm.

commit   : 3ccae48f44d993351e1f881761bd6c556ebd6638    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Tue, 9 Apr 2013 01:05:55 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Tue, 9 Apr 2013 01:05:55 -0400    

Click here for diff

This works by extracting trigrams from the given regular expression,  
in generally the same spirit as the previously-existing support for  
LIKE searches, though of course the details are far more complicated.  
  
Currently, only GIN indexes are supported.  We might be able to make  
it work with GiST indexes later.  
  
The implementation includes adding API functions to backend/regex/  
to provide a view of the search NFA created from a regular expression.  
These functions are meant to be generic enough to be supportable in  
a standalone version of the regex library, should that ever happen.  
  
Alexander Korotkov, reviewed by Heikki Linnakangas and Tom Lane  

M contrib/pg_trgm/Makefile
M contrib/pg_trgm/expected/pg_trgm.out
A contrib/pg_trgm/pg_trgm–1.0–1.1.sql
R095 contrib/pg_trgm/pg_trgm–1.0.sql contrib/pg_trgm/pg_trgm–1.1.sql
M contrib/pg_trgm/pg_trgm.control
M contrib/pg_trgm/sql/pg_trgm.sql
M contrib/pg_trgm/trgm.h
M contrib/pg_trgm/trgm_gin.c
M contrib/pg_trgm/trgm_op.c
A contrib/pg_trgm/trgm_regexp.c
M doc/src/sgml/pgtrgm.sgml
M src/backend/regex/Makefile
M src/backend/regex/README
A src/backend/regex/regexport.c
M src/backend/utils/adt/selfuncs.c
M src/include/mb/pg_wchar.h
A src/include/regex/regexport.h

Minor rewording of README comments

commit   : e60d20a35e436cef3c454bfeab34d8ea71b54910    
  
author   : Simon Riggs <simon@2ndQuadrant.com>    
date     : Mon, 8 Apr 2013 17:20:26 +0100    
  
committer: Simon Riggs <simon@2ndQuadrant.com>    
date     : Mon, 8 Apr 2013 17:20:26 +0100    

Click here for diff

M src/backend/storage/page/README

Fix calculation of how many segments to retain for wal_keep_segments.

commit   : 594041311c8263832258d35632aa3eebf9371fd1    
  
author   : Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Mon, 8 Apr 2013 16:26:52 +0300    
  
committer: Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Mon, 8 Apr 2013 16:26:52 +0300    

Click here for diff

KeepLogSeg function was broken when we switched to use a 64-bit int for the  
segment number.  
  
Per report from Jeff Janes.  

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

Skip extraneous locking in XLogCheckBuffer(). Heikki reported comment was wrong, so fixed code to match the comment: we only need to take additional locking precautions when we have a shared lock on the buffer.

commit   : 5787c6730e7a848ef95d5c4194e27614ea8e6e41    
  
author   : Simon Riggs <simon@2ndQuadrant.com>    
date     : Mon, 8 Apr 2013 09:11:49 +0100    
  
committer: Simon Riggs <simon@2ndQuadrant.com>    
date     : Mon, 8 Apr 2013 09:11:49 +0100    

Click here for diff

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

commit   : 47c4333189c9eb5ac1f95adc90213e61996f53c4    
  
author   : Simon Riggs <simon@2ndQuadrant.com>    
date     : Mon, 8 Apr 2013 08:52:39 +0100    
  
committer: Simon Riggs <simon@2ndQuadrant.com>    
date     : Mon, 8 Apr 2013 08:52:39 +0100    

Click here for diff

Andres Freund  
  
Bug report by Fujii Masao, testing by Jeff Janes and Jaime Casanova,  
review by Jeff Davis and Simon Riggs. Applied with changes from review  
and some comment editing.  

M src/backend/access/rmgrdesc/xlogdesc.c
M src/backend/access/transam/xlog.c
M src/backend/storage/buffer/bufmgr.c
M src/include/catalog/catversion.h

README comments on checksums on page holes.

commit   : a4b94b85156192b839a3c840f8aaf0cf8699a8c8    
  
author   : Simon Riggs <simon@2ndQuadrant.com>    
date     : Mon, 8 Apr 2013 08:42:52 +0100    
  
committer: Simon Riggs <simon@2ndQuadrant.com>    
date     : Mon, 8 Apr 2013 08:42:52 +0100    

Click here for diff

M src/backend/storage/page/README

Tune BufferGetLSNAtomic() when checksums !enabled

commit   : 1be203519ac4da238bf6dfe8f7015d5780723e0f    
  
author   : Simon Riggs <simon@2ndQuadrant.com>    
date     : Sun, 7 Apr 2013 22:37:39 +0100    
  
committer: Simon Riggs <simon@2ndQuadrant.com>    
date     : Sun, 7 Apr 2013 22:37:39 +0100    

Click here for diff

From performance analysis by Heikki Linnakangas  

M src/backend/storage/buffer/bufmgr.c

Fix checksums for CLUSTER, VACUUM FULL etc. In CLUSTER, VACUUM FULL and ALTER TABLE SET TABLESPACE I erroneously set checksum before log_newpage, which sets the LSN and invalidates the checksum. So set checksum immediately *after* log_newpage.

commit   : cf8dc9e10c0d954970cbe5ca9be4c6b881cde482    
  
author   : Simon Riggs <simon@2ndQuadrant.com>    
date     : Sun, 7 Apr 2013 22:16:51 +0100    
  
committer: Simon Riggs <simon@2ndQuadrant.com>    
date     : Sun, 7 Apr 2013 22:16:51 +0100    

Click here for diff

Bug report Fujii Masao, Fix and patch by Jeff Davis  

M src/backend/access/heap/rewriteheap.c
M src/backend/commands/tablecmds.c

Get rid of USE_WIDE_UPPER_LOWER dependency in trigram construction.

commit   : 7844608e54a3a2e3dee461b00fd6ef028a845d7c    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sun, 7 Apr 2013 14:45:33 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sun, 7 Apr 2013 14:45:33 -0400    

Click here for diff

contrib/pg_trgm's make_trigrams() was coded to ignore multibyte character  
boundaries and just make trigrams from bytes if USE_WIDE_UPPER_LOWER wasn't  
defined.  This is a bit odd, since there's no obvious reason why trigram  
compaction rules should depend on the presence of towlower() and friends.  
What's more, there was an Assert() that would fail if that code path was  
fed any multibyte characters.  
  
We need to do something about this since the pending regex-indexing patch  
has an assumption that you get just one "trgm" from any three characters.  
The best solution seems to be to remove the USE_WIDE_UPPER_LOWER  
dependency, which shouldn't really have been there in the first place.  
The second loop in make_trigrams() is now just a fast path and not a  
potentially incompatible algorithm.  
  
If there is anybody still using Postgres on machines without wcstombs() or  
towlower(), and they have non-ASCII data indexed by pg_trgm, they'll need  
to REINDEX those indexes after pg_upgrade to 9.3, else searches may fail  
incorrectly. It seems likely that there are no such installations, though.  
  
In passing, rename cnt_trigram to compact_trigram, which seems to better  
describe its functionality, and improve make_trigrams' test for whether it  
has to use the slow path or not (per a suggestion from Alexander Korotkov).  

M contrib/pg_trgm/trgm_op.c

In isolationtester, retry after EINTR return from select(2).

commit   : faf4726c9fd5748ad25dbce55a7d31deeabe9866    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sat, 6 Apr 2013 22:28:49 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sat, 6 Apr 2013 22:28:49 -0400    

Click here for diff

Per report from Jaime Casanova.  Very curious that no one else has seen  
this failure ... but the code is clearly wrong as-is.  

M src/test/isolation/isolationtester.c

sepgsql: Enforce db_schema:search permission.

commit   : e965e6344cfaff0708a032721b56f61eea777bc5    
  
author   : Robert Haas <rhaas@postgresql.org>    
date     : Fri, 5 Apr 2013 08:51:31 -0400    
  
committer: Robert Haas <rhaas@postgresql.org>    
date     : Fri, 5 Apr 2013 08:51:31 -0400    

Click here for diff

KaiGai Kohei, with comment and doc wordsmithing by me  

M contrib/sepgsql/expected/alter.out
M contrib/sepgsql/expected/ddl.out
M contrib/sepgsql/expected/dml.out
M contrib/sepgsql/hooks.c
M contrib/sepgsql/schema.c
M contrib/sepgsql/sepgsql-regtest.te
M contrib/sepgsql/sepgsql.h
M contrib/sepgsql/sql/dml.sql
M doc/src/sgml/sepgsql.sgml
M src/backend/catalog/namespace.c
M src/backend/catalog/objectaccess.c
M src/backend/tcop/fastpath.c
M src/include/catalog/objectaccess.h

Improve documentation about the relationship of extensions and schemas.

commit   : 52f436b807b0d02203ea6be19bafa56e4e1381e8    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 4 Apr 2013 22:37:25 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 4 Apr 2013 22:37:25 -0400    

Click here for diff

There's been some confusion expressed about this point, so clarify.  
Extended version of a patch by David Wheeler.  

M doc/src/sgml/extend.sgml
M doc/src/sgml/ref/create_extension.sgml

doc: Fix number of columns in table

commit   : e3f719c3671c293bf9e1a7293c7bd5eb6d9a2611    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Thu, 4 Apr 2013 21:07:05 -0400    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
date     : Thu, 4 Apr 2013 21:07:05 -0400    

Click here for diff

M doc/src/sgml/event-trigger.sgml

Fix line count in slashUsage().

commit   : 927e1dc96ce3eb4a618fd7b67f69eec72b56d850    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 4 Apr 2013 20:29:46 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 4 Apr 2013 20:29:46 -0400    

Click here for diff

Counting newlines shows that quite a few recent patches have neglected  
to update the output-lines count given to PageOutput().  Fortunately  
it's not terribly critical that this be exact, since we long since  
exceeded the height of most people's terminal windows.  Still, maybe  
we ought to think of a way to not have to maintain this manually anymore.  

M src/bin/psql/help.c

Add \watch [SEC] command to psql.

commit   : c6a3fce7dd4dae6e1a005e5b09cdd7c1d7f9c4f4    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 4 Apr 2013 19:56:33 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 4 Apr 2013 19:56:33 -0400    

Click here for diff

This allows convenient re-execution of commands.  
  
Will Leinweber, reviewed by Peter Eisentraut, Daniel Farina, and Tom Lane  

M doc/src/sgml/ref/psql-ref.sgml
M src/bin/psql/command.c
M src/bin/psql/help.c
M src/bin/psql/tab-complete.c

Fix off by one error in JSON extract path code.

commit   : e75feb28341ea49e9d41266906e701a4e3742e2e    
  
author   : Andrew Dunstan <andrew@dunslane.net>    
date     : Thu, 4 Apr 2013 18:26:52 -0400    
  
committer: Andrew Dunstan <andrew@dunslane.net>    
date     : Thu, 4 Apr 2013 18:26:52 -0400    

Click here for diff

Bug report by David Wheeler, diagnosis assistance from Tom Lane.  

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

psql: fix startup crash caused by PSQLRC containing a tilde

commit   : 48a2cd370e2610f0a196240aed9f5abd82d3dada    
  
author   : Bruce Momjian <bruce@momjian.us>    
date     : Thu, 4 Apr 2013 12:56:21 -0400    
  
committer: Bruce Momjian <bruce@momjian.us>    
date     : Thu, 4 Apr 2013 12:56:21 -0400    

Click here for diff

'strdup' the PSQLRC environment variable value before calling a routine  
that might free() it.  
  
Backpatch to 9.2, where the bug first appeared.  

M src/bin/psql/common.c
M src/bin/psql/common.h
M src/bin/psql/startup.c

Fix crash on compiling a regular expression with more than 32k colors.

commit   : bf2b0a147857f63daa2e5c17eed0169861371af8    
  
author   : Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Thu, 4 Apr 2013 19:04:57 +0300    
  
committer: Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Thu, 4 Apr 2013 19:04:57 +0300    

Click here for diff

Throw an error instead.  
  
Backpatch to all supported branches.  

M src/backend/regex/regc_color.c
M src/include/regex/regerrs.h
M src/include/regex/regex.h
M src/include/regex/regguts.h

Fix a few thinkos in the JSON functions docs.

commit   : d7d5832012ae5174707643af1a450d26d3350719    
  
author   : Andrew Dunstan <andrew@dunslane.net>    
date     : Thu, 4 Apr 2013 10:41:29 -0400    
  
committer: Andrew Dunstan <andrew@dunslane.net>    
date     : Thu, 4 Apr 2013 10:41:29 -0400    

Click here for diff

Dickson S. Guedes  

M doc/src/sgml/func.sgml

Calculate # of semaphores correctly with --disable-spinlocks.

commit   : b8ed4cc9627de437e5eafdb81631a0d0f063abb3    
  
author   : Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Thu, 4 Apr 2013 16:31:44 +0300    
  
committer: Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Thu, 4 Apr 2013 16:31:44 +0300    

Click here for diff

The old formula didn't take into account that each WAL sender process needs  
a spinlock. We had also already exceeded the fixed number of spinlocks  
reserved for misc purposes (10). Bump that to 30.  
  
Backpatch to 9.0, where WAL senders were introduced. If I counted correctly,  
9.0 had exactly 10 predefined spinlocks, and 9.1 exceeded that, but bump the  
limit in 9.0 too because 10 is uncomfortably close to the edge.  

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

Avoid updating our PgBackendStatus entry when track_activities is off.

commit   : f7b0006f42913b6d641c9f0bef6fad1f670b9194    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Wed, 3 Apr 2013 14:13:28 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Wed, 3 Apr 2013 14:13:28 -0400    

Click here for diff

The point of turning off track_activities is to avoid this reporting  
overhead, but a thinko in commit 4f42b546fd87a80be30c53a0f2c897acb826ad52  
caused pgstat_report_activity() to perform half of its updates anyway.  
Fix that, and also make sure that we clear all the now-disabled fields  
when transitioning to the non-reporting state.  

M src/backend/postmaster/pgstat.c
M src/backend/utils/adt/pgstatfuncs.c

Fix typo in FDW docs.

commit   : 0f1345d38b4d7b35175d4f4be322da0aa6d6aaeb    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Wed, 3 Apr 2013 10:26:18 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Wed, 3 Apr 2013 10:26:18 -0400    

Click here for diff

Laurenz Albe  

M doc/src/sgml/fdwhandler.sgml

Minor robustness improvements for isolationtester.

commit   : 845d335a90b684dd51e80a6470ebb923a59a1f91    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Tue, 2 Apr 2013 21:15:37 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Tue, 2 Apr 2013 21:15:37 -0400    

Click here for diff

Notice and complain about PQcancel() failures.  Also, don't dump core if  
an error PGresult doesn't contain severity and message subfields, as it  
might not if it was generated by libpq itself.  (We have a longstanding  
TODO item to improve that, but in the meantime isolationtester had better  
cope.)  
  
I tripped across the latter item while investigating a trouble report on  
buildfarm member spoonbill.  As for the former, there's no evidence that  
PQcancel failure is actually involved in spoonbill's problem, but it still  
seems like a bad idea to ignore an error return code.  

M src/test/isolation/isolationtester.c

Update release notes for 9.2.4, 9.1.9, 9.0.13, 8.4.17.

commit   : 89b661bab99e8573fad271f68755ba286932dec2    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Mon, 1 Apr 2013 14:11:11 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Mon, 1 Apr 2013 14:11:11 -0400    

Click here for diff

Security: CVE-2013-1899, CVE-2013-1901  

M doc/src/sgml/release-9.0.sgml
M doc/src/sgml/release-9.1.sgml
M doc/src/sgml/release-9.2.sgml

Fix insecure parsing of server command-line switches.

commit   : 17fe2793ea7fe269ed616cb305150b6cf38dbaa8    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Mon, 1 Apr 2013 14:00:51 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Mon, 1 Apr 2013 14:00:51 -0400    

Click here for diff

An oversight in commit e710b65c1c56ca7b91f662c63d37ff2e72862a94 allowed  
database names beginning with "-" to be treated as though they were secure  
command-line switches; and this switch processing occurs before client  
authentication, so that even an unprivileged remote attacker could exploit  
the bug, needing only connectivity to the postmaster's port.  Assorted  
exploits for this are possible, some requiring a valid database login,  
some not.  The worst known problem is that the "-r" switch can be invoked  
to redirect the process's stderr output, so that subsequent error messages  
will be appended to any file the server can write.  This can for example be  
used to corrupt the server's configuration files, so that it will fail when  
next restarted.  Complete destruction of database tables is also possible.  
  
Fix by keeping the database name extracted from a startup packet fully  
separate from command-line switches, as had already been done with the  
user name field.  
  
The Postgres project thanks Mitsumasa Kondo for discovering this bug,  
Kyotaro Horiguchi for drafting the fix, and Noah Misch for recognizing  
the full extent of the danger.  
  
Security: CVE-2013-1899  

M src/backend/main/main.c
M src/backend/postmaster/postmaster.c
M src/backend/tcop/postgres.c
M src/backend/utils/init/postinit.c
M src/include/tcop/tcopprot.h

Make REPLICATION privilege checks test current user not authenticated user.

commit   : ce9ab88981495d975aade8fc664f99f68fc18e2b    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Mon, 1 Apr 2013 13:09:24 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Mon, 1 Apr 2013 13:09:24 -0400    

Click here for diff

The pg_start_backup() and pg_stop_backup() functions checked the privileges  
of the initially-authenticated user rather than the current user, which is  
wrong.  For example, a user-defined index function could successfully call  
these functions when executed by ANALYZE within autovacuum.  This could  
allow an attacker with valid but low-privilege database access to interfere  
with creation of routine backups.  Reported and fixed by Noah Misch.  
  
Security: CVE-2013-1901  

M src/backend/access/transam/xlog.c
M src/backend/utils/init/miscinit.c
M src/backend/utils/init/postinit.c
M src/include/miscadmin.h

commit   : 85079078acb4f120335f54f38f93635dd8c8b83d    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Sun, 31 Mar 2013 23:50:51 -0400    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
date     : Sun, 31 Mar 2013 23:50:51 -0400    

Click here for diff

This reverts commit 3780fc679cc428c1f211e1728c4281ca15e9746b.  
  
HP-UX didn't like it.  There would probably be a way to fix that, but  
since the net effect of all of this is zero because ecpg ends up using  
libpq anyway, it's not worth bothering further.  

M src/interfaces/ecpg/compatlib/Makefile

Update release notes for changes through today.

commit   : e48a7bd527481556f7068832331ef6b00805920b    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sun, 31 Mar 2013 18:59:35 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sun, 31 Mar 2013 18:59:35 -0400    

Click here for diff

M doc/src/sgml/release-9.0.sgml
M doc/src/sgml/release-9.1.sgml
M doc/src/sgml/release-9.2.sgml

Ignore extra subquery outputs in set_subquery_size_estimates().

commit   : d931ac0ec4c25b61f480562a13f1974f913afd59    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sun, 31 Mar 2013 18:32:54 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sun, 31 Mar 2013 18:32:54 -0400    

Click here for diff

In commit 0f61d4dd1b4f95832dcd81c9688dac56fd6b5687, I added code to copy up  
column width estimates for each column of a subquery.  That code supposed  
that the subquery couldn't have any output columns that didn't correspond  
to known columns of the current query level --- which is true when a query  
is parsed from scratch, but the assumption fails when planning a view that  
depends on another view that's been redefined (adding output columns) since  
the upper view was made.  This results in an assertion failure or even a  
crash, as per bug #8025 from lindebg.  Remove the Assert and instead skip  
the column if its resno is out of the expected range.  

M src/backend/optimizer/path/costsize.c

Add pkg-config files for libpq and ecpg libraries

commit   : 64f890905f3a5186bc4df980c8becfda5c39c2ea    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Sun, 31 Mar 2013 16:58:40 -0400    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
date     : Sun, 31 Mar 2013 16:58:40 -0400    

Click here for diff

This will hopefully be easier to use than pg_config for users who are  
already used to the pkg-config interface.  It also works better for  
multi-arch installations.  
  
reviewed by Tom Lane  

M .gitignore
M doc/src/sgml/ecpg.sgml
M doc/src/sgml/libpq.sgml
M src/Makefile.shlib
M src/interfaces/ecpg/compatlib/Makefile
M src/interfaces/ecpg/ecpglib/Makefile

commit   : 3780fc679cc428c1f211e1728c4281ca15e9746b    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Sun, 31 Mar 2013 16:51:00 -0400    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
date     : Sun, 31 Mar 2013 16:51:00 -0400    

Click here for diff

It doesn't actually use libpq.  But we need to keep libpq in the  
CPPFLAGS for building, because compatlib uses ecpglib.h which uses  
libpq-fe.h, but we don't need to refer to libpq for linking.  
  
reviewed by Tom Lane  

M src/interfaces/ecpg/compatlib/Makefile

commit   : 203d8ae2db4cf255b94520fdc1521b5f96778596    
  
author   : Bruce Momjian <bruce@momjian.us>    
date     : Sat, 30 Mar 2013 22:20:53 -0400    
  
committer: Bruce Momjian <bruce@momjian.us>    
date     : Sat, 30 Mar 2013 22:20:53 -0400    

Click here for diff

Now that pg_dump no longer dumps invalid indexes, per commit  
683abc73dff549e94555d4020dae8d02f32ed78b, have pg_upgrade also skip  
them.  Previously pg_upgrade threw an error if invalid indexes existed.  
  
Backpatch to 9.2, 9.1, and 9.0 (where pg_upgrade was added to git)  

M contrib/pg_upgrade/check.c
M contrib/pg_upgrade/info.c

Improve code documentation about "magnetic disk" storage manager.

commit   : 22f7b9613e5a60bc3daca35f87f546baa9fd934c    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sat, 30 Mar 2013 14:23:45 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sat, 30 Mar 2013 14:23:45 -0400    

Click here for diff

The modern incarnation of md.c is by no means specific to magnetic disk  
technology, but every so often we hear from someone who's misled by the  
label.  Try to clarify that it will work for anything that supports  
standard filesystem operations.  Per suggestion from Andrew Dunstan.  

M src/backend/storage/smgr/README
M src/backend/storage/smgr/md.c

Avoid moving data directory in upgrade testing.

commit   : 67eb3e5075b52bb9d91dc3bd9358ac1da2ded5fc    
  
author   : Andrew Dunstan <andrew@dunslane.net>    
date     : Sat, 30 Mar 2013 12:44:29 -0400    
  
committer: Andrew Dunstan <andrew@dunslane.net>    
date     : Sat, 30 Mar 2013 12:44:29 -0400    

Click here for diff

Windows sometimes gets upset if we rename a large directory and then try  
to use the old name quickly, as seen in occasional buildfarm failures.  
So we avoid that by building the old version in the intended  
destination in the first place instead of renaming it, similar to the  
change made for the same reason in commit b7f8465c.  

M contrib/pg_upgrade/test.sh

Remove tab from SGML file.

commit   : b015558091075a898a8348934f1d36386d87f5e5    
  
author   : Bruce Momjian <bruce@momjian.us>    
date     : Fri, 29 Mar 2013 23:19:03 -0400    
  
committer: Bruce Momjian <bruce@momjian.us>    
date     : Fri, 29 Mar 2013 23:19:03 -0400    

Click here for diff

M doc/src/sgml/func.sgml

ecpg: Parallel make fix

commit   : 602070f9cce790debd8d1469254e7726ab499ae7    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Fri, 29 Mar 2013 21:39:55 -0400    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
date     : Fri, 29 Mar 2013 21:39:55 -0400    

Click here for diff

In some parallel make situations, the install-headers target could be  
called before the installation directories are created by installdirs,  
causing the installation to fail.  Fix that by making install-headers  
depend on installdirs.  

M src/interfaces/ecpg/include/Makefile

Fix page title for JSON Functions and Operators.

commit   : 6caf759f3f34eb496f4a92c3db9d3289299066b9    
  
author   : Andrew Dunstan <andrew@dunslane.net>    
date     : Fri, 29 Mar 2013 16:56:22 -0400    
  
committer: Andrew Dunstan <andrew@dunslane.net>    
date     : Fri, 29 Mar 2013 16:56:22 -0400    

Click here for diff

M doc/src/sgml/func.sgml

Add new JSON processing functions and parser API.

commit   : a570c98d7fa0841f17bbf51d62d02d9e493c7fcc    
  
author   : Andrew Dunstan <andrew@dunslane.net>    
date     : Fri, 29 Mar 2013 14:12:13 -0400    
  
committer: Andrew Dunstan <andrew@dunslane.net>    
date     : Fri, 29 Mar 2013 14:12:13 -0400    

Click here for diff

The JSON parser is converted into a recursive descent parser, and  
exposed for use by other modules such as extensions. The API provides  
hooks for all the significant parser event such as the beginning and end  
of objects and arrays, and providing functions to handle these hooks  
allows for fairly simple construction of a wide variety of JSON  
processing functions. A set of new basic processing functions and  
operators is also added, which use this API, including operations to  
extract array elements, object fields, get the length of arrays and the  
set of keys of a field, deconstruct an object into a set of key/value  
pairs, and create records from JSON objects and arrays of objects.  
  
Catalog version bumped.  
  
Andrew Dunstan, with some documentation assistance from Merlin Moncure.  

M doc/src/sgml/func.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/jsonfuncs.c
M src/include/catalog/catversion.h
M src/include/catalog/pg_operator.h
M src/include/catalog/pg_proc.h
M src/include/utils/json.h
A src/include/utils/jsonapi.h
M src/test/regress/expected/json.out
M src/test/regress/sql/json.sql

Document encode(bytea, 'escape')'s behavior correctly.

commit   : 9ad27c215362df436f8c16f1aace923011f31be4    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 28 Mar 2013 23:14:54 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 28 Mar 2013 23:14:54 -0400    

Click here for diff

I changed this in commit fd15dba543247eb1ce879d22632b9fdb4c230831, but  
missed the fact that the SGML documentation of the function specified  
exactly what it did.  Well, one of the two places where it's specified  
documented that --- probably I looked at the other place and thought  
nothing needed to be done.  Sync the two places where encode() and  
decode() are described.  

M doc/src/sgml/func.sgml

Must check indisready not just indisvalid when dumping from 9.2 server.

commit   : aa02864f64c46807f7682a41882fe40f7f5cb819    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 28 Mar 2013 22:09:12 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 28 Mar 2013 22:09:12 -0400    

Click here for diff

9.2 uses a kluge representation of "indislive"; we have to account for  
that when examining pg_index.  Simplest solution is to check indisready  
for 9.0 and 9.1 as well; that's harmless though unnecessary, so it's  
not worth making a version distinction for.  
  
Fixes oversight in commit 683abc73dff549e94555d4020dae8d02f32ed78b,  
as noted by Andres Freund.  

M src/bin/pg_dump/pg_dump.c

Draft release notes for 9.2.4, 9.1.9, 9.0.13, 8.4.17.

commit   : 29505a894e1ece60bf42a2756ae99c9e44b5ae6a    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 28 Mar 2013 21:40:19 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 28 Mar 2013 21:40:19 -0400    

Click here for diff

Covers commits through today.  Not back-patching into back branches  
yet, since this is just for people to review in advance.  

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

sepgsql: Documentation improvements.

commit   : 2a3db8cec24d0c95136b74b305bf1f1e41615a4d    
  
author   : Robert Haas <rhaas@postgresql.org>    
date     : Thu, 28 Mar 2013 15:55:44 -0400    
  
committer: Robert Haas <rhaas@postgresql.org>    
date     : Thu, 28 Mar 2013 15:55:44 -0400    

Click here for diff

Fixes by me, per griping by Thom Brown.  

M doc/src/sgml/sepgsql.sgml

Allow sepgsql labels to depend on object name.

commit   : 0f05840bf4c256b838eca8f1be9d7b5be82ccd0e    
  
author   : Robert Haas <rhaas@postgresql.org>    
date     : Thu, 28 Mar 2013 15:38:35 -0400    
  
committer: Robert Haas <rhaas@postgresql.org>    
date     : Thu, 28 Mar 2013 15:38:35 -0400    

Click here for diff

The main change here is to call security_compute_create_name_raw()  
rather than security_compute_create_raw().  This ups the minimum  
requirement for libselinux from 2.0.99 to 2.1.10, but it looks  
like most distributions will have picked that up before 9.3 is out.  
  
KaiGai Kohei  

M configure
M configure.in
M contrib/sepgsql/database.c
M contrib/sepgsql/expected/label.out
M contrib/sepgsql/proc.c
M contrib/sepgsql/relation.c
M contrib/sepgsql/schema.c
M contrib/sepgsql/selinux.c
M contrib/sepgsql/sepgsql-regtest.te
M contrib/sepgsql/sepgsql.h
M contrib/sepgsql/sql/label.sql
M contrib/sepgsql/uavc.c
M doc/src/sgml/sepgsql.sgml

Update time zone data files to tzdata release 2013b.

commit   : ae7f1c3ef2eef9584e3c9a42c395eb0c0e59a5ed    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 28 Mar 2013 15:25:48 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 28 Mar 2013 15:25:48 -0400    

Click here for diff

DST law changes in Chile, Haiti, Morocco, Paraguay, some Russian areas.  
Historical corrections for numerous places.  

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/southamerica
M src/timezone/data/zone.tab

Avoid "variable might be clobbered by longjmp" warning.

commit   : 58bc48179b3cad0793ae20b002d60289c8bf0b9b    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 28 Mar 2013 13:19:49 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 28 Mar 2013 13:19:49 -0400    

Click here for diff

On older-model gcc, the original coding of UTILITY_BEGIN_QUERY() can  
draw this error because of multiple assignments to _needCleanup.  
Rather than mark that variable volatile, we can suppress the warning  
by arranging to have just one unconditional assignment before PG_TRY.  

M src/backend/tcop/utility.c

Add sql_drop event for event triggers

commit   : 473ab40c8bb3fcb1a7645f6a7443a0424d70fbaf    
  
author   : Alvaro Herrera <alvherre@alvh.no-ip.org>    
date     : Wed, 27 Mar 2013 16:02:10 -0300    
  
committer: Alvaro Herrera <alvherre@alvh.no-ip.org>    
date     : Wed, 27 Mar 2013 16:02:10 -0300    

Click here for diff

This event takes place just before ddl_command_end, and is fired if and  
only if at least one object has been dropped by the command.  (For  
instance, DROP TABLE IF EXISTS of a table that does not in fact exist  
will not lead to such a trigger firing).  Commands that drop multiple  
objects (such as DROP SCHEMA or DROP OWNED BY) will cause a single event  
to fire.  Some firings might be surprising, such as  
ALTER TABLE DROP COLUMN.  
  
The trigger is fired after the drop has taken place, because that has  
been deemed the safest design, to avoid exposing possibly-inconsistent  
internal state (system catalogs as well as current transaction) to the  
user function code.  This means that careful tracking of object  
identification is required during the object removal phase.  
  
Like other currently existing events, there is support for tag  
filtering.  
  
To support the new event, add a new pg_event_trigger_dropped_objects()  
set-returning function, which returns a set of rows comprising the  
objects affected by the command.  This is to be used within the user  
function code, and is mostly modelled after the recently introduced  
pg_identify_object() function.  
  
Catalog version bumped due to the new function.  
  
Dimitri Fontaine and Álvaro Herrera  
Review by Robert Haas, Tom Lane  

M doc/src/sgml/event-trigger.sgml
M doc/src/sgml/func.sgml
M src/backend/catalog/dependency.c
M src/backend/commands/event_trigger.c
M src/backend/parser/gram.y
M src/backend/tcop/utility.c
M src/backend/utils/adt/regproc.c
M src/backend/utils/cache/evtcache.c
M src/include/catalog/catversion.h
M src/include/catalog/pg_proc.h
M src/include/commands/event_trigger.h
M src/include/utils/builtins.h
M src/include/utils/evtcache.h
M src/test/regress/expected/event_trigger.out
M src/test/regress/sql/event_trigger.sql

Revoke bc5334d8679c428a709d150666b288171795bd76

commit   : 593c39d156fd13e07dbfc43e63b53a3e89e82aa4    
  
author   : Simon Riggs <simon@2ndQuadrant.com>    
date     : Thu, 28 Mar 2013 09:18:02 +0000    
  
committer: Simon Riggs <simon@2ndQuadrant.com>    
date     : Thu, 28 Mar 2013 09:18:02 +0000    

Click here for diff

M doc/src/sgml/config.sgml
M src/backend/access/transam/xlog.c
M src/backend/utils/init/globals.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.h

Revoke 7a5a59d378e052618d6feae64d1d2b4f2ad6f9bc

commit   : d139a5e26b0d1123d77c403e2e95feaf77634a40    
  
author   : Simon Riggs <simon@2ndQuadrant.com>    
date     : Thu, 28 Mar 2013 09:12:55 +0000    
  
committer: Simon Riggs <simon@2ndQuadrant.com>    
date     : Thu, 28 Mar 2013 09:12:55 +0000    

Click here for diff

M src/backend/utils/misc/guc.c

Reset OpenSSL randomness state in each postmaster child process.

commit   : 0d1ecd6300191a450978ca2fcd12bbbb7c5e65e6    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Wed, 27 Mar 2013 18:50:21 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Wed, 27 Mar 2013 18:50:21 -0400    

Click here for diff

Previously, if the postmaster initialized OpenSSL's PRNG (which it will do  
when ssl=on in postgresql.conf), the same pseudo-random state would be  
inherited by each forked child process.  The problem is masked to a  
considerable extent if the incoming connection uses SSL encryption, but  
when it does not, identical pseudo-random state is made available to  
functions like contrib/pgcrypto.  The process's PID does get mixed into any  
requested random output, but on most systems that still only results in 32K  
or so distinct random sequences available across all Postgres sessions.  
This might allow an attacker who has database access to guess the results  
of "secure" operations happening in another session.  
  
To fix, forcibly reset the PRNG after fork().  Each child process that has  
need for random numbers from OpenSSL's generator will thereby be forced to  
go through OpenSSL's normal initialization sequence, which should provide  
much greater variability of the sequences.  There are other ways we might  
do this that would be slightly cheaper, but this approach seems the most  
future-proof against SSL-related code changes.  
  
This has been assigned CVE-2013-1900, but since the issue and the patch  
have already been publicized on pgsql-hackers, there's no point in trying  
to hide this commit.  
  
Back-patch to all supported branches.  
  
Marko Kreen  

M src/backend/postmaster/fork_process.c

Fix pasto which broke docs build.

commit   : 40e873d854cae046df941d162c3cbcefd00b3915    
  
author   : Kevin Grittner <kgrittn@postgresql.org>    
date     : Wed, 27 Mar 2013 16:11:46 -0500    
  
committer: Kevin Grittner <kgrittn@postgresql.org>    
date     : Wed, 27 Mar 2013 16:11:46 -0500    

Click here for diff

Commit bc5334d8679c428a709d150666b288171795bd76 accidentally  
included a second <variablelist> tag for a new list item.  

M doc/src/sgml/config.sgml

Fix buffer pin leak in heap update redo routine.

commit   : 3cfb572dde2095df1bfc6665862dcf8ee0a95b99    
  
author   : Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Wed, 27 Mar 2013 21:51:27 +0200    
  
committer: Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Wed, 27 Mar 2013 21:51:27 +0200    

Click here for diff

In a heap update, if the old and new tuple were on different pages, and the  
new page no longer existed (because it was subsequently truncated away by  
vacuum), heap_xlog_update forgot to release the pin on the old buffer. This  
bug was introduced by the "Fix multiple problems in WAL replay" patch,  
commit 3bbf668de9f1bc172371681e80a4e769b6d014c8 (on master branch).  
  
With full_page_writes=off, this triggered an "incorrect local pin count"  
error later in replay, if the old page was vacuumed.  
  
This fixes bug #7969, reported by Yunong Xiao. Backpatch to 9.0, like the  
commit that introduced this bug.  

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

Set recovery_config_directory for EXEC_BACKEND. Remove comment questioning whether this is necessary for DataDir. From buildfarm failures on Windows.

commit   : 7a5a59d378e052618d6feae64d1d2b4f2ad6f9bc    
  
author   : Simon Riggs <simon@2ndQuadrant.com>    
date     : Wed, 27 Mar 2013 16:35:38 +0000    
  
committer: Simon Riggs <simon@2ndQuadrant.com>    
date     : Wed, 27 Mar 2013 16:35:38 +0000    

Click here for diff

M src/backend/utils/misc/guc.c

Move some pg_dump function around.

commit   : 7800a71291690dcc34eb3b7aab18750b5a7ebe2c    
  
author   : Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Wed, 27 Mar 2013 18:10:40 +0200    
  
committer: Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Wed, 27 Mar 2013 18:10:40 +0200    

Click here for diff

Move functions used only by pg_dump and pg_restore from dumputils.c to a new  
file, pg_backup_utils.c. dumputils.c is linked into psql and some programs  
in bin/scripts, so it seems good to keep it slim. The parallel functionality  
is moved to parallel.c, as is exit_horribly, because the interesting code in  
exit_horribly is parallel-related.  
  
This refactoring gets rid of the on_exit_msg_func function pointer. It was  
problematic, because a modern gcc version with -Wmissing-format-attribute  
complained if it wasn't marked with PF_PRINTF_ATTRIBUTE, but the ancient gcc  
version that Tom Lane's old HP-UX box has didn't accept that attribute on a  
function pointer, and gave an error. We still use a similar function pointer  
trick for getLocalPQBuffer() function, to use a thread-local version of that  
in parallel mode on Windows, but that dodges the problem because it doesn't  
take printf-like arguments.  

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/dumputils.c
M src/bin/pg_dump/dumputils.h
M src/bin/pg_dump/parallel.c
M src/bin/pg_dump/parallel.h
M src/bin/pg_dump/pg_backup_archiver.c
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
A src/bin/pg_dump/pg_backup_utils.c
A src/bin/pg_dump/pg_backup_utils.h
M src/bin/pg_dump/pg_dump.c
M src/bin/pg_dump/pg_dump_sort.c
M src/bin/pg_dump/pg_dumpall.c
M src/bin/pg_dump/pg_restore.c

sepgsql: Support for new post-ALTER access hook.

commit   : 1cea9bbb21e9e90dc7085ce605d9160e7161fa58    
  
author   : Robert Haas <rhaas@postgresql.org>    
date     : Wed, 27 Mar 2013 08:10:14 -0400    
  
committer: Robert Haas <rhaas@postgresql.org>    
date     : Wed, 27 Mar 2013 08:10:14 -0400    

Click here for diff

KaiGai Kohei  

M contrib/sepgsql/database.c
A contrib/sepgsql/expected/alter.out
M contrib/sepgsql/expected/ddl.out
M contrib/sepgsql/hooks.c
M contrib/sepgsql/proc.c
M contrib/sepgsql/relation.c
M contrib/sepgsql/schema.c
M contrib/sepgsql/sepgsql.h
A contrib/sepgsql/sql/alter.sql
M contrib/sepgsql/sql/ddl.sql
M contrib/sepgsql/test_sepgsql
M doc/src/sgml/sepgsql.sgml

Allow external recovery_config_directory If required, recovery.conf can now be located outside of the data directory. Server needs read/write permissions on this directory.

commit   : bc5334d8679c428a709d150666b288171795bd76    
  
author   : Simon Riggs <simon@2ndQuadrant.com>    
date     : Wed, 27 Mar 2013 11:45:42 +0000    
  
committer: Simon Riggs <simon@2ndQuadrant.com>    
date     : Wed, 27 Mar 2013 11:45:42 +0000    

Click here for diff

M doc/src/sgml/config.sgml
M src/backend/access/transam/xlog.c
M src/backend/utils/init/globals.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.h

Fix grammatical errors in some new message strings.

commit   : f7f210b5c4c9c76e87fffc5abef7dea752d1ac9a    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Tue, 26 Mar 2013 17:52:00 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Tue, 26 Mar 2013 17:52:00 -0400    

Click here for diff

Daniele Varrazzo  

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

Ignore invalid indexes in pg_dump.

commit   : 683abc73dff549e94555d4020dae8d02f32ed78b    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Tue, 26 Mar 2013 17:43:19 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Tue, 26 Mar 2013 17:43:19 -0400    

Click here for diff

Dumping invalid indexes can cause problems at restore time, for example  
if the reason the index creation failed was because it tried to enforce  
a uniqueness condition not satisfied by the table's data.  Also, if the  
index creation is in fact still in progress, it seems reasonable to  
consider it to be an uncommitted DDL change, which pg_dump wouldn't be  
expected to dump anyway.  
  
Back-patch to all active versions, and teach them to ignore invalid  
indexes in servers back to 8.2, where the concept was introduced.  
  
Michael Paquier  

M src/bin/pg_dump/pg_dump.c

Fix pg_dump against 9.1/9.2 servers.

commit   : 625b237f79ec59369e6083f041649adf4fdc1080    
  
author   : Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Tue, 26 Mar 2013 15:43:19 +0200    
  
committer: Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Tue, 26 Mar 2013 15:43:19 +0200    

Click here for diff

The parallel pg_dump patch forgot to add relpages column to 9.1/9.2 version  
of the getTables() query.  
  
Reported by Bernd Helmle.  

M src/bin/pg_dump/pg_dump.c

Get rid of obsolete parse_version helper function.

commit   : 901b89e37bb8e71224ee76987679010ff3c93c05    
  
author   : Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Tue, 26 Mar 2013 15:21:57 +0200    
  
committer: Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Tue, 26 Mar 2013 15:21:57 +0200    

Click here for diff

For getting the server's version in numeric form, use PQserverVersion().  
It does the exact same parsing as dumputils.c's parse_version(), and has  
been around in libpq for a long time. For the client's version, just use  
the PG_VERSION_NUM constant.  

M src/bin/pg_dump/dumputils.c
M src/bin/pg_dump/dumputils.h
M src/bin/pg_dump/pg_backup_db.c
M src/bin/pg_dump/pg_dump.c
M src/bin/pg_dump/pg_dumpall.c
M src/bin/psql/command.c

Fix a small logic bug in adjusted parallel restore code.

commit   : ec143f94051779bb5d07419723529b4cc4fcce95    
  
author   : Andrew Dunstan <andrew@dunslane.net>    
date     : Mon, 25 Mar 2013 22:52:28 -0400    
  
committer: Andrew Dunstan <andrew@dunslane.net>    
date     : Mon, 25 Mar 2013 22:52:28 -0400    

Click here for diff

M src/bin/pg_dump/pg_backup_archiver.c

In base backup, only include our own tablespace version directory.

commit   : 28ba260906c87ffbda42f93d867191f491025a04    
  
author   : Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Mon, 25 Mar 2013 20:19:22 +0200    
  
committer: Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Mon, 25 Mar 2013 20:19:22 +0200    

Click here for diff

If you have clusters of different versions pointing to the same tablespace  
location, we would incorrectly include all the data belonging to the other  
versions, too.  
  
Fixes bug #7986, reported by Sergey Burladyan.  

M src/backend/replication/basebackup.c

Make pg_basebackup work with pre-9.3 servers, and add server version check.

commit   : d298b50a3b469c088bb40a4d36d38111b4cd574d    
  
author   : Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Fri, 22 Mar 2013 13:02:59 +0200    
  
committer: Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Fri, 22 Mar 2013 13:02:59 +0200    

Click here for diff

A new 'starttli' field was added to the response of BASE_BACKUP command.  
Make pg_basebackup tolerate the case that it's missing, so that it still  
works with older servers.  
  
Add an explicit check for the server version, so that you get a nicer error  
message if you try to use it with a pre-9.1 server.  
  
The streaming protocol message format changed in 9.3, so -X stream still won't  
work with pre-9.3 servers. I added a version check to ReceiveXLogStream()  
earlier, but write that slightly differently, so that in 9.4, it will still  
work with a 9.3 server. (In 9.4, the error message needs to be adjusted to  
"9.3 or above", though). Also, if the version check fails, don't retry.  

M doc/src/sgml/ref/pg_basebackup.sgml
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/receivelog.h

Add PF_PRINTF_ATTRIBUTE to on_exit_msg_fmt.

commit   : ea988ee8c8b191615e730f930bcde6144a598688    
  
author   : Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Mon, 25 Mar 2013 10:06:03 +0200    
  
committer: Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Mon, 25 Mar 2013 10:06:03 +0200    

Click here for diff

Per warning from -Wmissing-format-attribute.  

M src/bin/pg_dump/dumputils.h

Add missing #include.

commit   : 4eefd0f86b6ce2e657c566fe40301930ab31eddd    
  
author   : Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Mon, 25 Mar 2013 09:55:43 +0200    
  
committer: Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Mon, 25 Mar 2013 09:55:43 +0200    

Click here for diff

time(2) requires time.h.  

M src/timezone/zic.c

Fix some unportable constructs in parallel pg_dump code.

commit   : 846681fdd574548d4f430f2ff7ab44d77b4c79fe    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sun, 24 Mar 2013 15:35:37 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sun, 24 Mar 2013 15:35:37 -0400    

Click here for diff

Didn't compile on semi-obsolete gcc, and probably not on not-gcc-at-all  
either.  

M src/bin/pg_dump/dumputils.h
M src/bin/pg_dump/parallel.h
M src/bin/pg_dump/pg_backup_archiver.h

Add parallel pg_dump option.

commit   : 9e257a181cc1dc5e19eb5d770ce09cc98f470f5f    
  
author   : Andrew Dunstan <andrew@dunslane.net>    
date     : Sun, 24 Mar 2013 11:27:20 -0400    
  
committer: Andrew Dunstan <andrew@dunslane.net>    
date     : Sun, 24 Mar 2013 11:27:20 -0400    

Click here for diff

New infrastructure is added which creates a set number of workers  
(threads on Windows, forked processes on Unix). Jobs are then  
handed out to these workers by the master process as needed.  
pg_restore is adjusted to use this new infrastructure in place of the  
old setup which created a new worker for each step on the fly. Parallel  
dumps acquire a snapshot clone in order to stay consistent, if  
available.  
  
The parallel option is selected by the -j / --jobs command line  
parameter of pg_dump.  
  
Joachim Wieland, lightly editorialized by Andrew Dunstan.  

M doc/src/sgml/backup.sgml
M doc/src/sgml/perform.sgml
M doc/src/sgml/ref/pg_dump.sgml
M src/bin/pg_dump/Makefile
M src/bin/pg_dump/compress_io.c
M src/bin/pg_dump/dumputils.c
M src/bin/pg_dump/dumputils.h
A src/bin/pg_dump/parallel.c
A src/bin/pg_dump/parallel.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_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_dump/pg_restore.c
M src/tools/msvc/Mkvcbuild.pm

Update time zone abbreviation lists for changes missed since 2006.

commit   : 3b91fe185a71c05ac4528f93a39ba27232acc9e0    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sat, 23 Mar 2013 19:16:36 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sat, 23 Mar 2013 19:16:36 -0400    

Click here for diff

Most (all?) of Russia has moved to what's effectively year-round daylight  
savings time, so that the "standard" zone names now mean an hour later  
than they used to.  Update that, notably changing MSK as per recent  
complaint from Sergey Konoplev, but also CHOT, GET, IRKT, KGT, KRAT,  
MAGT, NOVT, OMST, VLAT, YAKT, YEKT.  The corresponding DST abbreviations  
are presumably now obsolete, but I left them in place with their old  
definitions, just to reduce any possible breakage from this change.  
  
Also add VOLT (Europe/Volgograd), which for some reason we never had  
before, as well as MIST (Antarctica/Macquarie), and fix obsolete  
definitions of MAWT, TKT, and WST.  

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

Semi-automatically detect changes in timezone abbreviations.

commit   : 69602772700e62b7b03e3f0ac7b10aa651c0c998    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sat, 23 Mar 2013 18:47:22 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sat, 23 Mar 2013 18:47:22 -0400    

Click here for diff

Add an option to zic.c to dump out all non-obsolete timezone abbreviations  
defined in the Olson database.  Comparing this list to its previous state  
will clue us in when something happens that we may need to account for in  
the tznames/ time zone abbreviation lists.  The README file's previous  
exhortation to "just grep for differences" was completely useless advice,  
in my now-considerable experience; but maybe this will be a bit more  
useful.  As a starting point I built the same list from the tzdata files  
as they existed in 2006, which is committed here as known_abbrevs.txt.  
Comparison indeed turned up quite a few changes we had neglected to account  
for, which I will commit separately.  

M src/timezone/.gitignore
M src/timezone/Makefile
M src/timezone/README
A src/timezone/known_abbrevs.txt
M src/timezone/zic.c

Avoid renaming data directory during MSVC upgrade testing.

commit   : b7f8465cc6c95da5b1af1de19bc7b7b1b2621276    
  
author   : Andrew Dunstan <andrew@dunslane.net>    
date     : Sat, 23 Mar 2013 16:26:06 -0400    
  
committer: Andrew Dunstan <andrew@dunslane.net>    
date     : Sat, 23 Mar 2013 16:26:06 -0400    

Click here for diff

This appears to cause some intermittent file system problems  
on Windows 8. Instead, set up the old data directory in its  
intended final location to start with.  

M src/tools/msvc/vcregress.pl

Don't put <indexterm> before <term> in <varlistentry> items.

commit   : cdc67938c086104ef7a0e2f1e6912e9ee0ba4c85    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sat, 23 Mar 2013 14:06:33 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sat, 23 Mar 2013 14:06:33 -0400    

Click here for diff

Doing that results in a broken index entry in PDF output.  We had only  
a few like that, which is probably why nobody noticed before.  
Standardize on putting the <term> first.  
  
Josh Kupershmidt  

M doc/src/sgml/config.sgml
M doc/src/sgml/libpq.sgml

Document cross-version compatibility issues for contrib/postgres_fdw.

commit   : 5b86fedfb57ea943f883a13c6d50c5a9e2a1cc57    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Fri, 22 Mar 2013 17:22:31 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Fri, 22 Mar 2013 17:22:31 -0400    

Click here for diff

One of the use-cases for postgres_fdw is extracting data from older PG  
servers, so cross-version compatibility is important.  Document what we  
can do here, and further annotate some of the coding choices that create  
compatibility constraints.  In passing, remove one unnecessary  
incompatibility with old servers, namely assuming that we didn't need to  
quote the timezone name 'UTC'.  

M contrib/postgres_fdw/connection.c
M contrib/postgres_fdw/postgres_fdw.c
M doc/src/sgml/postgres-fdw.sgml

commit   : 8a3b6772aedbd95557ab1fc489ddf007ac9d405d    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Fri, 22 Mar 2013 15:22:15 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Fri, 22 Mar 2013 15:22:15 -0400    

Click here for diff

If the remote database's settings of these GUCs are different from ours,  
ambiguous datetime values may be read incorrectly.  To fix, temporarily  
adopt the remote server's settings while we ingest a query result.  
  
This is not a complete fix, since it doesn't do anything about ambiguous  
values in commands sent to the remote server; but there seems little we  
can do about that end of it given dblink's entirely textual API for  
transmitted commands.  
  
Back-patch to 9.2.  The hazard exists in all versions, but this patch  
would need more work to apply before 9.2.  Given the lack of field  
complaints about this issue, it doesn't seem worth the effort at present.  
  
Daniel Farina and Tom Lane  

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

Fix problems with incomplete attempt to prohibit OIDS with MVs.

commit   : 549dae0352a06a43ec664dc158556e12ec2d30e5    
  
author   : Kevin Grittner <kgrittn@postgresql.org>    
date     : Fri, 22 Mar 2013 13:27:34 -0500    
  
committer: Kevin Grittner <kgrittn@postgresql.org>    
date     : Fri, 22 Mar 2013 13:27:34 -0500    

Click here for diff

Problem with assertion failure in restoring from pg_dump output  
reported by Joachim Wieland.  
  
Review and suggestions by Tom Lane and Robert Haas.  

M doc/src/sgml/ref/create_materialized_view.sgml
M src/backend/commands/createas.c
M src/backend/commands/tablecmds.c
M src/backend/parser/parse_clause.c
M src/backend/parser/parse_utilcmd.c
M src/include/parser/parse_clause.h

Suppress uninitialized-variable warning in new checksum code.

commit   : 4912385b56afe68ef76e47d38df1d61ada0fde2f    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Fri, 22 Mar 2013 12:27:50 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Fri, 22 Mar 2013 12:27:50 -0400    

Click here for diff

Some compilers understand that this coding is safe, and some don't.  

M src/backend/storage/page/bufpage.c

Update commit_delay documentation.

commit   : 82b945c0979350c87ddc52adefe9f0a36dd5b4c8    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Fri, 22 Mar 2013 11:39:15 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Fri, 22 Mar 2013 11:39:15 -0400    

Click here for diff

Commit 13fe298ca06f5390df5edf073cf401f9f0b67458 changed this GUC to be  
PGC_SUSET, but neglected to update the documentation to match.  
  
While at it, edit and rearrange the text a little for clarity.  

M doc/src/sgml/config.sgml

Add new README file for pages/checksums

commit   : 9df56f6d91c3d67b23925b8f8b70365636995b71    
  
author   : Simon Riggs <simon@2ndQuadrant.com>    
date     : Fri, 22 Mar 2013 14:21:58 +0000    
  
committer: Simon Riggs <simon@2ndQuadrant.com>    
date     : Fri, 22 Mar 2013 14:21:58 +0000    

Click here for diff

A src/backend/storage/page/README

Allow I/O reliability checks using 16-bit checksums

commit   : 96ef3b8ff1cf1950e897fd2f766d4bd9ef0d5d56    
  
author   : Simon Riggs <simon@2ndQuadrant.com>    
date     : Fri, 22 Mar 2013 13:54:07 +0000    
  
committer: Simon Riggs <simon@2ndQuadrant.com>    
date     : Fri, 22 Mar 2013 13:54:07 +0000    

Click here for diff

Checksums are set immediately prior to flush out of shared buffers  
and checked when pages are read in again. Hint bit setting will  
require full page write when block is dirtied, which causes various  
infrastructure changes. Extensive comments, docs and README.  
  
WARNING message thrown if checksum fails on non-all zeroes page;  
ERROR thrown but can be disabled with ignore_checksum_failure = on.  
  
Feature enabled by an initdb option, since transition from option off  
to option on is long and complex and has not yet been implemented.  
Default is not to use checksums.  
  
Checksum used is WAL CRC-32 truncated to 16-bits.  
  
Simon Riggs, Jeff Davis, Greg Smith  
Wide input and assistance from many community members. Thank you.  

M contrib/pg_upgrade/controldata.c
M contrib/pg_upgrade/pg_upgrade.h
M doc/src/sgml/config.sgml
M doc/src/sgml/ref/initdb.sgml
M src/backend/access/gist/gistget.c
M src/backend/access/hash/hash.c
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/visibilitymap.c
M src/backend/access/nbtree/nbtinsert.c
M src/backend/access/nbtree/nbtree.c
M src/backend/access/nbtree/nbtsort.c
M src/backend/access/nbtree/nbtutils.c
M src/backend/access/rmgrdesc/xlogdesc.c
M src/backend/access/spgist/spginsert.c
M src/backend/access/transam/README
M src/backend/access/transam/xlog.c
M src/backend/bootstrap/bootstrap.c
M src/backend/commands/matview.c
M src/backend/commands/sequence.c
M src/backend/commands/tablecmds.c
M src/backend/commands/vacuumlazy.c
M src/backend/storage/buffer/bufmgr.c
M src/backend/storage/buffer/localbuf.c
M src/backend/storage/freespace/README
M src/backend/storage/freespace/freespace.c
M src/backend/storage/freespace/fsmpage.c
M src/backend/storage/page/bufpage.c
M src/backend/utils/misc/guc.c
M src/backend/utils/time/tqual.c
M src/bin/initdb/initdb.c
M src/bin/pg_controldata/pg_controldata.c
M src/bin/pg_resetxlog/pg_resetxlog.c
M src/include/access/heapam_xlog.h
M src/include/access/visibilitymap.h
M src/include/access/xlog.h
M src/include/catalog/pg_control.h
M src/include/storage/bufmgr.h
M src/include/storage/bufpage.h

Silence compiler warnings about unused values.

commit   : e4a05c7512b23c8f48c186e685f2ef186374a20a    
  
author   : Andrew Dunstan <andrew@dunslane.net>    
date     : Fri, 22 Mar 2013 09:14:16 -0400    
  
committer: Andrew Dunstan <andrew@dunslane.net>    
date     : Fri, 22 Mar 2013 09:14:16 -0400    

Click here for diff

Per gripe from Kevin Grittner.  

M contrib/hstore/hstore_io.c

Change commit_delay to be SUSET for 9.3+ Prior to 9.3 the commit_delay affected only the current user, whereas now only the group leader waits while holding the WALWriteLock. Deliberate or accidental settings to a poor value could seriously degrade performance for all users. Privileges may be delegated by SECURITY DEFINER functions for anyone that needs per-user settings in real situations. Request for change from Peter Geoghegan

commit   : 13fe298ca06f5390df5edf073cf401f9f0b67458    
  
author   : Simon Riggs <simon@2ndQuadrant.com>    
date     : Fri, 22 Mar 2013 12:01:16 +0000    
  
committer: Simon Riggs <simon@2ndQuadrant.com>    
date     : Fri, 22 Mar 2013 12:01:16 +0000    

Click here for diff

M src/backend/utils/misc/guc.c

Avoid retrieving dummy NULL columns in postgres_fdw.

commit   : e690b9515072fd7767fdeca5c54166f6a77733bc    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Fri, 22 Mar 2013 00:31:11 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Fri, 22 Mar 2013 00:31:11 -0400    

Click here for diff

This should provide some marginal overall savings, since it surely takes  
many more cycles for the remote server to deal with the NULL columns than  
it takes for postgres_fdw not to emit them.  But really the reason is to  
keep the emitted queries from looking quite so silly ...  

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

Redo postgres_fdw's planner code so it can handle parameterized paths.

commit   : 9cbc4b80ddc10b36c64514104caa69747c386dcf    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 21 Mar 2013 19:43:59 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 21 Mar 2013 19:43:59 -0400    

Click here for diff

I wasn't going to ship this without having at least some example of how  
to do that.  This version isn't terribly bright; in particular it won't  
consider any combinations of multiple join clauses.  Given the cost of  
executing a remote EXPLAIN, I'm not sure we want to be very aggressive  
about doing that, anyway.  
  
In support of this, refactor generate_implied_equalities_for_indexcol  
so that it can be used to extract equivalence clauses that aren't  
necessarily tied to an index.  

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
M src/backend/optimizer/path/equivclass.c
M src/backend/optimizer/path/indxpath.c
M src/include/optimizer/paths.h

Eliminate trivial whitespace inconsistency in docs sample code.

commit   : 08af1a0a2ae8fbbd9949d9fa0f7583f6c09cf4ec    
  
author   : Kevin Grittner <kgrittn@postgresql.org>    
date     : Thu, 21 Mar 2013 10:34:47 -0500    
  
committer: Kevin Grittner <kgrittn@postgresql.org>    
date     : Thu, 21 Mar 2013 10:34:47 -0500    

Click here for diff

M doc/src/sgml/rules.sgml

Fix "element <@ range" cost estimation.

commit   : f897c4744fea221dfc7bbd277081edad41d1d58d    
  
author   : Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Thu, 21 Mar 2013 11:15:45 +0200    
  
committer: Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Thu, 21 Mar 2013 11:15:45 +0200    

Click here for diff

The statistics-based cost estimation patch for range types broke that, by  
incorrectly assuming that the left operand of all range oeprators is a  
range. That lead to a "type x is not a range type" error. Because it took so  
long for anyone to notice, add a regression test for that case.  
  
We still don't do proper statistics-based cost estimation for that, so you  
just get a default constant estimate. We should look into implementing that,  
but this patch at least fixes the regression.  
  
Spotted by Tom Lane, when testing query from Josh Berkus.  

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

Allow extracting machine-readable object identity

commit   : f8348ea32ec8d713cd6e5d5e16f15edef22c4d03    
  
author   : Alvaro Herrera <alvherre@alvh.no-ip.org>    
date     : Wed, 20 Mar 2013 18:19:19 -0300    
  
committer: Alvaro Herrera <alvherre@alvh.no-ip.org>    
date     : Wed, 20 Mar 2013 18:19:19 -0300    

Click here for diff

Introduce pg_identify_object(oid,oid,int4), which is similar in spirit  
to pg_describe_object but instead produces a row of machine-readable  
information to uniquely identify the given object, without resorting to  
OIDs or other internal representation.  This is intended to be used in  
the event trigger implementation, to report objects being operated on;  
but it has usefulness of its own.  
  
Catalog version bumped because of the new function.  

M doc/src/sgml/func.sgml
M src/backend/catalog/dependency.c
M src/backend/catalog/objectaddress.c
M src/backend/commands/alter.c
M src/backend/parser/gram.y
M src/backend/utils/adt/format_type.c
M src/backend/utils/adt/regproc.c
M src/include/catalog/catversion.h
M src/include/catalog/dependency.h
M src/include/catalog/objectaddress.h
M src/include/catalog/pg_proc.h
M src/include/utils/builtins.h

Bump up timeout delays some more in timeouts isolation test.

commit   : a7921f71a3c747141344d8604f6a6d7b4cddb2a9    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Wed, 20 Mar 2013 13:53:43 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Wed, 20 Mar 2013 13:53:43 -0400    

Click here for diff

The buildfarm members using -DCLOBBER_CACHE_ALWAYS still don't like this  
test.  Some experimentation shows that on my machine, isolationtester's  
query to check for "waiting" state takes 2 to 2.5 seconds to bind+execute  
under -DCLOBBER_CACHE_ALWAYS.  Set the timeouts to 5 seconds to leave some  
headroom for possibly-slower buildfarm critters.  
  
Really we ought to fix the "waiting" query, which is not only horridly  
slow but outright wrong in detail; and then maybe we can back off these  
timeouts.  But right now I'm just trying to get the buildfarm green again.  

M src/test/isolation/expected/timeouts.out
M src/test/isolation/specs/timeouts.spec

Use ORDER BY on matview definitions were needed for stable plans.

commit   : 241139ae4baf6264c3c2cd053a547833c6e49a59    
  
author   : Kevin Grittner <kgrittn@postgresql.org>    
date     : Tue, 19 Mar 2013 10:33:37 -0500    
  
committer: Kevin Grittner <kgrittn@postgresql.org>    
date     : Tue, 19 Mar 2013 10:33:37 -0500    

Click here for diff

Per report from Hadi Moshayedi of matview regression test failure  
with optimization of aggregates.  A few ORDER BY clauses improve  
code coverage for matviews while solving that problem.  

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

Clarify assumption of filesystem metadata integrity.

commit   : 1a091002cfa2180a908b36d56c58749a175b4be7    
  
author   : Simon Riggs <simon@2ndQuadrant.com>    
date     : Tue, 19 Mar 2013 08:57:29 +0000    
  
committer: Simon Riggs <simon@2ndQuadrant.com>    
date     : Tue, 19 Mar 2013 08:57:29 +0000    

Click here for diff

Jeff Davis  

M doc/src/sgml/wal.sgml

Correction that 2pc state files use CRC-32.

commit   : 8c3b87ca10a54daf06e41986d763e12538c06ab9    
  
author   : Simon Riggs <simon@2ndQuadrant.com>    
date     : Tue, 19 Mar 2013 08:51:35 +0000    
  
committer: Simon Riggs <simon@2ndQuadrant.com>    
date     : Tue, 19 Mar 2013 08:51:35 +0000    

Click here for diff

Jeff Davis  

M doc/src/sgml/wal.sgml

Add reliability docs about storage/memory corruptions. Add section to the Reliability section about what is and is not protected for various file types. Further edits welcome.

commit   : 2266db392cb825eccb39518e7b652e7f336fff6c    
  
author   : Simon Riggs <simon@2ndQuadrant.com>    
date     : Mon, 18 Mar 2013 22:38:07 +0000    
  
committer: Simon Riggs <simon@2ndQuadrant.com>    
date     : Mon, 18 Mar 2013 22:38:07 +0000    

Click here for diff

Designed to allow 1-2 line change when/if checksums are committed.  
  
Inspired by docs written by Jeff Davis, though completely different from his  
patch.  

M doc/src/sgml/wal.sgml

Improve documentation of EXTRACT(WEEK).

commit   : e39feb1006ac5c64fd804597088bc7f40ff7b635    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Mon, 18 Mar 2013 13:34:15 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Mon, 18 Mar 2013 13:34:15 -0400    

Click here for diff

The docs showed that early-January dates can be considered part of the  
previous year for week-counting purposes, but failed to say explicitly  
that late-December dates can also be considered part of the next year.  
Fix that, and add a cross-reference to the "isoyear" field.  Per bug  
#7967 from Pawel Kobylak.  

M doc/src/sgml/func.sgml

Add pageinspect--1.0--1.sql for checksum changes

commit   : e016b72411caa7027f9c980fb2c0560cdab2a129    
  
author   : Simon Riggs <simon@2ndQuadrant.com>    
date     : Mon, 18 Mar 2013 14:39:17 +0000    
  
committer: Simon Riggs <simon@2ndQuadrant.com>    
date     : Mon, 18 Mar 2013 14:39:17 +0000    

Click here for diff

A contrib/pageinspect/pageinspect–1.0–1.1.sql

Add pageinspect--1.1.sql for checksum changes

commit   : ef04cb745fc3167264f369a2710f237de4db0bf4    
  
author   : Simon Riggs <simon@2ndQuadrant.com>    
date     : Mon, 18 Mar 2013 14:19:06 +0000    
  
committer: Simon Riggs <simon@2ndQuadrant.com>    
date     : Mon, 18 Mar 2013 14:19:06 +0000    

Click here for diff

A contrib/pageinspect/pageinspect–1.1.sql

Remove PageSetTLI and rename pd_tli to pd_checksum Remove use of PageSetTLI() from all page manipulation functions and adjust README to indicate change in the way we make changes to pages. Repurpose those bytes into the pd_checksum field and explain how that works in comments about page header.

commit   : bb7cc2623f242ffafae404f8ebbb331b9a7f2b68    
  
author   : Simon Riggs <simon@2ndQuadrant.com>    
date     : Mon, 18 Mar 2013 13:46:42 +0000    
  
committer: Simon Riggs <simon@2ndQuadrant.com>    
date     : Mon, 18 Mar 2013 13:46:42 +0000    

Click here for diff

Refactoring ahead of actual feature patch which would make use  
of the checksum field, arriving later.  
  
Jeff Davis, with comments and doc changes by Simon Riggs  
Direction suggested by Robert Haas; many others providing  
review comments.  

M contrib/pageinspect/Makefile
M contrib/pageinspect/pageinspect.control
M contrib/pageinspect/rawpage.c
M doc/src/sgml/pageinspect.sgml
M src/backend/access/gin/ginbtree.c
M src/backend/access/gin/ginfast.c
M src/backend/access/gin/gininsert.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/gistvacuum.c
M src/backend/access/gist/gistxlog.c
M src/backend/access/heap/heapam.c
M src/backend/access/heap/pruneheap.c
M src/backend/access/heap/visibilitymap.c
M src/backend/access/nbtree/nbtinsert.c
M src/backend/access/nbtree/nbtpage.c
M src/backend/access/nbtree/nbtsort.c
M src/backend/access/nbtree/nbtxlog.c
M src/backend/access/spgist/spgdoinsert.c
M src/backend/access/spgist/spginsert.c
M src/backend/access/spgist/spgvacuum.c
M src/backend/access/spgist/spgxlog.c
M src/backend/access/transam/README
M src/backend/access/transam/xlog.c
M src/backend/commands/sequence.c
M src/backend/commands/vacuumlazy.c
M src/include/storage/bufpage.h

Increase timeout delays in new timeouts isolation test.

commit   : 4c855750fc0ba9bd30fa397eafbfee354908bbca    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sun, 17 Mar 2013 23:00:44 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sun, 17 Mar 2013 23:00:44 -0400    

Click here for diff

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

M src/test/isolation/expected/timeouts.out
M src/test/isolation/specs/timeouts.spec

Extend object-access hook machinery to support post-alter events.

commit   : 05f3f9c7b2922b2a064418b5cd87b372d1b73412    
  
author   : Robert Haas <rhaas@postgresql.org>    
date     : Sun, 17 Mar 2013 22:55:14 -0400    
  
committer: Robert Haas <rhaas@postgresql.org>    
date     : Sun, 17 Mar 2013 22:55:14 -0400    

Click here for diff

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

M src/backend/catalog/aclchk.c
M src/backend/catalog/heap.c
M src/backend/catalog/index.c
M src/backend/catalog/objectaccess.c
M src/backend/catalog/pg_constraint.c
M src/backend/catalog/pg_db_role_setting.c
M src/backend/catalog/pg_type.c
M src/backend/commands/alter.c
M src/backend/commands/cluster.c
M src/backend/commands/dbcommands.c
M src/backend/commands/event_trigger.c
M src/backend/commands/extension.c
M src/backend/commands/foreigncmds.c
M src/backend/commands/functioncmds.c
M src/backend/commands/matview.c
M src/backend/commands/opclasscmds.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/tsearchcmds.c
M src/backend/commands/typecmds.c
M src/backend/commands/user.c
M src/backend/rewrite/rewriteDefine.c
M src/include/catalog/heap.h
M src/include/catalog/index.h
M src/include/catalog/objectaccess.h
M src/include/catalog/pg_constraint.h
M src/include/commands/cluster.h
M src/include/commands/tablecmds.h

Improve signal-handler lockout mechanism in timeout.c.

commit   : 6ac7facdd3990baf47efc124e9d7229422a06452    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sun, 17 Mar 2013 22:42:19 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sun, 17 Mar 2013 22:42:19 -0400    

Click here for diff

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

M src/backend/utils/misc/timeout.c

Use pqsignal() in contrib programs rather than calling signal(2) directly.

commit   : 3c07fbf40bd0276e4be02fc72cba6b1cd62da301    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sun, 17 Mar 2013 16:09:47 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sun, 17 Mar 2013 16:09:47 -0400    

Click here for diff

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

M contrib/pg_standby/pg_standby.c
M contrib/pg_test_fsync/pg_test_fsync.c

Re-include pqsignal() in libpq.

commit   : b1fae823ee46a26e7e557591d659351835742537    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sun, 17 Mar 2013 15:45:31 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sun, 17 Mar 2013 15:45:31 -0400    

Click here for diff

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

M src/interfaces/libpq/.gitignore
M src/interfaces/libpq/Makefile
M src/interfaces/libpq/bcc32.mak
M src/interfaces/libpq/win32.mak

initdb needs pqsignal() even on Windows.

commit   : e2a203a1903367135457f12e0032626f96ef04ca    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sun, 17 Mar 2013 15:19:47 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sun, 17 Mar 2013 15:19:47 -0400    

Click here for diff

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

M src/include/port.h
M src/port/pqsignal.c
M src/tools/msvc/Mkvcbuild.pm

Fix inclusions in pgbench.c.

commit   : 8c41cb695cc5f90eee3d2226ad09016381700ca7    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sun, 17 Mar 2013 14:18:33 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sun, 17 Mar 2013 14:18:33 -0400    

Click here for diff

Apparently this was depending on pqsignal.h for <signal.h>.  
Not sure why I didn't see the failure on my other machine.  

M contrib/pgbench/pgbench.c

Fix inclusions in pg_receivexlog.c.

commit   : c68b5eff13b97ecaaa87b24406455fafe568aa3f    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sun, 17 Mar 2013 14:11:48 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sun, 17 Mar 2013 14:11:48 -0400    

Click here for diff

Apparently this was depending on pqsignal.h for <signal.h>.  
Not sure why I didn't see the failure on my other machine.  

M src/bin/pg_basebackup/pg_receivexlog.c

Move pqsignal() to libpgport.

commit   : da5aeccf64b37a8e9bd3cb605848590595dbcbf8    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sun, 17 Mar 2013 12:06:42 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sun, 17 Mar 2013 12:06:42 -0400    

Click here for diff

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

M contrib/pgbench/pgbench.c
M src/backend/access/transam/xlog.c
M src/backend/libpq/pqsignal.c
M src/backend/main/main.c
M src/backend/port/win32/signal.c
M src/backend/port/win32/timer.c
M src/backend/replication/walsender.c
M src/backend/utils/misc/timeout.c
M src/bin/initdb/.gitignore
M src/bin/initdb/Makefile
M src/bin/initdb/initdb.c
M src/bin/pg_basebackup/pg_receivexlog.c
M src/bin/pg_ctl/pg_ctl.c
M src/bin/psql/common.c
M src/bin/psql/copy.c
M src/bin/psql/print.c
M src/bin/scripts/common.c
M src/include/libpq/pqsignal.h
M src/include/port.h
M src/interfaces/libpq/Makefile
M src/interfaces/libpq/bcc32.mak
M src/interfaces/libpq/fe-misc.c
M src/interfaces/libpq/fe-print.c
M src/interfaces/libpq/fe-secure.c
D src/interfaces/libpq/pqsignal.c
D src/interfaces/libpq/pqsignal.h
M src/interfaces/libpq/win32.mak
M src/pl/plperl/plperl.c
M src/port/Makefile
A src/port/pqsignal.c

Add lock_timeout configuration parameter.

commit   : d43837d03067487560af481474ae985df894f786    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sat, 16 Mar 2013 23:22:17 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sat, 16 Mar 2013 23:22:17 -0400    

Click here for diff

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

M doc/src/sgml/config.sgml
M src/backend/postmaster/autovacuum.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/init/postinit.c
M src/backend/utils/misc/guc.c
M src/backend/utils/misc/postgresql.conf.sample
M src/backend/utils/misc/timeout.c
M src/bin/pg_dump/pg_backup_archiver.c
M src/bin/pg_dump/pg_dump.c
M src/include/storage/proc.h
M src/include/utils/timeout.h
A src/test/isolation/expected/timeouts.out
M src/test/isolation/isolation_schedule
A src/test/isolation/specs/timeouts.spec

pg_resetxlog: Capitalize placeholder in --help output

commit   : d2bef5f7db5f3afdbbb3f58b8eff49f0bc7ef790    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Sat, 16 Mar 2013 21:47:52 -0400    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
date     : Sat, 16 Mar 2013 21:47:52 -0400    

Click here for diff

M src/bin/pg_resetxlog/pg_resetxlog.c

pg_controldata: Undo message spelling change

commit   : ea1aee88e343969ad7122a18aff7a43e789dbbd7    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Sat, 16 Mar 2013 21:47:10 -0400    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
date     : Sat, 16 Mar 2013 21:47:10 -0400    

Click here for diff

M src/bin/pg_controldata/pg_controldata.c

Improve the documentation about commit_delay.

commit   : 70ec2f8f4392f4e3d379c2c759789d631ffeec10    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Fri, 15 Mar 2013 17:41:47 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Fri, 15 Mar 2013 17:41:47 -0400    

Click here for diff

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

M contrib/pg_test_fsync/pg_test_fsync.c
M doc/src/sgml/config.sgml
M doc/src/sgml/pgtestfsync.sgml
M doc/src/sgml/wal.sgml

Improve error reporting in code that checks for buffer refcount leaks.

commit   : dcafdbcde1baf256891be6af77868b84889b435d    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Fri, 15 Mar 2013 12:26:26 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Fri, 15 Mar 2013 12:26:26 -0400    

Click here for diff

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

M src/backend/storage/buffer/bufmgr.c
M src/backend/storage/buffer/localbuf.c

Extend format() to handle field width and left/right alignment.

commit   : 73e7025bd8eed941a068f0a7a71e02dca8d38d1c    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 14 Mar 2013 22:56:56 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 14 Mar 2013 22:56:56 -0400    

Click here for diff

This change adds some more standard sprintf() functionality to format().  
  
Pavel Stehule, reviewed by Dean Rasheed and Kyotaro Horiguchi  

M doc/src/sgml/func.sgml
M src/backend/utils/adt/varlena.c
M src/test/regress/expected/text.out
M src/test/regress/sql/text.sql

Avoid inserting no-op Limit plan nodes.

commit   : 1a1832eb085e5bca198735e5d0e766a3cb61b8fc    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 14 Mar 2013 15:10:41 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 14 Mar 2013 15:10:41 -0400    

Click here for diff

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

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

Revert unnecessary change in MV call to checkRuleResultList().

commit   : fb60e7296c2cf15195802b4596496b179bdc905a    
  
author   : Kevin Grittner <kgrittn@postgresql.org>    
date     : Thu, 14 Mar 2013 13:59:52 -0500    
  
committer: Kevin Grittner <kgrittn@postgresql.org>    
date     : Thu, 14 Mar 2013 13:59:52 -0500    

Click here for diff

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

M src/backend/rewrite/rewriteDefine.c

Add regression test for MV join to view.

commit   : 8d7ff13ed5626ecdac2bb0b356445ff4192810aa    
  
author   : Kevin Grittner <kgrittn@postgresql.org>    
date     : Thu, 14 Mar 2013 13:34:51 -0500    
  
committer: Kevin Grittner <kgrittn@postgresql.org>    
date     : Thu, 14 Mar 2013 13:34:51 -0500    

Click here for diff

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

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

Also update psqlscan.l with the UESCAPE error rule changes.

commit   : f7559c0101afa33bfb4e104036ca46adac900111    
  
author   : Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Thu, 14 Mar 2013 20:31:27 +0200    
  
committer: Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Thu, 14 Mar 2013 20:31:27 +0200    

Click here for diff

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

M src/bin/psql/psqlscan.l

Minor fixes for hstore_to_json_loose().

commit   : c2754991ba6e513a07c15b4058df13d58f8c55ba    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 14 Mar 2013 13:51:47 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 14 Mar 2013 13:51:47 -0400    

Click here for diff

Fix unportable use of isdigit(), get rid of useless calculations.  

M contrib/hstore/hstore_io.c

Avoid inserting Result nodes that only compute identity projections.

commit   : 4387cf956b9eb13aad569634e0c4df081d76e2e3    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 14 Mar 2013 13:42:51 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 14 Mar 2013 13:42:51 -0400    

Click here for diff

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

M src/backend/optimizer/plan/createplan.c
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/alter_table.out
M src/test/regress/expected/inherit.out
M src/test/regress/expected/union.out

Change the way UESCAPE is lexed, to reduce the size of the flex tables.

commit   : a5ff502fceadc7c203b0d7a11b45c73f1b421f69    
  
author   : Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Thu, 14 Mar 2013 19:00:09 +0200    
  
committer: Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Thu, 14 Mar 2013 19:00:09 +0200    

Click here for diff

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

M src/backend/parser/scan.l

Add cost estimation of range @> and <@ operators.

commit   : 59d0bf9dca58b237902c2fd1507e8bc5d54d4a63    
  
author   : Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Thu, 14 Mar 2013 15:36:56 +0200    
  
committer: Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Thu, 14 Mar 2013 15:36:56 +0200    

Click here for diff

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

M src/backend/utils/adt/rangetypes_selfuncs.c
M src/backend/utils/adt/rangetypes_typanalyze.c
M src/include/catalog/catversion.h
M src/include/catalog/pg_operator.h
M src/include/catalog/pg_statistic.h

Add regression tests for XML mapping of domains

commit   : 788bce13d3249ddbcdf3443ee078145f4888ab45    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Wed, 13 Mar 2013 22:42:57 -0400    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
date     : Wed, 13 Mar 2013 22:42:57 -0400    

Click here for diff

Pavel Stěhule  

M src/test/regress/expected/xmlmap.out
M src/test/regress/expected/xmlmap_1.out
M src/test/regress/sql/xmlmap.sql

Fix bug in dumping prior releases due to MV REFRESH dependency checking.

commit   : a18b72adcd3632aa21ebf84cc6ed1caf46ba43da    
  
author   : Kevin Grittner <kgrittn@postgresql.org>    
date     : Wed, 13 Mar 2013 20:20:32 -0500    
  
committer: Kevin Grittner <kgrittn@postgresql.org>    
date     : Wed, 13 Mar 2013 20:20:32 -0500    

Click here for diff

Reports and suggested patches from Fujii Masao and Andrew Dunstan.  
  
Andrew Dunstan  

M src/bin/pg_dump/pg_dump.c

Introduce less-bogus handling of collations in contrib/postgres_fdw.

commit   : ed3ddf918b59545583a4b374566bc1148e75f593    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Wed, 13 Mar 2013 19:46:31 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Wed, 13 Mar 2013 19:46:31 -0400    

Click here for diff

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

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

Fix documentation oversight.

commit   : 209f675f0f9094015414eee39c435ed3bf65d82a    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Tue, 12 Mar 2013 19:06:43 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Tue, 12 Mar 2013 19:06:43 -0400    

Click here for diff

Mention that PlanForeignModify's result must be copiable by copyObject.  

M doc/src/sgml/fdwhandler.sgml

Fix contrib/postgres_fdw's handling of column defaults.

commit   : 50c19fc76f05124b80fc4c5d20a359c5dbf017af    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Tue, 12 Mar 2013 18:58:13 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Tue, 12 Mar 2013 18:58:13 -0400    

Click here for diff

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

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

Allow default expressions to be attached to columns of foreign tables.

commit   : a0c6dfeecfcc860858b04617a9d96eaee1d82c66    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Tue, 12 Mar 2013 17:37:07 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Tue, 12 Mar 2013 17:37:07 -0400    

Click here for diff

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

M doc/src/sgml/ref/alter_foreign_table.sgml
M doc/src/sgml/ref/create_foreign_table.sgml
M src/backend/commands/tablecmds.c
M src/backend/parser/gram.y
M src/backend/parser/parse_utilcmd.c
M src/test/regress/expected/foreign_data.out
M src/test/regress/sql/foreign_data.sql

Fix orthotypographical mistake

commit   : 1ba0119308e74e522c75662147d89d154f45bb5d    
  
author   : Alvaro Herrera <alvherre@alvh.no-ip.org>    
date     : Tue, 12 Mar 2013 11:57:22 -0300    
  
committer: Alvaro Herrera <alvherre@alvh.no-ip.org>    
date     : Tue, 12 Mar 2013 11:57:22 -0300    

Click here for diff

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

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

Avoid row-processing-order dependency in postgres_fdw regression test.

commit   : 0247d43dd9c4ba3d2e121f98e3d5adcf769ab1e3    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Tue, 12 Mar 2013 10:47:04 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Tue, 12 Mar 2013 10:47:04 -0400    

Click here for diff

A test intended to provoke an error on the remote side was coded in such  
a way that multiple rows should be updated, so the output would vary  
depending on which one was processed first.  Per buildfarm.  

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

Fix postgres_fdw's issues with inconsistent interpretation of data values.

commit   : cc3f281ffb0a5d9b187e7a7b7de4a045809ff683    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Mon, 11 Mar 2013 21:31:28 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Mon, 11 Mar 2013 21:31:28 -0400    

Click here for diff

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

M contrib/postgres_fdw/connection.c
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

Avoid generating bad remote SQL for INSERT ... DEFAULT VALUES.

commit   : 8f9cc41daf08be802933dc788517743719ee0949    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Mon, 11 Mar 2013 14:26:05 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Mon, 11 Mar 2013 14:26:05 -0400    

Click here for diff

"INSERT INTO foo() VALUES ()" is invalid syntax, so don't do that.  

M contrib/postgres_fdw/deparse.c

Fix thinko in matview patch.

commit   : 41eef0ff75c3ea905513ae46f795c0409635fac8    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Mon, 11 Mar 2013 12:00:24 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Mon, 11 Mar 2013 12:00:24 -0400    

Click here for diff

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

M src/backend/rewrite/rewriteHandler.c

JSON generation improvements.

commit   : 38fb4d978c5bfc377ef979e2595e3472744a3b05    
  
author   : Andrew Dunstan <andrew@dunslane.net>    
date     : Sun, 10 Mar 2013 17:35:36 -0400    
  
committer: Andrew Dunstan <andrew@dunslane.net>    
date     : Sun, 10 Mar 2013 17:35:36 -0400    

Click here for diff

This adds the following:  
  
    json_agg(anyrecord) -> json  
    to_json(any) -> json  
    hstore_to_json(hstore) -> json (also used as a cast)  
    hstore_to_json_loose(hstore) -> json  
  
The last provides heuristic treatment of numbers and booleans.  
  
Also, in json generation, if any non-builtin type has a cast to json,  
that function is used instead of the type's output function.  
  
Andrew Dunstan, reviewed by Steve Singer.  
  
Catalog version bumped.  

M contrib/hstore/expected/hstore.out
M contrib/hstore/hstore–1.1.sql
M contrib/hstore/hstore_io.c
M contrib/hstore/sql/hstore.sql
M doc/src/sgml/func.sgml
M doc/src/sgml/hstore.sgml
M src/backend/utils/adt/json.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/sql/json.sql

doc: Add note about checkpoint_warning vs checkpoint_timeout

commit   : dd28c410f77e415ce104cb42bf52c4a5457085da    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Sun, 10 Mar 2013 17:16:18 -0400    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
date     : Sun, 10 Mar 2013 17:16:18 -0400    

Click here for diff

suggested by Tianyin Xu  

M doc/src/sgml/config.sgml

pg_ctl: Adjust nls.mk for split out of wait_error.c

commit   : 31531325a4d374e6470b51e4b1dbc3cdc78f7d6e    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Sun, 10 Mar 2013 16:54:27 -0400    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
date     : Sun, 10 Mar 2013 16:54:27 -0400    

Click here for diff

M src/bin/pg_ctl/nls.mk

pg_basebackup: Add missing newlines to several error messages

commit   : 74e629cb0987fd3505173c4e117108e079e7e930    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Sun, 10 Mar 2013 16:53:04 -0400    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
date     : Sun, 10 Mar 2013 16:53:04 -0400    

Click here for diff

M src/bin/pg_basebackup/pg_basebackup.c
M src/bin/pg_basebackup/receivelog.c

Band-aid for regression test expected-results problem with timestamptz.

commit   : f7951eef89be78c50ea2241f593d76dfefe176c9    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sun, 10 Mar 2013 15:07:38 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sun, 10 Mar 2013 15:07:38 -0400    

Click here for diff

We probably need to tell the remote server to use specific timezone and  
datestyle settings, and maybe other things.  But for now let's just hack  
the postgres_fdw regression test to not provoke failures when run in  
non-EST5EDT environments.  Per buildfarm.  

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

Support writable foreign tables.

commit   : 21734d2fb896e0ecdddd3251caa72a3576e2d415    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sun, 10 Mar 2013 14:14:53 -0400    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sun, 10 Mar 2013 14:14:53 -0400    

Click here for diff

This patch adds the core-system infrastructure needed to support updates  
on foreign tables, and extends contrib/postgres_fdw to allow updates  
against remote Postgres servers.  There's still a great deal of room for  
improvement in optimization of remote updates, but at least there's basic  
functionality there now.  
  
KaiGai Kohei, reviewed by Alexander Korotkov and Laurenz Albe, and rather  
heavily revised by Tom Lane.  

M contrib/file_fdw/input/file_fdw.source
M contrib/file_fdw/output/file_fdw.source
M contrib/postgres_fdw/connection.c
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
M doc/src/sgml/ddl.sgml
M doc/src/sgml/fdwhandler.sgml
M doc/src/sgml/file-fdw.sgml
M doc/src/sgml/postgres-fdw.sgml
M doc/src/sgml/ref/create_foreign_data_wrapper.sgml
M src/backend/commands/copy.c
M src/backend/commands/explain.c
M src/backend/executor/execMain.c
M src/backend/executor/nodeForeignscan.c
M src/backend/executor/nodeModifyTable.c
M src/backend/nodes/copyfuncs.c
M src/backend/nodes/outfuncs.c
M src/backend/optimizer/plan/createplan.c
M src/backend/optimizer/plan/planner.c
M src/backend/optimizer/prep/preptlist.c
M src/backend/parser/analyze.c
M src/backend/rewrite/rewriteHandler.c
M src/include/foreign/fdwapi.h
M src/include/nodes/execnodes.h
M src/include/nodes/plannodes.h
M src/include/optimizer/planmain.h

Report pg_hba line number and contents when users fail to log in

commit   : 7f49a67f954db3e92fd96963169fb8302959576e    
  
author   : Magnus Hagander <magnus@hagander.net>    
date     : Sun, 10 Mar 2013 15:54:37 +0100    
  
committer: Magnus Hagander <magnus@hagander.net>    
date     : Sun, 10 Mar 2013 15:54:37 +0100    

Click here for diff

Instead of just reporting which user failed to log in, log both the  
line number in the active pg_hba.conf file (which may not match reality  
in case the file has been edited and not reloaded) and the contents of  
the matching line (which will always be correct), to make it easier  
to debug incorrect pg_hba.conf files.  
  
The message to the client remains unchanged and does not include this  
information, to prevent leaking security sensitive information.  
  
Reviewed by Tom Lane and Dean Rasheed  

M src/backend/libpq/auth.c
M src/backend/libpq/hba.c
M src/include/libpq/hba.h

Forgot catversion bump in the SP-GiST adjacent support patch.

commit   : 96443d142002a6c17ee51fa0633ee5de3bffdc83    
  
author   : Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Fri, 8 Mar 2013 17:12:38 +0200    
  
committer: Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Fri, 8 Mar 2013 17:12:38 +0200    

Click here for diff

M src/include/catalog/catversion.h

SP-GiST support of the range adjacent operator -|-

commit   : 23f10b6473ed58c3699b81ca4677f4ff51878ec0    
  
author   : Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Fri, 8 Mar 2013 15:03:19 +0200    
  
committer: Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Fri, 8 Mar 2013 15:03:19 +0200    

Click here for diff

Alexander Korotkov, reviewed by Jeff Davis.  

M src/backend/utils/adt/rangetypes.c
M src/backend/utils/adt/rangetypes_spgist.c
M src/include/catalog/pg_amop.h
M src/include/utils/rangetypes.h
M src/test/regress/expected/opr_sanity.out

Remove unnecessary #ifdef FRONTEND check to choose between strdup and pstrdup.

commit   : 2443a26b9b905e66cd9b95a2faf57e1f1ebcafb1    
  
author   : Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Fri, 8 Mar 2013 11:21:44 +0200    
  
committer: Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Fri, 8 Mar 2013 11:21:44 +0200    

Click here for diff

The libpgcommon patch made that unnecessary, palloc and friends are now  
available in frontend programs too, mapped to plain old malloc.  
  
As pointed out by Alvaro Herrera.  

M src/port/wait_error.c

Fix typo in docs for ALTER MATERIALIZED VIEW.

commit   : 71877c18a869b858f69e813659ed4bb22b117c4a    
  
author   : Kevin Grittner <kgrittn@postgresql.org>    
date     : Thu, 7 Mar 2013 11:39:36 -0600    
  
committer: Kevin Grittner <kgrittn@postgresql.org>    
date     : Thu, 7 Mar 2013 11:39:36 -0600    

Click here for diff

Fujii Masao  

M doc/src/sgml/ref/alter_materialized_view.sgml

Fix infinite-loop risk in fixempties() stage of regex compilation.

commit   : a7b61d4f5af37344f8973b2dfce47e2ba2680061    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 7 Mar 2013 11:51:03 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 7 Mar 2013 11:51:03 -0500    

Click here for diff

The previous coding of this function could get into situations where it  
would never terminate, because successive passes would re-add EMPTY arcs  
that had been removed by the previous pass.  Rewrite the function  
completely using a new algorithm that is guaranteed to terminate, and  
also seems to be usually faster than the old one.  Per Tcl bugs 3604074  
and 3606683.  
  
Tom Lane and Don Porter  

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

Fix tli history file fetching, broken by the archive after crash recevery patch.

commit   : 7ccefe8610db8b339bad2c5b51abc07448a32947    
  
author   : Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Thu, 7 Mar 2013 12:18:41 +0200    
  
committer: Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Thu, 7 Mar 2013 12:18:41 +0200    

Click here for diff

If we were about to enter archive recovery after crash recovery, we scanned  
the archive for the latest tli history file, and set the recovery target  
timeline to that. However, when we actually tried to read the history file,  
we would not fetch the file from the archive, because we were not in archive  
recovery yet.  
  
To fix, make readTimeLineHistory and existsTimeLineHistory to always fetch  
the file from archive if archive recovery is requested, even if we're not in  
archive recovery yet.  
  
Backpatch to 9.2. Mitsumasa KONDO  

M src/backend/access/transam/timeline.c
M src/backend/access/transam/xlog.c
M src/include/access/xlog_internal.h

Arrange to cache FdwRoutine structs in foreign tables' relcache entries.

commit   : 1908abc4a37d397356c9cdf0fd31c33a86281d63    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Wed, 6 Mar 2013 23:47:38 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Wed, 6 Mar 2013 23:47:38 -0500    

Click here for diff

This saves several catalog lookups per reference.  It's not all that  
exciting right now, because we'd managed to minimize the number of places  
that need to fetch the data; but the upcoming writable-foreign-tables patch  
needs this info in a lot more places.  

M src/backend/commands/analyze.c
M src/backend/executor/nodeForeignscan.c
M src/backend/foreign/foreign.c
M src/backend/optimizer/path/allpaths.c
M src/backend/optimizer/util/plancat.c
M src/backend/utils/cache/relcache.c
M src/include/foreign/fdwapi.h
M src/include/utils/rel.h

Add fe_memutils.c to nls.mk where used

commit   : 97951139164055d6bae5aae7ea058c28e1462253    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Wed, 6 Mar 2013 23:45:16 -0500    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
date     : Wed, 6 Mar 2013 23:45:16 -0500    

Click here for diff

M src/bin/initdb/nls.mk
M src/bin/pg_basebackup/nls.mk
M src/bin/pg_ctl/nls.mk
M src/bin/pg_dump/nls.mk
M src/bin/psql/nls.mk
M src/bin/scripts/nls.mk

Code beautification for object-access hook machinery.

commit   : f90cc269823ba5282341a197c7387f5ada6703a6    
  
author   : Robert Haas <rhaas@postgresql.org>    
date     : Wed, 6 Mar 2013 20:52:06 -0500    
  
committer: Robert Haas <rhaas@postgresql.org>    
date     : Wed, 6 Mar 2013 20:52:06 -0500    

Click here for diff

KaiGai Kohei  

M src/backend/catalog/Makefile
M src/backend/catalog/dependency.c
M src/backend/catalog/heap.c
M src/backend/catalog/index.c
A src/backend/catalog/objectaccess.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_namespace.c
M src/backend/catalog/pg_operator.c
M src/backend/catalog/pg_proc.c
M src/backend/catalog/pg_type.c
M src/backend/commands/aggregatecmds.c
M src/backend/commands/dbcommands.c
M src/backend/commands/event_trigger.c
M src/backend/commands/extension.c
M src/backend/commands/foreigncmds.c
M src/backend/commands/functioncmds.c
M src/backend/commands/opclasscmds.c
M src/backend/commands/proclang.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/user.c
M src/backend/rewrite/rewriteDefine.c
M src/backend/storage/large_object/inv_api.c
M src/backend/utils/init/globals.c
M src/include/catalog/objectaccess.h

Adjust nls.mk for split out of wait_error.c

commit   : f11af2bcab36b51a7e41df7986d6f030459d7d09    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Wed, 6 Mar 2013 20:25:25 -0500    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
date     : Wed, 6 Mar 2013 20:25:25 -0500    

Click here for diff

M src/bin/initdb/nls.mk
M src/bin/psql/nls.mk

Fix missing #include in commands/matview.h.

commit   : e11cb8ba2c9134c9f16253213f2f0cf089c5838e    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Wed, 6 Mar 2013 18:20:51 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Wed, 6 Mar 2013 18:20:51 -0500    

Click here for diff

It needs parsenodes.h to be compilable regardless of previous headers.  

M src/include/commands/matview.h

WAL-log the extension of a new empty MV heap which is being populated.

commit   : c5bf7a2052c8e7ebbd1ca3986525c3629d7345d1    
  
author   : Kevin Grittner <kgrittn@postgresql.org>    
date     : Wed, 6 Mar 2013 17:15:34 -0600    
  
committer: Kevin Grittner <kgrittn@postgresql.org>    
date     : Wed, 6 Mar 2013 17:15:34 -0600    

Click here for diff

This page with no tuples is used to distinguish an MV containing a  
zero-row resultset of its backing query from an MV which has not  
been populated by its backing query.  Unless WAL-logged, recovery  
and hot standby don't work correctly with what should be an empty  
but scannable materialized view.  
  
Fixes bugs reported by Fujii Masao in testing MVs on hot standby.  

M src/backend/commands/matview.c

Add docs for pg_matviews, which were missed in the initial MV commit.

commit   : 5141603ebd162a50c36583f1a80eceadc94ef25e    
  
author   : Kevin Grittner <kgrittn@postgresql.org>    
date     : Wed, 6 Mar 2013 15:35:59 -0600    
  
committer: Kevin Grittner <kgrittn@postgresql.org>    
date     : Wed, 6 Mar 2013 15:35:59 -0600    

Click here for diff

M doc/src/sgml/catalogs.sgml

Fix broken pg_dump for 9.0 and 9.1 caused by the MV patch.

commit   : cfa3df3de14b437d5f1691d1636a57c9ec595f51    
  
author   : Kevin Grittner <kgrittn@postgresql.org>    
date     : Wed, 6 Mar 2013 09:51:49 -0600    
  
committer: Kevin Grittner <kgrittn@postgresql.org>    
date     : Wed, 6 Mar 2013 09:51:49 -0600    

Click here for diff

Per report and suggestion from Bernd Helmle  

M src/bin/pg_dump/pg_dump.c

Fix message typo.

commit   : cd340ca89a06d6386f1af3b519db6f77c21ac84e    
  
author   : Andrew Dunstan <andrew@dunslane.net>    
date     : Wed, 6 Mar 2013 09:53:38 -0500    
  
committer: Andrew Dunstan <andrew@dunslane.net>    
date     : Wed, 6 Mar 2013 09:53:38 -0500    

Click here for diff

M src/tools/msvc/vcregress.pl

pg_ctl: Add comma to message

commit   : 71ea7e9737c1817cfa1747b181b27e73ce620f3b    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Tue, 5 Mar 2013 23:22:12 -0500    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
date     : Tue, 5 Mar 2013 23:22:12 -0500    

Click here for diff

M src/bin/pg_ctl/pg_ctl.c

Remove dependency on the DLL of pythonxx.def file.

commit   : 0d147e43adcf5d2bff9caa073608f381a27439bf    
  
author   : Andrew Dunstan <andrew@dunslane.net>    
date     : Tue, 5 Mar 2013 19:24:29 -0500    
  
committer: Andrew Dunstan <andrew@dunslane.net>    
date     : Tue, 5 Mar 2013 19:24:29 -0500    

Click here for diff

This confused Cygwin's make because of the colon in the path. The  
DLL isn't likely to change under us so preserving the dependency  
doesn't gain us much, and it's useful to be able to do a native  
Windows build with the Cygwin mingw toolset.  
  
Noah Misch.  

M src/pl/plpython/Makefile

Fix to_char() to use ASCII-only case-folding rules where appropriate.

commit   : 80b011ef0a13bb326861f79ba987b4fa04ae4a27    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Tue, 5 Mar 2013 13:02:30 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Tue, 5 Mar 2013 13:02:30 -0500    

Click here for diff

formatting.c used locale-dependent case folding rules in some code paths  
where the result isn't supposed to be locale-dependent, for example  
to_char(timestamp, 'DAY').  Since the source data is always just ASCII  
in these cases, that usually didn't matter ... but it does matter in  
Turkish locales, which have unusual treatment of "i" and "I".  To confuse  
matters even more, the misbehavior was only visible in UTF8 encoding,  
because in single-byte encodings we used pg_toupper/pg_tolower which  
don't have locale-specific behavior for ASCII characters.  Fix by providing  
intentionally ASCII-only case-folding functions and using these where  
appropriate.  Per bug #7913 from Adnan Dursun.  Back-patch to all active  
branches, since it's been like this for a long time.  

M src/backend/utils/adt/formatting.c
M src/include/utils/formatting.h

Bump catversion because of new function in the materialized view patch.

commit   : c8056592bcbed183fb03266d22fa1073bc8b04b4    
  
author   : Kevin Grittner <kgrittn@postgresql.org>    
date     : Tue, 5 Mar 2013 05:32:03 -0600    
  
committer: Kevin Grittner <kgrittn@postgresql.org>    
date     : Tue, 5 Mar 2013 05:32:03 -0600    

Click here for diff

M src/include/catalog/catversion.h

Fix overflow check in tm2timestamp (this time for sure).

commit   : 542eeba26992305d872be699158cb3ab1c2be6e6    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Mon, 4 Mar 2013 15:13:31 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Mon, 4 Mar 2013 15:13:31 -0500    

Click here for diff

I fixed this code back in commit 841b4a2d5, but didn't think carefully  
enough about the behavior near zero, which meant it improperly rejected  
1999-12-31 24:00:00.  Per report from Magnus Hagander.  

M src/backend/utils/adt/timestamp.c
M src/interfaces/ecpg/pgtypeslib/timestamp.c

psql: Let \l accept a pattern

commit   : 0ea1f6e98fc84f1c5f66cc6355f6e20582295e81    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Sun, 3 Mar 2013 22:17:08 -0500    
  
committer: Magnus Hagander <magnus@hagander.net>    
date     : Sun, 3 Mar 2013 22:17:08 -0500    

Click here for diff

reviewed by Satoshi Nagayasu  

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
M src/bin/psql/help.c
M src/bin/psql/startup.c

Remove accidentally-committed .orig file.

commit   : 54d6706ded5c612a7f9b16eb6ddb08f44e24bb70    
  
author   : Kevin Grittner <kgrittn@postgresql.org>    
date     : Sun, 3 Mar 2013 18:38:44 -0600    
  
committer: Magnus Hagander <magnus@hagander.net>    
date     : Sun, 3 Mar 2013 18:38:44 -0600    

Click here for diff

D src/backend/rewrite/rewriteDefine.c.orig

Fix map_sql_value_to_xml_value() to treat domains like their base types.

commit   : bc61878682051678ade5f59da7bfd90ab72ce13b    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sun, 3 Mar 2013 19:32:12 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sun, 3 Mar 2013 19:32:12 -0500    

Click here for diff

This was already the case for domains over arrays, but not for domains  
over certain built-in types such as boolean.  The special formatting  
rules for those types should apply to domains over them as well.  
Per discussion.  
  
While this is a bug fix, it's also a behavioral change that seems likely  
to trip up some applications.  So no back-patch.  
  
Pavel Stehule  

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

Add a materialized view relations.

commit   : 3bf3ab8c563699138be02f9dc305b7b77a724307    
  
author   : Kevin Grittner <kgrittn@postgresql.org>    
date     : Sun, 3 Mar 2013 18:23:31 -0600    
  
committer: Kevin Grittner <kgrittn@postgresql.org>    
date     : Sun, 3 Mar 2013 18:23:31 -0600    

Click here for diff

A materialized view has a rule just like a view and a heap and  
other physical properties like a table.  The rule is only used to  
populate the table, references in queries refer to the  
materialized data.  
  
This is a minimal implementation, but should still be useful in  
many cases.  Currently data is only populated "on demand" by the  
CREATE MATERIALIZED VIEW and REFRESH MATERIALIZED VIEW statements.  
It is expected that future releases will add incremental updates  
with various timings, and that a more refined concept of defining  
what is "fresh" data will be developed.  At some point it may even  
be possible to have queries use a materialized in place of  
references to underlying tables, but that requires the other  
above-mentioned features to be working first.  
  
Much of the documentation work by Robert Haas.  
Review by Noah Misch, Thom Brown, Robert Haas, Marko Tiikkaja  
Security review by KaiGai Kohei, with a decision on how best to  
implement sepgsql still pending.  

M contrib/oid2name/oid2name.c
M contrib/pg_upgrade/info.c
M contrib/pg_upgrade/pg_upgrade.c
M contrib/pg_upgrade/version_old_8_3.c
M contrib/pgstattuple/pgstattuple.c
M contrib/vacuumlo/vacuumlo.c
M doc/src/sgml/catalogs.sgml
M doc/src/sgml/func.sgml
M doc/src/sgml/ref/allfiles.sgml
M doc/src/sgml/ref/alter_extension.sgml
A doc/src/sgml/ref/alter_materialized_view.sgml
M doc/src/sgml/ref/comment.sgml
M doc/src/sgml/ref/create_index.sgml
A doc/src/sgml/ref/create_materialized_view.sgml
M doc/src/sgml/ref/create_table_as.sgml
M doc/src/sgml/ref/create_view.sgml
A doc/src/sgml/ref/drop_materialized_view.sgml
A doc/src/sgml/ref/refresh_materialized_view.sgml
M doc/src/sgml/ref/security_label.sgml
M doc/src/sgml/reference.sgml
M doc/src/sgml/rules.sgml
M src/backend/access/common/reloptions.c
M src/backend/access/heap/heapam.c
M src/backend/access/heap/tuptoaster.c
M src/backend/catalog/aclchk.c
M src/backend/catalog/dependency.c
M src/backend/catalog/heap.c
M src/backend/catalog/objectaddress.c
M src/backend/catalog/system_views.sql
M src/backend/catalog/toasting.c
M src/backend/commands/Makefile
M src/backend/commands/alter.c
M src/backend/commands/analyze.c
M src/backend/commands/cluster.c
M src/backend/commands/comment.c
M src/backend/commands/copy.c
M src/backend/commands/createas.c
M src/backend/commands/event_trigger.c
M src/backend/commands/explain.c
M src/backend/commands/indexcmds.c
A src/backend/commands/matview.c
M src/backend/commands/prepare.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/commands/view.c
M src/backend/executor/execMain.c
M src/backend/executor/spi.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/optimizer/plan/planner.c
M src/backend/optimizer/util/plancat.c
M src/backend/parser/analyze.c
M src/backend/parser/gram.y
M src/backend/parser/parse_utilcmd.c
M src/backend/postmaster/autovacuum.c
M src/backend/postmaster/pgstat.c
M src/backend/rewrite/rewriteDefine.c
A src/backend/rewrite/rewriteDefine.c.orig
M src/backend/rewrite/rewriteHandler.c
M src/backend/storage/lmgr/predicate.c
M src/backend/tcop/dest.c
M src/backend/tcop/utility.c
M src/backend/utils/adt/dbsize.c
M src/backend/utils/adt/xml.c
M src/backend/utils/cache/relcache.c
M src/bin/initdb/initdb.c
M src/bin/pg_dump/common.c
M src/bin/pg_dump/pg_backup_archiver.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/psql/command.c
M src/bin/psql/describe.c
M src/bin/psql/help.c
M src/bin/psql/tab-complete.c
M src/include/catalog/heap.h
M src/include/catalog/pg_class.h
M src/include/catalog/pg_proc.h
M src/include/commands/createas.h
M src/include/commands/explain.h
A src/include/commands/matview.h
M src/include/commands/tablecmds.h
M src/include/commands/view.h
M src/include/executor/executor.h
M src/include/nodes/nodes.h
M src/include/nodes/parsenodes.h
M src/include/nodes/primnodes.h
M src/include/parser/kwlist.h
M src/include/tcop/dest.h
M src/include/utils/builtins.h
M src/include/utils/rel.h
M src/pl/plpgsql/src/pl_comp.c
M src/pl/tcl/pltcl.c
A src/test/regress/expected/matview.out
M src/test/regress/expected/rules.out
M src/test/regress/output/misc.source
M src/test/regress/parallel_schedule
M src/test/regress/serial_schedule
A src/test/regress/sql/matview.sql

Get rid of any toast table when converting a table to a view.

commit   : b15a6da29217b14f02895af1d9271e84415a91ae    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sun, 3 Mar 2013 19:05:47 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sun, 3 Mar 2013 19:05:47 -0500    

Click here for diff

Also make sure other fields of the view's pg_class entry are appropriate  
for a view; it shouldn't have relfrozenxid set for instance.  
  
This ancient omission isn't believed to have any serious consequences in  
versions 8.4-9.2, so no backpatch.  But let's fix it before it does bite  
us in some serious way.  It's just luck that the case doesn't cause  
problems for autovacuum.  (It did cause problems in 8.3, but that's out  
of support.)  
  
Andres Freund  

M src/backend/rewrite/rewriteDefine.c
M src/backend/rewrite/rewriteSupport.c
M src/include/rewrite/rewriteSupport.h
M src/test/regress/expected/rules.out
M src/test/regress/sql/rules.sql

Fix SQL function execution to be safe with long-lived FmgrInfos.

commit   : 2b78d101d1d6b1d8533a7b7aeff4d82b10a915f8    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sun, 3 Mar 2013 17:39:58 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sun, 3 Mar 2013 17:39:58 -0500    

Click here for diff

fmgr_sql had been designed on the assumption that the FmgrInfo it's called  
with has only query lifespan.  This is demonstrably unsafe in connection  
with range types, as shown in bug #7881 from Andrew Gierth.  Fix things  
so that we re-generate the function's cache data if the (sub)transaction  
it was made in is no longer active.  
  
Back-patch to 9.2.  This might be needed further back, but it's not clear  
whether the case can realistically arise without range types, so for now  
I'll desist from back-patching further.  

M src/backend/access/transam/xact.c
M src/backend/executor/functions.c
M src/include/access/xact.h

doc: Small tweak for consistency

commit   : 891869c352160e480d4afdc2a3443035c2560282    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Sun, 3 Mar 2013 08:58:34 -0500    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
date     : Sun, 3 Mar 2013 08:58:34 -0500    

Click here for diff

submitted by "Lyle"  

M doc/src/sgml/datatype.sgml

doc: A few awkward phrasing fixes

commit   : 743b73bdf57a21d39cf764d92536b4080fb2925a    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Sun, 3 Mar 2013 08:49:49 -0500    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
date     : Sun, 3 Mar 2013 08:49:49 -0500    

Click here for diff

Josh Kupershmidt  

M doc/src/sgml/docguide.sgml
M doc/src/sgml/ref/pg_basebackup.sgml

Exclude utils/probes.h and pg_trace.h from cpluspluscheck

commit   : 1275b88f711c663e3b7a77c7526a934752efe52d    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Fri, 1 Mar 2013 22:43:47 -0500    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
date     : Fri, 1 Mar 2013 22:43:47 -0500    

Click here for diff

They can include sys/sdt.h from SystemTap, which itself contains C++  
code and so won't compile with a C++ compiler under extern "C" linkage.  

M src/tools/pginclude/cpluspluscheck

Eliminate memory leaks in plperl's spi_prepare() function.

commit   : a4d3a504e730c47ccee5082ee703082e42c8b5ce    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Fri, 1 Mar 2013 21:33:34 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Fri, 1 Mar 2013 21:33:34 -0500    

Click here for diff

Careless use of TopMemoryContext for I/O function data meant that repeated  
use of spi_prepare and spi_freeplan would leak memory at the session level,  
as per report from Christian Schröder.  In addition, spi_prepare  
leaked a lot of transient data within the current plperl function's SPI  
Proc context, which would be a problem for repeated use of spi_prepare  
within a single plperl function call; and it wasn't terribly careful  
about releasing permanent allocations in event of an error, either.  
  
In passing, clean up some copy-and-pasteos in query-lookup error messages.  
  
Alex Hunsaker and Tom Lane  

M src/pl/plperl/plperl.c

Improve pg_upgrade commentary on multixact change

commit   : cd7d00ad65fab11496ad9990cfc145c06c6ee53d    
  
author   : Alvaro Herrera <alvherre@alvh.no-ip.org>    
date     : Thu, 28 Feb 2013 16:29:17 -0300    
  
committer: Alvaro Herrera <alvherre@alvh.no-ip.org>    
date     : Thu, 28 Feb 2013 16:29:17 -0300    

Click here for diff

Per gripe from Andres Freund  

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

Flush stderr and stdout in isolation tester.

commit   : 63d283ecd0bc5078594a64dfbae29276072cdf45    
  
author   : Andrew Dunstan <andrew@dunslane.net>    
date     : Wed, 27 Feb 2013 19:13:07 -0500    
  
committer: Andrew Dunstan <andrew@dunslane.net>    
date     : Wed, 27 Feb 2013 19:13:07 -0500    

Click here for diff

This is a possibly vain attempt to fix a buffering issue  
observed for some MSVC builds.  

M src/test/isolation/isolationtester.c

Remove spurious "the", and add a missing one.

commit   : 7d6b8f7158f0ea2e55b42c1db1d31991e3c67572    
  
author   : Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Wed, 27 Feb 2013 21:50:15 +0200    
  
committer: Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Wed, 27 Feb 2013 21:50:15 +0200    

Click here for diff

Thom Brown and me.  

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

Fix MSVC build.

commit   : f70b1b274824e5116c8e993d274629d3934b3978    
  
author   : Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Wed, 27 Feb 2013 21:31:41 +0200    
  
committer: Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Wed, 27 Feb 2013 21:31:41 +0200    

Click here for diff

The new file in src/port needs to be listed in Mkvcbuild.pm as well.  

M src/tools/msvc/Mkvcbuild.pm

Fix typo in "pg_xlogdump --help" and error message.

commit   : 26b45dc54f379c4e7b44b308584dc14d0ed17482    
  
author   : Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Wed, 27 Feb 2013 21:27:01 +0200    
  
committer: Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Wed, 27 Feb 2013 21:27:01 +0200    

Click here for diff

Fujii Masao and me.  

M contrib/pg_xlogdump/pg_xlogdump.c

Cannot use WL_SOCKET_WRITEABLE without WL_SOCKET_READABLE.

commit   : 3a9e64aa0d96c8ffb6c682b082d0f72b1d373327    
  
author   : Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Wed, 27 Feb 2013 19:17:07 +0200    
  
committer: Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Wed, 27 Feb 2013 19:17:07 +0200    

Click here for diff

In copy-out mode, the frontend should not send any messages until the  
backend has finished streaming, by sending a CopyDone message. I'm not sure  
if it would be legal for the client to send a new query before receiving the  
CopyDone message from the backend, but trying to support that would require  
bigger changes to the backend code structure.  
  
Fixes an assertion failure reported by Fujii Masao.  

M src/backend/replication/walsender.c

Add standard file header comment to quotes.c.

commit   : 5ddf38f21d3f34c794de2d1c9b61ba92a7d6f39c    
  
author   : Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Wed, 27 Feb 2013 18:42:40 +0200    
  
committer: Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Wed, 27 Feb 2013 18:42:40 +0200    

Click here for diff

M src/port/quotes.c

Add support for piping COPY to/from an external program.

commit   : 3d009e45bde2a2681826ef549637ada76508b597    
  
author   : Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Wed, 27 Feb 2013 18:17:21 +0200    
  
committer: Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Wed, 27 Feb 2013 18:17:21 +0200    

Click here for diff

This includes backend "COPY TO/FROM PROGRAM '...'" syntax, and corresponding  
psql \copy syntax. Like with reading/writing files, the backend version is  
superuser-only, and in the psql version, the program is run in the client.  
  
In the passing, the psql \copy STDIN/STDOUT syntax is subtly changed: if you  
the stdin/stdout is quoted, it's now interpreted as a filename. For example,  
"\copy foo from 'stdin'" now reads from a file called 'stdin', not from  
standard input. Before this, there was no way to specify a filename called  
stdin, stdout, pstdin or pstdout.  
  
This creates a new function in pgport, wait_result_to_str(), which can  
be used to convert the exit status of a process, as returned by wait(3),  
to a human-readable string.  
  
Etsuro Fujita, reviewed by Amit Kapila.  

M contrib/file_fdw/file_fdw.c
M doc/src/sgml/keywords.sgml
M doc/src/sgml/ref/copy.sgml
M doc/src/sgml/ref/psql-ref.sgml
M src/backend/commands/copy.c
M src/backend/nodes/copyfuncs.c
M src/backend/nodes/equalfuncs.c
M src/backend/parser/gram.y
M src/backend/storage/file/fd.c
M src/bin/psql/copy.c
M src/bin/psql/stringutils.c
M src/bin/psql/stringutils.h
M src/include/commands/copy.h
M src/include/nodes/parsenodes.h
M src/include/parser/kwlist.h
M src/include/port.h
M src/include/storage/fd.h
M src/interfaces/ecpg/preproc/ecpg.addons
M src/port/Makefile
M src/port/exec.c
A src/port/wait_error.c

Add missing error check in regexp parser.

commit   : 73dc003beef859e0b67da463c5e28f5468d3f17f    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Wed, 27 Feb 2013 10:40:03 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Wed, 27 Feb 2013 10:40:03 -0500    

Click here for diff

parseqatom() failed to check for an error return (NULL result) from its  
recursive call to parsebranch(), and in consequence could crash with a  
null-pointer dereference after an error return.  This bug has been there  
since day one, but wasn't noticed before, probably because most error cases  
in parsebranch() didn't actually lead to returning NULL.  Add the missing  
error check, and also tweak parsebranch() to exit in a less indirect  
fashion after a call to parseqatom() fails.  
  
Report by Tomasz Karlik, fix by me.  

M src/backend/regex/regcomp.c

Add missing .gitignore file.

commit   : 08f9728057a485edf5b3a589e70548e1f0da4e53    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Tue, 26 Feb 2013 15:58:34 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Tue, 26 Feb 2013 15:58:34 -0500    

Click here for diff

A contrib/pg_xlogdump/.gitignore

Clean up "stopgap" implementation of timestamptz_to_str().

commit   : 1418e6e07b69766ea1e231917601f18fcf0c2624    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Tue, 26 Feb 2013 15:50:22 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Tue, 26 Feb 2013 15:50:22 -0500    

Click here for diff

Use correct type for "result", fix bogus strftime argument, don't use  
unnecessary static variables, improve comments.  
  
Andres Freund and Tom Lane  

M contrib/pg_xlogdump/compat.c

Install headers from the new src/include/common subdirectory.

commit   : c153530dc10bf5ff6dc5a89249f9cb596dd71a63    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Tue, 26 Feb 2013 15:27:30 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Tue, 26 Feb 2013 15:27:30 -0500    

Click here for diff

This got missed in commit 8396447cdbdff0b62914748de2fec04281dc9114.  
  
Andres Freund  

M src/include/Makefile

Remove the check for COPY TO STDIN and COPY FROM STDOUT from ecpg.

commit   : 0a4fe8a318ed37556dd019def073ccd956645e27    
  
author   : Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Tue, 26 Feb 2013 19:30:15 +0200    
  
committer: Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Tue, 26 Feb 2013 19:30:15 +0200    

Click here for diff

The backend grammar treats STDIN and STDOUT completely interchangeable, so  
that the above accepted. Arguably that was a mistake the backend grammar,  
but it's not ecpg's business to second guess that.  

M src/interfaces/ecpg/preproc/ecpg.addons

doc: Fix markup typo

commit   : 8337e3b4575b1588462c2d74135516fd22f60942    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Mon, 25 Feb 2013 17:58:14 -0500    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
date     : Mon, 25 Feb 2013 17:58:14 -0500    

Click here for diff

M doc/src/sgml/xml2.sgml

Only quote libpq connection string values that need quoting.

commit   : 2953cd6d17210935098c803c52c6df5b12a725b9    
  
author   : Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Mon, 25 Feb 2013 19:53:04 +0200    
  
committer: Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Mon, 25 Feb 2013 19:53:04 +0200    

Click here for diff

There's no harm in excessive quoting per se, but it makes the strings nicer  
to read. The values can get quite unwieldy, when they're first quoted within  
within single-quotes when included in the connection string, and then all  
the single-quotes are escaped when the connection string is passed as a  
shell argument.  

M src/bin/pg_dump/pg_dumpall.c

Add -d option to pg_dumpall, for specifying a connection string.

commit   : 3dee636e0404885d07885d41c0d70e50c784f324    
  
author   : Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Mon, 25 Feb 2013 19:39:10 +0200    
  
committer: Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Mon, 25 Feb 2013 19:39:10 +0200    

Click here for diff

Like with pg_basebackup and pg_receivexlog, it's a bit strange to call the  
option -d/--dbname, when in fact you cannot pass a database name in it.  
  
Original patch by Amit Kapila, heavily modified by me.  

M doc/src/sgml/ref/pg_dumpall.sgml
M src/bin/pg_dump/pg_dumpall.c

Add -d/--dbname option to pg_dump.

commit   : 691e595dd9c7786d37d73ccd327f8c2b6f0dace6    
  
author   : Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Mon, 25 Feb 2013 19:39:04 +0200    
  
committer: Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Mon, 25 Feb 2013 19:39:04 +0200    

Click here for diff

You could already pass a database name just by passing it as the last  
option, without -d. This is an alias for that, like the -d/--dbname option  
in psql and many other client applications. For consistency.  

M doc/src/sgml/ref/pg_dump.sgml
M src/bin/pg_dump/pg_dump.c

Redo MSVC build implementation for pg_xlogdump.

commit   : a64e33f030f3ba379a0d3e22fe6bcda9dc3bbc60    
  
author   : Andrew Dunstan <andrew@dunslane.net>    
date     : Mon, 25 Feb 2013 12:00:53 -0500    
  
committer: Andrew Dunstan <andrew@dunslane.net>    
date     : Mon, 25 Feb 2013 12:00:53 -0500    

Click here for diff

The previous commit didn't work on MSVC editions earlier than  
Visual Studio 2011, apparently. This works by copying files into the  
contrib directory, and making provision to clean them up, which should  
work on all editions.  

M src/tools/msvc/Mkvcbuild.pm
M src/tools/msvc/clean.bat

Add -d option to pg_basebackup and pg_receivexlog, for connection string.

commit   : aa05c37e823a41056273e73f6b3d168009a67c3f    
  
author   : Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Mon, 25 Feb 2013 14:48:27 +0200    
  
committer: Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Mon, 25 Feb 2013 14:48:27 +0200    

Click here for diff

Without this, there's no way to pass arbitrary libpq connection parameters  
to these applications. It's a bit strange that the option is called  
-d/--dbname, when in fact you can *not* pass a database name in it, but it's  
consistent with other client applications where a connection string is also  
passed using -d.  
  
Original patch by Amit Kapila, heavily modified by me.  

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

Provide MSVC build setup for pg_xlogdump.

commit   : 786170d74f30bc8d3017149dc444f3f3e29029a7    
  
author   : Andrew Dunstan <andrew@dunslane.net>    
date     : Sun, 24 Feb 2013 20:28:42 -0500    
  
committer: Andrew Dunstan <andrew@dunslane.net>    
date     : Sun, 24 Feb 2013 20:28:42 -0500    

Click here for diff

M src/tools/msvc/Mkvcbuild.pm

doc: Remove PostgreSQL version number from xml2 deprecation notice

commit   : 3163baa6d2d12c28f45fec60ab313537ea9a43a4    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Sun, 24 Feb 2013 15:38:07 -0500    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
date     : Sun, 24 Feb 2013 15:38:07 -0500    

Click here for diff

It is obviously no longer true.  

M doc/src/sgml/xml2.sgml

Fix build of contrib/pg_xlogdump.

commit   : e5bf0c376ed43feaebbe37519a6b8bc8e795f1d2    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sun, 24 Feb 2013 08:58:00 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sun, 24 Feb 2013 08:58:00 -0500    

Click here for diff

rmgrdesc.c is not auto-generated now, though it apparently was the last  
time the Makefile was updated.  

M contrib/pg_xlogdump/Makefile

Correct tense in log message

commit   : ca9c66660207164d08c5bbeba1a992152275d4e7    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Sat, 23 Feb 2013 23:30:14 -0500    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
date     : Sat, 23 Feb 2013 23:30:14 -0500    

Click here for diff

M src/backend/commands/vacuumlazy.c

Rename postgres_fdw's use_remote_explain option to use_remote_estimate.

commit   : 09a7cd409e762f0430a5d474f4d8d7c962369a8e    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sat, 23 Feb 2013 12:20:48 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sat, 23 Feb 2013 12:20:48 -0500    

Click here for diff

The new name was originally my typo, but per discussion it seems like a  
better name anyway.  So make the code match the docs, not vice versa.  

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

doc: Add more compatibility information for triggers

commit   : 8e8d0f7e80d80c61b09346a84059457aeeeae548    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Sat, 23 Feb 2013 00:28:33 -0500    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
date     : Sat, 23 Feb 2013 00:28:33 -0500    

Click here for diff

Louis-Claude Canon and Josh Kupershmidt  

M doc/src/sgml/ref/create_trigger.sgml

Add quotes to messages

commit   : 4f362926692631a67cd76b747f92389c8f63478e    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Fri, 22 Feb 2013 23:33:07 -0500    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
date     : Fri, 22 Feb 2013 23:33:07 -0500    

Click here for diff

M src/backend/replication/basebackup.c

contrib/Makefile also needs updated

commit   : 36f697cbba44fd55f23727066c3274fd01919640    
  
author   : Alvaro Herrera <alvherre@alvh.no-ip.org>    
date     : Fri, 22 Feb 2013 18:56:42 -0300    
  
committer: Alvaro Herrera <alvherre@alvh.no-ip.org>    
date     : Fri, 22 Feb 2013 18:56:42 -0300    

Click here for diff

Erik Rijkers  

M contrib/Makefile

Fix some typos and grammatical mistakes

commit   : 45919335493291ef43f9b66c81a56d32a562ab5a    
  
author   : Alvaro Herrera <alvherre@alvh.no-ip.org>    
date     : Fri, 22 Feb 2013 18:52:59 -0300    
  
committer: Alvaro Herrera <alvherre@alvh.no-ip.org>    
date     : Fri, 22 Feb 2013 18:52:59 -0300    

Click here for diff

... as well a update copyrights statements to 2013.  
  
Noted by Thom Brown and Peter Geoghegan  

M contrib/pg_xlogdump/compat.c
M contrib/pg_xlogdump/pg_xlogdump.c
M doc/src/sgml/pg_xlogdump.sgml

Fix copy-and-pasteo

commit   : f03a779751f6fc8dc87628d021510c4ec9e1e667    
  
author   : Alvaro Herrera <alvherre@alvh.no-ip.org>    
date     : Fri, 22 Feb 2013 17:03:22 -0300    
  
committer: Alvaro Herrera <alvherre@alvh.no-ip.org>    
date     : Fri, 22 Feb 2013 17:03:22 -0300    

Click here for diff

Harmless, but it's certainly better like this.  
  
Noticed by Andres Freund  

M contrib/pg_xlogdump/pg_xlogdump.c

Add pg_xlogdump contrib program

commit   : 639ed4e84b7493594860f56b78b25fd113e78fd7    
  
author   : Alvaro Herrera <alvherre@alvh.no-ip.org>    
date     : Fri, 22 Feb 2013 16:46:24 -0300    
  
committer: Alvaro Herrera <alvherre@alvh.no-ip.org>    
date     : Fri, 22 Feb 2013 16:46:24 -0300    

Click here for diff

This program relies on rm_desc backend routines and the xlogreader  
infrastructure to emit human-readable rendering of WAL records.  
  
Author: Andres Freund, with many reworks by Álvaro  
Reviewed (in a much earlier version) by Peter Eisentraut  

A contrib/pg_xlogdump/Makefile
A contrib/pg_xlogdump/compat.c
A contrib/pg_xlogdump/pg_xlogdump.c
A contrib/pg_xlogdump/rmgrdesc.c
A contrib/pg_xlogdump/rmgrdesc.h
M doc/src/sgml/contrib.sgml
M doc/src/sgml/filelist.sgml
A doc/src/sgml/pg_xlogdump.sgml
M doc/src/sgml/ref/pg_isready.sgml
M src/include/utils/palloc.h

Fix some planning oversights in postgres_fdw.

commit   : c0c6acdfa055b0c76ea0d1defd4c2c0d5a5c256f    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Fri, 22 Feb 2013 10:56:06 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Fri, 22 Feb 2013 10:56:06 -0500    

Click here for diff

Include eval costs of local conditions in remote-estimate mode, and don't  
assume the remote eval cost is zero in local-estimate mode.  (The best  
we can do with that at the moment is to assume a seqscan, which may well  
be wildly pessimistic ... but zero won't do at all.)  
  
To get a reasonable local estimate, we need to know the relpages count  
for the remote rel, so improve the ANALYZE code to fetch that rather  
than just setting the foreign table's relpages field to zero.  

M contrib/postgres_fdw/deparse.c
M contrib/postgres_fdw/postgres_fdw.c
M contrib/postgres_fdw/postgres_fdw.h

Blind attempt at fixing the non-MSVC Windows builds

commit   : af0a4c5924061869ee3db391900ab745107c966f    
  
author   : Alvaro Herrera <alvherre@alvh.no-ip.org>    
date     : Fri, 22 Feb 2013 11:51:15 -0300    
  
committer: Alvaro Herrera <alvherre@alvh.no-ip.org>    
date     : Fri, 22 Feb 2013 11:51:15 -0300    

Click here for diff

Apparently, they need -DBUILDING_DLL for the Assert() declarations to  
work correctly.  

M src/makefiles/Makefile.cygwin
M src/makefiles/Makefile.win32

Fix whole-row references in postgres_fdw.

commit   : 6da378dbc97f1b96bf5778a558e168a0dc405bce    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Fri, 22 Feb 2013 09:21:50 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Fri, 22 Feb 2013 09:21:50 -0500    

Click here for diff

The optimization to not retrieve unnecessary columns wasn't smart enough.  
Noted by Thom Brown.  

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

Change postgres_fdw to show casts as casts, not underlying function calls.

commit   : 211e157a51bf94dfcc143e78221951411f87e4b2    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Fri, 22 Feb 2013 07:30:21 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Fri, 22 Feb 2013 07:30:21 -0500    

Click here for diff

On reflection this method seems to be exposing an unreasonable amount of  
implementation detail.  It wouldn't matter when talking to a remote server  
of the identical Postgres version, but it seems likely to make things worse  
not better if the remote is a different version with different casting  
infrastructure.  Instead adopt ruleutils.c's policy of regurgitating the  
cast as it was originally specified; including not showing it at all, if  
it was implicit to start with.  (We must do that because for some datatypes  
explicit and implicit casts have different semantics.)  

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

Get rid of postgres_fdw's assumption that remote type OIDs match ours.

commit   : 5fd386bb31f9a8ed5058093bc3f8937fdde3dbec    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Fri, 22 Feb 2013 06:36:09 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Fri, 22 Feb 2013 06:36:09 -0500    

Click here for diff

The only place we depended on that was in sending numeric type OIDs in  
PQexecParams; but we can replace that usage with explicitly casting  
each Param symbol in the query string, so that the types are specified  
to the remote by name not OID.  This makes no immediate difference but  
will be essential if we ever hope to support use of non-builtin types.  

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

Fix thinko in previous commit.

commit   : 6c4f6664b201bea77eb6e3f813559e3911a5ef35    
  
author   : Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Fri, 22 Feb 2013 13:07:02 +0200    
  
committer: Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Fri, 22 Feb 2013 13:07:02 +0200    

Click here for diff

We must still initialize minRecoveryPoint if we start straight with archive  
recovery, e.g when recovering from a normal base backup taken with  
pg_start/stop_backup. Otherwise we never consider the system consistent.  

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

Adjust postgres_fdw's search path handling.

commit   : 6d06049493862f7f6b639035198fc817949723ae    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Fri, 22 Feb 2013 06:03:46 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Fri, 22 Feb 2013 06:03:46 -0500    

Click here for diff

Set the remote session's search path to exactly "pg_catalog" at session  
start, then schema-qualify only names that aren't in that schema.  This  
greatly reduces clutter in the generated SQL commands, as seen in the  
regression test changes.  Per discussion.  
  
Also, rethink use of FirstNormalObjectId as the "built-in object" cutoff  
--- FirstBootstrapObjectId is safer, since the former will accept  
objects in information_schema for instance.  

M contrib/postgres_fdw/connection.c
M contrib/postgres_fdw/deparse.c
M contrib/postgres_fdw/expected/postgres_fdw.out

If recovery.conf is created after "pg_ctl stop -m i", do crash recovery.

commit   : abf5c5c9a4f142b3343614746bb9e99a794f8e7b    
  
author   : Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Fri, 22 Feb 2013 11:43:04 +0200    
  
committer: Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Fri, 22 Feb 2013 11:43:04 +0200    

Click here for diff

If you create a base backup using an atomic filesystem snapshot, and try to  
perform PITR starting from that base backup, or if you just kill a master  
server and create recovery.conf to put it into standby mode, we don't know  
how far we need to recover before reaching consistency. Normally in crash  
recovery, we replay all the WAL present in pg_xlog, and assume that we're  
consistent after that. And normally in archive recovery, minRecoveryPoint,  
backupEndRequired, or backupEndPoint is set in the control file, indicating  
how far we need to replay to reach consistency. But if the server was  
previously up and running normally, and you kill -9 it or take an atomic  
filesystem snapshot, none of those fields are set in the control file.  
  
The solution is to perform crash recovery first, replaying all the WAL in  
pg_xlog. After that's done, we assume that the system is consistent like in  
normal crash recovery, and switch to archive recovery mode after that.  
  
Per report from Kyotaro HORIGUCHI. In his scenario, recovery.conf was  
created after "pg_ctl stop -m i". I'm not sure we need to support that exact  
scenario, but we should support backing up using a filesystem snapshot,  
which looks identical.  
  
This issue goes back to at least 9.0, where hot standby was introduced and  
we started to track when consistency is reached. In 9.1 and 9.2, we would  
open up for hot standby too early, and queries could briefly see an  
inconsistent state. But 9.2 made it more visible, as we started to PANIC if  
we see a reference to a non-existing page during recovery, if we've already  
reached consistency. This is a fairly big patch, so back-patch to 9.2 only,  
where the issue is more visible. We can consider back-patching further after  
this has received some more testing in 9.2 and master.  

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

Move relpath() to libpgcommon

commit   : a73018392636ce832b09b5c31f6ad1f18a4643ea    
  
author   : Alvaro Herrera <alvherre@alvh.no-ip.org>    
date     : Thu, 21 Feb 2013 22:46:17 -0300    
  
committer: Alvaro Herrera <alvherre@alvh.no-ip.org>    
date     : Thu, 21 Feb 2013 22:46:17 -0300    

Click here for diff

This enables non-backend code, such as pg_xlogdump, to use it easily.  
The previous location, in src/backend/catalog/catalog.c, made that  
essentially impossible because that file depends on many backend-only  
facilities; so this needs to live separately.  

M src/backend/Makefile
M src/backend/access/rmgrdesc/smgrdesc.c
M src/backend/access/rmgrdesc/xactdesc.c
M src/backend/access/transam/xlogutils.c
M src/backend/catalog/catalog.c
M src/backend/commands/tablespace.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/file/reinit.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/Makefile
A src/common/relpath.c
M src/include/catalog/catalog.h
A src/include/common/relpath.h
M src/tools/msvc/Mkvcbuild.pm

Remove useless variable

commit   : 6e3fd964632e95c7359457b7d67aa20c72a71679    
  
author   : Alvaro Herrera <alvherre@alvh.no-ip.org>    
date     : Thu, 21 Feb 2013 11:46:46 -0300    
  
committer: Alvaro Herrera <alvherre@alvh.no-ip.org>    
date     : Thu, 21 Feb 2013 11:46:46 -0300    

Click here for diff

Per Jeff Janes  

M src/backend/postmaster/pgstat.c

Need to decorate XactIsoLevel as PGDLLIMPORT for postgres_fdw.

commit   : 54a278683531edac535e6aa4d5427799409823f1    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 21 Feb 2013 09:28:42 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 21 Feb 2013 09:28:42 -0500    

Click here for diff

Per buildfarm.  

M contrib/postgres_fdw/connection.c
M src/include/access/xact.h

Teach MSVC build system about postgres_fdw.

commit   : 699d70b2ec2cb6dc07f6c5b2876609301ddd20a8    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 21 Feb 2013 06:43:15 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 21 Feb 2013 06:43:15 -0500    

Click here for diff

Per buildfarm.  

M src/tools/msvc/Mkvcbuild.pm

Add postgres_fdw contrib module.

commit   : d0d75c402217421b691050857eb3d7af82d0c770    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 21 Feb 2013 05:26:23 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 21 Feb 2013 05:26:23 -0500    

Click here for diff

There's still a lot of room for improvement, but it basically works,  
and we need this to be present before we can do anything much with the  
writable-foreign-tables patch.  So let's commit it and get on with testing.  
  
Shigeru Hanada, reviewed by KaiGai Kohei and Tom Lane  

M contrib/Makefile
A contrib/postgres_fdw/.gitignore
A contrib/postgres_fdw/Makefile
A contrib/postgres_fdw/connection.c
A contrib/postgres_fdw/deparse.c
A contrib/postgres_fdw/expected/postgres_fdw.out
A contrib/postgres_fdw/option.c
A contrib/postgres_fdw/postgres_fdw–1.0.sql
A contrib/postgres_fdw/postgres_fdw.c
A contrib/postgres_fdw/postgres_fdw.control
A contrib/postgres_fdw/postgres_fdw.h
A contrib/postgres_fdw/sql/postgres_fdw.sql
M doc/src/sgml/client-auth.sgml
M doc/src/sgml/contrib.sgml
M doc/src/sgml/dblink.sgml
M doc/src/sgml/filelist.sgml
M doc/src/sgml/libpq.sgml
A doc/src/sgml/postgres-fdw.sgml
M doc/src/sgml/queries.sgml
M doc/src/sgml/recovery-config.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_server.sgml
M doc/src/sgml/ref/grant.sgml
M doc/src/sgml/ref/pg_isready.sgml
M doc/src/sgml/ref/psql-ref.sgml
M doc/src/sgml/runtime.sgml
M src/backend/foreign/foreign.c

Fix pg_dumpall with database names containing =

commit   : f435cd1d385859a0cdb1d70fccc21dde2b1ee116    
  
author   : Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Wed, 20 Feb 2013 17:08:54 +0200    
  
committer: Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Wed, 20 Feb 2013 17:08:54 +0200    

Click here for diff

If a database name contained a '=' character, pg_dumpall failed. The problem  
was in the way pg_dumpall passes the database name to pg_dump on the  
command line. If it contained a '=' character, pg_dump would interpret it  
as a libpq connection string instead of a plain database name.  
  
To fix, pass the database name to pg_dump as a connection string,  
"dbname=foo", with the database name escaped if necessary.  
  
Back-patch to all supported branches.  

M src/bin/pg_dump/pg_dumpall.c

Don't pass NULL to fprintf, if a bogus connection string is given to pg_dump.

commit   : 2930c05634bcb7491bc443a493405e927ed08443    
  
author   : Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Wed, 20 Feb 2013 16:22:47 +0200    
  
committer: Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Wed, 20 Feb 2013 16:22:47 +0200    

Click here for diff

Back-patch to all supported branches.  

M src/bin/pg_dump/pg_backup_db.c

Fix yet another typo in comment.

commit   : 5d6899dbae7ac19d90f135e2ad64832e4ca8d064    
  
author   : Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Wed, 20 Feb 2013 12:30:59 +0200    
  
committer: Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Wed, 20 Feb 2013 12:30:59 +0200    

Click here for diff

Etsuro Fujita  

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

Move ExceptionalCondition back to postgres.h

commit   : a40d09e27fefbeca0d6994471b3e6965f1ac9dda    
  
author   : Alvaro Herrera <alvherre@alvh.no-ip.org>    
date     : Mon, 18 Feb 2013 18:53:32 -0300    
  
committer: Alvaro Herrera <alvherre@alvh.no-ip.org>    
date     : Mon, 18 Feb 2013 18:53:32 -0300    

Click here for diff

It needs to be defined in the backend even when assertions are not  
enabled.  It's cleaner to put it back, than create a separate #ifdef  
section in c.h.  
  
Per trouble report from Jeff Janes  

M src/include/c.h
M src/include/postgres.h

Split pgstat file in smaller pieces

commit   : 187492b6c2e8cafc5b39063ca3b67846e8155d24    
  
author   : Alvaro Herrera <alvherre@alvh.no-ip.org>    
date     : Mon, 18 Feb 2013 17:56:08 -0300    
  
committer: Alvaro Herrera <alvherre@alvh.no-ip.org>    
date     : Mon, 18 Feb 2013 17:56:08 -0300    

Click here for diff

We now write one file per database and one global file, instead of  
having the whole thing in a single huge file.  This reduces the I/O that  
must be done when partial data is required -- which is all the time,  
because each process only needs information on its own database anyway.  
Also, the autovacuum launcher does not need data about tables and  
functions in each database; having the global stats for all DBs is  
enough.  
  
Catalog version bumped because we have a new subdir under PGDATA.  
  
Author: Tomas Vondra.  Some rework by Álvaro  
Testing by Jeff Janes  
Other discussion by Heikki Linnakangas, Tom Lane.  

M src/backend/postmaster/pgstat.c
M src/backend/utils/misc/guc.c
M src/bin/initdb/initdb.c
M src/include/catalog/catversion.h
M src/include/pgstat.h

Add ALTER ROLE ALL SET command

commit   : 9475db3a4eb5876b364254886d2730db01e042fd    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Sun, 17 Feb 2013 23:45:36 -0500    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
date     : Sun, 17 Feb 2013 23:45:36 -0500    

Click here for diff

This generalizes the existing ALTER ROLE ... SET and ALTER DATABASE  
... SET functionality to allow creating settings that apply to all users  
in all databases.  
  
reviewed by Pavel Stehule  

M doc/src/sgml/ref/alter_role.sgml
M src/backend/commands/user.c
M src/backend/parser/gram.y
M src/backend/utils/init/postinit.c
M src/backend/utils/misc/guc.c
M src/include/utils/guc.h

Warn about initdb using mount-points

commit   : 17f15239325a88581bb4f9cf91d38005f1f52d69    
  
author   : Bruce Momjian <bruce@momjian.us>    
date     : Sat, 16 Feb 2013 18:52:50 -0500    
  
committer: Bruce Momjian <bruce@momjian.us>    
date     : Sat, 16 Feb 2013 18:52:50 -0500    

Click here for diff

Add code to detect and warn about trying to initdb or create pg_xlog on  
mount points.  

M src/bin/initdb/initdb.c
M src/bin/pg_basebackup/pg_basebackup.c
M src/port/pgcheckdir.c

Better fix for "unarchived WAL files get deleted on crash recovery" bug.

commit   : 1bd42cd70abdbc946ad64c3c8eaefed4bb8b1145    
  
author   : Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Fri, 15 Feb 2013 19:33:31 +0200    
  
committer: Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Fri, 15 Feb 2013 19:33:31 +0200    

Click here for diff

Revert my earlier fix for the bug that unarchived WAL files get deleted on  
crash recovery, commit c9cc7e05c6d82a9781883a016c70d95aa4923122. We create  
a .done file for files streamed or restored from archive, so the WAL file  
recycling logic used during normal operation works just as well during  
archive recovery.  
  
Per Fujii Masao's suggestion.  

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

Force archive_status of .done for xlogs created by dearchival/replication.

commit   : c2f79ba2691a4863db53003f25538f8806ebd2db    
  
author   : Simon Riggs <simon@2ndQuadrant.com>    
date     : Wed, 8 Aug 2012 23:58:49 +0100    
  
committer: Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Wed, 8 Aug 2012 23:58:49 +0100    

Click here for diff

This is a forward-patch of commit 6f4b8a4f4f7a2d683ff79ab59d3693714b965e3d,  
applied to 9.2 back in August. The plan was to do something else in master,  
but it looks like it's not going to happen, so let's just apply the 9.2  
solution to master as well.  
  
Fujii Masao  

M src/backend/access/transam/xlogarchive.c
M src/backend/replication/walreceiver.c
M src/include/access/xlog_internal.h

Don't delete unarchived WAL files during crash recovery.

commit   : c9cc7e05c6d82a9781883a016c70d95aa4923122    
  
author   : Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Fri, 15 Feb 2013 17:25:16 +0200    
  
committer: Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Fri, 15 Feb 2013 17:25:16 +0200    

Click here for diff

Bug reported by Jehan-Guillaume (ioguix) de Rorthais. This was introduced  
with the change to keep WAL files restored from archive in pg_xlog, in 9.2.  

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

pgindent: Fix order in instructions

commit   : 8e6c8da16a51e24a33bf4afeb311ca5d0ecd2b21    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Thu, 14 Feb 2013 21:40:05 -0500    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
date     : Thu, 14 Feb 2013 21:40:05 -0500    

Click here for diff

The previous order of steps didn't literally work, because git clean  
-fdx would delete the downloaded typedefs.list.  Also, pgindent needs to  
be called with a path when one is in at the top of the build tree.  

M src/tools/pgindent/README

Invent pre-commit/pre-prepare/pre-subcommit events for xact callbacks.

commit   : fdaf44862beba24c12434d31df556fab25fd3ee7    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 14 Feb 2013 20:35:08 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 14 Feb 2013 20:35:08 -0500    

Click here for diff

Currently it's only possible for loadable modules to get control during  
post-commit cleanup of a transaction.  That doesn't work too well if they  
want to do something that could throw an error; for example, an FDW might  
need to issue a remote commit, which could well fail.  To improve matters,  
extend the existing APIs for XactCallback and SubXactCallback functions  
to provide new pre-commit events for this purpose.  
  
The release notes will need to mention that existing callback functions  
should be checked to make sure they don't do something unwanted when one  
of the new event types occurs.  In the examples within our source tree,  
contrib/sepgsql was fine but plpgsql had been a bit too cute.  

M src/backend/access/transam/xact.c
M src/include/access/xact.h
M src/pl/plpgsql/src/pl_exec.c

pg_upgrade: conditionally create cluster delete script

commit   : 4765dd79219b9697d84f5c2c70f3fe00455609a1    
  
author   : Bruce Momjian <bruce@momjian.us>    
date     : Thu, 14 Feb 2013 10:53:03 -0500    
  
committer: Bruce Momjian <bruce@momjian.us>    
date     : Thu, 14 Feb 2013 10:53:03 -0500    

Click here for diff

If users create tablespaces inside the old cluster directory, it is  
impossible for the delete script to delete _only_ the old cluster files,  
so don't create a script in that case, and issue a message to the user.  

M contrib/pg_upgrade/check.c

Fix pg_upgrade log file cleanup code

commit   : 74205266d4925b54bf1d77bae7b0e7f60f68840a    
  
author   : Bruce Momjian <bruce@momjian.us>    
date     : Thu, 14 Feb 2013 00:04:15 -0500    
  
committer: Bruce Momjian <bruce@momjian.us>    
date     : Thu, 14 Feb 2013 00:04:15 -0500    

Click here for diff

Recent pg_upgrade parallel improvements introduced a bug that prevented  
cleanup of per-database log files.  

M contrib/pg_upgrade/pg_upgrade.c

doc: Add make target to produce EPUB from DocBook

commit   : ff64fd49ce91534ebbfd5774a8715b11bfc09b97    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Wed, 13 Feb 2013 23:12:21 -0500    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
date     : Wed, 13 Feb 2013 23:12:21 -0500    

Click here for diff

M doc/src/sgml/Makefile

Fix CVE-2013-0255 properly.

commit   : 71627f3d1964ef9831ea7997d2f4ac5617c718cc    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Wed, 13 Feb 2013 16:20:01 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Wed, 13 Feb 2013 16:20:01 -0500    

Click here for diff

Revert commit ab0f7b6089fd215f6ce6081e2e222c38d643a526 (in HEAD only)  
in favor of the proper solution, which is to declare enum_recv() correctly  
in the system catalogs.  It should be declared to take type "internal"  
not "cstring".  
  
Also improve the type_sanity regression test, which should have caught  
this typo, so that it actually would.  Most of the relevant checks on  
the signature of type I/O functions should not have been restricted to  
basetypes/pseudotypes, as they should apply to any type's I/O functions.  

M src/backend/utils/adt/enum.c
M src/include/catalog/catversion.h
M src/include/catalog/pg_proc.h
M src/test/regress/expected/type_sanity.out
M src/test/regress/sql/type_sanity.sql

Fix contrib/pg_trgm's similarity() function for trigram-free strings.

commit   : 9728eda7925b6d42621b38c48e91ef9ab8d90cbc    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Wed, 13 Feb 2013 14:07:06 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Wed, 13 Feb 2013 14:07:06 -0500    

Click here for diff

Cases such as similarity('', '') produced a NaN result due to computing  
0/0.  Per discussion, make it return zero instead.  
  
This appears to be the basic cause of bug #7867 from Michele Baravalle,  
although it remains unclear why her installation doesn't think Cyrillic  
letters are letters.  
  
Back-patch to all active branches.  

M contrib/pg_trgm/expected/pg_trgm.out
M contrib/pg_trgm/sql/pg_trgm.sql
M contrib/pg_trgm/trgm_op.c

Fix bogus when-to-deregister-from-listener-array logic.

commit   : cd89965aab34463252b9354bc1bf1bcf0339c102    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Wed, 13 Feb 2013 12:48:05 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Wed, 13 Feb 2013 12:48:05 -0500    

Click here for diff

Since a backend adds itself to the global listener array during  
Exec_ListenPreCommit, it's inappropriate for it to remove itself during  
Exec_UnlistenCommit or Exec_UnlistenAllCommit --- that leads to failure  
when committing a transaction that did UNLISTEN then LISTEN, since we end  
up not registered though we should be.  (This leads to missing later  
notifications, or to Assert failures in assert-enabled builds.)  Instead  
deal with deregistering at the bottom of AtCommit_Notify, when we know the  
final state of the listenChannels list.  
  
Also, simplify the representation of registration status by replacing the  
transient backendHasExecutedInitialListen flag with an amRegisteredListener  
flag.  
  
Per report from Greg Sabino Mullane.  Back-patch to 9.0, where the problem  
was introduced during the LISTEN/NOTIFY rewrite.  

M src/backend/commands/async.c

Update visibility map in the second phase of vacuum.

commit   : fdf9e21196a6f58c6021c967dc5776a16190f295    
  
author   : Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Wed, 13 Feb 2013 17:46:23 +0200    
  
committer: Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Wed, 13 Feb 2013 17:46:23 +0200    

Click here for diff

There's a high chance that a page becomes all-visible when the second phase  
of vacuum removes all the dead tuples on it, so it makes sense to check for  
that. Otherwise the visibility map won't get updated until the next vacuum.  
  
Pavan Deolasee, reviewed by Jeff Janes.  

M src/backend/commands/vacuumlazy.c

Rename "string" pstrdup argument to "in"

commit   : 0e81ddde2c62ada7f818114ca961d80d42370e32    
  
author   : Alvaro Herrera <alvherre@alvh.no-ip.org>    
date     : Tue, 12 Feb 2013 12:43:09 -0300    
  
committer: Alvaro Herrera <alvherre@alvh.no-ip.org>    
date     : Tue, 12 Feb 2013 12:43:09 -0300    

Click here for diff

The former name collides with a symbol also used in the isolation test's  
parser, causing assorted failures in certain platforms.  

M src/common/fe_memutils.c
M src/include/common/fe_memutils.h

Don't build libpgcommon_srv.a just yet

commit   : 0f980b0e17d95e77dc2822eb7855d072a5874d9a    
  
author   : Alvaro Herrera <alvherre@alvh.no-ip.org>    
date     : Tue, 12 Feb 2013 12:21:27 -0300    
  
committer: Alvaro Herrera <alvherre@alvh.no-ip.org>    
date     : Tue, 12 Feb 2013 12:21:27 -0300    

Click here for diff

It's empty, and some archivers do not support that case.  

M src/common/Makefile

Create libpgcommon, and move pg_malloc et al to it

commit   : 8396447cdbdff0b62914748de2fec04281dc9114    
  
author   : Alvaro Herrera <alvherre@alvh.no-ip.org>    
date     : Tue, 12 Feb 2013 10:33:40 -0300    
  
committer: Alvaro Herrera <alvherre@alvh.no-ip.org>    
date     : Tue, 12 Feb 2013 10:33:40 -0300    

Click here for diff

libpgcommon is a new static library to allow sharing code among the  
various frontend programs and backend; this lets us eliminate duplicate  
implementations of common routines.  We avoid libpgport, because that's  
intended as a place for porting issues; per discussion, it seems better  
to keep them separate.  
  
The first use case, and the only implemented by this patch, is pg_malloc  
and friends, which many frontend programs were already using.  
  
At the same time, we can use this to provide palloc emulation functions  
for the frontend; this way, some palloc-using files in the backend can  
also be used by the frontend cleanly.  To do this, we change palloc() in  
the backend to be a function instead of a macro on top of  
MemoryContextAlloc().  This was previously believed to cause loss of  
performance, but this implementation has been tweaked by Tom and Andres  
so that on modern compilers it provides a slight improvement over the  
previous one.  
  
This lets us clean up some places that were already with  
localized hacks.  
  
Most of the pg_malloc/palloc changes in this patch were authored by  
Andres Freund. Zoltán Böszörményi also independently provided a form of  
that.  libpgcommon infrastructure was authored by Álvaro.  

M contrib/oid2name/oid2name.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.c
M contrib/pg_upgrade/version_old_8_3.c
M contrib/pgbench/pgbench.c
M src/Makefile
M src/Makefile.global.in
M src/backend/storage/file/copydir.c
M src/backend/utils/mmgr/mcxt.c
M src/bin/initdb/initdb.c
M src/bin/pg_basebackup/streamutil.c
M src/bin/pg_basebackup/streamutil.h
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
D src/bin/pg_dump/dumpmem.c
D src/bin/pg_dump/dumpmem.h
M src/bin/pg_dump/dumputils.c
M src/bin/pg_dump/nls.mk
M src/bin/pg_dump/pg_backup_archiver.c
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
M src/bin/pg_dump/pg_dump.c
M src/bin/pg_dump/pg_dump_sort.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/common.c
M src/bin/psql/common.h
M src/bin/scripts/common.c
M src/bin/scripts/common.h
A src/common/Makefile
A src/common/fe_memutils.c
A src/include/common/fe_memutils.h
M src/include/postgres_fe.h
M src/include/utils/palloc.h
M src/port/dirmod.c
M src/tools/msvc/Install.pm
M src/tools/msvc/Mkvcbuild.pm
M src/tools/msvc/Project.pm

Add noreturn attributes to some error reporting functions

commit   : 0cb1fac3b19f01025b63d2cdceabb8767185da28    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Tue, 12 Feb 2013 07:13:22 -0500    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
date     : Tue, 12 Feb 2013 07:13:22 -0500    

Click here for diff

M contrib/cube/cubescan.l
M contrib/seg/segscan.l
M src/backend/replication/repl_scanner.l
M src/include/mb/pg_wchar.h
M src/include/parser/parse_relation.h
M src/include/storage/lock.h
M src/include/tcop/tcopprot.h
M src/pl/plpgsql/src/pl_scanner.c

Support unlogged GiST index.

commit   : 62401db45c4feff9be296fa78a8bb7b9947d69de    
  
author   : Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Mon, 11 Feb 2013 22:50:15 +0200    
  
committer: Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Mon, 11 Feb 2013 22:50:15 +0200    

Click here for diff

The reason this wasn't supported before was that GiST indexes need an  
increasing sequence to detect concurrent page-splits. In a regular WAL-  
logged GiST index, the LSN of the page-split record is used for that  
purpose, and in a temporary index, we can get away with a backend-local  
counter. Neither of those methods works for an unlogged relation.  
  
To provide such an increasing sequence of numbers, create a "fake LSN"  
counter that is saved and restored across shutdowns. On recovery, unlogged  
relations are blown away, so the counter doesn't need to survive that  
either.  
  
Jeevan Chalke, based on discussions with Robert Haas, Tom Lane and me.  

M doc/src/sgml/ref/create_table.sgml
M src/backend/access/gist/gist.c
M src/backend/access/gist/gistbuild.c
M src/backend/access/gist/gistutil.c
M src/backend/access/gist/gistvacuum.c
M src/backend/access/transam/xlog.c
M src/backend/storage/buffer/bufmgr.c
M src/bin/pg_controldata/pg_controldata.c
M src/bin/pg_resetxlog/pg_resetxlog.c
M src/include/access/gist_private.h
M src/include/access/xlog.h
M src/include/catalog/pg_control.h

Fix checkpoint after fast promotion.

commit   : b669f416cee77ef9025b80f9c4201688578447d1    
  
author   : Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Mon, 11 Feb 2013 22:16:56 +0200    
  
committer: Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Mon, 11 Feb 2013 22:16:56 +0200    

Click here for diff

The intention was to request a regular online checkpoint immediately after  
end of recovery, when performing "fast promotion". However, because the  
checkpoint was requested before other backends were allowed to write WAL,  
the checkpointer process performed a restartpoint rather than a checkpoint.  
  
Delay the RequestCheckPoint call until after recovery has truly ended, so  
that you get a real checkpoint.  

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

Include previous TLI in end-of-recovery and shutdown checkpoint records.

commit   : 7803e9327db3788f68d820c19f4081afb79edd12    
  
author   : Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Mon, 11 Feb 2013 18:13:09 +0200    
  
committer: Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Mon, 11 Feb 2013 18:13:09 +0200    

Click here for diff

This isn't used for anything but a sanity check at the moment, but it could  
be highly valuable for debugging purposes. It could also be used to recreate  
timeline history by traversing WAL, which seems useful.  

M src/backend/access/rmgrdesc/xlogdesc.c
M src/backend/access/transam/xlog.c
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

Further cleanup of gistsplit.c.

commit   : c352ea2d74c4e317bf2a1471ec1f750f9f072276    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sun, 10 Feb 2013 16:21:26 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sun, 10 Feb 2013 16:21:26 -0500    

Click here for diff

After further reflection I was unconvinced that the existing coding is  
guaranteed to return valid union datums in every code path for multi-column  
indexes.  Fix that by forcing a gistunionsubkey() call at the end of the  
recursion.  Having done that, we can remove some clearly-redundant calls  
elsewhere.  This should be a little faster for multi-column indexes (since  
the previous coding would uselessly do such a call for each column while  
unwinding the recursion), as well as much harder to break.  
  
Also, simplify the handling of cases where one side or the other of a  
primary split contains only don't-care tuples.  The previous coding used a  
very ugly hack in removeDontCares() that essentially forced one random  
tuple to be treated as non-don't-care, providing a random initial choice of  
seed datum for the secondary split.  It seems unlikely that that method  
will give better-than-random splits.  Instead, treat such a split as  
degenerate and just let the next column determine the split, the same way  
that we handle fully degenerate cases where the two sides produce identical  
union datums.  

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

Remove useless picksplit-doesn't-support-secondary-split log spam.

commit   : db3d7e9f0d7d2a7edf57d154f62dff0a18f1b1f9    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sun, 10 Feb 2013 13:07:40 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sun, 10 Feb 2013 13:07:40 -0500    

Click here for diff

This LOG message was put in over five years ago with the evident  
expectation that we'd make all GiST opclasses support secondary split  
directly.  However, no such thing ever happened, and indeed the number of  
opclasses supporting it decreased to zero in 9.2.  The reason is that  
improving on the default implementation isn't that easy --- the  
opclass-specific code that did exist, before 9.2, doesn't appear to have  
been any improvement over the default.  
  
Hence, remove the message altogether.  There's certainly no point in  
nagging users about this in released branches, but I doubt that we'll  
ever implement complete opclass-specific support anyway.  

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

Remove vestigial secondary-split support in gist_box_picksplit().

commit   : dacc185f52e9937e9c2fe1bf29c6e92e0c16ae14    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sun, 10 Feb 2013 12:40:09 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sun, 10 Feb 2013 12:40:09 -0500    

Click here for diff

Not only is this implementation of secondary-split not better than the  
default implementation in gistsplit.c, it's actually worse.  The gistsplit.c  
code at least looks to see if switching the left and right sides would make  
a better merge with the previously-split tuples, while this doesn't.  
  
In any case it's rather useless to support secondary split only in an edge  
case.  There used to be more complete support for it here (in chooseLR()),  
but that was removed in commit 7f3bd86843e5aad84585a57d3f6b80db3c609916.  
It appears to me though that the chooseLR() code was really isomorphic to  
the default implementation, since it was still based on choosing the cheaper  
way of adding two sub-split vectors that had been chosen without regard to  
the primary split initially.  I think an implementation of secondary split  
that could beat the default implementation would have to be pretty fully  
integrated into the split algorithm, not plastered on at the end.  
  
Back-patch to 9.2, but not further; previous branches have the chooseLR()  
code which I don't feel a great need to mess with.  This is mainly so we  
just have two behaviors and not three among the various branches (IOW, this  
patch is cleanup for commit 7f3bd86843e5aad84585a57d3f6b80db3c609916's  
incomplete removal of secondary-split support).  

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

Document and clean up gistsplit.c.

commit   : 0fd0f3688b7a8ab0b907d431cf7022098110cfc8    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sun, 10 Feb 2013 11:58:15 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sun, 10 Feb 2013 11:58:15 -0500    

Click here for diff

Improve comments, rename some variables and functions, slightly simplify  
a couple of APIs, in an attempt to make this code readable by people other  
than its original author.  
  
Even though this is essentially just cosmetic, back-patch to all active  
branches, because otherwise it's going to make back-patching future fixes  
in this file very painful.  

M src/backend/access/gist/gist.c
M src/backend/access/gist/gistsplit.c
M src/include/access/gist.h
M src/include/access/gist_private.h

Reduce log level of picksplit-doesn't-support-secondary-split whining.

commit   : a187c96d26520695fc392edb1c8f38d86b16ef5b    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sat, 9 Feb 2013 12:17:55 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sat, 9 Feb 2013 12:17:55 -0500    

Click here for diff

This was agreed to back in 2007, but never actually done.  
  
Josh Hansen  

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

Add an example of attaching a default value to an updatable view.

commit   : 3a1f8cdfa90443117049c601364009b71eaad3d1    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sat, 9 Feb 2013 11:43:48 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sat, 9 Feb 2013 11:43:48 -0500    

Click here for diff

This is probably the single most useful thing that ALTER VIEW can do,  
particularly now that we have auto-updatable views.  So show an explicit  
example.  

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

psql: Improve unaligned expanded output for zero rows

commit   : 0343a59d119de3fb835234fa34fbcd697b9335db    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Sat, 9 Feb 2013 00:05:27 -0500    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
date     : Sat, 9 Feb 2013 00:05:27 -0500    

Click here for diff

This used to erroneously print an empty line.  Now it prints nothing.  

M src/bin/psql/print.c

psql: Improve expanded print output in tuples-only mode

commit   : 8ade58a4ea318d0ab8548ab94e49a3b80fdbeb0d    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Fri, 8 Feb 2013 23:39:22 -0500    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
date     : Fri, 8 Feb 2013 23:39:22 -0500    

Click here for diff

When there are zero result rows, in expanded mode, "(No rows)" is  
printed.  So far, there was no way to turn this off.  Now, when  
tuples-only mode is turned on, nothing is printed in this case.  

M src/bin/psql/print.c

Add support for ALTER RULE ... RENAME TO.

commit   : c61e26ee3e447c0277c6c4e5a8a452dbefdc502d    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Fri, 8 Feb 2013 23:58:40 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Fri, 8 Feb 2013 23:58:40 -0500    

Click here for diff

Ali Dar, reviewed by Dean Rasheed.  

M doc/src/sgml/ref/allfiles.sgml
A doc/src/sgml/ref/alter_rule.sgml
M doc/src/sgml/ref/create_rule.sgml
M doc/src/sgml/ref/drop_rule.sgml
M doc/src/sgml/reference.sgml
M src/backend/commands/alter.c
M src/backend/parser/gram.y
M src/backend/rewrite/rewriteDefine.c
M src/bin/psql/tab-complete.c
M src/include/rewrite/rewriteDefine.h
M src/test/regress/expected/rules.out
M src/test/regress/sql/rules.sql

Simplify box_overlap computations.

commit   : f806c191a3d5faa1af1e5032d394fc6c5f93df86    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Fri, 8 Feb 2013 18:26:08 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Fri, 8 Feb 2013 18:26:08 -0500    

Click here for diff

Given the assumption that a box's high coordinates are not less than its  
low coordinates, the tests in box_ov() are overly complicated and can be  
reduced to about half as much work.  Since many other functions in  
geo_ops.c rely on that assumption, there doesn't seem to be a good reason  
not to use it here.  
  
Per discussion of Alexander Korotkov's GiST fix, which was already using  
the simplified logic (in a non-fuzzy form, but the equivalence holds just  
as well for fuzzy).  

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

Fix gist_box_same and gist_point_consistent to handle fuzziness correctly.

commit   : 3c29b196b0ce46662cb9bb7a1f91079fbacbcabb    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Fri, 8 Feb 2013 18:03:17 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Fri, 8 Feb 2013 18:03:17 -0500    

Click here for diff

While there's considerable doubt that we want fuzzy behavior in the  
geometric operators at all (let alone as currently implemented), nobody is  
stepping forward to redesign that stuff.  In the meantime it behooves us  
to make sure that index searches agree with the behavior of the underlying  
operators.  This patch fixes two problems in this area.  
  
First, gist_box_same was using fuzzy equality, but it really needs to use  
exact equality to prevent not-quite-identical upper index keys from being  
treated as identical, which for example would prevent an existing upper  
key from being extended by an amount less than epsilon.  This would result  
in inconsistent indexes.  (The next release notes will need to recommend  
that users reindex GiST indexes on boxes, polygons, circles, and points,  
since all four opclasses use gist_box_same.)  
  
Second, gist_point_consistent used exact comparisons for upper-page  
comparisons in ~= searches, when it needs to use fuzzy comparisons to  
ensure it finds all matches; and it used fuzzy comparisons for point <@ box  
searches, when it needs to use exact comparisons because that's what the  
<@ operator (rather inconsistently) does.  
  
The added regression test cases illustrate all three misbehaviors.  
  
Back-patch to all active branches.  (8.4 did not have GiST point_ops,  
but it still seems prudent to apply the gist_box_same patch to it.)  
  
Alexander Korotkov, reviewed by Noah Misch  

M src/backend/access/gist/gistproc.c
M src/test/regress/expected/point.out
M src/test/regress/sql/point.sql

Clean up c.h / postgres.h after Assert() move

commit   : 381d4b70a9854a7b5b9f12d828a0824f8564f1e7    
  
author   : Alvaro Herrera <alvherre@alvh.no-ip.org>    
date     : Fri, 8 Feb 2013 12:13:34 -0300    
  
committer: Alvaro Herrera <alvherre@alvh.no-ip.org>    
date     : Fri, 8 Feb 2013 12:13:34 -0300    

Click here for diff

Per Tom  

M src/include/c.h
M src/include/postgres.h

Fix Xmax freeze conditions

commit   : 5766228bc64268369b59b07cffa7d31cd4f9c9ff    
  
author   : Alvaro Herrera <alvherre@alvh.no-ip.org>    
date     : Fri, 8 Feb 2013 01:27:54 -0300    
  
committer: Alvaro Herrera <alvherre@alvh.no-ip.org>    
date     : Fri, 8 Feb 2013 01:27:54 -0300    

Click here for diff

I broke this in 0ac5ad5134; previously, freezing a tuple marked with an  
IS_MULTI xmax was not necessary.  
  
Per brokenness report from Jeff Janes.  

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

doc: Fix mistakes in the most recent set of release notes.

commit   : 335c5e9206b40c2fac3945db2499a57b948cc996    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Fri, 8 Feb 2013 10:41:15 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Fri, 8 Feb 2013 10:41:15 -0500    

Click here for diff

Improve description of the vacuum_freeze_table_age bug (it's much more  
serious than we realized at the time the fix was committed), and correct  
attribution of pg_upgrade -O/-o fix (Marti Raudsepp contributed that,  
but Bruce forgot to credit him in the commit log).  
  
No need to back-patch right now, it'll happen when the next set of  
release notes are prepared.  

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

Fix another typo in a comment

commit   : c572bfaf39d87b0c603f28e1ff385cd85b0a0879    
  
author   : Magnus Hagander <magnus@hagander.net>    
date     : Fri, 8 Feb 2013 15:14:40 +0100    
  
committer: Magnus Hagander <magnus@hagander.net>    
date     : Fri, 8 Feb 2013 15:14:40 +0100    

Click here for diff

Noted by Thom Brown  

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

Exclude access/rmgrlist.h from cpluspluscheck

commit   : cf4d67e819e05d46836d896cce2a2b52f4a194d0    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Fri, 8 Feb 2013 07:01:21 -0500    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
date     : Fri, 8 Feb 2013 07:01:21 -0500    

Click here for diff

It is not meant to be included standalone.  

M src/tools/pginclude/cpluspluscheck

scripts: Add build prerequisite on libpgport

commit   : 4760142146ffc0a88a17b7ef477b8a84b041238e    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Fri, 8 Feb 2013 06:43:54 -0500    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
date     : Fri, 8 Feb 2013 06:43:54 -0500    

Click here for diff

Without this, building in src/bin/scripts directly will fail if  
libpgport wasn't built first.  Other bin components are handled the same  
way.  
  
Phil Sorber  

M src/bin/scripts/Makefile

Fix typo in comment

commit   : 733701d2748b6bbbe5f3cdc6421fdc83f6aa0c01    
  
author   : Magnus Hagander <magnus@hagander.net>    
date     : Fri, 8 Feb 2013 11:45:42 +0100    
  
committer: Magnus Hagander <magnus@hagander.net>    
date     : Fri, 8 Feb 2013 11:45:42 +0100    

Click here for diff

Etsuro Fujita  

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

doc: Rewrite how to get the source code

commit   : 858ef718ba6301b24e245bbe3ecf20aa10cb60a4    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Thu, 7 Feb 2013 23:19:18 -0500    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
date     : Thu, 7 Feb 2013 23:19:18 -0500    

Click here for diff

Instead of hardcoding a specific link, give a general link to the  
download section of the web site.  This gives the user more download  
options and the sysadmins more flexibility.  Also, the previously  
presented link didn't work for devel versions.  

M doc/src/sgml/installation.sgml

Fix performance issue in EXPLAIN (ANALYZE, TIMING OFF).

commit   : bcc6c4c2914ab4f9a39e4a6673f9b6c36ad93914    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 7 Feb 2013 22:53:00 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 7 Feb 2013 22:53:00 -0500    

Click here for diff

Commit af7914c6627bcf0b0ca614e9ce95d3f8056602bf, which added the TIMING  
option to EXPLAIN, had an oversight: if the TIMING option is disabled  
then control in InstrStartNode() goes through an elog(DEBUG2) call, which  
typically does nothing but takes a noticeable amount of time to do it.  
Tweak the logic to avoid that.  
  
In HEAD, also change the elog(DEBUG2)'s in instrument.c to elog(ERROR).  
It's not very clear why they weren't like that to begin with, but this  
episode shows that not complaining more vociferously about misuse is  
likely to do little except allow bugs to remain hidden.  
  
While at it, adjust some code that was making possibly-dangerous  
assumptions about flag bits being in the rightmost byte of the  
instrument_options word.  
  
Problem reported by Pavel Stehule (via Tomas Vondra).  

M src/backend/executor/instrument.c

Make contrib/btree_gist's GiST penalty function a bit saner.

commit   : 9221f9d485b26d8c663fa2c381e6ecf59b6b3488    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 7 Feb 2013 19:13:59 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 7 Feb 2013 19:13:59 -0500    

Click here for diff

The previous coding supposed that the first differing bytes in two varlena  
datums must have the same sign difference as their overall comparison  
result.  This is obviously bogus for text strings in non-C locales, and  
probably wrong for numeric, and even for bytea I think it was wrong on  
machines where char is signed.  When the assumption failed, the function  
could deliver a zero or negative penalty in situations where such a result  
is quite ridiculous, leading the core GiST code to make very bad page-split  
decisions.  
  
To fix, take the absolute values of the byte-level differences.  Also,  
switch the code to using unsigned char not just char, so that the behavior  
will be consistent whether char is signed or not.  
  
Per investigation of a trouble report from Tomas Vondra.  Back-patch to all  
supported branches.  

M contrib/btree_gist/btree_utils_var.c

Fix erroneous range-union logic for varlena types in contrib/btree_gist.

commit   : 94f565dcf1ada1f2a7c6905f205e14060c4ce08b    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 7 Feb 2013 18:22:19 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 7 Feb 2013 18:22:19 -0500    

Click here for diff

gbt_var_bin_union() failed to do the right thing when the existing range  
needed to be widened at both ends rather than just one end.  This could  
result in an invalid index in which keys that are present would not be  
found by searches, because the searches would not think they need to  
descend to the relevant leaf pages.  This error affected all the varlena  
datatypes supported by btree_gist (text, bytea, bit, numeric).  
  
Per investigation of a trouble report from Tomas Vondra.  (There is also  
an issue in gbt_var_penalty(), but that should only result in inefficiency  
not wrong answers.  I'm committing this separately so that we have a git  
state in which it can be tested that bad penalty results don't produce  
invalid indexes.)  Back-patch to all supported branches.  

M contrib/btree_gist/btree_utils_var.c

Repair bugs in GiST page splitting code for multi-column indexes.

commit   : 166d534fcd1d16edb7c6d57429b2ebde80c02ff7    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 7 Feb 2013 17:44:02 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 7 Feb 2013 17:44:02 -0500    

Click here for diff

When considering a non-last column in a multi-column GiST index,  
gistsplit.c tries to improve on the split chosen by the opclass-specific  
pickSplit function by considering penalties for the next column.  However,  
there were two bugs in this code: it failed to recompute the union keys for  
the leftmost index columns, even though these might well change after  
reassigning tuples; and it included the old union keys in the recomputation  
for the columns it did recompute, so that those keys couldn't get smaller  
even if they should.  The first problem could result in an invalid index  
in which searches wouldn't find index entries that are in fact present;  
the second would make the index less efficient to search.  
  
Both of these errors were caused by misuse of gistMakeUnionItVec, whose  
API was designed in a way that just begged such errors to be made.  There  
is no situation in which it's safe or useful to compute the union keys for  
a subset of the index columns, and there is no caller that wants any  
previous union keys to be included in the computation; so the undocumented  
choice to treat the union keys as in/out rather than pure output parameters  
is a waste of code as well as being dangerous.  
  
Hence, rather than just making a minimal patch, I've changed the API of  
gistMakeUnionItVec to remove the "startkey" parameter (it now always  
processes all index columns) and treat the attr/isnull arrays as purely  
output parameters.  
  
In passing, also get rid of a couple of unnecessary and dangerous uses  
of static variables in gistutil.c.  It's remarkable that the one in  
gistMakeUnionKey hasn't given us portability troubles before now, because  
in addition to posing a re-entrancy hazard, it was unsafely assuming that  
a static char[] array would have at least Datum alignment.  
  
Per investigation of a trouble report from Tomas Vondra.  (There are also  
some bugs in contrib/btree_gist to be fixed, but that seems like material  
for a separate patch.)  Back-patch to all supported branches.  

M src/backend/access/gist/gistsplit.c
M src/backend/access/gist/gistutil.c
M src/include/access/gist_private.h

Fix possible failure to send final transaction counts to stats collector.

commit   : c5aad8dc14d8ad9d7d55ee4a9b136b6273c7991a    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 7 Feb 2013 14:44:00 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 7 Feb 2013 14:44:00 -0500    

Click here for diff

Normally, we suppress sending a tabstats message to the collector unless  
there were some actual table stats to send.  However, during backend exit  
we should force out the message if there are any transaction commit/abort  
counts to send, else the session's last few commit/abort counts will never  
get reported at all.  We had logic for this, but the short-circuit test  
at the top of pgstat_report_stat() ignored the "force" flag, with the  
consequence that session-ending transactions that touched no database-local  
tables would not get counted.  Seems to be an oversight in my commit  
641912b4d17fd214a5e5bae4e7bb9ddbc28b144b, which added the "force" flag.  
That was back in 8.3, so back-patch to all supported versions.  

M src/backend/postmaster/pgstat.c

Rely only on checkpoint 1 at end of recovery. Searching for checkpoint 2 (previous) is not correct in all cases.

commit   : 072521b8c804cc15800e503244661d17c6202ccc    
  
author   : Simon Riggs <simon@2ndQuadrant.com>    
date     : Thu, 7 Feb 2013 16:33:05 +0000    
  
committer: Simon Riggs <simon@2ndQuadrant.com>    
date     : Thu, 7 Feb 2013 16:33:05 +0000    

Click here for diff

Bug report from Heikki Linnakangas  

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

Enable building with Microsoft Visual Studio 2012.

commit   : e1c1e2173248f39c1b15fca7b2a31ad7b5199ce7    
  
author   : Andrew Dunstan <andrew@dunslane.net>    
date     : Wed, 6 Feb 2013 14:52:29 -0500    
  
committer: Andrew Dunstan <andrew@dunslane.net>    
date     : Wed, 6 Feb 2013 14:52:29 -0500    

Click here for diff

Backpatch to release 9.2  
  
Brar Piening and Noah Misch, reviewed by Craig Ringer.  

M doc/src/sgml/install-windows.sgml
M src/backend/utils/adt/pg_locale.c
M src/bin/initdb/initdb.c
M src/port/chklocale.c
M src/port/win32env.c
M src/tools/msvc/MSBuildProject.pm
M src/tools/msvc/README
M src/tools/msvc/Solution.pm
M src/tools/msvc/VSObjectFactory.pm
M src/tools/msvc/build.pl
M src/tools/msvc/gendef.pl

Split out list of XLog resource managers

commit   : 5a1cd89f8f4a0bc13c85810de47d48bb6386ea89    
  
author   : Alvaro Herrera <alvherre@alvh.no-ip.org>    
date     : Tue, 5 Feb 2013 17:21:29 -0300    
  
committer: Alvaro Herrera <alvherre@alvh.no-ip.org>    
date     : Tue, 5 Feb 2013 17:21:29 -0300    

Click here for diff

The new rmgrlist.h header, containing all necessary data  
about built-in resource managers, allows other pieces of code to  
access them.  
  
In particular, this allows a future pg_xlogdump program to extract  
rm_desc function pointers, without having to keep a duplicate list of  
them.  

M src/backend/access/transam/rmgr.c
M src/include/access/rmgr.h
A src/include/access/rmgrlist.h
M src/include/access/xlog_internal.h

Improve error message wording

commit   : cb9b66d31ad4bcd37226f20d651a213323621b89    
  
author   : Alvaro Herrera <alvherre@alvh.no-ip.org>    
date     : Tue, 5 Feb 2013 22:46:26 -0300    
  
committer: Alvaro Herrera <alvherre@alvh.no-ip.org>    
date     : Tue, 5 Feb 2013 22:46:26 -0300    

Click here for diff

The wording changes applied in 0ac5ad513 were universally disliked.  
  
Per gripe from Andrew Dunstan  

M contrib/file_fdw/output/file_fdw.source
M src/backend/optimizer/plan/initsplan.c
M src/backend/optimizer/plan/planner.c
M src/backend/parser/analyze.c

Prevent execution of enum_recv() from SQL.

commit   : ab0f7b6089fd215f6ce6081e2e222c38d643a526    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Mon, 4 Feb 2013 16:25:01 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Mon, 4 Feb 2013 16:25:01 -0500    

Click here for diff

This function was misdeclared to take cstring when it should take internal.  
This at least allows crashing the server, and in principle an attacker  
might be able to use the function to examine the contents of server memory.  
  
The correct fix is to adjust the system catalog contents (and fix the  
regression tests that should have caught this but failed to).  However,  
asking users to correct the catalog contents in existing installations  
is a pain, so as a band-aid fix for the back branches, install a check  
in enum_recv() to make it throw error if called with a cstring argument.  
We will later revert this in HEAD in favor of correcting the catalogs.  
  
Our thanks to Sumit Soni (via Secunia SVCRP) for reporting this issue.  
  
Security: CVE-2013-0255  

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 src/backend/utils/adt/enum.c

Update release notes for 9.2.3, 9.1.8, 9.0.12, 8.4.16, 8.3.23.

commit   : 318db6b2a05ca12d7ca7bae288bf473def4bdd42    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Mon, 4 Feb 2013 15:50:42 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Mon, 4 Feb 2013 15:50:42 -0500    

Click here for diff

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

Reset vacuum_defer_cleanup_age to PGC_SIGHUP. Revert commit 84725aa5efe11688633b553e58113efce4181f2e

commit   : f480e294498533820f3ef3e6de4dcb8ff5401140    
  
author   : Simon Riggs <simon@2ndQuadrant.com>    
date     : Mon, 4 Feb 2013 16:39:55 +0000    
  
committer: Simon Riggs <simon@2ndQuadrant.com>    
date     : Mon, 4 Feb 2013 16:39:55 +0000    

Click here for diff

M doc/src/sgml/config.sgml
M src/backend/utils/misc/guc.c

Reset master xmin when hot_standby_feedback disabled. If walsender has xmin of standby then ensure we reset the value to 0 when we change from hot_standby_feedback=on to hot_standby_feedback=off.

commit   : bd56e74127dea4102d1fc761d65fefbb32146713    
  
author   : Simon Riggs <simon@2ndQuadrant.com>    
date     : Mon, 4 Feb 2013 10:29:22 +0000    
  
committer: Simon Riggs <simon@2ndQuadrant.com>    
date     : Mon, 4 Feb 2013 10:29:22 +0000    

Click here for diff

M doc/src/sgml/protocol.sgml
M src/backend/replication/walreceiver.c
M src/backend/replication/walsender.c

Perform line wrapping and indenting by default in ruleutils.c.

commit   : 62e666400dddf605b9b6d9a7ac2918711b5c5629    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sun, 3 Feb 2013 15:56:45 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sun, 3 Feb 2013 15:56:45 -0500    

Click here for diff

This patch changes pg_get_viewdef() and allied functions so that  
PRETTY_INDENT processing is always enabled.  Per discussion, only the  
PRETTY_PAREN processing (that is, stripping of "unnecessary" parentheses)  
poses any real forward-compatibility risk, so we may as well make dump  
output look as nice as we safely can.  
  
Also, set the default wrap length to zero (i.e, wrap after each SELECT  
or FROM list item), since there's no very principled argument for the  
former default of 80-column wrapping, and most people seem to agree this  
way looks better.  
  
Marko Tiikkaja, reviewed by Jeevan Chalke, further hacking by Tom Lane  

M doc/src/sgml/func.sgml
M src/backend/utils/adt/ruleutils.c
M src/test/regress/expected/aggregates.out
M src/test/regress/expected/collate.out
M src/test/regress/expected/create_view.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/window.out
M src/test/regress/expected/with.out
M src/test/regress/expected/xml.out
M src/test/regress/expected/xml_1.out

PL/Python: Add result object str handler

commit   : 330ed4ac6c55294c62bfd975d6e1aafda274e096    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Sun, 3 Feb 2013 00:31:01 -0500    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
date     : Sun, 3 Feb 2013 00:31:01 -0500    

Click here for diff

This is intended so that say plpy.debug(rv) prints something useful for  
debugging query execution results.  
  
reviewed by Steve Singer  

M doc/src/sgml/plpython.sgml
M src/pl/plpython/expected/plpython_spi.out
M src/pl/plpython/plpy_resultobject.c
M src/pl/plpython/sql/plpython_spi.sql

Create a psql command \gset to store query results into psql variables.

commit   : d2d153fdb08053d655bd0fef14187eed6a674193    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sat, 2 Feb 2013 17:06:38 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sat, 2 Feb 2013 17:06:38 -0500    

Click here for diff

This eases manipulation of query results in psql scripts.  
  
Pavel Stehule, reviewed by Piyush Newe, Shigeru Hanada, and Tom Lane  

M doc/src/sgml/ref/psql-ref.sgml
M src/bin/psql/command.c
M src/bin/psql/common.c
M src/bin/psql/help.c
M src/bin/psql/settings.h
M src/bin/psql/tab-complete.c
A src/test/regress/expected/psql.out
M src/test/regress/parallel_schedule
M src/test/regress/serial_schedule
A src/test/regress/sql/psql.sql

Prevent "\g filename" from affecting subsequent commands after an error.

commit   : 101d6ae755656b675b7c18db655249511982b780    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sat, 2 Feb 2013 14:21:24 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sat, 2 Feb 2013 14:21:24 -0500    

Click here for diff

In the previous coding, psql's state variable saying that output should  
go to a file was only reset after successful completion of a query  
returning tuples.  Thus for example,  
  
regression=# select 1/0  
regression-# \g somefile  
ERROR:  division by zero  
regression=# select 1/2;  
regression=#  
  
... huh, I wonder where that output went.  Even more oddly, the state  
was not reset even if it's the file that's causing the failure:  
  
regression=# select 1/2 \g /foo  
/foo: Permission denied  
regression=# select 1/2;  
/foo: Permission denied  
regression=# select 1/2;  
/foo: Permission denied  
  
This seems to me not to satisfy the principle of least surprise.  
\g is certainly not documented in a way that suggests its effects are  
at all persistent.  
  
To fix, adjust the code so that the flag is reset at exit from SendQuery  
no matter what happened.  
  
Noted while reviewing the \gset patch, which had comparable issues.  
Arguably this is a bug fix, but I'll refrain from back-patching for now.  

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

Mark vacuum_defer_cleanup_age as PGC_POSTMASTER.

commit   : 84725aa5efe11688633b553e58113efce4181f2e    
  
author   : Simon Riggs <simon@2ndQuadrant.com>    
date     : Sat, 2 Feb 2013 18:49:54 +0000    
  
committer: Simon Riggs <simon@2ndQuadrant.com>    
date     : Sat, 2 Feb 2013 18:49:54 +0000    

Click here for diff

Following bug analysis of #7819 by Tom Lane  

M doc/src/sgml/config.sgml
M src/backend/utils/misc/guc.c

Adjust COPY FREEZE error message to be more accurate and consistent.

commit   : e8ae01966115a35d3815e0445da5f78878f6dd14    
  
author   : Bruce Momjian <bruce@momjian.us>    
date     : Sat, 2 Feb 2013 12:56:14 -0500    
  
committer: Bruce Momjian <bruce@momjian.us>    
date     : Sat, 2 Feb 2013 12:56:14 -0500    

Click here for diff

Per suggestions from Noah and Tom.  

M src/backend/commands/copy.c
M src/test/regress/expected/copy2.out

doc: Tiny whitespace fix

commit   : f4987049ef7dd28d810a77c3b15a0a202ad493f8    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Fri, 1 Feb 2013 21:44:22 -0500    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
date     : Fri, 1 Feb 2013 21:44:22 -0500    

Click here for diff

M doc/src/sgml/func.sgml

Move Assert() definitions to c.h

commit   : e1d25de35a2b1f809e8f8d7b182ce0af004f3ec9    
  
author   : Alvaro Herrera <alvherre@alvh.no-ip.org>    
date     : Fri, 1 Feb 2013 17:50:04 -0300    
  
committer: Alvaro Herrera <alvherre@alvh.no-ip.org>    
date     : Fri, 1 Feb 2013 17:50:04 -0300    

Click here for diff

This way, they can be used by frontend and backend code.  We already  
supported that, but doing it this way allows us to mix true frontend  
files with backend files compiled in frontend environment.  
  
Author: Andres Freund  

M src/include/c.h
M src/include/postgres.h
M src/include/postgres_fe.h

Fix typo in freeze_table_age implementation

commit   : dd1569da67937b819d1589a9f664af9aa9657945    
  
author   : Alvaro Herrera <alvherre@alvh.no-ip.org>    
date     : Fri, 1 Feb 2013 12:00:40 -0300    
  
committer: Alvaro Herrera <alvherre@alvh.no-ip.org>    
date     : Fri, 1 Feb 2013 12:00:40 -0300    

Click here for diff

The original code used freeze_min_age instead of freeze_table_age.  The  
main consequence of this mistake is that lowering freeze_min_age would  
cause full-table scans to occur much more frequently, which causes  
serious issues because the number of writes required is much larger.  
That feature (freeze_min_age) is supposed to affect only how soon tuples  
are frozen; some pages should still be skipped due to the visibility  
map.  
  
Backpatch to 8.4, where the freeze_table_age feature was introduced.  
  
Report and patch from Andres Freund  

M src/backend/commands/vacuum.c

Fill tuple before HeapSatisfiesHOTAndKeyUpdate

commit   : 9ee00ef4c7de991b9371f614ce9c03ff436ce383    
  
author   : Alvaro Herrera <alvherre@alvh.no-ip.org>    
date     : Fri, 1 Feb 2013 10:43:09 -0300    
  
committer: Alvaro Herrera <alvherre@alvh.no-ip.org>    
date     : Fri, 1 Feb 2013 10:43:09 -0300    

Click here for diff

Failing to do this results in almost all updates to system catalogs  
being non-HOT updates, because the OID column would differ (not having  
been set for the new tuple), which is an indexed column.  
  
While at it, make sure to set the tableoid early in both old and new  
tuples as well.  This isn't of much consequence, since that column is  
seldom (never?) indexed.  
  
Report and patch from Andres Freund.  

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

Add CREATE RECURSIVE VIEW syntax

commit   : 583905269378bf41c24585773885b1e226a998ce    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Thu, 31 Jan 2013 22:31:58 -0500    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
date     : Thu, 31 Jan 2013 22:31:58 -0500    

Click here for diff

This is specified in the SQL standard.  The CREATE RECURSIVE VIEW  
specification is transformed into a normal CREATE VIEW statement with a  
WITH RECURSIVE clause.  
  
reviewed by Abhijit Menon-Sen and Stephen Frost  

M doc/src/sgml/ref/create_view.sgml
M src/backend/parser/gram.y
M src/test/regress/expected/with.out
M src/test/regress/sql/with.sql

PL/Tcl: Fix compiler warnings with Tcl 8.6

commit   : b1980f6d03f79ab57da8f32aa8cd9677dbe1d58f    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Thu, 31 Jan 2013 22:08:53 -0500    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
date     : Thu, 31 Jan 2013 22:08:53 -0500    

Click here for diff

Some constification was added in the Tcl APIs, so add the modifiers in  
PL/Tcl as well.  

M src/pl/tcl/pltcl.c

Restrict infomask bits to set on multixacts

commit   : b78647a0e6f7b110273e98601f26d3d1db0ad931    
  
author   : Alvaro Herrera <alvherre@alvh.no-ip.org>    
date     : Thu, 31 Jan 2013 19:12:35 -0300    
  
committer: Alvaro Herrera <alvherre@alvh.no-ip.org>    
date     : Thu, 31 Jan 2013 19:12:35 -0300    

Click here for diff

We must only set the bit(s) for the strongest lock held in the tuple;  
otherwise, a multixact containing members with exclusive lock and  
key-share lock will behave as though only a share lock is held.  
  
This bug was introduced in commit 0ac5ad5134, somewhere along  
development, when we allowed a singleton FOR SHARE lock to be  
implemented without a MultiXact by using a multi-bit pattern.  
I overlooked that GetMultiXactIdHintBits() needed to be tweaked as well.  
Previously, we could have the bits for FOR KEY SHARE and FOR UPDATE  
simultaneously set and it wouldn't cause a problem.  
  
Per report from digoal@126.com  

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

pgrowlocks: fix bogus lock strength output

commit   : 77a3082fc546774808b76f58173caec3852ebf62    
  
author   : Alvaro Herrera <alvherre@alvh.no-ip.org>    
date     : Thu, 31 Jan 2013 19:11:34 -0300    
  
committer: Alvaro Herrera <alvherre@alvh.no-ip.org>    
date     : Thu, 31 Jan 2013 19:11:34 -0300    

Click here for diff

Per report from digoal@126.com  

M contrib/pgrowlocks/pgrowlocks.c

pg_upgrade docs: mention modification of postgresql.conf in new cluster

commit   : a11e15c7b66c647269ecad73560be0e717ffc400    
  
author   : Bruce Momjian <bruce@momjian.us>    
date     : Thu, 31 Jan 2013 16:32:35 -0500    
  
committer: Bruce Momjian <bruce@momjian.us>    
date     : Thu, 31 Jan 2013 16:32:35 -0500    

Click here for diff

Mention it might be necessary to modify postgresql.conf in the new  
cluster to match the old cluster.  
  
Backpatch to 9.2.  
  
Suggested by user.  

M doc/src/sgml/pgupgrade.sgml

Switch timelines if we crash soon after promotion. Previous patch to skip checkpoints at end of recovery didn't correctly perform crash recovery, fumbling the timeline switch. Now we record the minRecoveryPointTLI of the newly selected timeline, so that we crash recover to the correct timeline.

commit   : 3f0ab052330905f1ad2183684e75e6a2cbfa0c76    
  
author   : Simon Riggs <simon@2ndQuadrant.com>    
date     : Thu, 31 Jan 2013 19:29:32 +0000    
  
committer: Simon Riggs <simon@2ndQuadrant.com>    
date     : Thu, 31 Jan 2013 19:29:32 +0000    

Click here for diff

Bug report from Fujii Masao, investigated by me.  

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

Reject nonzero day fields in AT TIME ZONE INTERVAL functions.

commit   : 9afc58396af75d59ea2eec467724faf68fe63890    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 31 Jan 2013 12:12:23 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 31 Jan 2013 12:12:23 -0500    

Click here for diff

It's not sensible for an interval that's used as a time zone value to be  
larger than a day.  When we changed the interval type to contain a separate  
day field, check_timezone() was adjusted to reject nonzero day values, but  
timetz_izone(), timestamp_izone(), and timestamptz_izone() evidently were  
overlooked.  
  
While at it, make the error messages for these three cases consistent.  

M src/backend/utils/adt/date.c
M src/backend/utils/adt/timestamp.c

Properly zero-pad the day-of-year part of the win32 build number

commit   : bfb8a8d3818972faf1976eccedddfaee7eb0f613    
  
author   : Magnus Hagander <magnus@hagander.net>    
date     : Thu, 31 Jan 2013 15:03:24 +0100    
  
committer: Magnus Hagander <magnus@hagander.net>    
date     : Thu, 31 Jan 2013 15:03:24 +0100    

Click here for diff

This ensure the version number increases over time. The first three digits  
in the version number is still set to the actual PostgreSQL version  
number, but the last one is intended to be an ever increasing build number,  
which previosly failed when it changed between 1, 2 and 3 digits long values.  
  
Noted by Deepak  

M src/tools/msvc/Project.pm

Add --aggregate-interval option.

commit   : 6a651d85eb6b2df7cbcbdf4b2f82a1660e691d12    
  
author   : Tatsuo Ishii <ishii@postgresql.org>    
date     : Thu, 31 Jan 2013 15:53:58 +0900    
  
committer: Tatsuo Ishii <ishii@postgresql.org>    
date     : Thu, 31 Jan 2013 15:53:58 +0900    

Click here for diff

The new option specifies length of aggregation interval (in  
seconds). May be used only together with -l. With this option, the log  
contains per-interval summary (number of transactions, min/max latency  
and two additional fields useful for variance estimation).  
  
Patch contributed by Tomas Vondra, reviewed by Pavel Stehule. Slight  
change by Tatsuo Ishii, suggested by Robert Hass to emit an error  
message indicating that the option is not currently supported on  
Windows.  

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

Don't use spi_priv.h in plpython.

commit   : 2ab218b57698bf76fc31b03e6230d057f5187ba3    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Wed, 30 Jan 2013 20:11:58 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Wed, 30 Jan 2013 20:11:58 -0500    

Click here for diff

There may once have been a reason to violate modularity like that,  
but it doesn't appear that there is anymore.  

M src/pl/plpython/plpy_spi.c

Fix plpgsql's reporting of plan-time errors in possibly-simple expressions.

commit   : 0900ac2d0dba3168ba574e5b0b61170237b4fdea    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Wed, 30 Jan 2013 20:02:23 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Wed, 30 Jan 2013 20:02:23 -0500    

Click here for diff

exec_simple_check_plan and exec_eval_simple_expr attempted to call  
GetCachedPlan directly.  This meant that if an error was thrown during  
planning, the resulting context traceback would not include the line  
normally contributed by _SPI_error_callback.  This is already inconsistent,  
but just to be really odd, a re-execution of the very same expression  
*would* show the additional context line, because we'd already have cached  
the plan and marked the expression as non-simple.  
  
The problem is easy to demonstrate in 9.2 and HEAD because planning of a  
cached plan doesn't occur at all until GetCachedPlan is done.  In earlier  
versions, it could only be an issue if initial planning had succeeded, then  
a replan was forced (already somewhat improbable for a simple expression),  
and the replan attempt failed.  Since the issue is mainly cosmetic in older  
branches anyway, it doesn't seem worth the risk of trying to fix it there.  
It is worth fixing in 9.2 since the instability of the context printout can  
affect the results of GET STACKED DIAGNOSTICS, as per a recent discussion  
on pgsql-novice.  
  
To fix, introduce a SPI function that wraps GetCachedPlan while installing  
the correct callback function.  Use this instead of calling GetCachedPlan  
directly from plpgsql.  
  
Also introduce a wrapper function for extracting a SPI plan's  
CachedPlanSource list.  This lets us stop including spi_priv.h in  
pl_exec.c, which was never a very good idea from a modularity standpoint.  
  
In passing, fix a similar inconsistency that could occur in SPI_cursor_open,  
which was also calling GetCachedPlan without setting up a context callback.  

M src/backend/executor/spi.c
M src/include/executor/spi.h
M src/pl/plpgsql/src/pl_exec.c
M src/test/regress/expected/plpgsql.out
M src/test/regress/sql/plpgsql.sql

Fix grammar for subscripting or field selection from a sub-SELECT result.

commit   : 670a6c7a228aea1f31fb96f6bfa69969962e133e    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Wed, 30 Jan 2013 14:16:16 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Wed, 30 Jan 2013 14:16:16 -0500    

Click here for diff

Such cases should work, but the grammar failed to accept them because of  
our ancient precedence hacks to convince bison that extra parentheses  
around a sub-SELECT in an expression are unambiguous.  (Formally, they  
*are* ambiguous, but we don't especially care whether they're treated as  
part of the sub-SELECT or part of the expression.  Bison cares, though.)  
Fix by adding a redundant-looking production for this case.  
  
This is a fine example of why fixing shift/reduce conflicts via  
precedence declarations is more dangerous than it looks: you can easily  
cause the parser to reject cases that should work.  
  
This has been wrong since commit 3db4056e22b0c6b2adc92543baf8408d2894fe91  
or maybe before, and apparently some people have been working around it  
by inserting no-op casts.  That method introduces a dump/reload hazard,  
as illustrated in bug #7838 from Jan Mate.  Hence, back-patch to all  
active branches.  

M src/backend/parser/gram.y
M src/test/regress/expected/subselect.out
M src/test/regress/sql/subselect.sql

pg_regress: Allow overriding diff options

commit   : 574f7643214d8381a03083ffbb08ecceec44d6b2    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Tue, 29 Jan 2013 22:58:38 -0500    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
date     : Tue, 29 Jan 2013 22:58:38 -0500    

Click here for diff

By setting the environment variable PG_REGRESS_DIFF_OPTS, custom diff  
options can be passed.  
  
reviewed by Jeevan Chalke  

M doc/src/sgml/regress.sgml
M src/test/regress/pg_regress.c

entab: Fix some compiler warnings

commit   : 5bb2ddc0af62cfcd538e0e51460fc1f4f91ee333    
  
author   : Peter Eisentraut <peter_e@gmx.net>    
date     : Tue, 29 Jan 2013 22:21:21 -0500    
  
committer: Peter Eisentraut <peter_e@gmx.net>    
date     : Tue, 29 Jan 2013 22:21:21 -0500    

Click here for diff

M src/tools/entab/entab.c
M src/tools/entab/halt.c

Provide database object names as separate fields in error messages.

commit   : 991f3e5ab3f8196d18d5b313c81a5f744f3baaea    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Tue, 29 Jan 2013 17:06:26 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Tue, 29 Jan 2013 17:06:26 -0500    

Click here for diff

This patch addresses the problem that applications currently have to  
extract object names from possibly-localized textual error messages,  
if they want to know for example which index caused a UNIQUE_VIOLATION  
failure.  It adds new error message fields to the wire protocol, which  
can carry the name of a table, table column, data type, or constraint  
associated with the error.  (Since the protocol spec has always instructed  
clients to ignore unrecognized field types, this should not create any  
compatibility problem.)  
  
Support for providing these new fields has been added to just a limited set  
of error reports (mainly, those in the "integrity constraint violation"  
SQLSTATE class), but we will doubtless add them to more calls in future.  
  
Pavel Stehule, reviewed and extensively revised by Peter Geoghegan, with  
additional hacking by Tom Lane.  

M doc/src/sgml/errcodes.sgml
M doc/src/sgml/libpq.sgml
M doc/src/sgml/protocol.sgml
M doc/src/sgml/sources.sgml
M src/backend/access/hash/hash.c
M src/backend/access/hash/hashsort.c
M src/backend/access/nbtree/nbtinsert.c
M src/backend/access/nbtree/nbtree.c
M src/backend/access/nbtree/nbtsort.c
M src/backend/commands/tablecmds.c
M src/backend/commands/typecmds.c
M src/backend/executor/execMain.c
M src/backend/executor/execQual.c
M src/backend/executor/execUtils.c
M src/backend/utils/adt/domains.c
M src/backend/utils/adt/ri_triggers.c
M src/backend/utils/cache/relcache.c
M src/backend/utils/error/elog.c
M src/backend/utils/sort/tuplesort.c
M src/include/access/hash.h
M src/include/access/nbtree.h
M src/include/postgres_ext.h
M src/include/utils/builtins.h
M src/include/utils/elog.h
M src/include/utils/relcache.h
M src/include/utils/tuplesort.h
M src/interfaces/libpq/fe-protocol3.c

Allow pgbench to use a scale larger than 21474.

commit   : 89d00cbe01447fd36edbc3bed659f869b18172d1    
  
author   : Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Tue, 29 Jan 2013 11:49:40 +0200    
  
committer: Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Tue, 29 Jan 2013 11:49:40 +0200    

Click here for diff

Beyond 21474, the number of accounts exceed the range for int4. Change the  
initialization code to use bigint for account id columns when scale is large  
enough, and switch to using int64s for the variables in pgbench code. The  
threshold where we switch to bigints is set at 20000, because that's easier  
to remember and document than 21474, and ensures that there is some headroom  
when int4s are used.  
  
Greg Smith, with various changes by Euler Taveira de Oliveira, Gurjeet  
Singh and Satoshi Nagayasu.  

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

Skip truncating ON COMMIT DELETE ROWS temp tables, if the transaction hasn't touched any temporary tables.

commit   : c9d7dbacd387ab3814bc6b38010a9e72a02ea4f5    
  
author   : Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Tue, 29 Jan 2013 10:40:22 +0200    
  
committer: Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Tue, 29 Jan 2013 10:40:22 +0200    

Click here for diff

We could try harder, and keep track of whether we've inserted to any temp  
tables, rather than accessed them, and which temp tables have been inserted  
to. But this is dead simple, and already covers many interesting scenarios.  

M src/backend/commands/tablecmds.c

Fast promote mode skips checkpoint at end of recovery. pg_ctl promote -m fast will skip the checkpoint at end of recovery so that we can achieve very fast failover when the apply delay is low. Write new WAL record XLOG_END_OF_RECOVERY to allow us to switch timeline correctly for downstream log readers. If we skip synchronous end of recovery checkpoint we request a normal spread checkpoint so that the window of re-recovery is low.

commit   : fd4ced5230162b50a5c9d33b4bf9cfb1231aa62e    
  
author   : Simon Riggs <simon@2ndQuadrant.com>    
date     : Tue, 29 Jan 2013 00:06:15 +0000    
  
committer: Simon Riggs <simon@2ndQuadrant.com>    
date     : Tue, 29 Jan 2013 00:06:15 +0000    

Click here for diff

Simon Riggs and Kyotaro Horiguchi, with input from Fujii Masao.  
Review by Heikki Linnakangas  

M src/backend/access/rmgrdesc/xlogdesc.c
M src/backend/access/transam/xlog.c
M src/bin/pg_ctl/pg_ctl.c
M src/include/access/xlog_internal.h
M src/include/catalog/pg_control.h

REASSIGN OWNED: handle shared objects, too

commit   : ee22c55f5ad2e7b7032cd6c0243254d84d4496c7    
  
author   : Alvaro Herrera <alvherre@alvh.no-ip.org>    
date     : Mon, 28 Jan 2013 18:03:23 -0300    
  
committer: Alvaro Herrera <alvherre@alvh.no-ip.org>    
date     : Mon, 28 Jan 2013 18:03:23 -0300    

Click here for diff

Give away ownership of shared objects (databases, tablespaces) along  
with local objects, per original code intention.  Try to make the  
documentation clearer, too.  
  
Per discussion about DROP OWNED's brokenness, in bug #7748.  
  
This is not backpatched because it'd require some refactoring of the  
ALTER/SET OWNER code for databases and tablespaces.  

M doc/src/sgml/ref/reassign_owned.sgml
M src/backend/catalog/pg_shdepend.c

DROP OWNED: don't try to drop tablespaces/databases

commit   : ec41b8edc1192e87f4ad05471c176cc735bda2c9    
  
author   : Alvaro Herrera <alvherre@alvh.no-ip.org>    
date     : Mon, 28 Jan 2013 17:46:47 -0300    
  
committer: Alvaro Herrera <alvherre@alvh.no-ip.org>    
date     : Mon, 28 Jan 2013 17:46:47 -0300    

Click here for diff

My "fix" for bugs #7578 and #6116 on DROP OWNED at fe3b5eb08a1 not only  
misstated that it applied to REASSIGN OWNED (which it did not affect),  
but it also failed to fix the problems fully, because I didn't test the  
case of owned shared objects.  Thus I created a new bug, reported by  
Thomas Kellerer as #7748, which would cause DROP OWNED to fail with a  
not-for-user-consumption error message.  The code would attempt to drop  
the database, which not only fails to work because the underlying code  
does not support that, but is a pretty dangerous and undesirable thing  
to be doing as well.  
  
This patch fixes that bug by having DROP OWNED only attempt to process  
shared objects when grants on them are found, ignoring ownership.  
  
Backpatch to 8.3, which is as far as the previous bug was backpatched.  

M doc/src/sgml/ref/drop_owned.sgml
M src/backend/catalog/pg_shdepend.c

Handle SPIErrors raised directly in PL/Python code.

commit   : 316186f2893d37ecd8e32392ee7c910cca9b93eb    
  
author   : Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Mon, 28 Jan 2013 09:40:20 +0200    
  
committer: Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Mon, 28 Jan 2013 09:40:20 +0200    

Click here for diff

If a PL/Python function raises an SPIError (or one if its subclasses)  
directly with python's raise statement, treat it the same as an SPIError  
generated internally. In particular, if the user sets the sqlstate  
attribute, preserve that.  
  
Oskari Saarenmaa and Jan Urbański, reviewed by Karl O. Pinc.  

M src/pl/plpython/expected/plpython_error.out
M src/pl/plpython/expected/plpython_error_0.out
M src/pl/plpython/plpy_elog.c
M src/pl/plpython/sql/plpython_error.sql

Made ecpglib use translated messages.

commit   : 96bb29dc444f2b7fc8fbddae4fd7fe25d6544665    
  
author   : Michael Meskes <meskes@postgresql.org>    
date     : Sun, 27 Jan 2013 13:48:12 +0100    
  
committer: Michael Meskes <meskes@postgresql.org>    
date     : Sun, 27 Jan 2013 13:48:12 +0100    

Click here for diff

Bug reported and fixed by Chen Huajun <chenhj@cn.fujitsu.com>.  

M src/interfaces/ecpg/ecpglib/misc.c

Make LATERAL implicit for functions in FROM.

commit   : 2378d79ab29865f59245744beb8f04a3ce56d2ae    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sat, 26 Jan 2013 16:18:42 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sat, 26 Jan 2013 16:18:42 -0500    

Click here for diff

The SQL standard does not have general functions-in-FROM, but it does  
allow UNNEST() there (see the <collection derived table> production),  
and the semantics of that are defined to include lateral references.  
So spec compliance requires allowing lateral references within UNNEST()  
even without an explicit LATERAL keyword.  Rather than making UNNEST()  
a special case, it seems best to extend this flexibility to any  
function-in-FROM.  We'll still allow LATERAL to be written explicitly  
for clarity's sake, but it's now a noise word in this context.  
  
In theory this change could result in a change in behavior of existing  
queries, by allowing what had been an outer reference in a function-in-FROM  
to be captured by an earlier FROM-item at the same level.  However, all  
pre-9.3 PG releases have a bug that causes them to match variable  
references to earlier FROM-items in preference to outer references (and  
then throw an error).  So no previously-working query could contain the  
type of ambiguity that would risk a change of behavior.  
  
Per a suggestion from Andrew Gierth, though I didn't use his patch.  

M doc/src/sgml/queries.sgml
M doc/src/sgml/ref/select.sgml
M src/backend/parser/parse_clause.c
M src/test/regress/expected/join.out
M src/test/regress/expected/rangefuncs.out
M src/test/regress/sql/join.sql
M src/test/regress/sql/rangefuncs.sql

Update comments in new DROP IF EXISTS code; commit message update

commit   : 8865fe0ad3e4260db0e67e2064200d96c0999fa0    
  
author   : Bruce Momjian <bruce@momjian.us>    
date     : Sat, 26 Jan 2013 14:51:59 -0500    
  
committer: Bruce Momjian <bruce@momjian.us>    
date     : Sat, 26 Jan 2013 14:51:59 -0500    

Click here for diff

DROP IF EXISTS with a missing schema in commit  
7e2322dff30c04d90c0602d2b5ae24b4881db88b applies not only to tables, but  
to DROP IF EXISTS with missing schemas for indexes, views, sequences,  
and foreign tables.  Yeah!  

M src/backend/catalog/namespace.c

Update LookupExplicitNamespace() comments; commit message update

commit   : 51cfb87ae235ffc875946bcb6cb8404fe97cbb9b    
  
author   : Bruce Momjian <bruce@momjian.us>    
date     : Sat, 26 Jan 2013 13:47:50 -0500    
  
committer: Bruce Momjian <bruce@momjian.us>    
date     : Sat, 26 Jan 2013 13:47:50 -0500    

Click here for diff

Also, commit 7e2322dff30c04d90c0602d2b5ae24b4881db88b affected DROP  
TABLE IF EXISTS, not CREATE TABLE IF EXISTS.  

M src/backend/catalog/namespace.c

Issue ERROR if FREEZE mode can't be honored by COPY

commit   : 4deb57de7dcfb66f850f16c0324731fdf3d86d09    
  
author   : Bruce Momjian <bruce@momjian.us>    
date     : Sat, 26 Jan 2013 13:33:24 -0500    
  
committer: Bruce Momjian <bruce@momjian.us>    
date     : Sat, 26 Jan 2013 13:33:24 -0500    

Click here for diff

Previously non-honored FREEZE mode was ignored.  This also issues an  
appropriate error message based on the cause of the failure, per  
suggestion from Tom.  Additional regression test case added.  

M doc/src/sgml/ref/copy.sgml
M src/backend/commands/copy.c
M src/test/regress/expected/copy2.out
M src/test/regress/sql/copy2.sql

Allow CREATE TABLE IF EXIST so succeed if the schema is nonexistent

commit   : 7e2322dff30c04d90c0602d2b5ae24b4881db88b    
  
author   : Bruce Momjian <bruce@momjian.us>    
date     : Sat, 26 Jan 2013 13:24:50 -0500    
  
committer: Bruce Momjian <bruce@momjian.us>    
date     : Sat, 26 Jan 2013 13:24:50 -0500    

Click here for diff

Previously, CREATE TABLE IF EXIST threw an error if the schema was  
nonexistent.  This was done by passing 'missing_ok' to the function that  
looks up the schema oid.  

M src/backend/catalog/aclchk.c
M src/backend/catalog/namespace.c
M src/backend/commands/indexcmds.c
M src/backend/commands/opclasscmds.c
M src/backend/commands/trigger.c
M src/backend/parser/parse_oper.c
M src/backend/parser/parse_type.c
M src/backend/utils/adt/xml.c
M src/include/catalog/namespace.h

doc: revert 80c20fcf3df17309b3c131962045825f42e45bc7 and 0e93959a70ac6e7c7858d1d6fb00645e7540a1cc

commit   : 7c83619b50c8f8a6d75105636e3ca63a9d2eb7a9    
  
author   : Bruce Momjian <bruce@momjian.us>    
date     : Fri, 25 Jan 2013 21:01:17 -0500    
  
committer: Bruce Momjian <bruce@momjian.us>    
date     : Fri, 25 Jan 2013 21:01:17 -0500    

Click here for diff

Revert patch that modified doc index mentions of search_path  
  
Per Peter E.  

M doc/src/sgml/config.sgml
M doc/src/sgml/ddl.sgml
M doc/src/sgml/ref/create_function.sgml

Fix plpython's handling of functions used as triggers on multiple tables.

commit   : 08be00fabebfa5efb843c9464d994891d80121f5    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Fri, 25 Jan 2013 16:58:55 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Fri, 25 Jan 2013 16:58:55 -0500    

Click here for diff

plp