using index to speedup add not null constraints to a table

2024-12-15 Thread jian he
hi. context: i was trying to speedup add check constraint then Sergei Kornilov sent me a link: [1]. so i studied that thread, then tried to implement $SUBJECT. obviously not using SPI at all. the logic is mentioned [2]: """ we could try an index scan - via index_beginscan() / index_getnext() / in

Re: Crash: invalid DSA memory alloc request

2024-12-15 Thread Andreas 'ads' Scherbaum
Hi Matthias, On Thu, Dec 12, 2024 at 10:49 PM Matthias van de Meent < boekewurm+postg...@gmail.com> wrote: > On Thu, 12 Dec 2024 at 22:28, Andreas 'ads' Scherbaum wrote: > > > > > > Hello, > > > > I'm running a couple of large tests, and in this particular test I have > > a few million tables mo

Re: Proposal for Updating CRC32C with AVX-512 Algorithm.

2024-12-15 Thread John Naylor
On Sat, Dec 14, 2024 at 10:24 PM Andres Freund wrote: > > Hi, > > On 2024-12-14 12:08:57 +0700, John Naylor wrote: > > On Thu, Jun 13, 2024 at 2:37 AM Andres Freund wrote: > > > > > > It's hard to understand, but a nonetheless helpful page is > > > https://users.ece.cmu.edu/~koopman/crc/crc32.htm

Re: Pass ParseState as down to utility functions.

2024-12-15 Thread Michael Paquier
On Thu, Dec 12, 2024 at 12:38:06PM +0800, jian he wrote: > I am using DefineDomain(ParseState *pstate, CreateDomainStmt *stmt) for now. > we can also pass querystring or another struct. All the changes in the alternate outputs for collate are always tricky to track. As far as I can see, you've no

Re: Added schema level support for publication.

2024-12-15 Thread Amit Kapila
On Sat, Dec 14, 2024 at 5:28 AM Tom Lane wrote: > > I suppose this exchange is what led to this bit in > getPublicationNamespaces: > > /* > * We always dump publication namespaces unless the corresponding > * namespace is excluded from the dump. > */ > if

Re: Regression tests fail on OpenBSD due to low semmns value

2024-12-15 Thread Tom Lane
Alexander Lakhin writes: > I deployed OpenBSD 7.4 locally and reproduced "too many clients" and that > hang as well. It turned out that OpenBSD has semmns as low as 60 (see [4]) > and as a consequence, initdb sets max_connections = 20 for the regression > test database. (This can be helpful someti

Re: pg_combinebackup PITR comparison test fix

2024-12-15 Thread Michael Paquier
On Sun, Dec 15, 2024 at 10:34:07AM +0900, Michael Paquier wrote: > Indeed, good catch. I'll take care of it. +sub { +s{create tablespace .* location '.*/tspitr\K[12]}{N}i for @_; +return $_[0] ne $_[1]; +}); The CI is complaining on this one because the custom comparison

Re: Add Postgres module info

2024-12-15 Thread Andrei Lepikhov
On 12/13/24 10:17, Tom Lane wrote: Andrei Lepikhov writes: On 12/12/24 21:02, Yurii Rashkovskii wrote: 2. Any reasons to dictate MAJ.MIN format? With semantic versioning abound, it's rather common to use MAJ.MIN.PATCH. Okay, thanks; that's a good catch. I wonder how to follow these rules wi

Regression tests fail on OpenBSD due to low semmns value

2024-12-15 Thread Alexander Lakhin
Hello hackers, A recent buildfarm timeout failure on sawshark [1] made me wonder, what's wrong with that animal — beside that failure, this animal (running on OpenBSD 7.4) produced "too many clients" errors from time to time, e. g., [2], [3]. I deployed OpenBSD 7.4 locally and reproduced "too ma

Re: Enhancing Memory Context Statistics Reporting

2024-12-15 Thread Amit Langote
Hi Rahila, Thanks for working on this. I've wanted something like this a number of times to replace my current method of attaching gdb like everyone else I suppose. I have a question / suggestion about the interface. +Datum +pg_get_process_memory_contexts(PG_FUNCTION_ARGS) +{ +int p

Re: Introduce XID age and inactive timeout based replication slot invalidation

2024-12-15 Thread Peter Smith
Hi Nisha. Thanks for the v55* patches. I have no comments for patch v55-0001. I have only 1 comment for patch v55-0002 regarding some remaining nitpicks (below) about the consistency of phrases. == I scanned again over all the phrases for consistency: CURRENT PATCH: Docs (idle_replicatio

Re: Precheck to consider path costs for partial paths

2024-12-15 Thread Andreas Karlsson
On 12/3/24 7:24 PM, Nikita Malakhov wrote: Please check the attached patch. I'm very interested if my assumption is correct or not. Hi, You probably attached the wrong file since your patch does not even compile. Andreas

Re: strangely worded message

2024-12-15 Thread Amit Langote
Hi Alvaro, On Sat, Dec 14, 2024 at 9:43 PM Alvaro Herrera wrote: > > Hello > > The following message introduced by commit 03734a7fed7d appears in two > places: > > if (returning->typid != JSONOID && returning->typid != JSONBOID) > ereport(ERROR, > (errcode(

Re: confusing / inefficient "need_transcoding" handling in copy

2024-12-15 Thread Sutou Kouhei
Hi, In "Re: confusing / inefficient "need_transcoding" handling in copy" on Mon, 16 Dec 2024 11:25:16 +0900, Michael Paquier wrote: > On Sat, Dec 14, 2024 at 04:46:57PM +0900, Michael Paquier wrote: >> Note that using "test" as table name for the tests is not a good idea, >> as this could

Re: confusing / inefficient "need_transcoding" handling in copy

2024-12-15 Thread Michael Paquier
On Sat, Dec 14, 2024 at 04:46:57PM +0900, Michael Paquier wrote: > Note that using "test" as table name for the tests is not a good idea, > as this could very likely conflict with some concurrent activity. I > would also add two RESET queries to remove the dependency to > client_encoding once the

Re: [PoC] Federated Authn/z with OAUTHBEARER

2024-12-15 Thread Daniel Gustafsson
> On 5 Dec 2024, at 19:29, Jacob Champion > wrote: > Seems good. I think this part of the API is going to need an > ABI-compatibility pass, too. For example, do we want a module to > allocate the result struct itself (which locks in the struct length)? > And should we have a MAGIC_NUMBER of some

Re: DOCS: pg_createsubscriber wrong link?

2024-12-15 Thread Peter Smith
On Fri, Dec 13, 2024 at 8:31 PM vignesh C wrote: > > On Fri, 13 Dec 2024 at 10:58, Peter Smith wrote: > > > > Hi, > > > > While reviewing the pg_createsubscriber [1] docs I found a potentially > > wrong linkend. > > > > This sentence: > > "For smaller databases, initial data synchronization is re

Re: Adding a '--two-phase' option to 'pg_createsubscriber' utility.

2024-12-15 Thread Peter Smith
Hi Shubham. The patch v8-0001 looks good to me. FYI, there are a few pending patches [1][2][3] that might have some tests/docs overlap with this one, so be on the lookout because if those get pushed first your patch may require rebasing. == [1] https://www.postgresql.org/message-id/flat/CAH

Re: bt_index_parent_check and concurrently build indexes

2024-12-15 Thread Michail Nikolaev
Hello, Andrey! Thanks for the review! > I think usually write only commit year. Something tells me you can safely write 2025 there. Done. > Can't wrap my head why do you need this? Oops, copy-paste, fixed. > I think this comment describes behavior before the fix in present tense. Fixed. > Snap

Re: [BUG] pgbench nested \if conditions incorrectly processed

2024-12-15 Thread Tom Lane
Michail Nikolaev writes: > I’ve found an issue with pgbench: it processes nested \if conditions > incorrectly. Right you are. > Attached is a fix that addresses this issue, along with a regression test. Code fix looks good, but I don't agree with creating a separate test script for this --- tha

Re: Sort functions with specialized comparators

2024-12-15 Thread Andrey M. Borodin
> On 11 Dec 2024, at 11:39, John Naylor wrote: > > On Mon, Dec 9, 2024 at 8:02 PM Andrey M. Borodin wrote: >> >> I think commit message states that it's better to opt-in for interruptible >> sort. So I do not think making sort interruptible is a blocker for making >> global specialized sor

Re: Windows UTF8 system locale

2024-12-15 Thread Michail Nikolaev
Hello, Noah! I have Win 11 with that feature enabled, 200_connstr.pl passes without any issues, but 010_dump_connstr.pl fails, yes. All other tests seem to be passing, at least without ICU enabled. 010_dump_connstr.pl log is attached. Best regards, Mikhail. log.tgz Description: application/co

Re: bt_index_parent_check and concurrently build indexes

2024-12-15 Thread Andrey M. Borodin
> On 13 Dec 2024, at 04:59, Michail Nikolaev wrote: > +# Copyright (c) 2021-2024, PostgreSQL Global Development Group I think usually write only commit year. Something tells me you can safely write 2025 there. +Test::More->builder->todo_start('filesystem bug') + if PostgreSQL::Test::Utils

Re: pg_attribute_noreturn(), MSVC, C11

2024-12-15 Thread Andres Freund
Hi, On 2024-12-14 18:18:35 +0100, Peter Eisentraut wrote: > On 13.12.24 20:54, Andres Freund wrote: > > Another wrinkle: While __attribute__((noreturn)) works for function pointers > > (or function pointer typedefs) _Noreturn doesn't. Gah. We only use it that > > way in two places, but still :( >

Re: pg_attribute_noreturn(), MSVC, C11

2024-12-15 Thread Andres Freund
Hi, On 2024-12-14 18:15:13 +0100, Peter Eisentraut wrote: > On 13.12.24 20:10, Andres Freund wrote: > > (or alternatively include stdreturn if __STDC_VERSION__ indicates support > > and > > define a bare 'noreturn' if not) > > > > For msvc that mean we'd need to add /std:c11 (or /std:c17) to the

Re: Reject Windows command lines not convertible to system locale

2024-12-15 Thread Thomas Munro
On Sun, Dec 15, 2024 at 6:05 PM Noah Misch wrote: > On Sun, Dec 15, 2024 at 04:50:57PM +1300, Thomas Munro wrote: > > For the all-ASCII test, why not us pg_is_ascii()? > > pg_is_ascii() takes a char[], but this has a wchar_t[]. Maybe I should wrap > that part in a pg_wcs_is_ascii()? (We can't us

[BUG] pgbench nested \if conditions incorrectly processed

2024-12-15 Thread Michail Nikolaev
Hello, I’ve found an issue with pgbench: it processes nested \if conditions incorrectly. For example: \if false \if true DROP TABLE money CASCADE; \endif \endif In this case, the table will be dropped, which is unexpected behavior. Attached is a fix that addresses this issue, a

Re: Parallel tests publication and subscription might fail due to concurrent tuple update

2024-12-15 Thread Jelte Fennema-Nio
On Sun, 15 Dec 2024 at 10:00, Alexander Lakhin wrote: > shows that the subscription and publication tests are not concurrent-safe, > because modifying the same pg_database entry might fail with the "tuple > concurrently updated" error. This seems related to this thread about concurrency issues in

Parallel tests publication and subscription might fail due to concurrent tuple update

2024-12-15 Thread Alexander Lakhin
Hello hackers, A recent desman failure [1] with the following diagnostics: # parallel group (2 tests):  subscription publication not ok 157   + publication  2251 ms ok 158   + subscription  415 ms --- /home/fedora/17-desman/buildroot/RE