Re: Reducing power consumption on idle servers

2022-03-24 Thread Kyotaro Horiguchi
At Thu, 10 Mar 2022 11:45:10 -0800, Andres Freund wrote in > Hi, > > On 2022-03-10 17:50:47 +, Simon Riggs wrote: > > On Wed, 9 Mar 2022 at 01:16, Zheng Li wrote: > > > > > > 1. Standardize the hibernation time at 60s, using a #define > > > > HIBERNATE_DELAY_SEC 60 > > > > > > I notice in

Re: Summary Sort workers Stats in EXPLAIN ANALYZE

2022-03-24 Thread Jian Guo
For a simple demo, with this explain statement: -- Test sort stats summary set force_parallel_mode=on; select explain_filter('explain (analyze, summary off, timing off, costs off, format json) select * from tenk1 order by unique1'); Before this patch, we got plan like this: "Node Ty

Re: Allow file inclusion in pg_hba and pg_ident files

2022-03-24 Thread Michael Paquier
On Wed, Mar 23, 2022 at 01:14:02PM +0900, Michael Paquier wrote: > On Wed, Mar 23, 2022 at 10:16:34AM +0800, Julien Rouhaud wrote: >> Yeah, I thought about it but didn't rename it given your concerns about git >> history. I'm fine either way. > > Oh, OK. The amount of diffs created by 0001 is st

Re: Patch proposal - parameter to limit amount of FPW because of hint bits per second

2022-03-24 Thread Michail Nikolaev
Hello, Peter. >> * Add code to _bt_killitems() that detects if it has generated an FPI, >> just to set some LP_DEAD bits. >> * Instead of avoiding the FPI when this happens, proactively call >> _bt_simpledel_pass() just before _bt_killitems() returns. Accept the >> immediate cost of setting an LP_

Re: Allow file inclusion in pg_hba and pg_ident files

2022-03-24 Thread Julien Rouhaud
On Thu, Mar 24, 2022 at 04:50:31PM +0900, Michael Paquier wrote: > On Wed, Mar 23, 2022 at 01:14:02PM +0900, Michael Paquier wrote: > > On Wed, Mar 23, 2022 at 10:16:34AM +0800, Julien Rouhaud wrote: > >> Yeah, I thought about it but didn't rename it given your concerns about git > >> history. I'm

Re: [PATCH] Accept IP addresses in server certificate SANs

2022-03-24 Thread Kyotaro Horiguchi
At Wed, 23 Mar 2022 23:52:06 +, Jacob Champion wrote in > On Wed, 2022-03-23 at 14:20 +0900, Kyotaro Horiguchi wrote: > > I tried to write out the doc part. What do you think about it? > > I like it, thanks! I've applied that in v10, with a tweak to two > iPAddress spellings and a short ex

Re: Assert in pageinspect with NULL pages

2022-03-24 Thread Julien Rouhaud
Hi, On Wed, Mar 23, 2022 at 05:16:41PM +0900, Michael Paquier wrote: > On Fri, Mar 18, 2022 at 06:43:39AM +0300, Alexander Lakhin wrote: > > Hello Michael, > > No, just x86_64, Ubuntu 20.04, gcc 11, valgrind 3.15. I just put that query > > in page.sql and see the server abort. > > Bah, of course,

Re: [PATCH] add relation and block-level filtering to pg_waldump

2022-03-24 Thread Thomas Munro
On Tue, Mar 22, 2022 at 12:01 PM David Christensen wrote: > Enclosed is v6, incorporating these fixes and docs tweaks. Thanks! I made a couple of minor changes in the docs, to wit: fixed copy/paste-o "-F block" -> "-F fork", fork names didn't have initial caps elsewhere, tablespace is better rep

Re: Remove an unnecessary errmsg_plural in dependency.c

2022-03-24 Thread Daniel Gustafsson
> On 24 Mar 2022, at 06:17, Kyotaro Horiguchi wrote: > The comment and errmsg_plural don't seem to be consistent. When the > code was added by c4f2a0458d, it had only singular form and already > had the comment. After that 8032d76b5 turned it to errmsg_plural > ignoring the comment. It seems l

Re: pg_walinspect - a new extension to get raw WAL data and WAL stats

2022-03-24 Thread Bharath Rupireddy
On Thu, Mar 24, 2022 at 10:22 AM Kyotaro Horiguchi wrote: > +void > +XLogRecGetBlockRefInfo(XLogReaderState *record, char *delimiter, > + uint32 *fpi_len, bool > detailed_format, > + StringInfo buf) > ... > +

Re: add checkpoint stats of snapshot and mapping files of pg_logical dir

2022-03-24 Thread Bharath Rupireddy
On Thu, Mar 24, 2022 at 8:58 AM Bharath Rupireddy wrote: > > On Wed, Mar 23, 2022 at 10:16 AM Bharath Rupireddy > wrote: > > > > On Tue, Mar 22, 2022 at 8:12 PM Andres Freund wrote: > > > > Do you mean like this? > > > > ereport(LOG, > > > > /* translator: the placeholders show checkpoin

Re: Support logical replication of DDLs

2022-03-24 Thread Dilip Kumar
On Mon, Mar 21, 2022 at 1:43 PM Dilip Kumar wrote: > > On Thu, Mar 17, 2022 at 2:47 AM Zheng Li wrote: > > > > Hi, > > > > >If you don't mind, would you like to share the POC or the branch for this > > >work? > > > > The POC patch is attached. It currently supports the following > > functionali

Re: proposal - psql - use pager for \watch command

2022-03-24 Thread Thomas Munro
On Wed, Jul 14, 2021 at 6:06 AM Pavel Stehule wrote: > út 13. 7. 2021 v 19:50 odesílatel Tom Lane napsal: >> After playing with this along the way to fixing the sigwait issues, >> I have a gripe/suggestion. If I hit control-C while the thing >> is waiting between queries, eg >> >> regression=# s

turn fastgetattr and heap_getattr to inline functions

2022-03-24 Thread Alvaro Herrera
This patch should silence some recent Coverity (false positive) complaints about assertions contained in these macros. Portability testing at: https://cirrus-ci.com/github/alvherre/postgres/macros-to-inlinefuncs Intend to push later today, unless something ugly happens. -- Álvaro Herrera

Re: proposal - psql - use pager for \watch command

2022-03-24 Thread Pavel Stehule
čt 24. 3. 2022 v 11:05 odesílatel Thomas Munro napsal: > On Wed, Jul 14, 2021 at 6:06 AM Pavel Stehule > wrote: > > út 13. 7. 2021 v 19:50 odesílatel Tom Lane napsal: > >> After playing with this along the way to fixing the sigwait issues, > >> I have a gripe/suggestion. If I hit control-C whi

Re: Parameter for planner estimate of recursive queries

2022-03-24 Thread Simon Riggs
On Wed, 23 Mar 2022 at 20:25, Tom Lane wrote: > > Simon Riggs writes: > >> [New patch version pending] > > Do you have any objection if I rename the GUC to > recursive_worktable_factor? That seems a bit clearer as to what > it does, and it leaves more room for other knobs in the same area > if w

Re: Logical replication timeout problem

2022-03-24 Thread Amit Kapila
On Tue, Mar 22, 2022 at 7:25 AM wangw.f...@fujitsu.com wrote: > > Attach the new patch. > It seems by mistake you have removed the changes from pgoutput_message and pgoutput_truncate functions. I have added those back. Additionally, I made a few other changes: (a) moved the function UpdateProgres

Re: Documenting when to retry on serialization failure

2022-03-24 Thread Simon Riggs
On Wed, 23 Mar 2022 at 19:50, Tom Lane wrote: > > Simon Riggs writes: > > I've tried to sum up the various points from everybody into this doc > > patch. Thanks all for replies. > > This seemed rather badly in need of copy-editing. How do you > like the attached text? Seems clear and does the j

Re: [PATCH] add relation and block-level filtering to pg_waldump

2022-03-24 Thread Peter Eisentraut
On 23.03.22 23:54, Thomas Munro wrote: That's because ForkNum is a signed type. You will probably succeed if you use "%d" instead. Erm, is that really OK? C says "Each enumerated type shall be compatible with char, a signed integer type, or an unsigned integer type. The choice of type is impl

Re: Reducing power consumption on idle servers

2022-03-24 Thread Simon Riggs
On Thu, 24 Mar 2022 at 07:16, Kyotaro Horiguchi wrote: > > Most of these timeouts are a bad idea and should not exist. We repeatedly > > have > > had bugs where we were missing wakeups etc but those bugs were harder to > > I basically agree to this. As a general point, maybe. But we have a lot

Re: Documenting when to retry on serialization failure

2022-03-24 Thread Thomas Munro
On Thu, Mar 24, 2022 at 11:44 PM Simon Riggs wrote: > The unique violation thing is worryingly general. Do we know enough to > say that this is thought to occur only with a) multiple unique > constraints, b) exclusion constraints? I'm aware of 3 cases. The two you mentioned, which I think we can

Re: [PATCH] add relation and block-level filtering to pg_waldump

2022-03-24 Thread Peter Eisentraut
On 24.03.22 11:57, Peter Eisentraut wrote: On 23.03.22 23:54, Thomas Munro wrote: That's because ForkNum is a signed type.  You will probably succeed if you use "%d" instead. Erm, is that really OK?  C says "Each enumerated type shall be compatible with char, a signed integer type, or an unsig

Re: [PATCH] add relation and block-level filtering to pg_waldump

2022-03-24 Thread Thomas Munro
On Fri, Mar 25, 2022 at 12:01 AM Peter Eisentraut wrote: > Or even: Why are we exposing fork *numbers* in the user interface? > Even low-level tools such as pageinspect use fork *names* in their > interface. I wondered about that but thought it seemed OK for such a low level tool. It's a fair p

Re: MDAM techniques and Index Skip Scan patch

2022-03-24 Thread Jesper Pedersen
On 3/23/22 18:22, Dmitry Dolgov wrote: The CF item could be set to RwF, what would you say, Jesper? We want to thank the community for the feedback that we have received over the years for this feature. Hopefully a future implementation can use Tom's suggestions to get closer to a committab

Re: Support logical replication of DDLs

2022-03-24 Thread Dilip Kumar
On Thu, Mar 24, 2022 at 3:32 PM Dilip Kumar wrote: > > On Mon, Mar 21, 2022 at 1:43 PM Dilip Kumar wrote: > > > > On Thu, Mar 17, 2022 at 2:47 AM Zheng Li wrote: > > > > > > Hi, > > > > > > >If you don't mind, would you like to share the POC or the branch for > > > >this work? > > > > > > The P

Re: Index Skip Scan (new UniqueKeys)

2022-03-24 Thread Jesper Pedersen
On 6/9/20 06:22, Dmitry Dolgov wrote: Here is a new version of index skip scan patch, based on v8 patch for UniqueKeys implementation from [1]. I want to start a new thread to simplify navigation, hopefully I didn't forget anyone who actively participated in the discussion. This CommitFest ent

Re: [PATCH] add relation and block-level filtering to pg_waldump

2022-03-24 Thread Thomas Munro
On Fri, Mar 25, 2022 at 12:26 AM Thomas Munro wrote: > On Fri, Mar 25, 2022 at 12:01 AM Peter Eisentraut > wrote: > > Or even: Why are we exposing fork *numbers* in the user interface? > > Even low-level tools such as pageinspect use fork *names* in their > > interface. > > I wondered about that

Re: turn fastgetattr and heap_getattr to inline functions

2022-03-24 Thread Michael Paquier
On Thu, Mar 24, 2022 at 11:21:07AM +0100, Alvaro Herrera wrote: > This patch should silence some recent Coverity (false positive) > complaints about assertions contained in these macros. The logic looks fine. Good idea to get rid of DISABLE_COMPLEX_MACRO. > Portability testing at: > https://cirr

Re: Estimating HugePages Requirements?

2022-03-24 Thread Michael Paquier
On Wed, Mar 23, 2022 at 03:25:48PM +0900, Michael Paquier wrote: > My solution for the docs is perhaps too confusing for the end-user, > and we are talking about a Linux-only thing here anyway. So, at the > end, I am tempted to just add the "2> /dev/null" as suggested upthread > by Nathan and call

Re: pg_stat_reset_single_*_counters vs pg_stat_database.stats_reset

2022-03-24 Thread Tomas Vondra
On 3/24/22 01:59, Andres Freund wrote: > Hi, > > On 2022-03-23 17:55:16 -0700, Andres Freund wrote: >> Maybe I just don't understand what these reset functions are intended for? >> Their introduction [3] didn't explain much either. To me the behaviour of >> resetting pg_stat_database.stats_reset b

Re: Documenting when to retry on serialization failure

2022-03-24 Thread Simon Riggs
On Thu, 24 Mar 2022 at 11:01, Thomas Munro wrote: > > On Thu, Mar 24, 2022 at 11:44 PM Simon Riggs > wrote: > > The unique violation thing is worryingly general. Do we know enough to > > say that this is thought to occur only with a) multiple unique > > constraints, b) exclusion constraints? > >

Re: [PATCH] add relation and block-level filtering to pg_waldump

2022-03-24 Thread David Christensen
> On Mar 24, 2022, at 6:43 AM, Thomas Munro wrote: > > On Fri, Mar 25, 2022 at 12:26 AM Thomas Munro wrote: >>> On Fri, Mar 25, 2022 at 12:01 AM Peter Eisentraut >>> wrote: >>> Or even: Why are we exposing fork *numbers* in the user interface? >>> Even low-level tools such as pageinspect us

Re: TAP output format in pg_regress

2022-03-24 Thread Daniel Gustafsson
> On 22 Mar 2022, at 00:49, Andres Freund wrote: > This is failing with segmentation faults on cfbot: > https://cirrus-ci.com/task/4879227009892352?logs=test_world#L21 > > Looks like something around isolationtester is broken? It could be triggered by plpgsql tests as well, and was (as usual) a

Re: Remove an unnecessary errmsg_plural in dependency.c

2022-03-24 Thread Bharath Rupireddy
On Thu, Mar 24, 2022 at 2:34 PM Daniel Gustafsson wrote: > > > On 24 Mar 2022, at 06:17, Kyotaro Horiguchi wrote: > > > The comment and errmsg_plural don't seem to be consistent. When the > > code was added by c4f2a0458d, it had only singular form and already > > had the comment. After that 803

Re: multithreaded zstd backup compression for client and server

2022-03-24 Thread Robert Haas
On Wed, Mar 23, 2022 at 7:07 PM Justin Pryzby wrote: > Did you try this on windows at all ? It's probably no surprise that zstd > implements threading differently there. I did not. I haven't had a properly functioning Windows development environment in about a decade. -- Robert Haas EDB: http:

Re: Remove an unnecessary errmsg_plural in dependency.c

2022-03-24 Thread Peter Eisentraut
On 24.03.22 13:48, Bharath Rupireddy wrote: Yes, the singular version of the message isn't required at all as numReportedClient > 1. Hence I proposed to remove errmsg_plural and singular version. The issue is that n == 1 and n != 1 are not the only cases that errmsg_plural() handles. Some l

Re: Estimating HugePages Requirements?

2022-03-24 Thread Magnus Hagander
On Wed, Mar 23, 2022 at 7:25 AM Michael Paquier wrote: > > On Tue, Mar 15, 2022 at 03:44:39PM -0700, Nathan Bossart wrote: > > A simple approach could be to just set log_min_messages to PANIC before > > exiting. I've attached a patch for this. With this patch, we'll still see > > a FATAL if we t

Re: Remove an unnecessary errmsg_plural in dependency.c

2022-03-24 Thread Peter Eisentraut
On 24.03.22 06:17, Kyotaro Horiguchi wrote: The comment and errmsg_plural don't seem to be consistent. When the code was added by c4f2a0458d, it had only singular form and already had the comment. After that 8032d76b5 turned it to errmsg_plural ignoring the comment. It seems like a thinko of 8

Re: Remove an unnecessary errmsg_plural in dependency.c

2022-03-24 Thread Daniel Gustafsson
> On 24 Mar 2022, at 14:07, Peter Eisentraut > wrote: > > On 24.03.22 06:17, Kyotaro Horiguchi wrote: >> The comment and errmsg_plural don't seem to be consistent. When the >> code was added by c4f2a0458d, it had only singular form and already >> had the comment. After that 8032d76b5 turned it

Re: unlogged sequences

2022-03-24 Thread Peter Eisentraut
Here is an updated patch that now also includes SET LOGGED/UNLOGGED support. So this version addresses all known issues and open problems. On 28.02.22 10:56, Peter Eisentraut wrote: rebased patch, no functional changes On 11.02.22 10:12, Peter Eisentraut wrote: On 25.06.19 20:37, Andres Fre

Re: multithreaded zstd backup compression for client and server

2022-03-24 Thread Dagfinn Ilmari Mannsåker
Hi Robert, I haven't reviewed the meat of the patch in detail, but I noticed something in the tests: Robert Haas writes: > diff --git a/src/bin/pg_verifybackup/t/009_extract.pl > b/src/bin/pg_verifybackup/t/009_extract.pl > index 9f9cc7540b..e17e7cad51 100644 > --- a/src/bin/pg_verifybackup/t/0

Re: turn fastgetattr and heap_getattr to inline functions

2022-03-24 Thread Alvaro Herrera
On 2022-Mar-24, Michael Paquier wrote: > Hmm. I think that you'd better add a return at the end of each > function? Some compilers are dumb in detecting that all the code > paths return (aka recent d0083c1) and could generate warnings, even if > things are coded to return all the time, like in

Re: Remove an unnecessary errmsg_plural in dependency.c

2022-03-24 Thread Bharath Rupireddy
On Thu, Mar 24, 2022 at 6:35 PM Peter Eisentraut wrote: > > On 24.03.22 13:48, Bharath Rupireddy wrote: > > Yes, the singular version of the message isn't required at all as > > numReportedClient > 1. Hence I proposed to remove errmsg_plural and > > singular version. > > The issue is that n == 1 a

Re: turn fastgetattr and heap_getattr to inline functions

2022-03-24 Thread Japin Li
On Thu, 24 Mar 2022 at 21:26, Alvaro Herrera wrote: > On 2022-Mar-24, Michael Paquier wrote: > >> Hmm. I think that you'd better add a return at the end of each >> function? Some compilers are dumb in detecting that all the code >> paths return (aka recent d0083c1) and could generate warnings,

Re: multithreaded zstd backup compression for client and server

2022-03-24 Thread Robert Haas
On Wed, Mar 23, 2022 at 7:31 PM Andres Freund wrote: > I found this the following section in the manual [1]: > > ZSTD_c_nbWorkers=400,/* Select how many threads will be spawned to > compress in parallel. > * When nbWorkers >= 1, triggers asynchronous > mode

Re: Documenting when to retry on serialization failure

2022-03-24 Thread Tom Lane
Thomas Munro writes: > On Thu, Mar 24, 2022 at 11:44 PM Simon Riggs > wrote: >> The unique violation thing is worryingly general. Do we know enough to >> say that this is thought to occur only with a) multiple unique >> constraints, b) exclusion constraints? > I'm aware of 3 cases. The two you

Re: Remove an unnecessary errmsg_plural in dependency.c

2022-03-24 Thread Tom Lane
Bharath Rupireddy writes: > Thanks. I think I get the point - is it dngettext doing things > differently for different languages? Yeah. To be concrete, have a look in ru.po: #: catalog/dependency.c:1208 #, c-format msgid "drop cascades to %d other object" msgid_plural "drop cascades to %d other

Re: Remove an unnecessary errmsg_plural in dependency.c

2022-03-24 Thread Alvaro Herrera
On 2022-Mar-24, Bharath Rupireddy wrote: > Thanks. I think I get the point - is it dngettext doing things > differently for different languages? Yes. The dngettext() rules are embedded in each translation's catalog file: $ git grep 'Plural-Forms' src/backend/po/*.po de.po:"Plural-Forms: nplural

Re: Documenting when to retry on serialization failure

2022-03-24 Thread Simon Riggs
On Thu, 24 Mar 2022 at 14:05, Tom Lane wrote: > > Thomas Munro writes: > > On Thu, Mar 24, 2022 at 11:44 PM Simon Riggs > > wrote: > >> The unique violation thing is worryingly general. Do we know enough to > >> say that this is thought to occur only with a) multiple unique > >> constraints, b)

Re: turn fastgetattr and heap_getattr to inline functions

2022-03-24 Thread Alvaro Herrera
On 2022-Mar-24, Japin Li wrote: > I want to know why we do not use the following style? > > +static inline Datum > +heap_getattr(HeapTuple tup, int attnum, TupleDesc tupleDesc, bool *isnull) > +{ > + if (attnum > 0) > + { > + if (attnum > (int) HeapTupleHeaderGetNatts(tup->t_d

Re: Remove an unnecessary errmsg_plural in dependency.c

2022-03-24 Thread Tom Lane
Alvaro Herrera writes: > $ git grep 'Plural-Forms' src/backend/po/*.po > ru.po:"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 > && n" Oh, interesting: if I'm reading that right, all three Russian forms are reachable, even with the knowledge that n > 1. (But isn't the last

Re: Documenting when to retry on serialization failure

2022-03-24 Thread Tom Lane
Simon Riggs writes: > OK, I see what you mean. There are 2 types of transaction, one that > reads inside the transaction, one that decides what value to use some > other way. > So now we have 2 cases, both of which generate uniqueness violations, > but only one of which might succeed if retried.

Re: Remove an unnecessary errmsg_plural in dependency.c

2022-03-24 Thread Alvaro Herrera
On 2022-Mar-24, Tom Lane wrote: > Alvaro Herrera writes: > > $ git grep 'Plural-Forms' src/backend/po/*.po > > ru.po:"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 > > && n" > > Oh, interesting: if I'm reading that right, all three Russian > forms are reachable, even with

Re: Use -fvisibility=hidden for shared libraries

2022-03-24 Thread Peter Eisentraut
On 11.01.22 03:53, Andres Freund wrote: Ugh. In the case of worker_spi it's because -fvisibility=hidden isn't applied to worker_spi.c at all. Which in turn is because Makefile.shlib isn't used at all for MODULES= style modules just for MODULE_big= ones :(. Once that's "fixed" it fails as expecte

Re: [RFC] building postgres with meson -v6

2022-03-24 Thread Peter Eisentraut
On 09.03.22 13:37, Peter Eisentraut wrote: v6-0008-meson-prereq-Handle-DLSUFFIX-in-msvc-builds-simil.patch.gz I think the right way here is actually to go the other way around: Move DLSUFFIX into header files for all platforms.  Move the DLSUFFIX assignment from src/makefiles/ to src/templates/,

Re: XID formatting and SLRU refactorings (was: Add 64-bit XIDs into PostgreSQL 15)

2022-03-24 Thread Pavel Borisov
Hi, Peter! Thanks for your review! About v25-0001-Use-unsigned-64-bit-numbering-of-SLRU-pages.patch: > > -static bool CLOGPagePrecedes(int page1, int page2); > +static bool CLOGPagePrecedes(uint64 page1, uint64 page2); > > You are changing the API from signed to unsigned. Is this intentional? > I

Re: XID formatting and SLRU refactorings (was: Add 64-bit XIDs into PostgreSQL 15)

2022-03-24 Thread Pavel Borisov
Just forgot to mention that answers in a previous message are describing the changes that are in v26. -- Best regards, Pavel Borisov Postgres Professional: http://postgrespro.com

Re: [PATCH] Accept IP addresses in server certificate SANs

2022-03-24 Thread Jacob Champion
On Thu, 2022-03-24 at 17:10 +0900, Kyotaro Horiguchi wrote: > I'm fine with it. Thanks. I marked it as Ready-for-Commiter. Thank you for the reviews and feedback! --Jacob

Re: Reducing power consumption on idle servers

2022-03-24 Thread Robert Haas
On Thu, Mar 24, 2022 at 6:59 AM Simon Riggs wrote: > The proposals of this patch are the following, each of which can be > independently accepted/rejected: > 1. fix the sleep pattern of bgwriter, walwriter and logical worker > (directly affects powersave) > 2. deprecate promote_trigger_file, which

Re: [RFC] building postgres with meson -v6

2022-03-24 Thread Andres Freund
Hi, On 2022-03-24 16:16:15 +0100, Peter Eisentraut wrote: > On 09.03.22 13:37, Peter Eisentraut wrote: > > v6-0008-meson-prereq-Handle-DLSUFFIX-in-msvc-builds-simil.patch.gz > > > > I think the right way here is actually to go the other way around: > > Move DLSUFFIX into header files for all plat

Re: turn fastgetattr and heap_getattr to inline functions

2022-03-24 Thread Japin Li
On Thu, 24 Mar 2022 at 22:32, Alvaro Herrera wrote: > On 2022-Mar-24, Japin Li wrote: > >> I want to know why we do not use the following style? >> >> +static inline Datum >> +heap_getattr(HeapTuple tup, int attnum, TupleDesc tupleDesc, bool *isnull) >> +{ >> +if (attnum > 0) >> +{ >> +

Re: Documenting when to retry on serialization failure

2022-03-24 Thread Simon Riggs
On Thu, 24 Mar 2022 at 14:56, Tom Lane wrote: > > Simon Riggs writes: > > OK, I see what you mean. There are 2 types of transaction, one that > > reads inside the transaction, one that decides what value to use some > > other way. > > > So now we have 2 cases, both of which generate uniqueness vi

Re: Parameter for planner estimate of recursive queries

2022-03-24 Thread Tom Lane
Simon Riggs writes: > On Wed, 23 Mar 2022 at 20:25, Tom Lane wrote: >> Do you have any objection if I rename the GUC to >> recursive_worktable_factor? That seems a bit clearer as to what >> it does, and it leaves more room for other knobs in the same area >> if we decide we need any. > None, I

Re: [Proposal] Fully WAL logged CREATE DATABASE - No Checkpoints

2022-03-24 Thread Robert Haas
On Thu, Mar 24, 2022 at 1:29 AM Dilip Kumar wrote: > In the latest version I have fixed this issue by using a non > conflicting name, because when it was compiled with-icu the foobar5 > was already used and we were seeing failure. Apart from this I have > fixed the duplicate cleanup problem by pa

Re: Reducing power consumption on idle servers

2022-03-24 Thread Simon Riggs
On Thu, 24 Mar 2022 at 15:39, Robert Haas wrote: > > On Thu, Mar 24, 2022 at 6:59 AM Simon Riggs > wrote: > > The proposals of this patch are the following, each of which can be > > independently accepted/rejected: > > 1. fix the sleep pattern of bgwriter, walwriter and logical worker > > (direct

Re: Parameter for planner estimate of recursive queries

2022-03-24 Thread Simon Riggs
On Thu, 24 Mar 2022 at 15:48, Tom Lane wrote: > > Simon Riggs writes: > > On Wed, 23 Mar 2022 at 20:25, Tom Lane wrote: > >> Do you have any objection if I rename the GUC to > >> recursive_worktable_factor? That seems a bit clearer as to what > >> it does, and it leaves more room for other knob

Re: [Proposal] Fully WAL logged CREATE DATABASE - No Checkpoints

2022-03-24 Thread Dilip Kumar
On Thu, Mar 24, 2022 at 9:29 PM Robert Haas wrote: > > On Thu, Mar 24, 2022 at 1:29 AM Dilip Kumar wrote: > > In the latest version I have fixed this issue by using a non > > conflicting name, because when it was compiled with-icu the foobar5 > > was already used and we were seeing failure. Apar

Re: Reducing power consumption on idle servers

2022-03-24 Thread Robert Haas
On Thu, Mar 24, 2022 at 12:02 PM Simon Riggs wrote: > What about (1)? That directly affects the powersave capability. I > didn't read anything specific to that. > > If we don't fix (1) as well, the changes for startup and walreceiver > will be ineffective for powersaving. > > What changes will be

Re: Documenting when to retry on serialization failure

2022-03-24 Thread Tom Lane
Simon Riggs writes: > On Thu, 24 Mar 2022 at 14:56, Tom Lane wrote: >> Um, what's that got to do with it? The example in >> read-write-unique-4.spec involves only a single pkey constraint. > Yes, but as you explained, its not actually a serializable case, it > just looks a bit like one. > That

Re: Column Filtering in Logical Replication

2022-03-24 Thread Peter Eisentraut
On 17.03.22 20:11, Tomas Vondra wrote: But the comment describes the error for the whole block, which looks like this: -- error: replica identity "a" not included in the column list ALTER PUBLICATION testpub_fortable ADD TABLE testpub_tbl5 (b, c); UPDATE testpub_tbl5 SET a = 1; ERROR: cannot u

Re: Documenting when to retry on serialization failure

2022-03-24 Thread Simon Riggs
On Thu, 24 Mar 2022 at 16:29, Tom Lane wrote: > > Simon Riggs writes: > > On Thu, 24 Mar 2022 at 14:56, Tom Lane wrote: > >> Um, what's that got to do with it? The example in > >> read-write-unique-4.spec involves only a single pkey constraint. > > > Yes, but as you explained, its not actually

Re: turn fastgetattr and heap_getattr to inline functions

2022-03-24 Thread Peter Eisentraut
On 24.03.22 13:09, Michael Paquier wrote: Hmm. I think that you'd better add a return at the end of each function? Some compilers are dumb in detecting that all the code paths return (aka recent d0083c1) and could generate warnings, even if things are coded to return all the time, like in your

Re: turn fastgetattr and heap_getattr to inline functions

2022-03-24 Thread Peter Eisentraut
On 24.03.22 15:32, Alvaro Herrera wrote: +static inline Datum +heap_getattr(HeapTuple tup, int attnum, TupleDesc tupleDesc, bool *isnull) +{ + if (attnum > 0) + { + if (attnum > (int) HeapTupleHeaderGetNatts(tup->t_data)) + return getmissingattr(tup

Re: role self-revocation

2022-03-24 Thread Robert Haas
On Fri, Mar 11, 2022 at 11:51 AM Robert Haas wrote: > On Fri, Mar 11, 2022 at 11:34 AM Tom Lane wrote: > > Note that either case would also involve making entries in pg_shdepend; > > although for the case of roles owned by/granted to the bootstrap > > superuser, we could omit those on the usual g

Re: turn fastgetattr and heap_getattr to inline functions

2022-03-24 Thread Alvaro Herrera
On 2022-Mar-24, Peter Eisentraut wrote: > But no compiler is stupid enough not to understand that > > foo() > { > if (something) > return this; > else > return that; > } > > always reaches a return. We have a number of examples of this pattern, so I guess it must be true

Re: role self-revocation

2022-03-24 Thread Tom Lane
Robert Haas writes: > Notwithstanding the lack of agreement on that point, I believe that > what we should do for v15 is remove the session user > self-administration exception. We have pretty much established that it > was originally introduced in error. Agreed. > However, it might. And if it d

Re: Removing more vacuumlazy.c special cases, relfrozenxid optimizations

2022-03-24 Thread Robert Haas
On Wed, Mar 23, 2022 at 6:28 PM Peter Geoghegan wrote: > It would be great if you could take a look v11-0002-*, Robert. Does it > make sense to you? You're probably not going to love hearing this, but I think you're still explaining things here in ways that are too baroque and hard to follow. I d

Re: shared-memory based stats collector - v66

2022-03-24 Thread Melanie Plageman
On Thu, Mar 17, 2022 at 3:36 AM Andres Freund wrote: > > The biggest todos are: > - Address all the remaining AFIXMEs and XXXs Attached is a patch that addresses three of the existing AFIXMEs. From 2a975cdb5d10ec365ca2ced39b9f99a9385b6268 Mon Sep 17 00:00:00 2001 From: Melanie Plageman Date: Wed

Re: role self-revocation

2022-03-24 Thread Robert Haas
On Thu, Mar 24, 2022 at 1:10 PM Tom Lane wrote: > > However, it might. And if it does, I think it would be best if > > removing that exception were the *only* change in this area made by > > that release. > > Good idea, especially since it's getting to be too late to consider > anything more invas

Re: Documenting when to retry on serialization failure

2022-03-24 Thread Tom Lane
Simon Riggs writes: > On Thu, 24 Mar 2022 at 16:29, Tom Lane wrote: >> How about the attached? (Only the third new para is different.) > It's much better, thanks. Pushed then. regards, tom lane

Re: [PATCH] Expose port->authn_id to extensions and triggers

2022-03-24 Thread Jacob Champion
On Wed, 2022-03-23 at 16:54 -0700, Andres Freund wrote: > On 2022-03-23 23:06:14 +, Jacob Champion wrote: > > On Wed, 2022-03-23 at 19:00 -0400, Tom Lane wrote: > > > Hm. I was more envisioning getting the "sharable" info out of Port > > > entirely, although I'm not quite sure where it should

Re: Support logical replication of DDLs

2022-03-24 Thread Zheng Li
Hi Dilip, Thanks for the feedback. > > > > The table creation WAL and table insert WAL are available. The tricky > > > > part is how do we break down this command into two parts (a normal > > > > CREATE TABLE followed by insertions) either from the parsetree or the > > > > WALs. I’ll have to dig

Re: [PATCH] Expose port->authn_id to extensions and triggers

2022-03-24 Thread Robert Haas
On Wed, Mar 2, 2022 at 4:27 PM Andres Freund wrote: > I don't think we should commit this without synchronizing the authn between > worker / leader (in a separate commit). Too likely that some function that's > marked parallel ok queries the authn_id, opening up a security/monitoring hole > or suc

Re: [HACKERS] WIP aPatch: Pgbench Serialization and deadlock errors

2022-03-24 Thread Tom Lane
Tatsuo Ishii writes: >> My hoary animal prairiedog doesn't like this [1]: > My machine (Ubuntu 20) did not complain either. Maybe perl version > difference? Any way, the fix pushed. Let's see how prairiedog feels. Still not happy. After some digging in man pages, I believe the problem is that

Re: [PATCH] Expose port->authn_id to extensions and triggers

2022-03-24 Thread Andres Freund
Hi, On 2022-03-24 13:55:29 -0400, Robert Haas wrote: > On Wed, Mar 2, 2022 at 4:27 PM Andres Freund wrote: > > I don't think we should commit this without synchronizing the authn between > > worker / leader (in a separate commit). Too likely that some function that's > > marked parallel ok querie

Doc patch: replace 'salesmen' with 'salespeople'

2022-03-24 Thread Dagfinn Ilmari Mannsåker
Hi Hackers, I just spotted an unnecessarily gendered example involving a 'salesmen' table in the UPDATE docs. Here's a patch that changes that to 'salespeople'. - ilmari >From fde378ccd44c15f827a3c22630265f477d70d748 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dagfinn=20Ilmari=20Manns=C3=A5ker?= D

Re: pg_walinspect - a new extension to get raw WAL data and WAL stats

2022-03-24 Thread Andres Freund
Hi, On 2022-03-24 15:02:29 +0530, Bharath Rupireddy wrote: > On Thu, Mar 24, 2022 at 10:22 AM Kyotaro Horiguchi > > This doesn't seem to be a part of xlogreader. Couldn't we add a new > > module "xlogstats"? XLogRecGetBlockRefInfo also doesn't seem to me as > > a part of xlogreader, the xlogstat

Re: Race conditions in 019_replslot_limit.pl

2022-03-24 Thread Tom Lane
I just noticed something very interesting: in a couple of recent buildfarm runs with this failure, the pg_stat_activity printout no longer shows the extra walsender: https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=serinus&dt=2022-03-24%2017%3A50%3A10 https://buildfarm.postgresql.org/cgi-bi

Re: Granting SET and ALTER SYSTE privileges for GUCs

2022-03-24 Thread Andrew Dunstan
On 3/24/22 12:49, Mark Dilger wrote: > >> On Mar 17, 2022, at 8:41 AM, Andrew Dunstan wrote: >> >> If we abandoned that for this form of GRANT/REVOKE I think we could >> probably get away with >> >> >> GRANT { SET | ALTER SYSTEM } ON setting_name ... >> >> >> I haven't tried it, so I could b

Re: Removing more vacuumlazy.c special cases, relfrozenxid optimizations

2022-03-24 Thread Peter Geoghegan
On Thu, Mar 24, 2022 at 10:21 AM Robert Haas wrote: > You're probably not going to love hearing this, but I think you're > still explaining things here in ways that are too baroque and hard to > follow. I do think it's probably better. There are a lot of dimensions to this work. It's hard to know

Re: Corruption during WAL replay

2022-03-24 Thread Robert Haas
On Thu, Mar 17, 2022 at 9:21 PM Kyotaro Horiguchi wrote: > Finally, no two of from 10 to 14 doesn't accept the same patch. > > As a cross-version check, I compared all combinations of the patches > for two adjacent versions and confirmed that no hunks are lost. > > All versions pass check world.

Re: ExecRTCheckPerms() and many prunable partitions

2022-03-24 Thread David Rowley
On Wed, 23 Mar 2022 at 20:03, Amit Langote wrote: > > On Mon, Mar 14, 2022 at 4:36 PM Amit Langote wrote: > > Also needed fixes when rebasing. > > Needed another rebase. I had a look at the v10-0001 patch. I agree that it seems to be a good idea to separate out the required permission checks rat

Re: Granting SET and ALTER SYSTE privileges for GUCs

2022-03-24 Thread Mark Dilger
> On Mar 24, 2022, at 12:06 PM, Andrew Dunstan wrote: > > > On 3/24/22 12:49, Mark Dilger wrote: >> >>> On Mar 17, 2022, at 8:41 AM, Andrew Dunstan wrote: >>> >>> If we abandoned that for this form of GRANT/REVOKE I think we could >>> probably get away with >>> >>> >>>GRANT { SET | A

identifying unrecognized node type errors

2022-03-24 Thread Andrew Dunstan
As I was tracking down some of these errors in the sql/json patches I noticed that we have a whole lot of them in the code, so working out which one has triggered an error is not as easy as it might be. ISTM we could usefully prefix each such message with the name of the function in which it occur

Re: identifying unrecognized node type errors

2022-03-24 Thread David Rowley
On Fri, 25 Mar 2022 at 08:53, Andrew Dunstan wrote: > As I was tracking down some of these errors in the sql/json patches I > noticed that we have a whole lot of them in the code, so working out > which one has triggered an error is not as easy as it might be. ISTM we > could usefully prefix each

Re: Small TAP tests cleanup for Windows and unused modules

2022-03-24 Thread Daniel Gustafsson
> On 18 Feb 2022, at 22:02, Daniel Gustafsson wrote: > .. let's drop the 0001 from this thread and just go ahead with 0002. I applied the 0002 patch today, cleaning up the unused module imports. -- Daniel Gustafsson https://vmware.com/

Re: identifying unrecognized node type errors

2022-03-24 Thread Tom Lane
Andrew Dunstan writes: > As I was tracking down some of these errors in the sql/json patches I > noticed that we have a whole lot of them in the code, so working out > which one has triggered an error is not as easy as it might be. ISTM we > could usefully prefix each such message with the name of

Re: make MaxBackends available in _PG_init

2022-03-24 Thread Nathan Bossart
On Wed, Mar 23, 2022 at 09:03:18PM +0800, Julien Rouhaud wrote: > On Wed, Mar 23, 2022 at 08:32:39AM -0400, Robert Haas wrote: >> Well, the conclusion upthread was that extensions might change the >> values of those GUCs from _PG_init(). If that's a real thing, then >> what you're asking for here i

Re: Removing more vacuumlazy.c special cases, relfrozenxid optimizations

2022-03-24 Thread Robert Haas
On Thu, Mar 24, 2022 at 3:28 PM Peter Geoghegan wrote: > But non-aggressive VACUUMs have always been able to do that. > > How about: "Set relfrozenxid to oldest extant XID seen by VACUUM" Sure, that sounds nice. > Believe it or not, I avoided functional changes in 0002 -- at least in > one impor

Re: make MaxBackends available in _PG_init

2022-03-24 Thread Robert Haas
On Thu, Mar 24, 2022 at 4:20 PM Nathan Bossart wrote: > Another possibility could be to add a hook that is called _before_ > _PG_init() where libraries are permitted to adjust GUCs. After the library > is loaded, we first call this _PG_change_GUCs() function, then we > initialize MaxBackends, and

  1   2   3   >