pgsql: Fix bugs in mdsyncfiletag().

2019-04-04 Thread Thomas Munro
Fix bugs in mdsyncfiletag(). Commit 3eb77eba moved a _mdfd_getseg() call from mdsync() into a new callback function mdsyncfiletag(), but didn't get the arguments quite right. Without the EXTENSION_DONT_CHECK_SIZE flag we fail to open a segment if lower-numbered segments have been truncated, and i

pgsql: Handle errors during GSSAPI startup better

2019-04-04 Thread Stephen Frost
Handle errors during GSSAPI startup better There was some confusion over the format of the error message returned from the server during GSSAPI startup; specifically, it was expected that a length would be returned when, in reality, at this early stage in the startup sequence, no length is returne

Re: pgsql: Generated columns

2019-04-04 Thread David Rowley
On Sat, 30 Mar 2019 at 20:25, Peter Eisentraut wrote: > src/backend/utils/cache/lsyscache.c | 33 + This change has caused a new compiler warning for compilers that don't understand that elog(ERROR) can't return. The attached fixes. -- David Rowley http://www.2nd

pgsql: Fix some documentation in pg_rewind

2019-04-04 Thread Michael Paquier
Fix some documentation in pg_rewind Since 11, it is possible to use a non-superuser role when using an online source cluster with pg_rewind as long as the role has proper permissions to execute on the source all the functions used by pg_rewind, and the documentation stated that a superuser is nece

pgsql: Fix some documentation in pg_rewind

2019-04-04 Thread Michael Paquier
Fix some documentation in pg_rewind A confusion which comes a lot from users is that it is necessary to issue a checkpoint on a freshly-promoted standby so as its control file has up-to-date timeline information which is used by pg_rewind to validate the operation. Let's document that properly.

pgsql: Fix some documentation in pg_rewind

2019-04-04 Thread Michael Paquier
Fix some documentation in pg_rewind A confusion which comes a lot from users is that it is necessary to issue a checkpoint on a freshly-promoted standby so as its control file has up-to-date timeline information which is used by pg_rewind to validate the operation. Let's document that properly.

pgsql: Fix some documentation in pg_rewind

2019-04-04 Thread Michael Paquier
Fix some documentation in pg_rewind Since 11, it is possible to use a non-superuser role when using an online source cluster with pg_rewind as long as the role has proper permissions to execute on the source all the functions used by pg_rewind, and the documentation stated that a superuser is nece

pgsql: Fix some documentation in pg_rewind

2019-04-04 Thread Michael Paquier
Fix some documentation in pg_rewind A confusion which comes a lot from users is that it is necessary to issue a checkpoint on a freshly-promoted standby so as its control file has up-to-date timeline information which is used by pg_rewind to validate the operation. Let's document that properly.

pgsql: Remove unused struct member, enforce multi_insert callback prese

2019-04-04 Thread Andres Freund
Remove unused struct member, enforce multi_insert callback presence. Author: David Rowley, Andres Freund Discussion: https://postgr.es/m/CAKJS1f9=9phmm66diaji4gvhnwsrk7bgfonct+meut_c8pp...@mail.gmail.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/57a7a3adfe4ea

pgsql: Harden tableam against nonexistant / wrong kind of AMs.

2019-04-04 Thread Andres Freund
Harden tableam against nonexistant / wrong kind of AMs. Previously it was allowed to set default_table_access_method to an empty string. That makes sense for default_tablespace, where that was copied from, as it signals falling back to the database's default tablespace. As there is no equivalent f

pgsql: Add test coverage for rootdescend verification.

2019-04-04 Thread Peter Geoghegan
Add test coverage for rootdescend verification. Commit c1afd175, which added support for rootdescend verification to amcheck, added only minimal regression test coverage. Address this by making sure that rootdescend verification is run on a multi-level index. In passing, simplify some of the regr

pgsql: tableam: Add table_multi_insert() and revamp/speed-up COPY FROM

2019-04-04 Thread Andres Freund
tableam: Add table_multi_insert() and revamp/speed-up COPY FROM buffering. This adds table_multi_insert(), and converts COPY FROM, the only user of heap_multi_insert, to it. A simple conversion of COPY FROM use slots would have yielded a slowdown when inserting into a partitioned table for some w

pgsql: Add a "SQLSTATE-only" error verbosity option to libpq and psql.

2019-04-04 Thread Tom Lane
Add a "SQLSTATE-only" error verbosity option to libpq and psql. This is intended for use mostly in test scripts for external tools, which could do without cross-PG-version variations in error message wording. Of course, the SQLSTATE isn't guaranteed stable either, but it should be more so than th

pgsql: pg_restore: Require "-f -" to mean stdout

2019-04-04 Thread Alvaro Herrera
pg_restore: Require "-f -" to mean stdout The previous convention that stdout was selected by default when nothing is specified was just too error-prone. After a suggestion from Andrew Gierth. Author: Euler Taveira Reviewed-by: Yoshikazu Imai, José Arthur Benetasso Villanova Discussion: https://p

pgsql: Make queries' locking of indexes more consistent.

2019-04-04 Thread Tom Lane
Make queries' locking of indexes more consistent. The assertions added by commit b04aeb0a0 exposed that there are some code paths wherein the executor will try to open an index without holding any lock on it. We do have some lock on the index's table, so it seems likely that there's no fatal prob

pgsql: Allow VACUUM to be run with index cleanup disabled.

2019-04-04 Thread Robert Haas
Allow VACUUM to be run with index cleanup disabled. This commit adds a new reloption, vacuum_index_cleanup, which controls whether index cleanup is performed for a particular relation by default. It also adds a new option to the VACUUM command, INDEX_CLEANUP, which can be used to override the rel

pgsql: Invalidate binary search bounds consistently.

2019-04-04 Thread Peter Geoghegan
Invalidate binary search bounds consistently. _bt_check_unique() failed to invalidate binary search bounds in the event of a live conflict following commit e5adcb78. This resulted in problems after waiting for the conflicting xact to commit or abort. The subsequent call to _bt_check_unique() wou

pgsql: Move the be_gssapi_get_* prototypes

2019-04-04 Thread Stephen Frost
Move the be_gssapi_get_* prototypes The be_gssapi_get_* prototypes were put close to similar ones for SSL- but a bit too close since that meant they ended up only being included for SSL-enabled builds. Move those to be under ENABLE_GSS instead. Pointed out by Tom. Branch -- master Details

pgsql: Refactor the fsync queue for wider use.

2019-04-04 Thread Thomas Munro
Refactor the fsync queue for wider use. Previously, md.c and checkpointer.c were tightly integrated so that fsync calls could be handed off and processed in the background. Introduce a system of callbacks and file tags, so that other modules can hand off fsync work in the same way. For now only m

pgsql: file_fdw: Fix for generated columns

2019-04-04 Thread Peter Eisentraut
file_fdw: Fix for generated columns Since file_fdw uses COPY internally, but COPY doesn't allow listing generated columns in its column list, we need to make sure that we don't add generated columns to the column lists internally generated by file_fdw. Reported-by: Erik Rijkers Branch -- ma

pgsql: Fix back-patch of 16ee6eaf80a40007a138b60bb5661660058d0422 to v9

2019-04-04 Thread Noah Misch
Fix back-patch of 16ee6eaf80a40007a138b60bb5661660058d0422 to v9.6. Branch -- REL9_6_STABLE Details --- https://git.postgresql.org/pg/commitdiff/331f152884f2bdf92c61432ef2d10239e67c663c Modified Files -- src/test/recovery/t/017_shm.pl | 2 +- 1 file changed, 1 insertion(+), 1