[COMMITTERS] pgsql: Misc GIN refactoring.

2013-11-06 Thread Heikki Linnakangas
Misc GIN refactoring.

Merge the isEnoughSpace and placeToPage functions in the b-tree interface
into one function that tries to put a tuple on page, and returns false if
it doesn't fit.

Move createPostingTree function to gindatapage.c, and change its contract
so that it can be passed more items than fit on the root page. It's in a
better position than the callers to know how many items fit.

Move ginMergeItemPointers out of gindatapage.c, into a separate file.

These changes make no difference now, but reduce the footprint of Alexander
Korotkov's upcoming patch to pack item pointers more tightly.

Branch
--
master

Details
---
http://git.postgresql.org/pg/commitdiff/ecaa4708e5dde5e9f72cdb066780acb4b12ee0ec

Modified Files
--
src/backend/access/gin/Makefile |2 +-
src/backend/access/gin/README   |2 +-
src/backend/access/gin/ginbtree.c   |   21 ++--
src/backend/access/gin/gindatapage.c|  163 +--
src/backend/access/gin/ginentrypage.c   |   14 ++-
src/backend/access/gin/gininsert.c  |   94 +-
src/backend/access/gin/ginpostinglist.c |   56 +++
src/backend/access/gin/ginvacuum.c  |   49 +-
src/include/access/gin_private.h|3 +-
9 files changed, 223 insertions(+), 181 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


[COMMITTERS] pgsql: Fix missing argument and function prototypes.

2013-11-06 Thread Heikki Linnakangas
Fix missing argument and function prototypes.

Not sure how I missed these in previous commit.

Branch
--
master

Details
---
http://git.postgresql.org/pg/commitdiff/0ea53256a856693dc8e8e1ce5ce26b3438d2e341

Modified Files
--
src/backend/access/gin/gininsert.c |3 ++-
src/include/access/gin_private.h   |   13 +
2 files changed, 11 insertions(+), 5 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


[COMMITTERS] pgsql: Keep heap open until new heap generated in RMV.

2013-11-06 Thread Kevin Grittner
Keep heap open until new heap generated in RMV.

Early close became apparent when invalidation messages were
processed in a new location under CLOBBER_CACHE_ALWAYS builds, due
to additional locking.

Back-patch to 9.3

Branch
--
REL9_3_STABLE

Details
---
http://git.postgresql.org/pg/commitdiff/bc06faeb78c0e66927cd04f46ed8b5d41ab18427

Modified Files
--
src/backend/commands/matview.c |4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


[COMMITTERS] pgsql: Keep heap open until new heap generated in RMV.

2013-11-06 Thread Kevin Grittner
Keep heap open until new heap generated in RMV.

Early close became apparent when invalidation messages were
processed in a new location under CLOBBER_CACHE_ALWAYS builds, due
to additional locking.

Back-patch to 9.3

Branch
--
master

Details
---
http://git.postgresql.org/pg/commitdiff/5829082a57be8bcbc5f75cd28d935730b783c6d2

Modified Files
--
src/backend/commands/matview.c |4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


[COMMITTERS] pgsql: Prevent creating window functions with default arguments.

2013-11-06 Thread Tom Lane
Prevent creating window functions with default arguments.

Insertion of default arguments doesn't work for window functions, which is
likely to cause a crash at runtime if the implementation code doesn't check
the number of actual arguments carefully.  It doesn't seem worth working
harder than this for pre-9.2 branches.

Branch
--
REL9_1_STABLE

Details
---
http://git.postgresql.org/pg/commitdiff/aad87e3f25ad751a3d021c139fd3adbbe1d19fce

Modified Files
--
doc/src/sgml/syntax.sgml  |7 +++
src/backend/catalog/pg_proc.c |6 ++
2 files changed, 13 insertions(+)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


[COMMITTERS] pgsql: Prevent creating window functions with default arguments.

2013-11-06 Thread Tom Lane
Prevent creating window functions with default arguments.

Insertion of default arguments doesn't work for window functions, which is
likely to cause a crash at runtime if the implementation code doesn't check
the number of actual arguments carefully.  It doesn't seem worth working
harder than this for pre-9.2 branches.

Branch
--
REL9_0_STABLE

Details
---
http://git.postgresql.org/pg/commitdiff/352ab596fa5a8a4ceec6d308ebae34176cc09c13

Modified Files
--
doc/src/sgml/syntax.sgml  |7 +++
src/backend/catalog/pg_proc.c |6 ++
2 files changed, 13 insertions(+)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


[COMMITTERS] pgsql: Support default arguments and named-argument notation for window

2013-11-06 Thread Tom Lane
Support default arguments and named-argument notation for window functions.

These things didn't work because the planner omitted to do the necessary
preprocessing of a WindowFunc's argument list.  Add the few dozen lines
of code needed to handle that.

Although this sounds like a feature addition, it's really a bug fix because
the default-argument case was likely to crash previously, due to lack of
checking of the number of supplied arguments in the built-in window
functions.  It's not a security issue because there's no way for a
non-superuser to create a window function definition with defaults that
refers to a built-in C function, but nonetheless people might be annoyed
that it crashes rather than producing a useful error message.  So
back-patch as far as the patch applies easily, which turns out to be 9.2.
I'll put a band-aid in earlier versions as a separate patch.

(Note that these features still don't work for aggregates, and fixing that
case will be harder since we represent aggregate arg lists as target lists
not bare expression lists.  There's no crash risk though because CREATE
AGGREGATE doesn't accept defaults, and we reject named-argument notation
when parsing an aggregate call.)

Branch
--
REL9_2_STABLE

Details
---
http://git.postgresql.org/pg/commitdiff/74aea2af96e5a97513c7d7c10e4c9d70ab6ed31d

Modified Files
--
doc/src/sgml/syntax.sgml |8 +++
src/backend/optimizer/util/clauses.c |   44 ++
src/backend/parser/parse_func.c  |   11 -
src/backend/utils/adt/ruleutils.c|7 --
src/test/regress/expected/window.out |   35 +++
src/test/regress/sql/window.sql  |   10 
6 files changed, 102 insertions(+), 13 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


[COMMITTERS] pgsql: Prevent creating window functions with default arguments.

2013-11-06 Thread Tom Lane
Prevent creating window functions with default arguments.

Insertion of default arguments doesn't work for window functions, which is
likely to cause a crash at runtime if the implementation code doesn't check
the number of actual arguments carefully.  It doesn't seem worth working
harder than this for pre-9.2 branches.

Branch
--
REL8_4_STABLE

Details
---
http://git.postgresql.org/pg/commitdiff/72c8a584bf7dd362227a3e0c23c39cc217f5753d

Modified Files
--
src/backend/catalog/pg_proc.c |6 ++
1 file changed, 6 insertions(+)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


[COMMITTERS] pgsql: Support default arguments and named-argument notation for window

2013-11-06 Thread Tom Lane
Support default arguments and named-argument notation for window functions.

These things didn't work because the planner omitted to do the necessary
preprocessing of a WindowFunc's argument list.  Add the few dozen lines
of code needed to handle that.

Although this sounds like a feature addition, it's really a bug fix because
the default-argument case was likely to crash previously, due to lack of
checking of the number of supplied arguments in the built-in window
functions.  It's not a security issue because there's no way for a
non-superuser to create a window function definition with defaults that
refers to a built-in C function, but nonetheless people might be annoyed
that it crashes rather than producing a useful error message.  So
back-patch as far as the patch applies easily, which turns out to be 9.2.
I'll put a band-aid in earlier versions as a separate patch.

(Note that these features still don't work for aggregates, and fixing that
case will be harder since we represent aggregate arg lists as target lists
not bare expression lists.  There's no crash risk though because CREATE
AGGREGATE doesn't accept defaults, and we reject named-argument notation
when parsing an aggregate call.)

Branch
--
REL9_3_STABLE

Details
---
http://git.postgresql.org/pg/commitdiff/66e6daa3e1a0c94f2fcf3463757d478c76c38b3a

Modified Files
--
doc/src/sgml/syntax.sgml |8 +++
src/backend/optimizer/util/clauses.c |   44 ++
src/backend/parser/parse_func.c  |   11 -
src/backend/utils/adt/ruleutils.c|7 --
src/test/regress/expected/window.out |   35 +++
src/test/regress/sql/window.sql  |   10 
6 files changed, 102 insertions(+), 13 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


[COMMITTERS] pgsql: Support default arguments and named-argument notation for window

2013-11-06 Thread Tom Lane
Support default arguments and named-argument notation for window functions.

These things didn't work because the planner omitted to do the necessary
preprocessing of a WindowFunc's argument list.  Add the few dozen lines
of code needed to handle that.

Although this sounds like a feature addition, it's really a bug fix because
the default-argument case was likely to crash previously, due to lack of
checking of the number of supplied arguments in the built-in window
functions.  It's not a security issue because there's no way for a
non-superuser to create a window function definition with defaults that
refers to a built-in C function, but nonetheless people might be annoyed
that it crashes rather than producing a useful error message.  So
back-patch as far as the patch applies easily, which turns out to be 9.2.
I'll put a band-aid in earlier versions as a separate patch.

(Note that these features still don't work for aggregates, and fixing that
case will be harder since we represent aggregate arg lists as target lists
not bare expression lists.  There's no crash risk though because CREATE
AGGREGATE doesn't accept defaults, and we reject named-argument notation
when parsing an aggregate call.)

Branch
--
master

Details
---
http://git.postgresql.org/pg/commitdiff/bb45c640411af61279bea044f8d108f9da96b735

Modified Files
--
doc/src/sgml/syntax.sgml |5 ++--
src/backend/optimizer/util/clauses.c |   50 ++
src/backend/parser/parse_func.c  |   11 
src/backend/utils/adt/ruleutils.c|7 +++--
src/test/regress/expected/window.out |   35 
src/test/regress/sql/window.sql  |   10 +++
6 files changed, 103 insertions(+), 15 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


[COMMITTERS] pgsql: Be more robust when strerror() doesn't give a useful result.

2013-11-06 Thread Tom Lane
Be more robust when strerror() doesn't give a useful result.

glibc, at least, is capable of returning "???" instead of anything useful
if it doesn't like the setting of LC_CTYPE.  If this happens, or in the
previously-known case of strerror() returning an empty string, try to
print the C macro name for the error code ("EACCES" etc).  Only if we
don't have the error code in our compiled-in list of popular error codes
(which covers most though not quite all of what's called out in the POSIX
spec) will we fall back to printing a numeric error code.  This should
simplify debugging.

Note that this functionality is currently only provided for %m in backend
ereport/elog messages.  That may be sufficient, since we don't fool with the
locale environment in frontend clients, but it's foreseeable that we might
want similar code in libpq for instance.

There was some talk of back-patching this, but let's see how the buildfarm
likes it first.  It seems likely that at least some of the POSIX-defined
error code symbols don't exist on all platforms.  I don't want to clutter
the entire list with #ifdefs, but we may need more than are here now.

MauMau, edited by me

Branch
--
master

Details
---
http://git.postgresql.org/pg/commitdiff/8e68816cc2567642c6fcca4eaac66c25e0ae5ced

Modified Files
--
src/backend/utils/error/elog.c |  161 +++-
1 file changed, 157 insertions(+), 4 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


[COMMITTERS] pgsql: Add #ifdef guards for some POSIX error symbols that Windows does

2013-11-06 Thread Tom Lane
Add #ifdef guards for some POSIX error symbols that Windows doesn't like.

Per buildfarm results.  It looks like the older the Windows version, the
more errno codes it hasn't got ...

Branch
--
master

Details
---
http://git.postgresql.org/pg/commitdiff/8dace66e0735ca39b779922d02c24ea2686e6521

Modified Files
--
src/backend/utils/error/elog.c |   26 ++
1 file changed, 26 insertions(+)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers