pgsql: Suppress possibly-uninitialized-variable warnings.

2018-01-19 Thread Tom Lane
Suppress possibly-uninitialized-variable warnings. Apparently, Peter's compiler has faith that the switch test values here could never not be valid values of their enums. Mine does not, and I tend to agree with it. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/96

pgsql: PL/Python: Simplify PLyLong_FromInt64

2018-01-19 Thread Peter Eisentraut
PL/Python: Simplify PLyLong_FromInt64 We don't actually need two code paths, one for 32 bits and one for 64 bits. Since the existing code already assumed that "long long" is available, we can just use PyLong_FromLongLong() for 64 bits as well. In Python 2.5 and later, PyLong_FromLong() and PyLong

pgsql: Allow UPDATE to move rows between partitions.

2018-01-19 Thread Robert Haas
Allow UPDATE to move rows between partitions. When an UPDATE causes a row to no longer match the partition constraint, try to move it to a different partition where it does match the partition constraint. In essence, the UPDATE is split into a DELETE from the old partition and an INSERT into the

pgsql: Fix CompareIndexInfo's attnum comparisons

2018-01-19 Thread Alvaro Herrera
Fix CompareIndexInfo's attnum comparisons When an index column is an expression, it makes no sense to compare its attribute numbers. This seems to account for remaining buildfarm fallout from 8b08f7d4820f. At least, it solves the issue in my local 32bit VM -- let's see what the rest thinks. Bran

pgsql: Replace AclObjectKind with ObjectType

2018-01-19 Thread Peter Eisentraut
Replace AclObjectKind with ObjectType AclObjectKind was basically just another enumeration for object types, and we already have a preferred one for that. It's only used in aclcheck_error. By using ObjectType instead, we can also give some more precise error messages, for example "index" instead

pgsql: Replace GrantObjectType with ObjectType

2018-01-19 Thread Peter Eisentraut
Replace GrantObjectType with ObjectType There used to be a lot of different *Type and *Kind symbol groups to address objects within different commands, most of which have been replaced by ObjectType, starting with b256f2426433c56b4bea3a8102757749885b81ba. But this conversion was never done for th

Re: pgsql: Local partitioned indexes

2018-01-19 Thread Tom Lane
Alvaro Herrera writes: > Local partitioned indexes Evidently you're not there yet. I'm suspicious that the continuing failures on dromedary may trace to its use of -DCOPY_PARSE_PLAN_TREES ... try looking for a missed field addition in copyfuncs.c. regards, tom lane

pgsql: Fix pg_dump version comparison

2018-01-19 Thread Alvaro Herrera
Fix pg_dump version comparison I missed a '0' in the version number string ... Per buildfarm member crake. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/42b5856038a5af6bb4ec3c09b62d9d9a3ab43172 Modified Files -- src/bin/pg_dump/pg_dump.c | 2 +- 1 fil

pgsql: Fix regression tests for better stability

2018-01-19 Thread Alvaro Herrera
Fix regression tests for better stability Per buildfarm Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/189d0ff588f54b9641c6684d7c668ef85ea4dfbd Modified Files -- src/test/regress/expected/indexing.out | 26 +- src/test/regress/sq

pgsql: Local partitioned indexes

2018-01-19 Thread Alvaro Herrera
Local partitioned indexes When CREATE INDEX is run on a partitioned table, create catalog entries for an index on the partitioned table (which is just a placeholder since the table proper has no data of its own), and recurse to create actual indexes on the existing partitions; create them in futur

pgsql: Fix StoreCatalogInheritance1 to use 32bit inhseqno

2018-01-19 Thread Alvaro Herrera
Fix StoreCatalogInheritance1 to use 32bit inhseqno For no apparent reason, this function was using a 16bit-wide inhseqno value, rather than the correct 32 bit width which is what is stored in the pg_inherits catalog. This becomes evident if you try to create a table with more than 65535 parents,

pgsql: Fix StoreCatalogInheritance1 to use 32bit inhseqno

2018-01-19 Thread Alvaro Herrera
Fix StoreCatalogInheritance1 to use 32bit inhseqno For no apparent reason, this function was using a 16bit-wide inhseqno value, rather than the correct 32 bit width which is what is stored in the pg_inherits catalog. This becomes evident if you try to create a table with more than 65535 parents,

pgsql: Fix StoreCatalogInheritance1 to use 32bit inhseqno

2018-01-19 Thread Alvaro Herrera
Fix StoreCatalogInheritance1 to use 32bit inhseqno For no apparent reason, this function was using a 16bit-wide inhseqno value, rather than the correct 32 bit width which is what is stored in the pg_inherits catalog. This becomes evident if you try to create a table with more than 65535 parents,

pgsql: Fix StoreCatalogInheritance1 to use 32bit inhseqno

2018-01-19 Thread Alvaro Herrera
Fix StoreCatalogInheritance1 to use 32bit inhseqno For no apparent reason, this function was using a 16bit-wide inhseqno value, rather than the correct 32 bit width which is what is stored in the pg_inherits catalog. This becomes evident if you try to create a table with more than 65535 parents,

pgsql: Fix StoreCatalogInheritance1 to use 32bit inhseqno

2018-01-19 Thread Alvaro Herrera
Fix StoreCatalogInheritance1 to use 32bit inhseqno For no apparent reason, this function was using a 16bit-wide inhseqno value, rather than the correct 32 bit width which is what is stored in the pg_inherits catalog. This becomes evident if you try to create a table with more than 65535 parents,

pgsql: Fix StoreCatalogInheritance1 to use 32bit inhseqno

2018-01-19 Thread Alvaro Herrera
Fix StoreCatalogInheritance1 to use 32bit inhseqno For no apparent reason, this function was using a 16bit-wide inhseqno value, rather than the correct 32 bit width which is what is stored in the pg_inherits catalog. This becomes evident if you try to create a table with more than 65535 parents,

pgsql: Transfer state pertaining to pending REINDEX operations to worke

2018-01-19 Thread Robert Haas
Transfer state pertaining to pending REINDEX operations to workers. This will allow the pending patch for parallel CREATE INDEX to work on system catalogs, and to provide the same level of protection against use of user indexes while they are being rebuilt that we have for non-parallel CREATE INDE