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

2023-07-12 Thread Michael Paquier
On Wed, Jul 12, 2023 at 08:49:03PM -0700, Nathan Bossart wrote: > After a couple more small edits, I've committed this. I looked through all > uses of getopt_long() in PostgreSQL earlier today, and of the programs that > accepted non-options, most accepted only one, some others accepted 2-3, and

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

2023-07-12 Thread Michael Paquier
On Thu, Jul 13, 2023 at 09:35:17AM +0530, Dilip Kumar wrote: > Yeah, It seems that using pg_index tuples from relcache is not safe, > at least for updating the catalog tuples. However, are there known > rules or do we need to add some comments saying that the pg_index > tuple from the relcache

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

2023-07-12 Thread Masahiko Sawada
On Wed, Jul 12, 2023 at 11:15 PM Masahiko Sawada wrote: > > On Wed, Jul 12, 2023 at 7:08 PM Amit Kapila wrote: > > > > On Wed, Jul 12, 2023 at 12:31 PM Masahiko Sawada > > wrote: > > > > > > On Tue, Jul 11, 2023 at 5:31 PM Peter Smith wrote: > > > > > > > > > > I don't think we have concluded

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

2023-07-12 Thread David Rowley
On Tue, 11 Jul 2023 at 02:41, Melih Mutlu wrote: > > - Afaics AllocSet->keeper is unnecessary these days, as it is always > > allocated > > together with the context itself. Saves 8 bytes. > > This seemed like a safe change and removed the keeper field in > AllocSet and Generation contexts. It

Configurable FP_LOCK_SLOTS_PER_BACKEND

2023-07-12 Thread Nikolay Samokhvalov
We're observing a few cases with lockmanager spikes in a few quite loaded systems. These cases are different; queries are different, Postgres versions are 12, 13, and 14. But in all cases, servers are quite beefy (96-128 vCPUs, ~600-800 GiB) receiving a lot of TPS (a few dozens of thousands).

Re: Consistent coding for the naming of LR workers

2023-07-12 Thread Peter Smith
On Wed, Jul 12, 2023 at 9:35 PM Peter Eisentraut wrote: > > On 21.06.23 09:18, Alvaro Herrera wrote: > > That is a terrible pattern in relatively new code. Let's get rid of it > > entirely rather than continue to propagate it. > > > >> So, I don't think it is fair to say that these format

Re: [PoC] Federated Authn/z with OAUTHBEARER

2023-07-12 Thread Andrey Chudnovsky
> > - Parameters are strings, so callback is not provided yet. > > 2. Client gets PgConn from PQconnectStart return value and updates > > conn->async_auth to its own callback. > > This is where some sort of official authn callback registration (see > above reply to Daniele) would probably come

Re: Preventing non-superusers from altering session authorization

2023-07-12 Thread Nathan Bossart
On Mon, Jul 10, 2023 at 01:49:55PM -0700, Nathan Bossart wrote: > Great. I'm going to wait a few more days in case anyone has additional > feedback, but otherwise I intend to commit this shortly. I've committed 0001 for now. I'm hoping to commit the other two patches within the next couple of

Re: numeric datatype for current release not available

2023-07-12 Thread Ashutosh Bapat
On Wed, Jul 12, 2023 at 8:55 PM Julien Rouhaud wrote: > > it's working here. probably a transient error, it happens from time to time. Thanks Julien for looking into it. It's working now. -- Best Wishes, Ashutosh Bapat

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

2023-07-12 Thread Hayato Kuroda (Fujitsu)
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 > > > transaction on publisher: another command is already in progress". > > > >

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

2023-07-12 Thread Dilip Kumar
On Thu, Jul 13, 2023 at 3:56 AM Michael Paquier wrote: > > On Wed, Jul 12, 2023 at 04:02:23PM -0400, Robert Haas wrote: > > Oh, interesting. The fact that indisreplident isn't copied seems like > > a pretty clear mistake, but I'm guessing that the fact that t_self > > wasn't refreshed was

Re: Use COPY for populating all pgbench tables

2023-07-12 Thread Michael Paquier
On Wed, Jul 12, 2023 at 09:29:35AM -0500, Tristan Partin wrote: > On Wed Jul 12, 2023 at 1:06 AM CDT, Michael Paquier wrote: >> This would use the freeze option only on pgbench_accounts when no >> partitioning is defined, but my point was a bit different. We could >> use the FREEZE option on the

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

2023-07-12 Thread Nathan Bossart
On Tue, Jul 11, 2023 at 09:32:32AM -0700, Nathan Bossart wrote: > Sure. І did it this way in v7. After a couple more small edits, I've committed this. I looked through all uses of getopt_long() in PostgreSQL earlier today, and of the programs that accepted non-options, most accepted only one,

Re: Duplicated LLVMJitHandle->lljit assignment?

2023-07-12 Thread Michael Paquier
On Wed, Jul 12, 2023 at 06:41:37PM -0700, Gurjeet Singh wrote: > LGTM. Indeed. It looks like a small thinko from 6c57f2e when support for LLVM12 was added. -- Michael signature.asc Description: PGP signature

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

2023-07-12 Thread Amit Kapila
On Wed, Jul 12, 2023 at 8:14 PM Önder Kalacı wrote: > >> >> > - return is_btree && !is_partial && !is_only_on_expression; >> > + /* Check whether the index is supported or not */ >> > + is_suitable_type = ((get_equal_strategy_number_for_am(indexInfo->ii_Am) >> > + != InvalidStrategy)); >> > + >>

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

2023-07-12 Thread Peter Smith
On Thu, Jul 13, 2023 at 12:22 PM Masahiko Sawada wrote: > > On Thu, Jul 13, 2023 at 11:12 AM Peter Smith wrote: > > > > On Thu, Jul 13, 2023 at 11:28 AM Masahiko Sawada > > wrote: > > > > > > On Thu, Jul 13, 2023 at 8:03 AM Peter Smith wrote: > > > > > > > > On Wed, Jul 12, 2023 at 5:01 PM

Re: Support to define custom wait events for extensions

2023-07-12 Thread Michael Paquier
On Thu, Jul 13, 2023 at 10:26:35AM +0900, Masahiro Ikeda wrote: > Thanks for your quick response. I'll rebase for the commit. Okay, thanks. I'll wait for the rebased version before moving on with the next review, then. -- Michael signature.asc Description: PGP signature

Re: CREATE INDEX CONCURRENTLY on partitioned index

2023-07-12 Thread Justin Pryzby
On Mon, Mar 27, 2023 at 01:28:24PM +0300, Alexander Pyhalov wrote: > Justin Pryzby писал 2023-03-26 17:51: > > On Sun, Dec 04, 2022 at 01:09:35PM -0600, Justin Pryzby wrote: > > > This currently handles partitions with a loop around the whole CIC > > > implementation, which means that things like

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

2023-07-12 Thread Masahiko Sawada
On Thu, Jul 13, 2023 at 11:12 AM Peter Smith wrote: > > On Thu, Jul 13, 2023 at 11:28 AM Masahiko Sawada > wrote: > > > > On Thu, Jul 13, 2023 at 8:03 AM Peter Smith wrote: > > > > > > On Wed, Jul 12, 2023 at 5:01 PM Masahiko Sawada > > > wrote: > > > > > > > > On Tue, Jul 11, 2023 at 5:31 

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

2023-07-12 Thread Peter Smith
On Thu, Jul 13, 2023 at 11:28 AM Masahiko Sawada wrote: > > On Thu, Jul 13, 2023 at 8:03 AM Peter Smith wrote: > > > > On Wed, Jul 12, 2023 at 5:01 PM Masahiko Sawada > > wrote: > > > > > > On Tue, Jul 11, 2023 at 5:31 PM Peter Smith wrote: > > > > ... > > > > I checked v5-0001 and noticed

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

2023-07-12 Thread Peter Smith
Here are some review comments for the v5 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. These 2 types of

Re: Duplicated LLVMJitHandle->lljit assignment?

2023-07-12 Thread Gurjeet Singh
On Wed, Jul 12, 2023 at 5:22 PM Matheus Alcantara wrote: > > I was reading the jit implementation and I notice that the lljit field of > LLVMJitHandle is being assigned twice on llvm_compile_module function, is this > correct? I'm attaching a supposed fixes that removes the second assignment. I

Re: CommandStatus from insert returning when using a portal.

2023-07-12 Thread David G. Johnston
On Wed, Jul 12, 2023 at 5:57 PM Dave Cramer wrote: > On Wed, 12 Jul 2023 at 20:00, wrote: > >> Dave Cramer writes: >> > Obviously I am biased by the JDBC API which would like to have >> > PreparedStatement.execute() return the number of rows inserted >> > without having to wait to read all of

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

2023-07-12 Thread Masahiko Sawada
On Thu, Jul 13, 2023 at 8:03 AM Peter Smith wrote: > > On Wed, Jul 12, 2023 at 5:01 PM Masahiko Sawada wrote: > > > > On Tue, Jul 11, 2023 at 5:31 PM Peter Smith wrote: > > > > > > Here are my comments for v4. > > > > > > == > > > > > > Docs/Comments: > > > > > > > > > > > Agreed. I've

Re: Autogenerate some wait events code and documentation

2023-07-12 Thread Michael Paquier
On Mon, Jul 10, 2023 at 07:52:23AM +0200, Drouvot, Bertrand wrote: > On 7/10/23 7:20 AM, Michael Paquier wrote: >> Hmm. Something like that could be done, for instance: >> >> # src/backend/utils/activity/wait_event_types.h >> -# typedef enum definitions for wait events. >> +#

Re: Support to define custom wait events for extensions

2023-07-12 Thread Masahiro Ikeda
On 2023-07-13 09:12, Michael Paquier wrote: On Wed, Jul 12, 2023 at 05:46:31PM +0900, Michael Paquier wrote: On Wed, Jul 12, 2023 at 04:52:38PM +0900, Masahiro Ikeda wrote: If the behavior is unexpected, we need to change the current code. I have created a patch for the areas that I felt

Re: CommandStatus from insert returning when using a portal.

2023-07-12 Thread Dave Cramer
On Wed, 12 Jul 2023 at 20:00, wrote: > Dave Cramer writes: > > Obviously I am biased by the JDBC API which would like to have > > PreparedStatement.execute() return the number of rows inserted > > without having to wait to read all of the rows returned > > Huh ... just how *is*

Duplicated LLVMJitHandle->lljit assignment?

2023-07-12 Thread Matheus Alcantara
Hi, I was reading the jit implementation and I notice that the lljit field of LLVMJitHandle is being assigned twice on llvm_compile_module function, is this correct? I'm attaching a supposed fixes that removes the second assignment. I ran meson test and all tests have pass. -- Matheus

Re: Support to define custom wait events for extensions

2023-07-12 Thread Michael Paquier
On Wed, Jul 12, 2023 at 05:46:31PM +0900, Michael Paquier wrote: > On Wed, Jul 12, 2023 at 04:52:38PM +0900, Masahiro Ikeda wrote: >> If the behavior is unexpected, we need to change the current code. >> I have created a patch for the areas that I felt needed to be changed. >> -

Re: MERGE ... RETURNING

2023-07-12 Thread Vik Fearing
On 7/13/23 01:48, Jeff Davis wrote: On Wed, 2023-07-12 at 03:47 +0200, Vik Fearing wrote: There is no RETURNING clause in Standard SQL, and the way they would do this is: SELECT ... FROM OLD TABLE ( MERGE ... ) AS m The rules for that for MERGE are well defined.

Re: CommandStatus from insert returning when using a portal.

2023-07-12 Thread chap
Dave Cramer writes: Obviously I am biased by the JDBC API which would like to have PreparedStatement.execute() return the number of rows inserted without having to wait to read all of the rows returned Huh ... just how *is* PreparedStatement.execute() supposed to behave when the statement is

Re: Meson build updates

2023-07-12 Thread Tristan Partin
Did you need anything more from the "Make finding pkg-config(python3) more robust" patch? That one doesn't seem to have been applied yet. Thanks for your reviews thus far. -- Tristan Partin Neon (https://neon.tech)

Re: MERGE ... RETURNING

2023-07-12 Thread Jeff Davis
On Wed, 2023-07-12 at 03:47 +0200, Vik Fearing wrote: > There is no RETURNING clause in Standard SQL, and the way they would > do > this is: > > SELECT ... > FROM OLD TABLE ( > MERGE ... > ) AS m > > The rules for that for MERGE are well defined. I only see OLD TABLE

Re: Meson build updates

2023-07-12 Thread Andres Freund
Hi, On 2023-06-29 13:34:42 -0500, Tristan Partin wrote: > On Thu Jun 29, 2023 at 12:35 PM CDT, Andres Freund wrote: > > Hm. One minor disadvantage of this is that if no c++ compiler was found, you > > can't really see anything about llvm in the the output, nor in > > meson-log.txt, > > making it

Re: Remove distprep

2023-07-12 Thread Andres Freund
Hi, On 2023-06-09 11:10:14 +0200, Peter Eisentraut wrote: > Per discussion at the unconference[0], I started to write a patch that > removes the make distprep target. A more detailed explanation of the > rationale is also in the patch. Thanks for tackling this! > It needs some polishing

Re: Correct the documentation for work_mem

2023-07-12 Thread David Rowley
On Tue, 25 Apr 2023 at 04:20, Imseih (AWS), Sami wrote: > > Based on the feedback, here is a v1 of the suggested doc changes. > > I modified Gurjeets suggestion slightly to make it clear that a specific > query execution could have operations simultaneously using up to > work_mem. > -

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

2023-07-12 Thread Peter Smith
On Wed, Jul 12, 2023 at 5:01 PM Masahiko Sawada wrote: > > On Tue, Jul 11, 2023 at 5:31 PM Peter Smith wrote: > > > > Here are my comments for v4. > > > > == > > > > Docs/Comments: > > > > > > Agreed. I've attached the updated patch. I'll push it barring any objections. > > > I

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

2023-07-12 Thread Michael Paquier
On Wed, Jul 12, 2023 at 10:01:49AM -0400, Robert Haas wrote: > I'm not sure exactly what is happening here, but it looks to me like > ATExecReplicaIdentity() only takes ShareLock on the index and > nevertheless feels entitled to update the pg_index tuple, which is > pretty strange. We normally

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

2023-07-12 Thread Michael Paquier
On Wed, Jul 12, 2023 at 04:02:23PM -0400, Robert Haas wrote: > Oh, interesting. The fact that indisreplident isn't copied seems like > a pretty clear mistake, but I'm guessing that the fact that t_self > wasn't refreshed was deliberate and that the author of this code > didn't really intend for

Re: document the need to analyze partitioned tables

2023-07-12 Thread David Rowley
On Wed, 25 Jan 2023 at 21:43, David Rowley wrote: > While I agree that the majority of partitions are likely to be > relkind='r', which you might ordinarily consider a "normal table", you > just might change your mind when you try to INSERT or UPDATE records > that would violate the partition

Re: CommandStatus from insert returning when using a portal.

2023-07-12 Thread David G. Johnston
On Wed, Jul 12, 2023 at 2:59 PM Dave Cramer wrote: > On Wed, 12 Jul 2023 at 17:49, Tom Lane wrote: > >> Dave Cramer writes: >> > Obviously I am biased by the JDBC API which would like to have >> > PreparedStatement.execute() return the number of rows inserted >> > without having to wait to

Re: CommandStatus from insert returning when using a portal.

2023-07-12 Thread Dave Cramer
On Wed, 12 Jul 2023 at 17:49, Tom Lane wrote: > Dave Cramer writes: > > Obviously I am biased by the JDBC API which would like to have > > PreparedStatement.execute() return the number of rows inserted > > without having to wait to read all of the rows returned > > Umm ... you do realize that

Re: CommandStatus from insert returning when using a portal.

2023-07-12 Thread Tom Lane
Dave Cramer writes: > Obviously I am biased by the JDBC API which would like to have > PreparedStatement.execute() return the number of rows inserted > without having to wait to read all of the rows returned Umm ... you do realize that we return the rows on-the-fly? The server does not know how

Re: CommandStatus from insert returning when using a portal.

2023-07-12 Thread Dave Cramer
Dave Cramer On Wed, 12 Jul 2023 at 16:31, David G. Johnston wrote: > On Wed, Jul 12, 2023 at 1:03 PM Dave Cramer wrote: > >> >> INSERT INTO test_table (cnt) VALUES (1), (2) RETURNING id >> >> if a portal is used to get the results then the CommandStatus >> > > IIUC the portal is not optional

Re: CommandStatus from insert returning when using a portal.

2023-07-12 Thread Gurjeet Singh
On Wed, Jul 12, 2023 at 1:03 PM Dave Cramer wrote: > > With a simple insert such as > > INSERT INTO test_table (cnt) VALUES (1), (2) RETURNING id > > if a portal is used to get the results then the CommandStatus is not returned > on the execute only when the portal is closed. After looking at

Re: CommandStatus from insert returning when using a portal.

2023-07-12 Thread David G. Johnston
On Wed, Jul 12, 2023 at 1:03 PM Dave Cramer wrote: > > INSERT INTO test_table (cnt) VALUES (1), (2) RETURNING id > > if a portal is used to get the results then the CommandStatus > IIUC the portal is not optional if you including the RETURNING clause. There is no CommandStatus message in the

CommandStatus from insert returning when using a portal.

2023-07-12 Thread Dave Cramer
Greetings, With a simple insert such as INSERT INTO test_table (cnt) VALUES (1), (2) RETURNING id if a portal is used to get the results then the CommandStatus is not returned on the execute only when the portal is closed. After looking at this more it is really after all of the data is read

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

2023-07-12 Thread Robert Haas
On Wed, Jul 12, 2023 at 12:28 PM Shruthi Gowda wrote: > I reviewed the function RelationReloadIndexInfo() and observed that the > 'indisreplident' field and the SelfItemPointer 't_self' are not refreshed to > the pg_index tuple of the index. > Attached is the patch that fixes the above

Re: COPY table FROM STDIN via SPI

2023-07-12 Thread Joe Conway
On 7/12/23 14:43, c...@anastigmatix.net wrote: On 2023-07-12 14:18, Joe Conway wrote: On 7/11/23 22:52, James Sewell wrote: What about running a COPY directly from C - is that possible? https://www.postgresql.org/docs/current/libpq-copy.html Or is the question about a COPY kicked off from

Re: COPY table FROM STDIN via SPI

2023-07-12 Thread chap
On 2023-07-12 14:18, Joe Conway wrote: On 7/11/23 22:52, James Sewell wrote: What about running a COPY directly from C - is that possible? https://www.postgresql.org/docs/current/libpq-copy.html Or is the question about a COPY kicked off from server-side C code (following up a question

Re: COPY table FROM STDIN via SPI

2023-07-12 Thread Joe Conway
On 7/11/23 22:52, James Sewell wrote: 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

Re: Better help output for pgbench -I init_steps

2023-07-12 Thread Gurjeet Singh
On Wed, Jul 12, 2023 at 3:08 AM Peter Eisentraut wrote: > > On 12.07.23 09:42, Gurjeet Singh wrote: > > These two variants show the two extremes; bare minimum vs. everything > > but the kitchen sink. So one may feel the need to find a middle ground > > and provide a "sufficient, but not too much"

Re: Meson build updates

2023-07-12 Thread Tristan Partin
On Wed Jul 12, 2023 at 11:39 AM CDT, Alvaro Herrera wrote: > On 2023-Jul-12, Tristan Partin wrote: > > > Attached is a patch which does just that without overriding the > > binaries. I investigated the bin_targets stuff, but some test > > executables get added there, so it wouldn't work out that

Re: Meson build updates

2023-07-12 Thread Alvaro Herrera
On 2023-Jul-12, Tristan Partin wrote: > Attached is a patch which does just that without overriding the > binaries. I investigated the bin_targets stuff, but some test > executables get added there, so it wouldn't work out that well. This seems useful. Maybe we should have some documentation

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

2023-07-12 Thread Shruthi Gowda
On Wed, Jul 12, 2023 at 5:46 PM Dilip Kumar wrote: > On Wed, Jul 12, 2023 at 1:56 PM Michael Paquier > wrote: > > > > On Wed, Jul 12, 2023 at 11:38:05AM +0530, Dilip Kumar wrote: > > > On Wed, Jul 12, 2023 at 11:12 AM Michael Paquier > wrote: > > >> > > >> On Wed, Jul 12, 2023 at 09:38:41AM

Re: Meson build updates

2023-07-12 Thread Tristan Partin
On Thu Jun 29, 2023 at 2:17 PM CDT, Tristan Partin wrote: > On Thu Jun 29, 2023 at 2:13 PM CDT, Andres Freund wrote: > > Hi, > > > > On 2023-06-29 14:07:19 -0500, Tristan Partin wrote: > > > I still think the overrides are important, at the very least for libpq, > > > but I will defer to your

Re: numeric datatype for current release not available

2023-07-12 Thread Julien Rouhaud
On Wed, 12 Jul 2023, 23:15 Ashutosh Bapat, wrote: > Hi All, > https://www.postgresql.org/docs/current/datatype-numeric.html gives me > "bad gateway" error. Attached screen shot. Date/Time datatype > documentation is accessible at > https://www.postgresql.org/docs/current/datatype-datetime.html.

numeric datatype for current release not available

2023-07-12 Thread Ashutosh Bapat
Hi All, https://www.postgresql.org/docs/current/datatype-numeric.html gives me "bad gateway" error. Attached screen shot. Date/Time datatype documentation is accessible at https://www.postgresql.org/docs/current/datatype-datetime.html. Just got this while wrapping up for the day. Didn't look at

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

2023-07-12 Thread Önder Kalacı
Hi Hayato, all > > - return is_btree && !is_partial && !is_only_on_expression; > > + /* 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 !=

Re: RelationGetIndexAttrBitmap comment outdated

2023-07-12 Thread Daniel Gustafsson
> On 12 Jul 2023, at 16:37, Alvaro Herrera wrote: > > I realized that commit 19d8e2308bc5 (and 5753d4ee320b before that) added > a new output type to RelationGetIndexAttrBitmap but forgot to list its > effect in the function's documenting comment. Here's a patch that > updates it, making it

RelationGetIndexAttrBitmap comment outdated

2023-07-12 Thread Alvaro Herrera
I realized that commit 19d8e2308bc5 (and 5753d4ee320b before that) added a new output type to RelationGetIndexAttrBitmap but forgot to list its effect in the function's documenting comment. Here's a patch that updates it, making it more specific (and IMO more readable). I also add a comment to

Re: Clean up some signal usage mainly related to Windows

2023-07-12 Thread Tristan Partin
On Wed Jul 12, 2023 at 9:31 AM CDT, Peter Eisentraut wrote: > On 12.07.23 16:23, Tristan Partin wrote: > > It has come to my attention that STDOUT_FILENO might not be portable and > > fileno(3) isn't marked as signal-safe, so I have just used the raw 1 for > > stdout, which as far as I know is

Re: Clean up some signal usage mainly related to Windows

2023-07-12 Thread Peter Eisentraut
On 12.07.23 16:23, Tristan Partin wrote: It has come to my attention that STDOUT_FILENO might not be portable and fileno(3) isn't marked as signal-safe, so I have just used the raw 1 for stdout, which as far as I know is portable. We do use STDOUT_FILENO elsewhere in the code, and there are

Re: Use COPY for populating all pgbench tables

2023-07-12 Thread Tristan Partin
On Wed Jul 12, 2023 at 1:06 AM CDT, Michael Paquier wrote: > 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

Re: tablecmds.c/MergeAttributes() cleanup

2023-07-12 Thread Peter Eisentraut
On 11.07.23 20:17, Alvaro Herrera wrote: I spent a few minutes doing a test merge of this to my branch with NOT NULL changes. Here's a quick review. Subject: [PATCH 01/17] Remove obsolete comment about OID support Obvious, trivial. +1 Subject: [PATCH 02/17] Remove ancient special case

Re: Clean up some signal usage mainly related to Windows

2023-07-12 Thread Tristan Partin
On Wed Jul 12, 2023 at 3:56 AM CDT, Peter Eisentraut wrote: > On 06.07.23 22:43, Tristan Partin wrote: > > /* Finish incomplete line on stdout */ > > - puts(""); > > - exit(1); > > + write(STDOUT_FILENO, "", 1); > > + _exit(1); > > puts() writes a newline, so it should probably be

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

2023-07-12 Thread Masahiko Sawada
On Wed, Jul 12, 2023 at 7:08 PM Amit Kapila wrote: > > On Wed, Jul 12, 2023 at 12:31 PM Masahiko Sawada > wrote: > > > > On Tue, Jul 11, 2023 at 5:31 PM Peter Smith wrote: > > > > > > > I don't think we have concluded any action for it. I agree that > > IsIndexOnlyOnExpression() is redundant.

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

2023-07-12 Thread Önder Kalacı
Hi Amit, all Amit Kapila , 12 Tem 2023 Çar, 13:09 tarihinde şunu yazdı: > On Wed, Jul 12, 2023 at 12:31 PM Masahiko Sawada > wrote: > > > > On Tue, Jul 11, 2023 at 5:31 PM Peter Smith > wrote: > > > > > > > I don't think we have concluded any action for it. I agree that > >

Re: The same 2PC data maybe recovered twice

2023-07-12 Thread Andy Fan
Hi: On Sat, Jul 8, 2023 at 2:53 AM 蔡梦娟(玊于) wrote: > Hi, all > I add a patch for pg11 to fix this bug, hope you can check it. > > Thanks for the bug report and patch! Usually we talk about bugs against the master branch, no people want to check out a history branch and do the discussion

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

2023-07-12 Thread Robert Haas
On Wed, Jul 12, 2023 at 4:26 AM Michael Paquier wrote: > Taking the test case of upthread, from what I can see, the ALTER TABLE > .. REPLICA IDENTITY registers two relcache invalidations for pk_foo > (via RegisterRelcacheInvalidation), which is the relcache entry whose > stuff is messed up. I

Re: Better help output for pgbench -I init_steps

2023-07-12 Thread Alvaro Herrera
On 2023-Jul-12, Gurjeet Singh wrote: > The init-steps are severely under-documented in pgbench --help output. > I think at least a pointer to the the pgbench docs should be mentioned > in the pgbench --help output; an average user may not rush to read the > code to find the explanation, but a

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

2023-07-12 Thread Robert Haas
On Tue, Jul 11, 2023 at 1:22 PM Shruthi Gowda wrote: > BEGIN; > > CREATE TABLE foo ( > id INT NOT NULL, > ts TIMESTAMP WITH TIME ZONE NOT NULL > ) PARTITION BY RANGE (ts); > > CREATE TABLE foo_2023 ( > id INT NOT NULL, > ts TIMESTAMP WITH TIME ZONE NOT NULL > ); > > ALTER TABLE ONLY foo

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

2023-07-12 Thread Dilip Kumar
On Wed, Jul 12, 2023 at 1:56 PM Michael Paquier wrote: > > On Wed, Jul 12, 2023 at 11:38:05AM +0530, Dilip Kumar wrote: > > 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

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

2023-07-12 Thread Wen Yi
I'm so sorry for my careless, you're right. But I still think there should add a tip to our user when there's check ok, because when I use the check mode, it didn't give me any message (If there's no error happend) and just exit, like this: [beginnerc@bogon devel]$ postgres --check -D

Re: pg16b2: REINDEX segv on null pointer in RemoveFromWaitQueue

2023-07-12 Thread Justin Pryzby
On Mon, Jul 10, 2023 at 09:01:37PM -0500, Justin Pryzby wrote: > An instance compiled locally, without assertions, failed like this: > ... > > => REINDEX was running, with parallel workers, but deadlocked with > ANALYZE, and then crashed. > > It looks like parallel workers are needed to hit

Re: Synchronizing slots from primary to standby

2023-07-12 Thread Peter Eisentraut
On 14.04.23 15:22, Drouvot, Bertrand wrote: Now that the "Minimal logical decoding on standby" patch series (mentioned up-thread) has been committed, I think we can resume working on this one ("Synchronizing slots from primary to standby"). Maybe you have seen this extension that was released

Re: Testing autovacuum wraparound (including failsafe)

2023-07-12 Thread Daniel Gustafsson
> On 12 Jul 2023, at 09:52, Masahiko Sawada wrote: > Agreed. The timeout can be set by manually setting > PG_TEST_TIMEOUT_DEFAULT, but I bump it to 10 min by default. And it > now require setting PG_TET_EXTRA to run it. +# bump the query timeout to avoid false negatives on slow test syetems.

Re: Consistent coding for the naming of LR workers

2023-07-12 Thread Peter Eisentraut
On 21.06.23 09:18, Alvaro Herrera wrote: That is a terrible pattern in relatively new code. Let's get rid of it entirely rather than continue to propagate it. So, I don't think it is fair to say that these format strings are OK for the existing HEAD code, but not OK for the patch code, when

Re: psql: Add role's membership options to the \du+ command

2023-07-12 Thread Pavel Luzanov
On 09.07.2023 13:56, Pavel Luzanov wrote: On 08.07.2023 20:07, Tom Lane wrote: 1. I was thinking in terms of dropping the "Member of" column entirely in \du and \dg. It doesn't tell you enough, and the output of those commands is often too wide already. 2. You have describeRoleGrants() set

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

2023-07-12 Thread Amit Kapila
On Wed, Jul 12, 2023 at 12:31 PM Masahiko Sawada wrote: > > On Tue, Jul 11, 2023 at 5:31 PM Peter Smith wrote: > > > > I don't think we have concluded any action for it. I agree that > IsIndexOnlyOnExpression() is redundant. We don't need to check *all* > index fields actually. I've attached a

Re: Better help output for pgbench -I init_steps

2023-07-12 Thread Peter Eisentraut
On 12.07.23 09:42, Gurjeet Singh wrote: These two variants show the two extremes; bare minimum vs. everything but the kitchen sink. So one may feel the need to find a middle ground and provide a "sufficient, but not too much" variant. I have attempted that in variants 3 and 4; also attached.

Re: DROP DATABASE is interruptible

2023-07-12 Thread Daniel Gustafsson
> On 12 Jul 2023, at 03:59, Andres Freund wrote: > 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: >>> There don't need to be explict checks, because pg_upgrade will fail, because

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

2023-07-12 Thread Michael Banck
Hi, On Mon, Jul 10, 2023 at 02:37:24PM -0700, Nikolay Samokhvalov wrote: > On Mon, Jul 10, 2023 at 2:02 PM Michael Banck wrote: > > > +++ b/doc/src/sgml/ref/pgupgrade.sgml > > > @@ -380,22 +380,28 @@ NET STOP postgresql- > > > > > > > > > > > > - Streaming replication and

Re: Clean up some signal usage mainly related to Windows

2023-07-12 Thread Peter Eisentraut
On 06.07.23 22:43, Tristan Partin wrote: /* Finish incomplete line on stdout */ - puts(""); - exit(1); + write(STDOUT_FILENO, "", 1); + _exit(1); puts() writes a newline, so it should probably be something like write(STDOUT_FILENO, "\n", 1);

Re: Support to define custom wait events for extensions

2023-07-12 Thread Michael Paquier
On Wed, Jul 12, 2023 at 04:52:38PM +0900, Masahiro Ikeda wrote: > In my understanding, the first column of the row for WaitEventExtension in > wait_event_names.txt can be any value and the above code should not die. > But if I use the following input, it falls on the last line. > > #

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

2023-07-12 Thread Masahiko Sawada
On Wed, Jul 12, 2023 at 3:52 AM Andres Freund wrote: > > 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.

Re: Support to define custom wait events for extensions

2023-07-12 Thread Masahiro Ikeda
On 2023-07-12 09:36, Andres Freund wrote: 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

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

2023-07-12 Thread Michael Paquier
On Wed, Jul 12, 2023 at 11:38:05AM +0530, Dilip Kumar wrote: > 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

Re: SQL:2011 application time

2023-07-12 Thread Peter Eisentraut
On 07.07.23 03:03, Paul A Jungwirth wrote: Here are some new patch files based on discussions from PGCon. Here are a few fixup patches to get things building without warnings and errors. The last patch (your 0005) fails the regression test for me and it didn't appear to be a trivial

Re: Support to define custom wait events for extensions

2023-07-12 Thread Masahiro Ikeda
On 2023-07-12 02:39, Tristan Partin wrote: 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

Re: Testing autovacuum wraparound (including failsafe)

2023-07-12 Thread Masahiko Sawada
On Thu, Apr 27, 2023 at 11:12 PM Daniel Gustafsson wrote: > > > On 27 Apr 2023, at 16:06, Masahiko Sawada wrote: > > On Fri, Apr 21, 2023 at 12:02 PM John Naylor > > wrote: > > >> ...that call to background_psql doesn't look like other ones that have > >> "key => value". Is there something I'm

Re: Support to define custom wait events for extensions

2023-07-12 Thread Masahiro Ikeda
On 2023-07-11 16:45, Michael Paquier wrote: 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

Better help output for pgbench -I init_steps

2023-07-12 Thread Gurjeet Singh
These patches were created during an unrelated discussion about pgbench. Please see emails [1] - [6] linked below, for the past discussion. In brief: > $ pgbench -i -I dtGvp -s 500 The init-steps are severely under-documented in pgbench --help output. I think at least a pointer to the the

Re: Exclusion constraints on partitioned tables

2023-07-12 Thread Peter Eisentraut
On 11.07.23 07:52, Paul A Jungwirth wrote: On Mon, Jul 10, 2023 at 8:06 AM Paul A Jungwirth wrote: 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

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

2023-07-12 Thread Hayato Kuroda (Fujitsu)
Dear Amit, Thanks for checking my patch! The patch can be available at [1]. > > > == > > > .../subscription/t/032_subscribe_use_index.pl > > > > > > 11. > > > AFAIK there is no test to verify that the leftmost index field must be > > > a column (e.g. cannot be an expression). Yes, there are

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

2023-07-12 Thread Hayato Kuroda (Fujitsu)
Dear Peter, Thanks for giving comment. > > 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 other

Re: Support to define custom wait events for extensions

2023-07-12 Thread Michael Paquier
On Tue, Jul 11, 2023 at 05:36:47PM -0700, Andres Freund wrote: > On 2023-07-11 16:45:26 +0900, Michael Paquier wrote: >> +$node->init; >> +$node->append_conf( >> +'postgresql.conf', >> +"shared_preload_libraries = 'test_custom_wait_events'" >> +); >> +$node->start; > > I think this should

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

2023-07-12 Thread Masahiko Sawada
On Tue, Jul 11, 2023 at 5:31 PM Peter Smith wrote: > > 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

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

2023-07-12 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

Re: CI and test improvements

2023-07-12 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

  1   2   >