pgsql: Add error codes to some corruption log messages

2019-08-01 Thread Peter Eisentraut
Add error codes to some corruption log messages In some cases we have elog(ERROR) while corruption is certain and we can give a clear error code ERRCODE_DATA_CORRUPTED or ERRCODE_INDEX_CORRUPTED. Author: Andrey Borodin Discussion: https://www.postgresql.org/message-id/flat/25f6c686-6442-4a6b-ba

pgsql: Add an isolation test to exercise parallel-worker deadlock resol

2019-08-01 Thread Tom Lane
Add an isolation test to exercise parallel-worker deadlock resolution. Commit a1c1af2a1 added logic in the deadlock checker to handle lock grouping, but it was very poorly tested, as evidenced by the bug fixed in 3420851a2. Add a test case that exercises that a bit better (and catches the bug ---

pgsql: Mark advisory-lock functions as parallel restricted, not paralle

2019-08-01 Thread Tom Lane
Mark advisory-lock functions as parallel restricted, not parallel unsafe. There seems no good reason not to allow a parallel leader to execute these functions. (The workers still can't, though. Although the code would work, any such lock would go away at worker exit, which is not the documented

pgsql: Add sort support routine for the inet data type.

2019-08-01 Thread Peter Geoghegan
Add sort support routine for the inet data type. Add sort support for inet, including support for abbreviated keys. Testing has shown that this reduces the time taken to sort medium to large inet/cidr inputs by ~50-60% in realistic cases. Author: Brandur Leach Reviewed-By: Peter Geoghegan, Edmund

Re: pgsql: Add sort support routine for the inet data type.

2019-08-01 Thread Tom Lane
Peter Geoghegan writes: > Add sort support routine for the inet data type. > Modified Files > -- > src/backend/utils/adt/network.c| 399 + > src/include/catalog/pg_amproc.dat | 3 + > src/include/catalog/pg_proc.dat| 3 + > src/test/regres

Re: pgsql: Add sort support routine for the inet data type.

2019-08-01 Thread Peter Geoghegan
On Thu, Aug 1, 2019 at 12:17 PM Tom Lane wrote: > (Probably not too important since I just pushed a bump an hour > or so earlier, but still.) My mistake. I'll push a catversion bump commit shortly. -- Peter Geoghegan

pgsql: Bump catversion.

2019-08-01 Thread Peter Geoghegan
Bump catversion. Oversight in commit 71dcd743. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/a8d6a95eb992e942838e41029537564d81c4a50e Modified Files -- src/include/catalog/catversion.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

pgsql: Allow functions-in-FROM to be pulled up if they reduce to consta

2019-08-01 Thread Tom Lane
Allow functions-in-FROM to be pulled up if they reduce to constants. This allows simplification of the plan tree in some common usage patterns: we can get rid of a join to the function RTE. In principle we could pull up any immutable expression, but restricting it to Consts avoids the risk that m

pgsql: Allow simplehash to use already-calculated hash values.

2019-08-01 Thread Jeff Davis
Allow simplehash to use already-calculated hash values. Add _lookup_hash and _insert_hash functions for callers that have already calculated the hash value of the key. The immediate use case is for hash algorithms that write to disk in partitions. The hash value can be calculated once, used to pe

pgsql: Fix format truncation issue from ECPG test

2019-08-01 Thread Michael Paquier
Fix format truncation issue from ECPG test This fixes one warning generated by GCC and present in the test case array part of ECPG. This likely got missed in past fixes like 3a4b891 because the compilation of those tests is not done by default. Reported-by: Sergei Kornilov Discussion: https://p