Re: pgsql: Consistently test for in-use shared memory.

2019-04-03 Thread Andres Freund
Hi, On 2019-04-04 00:16:55 +, Noah Misch wrote: > Consistently test for in-use shared memory. > > postmaster startup scrutinizes any shared memory segment recorded in > postmaster.pid, exiting if that segment matches the current data > directory and has an attached process. When the

pgsql: Improve readability of some tests in strings.sql

2019-04-03 Thread Michael Paquier
Improve readability of some tests in strings.sql c251336 has added some tests to check if a toast relation should be empty or not, hardcoding the toast relation name when calling pg_relation_size(). pg_class.reltoastrelid offers the same information, so simplify the tests to use that.

pgsql: tableam: basic documentation.

2019-04-03 Thread Andres Freund
tableam: basic documentation. This adds documentation about the user oriented parts of table access methods (i.e. the default_table_access_method GUC and the USING clause for CREATE TABLE etc), adds a basic chapter about the table access method interface, and adds a note to storage.sgml that it's

pgsql: Consistently test for in-use shared memory.

2019-04-03 Thread Noah Misch
Consistently test for in-use shared memory. postmaster startup scrutinizes any shared memory segment recorded in postmaster.pid, exiting if that segment matches the current data directory and has an attached process. When the postmaster.pid file was missing, a starting postmaster used weaker

pgsql: Consistently test for in-use shared memory.

2019-04-03 Thread Noah Misch
Consistently test for in-use shared memory. postmaster startup scrutinizes any shared memory segment recorded in postmaster.pid, exiting if that segment matches the current data directory and has an attached process. When the postmaster.pid file was missing, a starting postmaster used weaker

pgsql: Handle USE_MODULE_DB for all tests able to use an installed post

2019-04-03 Thread Noah Misch
Handle USE_MODULE_DB for all tests able to use an installed postmaster. When $(MODULES) and $(MODULE_big) are empty, derive the database name from the first element of $(REGRESS) instead of using a constant string. When deriving the database name from $(MODULES), use its first element instead of

pgsql: Assert that pgwin32_signal_initialize() has been called early en

2019-04-03 Thread Noah Misch
Assert that pgwin32_signal_initialize() has been called early enough. Before the pgwin32_signal_initialize() call, the backend version of pg_usleep() has no effect. No in-tree code falls afoul of that today, but temporary commit 23078689a9921968ac0873b017be6e7f772f10bc did so. Discussion:

pgsql: Consistently test for in-use shared memory.

2019-04-03 Thread Noah Misch
Consistently test for in-use shared memory. postmaster startup scrutinizes any shared memory segment recorded in postmaster.pid, exiting if that segment matches the current data directory and has an attached process. When the postmaster.pid file was missing, a starting postmaster used weaker

pgsql: Consistently test for in-use shared memory.

2019-04-03 Thread Noah Misch
Consistently test for in-use shared memory. postmaster startup scrutinizes any shared memory segment recorded in postmaster.pid, exiting if that segment matches the current data directory and has an attached process. When the postmaster.pid file was missing, a starting postmaster used weaker

pgsql: Consistently test for in-use shared memory.

2019-04-03 Thread Noah Misch
Consistently test for in-use shared memory. postmaster startup scrutinizes any shared memory segment recorded in postmaster.pid, exiting if that segment matches the current data directory and has an attached process. When the postmaster.pid file was missing, a starting postmaster used weaker

pgsql: Consistently test for in-use shared memory.

2019-04-03 Thread Noah Misch
Consistently test for in-use shared memory. postmaster startup scrutinizes any shared memory segment recorded in postmaster.pid, exiting if that segment matches the current data directory and has an attached process. When the postmaster.pid file was missing, a starting postmaster used weaker

pgsql: Handle USE_MODULE_DB for all tests able to use an installed post

2019-04-03 Thread Noah Misch
Handle USE_MODULE_DB for all tests able to use an installed postmaster. When $(MODULES) and $(MODULE_big) are empty, derive the database name from the first element of $(REGRESS) instead of using a constant string. When deriving the database name from $(MODULES), use its first element instead of

pgsql: Handle USE_MODULE_DB for all tests able to use an installed post

2019-04-03 Thread Noah Misch
Handle USE_MODULE_DB for all tests able to use an installed postmaster. When $(MODULES) and $(MODULE_big) are empty, derive the database name from the first element of $(REGRESS) instead of using a constant string. When deriving the database name from $(MODULES), use its first element instead of

pgsql: Handle USE_MODULE_DB for all tests able to use an installed post

2019-04-03 Thread Noah Misch
Handle USE_MODULE_DB for all tests able to use an installed postmaster. When $(MODULES) and $(MODULE_big) are empty, derive the database name from the first element of $(REGRESS) instead of using a constant string. When deriving the database name from $(MODULES), use its first element instead of

pgsql: Handle USE_MODULE_DB for all tests able to use an installed post

2019-04-03 Thread Noah Misch
Handle USE_MODULE_DB for all tests able to use an installed postmaster. When $(MODULES) and $(MODULE_big) are empty, derive the database name from the first element of $(REGRESS) instead of using a constant string. When deriving the database name from $(MODULES), use its first element instead of

pgsql: Handle USE_MODULE_DB for all tests able to use an installed post

2019-04-03 Thread Noah Misch
Handle USE_MODULE_DB for all tests able to use an installed postmaster. When $(MODULES) and $(MODULE_big) are empty, derive the database name from the first element of $(REGRESS) instead of using a constant string. When deriving the database name from $(MODULES), use its first element instead of

pgsql: Doc: clarify partial-index example.

2019-04-03 Thread Tom Lane
Doc: clarify partial-index example. Jonathan Katz Discussion: https://postgr.es/m/155432280882.722.12392985690846288...@wrigleys.postgresql.org Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/af052daec5aa282eab2d22fa3b24d6109a30c2f3 Modified Files --

pgsql: Add SETTINGS option to EXPLAIN, to print modified settings.

2019-04-03 Thread Tomas Vondra
Add SETTINGS option to EXPLAIN, to print modified settings. Query planning is affected by a number of configuration options, and it may be crucial to know which of those options were set to non-default values. With this patch you can say EXPLAIN (SETTINGS ON) to include that information in the

pgsql: Log all statements from a sample of transactions

2019-04-03 Thread Alvaro Herrera
Log all statements from a sample of transactions This is useful to obtain a view of the different transaction types in an application, regardless of the durations of the statements each runs. Author: Adrien Nayrat Reviewed-by: Masahiko Sawada, Hayato Kuroda, Andres Freund Branch -- master

pgsql: Tweak docs for log_statement_sample_rate

2019-04-03 Thread Alvaro Herrera
Tweak docs for log_statement_sample_rate Author: Justin Pryzby, partly after a suggestion from Masahiko Sawada Discussion: https://postgr.es/m/20190328135918.ga27...@telsasoft.com Discussion: https://postgr.es/m/cad21aob9+y8n4+fan-ne-_7j5ytybpttxevkfwuockp4zt1...@mail.gmail.com Branch --

pgsql: Remove now-unnecessary thread pointer arguments in pgbench.

2019-04-03 Thread Tom Lane
Remove now-unnecessary thread pointer arguments in pgbench. Not required after nuking the zipfian thread-local cache. Also add a comment about hazardous pointer punning in threadRun(), and avoid using "thread" to refer to the threads array as a whole. Fabien Coelho and Tom Lane, per suggestion

pgsql: Reduce overhead of pg_mcv_list (de)serialization

2019-04-03 Thread Tomas Vondra
Reduce overhead of pg_mcv_list (de)serialization Commit ea4e1c0e8f resolved issues with memory alignment in serialized pg_mcv_list values, but it required copying data to/from the varlena buffer during serialization and deserialization. As the MCV lits may be fairly large, the overhead (memory

pgsql: GSSAPI encryption support

2019-04-03 Thread Stephen Frost
GSSAPI encryption support On both the frontend and backend, prepare for GSSAPI encryption support by moving common code for error handling into a separate file. Fix a TODO for handling multiple status messages in the process. Eliminate the OIDs, which have not been needed for some time. Add

pgsql: Copy name when cloning FKs recurses to partitions

2019-04-03 Thread Alvaro Herrera
Copy name when cloning FKs recurses to partitions We were passing a string owned by a syscache entry, which was released before recursing. Fix by pstrdup'ing the string. Per buildfarm member prion. Branch -- master Details ---

pgsql: Support foreign keys that reference partitioned tables

2019-04-03 Thread Alvaro Herrera
Support foreign keys that reference partitioned tables Previously, while primary keys could be made on partitioned tables, it was not possible to define foreign keys that reference those primary keys. Now it is possible to do that. Author: Álvaro Herrera Reviewed-by: Amit Langote, Jesper

pgsql: Generate less WAL during GiST, GIN and SP-GiST index build.

2019-04-03 Thread Heikki Linnakangas
Generate less WAL during GiST, GIN and SP-GiST index build. Instead of WAL-logging every modification during the build separately, first build the index without any WAL-logging, and make a separate pass through the index at the end, to write all pages to the WAL. This significantly reduces the

pgsql: Correctly initialize newly added struct member

2019-04-03 Thread Alvaro Herrera
Correctly initialize newly added struct member Valgrind was rightly complaining that IndexVacuumInfo->report_progress (added by commit ab0dfc961b6a) was not being initialized in some code paths. Repair. Per buildfarm member lousyjack. Branch -- master Details ---