Re: Catalog domain not-null constraints

2024-02-07 Thread Peter Eisentraut
On 18.01.24 07:53, Peter Eisentraut wrote: On 17.01.24 13:15, vignesh C wrote: One of the test has failed in CFBot at [1] with: diff -U3 /tmp/cirrus-ci-build/src/test/regress/expected/domain.out /tmp/cirrus-ci-build/src/test/regress/results/domain.out --- /tmp/cirrus-ci-build/src/test/regress/ex

pg_get_expr locking

2024-02-07 Thread Peter Eisentraut
The function pg_get_expr(), which is used in various system views and information schema views, does not appear to lock the table passed as the second argument, and so appears to be liable to fail if there is a concurrent drop of the table. There is a (probable) case of this being discussed at

Re: An improvement on parallel DISTINCT

2024-02-07 Thread David Rowley
On Mon, 5 Feb 2024 at 14:42, Richard Guo wrote: > > > On Fri, Feb 2, 2024 at 7:36 PM David Rowley wrote: >> I think we should just make it work the same way as >> create_grouping_paths(), where grouping_target is passed as a >> parameter. >> >> I've done it that way in the attached. > > > The cha

Re: Printing backtrace of postgres processes

2024-02-07 Thread Bharath Rupireddy
On Tue, Feb 6, 2024 at 4:21 PM Michael Paquier wrote: > > --- a/src/backend/storage/ipc/procarray.c > +++ b/src/backend/storage/ipc/procarray.c > +bool > +SendProcSignalBackendOrAuxproc(int pid, ProcSignalReason reason) > +{ > > Looking at 0001. This API is a thin wrapper of SendProcSignal(), tha

Re: Is this a problem in GenericXLogFinish()?

2024-02-07 Thread Amit Kapila
On Mon, Feb 5, 2024 at 1:33 PM Michael Paquier wrote: > > On Mon, Feb 05, 2024 at 07:57:09AM +, Hayato Kuroda (Fujitsu) wrote: > > You are right. Based on the previous discussions, PageSetLSN() must be > > called > > after the MakeBufferDirty(). REGBUF_NO_CHANGE has been introduced for > > s

Re: Synchronizing slots from primary to standby

2024-02-07 Thread Amit Kapila
On Mon, Feb 5, 2024 at 9:19 AM Zhijie Hou (Fujitsu) wrote: > > On Thursday, February 1, 2024 12:20 PM Amit Kapila > wrote: > > > > On Thu, Feb 1, 2024 at 8:15 AM Euler Taveira wrote: > > > > > > > > > While working on another patch I noticed a new NOTICE message: > > > > > > NOTICE: changed th

Re: Possibility to disable `ALTER SYSTEM`

2024-02-07 Thread Joel Jacobson
On Fri, Sep 8, 2023, at 16:17, Gabriele Bartolini wrote: > ``` > postgres=# ALTER SYSTEM SET wal_level TO minimal; > ERROR: could not open file "postgresql.auto.conf": Permission denied > ``` +1 to simply mark postgresql.auto.conf file as not being writeable. To improve the UX experience, how ab

Re: glibc qsort() vulnerability

2024-02-07 Thread Mats Kindahl
On Tue, Feb 6, 2024 at 4:11 PM Tom Lane wrote: > Mats Kindahl writes: > > There is a bug in glibc's qsort() algorithm that runs the risk of > creating > > an out-of-bounds error if the comparison function is not transitive, for > > example, if subtraction is used so that it can create an overflo

Re: glibc qsort() vulnerability

2024-02-07 Thread Mats Kindahl
On Tue, Feb 6, 2024 at 9:56 PM Tom Lane wrote: > Nathan Bossart writes: > > Even if the glibc issue doesn't apply to Postgres, I'm tempted to suggest > > that we make it project policy that comparison functions must be > > transitive. There might be no real issues today, but if we write all > >

RE: speed up a logical replica setup

2024-02-07 Thread Hayato Kuroda (Fujitsu)
Dear Euler, I have not finished reviewing, but I can reply to you first. > I didn't complete this task yet so I didn't include it in this patch. > Just to confirm - No need to forcibly include my refactoring patch: you can modify based on your idea. > That's correct. We made a decision to use n

Re: Printing backtrace of postgres processes

2024-02-07 Thread Michael Paquier
On Wed, Feb 07, 2024 at 02:04:39PM +0530, Bharath Rupireddy wrote: > Well, that 'ubuntu' is the default username there, I've changed it now > and kept the output short. I would keep it just at two or three lines, with a "For example, with lines like": > I've simplified the tests, now we don't nee

Re: Synchronizing slots from primary to standby

2024-02-07 Thread shveta malik
On Tue, Feb 6, 2024 at 12:25 PM Bertrand Drouvot wrote: > > Hi, > That said, I still think the commit message needs some re-wording, what about? > > = > If a logical slot on the primary is valid but is invalidated on the standby, > then that slot is dropped and can be recreated on the standby

Re: Is this a problem in GenericXLogFinish()?

2024-02-07 Thread Michael Paquier
On Wed, Feb 07, 2024 at 02:08:42PM +0530, Amit Kapila wrote: > Thanks for the report and looking into it. Pushed! Thanks Amit for the commit and Kuroda-san for the patch! -- Michael signature.asc Description: PGP signature

Re: cataloguing NOT NULL constraints

2024-02-07 Thread jian he
On Mon, Feb 5, 2024 at 5:51 PM Alvaro Herrera wrote: > > On 2024-Feb-05, Alvaro Herrera wrote: > > > Hmm, let me have a look, I can probably get this one fixed today before > > embarking on a larger fix elsewhere in the same feature. > > You know what -- this missing CCI has a much more visible im

Re: Why is subscription/t/031_column_list.pl failing so much?

2024-02-07 Thread Amit Kapila
On Tue, Feb 6, 2024 at 8:21 PM Tom Lane wrote: > > Amit Kapila writes: > > Yeah, I was worried about that. The other idea I have previously > > thought was to change Alter Subscription to Drop+Create Subscription. > > That should also help in bringing stability without losing any > > functionalit

Re: Built-in CTYPE provider

2024-02-07 Thread Peter Eisentraut
Review of the v16 patch set: (Btw., I suppose you started this patch series with 0002 because some 0001 was committed earlier. But I have found this rather confusing. I think it's ok to renumber from 0001 for each new version.) * v16-0002-Add-Unicode-property-tables.patch Various comments

Re: Psql meta-command conninfo+

2024-02-07 Thread Erik Wienhold
On 2024-02-07 05:13 +0100, Maiquel Grassi wrote: > On Tue, Feb 06, 2024 at 09:45:54PM +, Maiquel Grassi wrote: > > My initial idea has always been that they should continue to appear > > because \conninfo+ should show all the things that \conninfo shows and > > add more information. I t

Re: Why is subscription/t/031_column_list.pl failing so much?

2024-02-07 Thread Amit Kapila
On Wed, Feb 7, 2024 at 2:06 AM Tom Lane wrote: > > I wrote: > > More to the point, aren't these proposals just band-aids that > > would stabilize the test without fixing the actual problem? > > The same thing is likely to happen to people in the field, > > unless we do something drastic like remov

Re: Postgres and --config-file option

2024-02-07 Thread Peter Eisentraut
On 02.02.24 22:27, David G. Johnston wrote: On Fri, Feb 2, 2024 at 2:23 PM David G. Johnston mailto:david.g.johns...@gmail.com>> wrote: On Mon, Jan 15, 2024 at 4:35 AM Aleksander Alekseev mailto:aleksan...@timescale.com>> wrote: PFA the patch. It's short but I think it mitigate

Re: Popcount optimization using AVX512

2024-02-07 Thread Alvaro Herrera
Hello, This looks quite reasonable. On my machine, I get the compiler test to pass so I get a "yes" in configure; but of course my CPU doesn't support the instructions so I get the slow variant. So here's the patch again with some minor artifacts fixed. I have the following review notes: 1. we

Re: pgsql: Add EXPLAIN (MEMORY) to report planner memory consumption

2024-02-07 Thread Alvaro Herrera
Many thanks, Justin, for the post-commit review. On 2024-Feb-06, Ashutosh Bapat wrote: > On Tue, Feb 6, 2024 at 3:51 AM Justin Pryzby wrote: > > > > Up to now, the explain " " (two space) format is not mixed with "=". > > > > And, other places which show "Memory" do not use "=". David will > >

Re: RFC: Logging plan of the running query

2024-02-07 Thread torikoshia
On 2024-02-07 13:58, Ashutosh Bapat wrote: On Wed, Feb 7, 2024 at 9:38 AM torikoshia wrote: Hi Ashutosh, On 2024-02-06 19:51, Ashutosh Bapat wrote: > Thanks for the summary. It is helpful. I think patch is also getting > better. > > I have a few questions and suggestions Thanks for your com

Re: Possibility to disable `ALTER SYSTEM`

2024-02-07 Thread Peter Eisentraut
On 06.02.24 16:22, Jelte Fennema-Nio wrote: On Tue, 30 Jan 2024 at 18:49, Robert Haas wrote: I also think that using the GUC system to manage itself is a little bit suspect. I wonder if it would be better to do this some other way, e.g. a sentinel file in the data directory. For example, suppos

Re: SLRU optimization - configurable buffer pool and partitioning the SLRU lock

2024-02-07 Thread Alvaro Herrera
On 2024-Feb-07, Dilip Kumar wrote: > On Tue, Feb 6, 2024 at 8:55 PM Alvaro Herrera wrote: > > > > I made CLOGShmemBuffers, CommitTsShmemBuffers and SUBTRANSShmemBuffers > > compute a number that's multiple of SLRU_BANK_SIZE. But it's a crock, > > because we don't have that macro at that point, s

Re: Possibility to disable `ALTER SYSTEM`

2024-02-07 Thread Gabriele Bartolini
Hi Jelte, On Tue, 6 Feb 2024 at 16:22, Jelte Fennema-Nio wrote: > I'm not convinced we need a new file to disable ALTER SYSTEM. I feel > like an "enable_alter_system" GUC that defaults to ON would work fine > for this. If we make that GUC be PGC_POSTMASTER then an operator can > disable ALTER SY

Re: SLRU optimization - configurable buffer pool and partitioning the SLRU lock

2024-02-07 Thread Dilip Kumar
On Wed, Feb 7, 2024 at 3:49 PM Alvaro Herrera wrote: > > On 2024-Feb-07, Dilip Kumar wrote: > > > On Tue, Feb 6, 2024 at 8:55 PM Alvaro Herrera > > wrote: > > > > > > I made CLOGShmemBuffers, CommitTsShmemBuffers and SUBTRANSShmemBuffers > > > compute a number that's multiple of SLRU_BANK_SIZE.

Re: Possibility to disable `ALTER SYSTEM`

2024-02-07 Thread Gabriele Bartolini
Hi Joel, On Wed, 7 Feb 2024 at 10:00, Joel Jacobson wrote: > On Fri, Sep 8, 2023, at 16:17, Gabriele Bartolini wrote: > > ``` > > postgres=# ALTER SYSTEM SET wal_level TO minimal; > > ERROR: could not open file "postgresql.auto.conf": Permission denied > > ``` > > +1 to simply mark postgresql.a

Re: pgsql: Add EXPLAIN (MEMORY) to report planner memory consumption

2024-02-07 Thread Ashutosh Bapat
On Wed, Feb 7, 2024 at 3:43 PM Alvaro Herrera wrote: > > Many thanks, Justin, for the post-commit review. > > On 2024-Feb-06, Ashutosh Bapat wrote: > > > On Tue, Feb 6, 2024 at 3:51 AM Justin Pryzby wrote: > > > > > > Up to now, the explain " " (two space) format is not mixed with "=". > > > > >

Re: Streaming I/O, vectored I/O (WIP)

2024-02-07 Thread Nazir Bilal Yavuz
Hi, Thanks for working on this! On Wed, 10 Jan 2024 at 07:14, Thomas Munro wrote: > Thanks! I committed the patches up as far as smgr.c before the > holidays. The next thing to commit would be the bufmgr.c one for > vectored ReadBuffer(), v5-0001. Here's my response to your review of > that,

Re: Why is subscription/t/031_column_list.pl failing so much?

2024-02-07 Thread vignesh C
On Wed, 7 Feb 2024 at 15:21, Amit Kapila wrote: > > On Tue, Feb 6, 2024 at 8:21 PM Tom Lane wrote: > > > > Amit Kapila writes: > > > Yeah, I was worried about that. The other idea I have previously > > > thought was to change Alter Subscription to Drop+Create Subscription. > > > That should also

Re: Synchronizing slots from primary to standby

2024-02-07 Thread Amit Kapila
On Tue, Feb 6, 2024 at 12:08 PM Peter Smith wrote: > > There seems some muddling of names here: > - "local" versus ? and "remote" versus "primary"; or sometimes the > function does not give an indication. > - "sync_slot" versus "synced_slot" versus nothing > - "check" versus "validate" > - etc. >

Re: recently added jsonpath method change jsonb_path_query, jsonb_path_query_first immutability

2024-02-07 Thread Jeevan Chalke
On Tue, Feb 6, 2024 at 5:25 PM Andrew Dunstan wrote: > > On 2024-02-05 Mo 22:06, jian he wrote: > > > Hi. > this commit [0] changes immutability of jsonb_path_query, > jsonb_path_query_first? > If so, it may change other functions also. > > Thanks for reporting Jian. Added checkTimezoneIsUsedFo

Re: Synchronizing slots from primary to standby

2024-02-07 Thread Dilip Kumar
> > So now if we have such a functionality then it would be even better to > > extend it to selectively sync the slot. For example, if there is some > > issue in syncing all slots, maybe some bug or taking a long time to > > sync because there are a lot of slots but if the user needs to quickly >

Re: Psql meta-command conninfo+

2024-02-07 Thread Pavel Luzanov
This is a good idea about extended connection info. On 07.02.2024 07:13, Maiquel Grassi wrote: SELECT ... current_user AS "User", This will be inconsistent with \conninfo. \conninfo returns authenticated user (PQuser), not the current_user. It might be worth showing current_user, session_user,

Re: Commitfest 2024-01 first week update

2024-02-07 Thread Alvaro Herrera
On 2024-Feb-04, vignesh C wrote: > We should do something about these kinds of entries, there were few > suggestions like tagging under a new category or so, can we add a new > status to park these entries something like "Waiting for direction". > The threads which have no discussion for 6 months

RE: Psql meta-command conninfo+

2024-02-07 Thread Maiquel Grassi
On 2024-02-07 05:13 +0100, Maiquel Grassi wrote: > On Tue, Feb 06, 2024 at 09:45:54PM +, Maiquel Grassi wrote: > > My initial idea has always been that they should continue to appear > > because \conninfo+ should show all the things that \conninfo shows and > > add more inform

Re: Commitfest 2024-01 first week update

2024-02-07 Thread Daniel Gustafsson
> On 7 Feb 2024, at 13:37, Alvaro Herrera wrote: > Maybe a new status is appropriate ... I would suggest "Stalled". Such a > patch still applies and has no pending feedback, but nobody seems > interested. Since the CF app knows when the last email in the thread was, the state of the patch entry

Re: Why is subscription/t/031_column_list.pl failing so much?

2024-02-07 Thread vignesh C
On Wed, 7 Feb 2024 at 15:26, Amit Kapila wrote: > > On Wed, Feb 7, 2024 at 2:06 AM Tom Lane wrote: > > > > I wrote: > > > More to the point, aren't these proposals just band-aids that > > > would stabilize the test without fixing the actual problem? > > > The same thing is likely to happen to peo

Re: Commitfest 2024-01 first week update

2024-02-07 Thread Alvaro Herrera
On 2024-Feb-07, Daniel Gustafsson wrote: > Since the CF app knows when the last email in the thread was, the > state of the patch entry and the number of CF's which is has been > present in; maybe we can extend the app to highlight these patches in > a way which doesn't add more manual interventio

Re: Reducing connection overhead in pg_upgrade compat check phase

2024-02-07 Thread Daniel Gustafsson
> On 6 Feb 2024, at 17:47, Daniel Gustafsson wrote: > >> On 6 Feb 2024, at 17:32, Nathan Bossart wrote: >> >> On Fri, Feb 02, 2024 at 12:18:25AM +0530, vignesh C wrote: >>> With no update to the thread and the patch still not applying I'm >>> marking this as returned with feedback. Please feel

Re: scram_iterations is undocumented GUC_REPORT

2024-02-07 Thread Daniel Gustafsson
> On 30 Jan 2024, at 15:44, Alvaro Herrera wrote: > I propose to turn the list into a > > which looks _much_ nicer to read, as in the attached screenshot of the > PDF. +1, this reads a lot better. -- Daniel Gustafsson

Re: Possibility to disable `ALTER SYSTEM`

2024-02-07 Thread Jelte Fennema-Nio
On Wed, 7 Feb 2024 at 11:16, Peter Eisentraut wrote: > On 06.02.24 16:22, Jelte Fennema-Nio wrote: > > On Tue, 30 Jan 2024 at 18:49, Robert Haas wrote: > >> I also think that using the GUC system to manage itself is a little > >> bit suspect. I wonder if it would be better to do this some other w

Re: Possibility to disable `ALTER SYSTEM`

2024-02-07 Thread David G. Johnston
On Wednesday, February 7, 2024, Joel Jacobson wrote: > > On Fri, Sep 8, 2023, at 23:43, Magnus Hagander wrote: > > We need a "allowlist" of things a user can do, rather than a blocklist > > of "they can do everything they can possibly think of and a computer > > is capable of doing, except for th

Re: Possibility to disable `ALTER SYSTEM`

2024-02-07 Thread Jelte Fennema-Nio
On Wed, 7 Feb 2024 at 11:35, Gabriele Bartolini wrote: > This is mostly the approach I have taken in the patch, except allowing to > change the value in the configuration file. (I had missed the patch in the long thread). I think it would be nice to have this be PGC_SIGHUP, and set GUC_DISALLOW_

Re: Commitfest 2024-01 first week update

2024-02-07 Thread Amit Kapila
On Wed, Feb 7, 2024 at 6:07 PM Alvaro Herrera wrote: > > On 2024-Feb-04, vignesh C wrote: > > > We should do something about these kinds of entries, there were few > > suggestions like tagging under a new category or so, can we add a new > > status to park these entries something like "Waiting for

What about Perl autodie?

2024-02-07 Thread Peter Eisentraut
I came across the Perl autodie pragma (https://perldoc.perl.org/autodie). This seems pretty useful; is this something we can use? Any drawbacks? Any minimum Perl version? Attached is a sample patch of the kind of thing I'd be interested in. The existing error handling of file operations in

Re: Commitfest 2024-01 first week update

2024-02-07 Thread Daniel Gustafsson
> On 7 Feb 2024, at 14:15, Alvaro Herrera wrote: > > On 2024-Feb-07, Daniel Gustafsson wrote: > >> Since the CF app knows when the last email in the thread was, the >> state of the patch entry and the number of CF's which is has been >> present in; maybe we can extend the app to highlight these

Re: Set log_lock_waits=on by default

2024-02-07 Thread Stephen Frost
Greetings, * Laurenz Albe (laurenz.a...@cybertec.at) wrote: > On Tue, 2024-02-06 at 12:29 -0500, Tom Lane wrote: > > Nathan Bossart writes: > > > It looks like there are two ideas: > > > [...] > > > * Set log_lock_waits on by default. The folks on this thread seem to > > > support this idea, b

RE: Psql meta-command conninfo+

2024-02-07 Thread Maiquel Grassi
This is a good idea about extended connection info. On 07.02.2024 07:13, Maiquel Grassi wrote: SELECT ... current_user AS "User", This will be inconsistent with \conninfo. \conninfo returns authenticated user (PQuser), not the current_user. It might be worth showing current_user, sess

Re: pgjdbc is not working with PKCS8 certificates with password

2024-02-07 Thread Joe Conway
On 2/7/24 06:42, just madhu wrote: On further investigation, /With certificate generated as below. JDBC connection is successful./ openssl pkcs8 -topk8 -inform PEM -in client.key -outform DER -out client.pk8  -passout pass:foobar / -v1 PBE-MD5-DES But a connection from pgAdmin (connection fail

Re: pgjdbc is not working with PKCS8 certificates with password

2024-02-07 Thread just madhu
On further investigation, *With certificate generated as below. JDBC connection is successful.openssl pkcs8 -topk8 -inform PEM -in client.key -outform DER -out client.pk8 -passout pass:foobar * -v1 PBE-MD5-DES But a connection from pgAdmin (connection failed: \SSLCerts\pk8_pass\client_pass_PBE.

Re: Set log_lock_waits=on by default

2024-02-07 Thread Tom Lane
Stephen Frost writes: >> On Tue, 2024-02-06 at 12:29 -0500, Tom Lane wrote: >>> I was, and remain, of the opinion that that was a bad idea that >>> we'll eventually revert, just like we previously got rid of most >>> inessential log chatter in the default configuration. >> Unsurprisingly, I want

Re: Set log_lock_waits=on by default

2024-02-07 Thread Stephen Frost
Greetings, * Tom Lane (t...@sss.pgh.pa.us) wrote: > Stephen Frost writes: > >> On Tue, 2024-02-06 at 12:29 -0500, Tom Lane wrote: > >>> I was, and remain, of the opinion that that was a bad idea that > >>> we'll eventually revert, just like we previously got rid of most > >>> inessential log chat

Re: pg_get_expr locking

2024-02-07 Thread Tom Lane
Peter Eisentraut writes: > The function pg_get_expr(), which is used in various system views and > information schema views, does not appear to lock the table passed as > the second argument, and so appears to be liable to fail if there is a > concurrent drop of the table. There is a (probable

Re: Printing backtrace of postgres processes

2024-02-07 Thread Bharath Rupireddy
On Wed, Feb 7, 2024 at 2:57 PM Michael Paquier wrote: > > On Wed, Feb 07, 2024 at 02:04:39PM +0530, Bharath Rupireddy wrote: > > Well, that 'ubuntu' is the default username there, I've changed it now > > and kept the output short. > > I would keep it just at two or three lines, with a "For example

Re: Change GUC hashtable to use simplehash?

2024-02-07 Thread Peter Eisentraut
On 22.01.24 03:03, John Naylor wrote: I wrote: fasthash_init(&hs, sizeof(Datum), kind); fasthash_accum(&hs, (char *) &value, sizeof(Datum)); return fasthash_final32(&hs, 0); It occurred to me that it's strange to have two places that length can be passed. That was a side effect of the

Re: recently added jsonpath method change jsonb_path_query, jsonb_path_query_first immutability

2024-02-07 Thread jian he
On Wed, Feb 7, 2024 at 7:36 PM Jeevan Chalke wrote: > Added checkTimezoneIsUsedForCast() check where ever we are casting timezoned > to non-timezoned types and vice-versa. https://www.postgresql.org/docs/devel/functions-json.html above Table 9.51. jsonpath Filter Expression Elements, the Note se

Combine headerscheck and cpluspluscheck scripts

2024-02-07 Thread Peter Eisentraut
headerscheck started in 55ea1091884 (2019) essentially as an adjusted copy of cpluspluscheck. Since then two scripts have not drifted far apart. But there are occasionally mistakes keeping the two exclude lists updated together. I figure we can just combine the two scripts into one, so it's

Re: Where can I find the doxyfile?

2024-02-07 Thread John Morris
>> I think all the explanatory messages in doc/doxygen/meson.build >> are a bit much. I think it's enough to just not define the target >> when the required conditions (dependencies, options) are not there. >> Maybe something like docs_pdf can serve as an example. Makes sense, and it is simpler. L

Re: Psql meta-command conninfo+

2024-02-07 Thread Pavel Luzanov
Hi,Maiquel! On 07.02.2024 17:47, Maiquel Grassi wrote: "Also, it seems that the verbose parameter in the listConnectionInformation is unnecessary." Could you point out exactly the line or code snippet you are referring to? +bool +listConnectionInformation(const char *pattern,*bool verbose*)

Re: pgjdbc is not working with PKCS8 certificates with password

2024-02-07 Thread just madhu
I see that the generated certificate is not working in pgAdmin and psql. So I wanted a way by which I could make it work there as well. As ANS.1 DER is a supported format for libpq, I suppose that this certificate should work here as well. Also as suggested checking in pgjdbc as well. On Wed, Feb

Re: What about Perl autodie?

2024-02-07 Thread Greg Sabino Mullane
On Wed, Feb 7, 2024 at 9:05 AM Peter Eisentraut wrote: > I came across the Perl autodie pragma > (https://perldoc.perl.org/autodie). This seems pretty useful; is this > something we can use? Any drawbacks? Any minimum Perl version? Big +1 No drawbacks. I've been using it heavily for many, m

Constant Splitting/Refactoring

2024-02-07 Thread David Christensen
As part of the reserved page space/page features[1] work, there is a need to convert some of the existing constants into variables, since the size of those will no longer be fixed at compile time. At FOSDEM, there was some interest expressed about seeing what a cleanup patch like that would look l

Re: common signal handler protection

2024-02-07 Thread Nathan Bossart
On Tue, Feb 06, 2024 at 06:48:53PM -0800, Andres Freund wrote: > On 2024-02-06 20:39:41 -0600, Nathan Bossart wrote: >> I finally spent some time trying to measure this overhead. Specifically, I >> sent many, many SIGUSR2 signals to postmaster, which just uses >> dummy_handler(), i.e., does nothin

Re: Possibility to disable `ALTER SYSTEM`

2024-02-07 Thread Euler Taveira
On Wed, Feb 7, 2024, at 10:49 AM, Jelte Fennema-Nio wrote: > On Wed, 7 Feb 2024 at 11:35, Gabriele Bartolini > wrote: > > This is mostly the approach I have taken in the patch, except allowing to > > change the value in the configuration file. > > (I had missed the patch in the long thread). I t

Re: common signal handler protection

2024-02-07 Thread Nathan Bossart
Sorry for the noise. On Wed, Feb 07, 2024 at 11:06:50AM -0600, Nathan Bossart wrote: > I'd like to get this committed (to HEAD only) in the next few weeks. TBH > I'm not wild about the weird caveats (e.g., race conditions when pqsignal() > is called within a signal handler), but I also think it i

Re: Where can I find the doxyfile?

2024-02-07 Thread John Morris
>> Maybe this is something that can be tweaked on the doxygen side? I’ll look into that idea. Doxygen is a separate project with its own developers to persuade. I could imagine a special “C” or “C++” mode. I wanted to keep things simple, and the filter mechanism is how they extend doxygen to sup

Re: Testing autovacuum wraparound (including failsafe)

2024-02-07 Thread Peter Eisentraut
The way src/test/modules/xid_wraparound/meson.build is written, it installs the xid_wraparound.so module into production installations. For test modules, a different installation code needs to be used. See neighboring test modules such as src/test/modules/test_rbtree/meson.build for examples.

Re: Refactoring backend fork+exec code

2024-02-07 Thread Andres Freund
Hi, On 2024-01-30 02:08:36 +0200, Heikki Linnakangas wrote: > I spent some more time on the 'lastBackend' optimization in sinvaladt.c. I > realized that it became very useless with these patches, because aux > processes are allocated pgprocno's after all the slots for regular backends. > There are

Re: scram_iterations is undocumented GUC_REPORT

2024-02-07 Thread Alvaro Herrera
On 2024-Feb-07, Daniel Gustafsson wrote: > On 30 Jan 2024, at 15:44, Alvaro Herrera wrote: > > > I propose to turn the list into a > > > > which looks _much_ nicer to read, as in the attached screenshot of > > the PDF. > > +1, this reads a lot better. Thanks, applied and backpatched to 16. -

Re: common signal handler protection

2024-02-07 Thread Andres Freund
Hi, On 2024-02-07 11:15:54 -0600, Nathan Bossart wrote: > On Wed, Feb 07, 2024 at 11:06:50AM -0600, Nathan Bossart wrote: > > I'd like to get this committed (to HEAD only) in the next few weeks. TBH > > I'm not wild about the weird caveats (e.g., race conditions when pqsignal() > > is called with

Re: glibc qsort() vulnerability

2024-02-07 Thread Heikki Linnakangas
On 07/02/2024 11:09, Mats Kindahl wrote: On Tue, Feb 6, 2024 at 9:56 PM Tom Lane > wrote: Nathan Bossart mailto:nathandboss...@gmail.com>> writes: > Even if the glibc issue doesn't apply to Postgres, I'm tempted to suggest > that we make it project poli

Re: Remove Start* macros from postmaster.c to ease understanding of code

2024-02-07 Thread Nathan Bossart
On Tue, Feb 06, 2024 at 02:37:25PM -0600, Nathan Bossart wrote: > Unless there are objections, I'll plan on committing this in the next day > or two. Committed. -- Nathan Bossart Amazon Web Services: https://aws.amazon.com

Re: Printing backtrace of postgres processes

2024-02-07 Thread Bharath Rupireddy
On Wed, Feb 7, 2024 at 9:00 PM Bharath Rupireddy wrote: > > On Wed, Feb 7, 2024 at 2:57 PM Michael Paquier wrote: > > > > On Wed, Feb 07, 2024 at 02:04:39PM +0530, Bharath Rupireddy wrote: > > > Well, that 'ubuntu' is the default username there, I've changed it now > > > and kept the output short

Re: the s_lock_stuck on perform_spin_delay

2024-02-07 Thread Andres Freund
Hi, There are some similarities between this and https://www.postgresql.org/message-id/20240207184050.rkvpuudq7huijmkb%40awork3.anarazel.de as described in that email. On 2024-01-25 15:24:17 +0800, Andy Fan wrote: > From 4c8fd0ab71299e57fbeb18dec70051bd1d035c7c Mon Sep 17 00:00:00 2001 > From: "

Re: Popcount optimization using AVX512

2024-02-07 Thread Alvaro Herrera
I happened to notice by chance that John Naylor had posted an extension to measure performance of popcount here: https://postgr.es/m/CAFBsxsE7otwnfA36Ly44zZO+b7AEWHRFANxR1h1kxveEV=g...@mail.gmail.com This might be useful as a base for a new one to verify the results of the proposed patch in machin

Re: common signal handler protection

2024-02-07 Thread Nathan Bossart
On Wed, Feb 07, 2024 at 10:40:50AM -0800, Andres Freund wrote: > On 2024-02-07 11:15:54 -0600, Nathan Bossart wrote: >> Perhaps we should add a file global bool that is only set during >> wrapper_handler(). Then we could Assert() or elog(ERROR, ...) if >> pqsignal() is called with it set. > > In

Question about behavior of deletes with REPLICA IDENTITY NOTHING

2024-02-07 Thread James Coleman
Hello, We recently noticed some behavior that seems reasonable but also surprised our engineers based on the docs. If we have this setup: create table items(i int); insert into items(i) values (1); create publication test_pub for all tables; Then when we: delete from items where i = 1; we get:

RE: Psql meta-command conninfo+

2024-02-07 Thread Maiquel Grassi
> Hi, Maiquel! > > On 07.02.2024 17:47, Maiquel Grassi wrote: > "Also, it seems that the verbose parameter in the listConnectionInformation > is unnecessary." > Could you point out exactly the line or code snippet you are referring to? > +bool > +listConnectionInformation(const char *pattern, bo

Re: Question about behavior of deletes with REPLICA IDENTITY NOTHING

2024-02-07 Thread Laurenz Albe
On Wed, 2024-02-07 at 15:12 -0500, James Coleman wrote: > We recently noticed some behavior that seems reasonable but also > surprised our engineers based on the docs. > > If we have this setup: > create table items(i int); > insert into items(i) values (1); > create publication test_pub for all t

gcc build warnings at -O3

2024-02-07 Thread Andres Freund
Hi, On 2024-01-11 21:55:19 -0500, Tom Lane wrote: > Bharath Rupireddy writes: > > Hi, I'm seeing a compiler warning with CFLAGS -O3 but not with -O2. > > > In file included from dbcommands.c:20: > > dbcommands.c: In function ‘createdb’: > > ../../../src/include/postgres.h:104:16: warning: ‘src_h

Re: speed up a logical replica setup

2024-02-07 Thread Euler Taveira
On Wed, Feb 7, 2024, at 2:31 AM, Hayato Kuroda (Fujitsu) wrote: > Ah, actually I did not have such a point of view. Assuming that changed port > number > can avoid connection establishments, there are four options: > a) Does not overwrite port and listen_addresses. This allows us to monitor by >

Re: glibc qsort() vulnerability

2024-02-07 Thread Nathan Bossart
On Wed, Feb 07, 2024 at 08:46:56PM +0200, Heikki Linnakangas wrote: > Doesn't hurt to fix the comparison functions, and +1 on using the same > pattern everywhere. I attached a new version of the patch with some small adjustments. I haven't looked through all in-tree qsort() comparators to see if

Re: Statistics Import and Export

2024-02-07 Thread Tomas Vondra
Hi, I took a quick look at the v4 patches. I haven't done much testing yet, so only some basic review. 0001 - The SGML docs for pg_import_rel_stats may need some changes. It starts with description of what gets overwritten (non-)transactionally (which gets repeated twice), but that seems more li

Re: index prefetching

2024-02-07 Thread Melanie Plageman
On Wed, Jan 24, 2024 at 3:20 PM Melanie Plageman wrote: > > On Wed, Jan 24, 2024 at 4:19 AM Tomas Vondra > wrote: > > > > On 1/24/24 01:51, Melanie Plageman wrote: > > >> But I'm not sure what to do about optimizations that are more specific > > >> to the access path. Consider for example the ind

Re: glibc qsort() vulnerability

2024-02-07 Thread Andres Freund
Hi, On 2024-02-07 20:46:56 +0200, Heikki Linnakangas wrote: > > The routines modified do a subtraction of int:s and return that, which > > can cause an overflow. This method is used for some int16 as well but > > since standard conversions in C will perform the arithmetics in "int" > > precision,

Re: Rename setup_cancel_handler in pg_dump

2024-02-07 Thread Daniel Gustafsson
> On 1 Feb 2024, at 02:21, Yugo NAGATA wrote: > On Tue, 30 Jan 2024 13:44:28 +0100 > Daniel Gustafsson wrote: >> -setup_cancel_handler(void) >> +pg_dump_setup_cancel_handler(void) >> >> We don't have any other functions prefixed with pg_dump_, based on the naming >> of the surrounding code in t

Re: Question about behavior of deletes with REPLICA IDENTITY NOTHING

2024-02-07 Thread James Coleman
On Wed, Feb 7, 2024 at 3:22 PM Laurenz Albe wrote: > > On Wed, 2024-02-07 at 15:12 -0500, James Coleman wrote: > > We recently noticed some behavior that seems reasonable but also > > surprised our engineers based on the docs. > > > > If we have this setup: > > create table items(i int); > > inser

Re: glibc qsort() vulnerability

2024-02-07 Thread Nathan Bossart
On Wed, Feb 07, 2024 at 01:48:57PM -0800, Andres Freund wrote: > Now, in most cases this won't matter, the sorting isn't performance > critical. But I don't think it's a good idea to standardize on a generally > slower pattern. > > Not that that's a good test, but I did quickly benchmark [1] this

Re: Question about behavior of deletes with REPLICA IDENTITY NOTHING

2024-02-07 Thread Peter Smith
On Thu, Feb 8, 2024 at 9:04 AM James Coleman wrote: > > On Wed, Feb 7, 2024 at 3:22 PM Laurenz Albe wrote: > > > > On Wed, 2024-02-07 at 15:12 -0500, James Coleman wrote: > > > We recently noticed some behavior that seems reasonable but also > > > surprised our engineers based on the docs. > > >

Re: pg_stat_advisor extension

2024-02-07 Thread jian he
On Tue, Feb 6, 2024 at 12:06 AM Ilia Evdokimov wrote: > > Hi hackers, > > I'm reaching out again regarding the patch with new extension > 'pg_stat_advisor' aimed at enhancing query plan efficiency through the > suggestion of creating statistics. > > I understand the community is busy, but I woul

Re: Question about behavior of deletes with REPLICA IDENTITY NOTHING

2024-02-07 Thread James Coleman
On Wed, Feb 7, 2024 at 6:04 PM Peter Smith wrote: > > On Thu, Feb 8, 2024 at 9:04 AM James Coleman wrote: > > > > On Wed, Feb 7, 2024 at 3:22 PM Laurenz Albe > > wrote: > > > > > > On Wed, 2024-02-07 at 15:12 -0500, James Coleman wrote: > > > > We recently noticed some behavior that seems reaso

Re: glibc qsort() vulnerability

2024-02-07 Thread Andres Freund
Hi, On 2024-02-07 16:21:24 -0600, Nathan Bossart wrote: > On Wed, Feb 07, 2024 at 01:48:57PM -0800, Andres Freund wrote: > > Now, in most cases this won't matter, the sorting isn't performance > > critical. But I don't think it's a good idea to standardize on a generally > > slower pattern. > > >

Re: Should we remove -Wdeclaration-after-statement?

2024-02-07 Thread Noah Misch
On Mon, Jan 29, 2024 at 04:03:44PM +0100, Jelte Fennema-Nio wrote: > I feel like this is the type of change where there's not much > discussion to be had. And the only way to resolve it is to use some > voting to gauge community opinion. > > So my suggestion is for people to respond with -1, -0.5,

Re: Rename setup_cancel_handler in pg_dump

2024-02-07 Thread Yugo NAGATA
On Wed, 7 Feb 2024 22:59:48 +0100 Daniel Gustafsson wrote: > > On 1 Feb 2024, at 02:21, Yugo NAGATA wrote: > > On Tue, 30 Jan 2024 13:44:28 +0100 > > Daniel Gustafsson wrote: > > >> -setup_cancel_handler(void) > >> +pg_dump_setup_cancel_handler(void) > >> > >> We don't have any other function

Re: cfbot is failing all tests on FreeBSD/Meson builds

2024-02-07 Thread Thomas Munro
On Tue, Jan 30, 2024 at 5:06 PM Tom Lane wrote: > Thomas Munro writes: > > On Sat, Jan 13, 2024 at 1:51 PM Tom Lane wrote: > >> Time for a bug report to IO::Tty's authors, I guess. > > > Ahh, there is one: https://github.com/cpan-authors/IO-Tty/issues/38 > > Just for the archives' sake: I hit th

Re: Document efficient self-joins / UPDATE LIMIT techniques.

2024-02-07 Thread Laurenz Albe
On Sat, 2024-02-03 at 15:27 -0500, Corey Huinker wrote: > > Here's another attempt, applying Laurenz's feedback: I like this patch much better. Some comments: > --- a/doc/src/sgml/ref/delete.sgml > +++ b/doc/src/sgml/ref/delete.sgml > @@ -234,6 +234,24 @@ DELETE FROM films > In some cases t

Re: glibc qsort() vulnerability

2024-02-07 Thread Nathan Bossart
On Wed, Feb 07, 2024 at 04:42:07PM -0800, Andres Freund wrote: > On 2024-02-07 16:21:24 -0600, Nathan Bossart wrote: >> The assembly for that looks encouraging, but I still need to actually test >> it... > > Possible. For 16bit upcasting to 32bit is clearly the best way. For 32 bit > that doesn't

Re: glibc qsort() vulnerability

2024-02-07 Thread Andres Freund
Hi, On 2024-02-07 19:52:11 -0600, Nathan Bossart wrote: > On Wed, Feb 07, 2024 at 04:42:07PM -0800, Andres Freund wrote: > > On 2024-02-07 16:21:24 -0600, Nathan Bossart wrote: > >> The assembly for that looks encouraging, but I still need to actually test > >> it... > > > > Possible. For 16bit u

Re: "ERROR: latch already owned" on gharial

2024-02-07 Thread Soumyadeep Chakraborty
Hey hackers, I wanted to report that we have seen this issue (with the procLatch) a few times very sporadically on Greenplum 6X (based on 9.4), with relatively newer versions of GCC. I realize that 9.4 is out of support, so this email is purely to add on to the existing thread, in case the info c

  1   2   >