pgsql: Add progress reporting to pg_checksums

2019-04-01 Thread Michael Paquier
Add progress reporting to pg_checksums This adds a new option to pg_checksums called -P/--progress, showing every second some information about the computation state of an operation for --check and --enable (--disable only updates the control file and is quick). This requires a pre-scan of the da

pgsql: Add wal_recycle and wal_init_zero GUCs.

2019-04-01 Thread Thomas Munro
Add wal_recycle and wal_init_zero GUCs. On at least ZFS, it can be beneficial to create new WAL files every time and not to bother zero-filling them. Since it's not clear which other filesystems might benefit from one or both of those things, add individual GUCs to control those two behaviors ind

pgsql: Only allow heap in a number of contrib modules.

2019-04-01 Thread Andres Freund
Only allow heap in a number of contrib modules. Contrib modules pgrowlocks, pgstattuple and some functionality in pageinspect currently only supports the heap table AM. As they are all concerned with low-level details that aren't reasonably exposed via tableam, error out if invoked on a non heap r

pgsql: tableam: Add table_finish_bulk_insert().

2019-04-01 Thread Andres Freund
tableam: Add table_finish_bulk_insert(). This replaces the previous calls of heap_sync() in places using bulk-insert. By passing in the flags used for bulk-insert the AM can decide (first at insert time and then during the finish call) which of the optimizations apply to it, and what operations ar

pgsql: Restrict pgbench's zipfian parameter to ensure good performance.

2019-04-01 Thread Tom Lane
Restrict pgbench's zipfian parameter to ensure good performance. Remove the code that supported zipfian distribution parameters less than 1.0, as it had undocumented performance hazards, and it's not clear that the case is useful enough to justify either fixing or documenting those hazards. Also,

Re: pgsql: Compute XID horizon for page level index vacuum on primary.

2019-04-01 Thread Thomas Munro
On Sat, Mar 30, 2019 at 11:32 PM Thomas Munro wrote: > Here's an attempt to write a suitable comment for the quick fix. And > I suppose effective_io_concurrency is a reasonable default. Pushed. -- Thomas Munro https://enterprisedb.com

pgsql: Fix deadlock in heap_compute_xid_horizon_for_tuples().

2019-04-01 Thread Thomas Munro
Fix deadlock in heap_compute_xid_horizon_for_tuples(). We can't call code that uses syscache while we hold buffer locks on a catalog relation. If passed such a relation, just fall back to the general effective_io_concurrency GUC rather than trying to look up the containing tablespace's IO concurr

pgsql: Improve documentation about our XML functionality.

2019-04-01 Thread Tom Lane
Improve documentation about our XML functionality. Add a section explaining how our XML features depart from current versions of the SQL standard. Update and clarify the descriptions of some XML functions. Chapman Flack, reviewed by Ryan Lambert Discussion: https://postgr.es/m/5bd1284c.1010...@

pgsql: Add volatile qualifier missed in commit 2e616dee9.

2019-04-01 Thread Tom Lane
Add volatile qualifier missed in commit 2e616dee9. Noted by Pavel Stehule Discussion: https://postgr.es/m/CAFj8pRAaGO5FX7bnP3E=mrssok8y5t78x7jky-vdiys68l8...@mail.gmail.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/b2b819019f4449f2fd889ce0c39ffa81ebfaee16 M

pgsql: Unified logging system for command-line programs

2019-04-01 Thread Peter Eisentraut
Unified logging system for command-line programs This unifies the various ad hoc logging (message printing, error printing) systems used throughout the command-line programs. Features: - Program name is automatically prefixed. - Message string does not end with newline. This removes a common

pgsql: Restrict some cases in parsing numerics in jsonpath

2019-04-01 Thread Alexander Korotkov
Restrict some cases in parsing numerics in jsonpath Jsonpath now accepts integers with leading zeroes and floats starting with a dot. However, SQL standard requires to follow JSON specification, which doesn't allow none of these cases. Our json[b] datatypes also restrict that. So, restrict it in

pgsql: Throw error in jsonb_path_match() when result is not single bool

2019-04-01 Thread Alexander Korotkov
Throw error in jsonb_path_match() when result is not single boolean jsonb_path_match() checks if jsonb document matches jsonpath query. Therefore, jsonpath query should return single boolean. Currently, if result of jsonpath is not a single boolean, NULL is returned independently whether silent

pgsql: GIN support for @@ and @? jsonpath operators

2019-04-01 Thread Alexander Korotkov
GIN support for @@ and @? jsonpath operators This commit makes existing GIN operator classes jsonb_ops and json_path_ops support "jsonb @@ jsonpath" and "jsonb @? jsonpath" operators. Basic idea is to extract statements of following form out of jsonpath. key1.key2. ... .keyN = const The rest o

pgsql: Catch syntax error in generated column definition

2019-04-01 Thread Peter Eisentraut
Catch syntax error in generated column definition The syntax GENERATED BY DEFAULT AS (expr) is not allowed but we have to accept it in the grammar to avoid shift/reduce conflicts because of the similar syntax for identity columns. The existing code just ignored this, incorrectly. Add an ex

Re: pgsql: Compute XID horizon for page level index vacuum on primary.

2019-04-01 Thread Simon Riggs
On Fri, 29 Mar 2019 at 16:32, Andres Freund wrote: > On 2019-03-29 16:20:54 +, Simon Riggs wrote: > > On Fri, 29 Mar 2019 at 16:12, Andres Freund wrote: > > > > > > > On 2019-03-29 15:58:14 +, Simon Riggs wrote: > > > > On Fri, 29 Mar 2019 at 15:29, Andres Freund > wrote: > > > > > That