Re: 'ERROR: attempted to update invisible tuple' from 'ALTER INDEX ... ATTACH PARTITION' on parent index

2023-07-11 Thread Dilip Kumar
On Wed, Jul 12, 2023 at 11:12 AM Michael Paquier wrote: > > On Wed, Jul 12, 2023 at 09:38:41AM +0900, Michael Paquier wrote: > > While working recently on what has led to cfc43ae and fc55c7f, I > > really got the feeling that there could be some command sequences that > > lacked some CCIs (or Comm

Re: CI and test improvements

2023-07-11 Thread Michael Paquier
On Wed, Jul 12, 2023 at 12:56:17AM -0500, Justin Pryzby wrote: > And, since 681d9e462: > > security is missing from contrib/seg/meson.build Ugh. Good catch! -- Michael signature.asc Description: PGP signature

Re: Use COPY for populating all pgbench tables

2023-07-11 Thread Michael Paquier
On Tue, Jul 11, 2023 at 09:46:43AM -0500, Tristan Partin wrote: > On Tue Jul 11, 2023 at 12:03 AM CDT, Michael Paquier wrote: >> This seems a bit incorrect because partitioning only applies to >> pgbench_accounts, no? This change means that the teller and branch >> tables would not benefit from FR

Re: CI and test improvements

2023-07-11 Thread Justin Pryzby
On Tue, Jan 17, 2023 at 11:35:09AM -0600, Justin Pryzby wrote: > However, this finds two real problems and one false-positive with > missing regress/isolation tests: > > $ for makefile in `find src contrib -name Makefile`; do for testname in `sed > -r '/^(REGRESS|ISOLATION) =/!d; s///; :l; /$

Re: 'ERROR: attempted to update invisible tuple' from 'ALTER INDEX ... ATTACH PARTITION' on parent index

2023-07-11 Thread Michael Paquier
On Wed, Jul 12, 2023 at 09:38:41AM +0900, Michael Paquier wrote: > While working recently on what has led to cfc43ae and fc55c7f, I > really got the feeling that there could be some command sequences that > lacked some CCIs (or CommandCounterIncrement calls) to make sure that > the catalog updates

Re: Cleaning up threading code

2023-07-11 Thread Thomas Munro
On Wed, Jul 12, 2023 at 3:34 PM Thomas Munro wrote: > On Wed, Jul 12, 2023 at 3:21 PM Thomas Munro wrote: > > Apparently "drongo" didn't like something about this commit, and an > > ecpg test failed, but I can't immediately see why. Just "server > > closed the connection unexpectedly". drongo i

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

2023-07-11 Thread Peter Smith
Here are my review comments for the patch v4. == General 1. FYI, this patch also needs some minor PG docs updates [1] because section "31.1 Publication" currently refers to only btree - e.g. "Candidate indexes must be btree, non-partial, and have..." (this may also clash with Sawada-san's ot

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

2023-07-11 Thread Amit Kapila
On Wed, Jul 12, 2023 at 8:37 AM Hayato Kuroda (Fujitsu) wrote: > > > 10. > > + /* Check whether the index is supported or not */ > > + is_suitable_type = ((get_equal_strategy_number_for_am(indexInfo->ii_Am) > > + != InvalidStrategy)); > > + > > + is_partial = (indexInfo->ii_Predicate != NIL); > >

Re: Cleaning up threading code

2023-07-11 Thread Thomas Munro
On Wed, Jul 12, 2023 at 3:21 PM Thomas Munro wrote: > Apparently "drongo" didn't like something about this commit, and an > ecpg test failed, but I can't immediately see why. Just "server > closed the connection unexpectedly". drongo is running the new Meson > buildfarm variant on Windows+MSVC,

Re: Cleaning up threading code

2023-07-11 Thread Thomas Munro
Apparently "drongo" didn't like something about this commit, and an ecpg test failed, but I can't immediately see why. Just "server closed the connection unexpectedly". drongo is running the new Meson buildfarm variant on Windows+MSVC, so, being still in development, I wonder if some diagnostic c

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

2023-07-11 Thread Hayato Kuroda (Fujitsu)
Dear Peter, Thank you for reviewing! PSA new version. > 1. > 89e46d allowed using indexes other than PRIMARY KEY or REPLICA IDENTITY > on the > subscriber, but only the BTree index could be used. This commit extends the > limitation, now the Hash index can be also used. > > ~ > > Before giving

Re: COPY table FROM STDIN via SPI

2023-07-11 Thread James Sewell
> > No. It'd be a wire protocol break, and even if it weren't I would not > expect many clients to be able to deal with it. They're in the middle > of a query cycle (for the SELECT or CALL that got you into SPI), and > suddenly the backend asks for COPY data? What are they supposed to > send, or

Re: unrecognized node type while displaying a Path due to dangling pointer

2023-07-11 Thread David Rowley
On Wed, 12 Jul 2023 at 14:23, Tom Lane wrote: > I did think about that, but "shallow copy a Path" seems nontrivial > because the Path structs are all different sizes. Maybe it is worth > building some infrastructure to support that? It seems a reasonable thing to have to do. It seems the minimu

Re: Forgive trailing semicolons inside of config files

2023-07-11 Thread Tom Lane
Andres Freund writes: > Looks like we could make this easier in core postgres by adding one more > sd_notify() call, with something like > STATUS=reload failed due to syntax error in file > "/srv/dev/pgdev-dev/postgresql.conf" line 821, near end of line Seems reasonable to investigate. The syst

Re: Forgive trailing semicolons inside of config files

2023-07-11 Thread Andres Freund
Hi, On 2023-07-11 12:21:46 -0400, Greg Sabino Mullane wrote: > On Tue, Jul 11, 2023 at 11:04 AM Isaac Morland > > Or maybe there could be a "check configuration" subcommand which checks > > the configuration. > > > > There are things inside of Postgres once it has started, but yeah, > something a

Re: unrecognized node type while displaying a Path due to dangling pointer

2023-07-11 Thread Tom Lane
David Rowley writes: > I've not taken the time to fully understand this, but from reading the > thread, I'm not immediately understanding why we can't just shallow > copy the Path from the other RelOptInfo and replace the parent before > using it in the upper RelOptInfo. Can you explain? I did t

Re: DROP DATABASE is interruptible

2023-07-11 Thread Andres Freund
Hi, On 2023-07-07 14:09:08 +0200, Daniel Gustafsson wrote: > > On 25 Jun 2023, at 19:03, Andres Freund wrote: > > On 2023-06-21 12:02:04 -0700, Andres Freund wrote: > >> I'm hacking on this bugfix again, > > This patch LGTM from reading through and testing (manually and with your > supplied tests

Re: MERGE ... RETURNING

2023-07-11 Thread Vik Fearing
On 7/12/23 02:43, Jeff Davis wrote: On Sun, 2023-01-22 at 19:58 +0100, Alvaro Herrera wrote: (We do have to keep our fingers crossed that they will decide to use the same RETURNING syntax as we do in this patch, of course.) Do we have a reason to think that they will accept something similar?

Re: [PoC] Federated Authn/z with OAUTHBEARER

2023-07-11 Thread Thomas Munro
On Wed, Jul 12, 2023 at 5:50 AM Jacob Champion wrote: > Oh, whoops, it's just the missed CLOEXEC flag in the final patch. (If > the write side of the pipe gets copied around, it hangs open and the > validator never sees the "end" of the token.) I'll switch the logic > around to set the flag on the

Re: MERGE ... RETURNING

2023-07-11 Thread Jeff Davis
On Sun, 2023-01-22 at 19:58 +0100, Alvaro Herrera wrote: > > (We do have to keep our fingers > crossed that they will decide to use the same RETURNING syntax as we > do > in this patch, of course.) Do we have a reason to think that they will accept something similar? Regards, Jeff Davis

Re: 'ERROR: attempted to update invisible tuple' from 'ALTER INDEX ... ATTACH PARTITION' on parent index

2023-07-11 Thread Michael Paquier
On Tue, Jul 11, 2023 at 10:52:16PM +0530, Shruthi Gowda wrote: > While testing some use cases, I encountered 'ERROR: attempted to update > invisible tuple' when a partitioned index is attached to a parent index > which is also a replica identity index. > Below is the reproducible test case. The is

Re: Support to define custom wait events for extensions

2023-07-11 Thread Andres Freund
Hi, On 2023-07-11 16:45:26 +0900, Michael Paquier wrote: > +/* -- > + * Wait Events - Extension > + * > + * Use this category when the server process is waiting for some condition > + * defined by an extension module. > + * > + * Extensions can define custom wait events. First, call > + *

Re: unrecognized node type while displaying a Path due to dangling pointer

2023-07-11 Thread David Rowley
On Wed, 12 Jul 2023 at 08:46, Tom Lane wrote: > A low-cost fix perhaps could be to unlink the lower rel's whole > path list (set input_rel->pathlist = NIL, also zero the related > fields such as cheapest_path) once we've finished selecting the > paths we want for the upper rel. That's not great f

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

2023-07-11 Thread Peter Smith
Hi, here are some review comments for the v3 patch == Commit message 1. 89e46d allowed using indexes other than PRIMARY KEY or REPLICA IDENTITY on the subscriber, but only the BTree index could be used. This commit extends the limitation, now the Hash index can be also used. ~ Before giving

Re: Reducing connection overhead in pg_upgrade compat check phase

2023-07-11 Thread Nathan Bossart
On Wed, Jul 12, 2023 at 12:43:14AM +0200, Daniel Gustafsson wrote: > I did have coffee before now, but only found time to actually address this now > so here is a v7 with just that change and a fresh rebase. Thanks. I think the patch is in decent shape. -- Nathan Bossart Amazon Web Services: ht

Re: Support to define custom wait events for extensions

2023-07-11 Thread Michael Paquier
On Tue, Jul 11, 2023 at 12:39:52PM -0500, Tristan Partin wrote: > Given the context of our last conversation, I assume this code was > copied from somewhere else. Since this is new code, I think it would > make more sense if newalloc was a uint16 or size_t. This style comes from LWLockRegisterTran

Re: Cleaning up threading code

2023-07-11 Thread Andres Freund
On 2023-07-12 08:58:29 +1200, Thomas Munro wrote: > On Mon, Jul 10, 2023 at 10:45 AM Thomas Munro wrote: > > * defined ENABLE_THREAD_SAFETY 1 in c.h, for the benefit of extensions > > I may lack imagination but I couldn't think of any use for that > vestigial macro in backend/extension code, and

Re: Avoid unused value (src/fe_utils/print.c)

2023-07-11 Thread Ranier Vilela
Em ter., 11 de jul. de 2023 às 19:34, Marko Tiikkaja escreveu: > On Thu, Jul 6, 2023 at 5:37 PM Karina Litskevich > wrote: > > My point is, technically right now you won't see any difference in output > > if you remove the line. Because if we get to that line the need_recordsep > > is already tr

Re: Reducing connection overhead in pg_upgrade compat check phase

2023-07-11 Thread Daniel Gustafsson
> On 11 Jul 2023, at 01:26, Daniel Gustafsson wrote: >> On 11 Jul 2023, at 01:09, Nathan Bossart wrote: >> I think we need to tmp++ somewhere here. > > Yuk, yes, will fix when caffeinated. Thanks. I did have coffee before now, but only found time to actually address this now so here is a v7 wi

Re: Avoid unused value (src/fe_utils/print.c)

2023-07-11 Thread Marko Tiikkaja
On Thu, Jul 6, 2023 at 5:37 PM Karina Litskevich wrote: > My point is, technically right now you won't see any difference in output > if you remove the line. Because if we get to that line the need_recordsep > is already true. However, understanding why it is true is complicated. That's > why if y

Re: Parallel CREATE INDEX for BRIN indexes

2023-07-11 Thread Matthias van de Meent
On Thu, 6 Jul 2023 at 16:13, Tomas Vondra wrote: > > On 7/5/23 16:33, Matthias van de Meent wrote: > > ... > > > >> Maybe. I wasn't that familiar with what parallel tuplesort can and can't > >> do, and the little I knew I managed to forget since I wrote this patch. > >> Which similar features do y

Re: Cleaning up threading code

2023-07-11 Thread Thomas Munro
On Mon, Jul 10, 2023 at 10:45 AM Thomas Munro wrote: > * defined ENABLE_THREAD_SAFETY 1 in c.h, for the benefit of extensions I may lack imagination but I couldn't think of any use for that vestigial macro in backend/extension code, and client code doesn't see c.h and might not get the right answ

Re: MERGE ... RETURNING

2023-07-11 Thread Gurjeet Singh
On Tue, Jul 11, 2023 at 1:43 PM Gurjeet Singh wrote: > > In the above hunk, if there's an exception/ERROR, I believe we should > PG_RE_THROW(). If there's a reason to continue, we should at least set > rslot = NULL, otherwise we may be returning an uninitialized value to > the caller. Excuse the

Re: Extensible storage manager API - SMGR hook Redux

2023-07-11 Thread Tristan Partin
> Subject: [PATCH v1 1/2] Expose f_smgr to extensions for manual implementation >From what I can see, all the md* APIs that were exposed in md.h can now be made static in md.c. The only other references to those APIs were in smgr.c. > Subject: [PATCH v1 2/2] Prototype: Allow tablespaces to specif

Re: unrecognized node type while displaying a Path due to dangling pointer

2023-07-11 Thread Tom Lane
So what's going on here is that create_ordered_paths() does this: foreach(lc, input_rel->pathlist) { Path *input_path = (Path *) lfirst(lc); if (/* input path is suitably sorted already */) sorted_path = input_path; else /* build a sor

Re: MERGE ... RETURNING

2023-07-11 Thread Gurjeet Singh
On Fri, Jul 7, 2023 at 3:48 PM Dean Rasheed wrote: > > On Thu, 6 Jul 2023 at 06:13, Gurjeet Singh wrote: > > > > > One minor annoyance is that, due to the way that pg_merge_action() and > > > pg_merge_when_clause() require access to the MergeActionState, they > > > only work if they appear direct

Re: Document that server will start even if it's unable to open some TCP/IP ports

2023-07-11 Thread Gurjeet Singh
On Mon, Jun 19, 2023 at 5:48 PM Bruce Momjian wrote: > > On Tue, Jun 13, 2023 at 11:11:04PM -0400, Tom Lane wrote: > > > > There is certainly an argument that such a condition indicates that > > something's very broken in our configuration and we should complain. > > But I'm not sure how exciting

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

2023-07-11 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: tablecmds.c/MergeAttributes() cleanup

2023-07-11 Thread Alvaro Herrera
On 2023-Jun-28, Peter Eisentraut wrote: > The MergeAttributes() and related code in and around tablecmds.c is huge and > ancient, with many things bolted on over time, and difficult to deal with. > I took some time to make careful incremental updates and refactorings to > make the code easier to f

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

2023-07-11 Thread Alena Rybakina
Hi! On 11.07.2023 11:47, Andrey Lepikhov wrote: This patch looks much better than earlier. But it definitely needs some covering with tests. As a first simple approximation, here you can see the result of regression tests, where the transformation limit is set to 0. See in the attachment some

Re: stats test intermittent failure

2023-07-11 Thread Alexander Lakhin
Hi Melanie, 10.07.2023 21:35, Melanie Plageman wrote: 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/

Re: [PoC] Federated Authn/z with OAUTHBEARER

2023-07-11 Thread Jacob Champion
On Mon, Jul 10, 2023 at 4:50 PM Jacob Champion wrote: > I don't understand why the > server-side tests are failing on FreeBSD, but they shouldn't be using > the libpq code at all, so I think your kqueue implementation is in the > clear. Oh, whoops, it's just the missed CLOEXEC flag in the final p

Re: Support to define custom wait events for extensions

2023-07-11 Thread Tristan Partin
> From bf06b8100cb747031959fe81a2d19baabc4838cf Mon Sep 17 00:00:00 2001 > From: Masahiro Ikeda > Date: Fri, 16 Jun 2023 11:53:29 +0900 > Subject: [PATCH 1/2] Support custom wait events for extensions. > + * This is indexed by event ID minus NUM_BUILTIN_WAIT_EVENT_EXTENSION, and > + * stores the

Issue in _bt_getrootheight

2023-07-11 Thread Ahmed Ibrahim
Hi everyone, We have been working on the pg_adviser extension whose goal is to suggest indexes by creating virtual/hypothetical indexes and see how it affects the query cost. The hypothetical index shouldn't take any space on the disk (allocates 0 pages)

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

2023-07-11 Thread Nathan Bossart
On Tue, Jul 11, 2023 at 04:16:09PM +0900, Kyotaro Horiguchi wrote: > I like it. We don't need to overcomplicate things just for the sake of > speed here. Plus, this version looks the most simple to me. That being > said, it might be better if the last term is positioned in the second > place. This

Re: Forgive trailing semicolons inside of config files

2023-07-11 Thread Greg Sabino Mullane
On Tue, Jul 11, 2023 at 11:04 AM Isaac Morland wrote: > Please, no! > > There is no end to accepting sloppy syntax. What next, allow "SET > random_page_cost = 2.5;" (with or without semicolon) in config files? > Well yes, there is an end. A single, trailing semicolon. Full stop. It's not a slipp

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

2023-07-11 Thread Andres Freund
Hi, On 2023-07-11 09:09:43 +0200, Jakub Wartak wrote: > On Mon, Jul 10, 2023 at 6:24 PM Andres Freund wrote: > > > > 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

Re: Forgive trailing semicolons inside of config files

2023-07-11 Thread Tom Lane
Isaac Morland writes: > On Tue, 11 Jul 2023 at 10:43, Greg Sabino Mullane >> # Add settings for extensions here >> random_page_cost = 2.5; >> >> Boom! Server will not start. Surely, we can be a little more liberal in >> what we accept? Attached patch allows a single trailing semicolon to be >> si

Re: Latches vs lwlock contention

2023-07-11 Thread Aleksander Alekseev
Hi, > Maybe this is all ok, but it would be good to make the assumptions more > explicit. Here are my two cents. ``` static void SetLatchV(Latch **latches, int nlatches) { /* Flush any other changes out to main memory just once. */ pg_memory_barrier(); /* Keep only latches that are

Re: Forgive trailing semicolons inside of config files

2023-07-11 Thread Isaac Morland
On Tue, 11 Jul 2023 at 10:43, Greg Sabino Mullane wrote: > This has been a long-standing annoyance of mine. Who hasn't done something > like this?: > > psql> SET random_page_cost = 2.5; > (do some stuff, realize that rpc was too high) > > Let's put that inside of postgresql.conf: > > > #-

Re: pg_decode_message vs skip_empty_xacts and xact_wrote_changes

2023-07-11 Thread Ashutosh Bapat
On Tue, Jul 11, 2023 at 5:59 PM Amit Kapila wrote: > > > > I have pushed this work. But feel free to propose further > improvements, if you have any better ideas. > Thanks. We have fixed the problem. So things are better than they were. I have been busy with something else so couldn't reply. -

Re: Make pgbench exit on SIGINT more reliably

2023-07-11 Thread Tristan Partin
On Mon Jul 10, 2023 at 10:29 PM CDT, Michael Paquier wrote: > On Tue, Jun 27, 2023 at 09:42:05AM -0500, Tristan Partin wrote: > > I would say there probably isn't much benefit if you think the polling > > for CancelRequested is fine. Looking at the other patch, I think it > > might be simple to add

Re: Use COPY for populating all pgbench tables

2023-07-11 Thread Tristan Partin
On Tue Jul 11, 2023 at 12:03 AM CDT, Michael Paquier wrote: > On Wed, Jun 14, 2023 at 10:58:06AM -0500, Tristan Partin wrote: > static void > -initGenerateDataClientSide(PGconn *con) > +initBranch(PGconn *con, PQExpBufferData *sql, int64 curr) > +{ > + /* "filler" column defaults to NULL */

Forgive trailing semicolons inside of config files

2023-07-11 Thread Greg Sabino Mullane
This has been a long-standing annoyance of mine. Who hasn't done something like this?: psql> SET random_page_cost = 2.5; (do some stuff, realize that rpc was too high) Let's put that inside of postgresql.conf: #-- # CUST

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

2023-07-11 Thread Alena Rybakina
On 11.07.2023 16:29, Ranier Vilela wrote: Em ter., 11 de jul. de 2023 às 09:29, Alena Rybakina escreveu: Hi! On 10.07.2023 15:15, Ranier Vilela wrote: Em seg., 10 de jul. de 2023 às 09:03, Ranier Vilela escreveu: Hi Alena, Em seg., 10 de jul. de 2023 às 05:

Re: [Question] Can someone provide some links related to the MemoryContext?

2023-07-11 Thread Matthias van de Meent
On Tue, 11 Jul 2023 at 15:11, Wen Yi wrote: > > Hi hackers, > I am learning the MemoryContext subsystem, but I really don't know where to > find it's document (The PostgreSQL Document just provide some spi function). > Can someone provide me some solutions? > Thanks in advance! You should take

Re: [PATCH]Add a tip to the check mode

2023-07-11 Thread Matthias van de Meent
On Tue, 11 Jul 2023 at 15:11, Wen Yi wrote: > > Hi community, > when I learn the source of PostgreSQL, I think it's better to add a tip to > the postgres "check mode", this can help the postgres's user when they check > the postgres's data directory. > > src/backend/bootstrap/bootstrap.c > > if

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

2023-07-11 Thread Ranier Vilela
Em ter., 11 de jul. de 2023 às 09:29, Alena Rybakina < lena.riback...@yandex.ru> escreveu: > Hi! > On 10.07.2023 15:15, Ranier Vilela wrote: > > 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.riba

RE: BUG #18016: REINDEX TABLE failure

2023-07-11 Thread Richard Veselý
Hi Gurjeet, Thank you for the follow-up. I was worried my message got buried in the middle of the thread. I also appreciate your work on the patch to fix/improve the REINDEX TABLE behavior even though most people would never encounter it in the wild. As a preface I would first like to say that

[PATCH]Add a tip to the check mode

2023-07-11 Thread Wen Yi
Hi community, when I learn the source of PostgreSQL, I think it's better to add a tip to the postgres "check mode", this can help the postgres's user when they check the postgres's data directory. src/backend/bootstrap/bootstrap.c if (check_only)     {    SetProcessingMode(NormalProces

Got FATAL in lock_twophase_recover() during recovery

2023-07-11 Thread suyu.cmj
Hi, all. I want to report a bug about the recovery of two-phase transaction, in current implementation of crash recovery, there are two ways to recover 2pc data: 1、before redo, func restoreTwoPhaseData() will restore 2pc data those xid < ShmemVariableCache->nextXid, which is initialized from chec

Re: BUG #18016: REINDEX TABLE failure

2023-07-11 Thread Gurjeet Singh
On Sun, Jul 9, 2023 at 7:18 AM Tom Lane wrote: > > Michael Paquier writes: > > That should be OK, I assume. However, if this is improved and > > something we want to support in the long-run I guess that a TAP test > > may be appropriate. > > I do not see the point of a TAP test. It's not like t

[Question] Can someone provide some links related to the MemoryContext?

2023-07-11 Thread Wen Yi
Hi hackers, I am learning the MemoryContext subsystem,  but I really don't know where to find it's document (The PostgreSQL Document just provide some spi function). Can someone provide me some solutions? Thanks in advance! Yours, Wen Yi

Re: Extension Enhancement: Buffer Invalidation in pg_buffercache

2023-07-11 Thread Palak Chaturvedi
Can you please review the new patch of the extension with implemented force variable. On Tue, 11 Jul 2023 at 18:08, Palak Chaturvedi wrote: > > Hey Nitin, > >Will > >there be a scenario where the buffer is dirty and its reference count > >is zero? > There might be a buffer that has been dirtied b

Re: Extension Enhancement: Buffer Invalidation in pg_buffercache

2023-07-11 Thread Palak Chaturvedi
Hey Nitin, >Will >there be a scenario where the buffer is dirty and its reference count >is zero? There might be a buffer that has been dirtied but is not pinned or being used currently by a process. So checking the refcount and then dirty buffers helps. >First, The TryInvalidateBuffer() tries to f

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

2023-07-11 Thread Alena Rybakina
Hi! On 10.07.2023 15:15, Ranier Vilela wrote: 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 escreveu: I agreed with the changes. Thank you for your work. I updated patch and added yo

Re: pg_decode_message vs skip_empty_xacts and xact_wrote_changes

2023-07-11 Thread Amit Kapila
On Thu, Jul 6, 2023 at 2:06 PM Amit Kapila wrote: > > On Wed, Jul 5, 2023 at 7:20 PM Ashutosh Bapat > wrote: > > > > On Wed, Jul 5, 2023 at 2:29 PM Amit Kapila wrote: > > > > > > On Wed, Jul 5, 2023 at 2:28 PM Amit Kapila > > > wrote: > > > > > > > > On Mon, Jul 3, 2023 at 4:49 PM vignesh C w

Re: A minor adjustment to get_cheapest_path_for_pathkeys

2023-07-11 Thread Aleksander Alekseev
Hi, > The check for parallel_safe should be even cheaper than cost comparison > so I think it's better to do that first. The attached patch does this > and also updates the comment to mention the requirement about being > parallel-safe. The patch was marked as "Needs review" so I decided to take

Re: unrecognized node type while displaying a Path due to dangling pointer

2023-07-11 Thread Jeevan Chalke
Hi Tom, On Tue, Jul 11, 2023 at 4:30 PM Tom Lane wrote: > Jeevan Chalke writes: > > Attached patch. > > I would be astonished if this fixes anything. The code still doesn't > know which paths are referenced by which other ones, and so the place > where we free a previously-added path can't kno

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

2023-07-11 Thread Nikita Malakhov
Hi! Aleksander, thank you for reminding me of this patch, try to do it in a few days. -- Regards, Nikita Malakhov Postgres Professional The Russian Postgres Company https://postgrespro.ru/

Re: SLRUs in the main buffer pool, redux

2023-07-11 Thread Aleksander Alekseev
Hi, > > Here's a rebased set of patches. > > > > The second patch is failing the pg_upgrade tests. Before I dig into > > that, I'd love to get some feedback on this general approach. > > Forgot to include the new "slrulist.h" file in the previous patch, fixed > here. Unfortunately the patchset ro

Re: PATCH: Using BRIN indexes for sorted output

2023-07-11 Thread Matthias van de Meent
On Mon, 10 Jul 2023 at 22:04, Tomas Vondra wrote: > 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: > I haven't really thought about geometric types, just about minmax and > minmax-mu

Re: unrecognized node type while displaying a Path due to dangling pointer

2023-07-11 Thread Tom Lane
Jeevan Chalke writes: > Attached patch. I would be astonished if this fixes anything. The code still doesn't know which paths are referenced by which other ones, and so the place where we free a previously-added path can't know what to do. I've speculated about adding some form of reference cou

Re: COPY table FROM STDIN via SPI

2023-07-11 Thread Tom Lane
James Sewell writes: > Is $subject possible? No. It'd be a wire protocol break, and even if it weren't I would not expect many clients to be able to deal with it. They're in the middle of a query cycle (for the SELECT or CALL that got you into SPI), and suddenly the backend asks for COPY data?

COPY table FROM STDIN via SPI

2023-07-11 Thread James Sewell
Is $subject possible? I feel like maybe the answer is no, but then I can also see some backend code for similar things in copy.h. Perhaps it’s possible via a function call not sending the SQL? - James

Re: logicalrep_message_type throws an error

2023-07-11 Thread Alvaro Herrera
On 2023-Jul-11, Masahiko Sawada wrote: > Since the numerical value is important only in invalid message type > cases, how about using a format like "??? (88)" in unknown message > type cases, in both error and context messages? +1 -- Álvaro Herrera 48°01'N 7°57'E — https://www.E

Re: unrecognized node type while displaying a Path due to dangling pointer

2023-07-11 Thread Jeevan Chalke
On Tue, Jul 11, 2023 at 2:58 PM Jeevan Chalke < jeevan.cha...@enterprisedb.com> wrote: > > > On Tue, Jul 11, 2023 at 1:19 PM Alvaro Herrera > wrote: > >> On 2023-Jul-11, Jeevan Chalke wrote: >> >> > 4. However, 2nd path was already sorted and passed as is to the >> add_path(). >> > 5. add_path()

Re: unrecognized node type while displaying a Path due to dangling pointer

2023-07-11 Thread Jeevan Chalke
On Tue, Jul 11, 2023 at 1:19 PM Alvaro Herrera wrote: > On 2023-Jul-11, Jeevan Chalke wrote: > > > 4. However, 2nd path was already sorted and passed as is to the > add_path(). > > 5. add_path() decides to reject this new path on some metrics. However, > in > > the end, it pfree() this passed in

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

2023-07-11 Thread Andrey Lepikhov
On 10/7/2023 15:38, Alena Rybakina wrote: 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. This patch looks much better than earlier. But it definitely needs some covering with tests. As a first simple ap

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

2023-07-11 Thread Sergei Kornilov
Hello I think it's appropriate to add on the restrictions page. (But mentioning that this restriction is only for subscriber) If the list were larger, then the restrictions page could be divided into publisher and subscriber restrictions. But not for one very specific restriction. regards, Se

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

2023-07-11 Thread Peter Smith
Here are my comments for v4. == Docs/Comments: All the docs and updated comments LTGM, except I felt one sentence might be written differently to avoid nested parentheses. BEFORE ...used for REPLICA IDENTITY FULL table (see FindUsableIndexForReplicaIdentityFull() for details). AFTER ...use

Re: logicalrep_message_type throws an error

2023-07-11 Thread Masahiko Sawada
On Thu, Jul 6, 2023 at 6:28 PM Amit Kapila wrote: > > One point to note is that the user may also get confused if the actual > ERROR says message type as 'X' and the context says '???'. I feel in > this case duplicate information is better than different information. I agree. I think it would be

Re: unrecognized node type while displaying a Path due to dangling pointer

2023-07-11 Thread Alvaro Herrera
On 2023-Jul-11, Jeevan Chalke wrote: > 4. However, 2nd path was already sorted and passed as is to the add_path(). > 5. add_path() decides to reject this new path on some metrics. However, in > the end, it pfree() this passed in path. It seems wrong as its references > do present elsewhere. For ex

Re: Support to define custom wait events for extensions

2023-07-11 Thread Michael Paquier
On Fri, Jun 23, 2023 at 05:56:26PM +0900, Masahiro Ikeda wrote: > I updated the patches to handle the warning mentioned > by PostgreSQL Patch Tester, and removed unnecessary spaces. I have begun hacking on that, and the API layer inspired from the LWLocks is sound. I have been playing with it in

Re: logical decoding and replication of sequences, take 2

2023-07-11 Thread Amit Kapila
On Tue, Jun 27, 2023 at 11:30 AM Ashutosh Bapat wrote: > > I have not looked at the DDL replication patch in detail so I may be > missing something. IIUC, that patch replicates the DDL statement in > some form: parse tree or statement. But it doesn't replicate the some > or all WAL records that th

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

2023-07-11 Thread Amit Kapila
On Tue, Jul 11, 2023 at 12:30 PM Hayato Kuroda (Fujitsu) wrote: > > Dear Amit, > > > Isn't the same true for the hash operator class family as well? > > True. I didn't write it on purpose because I didn't know the operator which is > operator class for BTree but not for Hash. But I agreed to clari

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

2023-07-11 Thread Hayato Kuroda (Fujitsu)
Dear Amit, > After seeing this, I am thinking about whether we add this restriction > on the Subscription page [1] or Restrictions page [2] as proposed. Do > you others have any preference? > > [1] - > https://www.postgresql.org/docs/devel/logical-replication-subscription.html > [2] - > https://w

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

2023-07-11 Thread Kyotaro Horiguchi
At Mon, 10 Jul 2023 13:06:58 -0700, Nathan Bossart wrote in > Here's a new version of the patch with the latest feedback addressed. Thanks! +* An argument is a non-option if it meets any of the following +* criteria: it follows an argument that is equivalent to

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

2023-07-11 Thread Jakub Wartak
On Mon, Jul 10, 2023 at 6:24 PM Andres Freund wrote: > > 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 - | blkp

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

2023-07-11 Thread Hayato Kuroda (Fujitsu)
Dear Sergei, Thank you for giving comment! The restriction is only for subscriber: the publisher can publish the changes to downstream under the condition, but the subscriber cannot apply that. > So, I suggest to mention subscriber explicitly: > > + class of Btree, then UPDATE and > DELETE

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

2023-07-11 Thread Hayato Kuroda (Fujitsu)
Dear Amit, > Isn't the same true for the hash operator class family as well? True. I didn't write it on purpose because I didn't know the operator which is operator class for BTree but not for Hash. But I agreed to clarify it. > Can we > slightly change the line as: "... the table includes an a