pgsql: doc: Get rid of unnecessary space character from some index item

2020-11-24 Thread Fujii Masao
doc: Get rid of unnecessary space character from some index items. Previously some index items have " ," (i.e., space + comma) in the docs as follows. Since the space character before the comma is unnecessary, this commit gets rid of that for the sake of consistency with other index items. par

pgsql: Move per-agg and per-trans duplicate finding to the planner.

2020-11-24 Thread Heikki Linnakangas
Move per-agg and per-trans duplicate finding to the planner. This has the advantage that the cost estimates for aggregates can count the number of calls to transition and final functions correctly. Bump catalog version, because views can contain Aggrefs. Reviewed-by: Andres Freund Discussion: h

Re: pgsql: Move per-agg and per-trans duplicate finding to the planner.

2020-11-24 Thread Michael Paquier
Hi Heikki, On Tue, Nov 24, 2020 at 08:53:42AM +, Heikki Linnakangas wrote: > Move per-agg and per-trans duplicate finding to the planner. > > This has the advantage that the cost estimates for aggregates can count > the number of calls to transition and final functions correctly. > > Bump ca

Re: pgsql: Move per-agg and per-trans duplicate finding to the planner.

2020-11-24 Thread Heikki Linnakangas
On 24/11/2020 12:58, Michael Paquier wrote: The regression tests of sepgsql are broken: https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=rhinoceros&dt=2020-11-24%2009%3A52%3A17 Reordering the lines in the output file would fix the issue. Yep, fixed, thanks! - Heikki

pgsql: Fix expected output: the order of agg permission checks changed.

2020-11-24 Thread Heikki Linnakangas
Fix expected output: the order of agg permission checks changed. Commit 0a2bc5d61e changed the order that permissions on the final and transition functions of an aggregate are checked in. That shows up as a difference in the order the LOG messages in this sepgsql regression test are printed. Adjus

pgsql: Put "inline" marker on declarations of inline functions.

2020-11-24 Thread Tom Lane
Put "inline" marker on declarations of inline functions. I'm having a hard time telling whether the letter of the C standard requires this, but we do have a couple of buildfarm members that throw warnings when this is not done. Oversight in c532d15dd. Branch -- master Details --- https:

pgsql: Tidy up definitions of pg_attribute_hot and pg_attribute_cold

2020-11-24 Thread David Rowley
Tidy up definitions of pg_attribute_hot and pg_attribute_cold 1fa22a43a was a quick fix for portability problem I introduced in 697e1d02f. 1fa22a43a adds a few more cases to the preprocessor logic than I'd have liked. Andres Freund and Dagfinn Ilmari Mannsåker suggested a better way to do this.

pgsql: Properly check index mark/restore in ExecSupportsMarkRestore.

2020-11-24 Thread Andrew Gierth
Properly check index mark/restore in ExecSupportsMarkRestore. Previously this code assumed that all IndexScan nodes supported mark/restore, which is not true since it depends on optional index AM support functions. This could lead to errors about missing support functions in rare edge cases of mer

pgsql: Properly check index mark/restore in ExecSupportsMarkRestore.

2020-11-24 Thread Andrew Gierth
Properly check index mark/restore in ExecSupportsMarkRestore. Previously this code assumed that all IndexScan nodes supported mark/restore, which is not true since it depends on optional index AM support functions. This could lead to errors about missing support functions in rare edge cases of mer

pgsql: Properly check index mark/restore in ExecSupportsMarkRestore.

2020-11-24 Thread Andrew Gierth
Properly check index mark/restore in ExecSupportsMarkRestore. Previously this code assumed that all IndexScan nodes supported mark/restore, which is not true since it depends on optional index AM support functions. This could lead to errors about missing support functions in rare edge cases of mer

pgsql: Properly check index mark/restore in ExecSupportsMarkRestore.

2020-11-24 Thread Andrew Gierth
Properly check index mark/restore in ExecSupportsMarkRestore. Previously this code assumed that all IndexScan nodes supported mark/restore, which is not true since it depends on optional index AM support functions. This could lead to errors about missing support functions in rare edge cases of mer

pgsql: Properly check index mark/restore in ExecSupportsMarkRestore.

2020-11-24 Thread Andrew Gierth
Properly check index mark/restore in ExecSupportsMarkRestore. Previously this code assumed that all IndexScan nodes supported mark/restore, which is not true since it depends on optional index AM support functions. This could lead to errors about missing support functions in rare edge cases of mer

pgsql: Properly check index mark/restore in ExecSupportsMarkRestore.

2020-11-24 Thread Andrew Gierth
Properly check index mark/restore in ExecSupportsMarkRestore. Previously this code assumed that all IndexScan nodes supported mark/restore, which is not true since it depends on optional index AM support functions. This could lead to errors about missing support functions in rare edge cases of mer

pgsql: Properly check index mark/restore in ExecSupportsMarkRestore.

2020-11-24 Thread Andrew Gierth
Properly check index mark/restore in ExecSupportsMarkRestore. Previously this code assumed that all IndexScan nodes supported mark/restore, which is not true since it depends on optional index AM support functions. This could lead to errors about missing support functions in rare edge cases of mer

pgsql: Remove catalog function currtid()

2020-11-24 Thread Michael Paquier
Remove catalog function currtid() currtid() and currtid2() are an undocumented set of functions whose sole known user is the Postgres ODBC driver, able to retrieve the latest TID version for a tuple given by the caller of those functions. As used by Postgres ODBC, currtid() is a shortcut able to

pgsql: Stop gap fix for __attribute__((cold)) compiler bug in MinGW 8.1

2020-11-24 Thread David Rowley
Stop gap fix for __attribute__((cold)) compiler bug in MinGW 8.1 The buildfarm animal walleye, running MinGW 8.1 has been having problems ever since 697e1d02f and 913ec71d6 went in. This appears to be a bug in assembler which was fixed in a later version. For now, in order to get that animal run

pgsql: Remove obsolete comment atop ri_PlanCheck.

2020-11-24 Thread Amit Kapila
Remove obsolete comment atop ri_PlanCheck. Commit 5b7ba75f7f removed the unused parameter but forgot to update the nearby comments. Author: Li Japin Backpatch-through: 13, where it was introduced Discussion: https://postgr.es/m/0e2f62a2-b2f1-4052-83ae-f0bec8a75...@hotmail.com Branch -- REL_1

pgsql: Remove obsolete comment atop ri_PlanCheck.

2020-11-24 Thread Amit Kapila
Remove obsolete comment atop ri_PlanCheck. Commit 5b7ba75f7f removed the unused parameter but forgot to update the nearby comments. Author: Li Japin Backpatch-through: 13, where it was introduced Discussion: https://postgr.es/m/0e2f62a2-b2f1-4052-83ae-f0bec8a75...@hotmail.com Branch -- maste

pgsql: Fix WaitLatch(NULL) on Windows.

2020-11-24 Thread Thomas Munro
Fix WaitLatch(NULL) on Windows. Further to commit 733fa9aa, on Windows when a latch is triggered but we aren't currently waiting for it, we need to locate the latch's HANDLE rather than calling ResetEvent(NULL). Author: Kyotaro Horiguchi Reported-by: Ranier Vilela Discussion: https://postgr.es

pgsql: Make error hint from bind() failure more accurate

2020-11-24 Thread Peter Eisentraut
Make error hint from bind() failure more accurate The hint "Is another postmaster already running ..." should only be printed for errors that are really about something else already using the address. In other cases it is misleading. So only show that hint if errno == EADDRINUSE. Also, since Un

pgsql: Add support for abstract Unix-domain sockets

2020-11-24 Thread Peter Eisentraut
Add support for abstract Unix-domain sockets This is a variant of the normal Unix-domain sockets that don't use the file system but a separate "abstract" namespace. At the user interface, such sockets are represented by names starting with "@". Supported on Linux and Windows right now. Reviewed-