]> granicus.if.org Git - postgresql/log
postgresql
5 years agoAdd docs of missing GUC to pgtrgm.sgml
Alexander Korotkov [Mon, 10 Jun 2019 16:38:13 +0000 (19:38 +0300)]
Add docs of missing GUC to pgtrgm.sgml

be8a7a68 introduced pg_trgm.strict_word_similarity_threshold GUC, but missed
docs for that.  This commit fixes that.

Discussion: https://postgr.es/m/fc907f70-448e-fda3-3aa4-209a59597af0%402ndquadrant.com
Author: Ian Barwick
Reviewed-by: Masahiko Sawada, Michael Paquier
Backpatch-through: 9.6

5 years agoFix docs indentation in pgtrgm.sgml
Alexander Korotkov [Mon, 10 Jun 2019 16:28:47 +0000 (19:28 +0300)]
Fix docs indentation in pgtrgm.sgml

5871b884 introduced pg_trgm.word_similarity_threshold GUC, but its documentation
contains wrong indentation.  This commit fixes that.  Backpatch for easier
backpatching of other documentation fixes.

Discussion: https://postgr.es/m/4c735d30-ab59-fc0e-45d8-f90eb5ed3855%402ndquadrant.com
Author: Ian Barwick
Backpatch-through: 9.6

5 years agoMSVC: Reconcile clean.bat with PostgreSQL 12 work.
Noah Misch [Sun, 9 Jun 2019 22:50:54 +0000 (15:50 -0700)]
MSVC: Reconcile clean.bat with PostgreSQL 12 work.

5 years agoReconcile nodes/*funcs.c with PostgreSQL 12 work.
Noah Misch [Sun, 9 Jun 2019 21:00:36 +0000 (14:00 -0700)]
Reconcile nodes/*funcs.c with PostgreSQL 12 work.

One would have needed out-of-tree code to observe the defects.  Remove
unreferenced fields instead of completing their support functions.
Since in-tree code can't reach _readIntoClause(), no catversion bump.

5 years agoSwitch position of some declarations in libpq.h
Michael Paquier [Sun, 9 Jun 2019 02:33:52 +0000 (11:33 +0900)]
Switch position of some declarations in libpq.h

This makes the header more consistent with the surroundings, with
declarations associated to a given file grouped together.

Author: Daniel Gustafsson
Discussion: https://postgr.es/m/20190608012439.GB7228@paquier.xyz

5 years agoFix some typos
Michael Paquier [Sun, 9 Jun 2019 02:25:56 +0000 (11:25 +0900)]
Fix some typos

Author: Guillaume Lelarge
Discussion: https://postgr.es/m/CAECtzeWPz4JikzUqZdMjqPTe8dAP3nZxPD-58Y-Hhvirg0fF+A@mail.gmail.com

5 years agoUpdate documentation about SIGKILL of postmaster.
Noah Misch [Sat, 8 Jun 2019 17:12:26 +0000 (10:12 -0700)]
Update documentation about SIGKILL of postmaster.

Removing shared memory and semaphores in response to server start
failure often masks the real problem, a live process associated with the
data directory; see commit 5a907404b52753c4d6c6a7c21765aeaa42fd6a3b.
Since 9.6, it's rarely necessary to kill subprocesses manually.  (When
it is necessary, that commit's HINT will say as much, in all supported
versions.)

5 years agoStop using spelling "nonexistant".
Noah Misch [Sat, 8 Jun 2019 17:12:26 +0000 (10:12 -0700)]
Stop using spelling "nonexistant".

The documentation used "nonexistent" exclusively, and the source tree
used it three times as often as "nonexistant".

5 years agoUpdate stale comments, and fix comment typos.
Noah Misch [Sat, 8 Jun 2019 17:12:26 +0000 (10:12 -0700)]
Update stale comments, and fix comment typos.

5 years agoFix assorted inconsistencies.
Amit Kapila [Sat, 8 Jun 2019 02:46:38 +0000 (08:16 +0530)]
Fix assorted inconsistencies.

There were a number of issues in the recent commits which include typos,
code and comments mismatch, leftover function declarations.  Fix them.

Reported-by: Alexander Lakhin
Author: Alexander Lakhin, Amit Kapila and Amit Langote
Reviewed-by: Amit Kapila
Discussion: https://postgr.es/m/ef0c0232-0c1d-3a35-63d4-0ebd06e31387@gmail.com

5 years agoMove be-gssapi-common.h into src/include/libpq/
Michael Paquier [Sat, 8 Jun 2019 00:59:02 +0000 (09:59 +0900)]
Move be-gssapi-common.h into src/include/libpq/

The file has been introduced in src/backend/libpq/ as of b0b39f72, but
all backend-side headers of libpq are located in src/include/libpq/.
Note that the identification path on top of the file referred to
src/include/libpq/ from the start.

Author: Michael Paquier
Reviewed-by: Stephen Frost
Discussion: https://postgr.es/m/20190607043415.GE1736@paquier.xyz

5 years agoImprove some comments in pg_checksums about the needed clean shutdown
Michael Paquier [Fri, 7 Jun 2019 11:48:39 +0000 (20:48 +0900)]
Improve some comments in pg_checksums about the needed clean shutdown

It was not clear from the code why it is necessary.  And we need a clean
shutdown to avoid random checksum failures caused by torn pages.

Author: Masahiko Sawada
Discussion: https://postgr.es/m/CAD21AoDum5MbAb7F=pa9dOD1W2tukuDMPzWT7NjZceNoWB_6Qw@mail.gmail.com

5 years agoFix copy-pasto in freeing memory on error in vacuumlo.
Heikki Linnakangas [Fri, 7 Jun 2019 09:42:27 +0000 (12:42 +0300)]
Fix copy-pasto in freeing memory on error in vacuumlo.

It's harmless to call PQfreemem() with a NULL argument, so the only
consequence was that if allocating 'schema' failed, but allocating 'table'
or 'field' succeeded, we would leak a bit of memory. That's highly
unlikely to happen, so this is just academical, but let's get it right.

Per bug #15838 from Timur Birsh. Backpatch back to 9.5, where the
PQfreemem() calls were introduced.

Discussion: https://www.postgresql.org/message-id/15838-3221652c72c5e69d@postgresql.org

5 years agoFix default_tablespace usage for partitioned tables
Alvaro Herrera [Fri, 7 Jun 2019 04:44:17 +0000 (00:44 -0400)]
Fix default_tablespace usage for partitioned tables

In commit 87259588d0ab I (Álvaro) tried to rationalize the determination
of tablespace to use for partitioned tables, but failed to handle the
default_tablespace case.  Repair and add proper tests.

Author: Amit Langote, Rushabh Lathia
Reported-by: Rushabh Lathia
Reviewed-by: Amit Langote, Álvaro Herrera
Discussion: https://postgr.es/m/CAGPqQf0cYjm1=rjxk_6gU0SjUS70=yFUAdCJLwWzh9bhNJnyVg@mail.gmail.com

5 years agoFix inconsistency in comments atop ExecParallelEstimate.
Amit Kapila [Thu, 6 Jun 2019 23:53:52 +0000 (05:23 +0530)]
Fix inconsistency in comments atop ExecParallelEstimate.

When this code was initially introduced in commit d1b7c1ff, the structure
used was SharedPlanStateInstrumentation, but later when it got changed to
Instrumentation structure in commit b287df70, we forgot to update the
comment.

Reported-by: Wu Fei
Author: Wu Fei
Reviewed-by: Amit Kapila
Backpatch-through: 9.6
Discussion: https://postgr.es/m/52E6E0843B9D774C8C73D6CF64402F0562215EB2@G08CNEXMBPEKD02.g08.fujitsu.local

5 years agoFix message style
Alvaro Herrera [Thu, 6 Jun 2019 16:18:14 +0000 (12:18 -0400)]
Fix message style

Mark one message not for translation, and prefer "cannot" over "may
not", per commentary from Robert Haas.

Discussion: https://postgr.es/m/20190430145813.GA29872@alvherre.pgsql

5 years agoAdd forgotten translatable string in pg_checksums.c
Michael Paquier [Thu, 6 Jun 2019 13:10:52 +0000 (22:10 +0900)]
Add forgotten translatable string in pg_checksums.c

Oversight in commit 280e5f1.

Author: Kyotaro Horiguchi
Discussion: https://postgr.es/m/20190606.200612.110313249.horikyota.ntt@gmail.com

5 years agopg_waldump: Fix invalid option handling
Peter Eisentraut [Wed, 5 Jun 2019 20:55:16 +0000 (22:55 +0200)]
pg_waldump: Fix invalid option handling

Previously, running pg_waldump with an invalid option (pg_waldump
--foo) would print the help output and exit successfully.  This was
because it tried to process the option letter '?' as a normal option,
but that letter is used by getopt() to report an invalid option.

To fix, process help and version options separately, like we do
everywhere else.  Also add a basic test suite for pg_waldump and run
the basic option handling tests, which would have caught this.

5 years agoFix confusion on different kinds of slots in IndexOnlyScans.
Heikki Linnakangas [Thu, 6 Jun 2019 06:46:52 +0000 (09:46 +0300)]
Fix confusion on different kinds of slots in IndexOnlyScans.

We used the same slot to store a tuple from the index, and to store a
tuple from the table. That's not OK. It worked with the heap, because
heapam_getnextslot() stores a HeapTuple to the slot, and doesn't care how
large the tts_values/nulls arrays are. But when I played with a toy table
AM implementation that used a virtual tuple, it caused memory overruns.

In the passing, tidy up comments on the ioss_PscanLen fields.

5 years agoDocs: concurrent builds of partitioned indexes are not supported
David Rowley [Thu, 6 Jun 2019 00:36:37 +0000 (12:36 +1200)]
Docs: concurrent builds of partitioned indexes are not supported

Document that CREATE INDEX CONCURRENTLY is not currently supported for
indexes on partitioned tables.

Discussion: https://postgr.es/m/CAKJS1f_CErd2z9L21Q8OGLD4TgH7yw1z9MAtHTSO13sXVG-yow@mail.gmail.com
Backpatch-through: 11

5 years agodoc: Add links to tables
Peter Eisentraut [Wed, 5 Jun 2019 20:08:50 +0000 (22:08 +0200)]
doc: Add links to tables

Formal tables should generally have an xref in the text that points to
them.  Add them here.

5 years agoFix confusing NOTICE text in REINDEX CONCURRENTLY
David Rowley [Wed, 5 Jun 2019 09:05:41 +0000 (21:05 +1200)]
Fix confusing NOTICE text in REINDEX CONCURRENTLY

When performing REINDEX TABLE CONCURRENTLY, if all of the table's indexes
could not be reindexed, a NOTICE message claimed that the table had no
indexes.  This was confusing, so let's change the NOTICE text to something
less confusing.

In passing, also mention in the comment before ReindexRelationConcurrently
that materialized views are supported too and also explain what the return
value of the function means.

Author: Ashwin Agrawal
Reviewed-by: Michael Paquier
Discussion: https://postgr.es/m/CALfoeithHvi13p_VyR8kt9o6Pa7Z=Smi6Nfc2anHnQx5Lj8bTQ@mail.gmail.com

5 years agoFix incorrect index behavior in COPY FROM with partitioned tables
David Rowley [Wed, 5 Jun 2019 06:28:38 +0000 (18:28 +1200)]
Fix incorrect index behavior in COPY FROM with partitioned tables

86b85044e rewrote how COPY FROM works to allow multiple tuple buffers to
exist to once thus allowing multi-inserts to be used in more cases with
partitioned tables.  That commit neglected to update the estate's
es_result_relation_info when flushing the insert buffer to the partition
making it possible for the index tuples to be added into an index on the
wrong partition.

Fix this and also add an Assert in ExecInsertIndexTuples to help ensure
that we never make this mistake again.

Reported-by: Haruka Takatsuka
Author: Ashutosh Sharma
Discussion: https://postgr.es/m/15832-b1bf336a4ee246b5@postgresql.org

5 years agoRework code using list_delete_cell() in MergeAttributes
Michael Paquier [Wed, 5 Jun 2019 06:01:14 +0000 (15:01 +0900)]
Rework code using list_delete_cell() in MergeAttributes

When merging two attributes, we are sure that at least one remains.
However, when deleting one element in the attribute list we may finish
with an empty list returned as NIL by list_delete_cell(), but the code
failed to track that, which is not project-like.  Adjust the call so as
we check for an empty list, and make use of it in an assertion.

This has been introduced by e7b3349, when adding support for CREATE
TABLE OF.

Author: Mark Dilger
Reviewed-by: Álvaro Herrera, Michael Paquier
Discussion: https://postgr.es/m/CAE-h2TpPDqSWgOvfvSziOaMngMPwW+QZcmPpY8hQ_KOJ2+3hXQ@mail.gmail.com

5 years agoDocument piecemeal construction of partitioned indexes
Alvaro Herrera [Tue, 4 Jun 2019 20:42:40 +0000 (16:42 -0400)]
Document piecemeal construction of partitioned indexes

Continuous operation cannot be achieved without applying this technique,
so it needs to be properly described.

Author: Álvaro Herrera
Reported-by: Tom Lane
Discussion: https://postgr.es/m/8756.1556302759@sss.pgh.pa.us

5 years agodoc: Fix whitespace
Peter Eisentraut [Tue, 4 Jun 2019 11:57:38 +0000 (13:57 +0200)]
doc: Fix whitespace

Verbatim environment tags should not be indented.

5 years agoAdd command column to pg_stat_progress_create_index
Peter Eisentraut [Tue, 4 Jun 2019 07:16:02 +0000 (09:16 +0200)]
Add command column to pg_stat_progress_create_index

This allows determining which command is running, similar to
pg_stat_progress_cluster.

Discussion: https://www.postgresql.org/message-id/flat/f0e56b3b-74b7-6cbc-e207-a5ed6bee18dc%402ndquadrant.com

5 years agoFix some typos and inconsistencies in tableam.h
Michael Paquier [Tue, 4 Jun 2019 00:48:25 +0000 (09:48 +0900)]
Fix some typos and inconsistencies in tableam.h

The defined callback definitions have been using references to heap for
a couple of variables and comments.  This makes the whole interface more
consistent by using "table" which is more generic.

A variable storing index information was misspelled as well.

Author: Michael Paquier
Discussion: https://postgr.es/m/20190601190946.GB1905@paquier.xyz

5 years agoFix contrib/auto_explain to not cause problems in parallel workers.
Tom Lane [Mon, 3 Jun 2019 22:06:04 +0000 (18:06 -0400)]
Fix contrib/auto_explain to not cause problems in parallel workers.

A parallel worker process should not be making any decisions of its
own about whether to auto-explain.  If the parent session process
passed down flags asking for instrumentation data, do that, otherwise
not.  Trying to enable instrumentation anyway leads to bugs like the
"could not find key N in shm TOC" failure reported in bug #15821
from Christian Hofstaedtler.

We can implement this cheaply by piggybacking on the existing logic
for not doing anything when we've chosen not to sample a statement.

While at it, clean up some tin-eared coding related to the sampling
feature, including an off-by-one error that meant that asking for 1.0
sampling rate didn't actually result in sampling every statement.

Although the specific case reported here only manifested in >= v11,
I believe that related misbehaviors can be demonstrated in any version
that has parallel query; and the off-by-one error is certainly there
back to 9.6 where that feature was added.  So back-patch to 9.6.

Discussion: https://postgr.es/m/15821-5eb422e980594075@postgresql.org

5 years agoFix unsafe memory management in CloneRowTriggersToPartition().
Tom Lane [Mon, 3 Jun 2019 20:59:16 +0000 (16:59 -0400)]
Fix unsafe memory management in CloneRowTriggersToPartition().

It's not really supported to call systable_getnext() in a different
memory context than systable_beginscan() was called in, and it's
*definitely* not safe to do so and then reset that context between
calls.  I'm not very clear on how this code survived
CLOBBER_CACHE_ALWAYS testing ... but Alexander Lakhin found a case
that would crash it pretty reliably.

Per bug #15828.  Fix, and backpatch to v11 where this code came in.

Discussion: https://postgr.es/m/15828-f6ddd7df4852f473@postgresql.org

5 years agoUpdate SQL conformance information about JSON path
Peter Eisentraut [Mon, 3 Jun 2019 19:33:01 +0000 (21:33 +0200)]
Update SQL conformance information about JSON path

Reviewed-by: Oleg Bartunov <obartunov@postgrespro.ru>
5 years agoFix typos in various places
Michael Paquier [Mon, 3 Jun 2019 04:44:03 +0000 (13:44 +0900)]
Fix typos in various places

Author: Andrea Gelmini
Reviewed-by: Michael Paquier, Justin Pryzby
Discussion: https://postgr.es/m/20190528181718.GA39034@glet

5 years agoFix some issues and improve psql completion for access methods
Michael Paquier [Mon, 3 Jun 2019 02:02:32 +0000 (11:02 +0900)]
Fix some issues and improve psql completion for access methods

The following issues have been spotted:
- CREATE INDEX .. USING suggests both index and table AMs, but it should
consider only index AMs.
- CREATE TABLE .. USING has no completion support.  USING was not being
included in the completion list where it should, and follow-up
suggestions for table AMs have been missing as well.
- CREATE ACCESS METHOD .. TYPE suggests only INDEX, with TABLE missing.

Author: Michael Paquier
Discussion: https://postgr.es/m/20190601191007.GC1905@paquier.xyz

5 years agoMake cpluspluscheck more portable.
Tom Lane [Sun, 2 Jun 2019 17:45:01 +0000 (13:45 -0400)]
Make cpluspluscheck more portable.

Teach it to scrape -I and -D switches from CPPFLAGS in Makefile.global.
This is useful for testing on, eg, FreeBSD, where you won't get far
without "-I/usr/local/include".

Also, expand the set of blacklisted-for-unportability atomics headers,
based on noting that arch-x86.h fails to compile on an ARM box.  The
other ones I'd omitted seem to compile all right on architectures they
don't belong to, but that's surely too shaky to rely on.  Let's do
like we did for the src/include/port/ headers, and ignore all except
the variant that's pulled in by the arch-independent header.

5 years agoClean up PL/Perl's handling of the _() macro.
Tom Lane [Sun, 2 Jun 2019 16:23:39 +0000 (12:23 -0400)]
Clean up PL/Perl's handling of the _() macro.

Perl likes to redefine the _() macro:

#ifdef CAN_PROTOTYPE
#define _(args) args
#else ...

There was lots not to like about the way we dealt with this before:

1. Instead of taking care of the conflict centrally in plperl.h, we
expected every one of its ever-growing number of includers to do so.
This is duplicative and error-prone in itself, plus it means that
plperl.h fails to meet the expectation of being compilable standalone,
resulting in macro-redefinition warnings in cpluspluscheck.

2. We left _() with its Perl definition, meaning that if someone tried
to use it in any Perl-related extension, it would silently fail to
provide run-time translation.  I don't see any live bugs of this ilk,
but it's clearly a hard-to-notice bug waiting to happen.

So fix that by centralizing the cleanup logic, making it match what
we're already doing for other macro conflicts with Perl.  Since we only
expect plperl.h to be included by extensions not core code, we should
redefine _() as dgettext() not gettext().

5 years agoworker_spi needs a .gitignore file now.
Tom Lane [Sun, 2 Jun 2019 15:13:23 +0000 (11:13 -0400)]
worker_spi needs a .gitignore file now.

5 years agoUn-break ecpg tests for Windows.
Tom Lane [Sun, 2 Jun 2019 15:07:54 +0000 (11:07 -0400)]
Un-break ecpg tests for Windows.

Declaring a function "inline" still doesn't work with Windows compilers
(C99? what's that?), unless the macro provided by pg_config.h is
in-scope, which it is not in our ECPG test programs.  So the workaround
I tried to use in commit 7640f9312 doesn't work for Windows.  Revert
the change in printf_hack.h, and instead just blacklist that file
in cpluspluscheck --- since it's a not-installed test file, we don't
really need to verify its C++ cleanliness anyway.

5 years agoIncrease test coverage for worker_spi by ∞%
Alvaro Herrera [Sun, 2 Jun 2019 04:29:49 +0000 (00:29 -0400)]
Increase test coverage for worker_spi by ∞%

This test module was not getting invoked, other than at compile time,
limiting its usefulness -- and keeping its coverage at 0%.  Add a
minimal regression test to ensure it runs on make check-world; this
makes it 92% covered (line-wise), which seems sufficient.

Author: Álvaro Herrera <alvherre@alvh.no-ip.org>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/20190529193256.GA17603@alvherre.pgsql

5 years agoFix documentation of check_option in information_schema.views
Michael Paquier [Sat, 1 Jun 2019 19:33:47 +0000 (15:33 -0400)]
Fix documentation of check_option in information_schema.views

Support of CHECK OPTION for updatable views has been added in 9.4, but
the documentation of information_schema never got the call even if the
information displayed is correct.

Author: Gilles Darold
Discussion: https://postgr.es/m/75d07704-6c74-4f26-656a-10045c01a17e@darold.net
Backpatch-through: 9.4

5 years agoImprove coverage of cpluspluscheck.
Tom Lane [Fri, 31 May 2019 20:32:07 +0000 (16:32 -0400)]
Improve coverage of cpluspluscheck.

Formerly, cpluspluscheck was only meant to examine headers that
we thought of as exported --- but its notion of what we export
was well behind the times.  Let's just make it check *all* .h
files, except for a well-defined blacklist, instead.

While at it, improve its ability to use a C++ compiler other than g++,
by scraping the CXX setting from Makefile.global and making it possible
to override the warning options used (per suggestion from Andres Freund).

Discussion: https://postgr.es/m/b517ec3918d645eb950505eac8dd434e@gaz-is.ru

5 years agoIntegrate cpluspluscheck into build system.
Andres Freund [Fri, 31 May 2019 19:36:17 +0000 (12:36 -0700)]
Integrate cpluspluscheck into build system.

Previously cpluspluscheck wouldn't work in vpath builds, this commit
fixes that. To make it easier to invoke, there's a top-level
cpluspluscheck target.

Discussion: https://postgr.es/20190530220244.kiputcbl4gkl2oo6@alap3.anarazel.de

5 years agoFix incorrect parameter name in comment
David Rowley [Fri, 31 May 2019 17:30:05 +0000 (13:30 -0400)]
Fix incorrect parameter name in comment

Author: Antonin Houska
Discussion: https://postgr.es/m/22370.1559293357@localhost

5 years agoAdjust ecpg expected-results files for commit 7640f9312.
Tom Lane [Fri, 31 May 2019 16:47:19 +0000 (12:47 -0400)]
Adjust ecpg expected-results files for commit 7640f9312.

Mea culpa for not rechecking check-world at the last step :-(
Per buildfarm.

5 years agoFix C++ incompatibilities in ecpg/preproc/ header files.
Tom Lane [Fri, 31 May 2019 16:38:53 +0000 (12:38 -0400)]
Fix C++ incompatibilities in ecpg/preproc/ header files.

There's probably no need to back-patch this, since it seems unlikely
that anybody would be inserting C++ code into ecpg's preprocessor.

Discussion: https://postgr.es/m/b517ec3918d645eb950505eac8dd434e@gaz-is.ru

5 years agoFix C++ incompatibilities in plpgsql's header files.
Tom Lane [Fri, 31 May 2019 16:34:54 +0000 (12:34 -0400)]
Fix C++ incompatibilities in plpgsql's header files.

Rename some exposed parameters so that they don't conflict with
C++ reserved words.

Back-patch to all supported versions.

George Tarasov

Discussion: https://postgr.es/m/b517ec3918d645eb950505eac8dd434e@gaz-is.ru

5 years agoFix assorted header files that failed to compile standalone.
Tom Lane [Fri, 31 May 2019 15:45:33 +0000 (11:45 -0400)]
Fix assorted header files that failed to compile standalone.

We have a longstanding project convention that all .h files should
be includable with no prerequisites other than postgres.h.  This is
tested/relied-on by cpluspluscheck.  However, cpluspluscheck has not
historically been applied to most headers outside the src/include
tree, with the predictable consequence that some of them don't work.
Fix that, usually by adding missing #include dependencies.

The change in printf_hack.h might require some explanation: without
it, my C++ compiler whines that the function is unused.  There's
not so many call sites that "inline" is going to cost much, and
besides all the callers are in test code that we really don't care
about the size of.

There's no actual bugs being fixed here, so I see no need to back-patch.

Discussion: https://postgr.es/m/b517ec3918d645eb950505eac8dd434e@gaz-is.ru

5 years agoMake our perfect hash functions be valid C++.
Tom Lane [Fri, 31 May 2019 14:40:00 +0000 (10:40 -0400)]
Make our perfect hash functions be valid C++.

While C is happy to cast "const void *" to "const unsigned char *"
silently, C++ insists on an explicit cast.  Since we put these
functions into header files, cpluspluscheck whines about that.
Add the cast to pacify it.

Discussion: https://postgr.es/m/b517ec3918d645eb950505eac8dd434e@gaz-is.ru

5 years agoFix double-phrase typo in message
Alvaro Herrera [Fri, 31 May 2019 14:08:37 +0000 (10:08 -0400)]
Fix double-phrase typo in message

New in 147e3722f7e5.

5 years agoRework options of pg_checksums options for filenode handling
Michael Paquier [Thu, 30 May 2019 20:58:17 +0000 (16:58 -0400)]
Rework options of pg_checksums options for filenode handling

This makes the tool consistent with the option set of oid2name, which
has been historically using -f for filenodes, and has more recently
gained long options and --filenode via 1aaf532.

Reported-by: Peter Eisentraut
Author: Fabien Coelho
Discussion: https://postgr.es/m/97045260-fb9e-e145-a950-cf7d28c4eaea@2ndquadrant.com

5 years agoRemove unnecessary (and wrong) forward declaration.
Andres Freund [Thu, 30 May 2019 20:44:38 +0000 (13:44 -0700)]
Remove unnecessary (and wrong) forward declaration.

Interestingly only C++ compilers have, so far, complained about this
odd forward declaration. This originated when IndexBuildCallback was
defined in another file, but now is completely unnecessary (but was
wrong before too, cpluspluscheck just wouldn't have noticed).

Reported-By: Tom Lane
Discussion: https://postgr.es/m/53941.1559239260@sss.pgh.pa.us

5 years agoMake error logging in extended statistics more consistent
Tomas Vondra [Thu, 30 May 2019 14:16:12 +0000 (16:16 +0200)]
Make error logging in extended statistics more consistent

Most errors reported in extended statistics are internal issues, and so
should use elog(). The MCV list code was already following this rule, but
the functional dependencies and ndistinct coefficients were using a mix
of elog() and ereport(). Fix this by changing most places to elog(), with
the exception of input functions.

This is a mostly cosmetic change, it makes the life a little bit easier
for translators, as elog() messages are not translated. So backpatch to
PostgreSQL 10, where extended statistics were introduced.

Author: Tomas Vondra
Backpatch-through: 10 where extended statistics were added
Discussion: https://postgr.es/m/20190503154404.GA7478@alvherre.pgsql

5 years agoFix some documentation about access methods
Michael Paquier [Wed, 29 May 2019 15:37:37 +0000 (11:37 -0400)]
Fix some documentation about access methods

Author: Guillaume Lelarge
Discussion: https://postgr.es/m/CAECtzeWPz4JikzUqZdMjqPTe8dAP3nZxPD-58Y-Hhvirg0fF+A@mail.gmail.com

5 years agoFix some documentation about FKs and partitioned tables
Michael Paquier [Wed, 29 May 2019 15:19:06 +0000 (11:19 -0400)]
Fix some documentation about FKs and partitioned tables

This got forgotten in f56f8f which has added foreign key support for
partitioned tables.  In passing, add a mention about caveats applying to
tables partitioned using inheritance regarding indexes and foreign keys.

Author: Paul A Jungwirth
Reviewed-by: Amit Langote, Michael Paquier
Discussion: https://postgr.es/m/CA+renyUuSmYgmZjKc_DfUNVZ0uttF91-FwhDVW3F7WEPj0jL5w@mail.gmail.com

5 years agoMake one message just like all its siblings.
Alvaro Herrera [Wed, 29 May 2019 03:44:22 +0000 (23:44 -0400)]
Make one message just like all its siblings.

5 years agoFix typo in message
Alvaro Herrera [Tue, 28 May 2019 21:34:38 +0000 (17:34 -0400)]
Fix typo in message

I introduced the typo in source code in the course of 75445c1515ff.
Repair.

5 years agoIn the pg_upgrade test suite, don't write to src/test/regress.
Noah Misch [Tue, 28 May 2019 19:59:00 +0000 (12:59 -0700)]
In the pg_upgrade test suite, don't write to src/test/regress.

When this suite runs installcheck, redirect file creations from
src/test/regress to src/bin/pg_upgrade/tmp_check/regress.  This closes a
race condition in "make -j check-world".  If the pg_upgrade suite wrote
to a given src/test/regress/results file in parallel with the regular
src/test/regress invocation writing it, a test failed spuriously.  Even
without parallelism, in "make -k check-world", the suite finishing
second overwrote the other's regression.diffs.  This revealed test
"largeobject" assuming @abs_builddir@ is getcwd(), so fix that, too.

Buildfarm client REL_10, released fifty-four days ago, supports saving
regression.diffs from its new location.  When an older client reports a
pg_upgradeCheck failure, it will no longer include regression.diffs.
Back-patch to 9.5, where pg_upgrade moved to src/bin.

Reviewed (in earlier versions) by Andrew Dunstan.

Discussion: https://postgr.es/m/20181224034411.GA3224776@rfd.leadboat.com

5 years agoIn the pg_upgrade test suite, remove and recreate "tmp_check".
Noah Misch [Tue, 28 May 2019 19:58:30 +0000 (12:58 -0700)]
In the pg_upgrade test suite, remove and recreate "tmp_check".

This allows "vcregress upgradecheck" to pass twice in immediate
succession, and it's more like how $(prove_check) works.  Back-patch to
9.5, where pg_upgrade moved to src/bin.

Discussion: https://postgr.es/m/20190520012436.GA1480421@rfd.leadboat.com

5 years agov12 release notes: Correct contributor name.
Andres Freund [Tue, 28 May 2019 16:06:40 +0000 (09:06 -0700)]
v12 release notes: Correct contributor name.

Mea culpa.

5 years agoFix comment
Peter Eisentraut [Tue, 28 May 2019 12:26:24 +0000 (08:26 -0400)]
Fix comment

This code block was copied/adapted from other similar places but
somehow the comment placement was changed so that it makes less sense.

5 years agodocs: PG 12 relnote wording fix
Bruce Momjian [Tue, 28 May 2019 11:17:34 +0000 (07:17 -0400)]
docs:  PG 12 relnote wording fix

Reported-by: Gaby Schilders
5 years agoFix typos in SQL scripts of pgcrypto
Michael Paquier [Tue, 28 May 2019 10:33:30 +0000 (06:33 -0400)]
Fix typos in SQL scripts of pgcrypto

Author: Gurjeet Singh
Discussion: https://postgr.es/m/CABwTF4U_5kEnH93PXZEuEsZHuoSSuBEOqC6pian8vDfLZSQJNA@mail.gmail.com

5 years agodoc: Fix generated column documentation
Peter Eisentraut [Mon, 27 May 2019 16:26:16 +0000 (12:26 -0400)]
doc: Fix generated column documentation

The old text still had an implicit reference to the virtual behavior,
which was not in the final patch.

Author: Tobias Bussmann <t.bussmann@gmx.net>

5 years agoFix more thinkos in new ECPG "PREPARE AS" code.
Tom Lane [Sun, 26 May 2019 14:39:11 +0000 (10:39 -0400)]
Fix more thinkos in new ECPG "PREPARE AS" code.

ecpg_build_params() failed to check for ecpg_alloc failure in one
newly-added code path, and leaked a temporary string in another path.
Errors in commit a1dc6ab46, spotted by Coverity.

5 years agoFix thinko in new ECPG "PREPARE AS" code.
Tom Lane [Sun, 26 May 2019 14:06:37 +0000 (10:06 -0400)]
Fix thinko in new ECPG "PREPARE AS" code.

ecpg_register_prepared_stmt() is pretty obviously checking the wrong
variable while trying to detect malloc failure.  Error in commit
a1dc6ab46, spotted by Coverity.

5 years agoFix typos.
Amit Kapila [Sun, 26 May 2019 12:58:18 +0000 (18:28 +0530)]
Fix typos.

Reported-by: Alexander Lakhin
Author: Alexander Lakhin
Reviewed-by: Amit Kapila and Tom Lane
Discussion: https://postgr.es/m/7208de98-add8-8537-91c0-f8b089e2928c@gmail.com

5 years agoChange Graphviz file extension
Peter Eisentraut [Sun, 26 May 2019 06:08:05 +0000 (08:08 +0200)]
Change Graphviz file extension

Change extension for Graphviz files from .dot to .gv.  The latter
appears to be the generally preferred one nowadays.

Discussion: https://www.postgresql.org/message-id/flat/71fe76d2-c7d7-2acc-6762-bbf9e61c566e%402ndquadrant.com

5 years agoDoc: fix incorrect references in PG 12 release notes.
Amit Kapila [Sat, 25 May 2019 10:10:53 +0000 (15:40 +0530)]
Doc: fix incorrect references in PG 12 release notes.

Reported-by: Euler Taveira
Author: Euler Taveira
Discussion: https://postgr.es/m/CAHE3wgjiA8DdnUzH9WqBLxdrUVvjDkKNdHx-MkEg9uV+HtpMfg@mail.gmail.com

5 years agoDoc: fix typo in pgbench random_zipfian() documentation.
Tom Lane [Fri, 24 May 2019 15:16:06 +0000 (11:16 -0400)]
Doc: fix typo in pgbench random_zipfian() documentation.

Per bug #15819 from Koizumi Satoru.

Discussion: https://postgr.es/m/15819-e6191bef1f7334c0@postgresql.org

5 years agoUpdate copyright year.
Thomas Munro [Thu, 23 May 2019 01:23:59 +0000 (13:23 +1200)]
Update copyright year.

Reviewed-by: Michael Paquier
Discussion: https://postgr.es/m/CA%2BhUKGJFWXmtYo6Frd77RR8YXCHz7hJ2mRy5aHV%3D7fJOqDnBHA%40mail.gmail.com

5 years agoFix typos.
Thomas Munro [Thu, 23 May 2019 01:17:41 +0000 (13:17 +1200)]
Fix typos.

Reviewed-by: Michael Paquier
Discussion: https://postgr.es/m/CA%2BhUKGJFWXmtYo6Frd77RR8YXCHz7hJ2mRy5aHV%3D7fJOqDnBHA%40mail.gmail.com

5 years agotableam: Rename wrapper functions to match callback names.
Andres Freund [Thu, 23 May 2019 23:25:48 +0000 (16:25 -0700)]
tableam: Rename wrapper functions to match callback names.

Some of the wrapper functions didn't match the callback names. Many of
them due to staying "consistent" with historic naming of the wrapped
functionality. We decided that for most cases it's more important to
be for tableam to be consistent going forward, than with the past.

The one exception is beginscan/endscan/...  because it'd have looked
odd to have systable_beginscan/endscan/... with a different naming
scheme, and changing the systable_* APIs would have caused way too
much churn (including breaking a lot of external users).

Author: Ashwin Agrawal, with some small additions by Andres Freund
Reviewed-By: Andres Freund
Discussion: https://postgr.es/m/CALfoeiugyrXZfX7n0ORCa4L-m834dzmaE8eFdbNR6PMpetU4Ww@mail.gmail.com

5 years agoFix table dump in pg_dump[all] with backends older than 9.5
Michael Paquier [Thu, 23 May 2019 23:19:21 +0000 (08:19 +0900)]
Fix table dump in pg_dump[all] with backends older than 9.5

The access method name "amname" can be dumped as of 3b925e90, but
queries for backends older than 9.5 forgot to map it to a dummy NULL
value, causing the column to not be mapped to a number.  As a result,
pg_dump was throwing some spurious errors in its stderr output coming
from libpq:
pg_dump: column number -1 is out of range 0..36

Fix this issue by adding a mapping of "amname" to NULL to all the older
queries.

Discussion: https://postgr.es/m/20190522083038.GA16837@paquier.xyz
Author: Michael Paquier
Reviewed-by: Dmitry Dolgov, Andres Freund, Tom Lane
5 years agopg_upgrade: Make test.sh's installcheck use to-be-upgraded version's bindir.
Andres Freund [Thu, 23 May 2019 21:46:52 +0000 (14:46 -0700)]
pg_upgrade: Make test.sh's installcheck use to-be-upgraded version's bindir.

On master (after 700538) the old version's installed psql was used -
even when the old version might not actually be installed / might be
installed into a temporary directory. As commonly the case when just
executing make check for pg_upgrade, as $oldbindir is just the current
version's $bindir.

In the back branches, with --install specified, psql from the new
version's temporary installation was used, without --install (e.g for
NO_TEMP_INSTALL, cf 47b3c26642), the new version's installed psql was
used (which might or might not exist).

Author: Andres Freund
Discussion: https://postgr.es/m/20190522175150.c26f4jkqytahajdg@alap3.anarazel.de

5 years agoFix array size allocation for HashAggregate hash keys.
Andrew Gierth [Thu, 23 May 2019 14:26:01 +0000 (15:26 +0100)]
Fix array size allocation for HashAggregate hash keys.

When there were duplicate columns in the hash key list, the array
sizes could be miscomputed, resulting in access off the end of the
array. Adjust the computation to ensure the array is always large
enough.

(I considered whether the duplicates could be removed in planning, but
I can't rule out the possibility that duplicate columns might have
different hash functions assigned. Simpler to just make sure it works
at execution time regardless.)

Bug apparently introduced in fc4b3dea2 as part of narrowing down the
tuples stored in the hashtable. Reported by Colm McHugh of Salesforce,
though I didn't use their patch. Backpatch back to version 10 where
the bug was introduced.

Discussion: https://postgr.es/m/CAFeeJoKKu0u+A_A9R9316djW-YW3-+Gtgvy3ju655qRHR3jtdA@mail.gmail.com

5 years agoFix ordering of GRANT commands in pg_dumpall for tablespaces
Michael Paquier [Thu, 23 May 2019 01:48:17 +0000 (10:48 +0900)]
Fix ordering of GRANT commands in pg_dumpall for tablespaces

This uses a method similar to 68a7c24f and now b8c6014 (applied for
database creation), which guarantees that GRANT commands using the WITH
GRANT OPTION are dumped in a way so as cascading dependencies are
respected.  Note that tablespaces do not have support for initial
privileges via pg_init_privs, so the same method needs to be applied
again.  It would be nice to merge all the logic generating ACL queries
in dumps under the same banner, but this requires extending the support
of pg_init_privs to objects that cannot use it yet, so this is left as
future work.

Discussion: https://postgr.es/m/20190522071555.GB1278@paquier.xyz
Author: Michael Paquier
Reviewed-by: Nathan Bossart
Backpatch-through: 9.6

5 years agoRemove -o/--oids from pg_dumpall
Michael Paquier [Thu, 23 May 2019 00:36:28 +0000 (09:36 +0900)]
Remove -o/--oids from pg_dumpall

This has been forgotten in 578b229, which has removed support for WITH
OIDS.

Discussion: https://postgr.es/m/CALAY4q99FcFCoG6ddke0V-AksGe82L_+bhDWgEfgZBakB840zA@mail.gmail.com
Author: Surafel Temesgen

5 years agoInitial pgperltidy run for v12.
Tom Lane [Wed, 22 May 2019 17:36:19 +0000 (13:36 -0400)]
Initial pgperltidy run for v12.

Make all the perl code look nice, too (for some value of "nice").

5 years agoPhase 2 pgindent run for v12.
Tom Lane [Wed, 22 May 2019 17:04:48 +0000 (13:04 -0400)]
Phase 2 pgindent run for v12.

Switch to 2.1 version of pg_bsd_indent.  This formats
multiline function declarations "correctly", that is with
additional lines of parameter declarations indented to match
where the first line's left parenthesis is.

Discussion: https://postgr.es/m/CAEepm=0P3FeTXRcU5B2W3jv3PgRVZ-kGUXLGfd42FFhUROO3ug@mail.gmail.com

5 years agoInitial pgindent run for v12.
Tom Lane [Wed, 22 May 2019 16:55:34 +0000 (12:55 -0400)]
Initial pgindent run for v12.

This is still using the 2.0 version of pg_bsd_indent.
I thought it would be good to commit this separately,
so as to document the differences between 2.0 and 2.1 behavior.

Discussion: https://postgr.es/m/16296.1558103386@sss.pgh.pa.us

5 years agoConvert ExecComputeStoredGenerated to use tuple slots
Peter Eisentraut [Wed, 15 May 2019 17:37:52 +0000 (19:37 +0200)]
Convert ExecComputeStoredGenerated to use tuple slots

This code was still using the old style of forming a heap tuple rather
than using tuple slots.  This would be less efficient if a non-heap
access method was used.  And using tuple slots is actually quite a bit
faster when using heap as well.

Also add some test cases for generated columns with null values and
with varlena values.  This lack of coverage was discovered while
working on this patch.

Discussion: https://www.postgresql.org/message-id/flat/20190331025744.ugbsyks7czfcoksd%40alap3.anarazel.de

5 years agoMention ANALYZE boolean options in documentation.
Fujii Masao [Wed, 22 May 2019 16:18:16 +0000 (01:18 +0900)]
Mention ANALYZE boolean options in documentation.

Commit 41b54ba78e allowed not only VACUUM but also ANALYZE options
to take a boolean argument. But it forgot to update the documentation
for ANALYZE. This commit adds the descriptions about those ANALYZE
boolean options into the documentation.

This patch also updates tab-completion for ANALYZE boolean options.

Reported-by: Kyotaro Horiguchi
Author: Fujii Masao
Reviewed-by: Masahiko Sawada, Michael Paquier
Discussion: https://postgr.es/m/CAHGQGwHTUt-kuwgiwe8f0AvTnB+ySqJWh95jvmh-qcoKW9YA9g@mail.gmail.com

5 years agoFix O(N^2) performance issue in pg_publication_tables view.
Tom Lane [Wed, 22 May 2019 15:46:57 +0000 (11:46 -0400)]
Fix O(N^2) performance issue in pg_publication_tables view.

The original coding of this view relied on a correlated IN sub-query.
Our planner is not very bright about correlated sub-queries, and even
if it were, there's no way for it to know that the output of
pg_get_publication_tables() is duplicate-free, making the de-duplicating
semantics of IN unnecessary.  Hence, rewrite as a LATERAL sub-query.
This provides circa 100X speedup for me with a few hundred published
tables (the whole regression database), and things would degrade as
roughly O(published_relations * all_relations) beyond that.

Because the rules.out expected output changes, force a catversion bump.
Ordinarily we might not want to do that post-beta1; but we already know
we'll be doing a catversion bump before beta2 to fix pg_statistic_ext
issues, so it's pretty much free to fix it now instead of waiting for v13.

Per report and fix suggestion from PegoraroF10.

Discussion: https://postgr.es/m/1551385426763-0.post@n3.nabble.com

5 years agodocs: PG 12 release notes, support functions
Bruce Momjian [Wed, 22 May 2019 15:22:13 +0000 (11:22 -0400)]
docs:  PG 12 release notes, support functions

Move support function mention to the proper section, and reword.

Reported-by: Tom Lane
Discussion: https://postgr.es/m/5121.1558472431@sss.pgh.pa.us

5 years agodoc: PG 12 relnotes, correct recovery_target* variable mention
Bruce Momjian [Wed, 22 May 2019 14:54:40 +0000 (10:54 -0400)]
doc:  PG 12 relnotes,  correct recovery_target* variable mention

Clarify new restriction on recovery_target* variables.

Reported-by: Gaby Schilders
Discussion: reported via chat

5 years agoAdd .gitignore entries for new ecpg test case.
Tom Lane [Wed, 22 May 2019 14:42:24 +0000 (10:42 -0400)]
Add .gitignore entries for new ecpg test case.

Oversight in commit a1dc6ab465986a62b308dd1bb8da316b5ed9685a.

5 years agoIn transam.h, don't expose static inline functions to frontend code.
Tom Lane [Wed, 22 May 2019 14:38:21 +0000 (10:38 -0400)]
In transam.h, don't expose static inline functions to frontend code.

That leads to unsatisfied external references if the C compiler fails
to elide unused static functions.  Apparently, we have no buildfarm
members building HEAD that have that issue ... but such compilers still
exist in the wild.  Need to do something about that.

In passing, fix Berkeley-era typo in comment.

Discussion: https://postgr.es/m/27054.1558533367@sss.pgh.pa.us

5 years agoFix ordering of GRANT commands in pg_dump for database creation
Michael Paquier [Wed, 22 May 2019 05:48:00 +0000 (14:48 +0900)]
Fix ordering of GRANT commands in pg_dump for database creation

This uses a method similar to 68a7c24f, which guarantees that GRANT
commands using the WITH GRANT OPTION are dumped in a way so as cascading
dependencies are respected.  As databases do not have support for
initial privileges via pg_init_privs, we need to repeat again the same
ACL reordering method.

ACL for databases have been moved from pg_dumpall to pg_dump in v11, so
this impacts pg_dump for v11 and above, and pg_dumpall for v9.6 and
v10.

Discussion: https://postgr.es/m/15788-4e18847520ebcc75@postgresql.org
Author: Nathan Bossart
Reviewed-by: Haribabu Kommi
Backpatch-through: 9.6

5 years agoUn-break pg_upgrade regression test.
Tom Lane [Wed, 22 May 2019 03:51:19 +0000 (23:51 -0400)]
Un-break pg_upgrade regression test.

Commit 5af2e976d removed a bit too much from the test.sh invocation.
Per buildfarm.

5 years agoImplement PREPARE AS statement for ECPG.
Michael Meskes [Wed, 22 May 2019 02:58:29 +0000 (04:58 +0200)]
Implement PREPARE AS statement for ECPG.

Besides implementing the new statement this change fix some issues with the
parsing of PREPARE and EXECUTE statements. The different forms of these
statements are now all handled in a ujnified way.

Author: Matsumura-san <matsumura.ryo@jp.fujitsu.com>

5 years agopg_upgrade: Avoid check target accidentally breaking make's --output-sync.
Andres Freund [Tue, 21 May 2019 22:03:27 +0000 (15:03 -0700)]
pg_upgrade: Avoid check target accidentally breaking make's --output-sync.

When $(MAKE) is present in a rule, make assumes that target is a
submake, and it doesn't need to buffer its output. But in this case
it's a shell script that needs buffered output. Avoid that heuristic,
by referring to $(MAKE) via an indirection.

Discussion: https://postgr.es/m/20190521004717.qsktdsugj3shagco@alap3.anarazel.de

5 years agopg_upgrade: Don't use separate installation for test.
Andres Freund [Tue, 21 May 2019 21:56:29 +0000 (14:56 -0700)]
pg_upgrade: Don't use separate installation for test.

For pg_upgrade's test we (unless prevented by the caller via via
NO_TEMP_INSTALL) built a separate installation. That causes an
unnecessary slowdown after the infrastructure introduced by
dcae5faccab (and unnecessarily duplicates code).

Author: Andres Freund
Reviewed-By: Tom Lane
Discussion:
    https://postgr.es/m/20190521191918.z7kwnrlj45mk2k67@alap3.anarazel.de
    https://postgr.es/m/20190521195209.qfzwfxvymguuwlu5@alap3.anarazel.de

5 years agodocs: PG 12 relnote adjustments based on feedback from Tom Lane
Bruce Momjian [Tue, 21 May 2019 20:45:48 +0000 (16:45 -0400)]
docs:  PG 12 relnote adjustments based on feedback from Tom Lane

Discussion: https://postgr.es/m/22793.1558399695@sss.pgh.pa.us

5 years agodocs: adjust RECORD PG 12 relnote item
Bruce Momjian [Tue, 21 May 2019 20:35:43 +0000 (16:35 -0400)]
docs:  adjust RECORD PG 12 relnote item

Discussion: https://postgr.es/m/15486.1558393010@sss.pgh.pa.us

5 years agodoc: adjust PG 12 relnotes item on float digit adjustment
Bruce Momjian [Tue, 21 May 2019 20:31:02 +0000 (16:31 -0400)]
doc:  adjust PG 12 relnotes item on float digit adjustment

Discussion: https://postgr.es/m/87y330d8ty.fsf@news-spur.riddles.org.uk

5 years agodoc: fix markup for PG 12 rel notes
Bruce Momjian [Tue, 21 May 2019 20:19:43 +0000 (16:19 -0400)]
doc:  fix markup for PG 12 rel notes

5 years agodoc: adjustments for PG 12 release notes
Bruce Momjian [Tue, 21 May 2019 20:14:33 +0000 (16:14 -0400)]
doc:  adjustments for PG 12 release notes

Mostly commit messages, attribution, and text, all suggested by Andres
Freund.

Discussion: https://postgr.es/m/20190520221719.pqgld3krjc2docr5@alap3.anarazel.de

5 years agoMake pg_upgrade's test.sh less chatty.
Tom Lane [Tue, 21 May 2019 17:11:57 +0000 (13:11 -0400)]
Make pg_upgrade's test.sh less chatty.

The use of "set -x" to echo a subset of the test's commands might've
been a good idea during development of this test, but it's been stable
for long enough now that the extra output isn't very useful.  Also
our project expectations have been trending towards less output in
non-error cases; the fact that "set -x" produces output on stderr
is particularly annoying from that standpoint.  So get rid of it.

Also, pass "-A trust" to initdb explicitly so that it won't issue
a warning about "trust" being an insecure default.  This matches
what the TAP tests have done for a long time, and again gets rid
of some noise on stderr.

Discussion: https://postgr.es/m/21766.1558397960@sss.pgh.pa.us

5 years agoInsert temporary debugging output in regression tests.
Tom Lane [Tue, 21 May 2019 16:23:16 +0000 (12:23 -0400)]
Insert temporary debugging output in regression tests.

We're seeing occasional instability in the plans generated for
parallel queries on the "a_star" table hierarchy.  This suggests
that something is changing the planner's stats for those tables,
but that should not be happening within a regression test run.
To try to gather some information about what's happening, insert
additional queries to check the basic page/tuple counts for these
tables, as well as whether any vacuums or analyzes have happened
on them.  (We expect that only the database-wide VACUUM in
sanity_check.sql will have touched them.)

I added the probes not only in select_parallel.sql itself, but
also in stats.sql, bearing in mind that the stats collector's
lag may prevent the initial query from reporting current truth.
If any extra vacuum/analyze has happened, the recheck in stats.sql
definitely ought to see it.

This commit can be reverted once we figure out what's going on.

Per suggestion from David Rowley, though I changed the queries around.

Discussion: https://postgr.es/m/CA+hUKG+0CxrKRWRMf5ymN3gm+BECHna2B-q1w8onKBep4HasUw@mail.gmail.com

5 years agotableam: Move heap-specific logic from needs_toast_table below tableam.
Robert Haas [Tue, 21 May 2019 15:57:13 +0000 (11:57 -0400)]
tableam: Move heap-specific logic from needs_toast_table below tableam.

This allows table AMs to completely suppress TOAST table creation, or
to modify the conditions under which they are created.

Patch by me.  Reviewed by Andres Freund.

Discussion: http://postgr.es/m/CA+Tgmoa4O2n=yphqD2pERUnYmUO84bH1SqMsA-nSxBGsZ7gWfA@mail.gmail.com

5 years agoDoc: improve description of regexp character classes.
Tom Lane [Mon, 20 May 2019 22:39:53 +0000 (18:39 -0400)]
Doc: improve description of regexp character classes.

Define the meanings of the POSIX-spec character classes in line,
rather than referring to the ctype(3) man page.  That man page
doesn't even exist on many modern systems, and if it does exist
it probably says the wrong things about non-ASCII characters.
Also document our non-POSIX-spec "ascii" character class.

Also, point out here that this behavior is controlled by collation or
LC_CTYPE, since the existing text explaining that is pretty far away.

Per gripe from Geert Lobbestael.  Given the lack of prior complaints,
I'm not excited about back-patching this.

Discussion: https://postgr.es/m/155837022049.1359.2948065118562813468@wrigleys.postgresql.org