Re: [PATCH] Renumber confusing value for GUC_UNIT_BYTE

2022-09-05 Thread Tom Lane
Peter Eisentraut writes: > I think renumbering this makes sense. We could just leave the comment > as is if we don't come up with a better wording. +1, I see no need to change the comment. We just need to establish the precedent that values within the GUC_UNIT_MEMORY field can be chosen

Re: pg_waldump: add test for coverage

2022-09-05 Thread Peter Eisentraut
On 23.08.22 03:50, Dong Wook Lee wrote: Hi Hackers, I wrote a test for coverage. Unfortunately, it seems to take quite a while to run the test. I want to improve these execution times, but I don't know exactly what to do. Therefore, I want to hear feedback from many people. I don't find these

Re: more descriptive message for process termination due to max_slot_wal_keep_size

2022-09-05 Thread Kyotaro Horiguchi
At Mon, 5 Sep 2022 11:56:33 +0200, "Drouvot, Bertrand" wrote in > Hi, > > On 3/2/22 7:37 AM, Kyotaro Horiguchi wrote: > > At Tue, 04 Jan 2022 10:29:31 +0900 (JST), Kyotaro > > Horiguchi wrote in > >> So what do you say if I propose the following? > >> > >> LOG: terminating process %d to

Re: Patch to address creation of PgStat* contexts with null parent context

2022-09-05 Thread Kyotaro Horiguchi
(It seems to me I overlooked some mails.. sorry.) At Mon, 5 Sep 2022 15:47:37 -0700, Andres Freund wrote in > On 2022-09-05 17:32:20 +0900, Kyotaro Horiguchi wrote: > > The rationale of creating them at pgstat_attach_shmem is that anyway once > > pgstat_attach_shmem is called, the process

Re: [PATCH] Renumber confusing value for GUC_UNIT_BYTE

2022-09-05 Thread Peter Eisentraut
On 20.07.22 16:52, Justin Pryzby wrote: +/* GUC_UNIT_* are not flags - they're tested for equality */ Well, there is GUC_UNIT_MEMORY, etc. so there is an additional constraint beyond just "pick any number". I'm not sure that "flag" and "tested for equality" are really antonyms anyway. I

Re: Modernizing our GUC infrastructure

2022-09-05 Thread Tom Lane
Pavel Stehule writes: > út 6. 9. 2022 v 6:32 odesílatel Pavel Stehule > napsal: >> 1. Session variables can be persistent - so the usage of session variables >> can be checked by static analyze like plpgsql_check > more precious - metadata of session variables are persistent Right ... so the

Re: Modernizing our GUC infrastructure

2022-09-05 Thread Tom Lane
Pavel Stehule writes: > The bad performance is not the main reason for implementing session > variables (and in almost all cases the performance of GUC is not a problem, > because it is not a bottleneck, and in some terrible cases, I can save the > GUC to a variable). There are other differences:

Re: Handle infinite recursion in logical replication setup

2022-09-05 Thread Peter Smith
Thanks for addressing my previous review comments. I have no more comments for v46*. -- Kind Regards, Peter Smith. Fujitsu Australia

Re: Modernizing our GUC infrastructure

2022-09-05 Thread Julien Rouhaud
Hi, On Tue, Sep 06, 2022 at 06:32:21AM +0200, Pavel Stehule wrote: > Hi > > út 6. 9. 2022 v 0:28 odesílatel Tom Lane napsal: > > > Attached is a patch series that attempts to modernize our GUC > > infrastructure, in particular removing the performance bottlenecks > > it has when there are lots

Re: Modernizing our GUC infrastructure

2022-09-05 Thread Pavel Stehule
út 6. 9. 2022 v 6:32 odesílatel Pavel Stehule napsal: > Hi > > út 6. 9. 2022 v 0:28 odesílatel Tom Lane napsal: > >> Attached is a patch series that attempts to modernize our GUC >> infrastructure, in particular removing the performance bottlenecks >> it has when there are lots of GUC

Re: Modernizing our GUC infrastructure

2022-09-05 Thread Pavel Stehule
Hi út 6. 9. 2022 v 0:28 odesílatel Tom Lane napsal: > Attached is a patch series that attempts to modernize our GUC > infrastructure, in particular removing the performance bottlenecks > it has when there are lots of GUC variables. I wrote this because > I am starting to question the

Re: Compilation issue on Solaris.

2022-09-05 Thread John Naylor
On Sun, Jul 10, 2022 at 9:27 PM Tom Lane wrote: > > Thomas Munro writes: > > Something bothers me about adding yet more clutter to every compile > > line for the rest of time to solve a problem that exists only for > > unpatched systems, and also that it's not even really a Solaris thing, > >

RE: Handle infinite recursion in logical replication setup

2022-09-05 Thread wangw.f...@fujitsu.com
On Tues, 6 Sept 2022 at 11:14, vignesh C wrote: > Thanks for the comments, the attached patch has the changes for the same. Thanks for updating the patch. Here is one comment for 0001 patch. 1. The query in function check_publications_origin. + appendStringInfoString(, +

RE: Handle infinite recursion in logical replication setup

2022-09-05 Thread shiy.f...@fujitsu.com
On Tue, Sep 6, 2022 11:14 AM vignesh C wrote: > > Thanks for the comments, the attached patch has the changes for the same. > Thanks for updating the patch. Here are some comments. 1. + if (subrel_count) + { + /* +* In case of ALTER SUBSCRIPTION ...

Re: FOR EACH ROW triggers, on partitioend tables, with indexes?

2022-09-05 Thread David Rowley
On Thu, 1 Sept 2022 at 20:57, Alvaro Herrera wrote: > So apparently the way to get a trigger associated with a relation > (tgconstrrelid) is via CREATE CONSTRAINT TRIGGER, but there doesn't > appear to be a way to have it associated with a specific *index* on that > relation (tgconstrindid). So

Re: Reducing the chunk header sizes on all memory context types

2022-09-05 Thread David Rowley
On Tue, 6 Sept 2022 at 14:43, Tom Lane wrote: > I think MemoryContextContains' charter is to return > > GetMemoryChunkContext(pointer) == context > > *except* that instead of asserting what GetMemoryChunkContext asserts, > it should treat those cases as reasons to return false. So if you

Re: Handle infinite recursion in logical replication setup

2022-09-05 Thread vignesh C
On Mon, 5 Sept 2022 at 15:10, Amit Kapila wrote: > > On Mon, Sep 5, 2022 at 9:47 AM Peter Smith wrote: > > > > Here are my review comments for v45-0001: > > > > == > > > > 1. doc/src/sgml/logical-replication.sgml > > > > > >To find which tables might potentially include non-local

Re: Handle infinite recursion in logical replication setup

2022-09-05 Thread vignesh C
On Mon, 5 Sept 2022 at 09:47, Peter Smith wrote: > > Here are my review comments for v45-0001: > > == > > 1. doc/src/sgml/logical-replication.sgml > > >To find which tables might potentially include non-local origins (due to >other subscriptions created on the publisher) try this

Re: pg_publication_tables show dropped columns

2022-09-05 Thread Tom Lane
Jaime Casanova writes: > Just trying the new column/row filter on v15, I found this issue that > could be replicated very easily. Bleah. Post-beta4 catversion bump, here we come. > This could be solved by adding a "NOT attisdropped", simple patch > attached. That view seems quite inefficient

Re: Modernizing our GUC infrastructure

2022-09-05 Thread Junwang Zhao
ah, yes, that makes sense ;) On Tue, Sep 6, 2022 at 10:48 AM Tom Lane wrote: > > Junwang Zhao writes: > > /* > > - * Create table with 20% slack > > + * Create hash table with 20% slack > > */ > > size_vars = num_vars + num_vars / 4; > > > Should we change 20% to 25%, I thought that might

pg_publication_tables show dropped columns

2022-09-05 Thread Jaime Casanova
Hi everyone, Just trying the new column/row filter on v15, I found this issue that could be replicated very easily. """ postgres=# create table t1(i serial primary key); CREATE TABLE postgres=# alter table t1 drop i; ALTER TABLE postgres=# alter table t1 add id serial primary key; ALTER TABLE

Re: Modernizing our GUC infrastructure

2022-09-05 Thread Tom Lane
Junwang Zhao writes: > /* > - * Create table with 20% slack > + * Create hash table with 20% slack > */ > size_vars = num_vars + num_vars / 4; > Should we change 20% to 25%, I thought that might be > a typo. No ... 20% of the allocated space is spare. regards, tom

Re: Modernizing our GUC infrastructure

2022-09-05 Thread Junwang Zhao
Hi Tom, @@ -5836,74 +5865,106 @@ build_guc_variables(void) } /* - * Create table with 20% slack + * Create hash table with 20% slack */ size_vars = num_vars + num_vars / 4; Should we change 20% to 25%, I thought that might be a typo. On Tue, Sep 6, 2022 at 6:28 AM Tom Lane wrote: > >

Re: Reducing the chunk header sizes on all memory context types

2022-09-05 Thread Tom Lane
David Rowley writes: > I think the fix is harder than I thought, or perhaps impossible to do > given how we now determine the owning MemoryContext of a pointer. > There's a comment in MemoryContextContains which says: > * NB: Can't use GetMemoryChunkContext() here - that performs assertions > *

Re: Reducing the chunk header sizes on all memory context types

2022-09-05 Thread David Rowley
On Tue, 6 Sept 2022 at 14:32, David Rowley wrote: > I wonder if there are many usages of MemoryContextContains in > extensions. If there's not, I'd be much happier if we got rid of this > function and used GetMemoryChunkContext() in nodeAgg.c and > nodeWindowAgg.c. I see postgis is one user of

Re: Reducing the chunk header sizes on all memory context types

2022-09-05 Thread David Rowley
On Tue, 6 Sept 2022 at 12:27, Tom Lane wrote: > > David Rowley writes: > > On Tue, 6 Sept 2022 at 11:09, Andres Freund wrote: > >> I was looking at > >> MemoryContextContains(). Unless I am missing something, the patch omitted > >> adjusting that? We'll probably always return false right now. >

Re: Remove dead macro exec_subplan_get_plan

2022-09-05 Thread Richard Guo
On Tue, Sep 6, 2022 at 1:18 AM Tom Lane wrote: > Zhang Mingli writes: > > Macro exec_subplan_get_plan is not used anymore. > > Attach a patch to remove it. > > Hm, I wonder why it's not used anymore. Maybe we no longer need > that list at all? If we do, should use of the macro be >

Re: pg15b3: recovery fails with wal prefetch enabled

2022-09-05 Thread Thomas Munro
On Tue, Sep 6, 2022 at 1:51 PM Tom Lane wrote: > "Jonathan S. Katz" writes: > > On 9/5/22 7:18 PM, Thomas Munro wrote: > >> Well I was about to commit this, but beta4 just got stamped (but not > >> yet tagged). I see now that Jonathan (with RMT hat on, CC'd) meant > >> commits should be in by

Re: Fix possible bogus array out of bonds (src/backend/access/brin/brin_minmax_multi.c)

2022-09-05 Thread David Rowley
On Tue, 6 Sept 2022 at 13:52, Ranier Vilela wrote: > > Em seg., 5 de set. de 2022 às 22:29, David Rowley > escreveu: >> It feels like it would be good if we had a way to detect a few of >> these issues much earlier than we are currently. There's been a long >> series of commits fixing up this

Re: Fix possible bogus array out of bonds (src/backend/access/brin/brin_minmax_multi.c)

2022-09-05 Thread Ranier Vilela
Em seg., 5 de set. de 2022 às 22:29, David Rowley escreveu: > On Tue, 6 Sept 2022 at 06:07, Ranier Vilela wrote: > > I did a search and found a few more places. > > v1 attached. > > Thanks. I've done a bit more looking and found a few more places that > we can improve and I've pushed the

Re: pg15b3: recovery fails with wal prefetch enabled

2022-09-05 Thread Tom Lane
"Jonathan S. Katz" writes: > On 9/5/22 7:18 PM, Thomas Munro wrote: >> Well I was about to commit this, but beta4 just got stamped (but not >> yet tagged). I see now that Jonathan (with RMT hat on, CC'd) meant >> commits should be in by the *start* of the 5th AoE, not the end. So >> the

Re: pg15b3: recovery fails with wal prefetch enabled

2022-09-05 Thread Jonathan S. Katz
On 9/5/22 7:18 PM, Thomas Munro wrote: On Mon, Sep 5, 2022 at 9:08 PM Thomas Munro wrote: At Mon, 05 Sep 2022 14:15:27 +0900 (JST), Kyotaro Horiguchi wrote in At Mon, 5 Sep 2022 16:54:07 +1200, Thomas Munro wrote in On reflection, it'd be better not to clobber any pre-existing error

Re: Fix possible bogus array out of bonds (src/backend/access/brin/brin_minmax_multi.c)

2022-09-05 Thread David Rowley
On Tue, 6 Sept 2022 at 06:07, Ranier Vilela wrote: > I did a search and found a few more places. > v1 attached. Thanks. I've done a bit more looking and found a few more places that we can improve and I've pushed the result. It feels like it would be good if we had a way to detect a few of

Re: [PATCH] Tab completion for SET COMPRESSION

2022-09-05 Thread Shinya Kato
On 2022-08-22 21:48, Aleksander Alekseev wrote: Hi hackers, The proposed patch adds the missing tab completion for 'ALTER TABLE ... SET COMPRESSION ...' syntax. Thanks, LGTM. In addition, why not take this opportunity to create a tab completion for "ALTER TABLE OF " and "ALTER TABLE NOT

Re: pg15b3: recovery fails with wal prefetch enabled

2022-09-05 Thread Kyotaro Horiguchi
At Mon, 5 Sep 2022 21:08:16 +1200, Thomas Munro wrote in > We also need the LSN that is past that record. > XLogReleasePreviousRecord() could return it (or we could use > reader->EndRecPtr I suppose). Thoughts on this version? (Catching the gap...) It is easier to read. Thanks! regards. --

Re: Reducing the chunk header sizes on all memory context types

2022-09-05 Thread Tom Lane
David Rowley writes: > On Tue, 6 Sept 2022 at 11:09, Andres Freund wrote: >> I was looking at >> MemoryContextContains(). Unless I am missing something, the patch omitted >> adjusting that? We'll probably always return false right now. > Oops. Yes. I'll push a fix a bit later. The existing

Re: Reducing the chunk header sizes on all memory context types

2022-09-05 Thread David Rowley
On Tue, 6 Sept 2022 at 11:09, Andres Freund wrote: > I was looking at > MemoryContextContains(). Unless I am missing something, the patch omitted > adjusting that? We'll probably always return false right now. Oops. Yes. I'll push a fix a bit later. David

Re: Mingw task for Cirrus CI

2022-09-05 Thread Andres Freund
Hi, On 2022-09-05 06:50:55 -0500, Justin Pryzby wrote: > I saw that but hadn't tracked it down yet. Do you know if the tar > failures were from a TAP test added since you first posted the mingw > patch, or ?? I think it's that msys now includes tar by default, but not sure. > Also: your

Re: Modernizing our GUC infrastructure

2022-09-05 Thread Tom Lane
Andres Freund writes: > It's only half related, but since we're talking about renovating guc.c: I > think it'd be good if we split the list of GUCs from the rest of the guc > machinery. Both for humans and compilers it's getting pretty large. And > commonly one either wants to edit the definition

Re: Column Filtering in Logical Replication

2022-09-05 Thread Peter Smith
On Mon, Sep 5, 2022 at 8:46 PM Amit Kapila wrote: > > On Mon, Sep 5, 2022 at 3:46 PM Peter Smith wrote: > > > > > > PSA v7. > > > > For example, if additional columns are added to the table, then > +(after a REFRESH PUBLICATION) if there was a column > list > +only those named columns

Re: Modernizing our GUC infrastructure

2022-09-05 Thread Andres Freund
Hi, > I wrote this because I am starting to question the schema-variables patch > [1] --- that's getting to be quite a large patch and I grow less and less > sure that it's solving a problem our users want solved. --- that's getting > to be quite a large patch and I grow less and less sure that

Re: pg15b3: recovery fails with wal prefetch enabled

2022-09-05 Thread Thomas Munro
On Mon, Sep 5, 2022 at 9:08 PM Thomas Munro wrote: > > At Mon, 05 Sep 2022 14:15:27 +0900 (JST), Kyotaro Horiguchi > > wrote in > > At Mon, 5 Sep 2022 16:54:07 +1200, Thomas Munro > > wrote in > > > On reflection, it'd be better not to clobber any pre-existing error > > > there, but report

Re: Reducing the chunk header sizes on all memory context types

2022-09-05 Thread Andres Freund
Hi, On 2022-08-29 17:26:29 +1200, David Rowley wrote: > On Mon, 29 Aug 2022 at 10:39, David Rowley wrote: > > One more try to make CFbot happy. > > After a bit more revision, mostly updating outdated comments and > naming adjustments, I've pushed this. Responding to Tom's email about guc.c

Re: Patch to address creation of PgStat* contexts with null parent context

2022-09-05 Thread Andres Freund
Hi, On 2022-09-05 17:32:20 +0900, Kyotaro Horiguchi wrote: > The rationale of creating them at pgstat_attach_shmem is that anyway once > pgstat_attach_shmem is called, the process fainally creates the contexts at > the end of the process, and (I think) it's simpler that we don't do if() > check

Modernizing our GUC infrastructure

2022-09-05 Thread Tom Lane
Attached is a patch series that attempts to modernize our GUC infrastructure, in particular removing the performance bottlenecks it has when there are lots of GUC variables. I wrote this because I am starting to question the schema-variables patch [1] --- that's getting to be quite a large patch

Re: failing to build preproc.c on solaris with sun studio

2022-09-05 Thread Tom Lane
Peter Eisentraut writes: > Why is this being proposed? Andres is annoyed by the long build time of ecpg, which he has to wait for whether he wants to test it or not. I could imagine that I might disable ecpg testing on my slowest buildfarm animals, too. I suppose maybe we could compromise on

Re: failing to build preproc.c on solaris with sun studio

2022-09-05 Thread Andres Freund
Hi, On 2022-09-05 22:52:03 +0200, Peter Eisentraut wrote: > On 04.09.22 16:55, Tom Lane wrote: > > I guess we could proceed like this: > > > > 1. Invent the --with option. Temporarily make "make check" in ecpg > > print a message but not fail if the option wasn't selected. > > > > 2. Update

Re: failing to build preproc.c on solaris with sun studio

2022-09-05 Thread Peter Eisentraut
On 04.09.22 16:55, Tom Lane wrote: I guess we could proceed like this: 1. Invent the --with option. Temporarily make "make check" in ecpg print a message but not fail if the option wasn't selected. 2. Update buildfarm client to recognize the option and skip ecpg-check if not selected. 3.

Re: Instrumented pages/tuples frozen in autovacuum's server log out (and VACUUM VERBOSE)

2022-09-05 Thread Peter Geoghegan
On Wed, Aug 31, 2022 at 7:49 PM Jeff Janes wrote: > I think "frozen:" would be a more suitable line prefix. Attached revision does it that way. Barring any objections I will commit this patch within the next few days. Thanks -- Peter Geoghegan

Re: Table AM modifications to accept column projection lists

2022-09-05 Thread Zhihong Yu
On Mon, Sep 5, 2022 at 9:51 AM Nikita Malakhov wrote: > Hi hackers! > > This is the original patch rebased onto v15 master with conflicts > resolved. I'm currently > studying it and latest comments in the original thread, and would try go > the way that > was mentioned in the thread (last

Re: predefined role(s) for VACUUM and ANALYZE

2022-09-05 Thread Nathan Bossart
Here is a first attempt at allowing users to grant VACUUM or ANALYZE per-relation. Overall, this seems pretty straightforward. I needed to adjust the permissions logic for VACUUM/ANALYZE a bit, which causes some extra WARNING messages for VACUUM (ANALYZE) in some cases, but this didn't seem

Re: Backpatching nbtree VACUUM (page deletion) hardening

2022-09-05 Thread Peter Geoghegan
On Fri, Sep 2, 2022 at 6:51 PM Peter Geoghegan wrote: > Yes -- nbtree VACUUM generally can cope quite well, even when the > index is corrupt. It should mostly manage to do what is expected here, > even with a misbehaving opclass, because it relies as little as > possible on user-defined opclass

Re: Fix possible bogus array out of bonds (src/backend/access/brin/brin_minmax_multi.c)

2022-09-05 Thread Ranier Vilela
Em seg., 5 de set. de 2022 às 10:40, David Rowley escreveu: > On Mon, 5 Sept 2022 at 22:15, David Rowley wrote: > > On Sat, 3 Sept 2022 at 00:37, Ranier Vilela wrote: > > > 6. Avoid overhead when using unnecessary StringInfoData to convert > Datum a to Text b. > > > > I've ripped out #4 and #6

Re: doc: mentioned CREATE+ATTACH PARTITION as an alternative to CREATE TABLE..PARTITION OF

2022-09-05 Thread Justin Pryzby
On Thu, Aug 04, 2022 at 01:45:49AM -0400, Robert Treat wrote: > After reading this again, it isn't clear to me that this advice would > be more appropriately placed into Section 5.11, aka > https://www.postgresql.org/docs/current/ddl-partitioning.html, but in > lieu of a specific suggestion for

Re: Remove dead macro exec_subplan_get_plan

2022-09-05 Thread Tom Lane
Zhang Mingli writes: > Macro exec_subplan_get_plan is not used anymore. > Attach a patch to remove it. Hm, I wonder why it's not used anymore. Maybe we no longer need that list at all? If we do, should use of the macro be re-introduced in the accessors? regards, tom

Re: pg_upgrade allows itself to be run twice

2022-09-05 Thread Justin Pryzby
rebased and updated Robert thought that it might be reasonable for someone to initdb, and then connect and make some modifications, and then pg_upgrade. https://www.postgresql.org/message-id/CA%2BTgmoYwaXh_wRRa2CqL4XpM4r6YEbq1%2Bec%3D%2B8b7Dr7-T_tT%2BQ%40mail.gmail.com But the DBs are dropped by

Re: Table AM modifications to accept column projection lists

2022-09-05 Thread Nikita Malakhov
Hi hackers! This is the original patch rebased onto v15 master with conflicts resolved. I'm currently studying it and latest comments in the original thread, and would try go the way that was mentioned in the thread (last message) - [1]

Remove dead macro exec_subplan_get_plan

2022-09-05 Thread Zhang Mingli
Hi, Macro exec_subplan_get_plan is not used anymore. Attach a patch to remove it. Regards, Zhang Mingli vn-0001-exec_subplan_get_plan-is-not-used.patch Description: Binary data

Re: Table AM modifications to accept column projection lists

2022-09-05 Thread Justin Pryzby
On Mon, Sep 05, 2022 at 05:38:51PM +0300, Nikita Malakhov wrote: > Due to experiments with columnar data storage I've decided to revive this > thread - Table AM modifications to accept column projection lists >

Re: ICU for global collation

2022-09-05 Thread Marina Polyakova
Hello! IMO after adding ICU for global collations [1] the behaviour of createdb and CREATE DATABASE is a bit inconsistent when both locale and lc_collate (or locale and lc_ctype) options are used: $ createdb mydb --locale C --lc-collate C --template template0 createdb: error: only one of

Re: Table AM modifications to accept column projection lists

2022-09-05 Thread Nikita Malakhov
Hi hackers! Due to experiments with columnar data storage I've decided to revive this thread - Table AM modifications to accept column projection lists To remind: This patch

Re: Convert *GetDatum() and DatumGet*() macros to inline functions

2022-09-05 Thread Aleksander Alekseev
Hi Peter, > Which compiler is that, by the way? The warnings were reported by cfbot during the "clang_warning" step. According to the logs: ``` using compiler=Debian clang version 11.0.1-2 ``` Personally I use Clang 14 on MacOS and I don't get these warnings. > I think to resolve that we

Re: Reducing the chunk header sizes on all memory context types

2022-09-05 Thread David Rowley
On Fri, 2 Sept 2022 at 20:11, David Rowley wrote: > > On Thu, 1 Sept 2022 at 12:46, Tom Lane wrote: > > > > David Rowley writes: > > > Maybe we should just consider always making room for a sentinel for > > > chunks that are on dedicated blocks. At most that's an extra 8 bytes > > > in some

Re: Fix possible bogus array out of bonds (src/backend/access/brin/brin_minmax_multi.c)

2022-09-05 Thread David Rowley
On Mon, 5 Sept 2022 at 22:15, David Rowley wrote: > On Sat, 3 Sept 2022 at 00:37, Ranier Vilela wrote: > > 6. Avoid overhead when using unnecessary StringInfoData to convert Datum a > > to Text b. > > I've ripped out #4 and #6 for now. I think we should do #6 in master > only, probably as part

Re: Asynchronous execution support for Custom Scan

2022-09-05 Thread Kazutaka Onishi
Fujita-san, I'm sorry for my error on your name... > IIUC, it uses the proposed > APIs, but actually executes ctidscans *synchronously*, so it does not > improve performance. Right? Exactly. The actual CustomScan that supports asynchronous execution will start processing in

Re: Different compression methods for FPI

2022-09-05 Thread Justin Pryzby
On Mon, Sep 05, 2022 at 02:45:57PM +0200, Matthias van de Meent wrote: > Hi, > > I have a small question for those involved: I suggest to "reply all" > Context: I'm trying to get the smallest BKPIMAGE size possible > regardless of CPU cost, which means I'm trying multiple compressions > to get

Re: Convert *GetDatum() and DatumGet*() macros to inline functions

2022-09-05 Thread Peter Eisentraut
On 30.08.22 20:15, Aleksander Alekseev wrote: Here is v3 with silenced compiler warnings. Some more warnings were reported by cfbot, so here is v4. Apologies for the noise. Looking at these warnings you are fixing, I think there is a small problem we need to address. I have defined

Re: Different compression methods for FPI

2022-09-05 Thread Matthias van de Meent
Hi, I have a small question for those involved: Context: I'm trying to get the smallest BKPIMAGE size possible regardless of CPU cost, which means I'm trying multiple compressions to get the smallest data possible with the options available. This means ignoring the wal_compression GUC in

Re: Fix possible bogus array out of bonds (src/backend/access/brin/brin_minmax_multi.c)

2022-09-05 Thread Ranier Vilela
Em seg., 5 de set. de 2022 às 07:15, David Rowley escreveu: > On Sat, 3 Sept 2022 at 00:37, Ranier Vilela wrote: > >> But +1 to fix this and other issues even if they would never crash. > > Yeah, I don't think any of this coding would lead to a crash, but it's > pretty weird coding and we

Re: TRAP: FailedAssertion("prev_first_lsn < cur_txn->first_lsn", File: "reorderbuffer.c", Line: 927, PID: 568639)

2022-09-05 Thread Tomas Vondra
On 9/5/22 12:12, Amit Kapila wrote: > On Mon, Sep 5, 2022 at 12:14 PM Tomas Vondra > wrote: >> >> On 9/5/22 06:32, Amit Kapila wrote: >>> On Sun, Sep 4, 2022 at 7:38 PM Tomas Vondra >>> wrote: On 9/4/22 14:24, Tomas Vondra wrote: > >> As per >> my understanding, the

Re: Mingw task for Cirrus CI

2022-09-05 Thread Justin Pryzby
On Sat, Sep 03, 2022 at 12:52:54AM +0300, Melih Mutlu wrote: > Justin Pryzby , 19 Ağu 2022 Cum, 05:34 tarihinde şunu > yazdı: > > > Inline notes about changes since the last version. > > > > On Thu, Jul 28, 2022 at 05:44:28PM -0500, Justin Pryzby wrote: > > > I think the "only_if" should allow

Re: explain_regress, explain(MACHINE), and default to explain(BUFFERS) (was: BUFFERS enabled by default in EXPLAIN (ANALYZE))

2022-09-05 Thread Justin Pryzby
On Tue, Jul 26, 2022 at 03:38:53PM -0700, David G. Johnston wrote: > On Mon, Jan 24, 2022 at 9:54 AM Justin Pryzby wrote: > > > Unfortunately, "COSTS OFF" breaks postgres_fdw remote_estimate. If > > > specifying > > > "COSTS ON" in postgres_fdw.c is considered to be a poor fix , then I > > >

Re: [POC] Allow flattening of subquery with a link to upper query

2022-09-05 Thread Andrey Lepikhov
On 9/5/22 12:22, Richard Guo wrote: On Fri, Sep 2, 2022 at 7:09 PM Andrey Lepikhov Yeah, it's not easy-to-solve problem. If I correctly understand the code, to fix this problem we must implement the same logic, as pull_up_subqueries (lowest_outer_join/safe_upper_varnos). Yeah,

Re: TRAP: FailedAssertion("prev_first_lsn < cur_txn->first_lsn", File: "reorderbuffer.c", Line: 927, PID: 568639)

2022-09-05 Thread Tomas Vondra
On 9/5/22 08:35, Amit Kapila wrote: > On Sun, Sep 4, 2022 at 11:10 PM Tomas Vondra > wrote: >> >> On 9/4/22 16:08, Tomas Vondra wrote: >>> ... >>> >>> so in fact we *know* 849 is a subxact of 848, but we don't call >>> ReorderBufferAssignChild in this case. In fact we can't even do the >>>

Re: Column Filtering in Logical Replication

2022-09-05 Thread Amit Kapila
On Mon, Sep 5, 2022 at 3:46 PM Peter Smith wrote: > > > PSA v7. > For example, if additional columns are added to the table, then +(after a REFRESH PUBLICATION) if there was a column list +only those named columns will continue to be replicated. This looks a bit unclear to me w.r.t the

Re: Column Filtering in Logical Replication

2022-09-05 Thread Peter Smith
On Mon, Sep 5, 2022 at 1:42 PM shiy.f...@fujitsu.com wrote: > > On Mon, Sep 5, 2022 8:28 AM Peter Smith wrote: > > > > I have rebased the remaining patch (v6-0001 is the same as v5-0002) > > > > Thanks for updating the patch. Here are some comments. > > 1. > + the will be successful but

Re: Fix possible bogus array out of bonds (src/backend/access/brin/brin_minmax_multi.c)

2022-09-05 Thread David Rowley
On Sat, 3 Sept 2022 at 00:37, Ranier Vilela wrote: >> But +1 to fix this and other issues even if they would never crash. Yeah, I don't think any of this coding would lead to a crash, but it's pretty weird coding and we should fix it. > 1. Once that ranges->nranges is invariant, avoid the loop

Re: TRAP: FailedAssertion("prev_first_lsn < cur_txn->first_lsn", File: "reorderbuffer.c", Line: 927, PID: 568639)

2022-09-05 Thread Amit Kapila
On Mon, Sep 5, 2022 at 12:14 PM Tomas Vondra wrote: > > On 9/5/22 06:32, Amit Kapila wrote: > > On Sun, Sep 4, 2022 at 7:38 PM Tomas Vondra > > wrote: > >> > >> On 9/4/22 14:24, Tomas Vondra wrote: > >>> > As per > my understanding, the problem I reported in the email [1] is the same >

Re: freeing LDAPMessage in CheckLDAPAuth

2022-09-05 Thread Zhihong Yu
On Sun, Sep 4, 2022 at 10:37 PM Michael Paquier wrote: > On Sun, Sep 04, 2022 at 06:52:37AM -0700, Zhihong Yu wrote: > > Please take a look at patch v3. > > Fine as far as it goes. I would have put the initialization of > search_message closer to ldap_search_s() for consistency with libpq. >

Re: Handle infinite recursion in logical replication setup

2022-09-05 Thread Amit Kapila
On Mon, Sep 5, 2022 at 9:47 AM Peter Smith wrote: > > Here are my review comments for v45-0001: > > == > > 1. doc/src/sgml/logical-replication.sgml > > >To find which tables might potentially include non-local origins (due to >other subscriptions created on the publisher) try this

Re: Missing CFI in iterate_word_similarity()

2022-09-05 Thread Daniel Gustafsson
> On 2 Sep 2022, at 15:22, Daniel Gustafsson wrote: > >> On 2 Sep 2022, at 15:16, Tom Lane wrote: > >> What's annoying me about the one-liner fix is that it makes it >> look like CFI is part of the "Get index" action. > > Thats a good point, I'll split the code up to make it clearer. Done

Re: pg15b3: recovery fails with wal prefetch enabled

2022-09-05 Thread Thomas Munro
On Mon, Sep 5, 2022 at 5:34 PM Kyotaro Horiguchi wrote: > At Mon, 05 Sep 2022 14:15:27 +0900 (JST), Kyotaro Horiguchi > wrote in > me> +1 for showing any message for the failure, but I think we shouldn't > me> hide an existing message if any. > > At Mon, 5 Sep 2022 16:54:07 +1200, Thomas Munro

Re: Patch to address creation of PgStat* contexts with null parent context

2022-09-05 Thread Kyotaro Horiguchi
At Mon, 5 Sep 2022 08:52:44 +0200, "Drouvot, Bertrand" wrote in > Could using TopMemoryContext like in the attach be an option? (aka > changing CacheMemoryContext by TopMemoryContext in the 3 places of > interest): that would ensure the 3 pgStat* contexts to have a non NULL > parent context.

Re: Fix typo function circle_same (src/backend/utils/adt/geo_ops.c)

2022-09-05 Thread Daniel Gustafsson
> On 4 Sep 2022, at 14:39, Ranier Vilela wrote: > But with Windows 10 build, I got this diff result: > > diff -w -U3 > C:/dll/postgres_dev/postgres_master/src/test/regress/expected/geometry.out > C:/dll/postgres_dev/postgres_master/src/test/regress/results/geometry.out > --- >

Re: [BUG] Storage declaration in ECPG

2022-09-05 Thread Kyotaro Horiguchi
At Sun, 04 Sep 2022 13:49:53 +0300, Andrey Sokolov wrote in > Hi, > > The ECPG preprocessor converts the code > "static VARCHAR str1[10], str2[20], str3[30];" > into > "static struct varchar_1 { int len; char arr[ 10 ]; } str1 ; > struct varchar_2 { int len; char arr[ 20 ]; }

Re: [POC] Allow flattening of subquery with a link to upper query

2022-09-05 Thread Richard Guo
On Fri, Sep 2, 2022 at 7:09 PM Andrey Lepikhov wrote: > On 9/1/22 17:24, Richard Guo wrote: > > On Wed, Aug 31, 2022 at 2:35 PM Andrey Lepikhov > > mailto:a.lepik...@postgrespro.ru>> wrote: > > Before flattening procedure we just look through the quals of > subquery, > > pull to the

Re: Clarify restriction on partitioned tables primary key / unique indexes

2022-09-05 Thread David Rowley
On Fri, 2 Sept 2022 at 22:06, David Rowley wrote: > Thanks. I ended up adjusting it to: > > "To create a unique or primary key constraint on a partitioned table," and pushed. Thanks for having a look at this Erik. David

Re: TRAP: FailedAssertion("prev_first_lsn < cur_txn->first_lsn", File: "reorderbuffer.c", Line: 927, PID: 568639)

2022-09-05 Thread Tomas Vondra
On 9/5/22 06:32, Amit Kapila wrote: > On Sun, Sep 4, 2022 at 7:38 PM Tomas Vondra > wrote: >> >> On 9/4/22 14:24, Tomas Vondra wrote: >>> As per my understanding, the problem I reported in the email [1] is the same and we have seen this in BF failures as well. I posted a way to

Re: POC: GROUP BY optimization

2022-09-05 Thread Michael Paquier
On Mon, Sep 05, 2022 at 12:14:48AM +0200, Tomas Vondra wrote: > I've pushed the fix to 15+master. In the end I just used David's patches > that set parallel_setup_cost to 0. Thanks, Tomas! -- Michael signature.asc Description: PGP signature

Re: TRAP: FailedAssertion("prev_first_lsn < cur_txn->first_lsn", File: "reorderbuffer.c", Line: 927, PID: 568639)

2022-09-05 Thread Amit Kapila
On Sun, Sep 4, 2022 at 11:10 PM Tomas Vondra wrote: > > On 9/4/22 16:08, Tomas Vondra wrote: > > ... > > > > so in fact we *know* 849 is a subxact of 848, but we don't call > > ReorderBufferAssignChild in this case. In fact we can't even do the > > assignment easily in this case, because we

Re: Asynchronous execution support for Custom Scan

2022-09-05 Thread Etsuro Fujita
On Fri, Sep 2, 2022 at 10:43 PM Kazutaka Onishi wrote: > The asynchronous version "ctidscan" plugin is ready. Thanks for that! I looked at the extended version quickly. IIUC, it uses the proposed APIs, but actually executes ctidscans *synchronously*, so it does not improve performance. Right?

Re: Refactoring postgres_fdw/connection.c

2022-09-05 Thread Etsuro Fujita
On Tue, Jul 26, 2022 at 4:25 PM Kyotaro Horiguchi wrote: > At Tue, 26 Jul 2022 00:54:47 +0900, Fujii Masao > wrote in > > There are two functions, pgfdw_get_result() and > > pgfdw_get_cleanup_result(), > > to get a query result. They have almost the same code, call > > PQisBusy(), > >

Re: SQL/JSON features for v15

2022-09-05 Thread Amit Langote
On Fri, Sep 2, 2022 at 8:56 PM Justin Pryzby wrote: > On Wed, Aug 31, 2022 at 03:51:18PM +0900, Amit Langote wrote: > > Finally, I get this warning: > > > > execExprInterp.c: In function ‘ExecJsonCoerceCStringToText’: > > execExprInterp.c:4765:3: warning: missing braces around initializer > >