Re: [HACKERS] [COMMITTERS] pgsql: Improve performance of SendRowDescriptionMessage.

2022-08-13 Thread Andres Freund
Hi, On 2022-08-13 13:50:06 -0700, Noah Misch wrote: > On Sat, Aug 13, 2022 at 12:08:43PM -0700, Andres Freund wrote: > > Any chance you could check if this is still needed? I've a FIXME about it in > > the meson code that I'd like to get rid of :) > > I ran hornet against 1c497fa72d, the commit t

pgsql: Add new win32 header to headerscheck and cpluspluscheck

2022-08-13 Thread Thomas Munro
Add new win32 header to headerscheck and cpluspluscheck Commit 5579388d added src/include/port/win32/netdb.h but forgot to filter it out in the header checking scripts. Per build farm animal crake. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/213bd0662cef220f7a3

pgsql: Remove configure probe for gethostbyname_r.

2022-08-13 Thread Thomas Munro
Remove configure probe for gethostbyname_r. It was only used by src/port/getaddrinfo.c, removed by the previous commit. Discussion: https://postgr.es/m/CA%2BhUKGJFLPCtAC58EAimF6a6GPw30TU_59FUY%3DGWB_kC%3DJEmVQ%40mail.gmail.com Branch -- master Details --- https://git.postgresql.org/pg/

pgsql: Remove replacement code for getaddrinfo.

2022-08-13 Thread Thomas Munro
Remove replacement code for getaddrinfo. SUSv3, all targeted Unixes and modern Windows have getaddrinfo() and related interfaces. Drop the replacement implementation, and adjust some headers slightly to make sure that the APIs are visible everywhere using standard POSIX headers and names. Review

pgsql: Remove configure probe for struct sockaddr_storage.

2022-08-13 Thread Thomas Munro
Remove configure probe for struct sockaddr_storage. provides sockaddr_storage in SUSv3 and all targeted Unix systems have it. Windows has it too. Reviewed-by: Tom Lane Discussion: https://postgr.es/m/CA%2BhUKG%2BL_3brvh%3D8e0BW_VfX9h7MtwgN%3DnFHP5o7X2oZucY9dg%40mail.gmail.com Branch -- m

pgsql: Avoid misbehavior when hash_table_bytes < bucket_size.

2022-08-13 Thread Tom Lane
Avoid misbehavior when hash_table_bytes < bucket_size. It's possible to reach this case when work_mem is very small and tupsize is (relatively) very large. In that case ExecChooseHashTableSize would get an assertion failure, or with asserts off it'd compute nbuckets = 0, which'd likely cause misb

pgsql: Avoid misbehavior when hash_table_bytes < bucket_size.

2022-08-13 Thread Tom Lane
Avoid misbehavior when hash_table_bytes < bucket_size. It's possible to reach this case when work_mem is very small and tupsize is (relatively) very large. In that case ExecChooseHashTableSize would get an assertion failure, or with asserts off it'd compute nbuckets = 0, which'd likely cause misb

pgsql: Avoid misbehavior when hash_table_bytes < bucket_size.

2022-08-13 Thread Tom Lane
Avoid misbehavior when hash_table_bytes < bucket_size. It's possible to reach this case when work_mem is very small and tupsize is (relatively) very large. In that case ExecChooseHashTableSize would get an assertion failure, or with asserts off it'd compute nbuckets = 0, which'd likely cause misb

pgsql: Avoid misbehavior when hash_table_bytes < bucket_size.

2022-08-13 Thread Tom Lane
Avoid misbehavior when hash_table_bytes < bucket_size. It's possible to reach this case when work_mem is very small and tupsize is (relatively) very large. In that case ExecChooseHashTableSize would get an assertion failure, or with asserts off it'd compute nbuckets = 0, which'd likely cause misb

pgsql: Remove HAVE_UNIX_SOCKETS.

2022-08-13 Thread Thomas Munro
Remove HAVE_UNIX_SOCKETS. Since HAVE_UNIX_SOCKETS is now defined unconditionally, remove the macro and drop a small amount of dead code. The last known systems not to have them (as far as I know at least) were QNX, which we de-supported years ago, and Windows, which now has them. If a new OS eve

Re: [HACKERS] [COMMITTERS] pgsql: Improve performance of SendRowDescriptionMessage.

2022-08-13 Thread Noah Misch
On Sat, Aug 13, 2022 at 12:08:43PM -0700, Andres Freund wrote: > On 2017-10-13 11:24:05 -0700, Andres Freund wrote: > > On 2017-10-13 14:19:22 -0400, Tom Lane wrote: > > > > So it'd probably better to introduce a FORCE_DISABLE_RESTRICT=yes, set > > > > at the same place, that's then tested before r

pgsql: Catch stack overflow when recursing in transformFromClauseItem()

2022-08-13 Thread Tom Lane
Catch stack overflow when recursing in transformFromClauseItem(). Most parts of the parser can expect that the stack overflow check in transformExprRecurse() will trigger before things get desperate. However, transformFromClauseItem() can recurse directly to self without having analyzed any expres

pgsql: Catch stack overflow when recursing in transformFromClauseItem()

2022-08-13 Thread Tom Lane
Catch stack overflow when recursing in transformFromClauseItem(). Most parts of the parser can expect that the stack overflow check in transformExprRecurse() will trigger before things get desperate. However, transformFromClauseItem() can recurse directly to self without having analyzed any expres

pgsql: Catch stack overflow when recursing in transformFromClauseItem()

2022-08-13 Thread Tom Lane
Catch stack overflow when recursing in transformFromClauseItem(). Most parts of the parser can expect that the stack overflow check in transformExprRecurse() will trigger before things get desperate. However, transformFromClauseItem() can recurse directly to self without having analyzed any expres

pgsql: Catch stack overflow when recursing in transformFromClauseItem()

2022-08-13 Thread Tom Lane
Catch stack overflow when recursing in transformFromClauseItem(). Most parts of the parser can expect that the stack overflow check in transformExprRecurse() will trigger before things get desperate. However, transformFromClauseItem() can recurse directly to self without having analyzed any expres

pgsql: Catch stack overflow when recursing in transformFromClauseItem()

2022-08-13 Thread Tom Lane
Catch stack overflow when recursing in transformFromClauseItem(). Most parts of the parser can expect that the stack overflow check in transformExprRecurse() will trigger before things get desperate. However, transformFromClauseItem() can recurse directly to self without having analyzed any expres

pgsql: Catch stack overflow when recursing in transformFromClauseItem()

2022-08-13 Thread Tom Lane
Catch stack overflow when recursing in transformFromClauseItem(). Most parts of the parser can expect that the stack overflow check in transformExprRecurse() will trigger before things get desperate. However, transformFromClauseItem() can recurse directly to self without having analyzed any expres

pgsql: Catch stack overflow when recursing in transformFromClauseItem()

2022-08-13 Thread Tom Lane
Catch stack overflow when recursing in transformFromClauseItem(). Most parts of the parser can expect that the stack overflow check in transformExprRecurse() will trigger before things get desperate. However, transformFromClauseItem() can recurse directly to self without having analyzed any expres

Re: [HACKERS] [COMMITTERS] pgsql: Improve performance of SendRowDescriptionMessage.

2022-08-13 Thread Andres Freund
Hi Noah, On 2017-10-13 11:24:05 -0700, Andres Freund wrote: > On 2017-10-13 14:19:22 -0400, Tom Lane wrote: > > > So it'd probably better to introduce a FORCE_DISABLE_RESTRICT=yes, set > > > at the same place, that's then tested before running the relevant > > > configure check? > > > > +1. I th

pgsql: Remove configurability of PPC spinlock assembly code.

2022-08-13 Thread Tom Lane
Remove configurability of PPC spinlock assembly code. Assume that we can use LWARX hint flags and the LWSYNC instruction on any PPC machine. The check on the assembler's behavior was only needed for Apple's old assembler, which is no longer of interest now that we've de-supported all PPC-era vers

pgsql: Remove configure probe for sys/select.h.

2022-08-13 Thread Thomas Munro
Remove configure probe for sys/select.h. is in SUSv3 and every targeted Unix system has it. Provide an empty header in src/include/port/win32 so that we can include it unguarded even on Windows. Reviewed-by: Tom Lane Discussion: https://postgr.es/m/CA%2BhUKG%2BL_3brvh%3D8e0BW_VfX9h7MtwgN%3DnFH

pgsql: Remove configure probe for sys/uio.h.

2022-08-13 Thread Thomas Munro
Remove configure probe for sys/uio.h. is in SUSv2, and all targeted Unix system have it, so we might as well drop the probe (in fact we never really needed this one). It's where struct iovec is defined, and as a common extension, it's also where non-standard preadv() and pwritev() are declared on

pgsql: Remove configure probe for shl_load library.

2022-08-13 Thread Thomas Munro
Remove configure probe for shl_load library. This was needed only by HP-UX 10, so it became redundant with commit 9db300ce. Reviewed-by: Tom Lane Discussion: https://postgr.es/m/CA%2BhUKG%2BL_3brvh%3D8e0BW_VfX9h7MtwgN%3DnFHP5o7X2oZucY9dg%40mail.gmail.com Branch -- master Details --- h

pgsql: Remove configure probes for sys/un.h and struct sockaddr_un.

2022-08-13 Thread Thomas Munro
Remove configure probes for sys/un.h and struct sockaddr_un. is in SUSv3 and every targeted Unix has it. Some Windows tool chains may still lack the approximately equivalent header , so we already defined struct sockaddr_un ourselves on that OS for now. To harmonize things a bit, move our defin

pgsql: Remove configure probe for sys/resource.h and refactor.

2022-08-13 Thread Thomas Munro
Remove configure probe for sys/resource.h and refactor. is in SUSv2 and is on all targeted Unix systems. We have a replacement for getrusage() on Windows, so let's just move its declarations into src/include/port/win32/sys/resource.h so that we can use a standard-looking #include. Also remove a

pgsql: Remove configure probes for sys/ipc.h, sys/sem.h, sys/shm.h.

2022-08-13 Thread Thomas Munro
Remove configure probes for sys/ipc.h, sys/sem.h, sys/shm.h. These are in SUSv2 and every targeted Unix system has them. It's not hard to avoid including them on Windows system because they're mostly used in platform-specific translation units. Reviewed-by: Tom Lane Discussion: https://postgr.

pgsql: Add missing fields to _outConstraint()

2022-08-13 Thread Peter Eisentraut
Add missing fields to _outConstraint() As of 897795240cfaaed724af2f53ed2c50c9862f951f, check constraints can be declared invalid. But that patch didn't update _outConstraint() to also show the relevant struct fields (which were only applicable to foreign keys before that). This currently only af

pgsql: Add missing fields to _outConstraint()

2022-08-13 Thread Peter Eisentraut
Add missing fields to _outConstraint() As of 897795240cfaaed724af2f53ed2c50c9862f951f, check constraints can be declared invalid. But that patch didn't update _outConstraint() to also show the relevant struct fields (which were only applicable to foreign keys before that). This currently only af

pgsql: Add missing fields to _outConstraint()

2022-08-13 Thread Peter Eisentraut
Add missing fields to _outConstraint() As of 897795240cfaaed724af2f53ed2c50c9862f951f, check constraints can be declared invalid. But that patch didn't update _outConstraint() to also show the relevant struct fields (which were only applicable to foreign keys before that). This currently only af

pgsql: Add missing fields to _outConstraint()

2022-08-13 Thread Peter Eisentraut
Add missing fields to _outConstraint() As of 897795240cfaaed724af2f53ed2c50c9862f951f, check constraints can be declared invalid. But that patch didn't update _outConstraint() to also show the relevant struct fields (which were only applicable to foreign keys before that). This currently only af

pgsql: Add missing fields to _outConstraint()

2022-08-13 Thread Peter Eisentraut
Add missing fields to _outConstraint() As of 897795240cfaaed724af2f53ed2c50c9862f951f, check constraints can be declared invalid. But that patch didn't update _outConstraint() to also show the relevant struct fields (which were only applicable to foreign keys before that). This currently only af

pgsql: Add missing fields to _outConstraint()

2022-08-13 Thread Peter Eisentraut
Add missing fields to _outConstraint() As of 897795240cfaaed724af2f53ed2c50c9862f951f, check constraints can be declared invalid. But that patch didn't update _outConstraint() to also show the relevant struct fields (which were only applicable to foreign keys before that). This currently only af

pgsql: Add missing fields to _outConstraint()

2022-08-13 Thread Peter Eisentraut
Add missing fields to _outConstraint() As of 897795240cfaaed724af2f53ed2c50c9862f951f, check constraints can be declared invalid. But that patch didn't update _outConstraint() to also show the relevant struct fields (which were only applicable to foreign keys before that). This currently only af