Re: pgsql: Fix configure's snprintf test so it exposes HP-UX bug.

2018-08-23 Thread Andres Freund
On 2018-08-17 14:38:41 +, Tom Lane wrote: > Fix configure's snprintf test so it exposes HP-UX bug. > > Since commit e1d19c902, buildfarm member gharial has been failing with > symptoms indicating that snprintf sometimes returns -1 for buffer > overrun, even though it passes the added configure

pgsql: Introduce minimal C99 usage to verify compiler support.

2018-08-23 Thread Andres Freund
Introduce minimal C99 usage to verify compiler support. This just converts a few for loops in postgres.c to declare variables in the loop initializer, and uses designated initializers in smgr.c's definition of smgr callbacks. Author: Andres Freund Discussion: https://postgr.es/m/97d4b165-192d-36

pgsql: Require C99 (and thus MSCV 2013 upwards).

2018-08-23 Thread Andres Freund
Require C99 (and thus MSCV 2013 upwards). In 86d78ef50e01 I enabled configure to check for C99 support, with the goal of checking which platforms support C99. While there are a few machines without C99 support among our buildfarm animals, de-supporting them for v12 was deemed acceptable. While n

pgsql: Add more tests for VACUUM skips with partitioned tables

2018-08-23 Thread Michael Paquier
Add more tests for VACUUM skips with partitioned tables A VACUUM or ANALYZE command listing directly a partitioned table expands it to its partitions, causing all elements of a tree to be processed with individual ownership checks done. This results in different relation skips depending on the ow

pgsql: Deduplicate code between slot_getallattrs() and slot_getsomeattr

2018-08-23 Thread Andres Freund
Deduplicate code between slot_getallattrs() and slot_getsomeattrs(). Code in slot_getallattrs() is the same as if slot_getsomeattrs() is called with number of attributes specified in the tuple descriptor. Implement it that way instead of duplicating the code between those two functions. This is p

pgsql: Fix lexing of standard multi-character operators in edge cases.

2018-08-23 Thread Andrew Gierth
Fix lexing of standard multi-character operators in edge cases. Commits c6b3c939b (which fixed the precedence of >=, <=, <> operators) and 865f14a2d (which added support for the standard => notation for named arguments) created a class of lexer tokens which look like multi-character operators but

pgsql: Fix lexing of standard multi-character operators in edge cases.

2018-08-23 Thread Andrew Gierth
Fix lexing of standard multi-character operators in edge cases. Commits c6b3c939b (which fixed the precedence of >=, <=, <> operators) and 865f14a2d (which added support for the standard => notation for named arguments) created a class of lexer tokens which look like multi-character operators but

pgsql: Fix lexing of standard multi-character operators in edge cases.

2018-08-23 Thread Andrew Gierth
Fix lexing of standard multi-character operators in edge cases. Commits c6b3c939b (which fixed the precedence of >=, <=, <> operators) and 865f14a2d (which added support for the standard => notation for named arguments) created a class of lexer tokens which look like multi-character operators but

pgsql: Reduce an unnecessary O(N^3) loop in lexer.

2018-08-23 Thread Andrew Gierth
Reduce an unnecessary O(N^3) loop in lexer. The lexer's handling of operators contained an O(N^3) hazard when dealing with long strings of + or - characters; it seems hard to prevent this case from being O(N^2), but the additional N multiplier was not needed. Backpatch all the way since this has

pgsql: Reduce an unnecessary O(N^3) loop in lexer.

2018-08-23 Thread Andrew Gierth
Reduce an unnecessary O(N^3) loop in lexer. The lexer's handling of operators contained an O(N^3) hazard when dealing with long strings of + or - characters; it seems hard to prevent this case from being O(N^2), but the additional N multiplier was not needed. Backpatch all the way since this has

pgsql: Reduce an unnecessary O(N^3) loop in lexer.

2018-08-23 Thread Andrew Gierth
Reduce an unnecessary O(N^3) loop in lexer. The lexer's handling of operators contained an O(N^3) hazard when dealing with long strings of + or - characters; it seems hard to prevent this case from being O(N^2), but the additional N multiplier was not needed. Backpatch all the way since this has

pgsql: Fix lexing of standard multi-character operators in edge cases.

2018-08-23 Thread Andrew Gierth
Fix lexing of standard multi-character operators in edge cases. Commits c6b3c939b (which fixed the precedence of >=, <=, <> operators) and 865f14a2d (which added support for the standard => notation for named arguments) created a class of lexer tokens which look like multi-character operators but

pgsql: Reduce an unnecessary O(N^3) loop in lexer.

2018-08-23 Thread Andrew Gierth
Reduce an unnecessary O(N^3) loop in lexer. The lexer's handling of operators contained an O(N^3) hazard when dealing with long strings of + or - characters; it seems hard to prevent this case from being O(N^2), but the additional N multiplier was not needed. Backpatch all the way since this has

pgsql: Reduce an unnecessary O(N^3) loop in lexer.

2018-08-23 Thread Andrew Gierth
Reduce an unnecessary O(N^3) loop in lexer. The lexer's handling of operators contained an O(N^3) hazard when dealing with long strings of + or - characters; it seems hard to prevent this case from being O(N^2), but the additional N multiplier was not needed. Backpatch all the way since this has

pgsql: Reduce an unnecessary O(N^3) loop in lexer.

2018-08-23 Thread Andrew Gierth
Reduce an unnecessary O(N^3) loop in lexer. The lexer's handling of operators contained an O(N^3) hazard when dealing with long strings of + or - characters; it seems hard to prevent this case from being O(N^2), but the additional N multiplier was not needed. Backpatch all the way since this has

pgsql: Fix lexing of standard multi-character operators in edge cases.

2018-08-23 Thread Andrew Gierth
Fix lexing of standard multi-character operators in edge cases. Commits c6b3c939b (which fixed the precedence of >=, <=, <> operators) and 865f14a2d (which added support for the standard => notation for named arguments) created a class of lexer tokens which look like multi-character operators but

pgsql: Reduce an unnecessary O(N^3) loop in lexer.

2018-08-23 Thread Andrew Gierth
Reduce an unnecessary O(N^3) loop in lexer. The lexer's handling of operators contained an O(N^3) hazard when dealing with long strings of + or - characters; it seems hard to prevent this case from being O(N^2), but the additional N multiplier was not needed. Backpatch all the way since this has

pgsql: In libpq, don't look up all the hostnames at once.

2018-08-23 Thread Tom Lane
In libpq, don't look up all the hostnames at once. Historically, we looked up the target hostname in connectDBStart, so that PQconnectPoll did not need to do DNS name resolution. The patches that added multiple-target-host support to libpq preserved this division of labor; but it's really nonsens

pgsql: In libpq, don't look up all the hostnames at once.

2018-08-23 Thread Tom Lane
In libpq, don't look up all the hostnames at once. Historically, we looked up the target hostname in connectDBStart, so that PQconnectPoll did not need to do DNS name resolution. The patches that added multiple-target-host support to libpq preserved this division of labor; but it's really nonsens

pgsql: In libpq, don't look up all the hostnames at once.

2018-08-23 Thread Tom Lane
In libpq, don't look up all the hostnames at once. Historically, we looked up the target hostname in connectDBStart, so that PQconnectPoll did not need to do DNS name resolution. The patches that added multiple-target-host support to libpq preserved this division of labor; but it's really nonsens

pgsql: Copy-editing of pg_verify_checksums help and ref page

2018-08-23 Thread Peter Eisentraut
Copy-editing of pg_verify_checksums help and ref page Reformat synopsis, put options into better order, make the desciption line a bit shorter, and put more details into the description. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/2d41d914ab70cfd45f89bc1fdf68214

pgsql: Copy-editing of pg_verify_checksums help and ref page

2018-08-23 Thread Peter Eisentraut
Copy-editing of pg_verify_checksums help and ref page Reformat synopsis, put options into better order, make the desciption line a bit shorter, and put more details into the description. Branch -- REL_11_STABLE Details --- https://git.postgresql.org/pg/commitdiff/9126b4ee1c59ef07c55227b5

pgsql: PL/pgSQL: Extend test case

2018-08-23 Thread Peter Eisentraut
PL/pgSQL: Extend test case This test was supposed to check the interaction of INOUT and default parameters in a procedure call, but it only checked the case where the parameter was not supplied. Now it also checks the case where the parameter was supplied. It was already working correctly, so no

pgsql: PL/pgSQL: Extend test case

2018-08-23 Thread Peter Eisentraut
PL/pgSQL: Extend test case This test was supposed to check the interaction of INOUT and default parameters in a procedure call, but it only checked the case where the parameter was not supplied. Now it also checks the case where the parameter was supplied. It was already working correctly, so no

pgsql: Return type of txid_status is text, not txid_status

2018-08-23 Thread Alvaro Herrera
Return type of txid_status is text, not txid_status Thinko in commit 857ee8e39. Discovered-by: Gianni Ciolli Branch -- REL_10_STABLE Details --- https://git.postgresql.org/pg/commitdiff/3f722ae26a92d1c46079dffc72b63d8376958f8c Modified Files -- doc/src/sgml/func.sgml | 2 +-

pgsql: Return type of txid_status is text, not txid_status

2018-08-23 Thread Alvaro Herrera
Return type of txid_status is text, not txid_status Thinko in commit 857ee8e39. Discovered-by: Gianni Ciolli Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/d10f7741650de3199033702c3fe98a6896fd32a9 Modified Files -- doc/src/sgml/func.sgml | 2 +- 1 file

pgsql: Return type of txid_status is text, not txid_status

2018-08-23 Thread Alvaro Herrera
Return type of txid_status is text, not txid_status Thinko in commit 857ee8e39. Discovered-by: Gianni Ciolli Branch -- REL_11_STABLE Details --- https://git.postgresql.org/pg/commitdiff/c2b5d177182a96aa0f9926c3bee2598253918700 Modified Files -- doc/src/sgml/func.sgml | 2 +-