Re: [PATCH] Reuse Workers and Replication Slots during Logical Replication

2023-07-10 Thread Peter Smith
Hi, here are some review comments for patch v16-0002. == Commit message 1. This commit allows reusing tablesync workers for syncing more than one table sequentially during their lifetime, instead of exiting after only syncing one table. Before this commit, tablesync workers were capable of s

Re: Autogenerate some wait events code and documentation

2023-07-10 Thread Alvaro Herrera
On 2023-Jul-09, Michael Paquier wrote: > Patch 0002 introduces a set of simplifications for the format of > wait_event_names.txt: > - Removal of the first column for the enums. I don't like this bit, because it means the .txt file is now ungreppable as source of the enum name. Things become myst

Re: Show various offset arrays for heap WAL records

2023-07-10 Thread Heikki Linnakangas
On 12/04/2023 01:29, Peter Geoghegan wrote: Thanks for your help with the follow-up work. Seems like we're done with this now. This is still listed in the July commitfest; is there some work remaining? I'm late to the party, but regarding commit c03c2eae0a, which added the guidelines for writ

Re: doc: clarify the limitation for logical replication when REPILICA IDENTITY is FULL

2023-07-10 Thread Peter Smith
On Mon, Jul 10, 2023 at 1:33 PM Hayato Kuroda (Fujitsu) wrote: > > Dear hackers, > > This is a fork thread from [1]. While analyzing codes I noticed that UPDATE > and > DELETE cannot be replicated when REPLICA IDENTITY is FULL and the table has > datatype > which does not have the operator class

Valgrind errors on 32-bit OS

2023-07-10 Thread o . tselebrovskiy
Greetings, everyone! While working on an extension, I've found myself using valgrind on a 32-bit OS (Debian 11) and after executing any query (even 'select 1;') under valgrind I've been shown the same error everytime: ==00:00:00:18.109 2528== VALGRINDERROR-BEGIN ==00:00:00:18.109 2528== Use o

Check invalid pages at the end of recovery to alarm lost data

2023-07-10 Thread 王伟(学弈)
hello, all. Recently, I find one very strange situation to lose data of primary node which the details can be find at the first patch: 0001-Add-test-case-data-lost-after-restart.patch. The first patch shows us that data could be lost after truncating physical file by someone else before startin

Re: add non-option reordering to in-tree getopt_long

2023-07-10 Thread Kyotaro Horiguchi
At Fri, 7 Jul 2023 20:52:24 -0700, Nathan Bossart wrote in > I spent some time tidying up the patch and adding a more detailed commit > message. The commit message and the change to TAP script looks good. Two conditions are to be reversed and one of them look somewhat unintuitive to me. +

Re: pg_usleep for multisecond delays

2023-07-10 Thread Daniel Gustafsson
> On 4 Apr 2023, at 05:31, Nathan Bossart wrote: > > On Mon, Apr 03, 2023 at 04:33:27PM -0400, Gregory Stark (as CFM) wrote: >> Is this still a WIP? Is it targeting this release? There are only a >> few days left before the feature freeze. I'm guessing it should just >> move to the next CF for th

Re: [PATCH] Slight improvement of worker_spi.c example

2023-07-10 Thread Daniel Gustafsson
> On 14 Jun 2023, at 13:08, Aleksander Alekseev > wrote: >> Are you or Aleksander interested in helping improve this module? I'm happy >> to help review and/or write patches. > > Unfortunately I'm not familiar with the problem in respect of naptime > Julien is referring to. If you know what th

Re: Eliminating SPI from RI triggers - take 2

2023-07-10 Thread Daniel Gustafsson
> On 21 Mar 2023, at 06:03, Amit Langote wrote: > On Tue, Mar 21, 2023 at 3:54 AM Gregory Stark (as CFM) > wrote: >> On Mon, 17 Oct 2022 at 14:59, Robert Haas wrote: >>> But I think the bigger problem for this patch set is that the >>> design-level feedback from >>> https://www.postgresql.org/

Re: Eliminating SPI from RI triggers - take 2

2023-07-10 Thread Amit Langote
On Mon, Jul 10, 2023 at 5:27 PM Daniel Gustafsson wrote: > > On 21 Mar 2023, at 06:03, Amit Langote wrote: > > On Tue, Mar 21, 2023 at 3:54 AM Gregory Stark (as CFM) > > wrote: > >> On Mon, 17 Oct 2022 at 14:59, Robert Haas wrote: > > >>> But I think the bigger problem for this patch set is th

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

2023-07-10 Thread Alena Rybakina
I agreed with the changes. Thank you for your work. I updated patch and added you to the authors. I specified Ranier Vilela as a reviewer. On 10.07.2023 06:12, Andrey Lepikhov wrote: On 7/7/2023 15:20, Alena Rybakina wrote: because we will provide similar manipulation in this: foreach(l, ge

RE: doc: clarify the limitation for logical replication when REPILICA IDENTITY is FULL

2023-07-10 Thread Hayato Kuroda (Fujitsu)
Dear Peter, Thanks for checking! PSA new version. > 1. > SUGGESTION (minor reword) > If the published table specifies REPLICA IDENTITY > FULL but the table includes an attribute whose datatype is > not an operator class of Btree, then UPDATE and > DELETE operations cannot be replicated. To make i

Re: RADIUS tests and improvements

2023-07-10 Thread Daniel Gustafsson
Hi Thomas, Have you have a chance to look at and address the feedback given in this thread? -- Daniel Gustafsson

Re: Split index and table statistics into different types of stats

2023-07-10 Thread Daniel Gustafsson
> On 4 Apr 2023, at 12:04, Drouvot, Bertrand > wrote: > On 4/3/23 11:47 PM, Gregory Stark (as CFM) wrote: >> On Thu, 16 Mar 2023 at 05:25, Drouvot, Bertrand >> wrote: >>> >>> My plan was to get [1] done before resuming working on the "Split index and >>> table statistics into different types o

Re: Cross-database SERIALIZABLE safe snapshots

2023-07-10 Thread Heikki Linnakangas
On 09/03/2023 07:34, Thomas Munro wrote: Here is a feature idea that emerged from a pgsql-bugs thread[1] that I am kicking into the next commitfest. Example: s1: \c db1 s1: CREATE TABLE t (i int); s1: BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE; s1: INSERT INTO t VALUES (42); s2: \c db2 s2:

Re: Prefetch the next tuple's memory during seqscans

2023-07-10 Thread Daniel Gustafsson
> On 4 Apr 2023, at 06:50, David Rowley wrote: > Updated patches attached. This patch is marked Waiting on Author, but from the thread it seems Needs Review is more apt. I've changed status and also attached a new version of the patch as the posted v1 no longer applied due to changes in formatt

Re: Prefetch the next tuple's memory during seqscans

2023-07-10 Thread Daniel Gustafsson
> On 10 Jul 2023, at 11:32, Daniel Gustafsson wrote: > >> On 4 Apr 2023, at 06:50, David Rowley wrote: > >> Updated patches attached. > > This patch is marked Waiting on Author, but from the thread it seems Needs > Review is more apt. I've changed status and also attached a new version of >

Re: Some revises in adding sorting path

2023-07-10 Thread Daniel Gustafsson
> On 28 Mar 2023, at 21:59, David Rowley wrote: > I'll mark this as waiting on author while you work on that. Richard: have you had a chance to incorporate the tests proposed by David in this thread into your patch? -- Daniel Gustafsson

Re: gcc -Wclobbered in PostgresMain

2023-07-10 Thread Sergey Shinderuk
Hello, Tom, On 08.07.2023 18:11, Tom Lane wrote: What we ought to be doing is resetting these two flags after the disable_all_timeouts call. Oops, I missed that. Having done that, it wouldn't really be necessary to mark these as volatile. I kept that marking anyway for consistency with s

Re: [Patch] Use *other* indexes on the subscriber when REPLICA IDENTITY is FULL

2023-07-10 Thread Amit Kapila
On Mon, Jun 26, 2023 at 7:14 PM Hayato Kuroda (Fujitsu) wrote: > > Thank you for giving comments! The author's comment is quite helpful for us. > > > > When I last dealt with the same issue, I was examining it from a slightly > broader perspective. I think > my conclusion was that RelationFindRep

Re: Request for comment on setting binary format output per session

2023-07-10 Thread Daniel Gustafsson
> On 25 Apr 2023, at 16:47, Dave Cramer wrote: > Patch attached with comments removed This patch no longer applies, please submit a rebased version on top of HEAD. -- Daniel Gustafsson

Re: doc: clarify the limitation for logical replication when REPILICA IDENTITY is FULL

2023-07-10 Thread Amit Kapila
On Mon, Jul 10, 2023 at 2:33 PM Hayato Kuroda (Fujitsu) wrote: > If the published table specifies + REPLICA IDENTITY FULL + but the table includes an attribute whose datatype is not an operator + class of Btree, Isn't the same true for the hash operator class family as well? Can

Re: PATCH: Using BRIN indexes for sorted output

2023-07-10 Thread Matthias van de Meent
On Fri, 7 Jul 2023 at 20:26, Tomas Vondra wrote: > > Hi, > > I finally had time to look at this patch again. There's a bit of bitrot, > so here's a rebased version (no other changes). Thanks! > On 2/27/23 16:40, Matthias van de Meent wrote: > > Some initial comments on 0004: > > > >> +/* > >> +

Re: optimize several list functions with SIMD intrinsics

2023-07-10 Thread Heikki Linnakangas
On 21/04/2023 23:33, Nathan Bossart wrote: On Fri, Apr 21, 2023 at 01:50:34PM +0700, John Naylor wrote: On Wed, Mar 8, 2023 at 7:25 AM Nathan Bossart wrote: was mostly a fun weekend project, and I don't presently have any concrete examples of workloads where this might help. It seems like th

Re:doc: clarify the limitation for logical replication when REPILICA IDENTITY is FULL

2023-07-10 Thread Sergei Kornilov
Hello Is this restriction only for the subscriber? If we have not changed the replica identity and there is no primary key, then we forbid update and delete on the publication side (a fairly common usage error at the beginning of using publications). If we have replica identity FULL (the table

RE: Initial Schema Sync for Logical Replication

2023-07-10 Thread Kumar, Sachin
> From: Amit Kapila > On Wed, Jul 5, 2023 at 7:45 AM Masahiko Sawada > wrote: > > > > On Mon, Jun 19, 2023 at 5:29 PM Peter Smith > wrote: > > > > > > Hi, > > > > > > Below are my review comments for the PoC patch 0001. > > > > > > In addition, the patch needed rebasing, and, after I rebased

Re: Standardize type of variable when extending Buffers

2023-07-10 Thread Ranier Vilela
Em seg., 10 de jul. de 2023 às 03:27, Kyotaro Horiguchi < horikyota@gmail.com> escreveu: > At Fri, 7 Jul 2023 11:29:16 -0700, Gurjeet Singh wrote > in > > On Fri, Jul 7, 2023 at 6:12 AM Ranier Vilela > wrote: > > > > > > Hi, > > > > > > This has already been discussed in [1]. > > > But I tho

Re: PATCH: Using BRIN indexes for sorted output

2023-07-10 Thread Tomas Vondra
On 7/10/23 12:22, Matthias van de Meent wrote: > On Fri, 7 Jul 2023 at 20:26, Tomas Vondra > wrote: >> >> Hi, >> >> I finally had time to look at this patch again. There's a bit of bitrot, >> so here's a rebased version (no other changes). > > Thanks! > >> On 2/27/23 16:40, Matthias van de M

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

2023-07-10 Thread Ranier Vilela
Hi Alena, Em seg., 10 de jul. de 2023 às 05:38, Alena Rybakina < lena.riback...@yandex.ru> escreveu: > I agreed with the changes. Thank you for your work. > > I updated patch and added you to the authors. > > I specified Ranier Vilela as a reviewer. > Is a good habit when post a new version of th

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

2023-07-10 Thread Ranier Vilela
Em seg., 10 de jul. de 2023 às 09:03, Ranier Vilela escreveu: > Hi Alena, > > Em seg., 10 de jul. de 2023 às 05:38, Alena Rybakina < > lena.riback...@yandex.ru> escreveu: > >> I agreed with the changes. Thank you for your work. >> >> I updated patch and added you to the authors. >> >> I specified

Re: [PATCH] Allow Postgres to pick an unused port to listen

2023-07-10 Thread Daniel Gustafsson
> On 11 May 2023, at 13:24, Yurii Rashkovskii wrote: > > On Thu, May 11, 2023 at 10:36 AM Alvaro Herrera > wrote: > On 2023-May-11, Yurii Rashkovskii wrote: > > > ``` > > 127.0.0.1=5432 ::1=54321 > > ``` > > > > Basically, a space-delimited set of address/port p

Re: HOT readme missing documentation on summarizing index handling

2023-07-10 Thread Aleksander Alekseev
Hi, > > Thanks, pushed after correcting a couple typos. > > Thanks! I noticed that ec99d6e9c87a introduced a slight typo: s/if there is not room/if there is no room -- Best regards, Aleksander Alekseev

Re: ResourceOwner refactoring

2023-07-10 Thread Peter Eisentraut
A few suggestions on the API: > +static ResourceOwnerFuncs tupdesc_resowner_funcs = These aren't all "functions", so maybe another word like "info" or "description" would be more appropriate? > + .release_phase = RESOURCE_RELEASE_AFTER_LOCKS, > + .release_priority = RELEASE_PRIO_TUPDESC_

Re: PATCH: Using BRIN indexes for sorted output

2023-07-10 Thread Matthias van de Meent
On Mon, 10 Jul 2023 at 13:43, Tomas Vondra wrote: > On 7/10/23 12:22, Matthias van de Meent wrote: >> On Fri, 7 Jul 2023 at 20:26, Tomas Vondra >> wrote: >>> However, it's not quite clear to me is what you mean by the weight- and >>> compare-operators? That is, what are >>> >>> - brin_minmax_mi

Re: [PATCH] Slight improvement of worker_spi.c example

2023-07-10 Thread Aleksander Alekseev
Hi, > Have you had a chance to look at these suggestions, and Juliens reply > downthread, in order to produce a new version of the patch? Thanks for the reminder. No I haven't. Please feel free marking this CF entry as RwF if this will be helpful. We may reopen it if and when necessary. -- Best

Re: [PATCH] Slight improvement of worker_spi.c example

2023-07-10 Thread Daniel Gustafsson
> On 10 Jul 2023, at 14:40, Aleksander Alekseev > wrote: >> Have you had a chance to look at these suggestions, and Juliens reply >> downthread, in order to produce a new version of the patch? > > Thanks for the reminder. No I haven't. Please feel free marking this > CF entry as RwF if this wil

Re: doc: clarify the limitation for logical replication when REPILICA IDENTITY is FULL

2023-07-10 Thread Amit Kapila
On Mon, Jul 10, 2023 at 4:33 PM Sergei Kornilov wrote: > > Is this restriction only for the subscriber? > > If we have not changed the replica identity and there is no primary key, then > we forbid update and delete on the publication side (a fairly common usage > error at the beginning of using

Re: [PATCH] Infinite loop while acquiring new TOAST Oid

2023-07-10 Thread Aleksander Alekseev
Hi Nikita, > I've prepared a patch with a 64-bit TOAST Value ID. It is a kind of prototype > and needs some further work, but it is already working and ready to play with. Unfortunately the patch rotted a bit. Could you please submit an updated/rebased patch so that it could be reviewed in the sc

Re: Things I don't like about \du's "Attributes" column

2023-07-10 Thread Pavel Luzanov
On 23.06.2023 03:50, Tom Lane wrote: * On a purely presentation level, how did we possibly arrive at the idea that the connection-limit and valid-until properties deserve their own lines in the Attributes column while the other properties are comma-separated? That makes no sense whatsoever, nor

Re: Performance degradation on concurrent COPY into a single relation in PG16.

2023-07-10 Thread Alvaro Herrera
Hello, On 2023-Jul-03, Masahiko Sawada wrote: > While testing PG16, I observed that in PG16 there is a big performance > degradation in concurrent COPY into a single relation with 2 - 16 > clients in my environment. I've attached a test script that measures > the execution time of COPYing 5GB dat

Re: doc: clarify the limitation for logical replication when REPILICA IDENTITY is FULL

2023-07-10 Thread Sergei Kornilov
>> Is this restriction only for the subscriber? >> >> If we have not changed the replica identity and there is no primary key, >> then we forbid update and delete on the publication side (a fairly common >> usage error at the beginning of using publications). >> If we have replica identity FULL (

Re: Exclusion constraints on partitioned tables

2023-07-10 Thread Peter Eisentraut
On 09.07.23 03:21, Paul A Jungwirth wrote: It seems to me that many of the test cases added in indexing.sql are redundant with create_table.sql/alter_table.sql (or vice versa). Is there a reason for this? Yes, there is some overlap. I think that's just because there was overlap before, and I d

Re: [Patch] Use *other* indexes on the subscriber when REPLICA IDENTITY is FULL

2023-07-10 Thread Önder Kalacı
Hi, I also think so. If this is true, how can we think of supporting > indexes other than hash like GiST, and SP-GiST as mentioned by you in > your latest email? As per my understanding if we don't have PK or > replica identity then after the index scan, we do tuples_equal which > will fail for GI

Re: [PATCH] Reuse Workers and Replication Slots during Logical Replication

2023-07-10 Thread Melih Mutlu
Hi, Amit Kapila , 6 Tem 2023 Per, 06:56 tarihinde şunu yazdı: > > On Wed, Jul 5, 2023 at 1:48 AM Melih Mutlu wrote: > > > > Hayato Kuroda (Fujitsu) , 4 Tem 2023 Sal, > > 08:42 tarihinde şunu yazdı: > > > > > But in the later patch the tablesync worker tries to reuse the slot > > > > > during the

Re: check_strxfrm_bug()

2023-07-10 Thread Peter Eisentraut
On 10.07.23 04:51, Thomas Munro wrote: On Sun, Jul 9, 2023 at 6:35 PM Thomas Munro wrote: On Sun, Jul 9, 2023 at 6:20 PM Peter Eisentraut wrote: So I don't think this code is correct. AFAICT, there is nothing right now that can possibly define HAVE_MBSTOWCS_L on Windows/MSVC. Was that the i

Re: [PATCH] Reuse Workers and Replication Slots during Logical Replication

2023-07-10 Thread Melih Mutlu
Hi, Hayato Kuroda (Fujitsu) , 6 Tem 2023 Per, 12:47 tarihinde şunu yazdı: > > Dear Melih, > > > Thanks for the 0003 patch. But it did not work for me. Can you create > > a subscription successfully with patch 0003 applied? > > I get the following error: " ERROR: table copy could not start > > tra

Re: Changing types of block and chunk sizes in memory contexts

2023-07-10 Thread Melih Mutlu
Hi, Thanks for your comments. Tom Lane , 28 Haz 2023 Çar, 13:59 tarihinde şunu yazdı: > > David Rowley writes: > > Perhaps it's ok to leave the context creation functions with Size > > typed parameters and then just Assert the passed-in sizes are not > > larger than 1GB within the context creati

Re: Reducing connection overhead in pg_upgrade compat check phase

2023-07-10 Thread Daniel Gustafsson
> On 8 Jul 2023, at 23:43, Nathan Bossart wrote: Thanks for reviewing! > Since "script" will be NULL and "db_used" will be false in the first > iteration of the loop, couldn't we move this stuff to before the loop? We could. It's done this way to match how all the other checks are performing t

Re: remaining sql/json patches

2023-07-10 Thread Alvaro Herrera
On 2023-Jul-10, Amit Langote wrote: > > I see that you add json_returning_clause_opt, but we already have > > json_output_clause_opt. Shouldn't these two be one and the same? > > I think the new name is more sensible than the old one, since the > > governing keyword is RETURNING; I suppose naming

Re: Add more sanity checks around callers of changeDependencyFor()

2023-07-10 Thread Tom Lane
Michael Paquier writes: > On Thu, Jul 06, 2023 at 10:09:20AM -0700, Andres Freund wrote: >> I also don't think pg_dump will dump the changed schema, which means a >> dump/restore leads to a different schema - IMO something to avoid. > Yes, you're right here. The function dumped is restored in th

Re: remaining sql/json patches

2023-07-10 Thread Alvaro Herrera
I forgot to add: * 0001 looks an obvious improvement. You could just push it now, to avoid carrying it forward anymore. I would just put the constructName ahead of value expr in the argument list, though. * 0002: I have no idea what this is (though I probably should). I would also push it righ

Re: Add more sanity checks around callers of changeDependencyFor()

2023-07-10 Thread Alvaro Herrera
On 2023-Jul-10, Tom Lane wrote: > Michael Paquier writes: > > On Thu, Jul 06, 2023 at 10:09:20AM -0700, Andres Freund wrote: > >> I also don't think pg_dump will dump the changed schema, which means a > >> dump/restore leads to a different schema - IMO something to avoid. > > > Yes, you're right

Re: Add more sanity checks around callers of changeDependencyFor()

2023-07-10 Thread Tom Lane
Alvaro Herrera writes: > On 2023-Jul-10, Tom Lane wrote: >> The user has altered properties of an extension member >> object locally within the database, but has not changed the extension's >> installation script to match. > If I were developing an extension and decided, down the line, to have >

Re: Exclusion constraints on partitioned tables

2023-07-10 Thread Paul A Jungwirth
On Mon, Jul 10, 2023 at 7:05 AM Peter Eisentraut wrote: > I'm not sure what value we would get from testing this with btree_gist, > but if we wanted to do that, then adding a new test file to the > btree_gist sql/ directory would seem reasonable to me. > > (I would make the test a little bit bigge

Re: Performance degradation on concurrent COPY into a single relation in PG16.

2023-07-10 Thread Andres Freund
Hi, On 2023-07-10 15:25:41 +0200, Alvaro Herrera wrote: > On 2023-Jul-03, Masahiko Sawada wrote: > > > While testing PG16, I observed that in PG16 there is a big performance > > degradation in concurrent COPY into a single relation with 2 - 16 > > clients in my environment. I've attached a test s

Re: Performance degradation on concurrent COPY into a single relation in PG16.

2023-07-10 Thread Andres Freund
Hi, On 2023-07-03 11:55:13 +0900, Masahiko Sawada wrote: > While testing PG16, I observed that in PG16 there is a big performance > degradation in concurrent COPY into a single relation with 2 - 16 > clients in my environment. I've attached a test script that measures > the execution time of COPYi

Re: Performance degradation on concurrent COPY into a single relation in PG16.

2023-07-10 Thread Andres Freund
Hi, On 2023-07-03 11:59:38 +0900, Masahiko Sawada wrote: > On Mon, Jul 3, 2023 at 11:55 AM Masahiko Sawada wrote: > > > > After further investigation, the performance degradation comes from > > calling posix_fallocate() (called via FileFallocate()) and pwritev() > > (called via FileZero) alternat

Re: gcc -Wclobbered in PostgresMain

2023-07-10 Thread Tom Lane
Sergey Shinderuk writes: > On 08.07.2023 18:11, Tom Lane wrote: >> Having done that, it wouldn't really be necessary to mark these >> as volatile. I kept that marking anyway for consistency with >> send_ready_for_query, but perhaps we shouldn't? > I don't know. Maybe marking them volatile is mor

Re: PATCH: Using BRIN indexes for sorted output

2023-07-10 Thread Matthias van de Meent
On Mon, 10 Jul 2023 at 17:09, Tomas Vondra wrote: > On 7/10/23 14:38, Matthias van de Meent wrote: >> Kind of. For single-dimensional opclasses (minmax, minmax_multi) we >> only need to extract the normal min/max values for ASC/DESC sorts, >> which are readily available in the summary. But for mul

Re: Performance degradation on concurrent COPY into a single relation in PG16.

2023-07-10 Thread Andres Freund
Hi, On 2023-07-03 11:53:56 +0200, Jakub Wartak wrote: > Out of curiosity I've tried and it is reproducible as you have stated : XFS > @ 4.18.0-425.10.1.el8_7.x86_64: >... > According to iostat and blktrace -d /dev/sda -o - | blkparse -i - output , > the XFS issues sync writes while ext4 does not,

Re: BUG #18016: REINDEX TABLE failure

2023-07-10 Thread Gurjeet Singh
On Sun, Jul 9, 2023 at 7:21 AM Richard Veselý wrote: > > ... there's no shortage of people that suffer from sluggish > pg_dump/pg_restore cycle and I imagine there are any number of people that > would be interested in improving bulk ingestion which is often a bottleneck > for analytical worklo

Re: UUID v7

2023-07-10 Thread Peter Eisentraut
On 07.07.23 14:06, Andrey M. Borodin wrote: Also, I think we should discuss UUID v8. UUID version 8 provides an RFC-compatible format for experimental or vendor-specific use cases. Revision 1 of IETF draft contained interesting code for v8: almost similar to v7, but with fields for "node ID" an

Re: DecodeInterval fixes

2023-07-10 Thread Reid Thompson
On Sun, 2023-07-09 at 13:24 -0400, Joseph Koshakow wrote: > > I've broken up this patch into three logical commits and attached > them. > None of the actual code has changed. > > Thanks, > Joe Koshakow I made a another pass through the separated patches, it looks good to me. Thanks, Reid

Re: Problems with estimating OR conditions, IS NULL on LEFT JOINs

2023-07-10 Thread Alena Rybakina
Well, I don't have a detailed plan either. In principle it shouldn't be that hard, I think - examine_variable is loading the statistics, so it could apply the same null_frac correction, just like nulltestsel would do a bit later. The main question is how to pass the information to examine_variabl

Re: pg_usleep for multisecond delays

2023-07-10 Thread Nathan Bossart
On Mon, Jul 10, 2023 at 10:12:36AM +0200, Daniel Gustafsson wrote: > Have you had any chance to revisit this such that there is a new patch to > review, or should it be returned/moved for now? Not yet. I moved it to the next commitfest. -- Nathan Bossart Amazon Web Services: https://aws.amazon.

Re: DecodeInterval fixes

2023-07-10 Thread Jacob Champion
On Mon, Jul 10, 2023 at 10:19 AM Reid Thompson wrote: > I made a another pass through the separated patches, it looks good to > me. LGTM too. (Thanks Tom for the clarification on ECPG.) Marked RfC. --Jacob

Re: Should we remove db_user_namespace?

2023-07-10 Thread Nathan Bossart
On Mon, Jul 10, 2023 at 03:43:07PM +0900, Michael Paquier wrote: > Thanks. Reading through the patch, this version should be able to > handle the dump reloads. Thanks for reviewing. I'm currently planning to commit this sometime next week. -- Nathan Bossart Amazon Web Services: https://aws.ama

Re: add non-option reordering to in-tree getopt_long

2023-07-10 Thread Nathan Bossart
On Mon, Jul 10, 2023 at 04:57:11PM +0900, Kyotaro Horiguchi wrote: > + if (!force_nonopt && place[0] == '-' && place[1]) > + { > + if (place[1] != '-' || place[2]) > + break; > + > +

stats test intermittent failure

2023-07-10 Thread Melanie Plageman
Hi, Jeff pointed out that one of the pg_stat_io tests has failed a few times over the past months (here on morepork [1] and more recently here on francolin [2]). Failing test diff for those who prefer not to scroll: +++ /home/bf/bf-build/francolin/HEAD/pgsql.build/testrun/recovery/027_stream_re

Re: pg_column_toast_chunk_id: a function to get a chunk ID of a TOASTed value

2023-07-10 Thread Sergei Kornilov
Hello My +1 to have such a function in core or in some contrib at least (pg_surgery? amcheck?). In the past, more than once I needed to find a damaged tuple knowing only chunk id and toastrelid. This feature would help a lot. regards, Sergei

Re: ResourceOwner refactoring

2023-07-10 Thread Andres Freund
Hi, On 2023-05-25 20:14:23 +0300, Heikki Linnakangas wrote: > @@ -2491,9 +2495,6 @@ BufferSync(int flags) > int mask = BM_DIRTY; > WritebackContext wb_context; > > - /* Make sure we can handle the pin inside SyncOneBuffer */ > - ResourceOwnerEnlargeBuffers(C

Re: ResourceOwner refactoring

2023-07-10 Thread Andres Freund
Hi, On 2023-07-10 12:14:46 -0700, Andres Freund wrote: > > /* > > - * Initially allocated size of a ResourceArray. Must be power of two since > > - * we'll use (arraysize - 1) as mask for hashing. > > + * Size of the fixed-size array to hold most-recently remembered resources. > > */ > > -#def

Re: PATCH: Using BRIN indexes for sorted output

2023-07-10 Thread Tomas Vondra
On 7/10/23 18:18, Matthias van de Meent wrote: > On Mon, 10 Jul 2023 at 17:09, Tomas Vondra > wrote: >> On 7/10/23 14:38, Matthias van de Meent wrote: >>> Kind of. For single-dimensional opclasses (minmax, minmax_multi) we >>> only need to extract the normal min/max values for ASC/DESC sorts, >

Re: add non-option reordering to in-tree getopt_long

2023-07-10 Thread Nathan Bossart
Here's a new version of the patch with the latest feedback addressed. -- Nathan Bossart Amazon Web Services: https://aws.amazon.com >From e662a1b6b73c92ff7862444e092406ed82b0c2c7 Mon Sep 17 00:00:00 2001 From: Nathan Bossart Date: Fri, 7 Jul 2023 20:00:47 -0700 Subject: [PATCH v6 1/1] Teach in-t

Re: Preventing non-superusers from altering session authorization

2023-07-10 Thread Nathan Bossart
On Sun, Jul 09, 2023 at 08:54:30PM -0400, Joseph Koshakow wrote: > I just realized that you moved this comment from > SetSessionAuthorization. I think we should leave the part about setting > the GUC variable is_superuser on top of SetSessionAuthorization since > that's where we actually set the GU

Re: pg_upgrade instructions involving "rsync --size-only" might lead to standby corruption?

2023-07-10 Thread Nikolay Samokhvalov
On Fri, Jul 7, 2023 at 6:31 AM Stephen Frost wrote: > * Nikolay Samokhvalov (n...@postgres.ai) wrote: > > But this can happen with anyone who follows the procedure from the docs > as > > is and doesn't do any additional steps, because in step 9 "Prepare for > > standby server upgrades": > > > > 1

Re: Preventing non-superusers from altering session authorization

2023-07-10 Thread Joseph Koshakow
On Mon, Jul 10, 2023 at 4:32 PM Nathan Bossart wrote: > Okay. Here's a new patch set in which I believe I've addressed all > feedback. I didn't keep the GetAuthenticatedUserIsSuperuser() helper > function around, as I didn't see a strong need for it. Thanks, I think the patch set looks good to

Re: Preventing non-superusers from altering session authorization

2023-07-10 Thread Nathan Bossart
On Mon, Jul 10, 2023 at 04:46:07PM -0400, Joseph Koshakow wrote: > Thanks, I think the patch set looks good to go! Great. I'm going to wait a few more days in case anyone has additional feedback, but otherwise I intend to commit this shortly. -- Nathan Bossart Amazon Web Services: https://aws.a

Re: pg_upgrade instructions involving "rsync --size-only" might lead to standby corruption?

2023-07-10 Thread Michael Banck
Hi, On Mon, Jul 10, 2023 at 01:36:39PM -0700, Nikolay Samokhvalov wrote: > On Fri, Jul 7, 2023 at 6:31 AM Stephen Frost wrote: > > * Nikolay Samokhvalov (n...@postgres.ai) wrote: > > > But this can happen with anyone who follows the procedure from the docs > > as > > > is and doesn't do any addit

Re: Refactoring backend fork+exec code

2023-07-10 Thread Tristan Partin
> From 1d89eec53c7fefa7a4a8c011c9f19e3df64dc436 Mon Sep 17 00:00:00 2001 > From: Heikki Linnakangas > Date: Mon, 12 Jun 2023 16:33:20 +0300 > Subject: [PATCH 4/9] Use FD_CLOEXEC on ListenSockets > @@ -831,7 +834,8 @@ StreamConnection(pgsocket server_fd, Port *port) > void > StreamClose(pgsocket

Re: Allowing parallel-safe initplans

2023-07-10 Thread Tom Lane
I wrote: > Richard Guo writes: >> On Mon, Apr 17, 2023 at 11:04 PM Tom Lane wrote: >>> I wondered about that too, but how come neither of us saw non-cosmetic >>> failures (ie, actual query output changes not just EXPLAIN changes) >>> when we tried this? >> Sorry I forgot to mention that I did se

Re: pg_upgrade instructions involving "rsync --size-only" might lead to standby corruption?

2023-07-10 Thread Nikolay Samokhvalov
On Mon, Jul 10, 2023 at 2:02 PM Michael Banck wrote: > Thanks for that! > Thanks for the fast review. > > > I agree with Andrey – without it, we don't have any good way to upgrade > > large clusters in short time. Default rsync mode (without "--size-only") > > takes a lot of time too, if the l

Re: check_strxfrm_bug()

2023-07-10 Thread Thomas Munro
On Tue, Jul 11, 2023 at 2:28 AM Peter Eisentraut wrote: > This looks sensible to me. > > If we ever need mbstowcs_l() etc. outside of pg_locale.c, then the > proper way would be to make a mbstowcs_l.c file in src/port/. > > But I like your approach for now because it moves us more firmly into > th

Re: Generating code for query jumbling through gen_node_support.pl

2023-07-10 Thread Michael Paquier
On Mon, Jan 30, 2023 at 11:48:45AM +0100, Peter Eisentraut wrote: > On 27.01.23 03:59, Michael Paquier wrote: >> At the end, that would be unnoticeable for the average user, I guess, >> but here are the numbers I get on my laptop :) > > Personally, I think we do not want the two jumble methods in

Re: Refactoring backend fork+exec code

2023-07-10 Thread Andres Freund
Hi, On 2023-06-18 14:22:33 +0300, Heikki Linnakangas wrote: > I started to look at the code in postmaster.c related to launching child > processes. I tried to reduce the difference between EXEC_BACKEND and > !EXEC_BACKEND code paths, and put the code that needs to differ behind a > better abstract

Re: Autogenerate some wait events code and documentation

2023-07-10 Thread Michael Paquier
On Mon, Jul 10, 2023 at 09:11:36AM +0200, Alvaro Herrera wrote: > I don't like this bit, because it means the .txt file is now ungreppable > as source of the enum name. Things become mysterious and people have to > track down the event name by reading the the Perl generating script. > It's annoyin

Re: [PoC] Implementation of distinct in Window Aggregates

2023-07-10 Thread Andreas Karlsson
On 3/12/23 09:17, Ankit Kumar Pandey wrote: Attaching updated patch with a fix for an issue in window function. I have also fixed naming convention of patch as last patch had incompatible name. Hi, This patch does not apply to master. Could you rebase it and submit it as one patch which app

Re: Reducing connection overhead in pg_upgrade compat check phase

2023-07-10 Thread Nathan Bossart
On Mon, Jul 10, 2023 at 04:43:23PM +0200, Daniel Gustafsson wrote: >> On 8 Jul 2023, at 23:43, Nathan Bossart wrote: >> Since "script" will be NULL and "db_used" will be false in the first >> iteration of the loop, couldn't we move this stuff to before the loop? > > We could. It's done this way

Re: sslinfo extension - add notbefore and notafter timestamps

2023-07-10 Thread Cary Huang
> Thanks for the new version! It doesn't fail the ssl tests, but the Kerberos > test now fails. You can see the test reports from the CFBot here: Yes, kerberos tests failed due to the addition of notbefore and notafter values. The values array within "pg_stat_get_activity" function related to

Re: [PoC] Federated Authn/z with OAUTHBEARER

2023-07-10 Thread Jacob Champion
On Fri, Jul 7, 2023 at 2:16 PM Andrey Chudnovsky wrote: > Please confirm my understanding of the flow is correct: > 1. Client calls PQconnectStart. > - The client doesn't know yet what is the issuer and the scope. Right. (Strictly speaking it doesn't even know that OAuth will be used for the co

Re: doc: improve the restriction description of using indexes on REPLICA IDENTITY FULL table.

2023-07-10 Thread Peter Smith
On Mon, Jul 10, 2023 at 2:21 PM Amit Kapila wrote: > > On Mon, Jul 10, 2023 at 7:55 AM Peter Smith wrote: > > > > On Sat, Jul 8, 2023 at 1:49 PM Amit Kapila wrote: > > > > > > On Fri, Jul 7, 2023 at 1:36 PM Masahiko Sawada > > > wrote: > > > > > > > > I prefer the first suggestion. I've attach

Re: Reducing connection overhead in pg_upgrade compat check phase

2023-07-10 Thread Daniel Gustafsson
> On 11 Jul 2023, at 01:09, Nathan Bossart wrote: > On Mon, Jul 10, 2023 at 04:43:23PM +0200, Daniel Gustafsson wrote: >>> +static int n_data_types_usage_checks = 7; >>> >>> Can we determine this programmatically so that folks don't need to remember >>> to update it? >> >> Fair point, I've adde

Re: [PoC] Federated Authn/z with OAUTHBEARER

2023-07-10 Thread Jacob Champion
On Fri, Jul 7, 2023 at 6:01 PM Thomas Munro wrote: > > On Fri, Jul 7, 2023 at 4:57 AM Jacob Champion wrote: > > On Wed, Jul 5, 2023 at 3:07 PM Thomas Munro wrote: > > > BTW I will happily do the epoll->kqueue port work if necessary. > > > > And I will happily take you up on that; thanks! > > Som

Re: Add bump memory context type and use it for tuplesorts

2023-07-10 Thread David Rowley
On Tue, 27 Jun 2023 at 21:19, David Rowley wrote: > I've attached the bump allocator patch and also the script I used to > gather the performance results in the first 2 tabs in the attached > spreadsheet. I've attached a v2 patch which changes the BumpContext a little to remove some of the fields

Re: WAL Insertion Lock Improvements

2023-07-10 Thread Michael Paquier
On Mon, Jun 05, 2023 at 08:00:00AM +0530, Bharath Rupireddy wrote: > On Wed, May 31, 2023 at 5:05 PM Michael Paquier wrote: >> @Andres: Were there any extra tests you wanted to be run for more >> input? > > @Andres Freund please let us know your thoughts. Err, ping. It seems like this thread is

Re: BUG #17946: LC_MONETARY & DO LANGUAGE plperl - BUG

2023-07-10 Thread Tristan Partin
Here is an up to date patch given some churn on the master branch. -- Tristan Partin Neon (https://neon.tech) From b68cec481768c7c635ec48329b4764eced264572 Mon Sep 17 00:00:00 2001 From: Tristan Partin Date: Fri, 30 Jun 2023 09:31:04 -0500 Subject: [PATCH v3 1/3] Skip checking for uselocale on W

Re: Add hint message for check_log_destination()

2023-07-10 Thread Japin Li
On Mon, 10 Jul 2023 at 14:23, Masahiko Sawada wrote: > On Mon, Jul 10, 2023 at 2:07 PM Kyotaro Horiguchi > wrote: >> >> At Mon, 10 Jul 2023 09:04:42 +0800, Japin Li wrote in >> > >> > On Sat, 08 Jul 2023 at 12:48, Michael Paquier wrote: >> > > On Fri, Jul 07, 2023 at 07:23:47PM +0800, Japin L

Re: Add more sanity checks around callers of changeDependencyFor()

2023-07-10 Thread Michael Paquier
On Mon, Jul 10, 2023 at 11:04:48AM -0400, Tom Lane wrote: > ISTR that we discussed forbidding such changes way back when the > extension mechanism was invented, and decided against it on the > grounds that (a) it'd be nanny-ism, (b) we'd have to add checks in an > awful lot of places and it'd be ea

pg16b2: REINDEX segv on null pointer in RemoveFromWaitQueue

2023-07-10 Thread Justin Pryzby
An instance compiled locally, without assertions, failed like this: < 2023-07-09 22:04:46.470 UTC >LOG: process 30002 detected deadlock while waiting for ShareLock on transaction 813219577 after 333.228 ms < 2023-07-09 22:04:46.470 UTC >DETAIL: Process holding the lock: 2103. Wait queue: 300

  1   2   >