Re: glibc qsort() vulnerability

2024-02-09 Thread Mats Kindahl
On Fri, Feb 9, 2024 at 9:08 PM Nathan Bossart wrote: > On Fri, Feb 09, 2024 at 08:43:21PM +0100, Mats Kindahl wrote: > > QQ: right now it looks like this: > > > > static inline int > > pg_cmp_u16(uint16 a, uint16 b) > > { > > > > return (int32)a - (int32)b; > > > > } > > > > > > and > > > >

Re: POC, WIP: OR-clause support for indexes

2024-02-09 Thread jian he
On Thu, Feb 8, 2024 at 1:34 PM Andrei Lepikhov wrote: > > On 3/2/2024 02:06, Alena Rybakina wrote: > > On 01.02.2024 08:00, jian he wrote: > > I added your code to the patch. > Thanks Alena and Jian for the detailed scrutiny! > > A couple of questions: > 1. As I see, transformAExprIn uses the

Re: Popcount optimization using AVX512

2024-02-09 Thread Andres Freund
Hi, On 2024-02-09 15:27:57 -0800, Noah Misch wrote: > On Fri, Feb 09, 2024 at 10:24:32AM -0800, Andres Freund wrote: > > On 2024-01-26 07:42:33 +0100, Alvaro Herrera wrote: > > > This suggests that finding a way to make the ifunc stuff work (with good > > > performance) is critical to this work.

RE: Synchronizing slots from primary to standby

2024-02-09 Thread Zhijie Hou (Fujitsu)
On Friday, February 9, 2024 4:13 PM Peter Smith wrote: > > FYI -- I checked patch v81-0001 to find which of the #includes are strictly > needed. Thanks! > > 1. > ... > > Many of these #includes seem unnecessary. e.g. I was able to remove > all those that are commented-out below, and the

RE: Synchronizing slots from primary to standby

2024-02-09 Thread Zhijie Hou (Fujitsu)
On Friday, February 9, 2024 12:27 PM Peter Smith wrote: > > Here are some review comments for patch v81-0001. Thanks for the comments. > . GENERAL - ReplicationSlotInvalidationCause enum. > > I was thinking that the ReplicationSlotInvalidationCause should > explicitly set RS_INVAL_NONE = 0

RE: Synchronizing slots from primary to standby

2024-02-09 Thread Zhijie Hou (Fujitsu)
On Friday, February 9, 2024 6:45 PM Amit Kapila wrote: > > On Fri, Feb 9, 2024 at 10:00 AM Zhijie Hou (Fujitsu) > wrote: > > > > Few comments on 0001 > === > 1. Shouldn't pg_sync_replication_slots() check whether the user has > replication > privilege? Yes, added. > > 2.

Re: failure in 019_replslot_limit

2024-02-09 Thread Alexander Lakhin
09.02.2024 21:59, Andres Freund wrote: https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=kestrel=2024-02-04%2001%3A53%3A44 ) and saw that it's not checkpointer, but walsender is hanging: How did you reproduce this? As kestrel didn't produce this failure until recently, I supposed that

Re: "ERROR: latch already owned" on gharial

2024-02-09 Thread Soumyadeep Chakraborty
Hey, Deeply appreciate both your input! On Thu, Feb 8, 2024 at 4:57 AM Heikki Linnakangas wrote: > Hmm, there is a pair of SpinLockAcquire() and SpinLockRelease() in > ProcKill(), before step 3 can happen. Comment in spin.h about > SpinLockAcquire/Release: > > > *Load and store operations

Re: Small fix on query_id_enabled

2024-02-09 Thread Michael Paquier
On Fri, Feb 09, 2024 at 04:37:23PM +0800, Julien Rouhaud wrote: > On Fri, Feb 09, 2024 at 03:38:23PM +0900, Yugo NAGATA wrote: >> Also, I think the name is a bit confusing for the same reason, that is, >> query_id_enabled may be false even when query id is computed in fact. >> >> Actually, this

Re: Make COPY format extendable: Extract COPY TO format implementations

2024-02-09 Thread Michael Paquier
On Fri, Feb 09, 2024 at 11:27:05AM -0800, Andres Freund wrote: > On 2024-02-09 13:21:34 +0900, Michael Paquier wrote: >> +static void >> +CopyFromTextInFunc(CopyFromState cstate, Oid atttypid, >> + FmgrInfo *finfo, Oid *typioparam) >> +{ >> +Oid

Re: Simplify documentation related to Windows builds

2024-02-09 Thread Michael Paquier
On Fri, Feb 09, 2024 at 11:59:21AM -0800, Andres Freund wrote: > On 2024-02-09 16:22:35 +0900, Michael Paquier wrote: >> + Diff is required to run the regression >> + tests. On Windows, it may not be available by default. >> + >> + >> >> > > It's not installed by

Re: Simplify documentation related to Windows builds

2024-02-09 Thread Michael Paquier
On Fri, Feb 09, 2024 at 11:56:08AM -0800, Andres Freund wrote: > One thing I forgot: I found chocolatey to be painfully slow to install. And > even at runtime, the wrappers it installs cause build time slowdowns too. And > unnecessary rebuilds with visual studio, because default install paths

Re: Printing backtrace of postgres processes

2024-02-09 Thread Michael Paquier
On Fri, Feb 09, 2024 at 02:27:26PM +0530, Ashutosh Bapat wrote: > On Fri, Feb 9, 2024 at 2:18 PM Alvaro Herrera wrote: >> Hmm, but the backtrace() manpage says >> >>• backtrace() and backtrace_symbols_fd() don't call malloc() explic‐ >> itly, but they are part of libgcc,

Re: Function and Procedure with same signature?

2024-02-09 Thread Tom Lane
"David G. Johnston" writes: > On Fri, Feb 9, 2024, 12:05 Deepak M wrote: >> Folks, When tried to create a function with the same signature as >> procedure it fails. > That seems like a good hint you cannot do it. Specifically because they > get defined in the same internal catalog within which

Re: Popcount optimization using AVX512

2024-02-09 Thread Noah Misch
On Fri, Feb 09, 2024 at 10:24:32AM -0800, Andres Freund wrote: > On 2024-01-26 07:42:33 +0100, Alvaro Herrera wrote: > > This suggests that finding a way to make the ifunc stuff work (with good > > performance) is critical to this work. > > Ifuncs are effectively implemented as a function call

Re: Function and Procedure with same signature?

2024-02-09 Thread David G. Johnston
On Fri, Feb 9, 2024, 12:05 Deepak M wrote: > Hello Hackers, > Wrong list, this is for discussions regarding patches. > Folks, When tried to create a function with the same signature as > procedure it fails. > That seems like a good hint you cannot do it. Specifically because they get

Re: Encoding protection for pgcrypto

2024-02-09 Thread cary huang
The following review has been posted through the commitfest application: make installcheck-world: tested, failed Implements feature: not tested Spec compliant: not tested Documentation:not tested Hello I had a look at your patch, which applies fine to PostgreSQL

Re: [PATCH] Add native windows on arm64 support

2024-02-09 Thread Dave Cramer
On Fri, 9 Feb 2024 at 14:36, Andres Freund wrote: > Hi, > > On 2024-02-09 14:23:46 -0500, Dave Cramer wrote: > > > interestingly meson test does not produce any error > > > The buildfarm produces the following error for me: > > > > > > -SELECT relname, attname, coltypes,

Re: Add semi-join pushdown to postgres_fdw

2024-02-09 Thread Alexander Korotkov
On Fri, Feb 9, 2024 at 10:08 PM Pavel Luzanov wrote: > While playing with this feature I found the following. > > Two foreign tables: > postgres@demo_postgres_fdw(17.0)=# \det aircrafts|seats > List of foreign tables > Schema | Table | Server > +---+- >

Re: glibc qsort() vulnerability

2024-02-09 Thread Nathan Bossart
On Fri, Feb 09, 2024 at 08:43:21PM +0100, Mats Kindahl wrote: > QQ: right now it looks like this: > > static inline int > pg_cmp_u16(uint16 a, uint16 b) > { > > return (int32)a - (int32)b; > > } > > > and > > static inline int > pg_cmp_u32(uint32 a, uint32 b) > { > > return (a > b) - (a <

Re: Add semi-join pushdown to postgres_fdw

2024-02-09 Thread Pavel Luzanov
Hello, While playing with this feature I found the following. Two foreign tables: postgres@demo_postgres_fdw(17.0)=# \det aircrafts|seats List of foreign tables Schema | Table | Server +---+- public | aircrafts | demo_server public | seats |

Re: glibc qsort() vulnerability

2024-02-09 Thread Andres Freund
On 2024-02-09 14:04:29 -0600, Nathan Bossart wrote: > On Fri, Feb 09, 2024 at 08:40:47PM +0100, Mats Kindahl wrote: > > On Fri, Feb 9, 2024 at 5:27 PM Tom Lane wrote: > >> We do pretty much assume that "int" is "int32". But I agree that > >> assuming anything about the width of size_t is bad. I

Function and Procedure with same signature?

2024-02-09 Thread Deepak M
Hello Hackers, Folks, When tried to create a function with the same signature as procedure it fails. postgres=# create or replace procedure obj1(char) language plpgsql as $$ begin select $1; end; $$; CREATE PROCEDURE postgres=# create or replace function obj1(char) returns void language sql as

Re: glibc qsort() vulnerability

2024-02-09 Thread Nathan Bossart
On Fri, Feb 09, 2024 at 08:40:47PM +0100, Mats Kindahl wrote: > On Fri, Feb 9, 2024 at 5:27 PM Tom Lane wrote: >> We do pretty much assume that "int" is "int32". But I agree that >> assuming anything about the width of size_t is bad. I think we need >> a separate pg_cmp_size() or

Re: Simplify documentation related to Windows builds

2024-02-09 Thread Andres Freund
Hi, On 2024-02-09 16:22:35 +0900, Michael Paquier wrote: > diff --git a/doc/src/sgml/installation.sgml b/doc/src/sgml/installation.sgml > index ed5b285a5e..af77352e6e 100644 > --- a/doc/src/sgml/installation.sgml > +++ b/doc/src/sgml/installation.sgml > @@ -193,6 +193,17 @@ >example,

Re: Simplify documentation related to Windows builds

2024-02-09 Thread Andres Freund
Hi, On 2024-02-09 11:53:35 -0800, Andres Freund wrote: > > Between MSYS2, mingw-w64 and Chocolatey, there are a lot of options > > available to users. So shouldn't we try to recommend only of them, > > then align the buildfarm and the CI to use one of them? > > I think regardless which of these

Re: Simplify documentation related to Windows builds

2024-02-09 Thread Andres Freund
Hi, On 2023-12-31 15:13:03 +0900, Michael Paquier wrote: > Some of my notes: > - How much does command line editing work on Windows? When it came to > VS, I always got the impression that this never worked. Andres in [2] > mentioned otherwise because meson makes that easier? Yea, I made it

Re: glibc qsort() vulnerability

2024-02-09 Thread Mats Kindahl
On Fri, Feb 9, 2024 at 8:26 PM Mats Kindahl wrote: > On Fri, Feb 9, 2024 at 5:24 PM Nathan Bossart > wrote: > >> On Fri, Feb 09, 2024 at 08:52:26AM +0100, Mats Kindahl wrote: >> > Here is a new version introducing pg_cmp_s32 and friends and use them >> > instead of the INT_CMP macro introduced

Re: glibc qsort() vulnerability

2024-02-09 Thread Mats Kindahl
On Fri, Feb 9, 2024 at 5:27 PM Tom Lane wrote: > Nathan Bossart writes: > > On Fri, Feb 09, 2024 at 08:52:26AM +0100, Mats Kindahl wrote: > >> The types "int" and "size_t" are treated as s32 and u32 respectively > since > >> that seems to be the case for most of the code, even if strictly not >

Re: [PATCH] Add native windows on arm64 support

2024-02-09 Thread Andres Freund
Hi, On 2024-02-09 14:23:46 -0500, Dave Cramer wrote: > > interestingly meson test does not produce any error > > The buildfarm produces the following error for me: > > > > -SELECT relname, attname, coltypes, get_columns_length(coltypes) > > - FROM check_columns > > - WHERE

Re: glibc qsort() vulnerability

2024-02-09 Thread Mats Kindahl
On Fri, Feb 9, 2024 at 5:27 PM Tom Lane wrote: > Nathan Bossart writes: > > On Fri, Feb 09, 2024 at 08:52:26AM +0100, Mats Kindahl wrote: > >> The types "int" and "size_t" are treated as s32 and u32 respectively > since > >> that seems to be the case for most of the code, even if strictly not >

Re: Make COPY format extendable: Extract COPY TO format implementations

2024-02-09 Thread Andres Freund
Hi, On 2024-02-09 13:21:34 +0900, Michael Paquier wrote: > +static void > +CopyFromTextInFunc(CopyFromState cstate, Oid atttypid, > +FmgrInfo *finfo, Oid *typioparam) > +{ > + Oid func_oid; > + > + getTypeInputInfo(atttypid, _oid,

Re: glibc qsort() vulnerability

2024-02-09 Thread Mats Kindahl
On Fri, Feb 9, 2024 at 5:24 PM Nathan Bossart wrote: > On Fri, Feb 09, 2024 at 08:52:26AM +0100, Mats Kindahl wrote: > > Here is a new version introducing pg_cmp_s32 and friends and use them > > instead of the INT_CMP macro introduced before. It also moves the > > definitions to common/int.h and

Re: glibc qsort() vulnerability

2024-02-09 Thread Andres Freund
Hi, On 2024-02-10 00:02:08 +0500, Andrey Borodin wrote: > > Not really in this case. The call is perfectly predictable - a single > > qsort() > > will use the same callback for every comparison, whereas the if is perfectly > > *unpredictable*. A branch mispredict is far more expensive than a

Re: [PATCH] Add native windows on arm64 support

2024-02-09 Thread Dave Cramer
Dave Cramer www.postgres.rocks On Fri, 9 Feb 2024 at 07:18, Dave Cramer wrote: > > > > > On Fri, 9 Feb 2024 at 00:26, Michael Paquier wrote: > >> On Tue, Feb 06, 2024 at 07:01:49AM -0500, Dave Cramer wrote: >> > Thanks, this patch works and >> > testing with meson passes. >> >> Only with the

Re: GUC-ify walsender MAX_SEND_SIZE constant

2024-02-09 Thread Andres Freund
Hi, On 2024-01-19 23:04:50 +0330, Majid Garoosi wrote: > Following is the description which is also written in the commit message: > MAX_SEND_SIZE parameter was used in WALSender to limit maximum size of > a WAL data packet sent to a WALReceiver during replication. Although > its default value

Re: glibc qsort() vulnerability

2024-02-09 Thread Andrey Borodin
> On 9 Feb 2024, at 21:32, Nathan Bossart wrote: > a lot > of current use-cases require inspecting specific fields of structs Yes, I'm proposing to pass to sorting routine not a comparator, but value extractor. And then rely on operators <,>,==. In a pseudocode: instead of sort(array,

Re: failure in 019_replslot_limit

2024-02-09 Thread Andres Freund
Hi, On 2024-02-09 18:00:01 +0300, Alexander Lakhin wrote: > I've managed to reproduce this issue (which still persists: > https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=kestrel=2024-02-04%2001%3A53%3A44 > ) and saw that it's not checkpointer, but walsender is hanging: How did you

Re: POC: Extension for adding distributed tracing - pg_tracing

2024-02-09 Thread Andres Freund
Hi, On 2024-02-09 19:46:58 +0300, Nikita Malakhov wrote: > I agree with Heikki on most topics and especially the one he recommended > to publish your extension on GitHub, this tool is very promising for highly > loaded > systems, you will get a lot of feedback very soon. > > I'm curious about

Re: glibc qsort() vulnerability

2024-02-09 Thread Andres Freund
Hi, On 2024-02-09 13:19:49 +0500, Andrey M. Borodin wrote: > > On 8 Feb 2024, at 06:52, Nathan Bossart wrote: > > For the same compASC() test, I see an ~8.4% improvement with your int64 > > code and a ~3.4% improvement with this: > > If we care about branch prediction in comparison function,

Re: Popcount optimization using AVX512

2024-02-09 Thread Andres Freund
Hi, On 2024-02-09 17:39:46 +, Amonson, Paul D wrote: > diff --git a/meson.build b/meson.build > index 8ed51b6aae..1e7a4dc942 100644 > --- a/meson.build > +++ b/meson.build > @@ -1773,6 +1773,45 @@ elif cc.links(''' > endif > > > +# XXX: The configure.ac check for __cpuidex() is broken,

Re: Popcount optimization using AVX512

2024-02-09 Thread Andres Freund
Hi, On 2024-01-26 07:42:33 +0100, Alvaro Herrera wrote: > This suggests that finding a way to make the ifunc stuff work (with good > performance) is critical to this work. Ifuncs are effectively implemented as a function call via a pointer, they're not magic, unfortunately. The sole trick they

RE: Popcount optimization using AVX512

2024-02-09 Thread Amonson, Paul D
Álvaro, All feedback is now completed. I added the additional checks for the new APIs and a separate check for the header to autoconf. About the double check for AVX 512 I added a large comment explaining why both are needed. There are cases where the CPU ZMM# registers are not exposed by the

Re: POC: Extension for adding distributed tracing - pg_tracing

2024-02-09 Thread Nikita Malakhov
Hi! I agree with Heikki on most topics and especially the one he recommended to publish your extension on GitHub, this tool is very promising for highly loaded systems, you will get a lot of feedback very soon. I'm curious about SpinLock - it is recommended for very short operations, taking up

Re: [PATCH] allow pg_current_logfile() execution under pg_monitor role

2024-02-09 Thread Nathan Bossart
On Fri, Feb 09, 2024 at 04:01:58PM +0100, Pavlo Golub wrote: > The patch attached fixes an oversight/inconsistency of disallowing the > pg_monitor system role to execute pg_current_logfile([text]). I think this is reasonable. We allow pg_monitor to execute functions like pg_ls_logdir(), so it

Re: glibc qsort() vulnerability

2024-02-09 Thread Nathan Bossart
On Fri, Feb 09, 2024 at 01:19:49PM +0500, Andrey M. Borodin wrote: > If we care about branch prediction in comparison function, maybe we could > produce sorting that inlines comparator, thus eliminating function call > to comparator? We convert comparison logic to int, to extract comparison > back

Re: glibc qsort() vulnerability

2024-02-09 Thread Tom Lane
Nathan Bossart writes: > On Fri, Feb 09, 2024 at 08:52:26AM +0100, Mats Kindahl wrote: >> The types "int" and "size_t" are treated as s32 and u32 respectively since >> that seems to be the case for most of the code, even if strictly not >> correct (size_t can be an unsigned long int for some

Re: glibc qsort() vulnerability

2024-02-09 Thread Nathan Bossart
On Fri, Feb 09, 2024 at 08:52:26AM +0100, Mats Kindahl wrote: > Here is a new version introducing pg_cmp_s32 and friends and use them > instead of the INT_CMP macro introduced before. It also moves the > definitions to common/int.h and adds that as an include to all locations > using these

Re: Documentation to upgrade logical replication cluster

2024-02-09 Thread vignesh C
On Thu, 1 Feb 2024 at 14:50, vignesh C wrote: > > On Wed, 31 Jan 2024 at 11:42, Hayato Kuroda (Fujitsu) > wrote: > > > > Dear Vignesh, > > > > Thanks for updating the patch! Here are my comments for v6. > > > > 01. > > ``` > > + Logical replication cluster > > + > > + > > + A set of

Improve documentation of upgrade for streaming replication section.

2024-02-09 Thread Shubham Khanna
Hi, Currently the documentation of upgrade for streaming replication section says that logical replication slots will be copied irrespective of the version, but the logical replication slots are copied only if the old primary is version 17.0 or later. The changes for the same are in the attached

RE: Psql meta-command conninfo+

2024-02-09 Thread Maiquel Grassi
>Hmm, I noticed that this would call printSSLInfo() and printGSSInfo() >after listConnectionInformation. It would be much better to show these >in tabular format as well and remove the calls to printSSL/GSSInfo. > >I propose additional columns to the same \conninfo+ table; when SSL, >like this: >

Re: Improve eviction algorithm in ReorderBuffer

2024-02-09 Thread Masahiko Sawada
On Fri, Feb 9, 2024 at 7:35 PM Ajin Cherian wrote: > > > > On Tue, Feb 6, 2024 at 5:06 PM Masahiko Sawada wrote: >> >> >> I've attached the new version patch set. >> >> Regards, >> >> >> -- >> Masahiko Sawada >> Amazon Web Services: https://aws.amazon.com > > > Thanks for the patch. I reviewed

Re: Improve eviction algorithm in ReorderBuffer

2024-02-09 Thread Masahiko Sawada
On Thu, Feb 8, 2024 at 6:33 PM Hayato Kuroda (Fujitsu) wrote: > > Dear Sawada-san, > > Thanks for making v3 patchset. I have also benchmarked the case [1]. > Below results are the average of 5th, there are almost the same result > even when median is used for the comparison. On my env, the

[PATCH] allow pg_current_logfile() execution under pg_monitor role

2024-02-09 Thread Pavlo Golub
Hello, The patch attached fixes an oversight/inconsistency of disallowing the pg_monitor system role to execute pg_current_logfile([text]). pgwatch3=# create user joe; CREATE ROLE pgwatch3=# set role joe; SET pgwatch3=> select pg_current_logfile(); ERROR: permission denied for function

Re: failure in 019_replslot_limit

2024-02-09 Thread Alexander Lakhin
Hello Andres, 05.04.2023 21:48, Andres Freund wrote: I just saw the following failure: https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=mylodon=2023-04-05%2017%3A47%3A03 after a commit of mine. The symptoms look unrelated though. [17:54:42.188](258.345s) # poll_query_until timed out

Re: [PATCH] Add CANONICAL option to xmlserialize

2024-02-09 Thread Jim Jones
On 05.10.23 09:38, Jim Jones wrote: > > v8 attached changes de default behaviour to WITH COMMENTS. v9 attached with rebase due to changes done to primnodes.h in 615f5f6 -- Jim From fe51a1826b75b778c21f559236b23d340a10d703 Mon Sep 17 00:00:00 2001 From: Jim Jones Date: Fri, 9 Feb 2024 13:51:44

Re: [PATCH] Add native windows on arm64 support

2024-02-09 Thread Dave Cramer
On Fri, 9 Feb 2024 at 00:26, Michael Paquier wrote: > On Tue, Feb 06, 2024 at 07:01:49AM -0500, Dave Cramer wrote: > > Thanks, this patch works and > > testing with meson passes. > > Only with the version posted at [1]? Interesting, that's the same > contents as v8 posted upthread, minus

RE: speed up a logical replica setup

2024-02-09 Thread Hayato Kuroda (Fujitsu)
Dear Euler, Further comments for v17. 01. This program assumes that the target server has same major version with this. Because the target server would be restarted by same version's pg_ctl command. I felt it should be ensured by reading the PG_VERSION. 02. pg_upgrade checked the version of

Re: speed up a logical replica setup

2024-02-09 Thread Shubham Khanna
On Wed, Feb 7, 2024 at 10:24 AM Euler Taveira wrote: > > On Fri, Feb 2, 2024, at 6:41 AM, Hayato Kuroda (Fujitsu) wrote: > > Thanks for updating the patch! > > > Thanks for taking a look. > > > > I'm still working on the data structures to group options. I don't like the > way > it was grouped

Re: Synchronizing slots from primary to standby

2024-02-09 Thread Amit Kapila
On Fri, Feb 9, 2024 at 10:00 AM Zhijie Hou (Fujitsu) wrote: > Few comments on 0001 === 1. Shouldn't pg_sync_replication_slots() check whether the user has replication privilege? 2. The function declarations in slotsync.h don't seem to be in the same order as they are defined in

Re: pipe_read_line for reading arbitrary strings

2024-02-09 Thread Daniel Gustafsson
The attached v5 is a rebase with no new changes just to get a fresh run in the CFBot before pushing. All review comments have been addressed and the patch has been Ready for Committer for some time, just didn't have time to get to it in the last CF. -- Daniel Gustafsson

Re: Improve eviction algorithm in ReorderBuffer

2024-02-09 Thread Ajin Cherian
On Tue, Feb 6, 2024 at 5:06 PM Masahiko Sawada wrote: > > I've attached the new version patch set. > > Regards, > > > -- > Masahiko Sawada > Amazon Web Services: https://aws.amazon.com Thanks for the patch. I reviewed that patch and did minimal testing and it seems to show the speed up as

Re: GUC-ify walsender MAX_SEND_SIZE constant

2024-02-09 Thread Majid Garoosi
On Fri, 9 Feb 2024 at 08:50, Michael Paquier wrote: > Something to be aware of, but the community lists use bottom-posting > for replies because it is easier to follow the logic of a thread this > way. See here: > https://en.wikipedia.org/wiki/Posting_style#Bottom-posting > Oh, sorry for not

Re: Psql meta-command conninfo+

2024-02-09 Thread Alvaro Herrera
Hmm, I noticed that this would call printSSLInfo() and printGSSInfo() after listConnectionInformation. It would be much better to show these in tabular format as well and remove the calls to printSSL/GSSInfo. I propose additional columns to the same \conninfo+ table; when SSL, like this:

Re: Extract numeric filed in JSONB more effectively

2024-02-09 Thread Andy Fan
Hi, Here is the update of this patch. 1. What is it for? commit f7b93acc24b4a152984048fefc6d71db606e3204 (HEAD -> jsonb_numeric) Author: yizhi.fzh Date: Fri Feb 9 16:54:06 2024 +0800 Improve the performance of Jsonb numeric/bool extraction. JSONB object uses a binary

RE: Psql meta-command conninfo+

2024-02-09 Thread Maiquel Grassi
>Hi Nathan > >On 09.02.24 03:41, Nathan Bossart wrote: > >> Separately, does >> the server version really belong here? I'm not sure I would consider that >> to be connection information. >> >I tend to agree with you. The info there wouldn't hurt, but perhaps the >client version would be a better

Re: Reducing connection overhead in pg_upgrade compat check phase

2024-02-09 Thread Daniel Gustafsson
> On 9 Feb 2024, at 00:04, Daniel Gustafsson wrote: > >> On 8 Feb 2024, at 15:16, Daniel Gustafsson wrote: > >> One option could perhaps be to include a version number for <= comparison, >> and >> if set to zero a function pointer to a version check function must be >> provided? >> That

RE: Psql meta-command conninfo+

2024-02-09 Thread Maiquel Grassi
Hi Pavel! >The patch v10 build ends with a warning: >$ make -j --silent >describe.c:911:1: warning: no previous prototype for >‘listConnectionInformation’ [-Wmissing-prototypes] > 911 | listConnectionInformation() | ^ >About terms. I resolved this in v11. I had

Fix parallel vacuum buffer usage reporting

2024-02-09 Thread Anthonin Bonnefoy
Hi, With a db setup with pgbench, we add an additional index: CREATE INDEX ON pgbench_accounts(abalance) And trigger several updates and vacuum to reach a stable amount of dirtied pages: UPDATE pgbench_accounts set abalance = abalance + 1 WHERE aid=1; CHECKPOINT; VACUUM (VERBOSE, INDEX_CLEANUP

Re: Printing backtrace of postgres processes

2024-02-09 Thread Ashutosh Bapat
On Fri, Feb 9, 2024 at 2:18 PM Alvaro Herrera wrote: > > On 2024-Feb-09, Michael Paquier wrote: > > > Anyway, I've been digging around the signal-safety of backtrace(3) > > (even looking a bit at some GCC code, brrr), and I am under the > > impression that backtrace() is just by nature not safe

Re: Printing backtrace of postgres processes

2024-02-09 Thread Alvaro Herrera
On 2024-Feb-09, Michael Paquier wrote: > Anyway, I've been digging around the signal-safety of backtrace(3) > (even looking a bit at some GCC code, brrr), and I am under the > impression that backtrace() is just by nature not safe and also > dangerous in signal handlers. One example of issue

Re: Small fix on query_id_enabled

2024-02-09 Thread Julien Rouhaud
Hi, On Fri, Feb 09, 2024 at 03:38:23PM +0900, Yugo NAGATA wrote: > > I found the comment on query_id_enabled looks inaccurate because this is > never set to true when compute_query_id is ON. > > /* True when compute_query_id is ON, or AUTO and a module requests them */ > bool

RE: Psql meta-command conninfo+

2024-02-09 Thread Maiquel Grassi
>Sorry if this has been brought up, but I noticed that some of the >information is listed below the result set: > > postgres=# \conninfo+ >Current Connection Information > -[ RECORD 1 ]--+- > Database | postgres > Authenticated User | nathan

Re: Make COPY format extendable: Extract COPY TO format implementations

2024-02-09 Thread Michael Paquier
On Fri, Feb 09, 2024 at 04:32:05PM +0900, Sutou Kouhei wrote: > In > "Re: Make COPY format extendable: Extract COPY TO format implementations" > on Fri, 9 Feb 2024 13:21:34 +0900, > Michael Paquier wrote: >> A next step I think we could take is to split the binary-only and the >>

Re: glibc qsort() vulnerability

2024-02-09 Thread Andrey M. Borodin
> On 8 Feb 2024, at 06:52, Nathan Bossart wrote: > > For the same compASC() test, I see an ~8.4% improvement with your int64 > code and a ~3.4% improvement with this: If we care about branch prediction in comparison function, maybe we could produce sorting that inlines comparator, thus

Re: Printing backtrace of postgres processes

2024-02-09 Thread Michael Paquier
On Thu, Feb 08, 2024 at 12:25:18PM +0900, Michael Paquier wrote: > In HandleLogBacktraceInterrupt(), we don't use backtrace_symbols() and > rely on backtrace_symbols_fd() to avoid doing malloc() in the signal > handler as mentioned in [1] back in 2022. Perhaps the part about the > fact that we

Re: Synchronizing slots from primary to standby

2024-02-09 Thread Peter Smith
FYI -- I checked patch v81-0001 to find which of the #includes are strictly needed. == src/backend/replication/logical/slotsync.c 1. +#include "postgres.h" + +#include + +#include "access/genam.h" +#include "access/table.h" +#include "access/xlog_internal.h" +#include