Re: [PATCH] Add some documentation on how to call internal functions

2024-10-18 Thread Pavel Stehule
pá 18. 10. 2024 v 22:23 odesílatel Tom Lane napsal: > Pavel Stehule writes: > > I'll mark this patch as ready for committer > > I spent a little time looking at this. I agree that it's better to > show conversion of the example function's arguments to and from text* > rather than leaving them a

Re: Logging parallel worker draught

2024-10-18 Thread Benoit Lobréau
On 10/15/24 09:52, Benoit Lobréau wrote: Thank you, it's a lot cleaner that way. I'll add this asap. This is an updated version with the suggested changes. -- Benoit Lobréau Consultant http://dalibo.comFrom b9bf7c0fa967c72972fd77333a768dfe89d91765 Mon Sep 17 00:00:00 2001 From: benoit Date: F

Re: Wrong security context for deferred triggers?

2024-10-18 Thread Pavel Stehule
Hi pá 18. 10. 2024 v 15:24 odesílatel Laurenz Albe napsal: > On Fri, 2024-10-18 at 11:32 +0200, Pavel Stehule wrote: > > pá 18. 10. 2024 v 10:20 odesílatel Laurenz Albe < > laurenz.a...@cybertec.at> napsal: > > > On Fri, 2024-10-18 at 07:47 +0200, Pavel Stehule wrote: > > > > Without deeper chec

Re: ECPG Refactor: move sqlca variable in ecpg_log()

2024-10-18 Thread Tom Lane
Fujii Masao writes: > I've attached the latest version of the patch, now including the commit log. > Unless there are any objections, I'll proceed with committing it. LGTM. Maybe move down the sqlca variable declaration, so that the declarations still match the order in which the variables are i

Re: allowing extensions to control planner behavior

2024-10-18 Thread Andrei Lepikhov
On 18/10/2024 14:56, Jakub Wartak wrote: Hi Andrei, On Fri, Oct 11, 2024 at 8:21 AM Andrei Lepikhov > wrote: out of curiosity, why do You think it would be inappropriate to do so in the core? Maybe it Is something similiar to compute_query_id that can be computed exte

Re: [BUG FIX] Fix validation of COPY options FORCE_NOT_NULL/FORCE_NULL

2024-10-18 Thread Michael Paquier
On Fri, Oct 18, 2024 at 08:27:44AM +0200, Joel Jacobson wrote: > I believe test specificity and clarity are important. Using COPY FROM in this > context is confusing and makes the tests harder to maintain, as testing two > things at once, deviates from the pattern established by other tests in > th

Re: Use more CppAsString2() in pg_amcheck.c

2024-10-18 Thread Michael Paquier
On Fri, Oct 18, 2024 at 12:22:26PM -0500, Nathan Bossart wrote: > On Fri, Oct 18, 2024 at 06:50:50PM +0900, Michael Paquier wrote: >> -appendPQExpBufferStr(&sql, "\nWHERE c.relpersistence != 't'"); >> +appendPQExpBufferStr(&sql, "\nWHERE c.relpersistence != " >> +

Re: Statistics Import and Export

2024-10-18 Thread Corey Huinker
> > > > Patch that allows relation_statistics_update to continue after one failed > stat (0001) attached, along with bool->void change (0002). > Once more, with feeling: From 0cf8a90c37ec95bbbefb274bc3d48a077b4868b8 Mon Sep 17 00:00:00 2001 From: Corey Huinker Date: Wed, 16 Oct 2024 19:13:01 -040

Re: Considering fractional paths in Append node

2024-10-18 Thread Andy Fan
Nikita Malakhov writes: Hi Nikita, > Hi! > > Andy, one quick question - what do you think on using > root->limit_tuples as a guidance on how many > rows we have to consider in plans cost? Within my exprerience, the committer probabaly dislikes the idea of "ignoring the difference of tuple_fra

Re: Statistics Import and Export

2024-10-18 Thread Corey Huinker
> > What is the benefit of a return value from the pg_set_*_stats variants? > As far as I can tell, there is none because they throw an ERROR if > anything goes wrong, so they should just return VOID. What am I > missing? > Probably nothing. The nuances of "this stat didn't get set but these other

Re: Avoiding superfluous buffer locking during nbtree backwards scans

2024-10-18 Thread Peter Geoghegan
On Thu, Oct 17, 2024 at 5:13 PM Matthias van de Meent wrote: > I'm a little bit concerned about this change: I'm not familiar with > predicate locks, PLP, or anything related to SSI, but previously we > called PLP in parallel scans while we still had hold of the scan, > while we now call PLP only

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

2024-10-18 Thread Devulapalli, Raghuveer
> I've proposed a patch to move the existing AVX-512 code in Postgres to use > __attribute__((target("..."))) instead of per-translation-unit compiler flags > [0]. We > should likely do something similar for this one. > > [0] https://postgr.es/m/ZxAqRG1-8fJLMRUY%40nathan I assume this will be

Re: [PATCH] Add some documentation on how to call internal functions

2024-10-18 Thread Tom Lane
Pavel Stehule writes: > I'll mark this patch as ready for committer I spent a little time looking at this. I agree that it's better to show conversion of the example function's arguments to and from text* rather than leaving them as Datum. I also do think that we need to incorporate the example

msvc directory missing in PostgreSQL 17.0

2024-10-18 Thread Mark Hill
I just downloaded the Postgresql 17.0 and the extracted directory postgresql-17.0/src/tools does not contain the "msvc" directory as it has since I've been building Postgres 12, 14, and 16. How am I supposed to build PostgreSQL for Windows now? I'm not sure what msvc_gendef.pl does. How do

Re: msvc directory missing in PostgreSQL 17.0

2024-10-18 Thread Bill Smith
> On Oct 18, 2024, at 4:05 PM, Mark Hill wrote: > > I just downloaded the Postgresql 17.0 and the extracted directory > postgresql-17.0/src/tools does not contain > the “msvc” directory as it has since I’ve been building Postgres 12, 14, and > 16. How am I supposed to build > PostgreSQL for

Changing shared_buffers without restart

2024-10-18 Thread Dmitry Dolgov
TL;DR A PoC for changing shared_buffers without PostgreSQL restart, via changing shared memory mapping layout. Any feedback is appreciated. Hi, Being able to change PostgreSQL configuration on the fly is an important property for performance tuning, since it reduces the feedback time and invasive

Re: Inconsistent use of relpages = -1

2024-10-18 Thread Tom Lane
Jeff Davis writes: > As Corey discovered, and I re-discovered later, partitioned tables can > have relpages=-1: > ... > Another problem is that it's inconsistent: sometimes it's 0 (before > analyze) and sometimes -1. Views also don't have any storage, but > relpages are always 0. > ... > I don't s

Inconsistent use of relpages = -1

2024-10-18 Thread Jeff Davis
As Corey discovered, and I re-discovered later, partitioned tables can have relpages=-1: https://www.postgresql.org/message-id/f4a0cf7975f1ad42a20fcc91be9e938a4f71259d.ca...@j-davis.com One problem is that the code (analyze.c:680) is a bit unclear because it implicitly casts back and forth betwee

Re: New "raw" COPY format

2024-10-18 Thread Joel Jacobson
On Fri, Oct 18, 2024, at 15:52, jian he wrote: > Raw Format is duplicated > Raw Format didn't mention the special handling of > end-of-data marker. Thanks for reviewing, above fixed. Here is a summary of the changes since v10, thanks to the feedback: Handling of e.g. JSON and other structured t

Re: Use more CppAsString2() in pg_amcheck.c

2024-10-18 Thread Nathan Bossart
On Fri, Oct 18, 2024 at 06:50:50PM +0900, Michael Paquier wrote: > - appendPQExpBufferStr(&sql, "\nWHERE c.relpersistence != 't'"); > + appendPQExpBufferStr(&sql, "\nWHERE c.relpersistence != " > + > CppAsString2(RELPERSISTENCE_TEMP) " "); I th

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

2024-10-18 Thread Nathan Bossart
On Tue, Oct 08, 2024 at 08:19:27PM +, Devulapalli, Raghuveer wrote: > Hi all, I'm currently in the process of reviewing and analyzing Paul's > patch. In the meantime, I'm open to addressing any questions or feedback > you may have. I've proposed a patch to move the existing AVX-512 code in Pos

Re: Considering fractional paths in Append node

2024-10-18 Thread Nikita Malakhov
Hi! Andy, one quick question - what do you think on using root->limit_tuples as a guidance on how many rows we have to consider in plans cost? -- Regards, Nikita Malakhov Postgres Professional The Russian Postgres Company https://postgrespro.ru/

Re: Doc: shared_memory_size_in_huge_pages with the "SHOW" command.

2024-10-18 Thread Nathan Bossart
On Fri, Oct 18, 2024 at 02:47:37PM +0900, Fujii Masao wrote: > On 2024/10/18 7:10, Michael Paquier wrote: >> Fine by me. Thanks. > > LGTM, too. Thanks! Committed. -- nathan

Re: Conflict detection for update_deleted in logical replication

2024-10-18 Thread Amit Kapila
On Tue, Oct 15, 2024 at 5:03 PM Amit Kapila wrote: > > On Mon, Oct 14, 2024 at 9:09 AM Zhijie Hou (Fujitsu) > wrote: > > > > We thought of few options to fix this: > > > > 1) Add a Time-Based Subscription Option: > > > > We could add a new time-based option for subscriptions, such as > > retain_d

Re: Incorrect comment on pg_shadow view

2024-10-18 Thread Tom Lane
Daniel Gustafsson writes: >> On 18 Oct 2024, at 13:50, Antonin Houska wrote: >> Attached is a proposal to fix a comment in pg_authid.h. pg_shadow is not (and >> obviously should not be) accessible by public: > - * pg_shadow and pg_group are now publicly accessible views on pg_authid. > + *

Re: [PATCH] Add get_bytes() and set_bytes() functions

2024-10-18 Thread Aleksander Alekseev
Hi, > > I guess there are in fact two problems, not one. > > > > 1. Converting between bytea and integer types > > 2. Multibyte versions of get_byte() / set_byte() > > > > As you rightly pointed out, for (1) we just need to add missing casts. > > Here is the corresponding patch, v3-0001. Note that

Re: Recovery of .partial WAL segments

2024-10-18 Thread Matthias van de Meent
On Fri, 5 Apr 2024 at 11:45, Stefan Fercot wrote: > > Dear hackers, > > Generating a ".partial" WAL segment is pretty common nowadays (using > pg_receivewal or during standby promotion). > However, we currently don't do anything with it unless the user manually > removes that ".partial" extensio

Re: New "raw" COPY format

2024-10-18 Thread jian he
On Wed, Oct 16, 2024 at 2:37 PM Joel Jacobson wrote: > > On Wed, Oct 16, 2024, at 05:31, jian he wrote: > > Hi. > > I only checked 0001, 0002, 0003. > > the raw format patch is v9-0016. > > 003-0016 is a lot of small patches, maybe you can consolidate it to > > make the review more easier. > > Tha

Re: Wrong security context for deferred triggers?

2024-10-18 Thread Laurenz Albe
On Fri, 2024-10-18 at 11:32 +0200, Pavel Stehule wrote: > pá 18. 10. 2024 v 10:20 odesílatel Laurenz Albe > napsal: > > On Fri, 2024-10-18 at 07:47 +0200, Pavel Stehule wrote: > > > Without deeper checks I don't like using GetUserNameFromId for checking > > > the validity of a role. > > > > > >

Re: Eager aggregation, take 3

2024-10-18 Thread jian he
/* * Eager aggregation is only possible if equality of grouping keys, as * defined by the equality operator, implies bitwise equality. * Otherwise, if we put keys with different byte images into the same * group, we may lose some information that could be

Re: Use more CppAsString2() in pg_amcheck.c

2024-10-18 Thread Alvaro Herrera
On 2024-Oct-18, Alvaro Herrera wrote: > Hmm, aren't you losing the single quotes? Ah, the defines themselves include the quotes, so this is not needed. Sorry for the noise. -- Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/ Syntax error: function hell() needs an ar

Re: Use more CppAsString2() in pg_amcheck.c

2024-10-18 Thread Alvaro Herrera
On 2024-Oct-18, Michael Paquier wrote: > pg_amcheck.c is one of these places where relkind and relpersistence > values are hardcoded in queries based on the contents of pg_class_d.h. > Similarly to other places in src/bin/, let's sprinkle some > CppAsString2() and feed to the binary the values fro

Re: unicode test programs don't build with meson

2024-10-18 Thread Aleksander Alekseev
Hi Peter, > 1) Add libintl directly to the affected programs, like > > case_test = executable('case_test', > ['case_test.c'], > - dependencies: [frontend_port_code, icu], > + dependencies: [frontend_port_code, icu, libintl], > include_directories: inc, > link_with: [common_static,

Re: Amcheck verification of GiST and GIN

2024-10-18 Thread Kirill Reshke
Hi! On Mon, 5 Aug 2024 at 20:05, Tomas Vondra wrote: > > Hi, > > I've spent a bit more time looking at the GiST part as part of my > "parallel GiST build" patch nearby, and I think there's some sort of > memory leak. > > Consider this: > > create table t (a text); > > insert into t select md5

Re: Recovery of .partial WAL segments

2024-10-18 Thread Stefan Fercot
Hi, On Fri, Oct 18, 2024 at 11:07 AM Stepan Neretin wrote: > Hi there! It looks good to me! > Thanks! But I have a question. How is the partialxlogfname freed in case of an > error? I'm not sure I understand your question. What kind of error would you expect exactly? I mostly added a pfree t

Re: On disable_cost

2024-10-18 Thread Laurenz Albe
Thanks for the fixes; I have only a few quibbles now. On Fri, 2024-10-18 at 23:54 +1300, David Rowley wrote: > --- a/doc/src/sgml/perform.sgml > +++ b/doc/src/sgml/perform.sgml > @@ -578,6 +578,33 @@ WHERE t1.unique1 < 100 AND t1.unique2 = t2.unique2; > discussed below. > > > + > +

Re: Pgoutput not capturing the generated columns

2024-10-18 Thread Shubham Khanna
On Thu, Oct 17, 2024 at 3:59 PM vignesh C wrote: > > On Wed, 16 Oct 2024 at 23:25, Shubham Khanna > wrote: > > > > On Wed, Oct 9, 2024 at 9:08 AM vignesh C wrote: > > > > > > On Tue, 8 Oct 2024 at 11:37, Shubham Khanna > > > wrote: > > > > > > > > On Fri, Oct 4, 2024 at 9:36 AM Peter Smith >

Re: Incorrect comment on pg_shadow view

2024-10-18 Thread Daniel Gustafsson
> On 18 Oct 2024, at 13:50, Antonin Houska wrote: > Attached is a proposal to fix a comment in pg_authid.h. pg_shadow is not (and > obviously should not be) accessible by public: - * pg_shadow and pg_group are now publicly accessible views on pg_authid. + * pg_shadow and pg_group are

Re: Make default subscription streaming option as Parallel

2024-10-18 Thread Amit Kapila
On Fri, Oct 18, 2024 at 9:48 AM Dilip Kumar wrote: > > On Tue, Oct 8, 2024 at 3:38 PM Amit Kapila wrote: >> >> On Tue, Oct 8, 2024 at 2:25 PM shveta malik wrote: >> > >> > On Mon, Oct 7, 2024 at 4:03 PM vignesh C wrote: >> > > >> > >> > With parallel streaming as default, do you think there is

Incorrect comment on pg_shadow view

2024-10-18 Thread Antonin Houska
Attached is a proposal to fix a comment in pg_authid.h. pg_shadow is not (and obviously should not be) accessible by public: postgres=# SELECT relname, relacl FROM pg_class WHERE relname IN ('pg_shadow', 'pg_group'); relname | relacl ---+-

Re: replace strtok()

2024-10-18 Thread Ranier Vilela
Em sex., 18 de out. de 2024 às 06:41, Peter Eisentraut escreveu: > On 16.10.24 09:42, Peter Eisentraut wrote: > > On 15.10.24 14:00, Alexander Lakhin wrote: > >> I also wonder, if other places touched by 5d2e1cc11 need corrections > too. > >> I played with > >> PG_COLOR=always PG_COLORS="error=01

Re: On disable_cost

2024-10-18 Thread David Rowley
On Sat, 12 Oct 2024 at 02:16, Laurenz Albe wrote: > > On Fri, 2024-10-11 at 20:45 +1300, David Rowley wrote: > > +When using the enable/disable flags to disable plan node types, the > > +majority of the flags only deprioritize the corresponding plan node > > I don't like "deprioritize". >

RE: Conflict Detection and Resolution

2024-10-18 Thread Zhijie Hou (Fujitsu)
On Wednesday, October 9, 2024 2:34 PM shveta malik wrote: > > On Wed, Oct 9, 2024 at 8:58 AM shveta malik > wrote: > > > > On Tue, Oct 8, 2024 at 3:12 PM Nisha Moond > wrote: > > > > > > > Please find few comments on v14-patch004: > > patch004: > 1) > GetConflictResolver currently errors out

Re: DOCS - pg_replication_slot . Fix the 'inactive_since' description

2024-10-18 Thread Amit Kapila
On Wed, Oct 16, 2024 at 10:56 PM Bruce Momjian wrote: > > On Mon, Sep 9, 2024 at 01:15:32PM +1000, Peter Smith wrote: > > > > Me too. I created this thread primarily to get the description changed > > to clarify this field represents a moment in time, rather than a > > duration. So I will be happ

Re: Use more CppAsString2() in pg_amcheck.c

2024-10-18 Thread Daniel Gustafsson
> On 18 Oct 2024, at 11:50, Michael Paquier wrote: > pg_amcheck.c is one of these places where relkind and relpersistence > values are hardcoded in queries based on the contents of pg_class_d.h. > Similarly to other places in src/bin/, let's sprinkle some > CppAsString2() and feed to the binary t

unicode test programs don't build with meson

2024-10-18 Thread Peter Eisentraut
The test programs in src/common/unicode/ (case_test, category_test, norm_test), don't build with meson if the nls option is enabled, because a libintl dependency is missing. (pg_strerror_r() in src/port/strerror.c makes a gettext call, so in that sense libpgport has a dependency on libintl.)

Re: Add “FOR UPDATE NOWAIT” lock details to the log.

2024-10-18 Thread Seino Yuki
The choice between adding a new GUC or extending the existing one (e.g., log_lock_waits) is debatable, but I prefer the latter. I'm considering extending log_lock_waits to accept a value like "fail". If set to "on" (the current behavior), detailed logs are generated when the lock wait time excee

Re: Enhance create subscription reference manual

2024-10-18 Thread Amit Kapila
On Fri, Oct 18, 2024 at 9:46 AM Tatsuo Ishii wrote: > > Hi Amit, > > > On Thu, Oct 3, 2024 at 8:53 AM Tatsuo Ishii wrote: > >> > >> > parameter in this case (it is an "optional" parameter, though). However, > >> > when we refer to the stored catalog value, we should call it an option or > >> > a

Use more CppAsString2() in pg_amcheck.c

2024-10-18 Thread Michael Paquier
Hi all, pg_amcheck.c is one of these places where relkind and relpersistence values are hardcoded in queries based on the contents of pg_class_d.h. Similarly to other places in src/bin/, let's sprinkle some CppAsString2() and feed to the binary the values from the header. The patch attached does

Re: Conflict detection for update_deleted in logical replication

2024-10-18 Thread Amit Kapila
On Fri, Oct 11, 2024 at 2:04 PM Zhijie Hou (Fujitsu) wrote: > > > Attach the V4 patch set which addressed above comments. > A few minor comments: 1. + * Retaining the dead tuples for this period is sufficient because any + * subsequent transaction from the publisher will have a later timestamp. +

Re: replace strtok()

2024-10-18 Thread Peter Eisentraut
On 16.10.24 09:42, Peter Eisentraut wrote: On 15.10.24 14:00, Alexander Lakhin wrote: I also wonder, if other places touched by 5d2e1cc11 need corrections too. I played with PG_COLOR=always PG_COLORS="error=01;31" .../initdb and it looks like this free() call in pg_logging_init():        

Re: Wrong security context for deferred triggers?

2024-10-18 Thread Pavel Stehule
pá 18. 10. 2024 v 10:20 odesílatel Laurenz Albe napsal: > On Fri, 2024-10-18 at 07:47 +0200, Pavel Stehule wrote: > > Without deeper checks I don't like using GetUserNameFromId for checking > the validity of a role. > > > > Maybe it is better to use own read of syscache or wrap > SetUserIdAndSecC

Re: Add isolation test template in injection_points for wait/wakeup/detach

2024-10-18 Thread Michael Paquier
On Fri, Oct 18, 2024 at 07:58:26AM +, Bertrand Drouvot wrote: > I think that it makes sense to "expose" the basics in a dedicated test. > > I thought that template.spec could have been another "naming" option but > basic.spec is better I think. I am not wedded to the name I have proposed. N

Re: Recovery of .partial WAL segments

2024-10-18 Thread Stepan Neretin
Hi there! It looks good to me! But I have a question. How is the partialxlogfname freed in case of an error? Best regards, Stepan Neretin.

Re: Remove unlogged materialized view persistence handling

2024-10-18 Thread Fujii Masao
On 2024/10/11 17:06, Fujii Masao wrote: On 2024/10/11 16:18, Yugo NAGATA wrote: On Fri, 11 Oct 2024 14:44:43 +0800 px shi wrote: +1 Materialized view is introduced by 3bf3ab8c563 and at that UNLOGGED was allowed, and it is disallowed by another commit 3223b25ff73. However, it seems tha

Re: Wrong security context for deferred triggers?

2024-10-18 Thread Laurenz Albe
On Fri, 2024-10-18 at 07:47 +0200, Pavel Stehule wrote: > Without deeper checks I don't like using GetUserNameFromId for checking the > validity of a role. > > Maybe it is better to use own read of syscache or wrap SetUserIdAndSecContext > to do this check. I agree; it was just the simplest way

Re: Add isolation test template in injection_points for wait/wakeup/detach

2024-10-18 Thread Bertrand Drouvot
Hi, On Fri, Oct 18, 2024 at 07:44:08AM +0900, Michael Paquier wrote: > Hi all, > > This was on my TODO bucket for some time. The isolation test > "inplace" in the isolation test suite for injection_points relies on a > couple of behaviors implemented in the backend. One of them is that a > poin

Re: allowing extensions to control planner behavior

2024-10-18 Thread Jakub Wartak
Hi Andrei, On Fri, Oct 11, 2024 at 8:21 AM Andrei Lepikhov wrote: > On 10/10/24 23:51, Robert Haas wrote: > > On Wed, Sep 18, 2024 at 11:48 AM Robert Haas > wrote: > > 1. If you want to specify in-query hints using comments, how does your > > extension get access to the comments? > Having desi

Re: Syncrep and improving latency due to WAL throttling

2024-10-18 Thread Jakub Wartak
Hi Soumyadeep & Shirisha, On Wed, Oct 16, 2024 at 8:04 AM Soumyadeep Chakraborty < soumyadeep2...@gmail.com> wrote: > Hey Tomas, > > Would you be interested in registering the patch for CF 2024-11? > > Please let us know if there is anything we can do to help with additional > review > or testing