Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes?

2022-10-26 Thread Michael Paquier
On Thu, Sep 29, 2022 at 08:09:56PM -0700, Nathan Bossart wrote: > Looks reasonable to me. 0001, to move pg_pwritev_with_retry() to a new home, seems fine, so applied. Regarding 0002, using pg_pwrite_zeros() as a routine name, as suggested by Thomas, sounds good to me. However, I am not really a

Re: Allow file inclusion in pg_hba and pg_ident files

2022-10-26 Thread Julien Rouhaud
Hi, On Thu, Oct 27, 2022 at 12:08:31PM +0900, Michael Paquier wrote: > > Putting things afresh, there are two different things here (sorry I > need to see that typed ;p): > 1) How do we want to check reliably the loading of the HBA and ident > files on errors? I guess you meant the failure to

Adding doubly linked list type which stores the number of items in the list

2022-10-26 Thread David Rowley
As part of the AIO work [1], there are quite a number of dlist_heads which a counter is used to keep track on how many items are in the list. We also have a few places in master which do the same thing. In order to tidy this up and to help ensure that the count variable does not get out of sync

Re: [PoC] Improve dead tuple storage for lazy vacuum

2022-10-26 Thread John Naylor
On Thu, Oct 27, 2022 at 9:11 AM Masahiko Sawada wrote: > > True. I'm going to start with 6 bytes and will consider reducing it to > 5 bytes. Okay, let's plan on 6 for now, so we have the worst-case sizes up front. As discussed, I will attempt the size class decoupling after v8 and see how it

Re: Allow file inclusion in pg_hba and pg_ident files

2022-10-26 Thread Michael Paquier
On Wed, Oct 26, 2022 at 11:32:14PM +0800, Julien Rouhaud wrote: > Have you already done a rebase while working on the patch or are you intending > to take care of it, or should I? Let's no both do the work :) Spoiler alert: I have not done a rebase yet ;) -- Michael signature.asc Description:

Re: Allow file inclusion in pg_hba and pg_ident files

2022-10-26 Thread Michael Paquier
On Wed, Oct 26, 2022 at 11:32:14PM +0800, Julien Rouhaud wrote: > I don't mind taking care of that, but before doing so I'd like to have some > feedback on whether you're ok with my approach (per my initial email about it > at [1]) or if you had some different > ideas on how to do it. Putting

Re: GUC values - recommended way to declare the C variables?

2022-10-26 Thread Michael Paquier
On Wed, Oct 26, 2022 at 09:49:34PM -0500, Justin Pryzby wrote: > In v4, Peter posted a 2-patch series with my patch as 001. > But I pointed out that it's better to fix the initialization of the > compile-time GUCs rather than exclude them from the check. > Then Peter submitted v5 whcih does that,

Re: Use LIMIT instead of Unique for DISTINCT when all distinct pathkeys are redundant

2022-10-26 Thread Richard Guo
On Wed, Oct 26, 2022 at 4:25 PM David Rowley wrote: > One other thought I had about the duplicate "Limit" node in the final > plan was that we could make the limit clause an Expr like > LEAST(, 1). That way we could ensure we get at > most 1 row, but perhaps less if the expression given in the

Re: GUC values - recommended way to declare the C variables?

2022-10-26 Thread Peter Smith
On Thu, Oct 27, 2022 at 1:33 PM Michael Paquier wrote: > > On Wed, Oct 26, 2022 at 09:14:37PM -0500, Justin Pryzby wrote: > > It seems like you're reviewing the previous version of the patch, rather > > than the one attached to the message you responded to (which doesn't > > have anything to do

Re: GUC values - recommended way to declare the C variables?

2022-10-26 Thread Justin Pryzby
On Thu, Oct 27, 2022 at 11:33:48AM +0900, Michael Paquier wrote: > On Wed, Oct 26, 2022 at 09:14:37PM -0500, Justin Pryzby wrote: > > It seems like you're reviewing the previous version of the patch, rather > > than the one attached to the message you responded to (which doesn't > > have anything

Re: generic plans and "initial" pruning

2022-10-26 Thread Amit Langote
On Mon, Oct 17, 2022 at 6:29 PM Amit Langote wrote: > On Wed, Oct 12, 2022 at 4:36 PM Amit Langote wrote: > > On Fri, Jul 29, 2022 at 1:20 PM Amit Langote > > wrote: > > > On Thu, Jul 28, 2022 at 1:27 AM Robert Haas wrote: > > > > 0001 adds es_part_prune_result but does not use it, so maybe

RE: Perform streaming logical transactions by background workers and parallel apply

2022-10-26 Thread shiy.f...@fujitsu.com
On Wed, Oct 26, 2022 7:19 PM Amit Kapila wrote: > > On Tue, Oct 25, 2022 at 8:38 AM Masahiko Sawada > wrote: > > > > On Fri, Oct 21, 2022 at 6:32 PM houzj.f...@fujitsu.com > > wrote: > > > > I've started to review this patch. I tested v40-0001 patch and have > > one question: > > > > IIUC even

Re: GUC values - recommended way to declare the C variables?

2022-10-26 Thread Michael Paquier
On Wed, Oct 26, 2022 at 09:14:37PM -0500, Justin Pryzby wrote: > It seems like you're reviewing the previous version of the patch, rather > than the one attached to the message you responded to (which doesn't > have anything to do with GUC_DEFAULT_COMPILE). It does not seem so as things stand, I

Re: GUC values - recommended way to declare the C variables?

2022-10-26 Thread Justin Pryzby
On Thu, Oct 27, 2022 at 11:06:56AM +0900, Michael Paquier wrote: > On Wed, Oct 26, 2022 at 06:31:56PM +1100, Peter Smith wrote: > > I re-checked all the GUC C vars which your patch flags as > > GUC_DEFAULT_COMPILE. For some of them, where it was not any trouble, I > > made the C var assignment use

Re: [PoC] Improve dead tuple storage for lazy vacuum

2022-10-26 Thread Masahiko Sawada
On Wed, Oct 26, 2022 at 8:06 PM John Naylor wrote: > > On Mon, Oct 24, 2022 at 12:54 PM Masahiko Sawada > wrote: > > > I've attached updated PoC patches for discussion and cfbot. From the > > previous version, I mainly changed the following things: > > Thank you for the comments! > > *

Re: GUC values - recommended way to declare the C variables?

2022-10-26 Thread Michael Paquier
On Wed, Oct 26, 2022 at 06:31:56PM +1100, Peter Smith wrote: > I re-checked all the GUC C vars which your patch flags as > GUC_DEFAULT_COMPILE. For some of them, where it was not any trouble, I > made the C var assignment use the same preprocessor rules as used by > guc_tables. For others (mostly

Re: Some regression tests for the pg_control_*() functions

2022-10-26 Thread Michael Paquier
On Wed, Oct 26, 2022 at 01:41:12PM +0530, Bharath Rupireddy wrote: > We will have bigger problems when a backend corrupts the pg_control > file, no? The bigger problems could be that the server won't come up > or it behaves abnormally or some other. Possibly, yes. > Can't the CRC check detect

Re: confused with name in the pic

2022-10-26 Thread David G. Johnston
On Wed, Oct 26, 2022 at 2:13 AM jack...@gmail.com wrote: > typedef struct A_Expr > > > > { > > > > pg_node_attr(custom_read_write) > > > > NodeTag type; > > > > A_Expr_Kind kind; /* see above */ > > > > List *name; /* possibly-qualified name of

Re: Documentation for building with meson

2022-10-26 Thread samay sharma
Hi, On Wed, Oct 19, 2022 at 7:43 PM Justin Pryzby wrote: > On Wed, Oct 19, 2022 at 11:35:10AM -0700, samay sharma wrote: > > Creating a new thread focussed on adding docs for building Postgres with > > meson. This is a spinoff from the original thread [1] and I've attempted > to > > address all

Re: pg_stat_bgwriter.buffers_backend is pretty meaningless (and more?)

2022-10-26 Thread Andres Freund
Hi, On 2022-10-24 14:38:52 -0400, Melanie Plageman wrote: > > - "repossession" is a very unintuitive name for me. If we want something > > like > > it, can't we just name it reuse_failed or such? > > Repossession could be called eviction_failed or reuse_failed. > Do we think we will ever want

Re: pg_stat_bgwriter.buffers_backend is pretty meaningless (and more?)

2022-10-26 Thread Melanie Plageman
okay, so I realized v35 had an issue where I wasn't counting strategy evictions correctly. fixed in attached v36. This made me wonder if there is actually a way to add a test for evictions (in strategy and shared contexts) that is not flakey. On Sun, Oct 23, 2022 at 6:48 PM Maciek Sakrejda

Re: Allow file inclusion in pg_hba and pg_ident files

2022-10-26 Thread Julien Rouhaud
On Wed, Oct 26, 2022 at 03:56:07PM +0900, Michael Paquier wrote: > > So, I have spent a good portion of today looking at what you have > here, applying 0001 and 0003 while fixing, rebasing and testing the > whole, discarding 0002 (we could do more for the line number and > source file in terms of

Re: Stack overflow issue

2022-10-26 Thread Egor Chindyaskin
24.08.2022 20:58, Tom Lane writes: Nice work! I wonder if you can make the regex crashes reachable by reducing the value of max_stack_depth enough that it's hit before reaching the "regular expression is too complex" limit. regards, tom lane Hello everyone! It's been a

Re: Reducing duplicativeness of EquivalenceClass-derived clauses

2022-10-26 Thread Tom Lane
Richard Guo writes: > On Wed, Oct 26, 2022 at 6:09 AM Tom Lane wrote: >> The only thing that I think might be controversial here is that >> I dropped the check for matching operator OID. To preserve that, >> we'd have needed to use get_commutator() in the reverse-match cases, >> which it seemed

Re: Perform streaming logical transactions by background workers and parallel apply

2022-10-26 Thread Amit Kapila
On Tue, Oct 25, 2022 at 8:38 AM Masahiko Sawada wrote: > > On Fri, Oct 21, 2022 at 6:32 PM houzj.f...@fujitsu.com > wrote: > > I've started to review this patch. I tested v40-0001 patch and have > one question: > > IIUC even when most of the changes in the transaction are filtered out > in

Re: [PoC] Improve dead tuple storage for lazy vacuum

2022-10-26 Thread John Naylor
On Mon, Oct 24, 2022 at 12:54 PM Masahiko Sawada wrote: > I've attached updated PoC patches for discussion and cfbot. From the > previous version, I mainly changed the following things: > > * Separate treatment of inner and leaf nodes Overall, this looks much better! > * Pack both the node

Re: Reducing duplicativeness of EquivalenceClass-derived clauses

2022-10-26 Thread Richard Guo
On Wed, Oct 26, 2022 at 6:09 AM Tom Lane wrote: > While fooling with my longstanding outer-join variables changes > (I am making progress on that, honest), I happened to notice that > equivclass.c is leaving some money on the table by generating > redundant RestrictInfo clauses. It already

Re: Have nodeSort.c use datum sorts single-value byref types

2022-10-26 Thread David Rowley
On Thu, 29 Sept 2022 at 18:12, David Rowley wrote: > In the attached patch, I've added a function named > tuplesort_getdatum_nocopy() which is the same as tuplesort_getdatum() > only without the datumCopy(). I opted for the new function rather than > a new parameter in the existing function just

Re: replacing role-level NOINHERIT with a grant-level option

2022-10-26 Thread Pavel Luzanov
Hello, Thanks for reviewing. Committed. Let me return to this topic. After looking at the changes in this patch, I have a suggestion. The inheritance option for role memberships is important information to know if the role privileges will be available automatically or if a switch with a

Re: Suppressing useless wakeups in walreceiver

2022-10-26 Thread Bharath Rupireddy
On Sun, Oct 16, 2022 at 9:29 AM Nathan Bossart wrote: > > Here's a different take. Instead of creating structs and altering function > signatures, we can just make the wake-up times file-global, and we can skip > the changes related to reducing the number of calls to > GetCurrentTimestamp() for

confused with name in the pic

2022-10-26 Thread jack...@gmail.com
typedef struct A_Expr { pg_node_attr(custom_read_write) NodeTag type; A_Expr_Kind kind;   /* see above */ List   *name;   /* possibly-qualified name of operator */ Node   *lexpr;  /* left argument, or NULL if none */

Re: Use LIMIT instead of Unique for DISTINCT when all distinct pathkeys are redundant

2022-10-26 Thread David Rowley
On Fri, 14 Oct 2022 at 15:15, Richard Guo wrote: > The v3 patch looks good to me. Thank you for looking at that. One other thought I had about the duplicate "Limit" node in the final plan was that we could make the limit clause an Expr like LEAST(, 1). That way we could ensure we get at most 1

Re: Some regression tests for the pg_control_*() functions

2022-10-26 Thread Bharath Rupireddy
On Wed, Oct 26, 2022 at 12:48 PM Michael Paquier wrote: > > On Wed, Oct 26, 2022 at 10:13:29AM +0530, Bharath Rupireddy wrote: > > +1 for improving the test coverage. Is there a strong reason to > > validate individual output columns rather than select count(*) > 0 > > from pg_control_();

Re: GUC values - recommended way to declare the C variables?

2022-10-26 Thread Peter Smith
Thanks for the feedback. PSA the v5 patch. On Wed, Oct 26, 2022 at 7:04 AM Justin Pryzby wrote: > > +#ifdef USE_ASSERT_CHECKING > + sanity_check_GUC_C_var(hentry->gucvar); > +#endif > > => You can conditionally define that as an empty function so #ifdefs > aren't needed in the

Re: Some regression tests for the pg_control_*() functions

2022-10-26 Thread Michael Paquier
On Wed, Oct 26, 2022 at 10:13:29AM +0530, Bharath Rupireddy wrote: > +1 for improving the test coverage. Is there a strong reason to > validate individual output columns rather than select count(*) > 0 > from pg_control_(); sort of tests? If the intention is to validate > the pg_controlfile

Re: Allow file inclusion in pg_hba and pg_ident files

2022-10-26 Thread Michael Paquier
On Wed, Oct 26, 2022 at 11:19:48AM +0800, Julien Rouhaud wrote: > That wouldn't be overdoing anymore if we remove the line number / filename > from > the fill_*_line prototypes right? So, I have spent a good portion of today looking at what you have here, applying 0001 and 0003 while fixing,

Re: Move backup-related code to xlogbackup.c/.h

2022-10-26 Thread Bharath Rupireddy
On Mon, Oct 24, 2022 at 1:00 PM Michael Paquier wrote: > > On Wed, Oct 19, 2022 at 09:07:04PM +0530, Bharath Rupireddy wrote: > > XLogBackupResetRunning() seemed better. +1 for above function names. > > I see what you are doing here. XLogCtl would still live in xlog.c, > but we want to have