Re: test_decoding assertion failure for the loss of top-sub transaction relationship

2022-09-01 Thread Dilip Kumar
On Fri, Sep 2, 2022 at 11:25 AM kuroda.hay...@fujitsu.com wrote: > > Dear Horiguchi-san, Dilip, > > Thank you for replying! > > > > It seems that SnapBuildCommitTxn() is already taking care of adding > > > the top transaction to the committed transaction if any subtransaction > > > has the

RE: test_decoding assertion failure for the loss of top-sub transaction relationship

2022-09-01 Thread kuroda.hay...@fujitsu.com
Dear Horiguchi-san, Dilip, Thank you for replying! > > It seems that SnapBuildCommitTxn() is already taking care of adding > > the top transaction to the committed transaction if any subtransaction > > has the catalog changes, it has just missed setting the flag so I > > think just setting the

Re: test_decoding assertion failure for the loss of top-sub transaction relationship

2022-09-01 Thread Kyotaro Horiguchi
At Fri, 2 Sep 2022 10:59:56 +0530, Dilip Kumar wrote in > On Fri, Sep 2, 2022 at 6:38 AM kuroda.hay...@fujitsu.com > wrote: > > > > Hi Hackers, > > > > > Therefore, this leads to the failure for the assert that can check > > > the consistency that when one sub transaction modifies the catalog,

Re: test_decoding assertion failure for the loss of top-sub transaction relationship

2022-09-01 Thread Dilip Kumar
On Fri, Sep 2, 2022 at 6:38 AM kuroda.hay...@fujitsu.com wrote: > > Hi Hackers, > > > Therefore, this leads to the failure for the assert that can check > > the consistency that when one sub transaction modifies the catalog, > > its top transaction should be marked so as well. > > > > I feel we

Re: broken table formatting in psql

2022-09-01 Thread Kyotaro Horiguchi
At Thu, 01 Sep 2022 18:22:06 +0900 (JST), Kyotaro Horiguchi wrote in > At Thu, 1 Sep 2022 15:00:38 +0700, John Naylor > wrote in > > UnicodeData.txt has this: > > > > 200B;ZERO WIDTH SPACE;Cf;0;BN;N; > > 200C;ZERO WIDTH NON-JOINER;Cf;0;BN;N; > > 200D;ZERO WIDTH

Re: Bug: Reading from single byte character column type may cause out of bounds memory reads.

2022-09-01 Thread Noah Misch
On Thu, Sep 01, 2022 at 03:35:52PM -0400, Tom Lane wrote: > Spyridon Dimitrios Agathos writes: > > this is to verify that the .patch proposed here: > > https://www.postgresql.org/message-id/flat/2318797.1638558730%40sss.pgh.pa.us > > fixes the issue. > > > Looking forward to the next steps. > >

Re: [HACKERS] PoC: custom signal handler for extensions

2022-09-01 Thread Andrey Lepikhov
On 1/12/18 20:51, Teodor Sigaev wrote: In perspective, this mechanism provides the low-level instrument to define remote procedure call on extension side. The simple RPC that defines effective userid on remote backend (remote_effective_user function) is attached for example. 7) Suppose, API

Re: test_decoding assertion failure for the loss of top-sub transaction relationship

2022-09-01 Thread Kyotaro Horiguchi
Good catch, and thanks for the patch! At Fri, 2 Sep 2022 01:08:04 +, "kuroda.hay...@fujitsu.com" wrote in > PSA patch that fixes the failure. > This adds pairs of sub-top transactions to the SnapBuild, and it will be > serialized and restored. > The pair will be checked when we mark the

Re: Column Filtering in Logical Replication

2022-09-01 Thread Peter Smith
On Thu, Sep 1, 2022 at 7:53 PM Amit Kapila wrote: > > On Fri, Aug 26, 2022 at 7:33 AM Peter Smith wrote: > > > > Few comments on both the patches: > v4-0001* > = > 1. > Furthermore, if the table uses > + REPLICA IDENTITY FULL, specifying a column list is not > + allowed (it will

Re: [PATCH] Optimize json_lex_string by batching character copying

2022-09-01 Thread John Naylor
On Wed, Aug 31, 2022 at 11:17 AM Nathan Bossart wrote: > > On Wed, Aug 31, 2022 at 10:50:39AM +0700, John Naylor wrote: > > Here's the final piece. I debated how many tests to add and decided it > > was probably enough to add one each for checking quotes and > > backslashes in the fast path.

Re: Can we avoid chdir'ing in resolve_symlinks() ?

2022-09-01 Thread Tom Lane
Isaac Morland writes: > On Thu, 1 Sept 2022 at 19:39, Tom Lane wrote: >> This code was mine originally (336969e49), but I sure don't >> remember why I wrote it like that. > Does this happen in a context where we need to worried about the directory > structure changing under us, either

Re: Can we avoid chdir'ing in resolve_symlinks() ?

2022-09-01 Thread Isaac Morland
On Thu, 1 Sept 2022 at 19:39, Tom Lane wrote: This code was mine originally (336969e49), but I sure don't > remember why I wrote it like that. I know we didn't have a > robust version of canonicalize_path() then, and that may have > been the main issue, but that offhand comment about mount >

Re: windows resource files, bugs and what do we actually want

2022-09-01 Thread Andres Freund
Hi, On 2022-08-29 15:13:14 -0700, Andres Freund wrote: > 1) For make based builds, all libraries that are built with MODULES rather >than MODULES_big have the wrong "FILETYPE", because Makefile.win32 checks >$(shlib), which is only set for MODULES_big. > >This used to be even more

Re: PostgreSQL 15 release announcement draft

2022-09-01 Thread Jonathan S. Katz
On 8/31/22 8:15 PM, Justin Pryzby wrote: On Tue, Aug 30, 2022 at 03:58:48PM -0400, Jonathan S. Katz wrote: In this latest release, PostgreSQL improves on its in-memory and on-disk sorting algorithms, with benchmarks showing speedups of 25% - 400% based on sort types. rather than "based on":

RE: test_decoding assertion failure for the loss of top-sub transaction relationship

2022-09-01 Thread kuroda.hay...@fujitsu.com
Hi Hackers, > Therefore, this leads to the failure for the assert that can check > the consistency that when one sub transaction modifies the catalog, > its top transaction should be marked so as well. > > I feel we need to remember the relationship between top transaction and sub > transaction

Re: PostgreSQL 15 release announcement draft

2022-09-01 Thread Jonathan S. Katz
On 8/31/22 1:51 PM, Michael Banck wrote: Hi, On Tue, Aug 30, 2022 at 03:58:48PM -0400, Jonathan S. Katz wrote: ### Other Notable Changes PostgreSQL server-level statistics are now collected in shared memory, eliminating the statistics collector process and writing these stats to disk.

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

2022-09-01 Thread David Rowley
On Fri, 2 Sept 2022 at 12:55, Ranier Vilela wrote: > Why not? > astate_values = accumArrayResult(astate_values, > PointerGetDatum(a), > false, > TEXTOID, > CurrentMemoryContext); > > Is it

test_decoding assertion failure for the loss of top-sub transaction relationship

2022-09-01 Thread osumi.takami...@fujitsu.com
Hi, hackers I've met an assertion failure of logical decoding with below scenario on HEAD. --- create table tab1 (val integer); select 'init' from pg_create_logical_replication_slot('regression_slot', 'test_decoding'); begin; savepoint sp1; insert into tab1 values (1); checkpoint; -- for

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

2022-09-01 Thread Ranier Vilela
Em qui., 1 de set. de 2022 às 21:27, David Rowley escreveu: > On Sat, 27 Aug 2022 at 01:29, Ranier Vilela wrote: > > At function has_matching_range, if variable ranges->nranges == 0, > > we exit quickly with a result equal to false. > > > > This means that nranges can be zero. > > It occurs

[PATCH] docs: Document the automatically generated names for indices

2022-09-01 Thread jadel
From: Jade Lovelace I have intentionally been careful to not guarantee that the automatically generated name *is* what's documented, but instead give the general idea. Knowing the format is useful for people writing migrations/ORM tools which need to name their unique indices and may wish to

[PATCH] docs: Document the automatically generated names for indices

2022-09-01 Thread jadel
Previously, the automatically generated names were entirely undocumented. That is not a very good state of affairs: although it's possibly inconvenient to rigidly specify what it is since it's an implementation detail, these names are user-visible, and it would be good to have documentation at

Re: introduce bufmgr hooks

2022-09-01 Thread Andres Freund
Hi, On 2022-09-01 13:11:50 -0700, Nathan Bossart wrote: > On Wed, Aug 31, 2022 at 08:29:31AM -0700, Andres Freund wrote: > > I'm very doubtful this is a good idea. These are quite hot paths. While not > > a > > huge cost, adding an indirection isn't free nonetheless. > > Are you concerned about

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

2022-09-01 Thread David Rowley
On Sat, 27 Aug 2022 at 01:29, Ranier Vilela wrote: > At function has_matching_range, if variable ranges->nranges == 0, > we exit quickly with a result equal to false. > > This means that nranges can be zero. > It occurs then that it is possible then to occur an array out of bonds, in > the

Can we avoid chdir'ing in resolve_symlinks() ?

2022-09-01 Thread Tom Lane
find_my_exec() wants to obtain an absolute, symlink-free path to the program's own executable, for what seem to me good reasons. However, chasing down symlinks is left to its subroutine resolve_symlinks(), which does this: * To resolve a symlink properly, we have to chdir into its directory

Re: postgres_fdw hint messages

2022-09-01 Thread Nathan Bossart
On Thu, Sep 01, 2022 at 07:08:49PM -0400, Tom Lane wrote: > (1) there probably needs to be some threshold of closeness, so we don't > offer "foobar" when the user wrote "huh" Agreed. > (2) there are several places doing this now, and there will no doubt > be more later, so we need to try to

Re: [RFC] building postgres with meson - v11

2022-09-01 Thread samay sharma
Hi, On Wed, Aug 31, 2022 at 1:42 AM Peter Eisentraut < peter.eisentr...@enterprisedb.com> wrote: > On 24.08.22 17:30, Andres Freund wrote: > >> 0545eec895 meson: Add docs > >> > >> We should think more about how to arrange the documentation. We > >> probably don't want to copy-and-paste all the

Re: [PATCH v1] fix potential memory leak in untransformRelOptions

2022-09-01 Thread Junwang Zhao
got it, thanks. Tom Lane 于2022年9月2日 周五01:13写道: > Junwang Zhao writes: > > I'm a little confused when we should call *pfree* and when we should not. > > A few lines before there is a call *text_to_cstring* in which it invokes > > *pfree* to free the unpacked text [0]. I'm just thinking that

Re: postgres_fdw hint messages

2022-09-01 Thread Tom Lane
Nathan Bossart writes: > On Fri, Aug 26, 2022 at 12:35:38PM -0400, Tom Lane wrote: >> I vote for just dropping all these hints for now, while leaving the >> door open for anyone who wants to write closest-match-offering code. > Here is a quickly-hacked-together proof-of-concept for using

Re: postgres_fdw hint messages

2022-09-01 Thread Nathan Bossart
On Fri, Aug 26, 2022 at 12:35:38PM -0400, Tom Lane wrote: > Peter also mentioned the possibility of "did you mean" with a closest > match offered. That seems like a reasonable idea if someone > is motivated to create the code, which I'm not. > > I vote for just dropping all these hints for now,

Re: Allow logical replication to copy tables in binary format

2022-09-01 Thread Andres Freund
Hi, On 2022-08-10 18:03:56 +0300, Melih Mutlu wrote: > To copy tables, COPY command is used and that command supports copying in > binary. So it seemed to me possible to copy in binary for tablesync too. > I'm not sure if there is a reason to always copy tables in text format. It'd be good to

Re: SQL/JSON features for v15

2022-09-01 Thread Jonathan S. Katz
On 9/1/22 5:13 PM, Andrew Dunstan wrote: On 2022-08-31 We 14:22, Andrew Dunstan wrote: On 2022-08-31 We 12:48, Jonathan S. Katz wrote: With RMT hat on -- Andrew can you please revert the patchset? :-( Yes, I'll do it, starting with the v15 branch. Might take a day or so. done Thank

Re: windows resource files, bugs and what do we actually want

2022-09-01 Thread Magnus Hagander
On Thu, Sep 1, 2022 at 11:22 PM Andres Freund wrote: > Hi, > > On 2022-09-01 22:34:07 +0200, Magnus Hagander wrote: > > 4) We include the date, excluding 0 for some mysterious reason, in the > > > version > > >number. This seems to unnecessarily contribute to making the build > not > > >

Re: Bug: When user-defined AM is used, the index path cannot be selected correctly

2022-09-01 Thread Tom Lane
I wrote: > I think we need something more like the attached. Meh -- serves me right for not doing check-world before sending. The patch causes some plans to change in the btree_gin and btree_gist modules; which is good, because that shows that the patch is actually doing what it's supposed to.

Re: windows resource files, bugs and what do we actually want

2022-09-01 Thread Andres Freund
Hi, On 2022-09-01 22:34:07 +0200, Magnus Hagander wrote: > 4) We include the date, excluding 0 for some mysterious reason, in the > > version > >number. This seems to unnecessarily contribute to making the build not > >reproducible. Hails from long ago: > > > >commit

Re: Use -fvisibility=hidden for shared libraries

2022-09-01 Thread Andres Freund
Hi, On 2022-07-27 14:02:28 -0400, Tom Lane wrote: > Andres Freund writes: > > On 2022-07-18 00:05:16 -0700, Andres Freund wrote: > >> Given that that's just about all compilers we support using configure, > >> perhaps > >> we should just move that out of the compiler specific section? Doesn't

Re: introduce bufmgr hooks

2022-09-01 Thread Nathan Bossart
On Tue, Aug 30, 2022 at 03:22:43PM -0700, Nathan Bossart wrote: > Okay, will do. v2 attached. -- Nathan Bossart Amazon Web Services: https://aws.amazon.com >From df1556c6da69f8c0aae9f8878f24e21907cf4d89 Mon Sep 17 00:00:00 2001 From: Nathan Bossart Date: Thu, 11 Aug 2022 16:24:26 -0700

Re: SQL/JSON features for v15

2022-09-01 Thread Andrew Dunstan
On 2022-08-31 We 14:22, Andrew Dunstan wrote: > On 2022-08-31 We 12:48, Jonathan S. Katz wrote: >> >> With RMT hat on -- Andrew can you please revert the patchset? > > :-( > > > Yes, I'll do it, starting with the v15 branch. Might take a day or so. > > done cheers andrew -- Andrew Dunstan

Re: allowing for control over SET ROLE

2022-09-01 Thread Nathan Bossart
On Wed, Aug 31, 2022 at 08:56:31AM -0400, Robert Haas wrote: > In some circumstances, it may be desirable to control this behavior. > For example, if we GRANT pg_read_all_settings TO seer, we do want the > seer to be able to read all the settings, else we would not have > granted the role. But we

Re: windows resource files, bugs and what do we actually want

2022-09-01 Thread Magnus Hagander
On Tue, Aug 30, 2022 at 12:13 AM Andres Freund wrote: > Hi, > > A few things about the windows resource files we generate > > 1) For make based builds, all libraries that are built with MODULES rather >than MODULES_big have the wrong "FILETYPE", because Makefile.win32 > checks >$(shlib),

Re: pg_auth_members.grantor is bunk

2022-09-01 Thread Jeff Davis
On Mon, 2022-08-22 at 11:47 -0400, Robert Haas wrote: > On Thu, Aug 18, 2022 at 1:26 PM Robert Haas > wrote: > > On Wed, Aug 10, 2022 at 4:28 PM Robert Haas > > wrote: > > > Well, CI isn't happy with this, and for good reason: > > > > CI is happier with this version, so I've committed 0001. If

Re: Bug: When user-defined AM is used, the index path cannot be selected correctly

2022-09-01 Thread Tom Lane
Quan Zongliang writes: > New patch attached. > It seems that partitions do not use AM other than btree and hash. > Rewrite only indxpath.c and check if it is a custom AM. This seems drastically underdocumented, and the test you're using for extension opclasses is wrong. What we need to know

Re: introduce bufmgr hooks

2022-09-01 Thread Nathan Bossart
On Wed, Aug 31, 2022 at 08:29:31AM -0700, Andres Freund wrote: > I'm very doubtful this is a good idea. These are quite hot paths. While not a > huge cost, adding an indirection isn't free nonetheless. Are you concerned about the NULL check or the potential hook implementations? I can probably

Re: Bug: Reading from single byte character column type may cause out of bounds memory reads.

2022-09-01 Thread Tom Lane
Spyridon Dimitrios Agathos writes: > this is to verify that the .patch proposed here: > https://www.postgresql.org/message-id/flat/2318797.1638558730%40sss.pgh.pa.us > fixes the issue. > Looking forward to the next steps. That's been committed into HEAD and v15, without pushback so far. So the

Re: add test: pg_rowlocks extension

2022-09-01 Thread Tom Lane
Dong Wook Lee writes: > I modified my previous patch by reflecting the feedback. > and I wrote most of the queries for the test after looking at the file below. Pushed with some revisions. Notably, I didn't see any point in repeating each test case four times, so I trimmed it down to once per

Re: Handle infinite recursion in logical replication setup

2022-09-01 Thread vignesh C
On Thu, 1 Sept 2022 at 09:19, Amit Kapila wrote: > > On Wed, Aug 31, 2022 at 11:35 AM Peter Smith wrote: > > > > Here are my review comments for v43-0001. > > > > == > > > > 1. Commit message > > > > The initial copy phase has no way to know the origin of the row data, > > so if 'copy_data =

make additional use of optimized linear search routines

2022-09-01 Thread Nathan Bossart
Hi hackers, Now that we have some optimized linear search routines [0], I thought I'd quickly check whether we could use them elsewhere. To start, I took another look at a previously posted patch [1] and noticed two potentially useful applications of pg_lfind32(). The attached patches replace

Re: Handle infinite recursion in logical replication setup

2022-09-01 Thread vignesh C
On Thu, 1 Sept 2022 at 08:01, shiy.f...@fujitsu.com wrote: > > On Wed, Aug 31, 2022 1:06 AM vignesh C wrote: > > > > The attached v43 patch has the changes for the same. > > > > Thanks for updating the patch. > > Here is a comment on the 0001 patch. > > + if (!isnewtable) > +

Re: Handle infinite recursion in logical replication setup

2022-09-01 Thread vignesh C
On Wed, 31 Aug 2022 at 11:45, Peter Smith wrote: > > Here are some review comments for patch v43-0002: > > == > > 1. doc/src/sgml/ref/create_subscription.sgml > > @@ -403,7 +403,9 @@ CREATE SUBSCRIPTION class="parameter">subscription_name warning to notify the user to check the publisher

Re: Handle infinite recursion in logical replication setup

2022-09-01 Thread vignesh C
On Mon, 29 Aug 2022 at 16:35, Amit Kapila wrote: > > On Wed, Aug 24, 2022 at 7:27 PM vignesh C wrote: > > > > Since there was no objections to change it to throw a warning, I have > > made the changes for the same. > > > > Review comments for v42-0001* > == > 1. Can we

Re: Handle infinite recursion in logical replication setup

2022-09-01 Thread vignesh C
On Wed, 31 Aug 2022 at 11:35, Peter Smith wrote: > > Here are my review comments for v43-0001. > > == > > 1. Commit message > > The initial copy phase has no way to know the origin of the row data, > so if 'copy_data = true' in the step 4 below, log a warning to notify user > that potentially

Re: Tracking last scan time

2022-09-01 Thread Andres Freund
Hi, On 2022-09-01 14:18:42 +0200, Matthias van de Meent wrote: > On Wed, 31 Aug 2022 at 20:56, Andres Freund wrote: > > But given this is done when stats are flushed, which only happens after the > > transaction ended, we can just use GetCurrentTransactionStopTimestamp() - if > > we got to

Re: [PATCH v1] fix potential memory leak in untransformRelOptions

2022-09-01 Thread Tom Lane
Junwang Zhao writes: > I'm a little confused when we should call *pfree* and when we should not. > A few lines before there is a call *text_to_cstring* in which it invokes > *pfree* to free the unpacked text [0]. I'm just thinking that since *s* has > been duplicated, we should free it, that's

[BUG] wrong FK constraint name when colliding name on ATTACH

2022-09-01 Thread Jehan-Guillaume de Rorthais
Hi, While studying and hacking on the parenting constraint issue, I found an incoherent piece of code leading to badly chosen fk name. If a constraint name collision is detected, while choosing a new name for the constraint, the code uses fkconstraint->fk_attrs which is not yet populated: /*

Re: [PATCH v1] fix potential memory leak in untransformRelOptions

2022-09-01 Thread Junwang Zhao
On Thu, Sep 1, 2022 at 10:10 PM Tom Lane wrote: > > Junwang Zhao writes: > > result = lappend(result, makeDefElem(pstrdup(s), val, -1)); > > + pfree(s); > > I wonder why it's pstrdup'ing s in the first place. > Maybe it's pstrdup'ing s so that the caller should take care of the free? I'm a

Re: [PATCH v1] fix potential memory leak in untransformRelOptions

2022-09-01 Thread Tom Lane
Junwang Zhao writes: > result = lappend(result, makeDefElem(pstrdup(s), val, -1)); > + pfree(s); I wonder why it's pstrdup'ing s in the first place. regards, tom lane

Re: POC: GROUP BY optimization

2022-09-01 Thread Jonathan S. Katz
On 9/1/22 9:06 AM, Tomas Vondra wrote: On 8/30/22 15:15, Jonathan S. Katz wrote: On 8/18/22 3:29 AM, Tomas Vondra wrote: On 8/18/22 03:32, David Rowley wrote: Here are a couple of patches to demo the idea. Yeah, that's an option too. I should have mentioned it along with the

Re: SQL/JSON features for v15

2022-09-01 Thread Nikita Glukhov
On 31.08.2022 23:39, Nikita Glukhov wrote: And here is a quick POC patch with an example for COPY and float4 I decided to go further and use new API in SQL/JSON functions (even if it does not make real sense now). I have added function for checking expressions trees, special executor steps

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

2022-09-01 Thread Ranier Vilela
Hi, Excuse me for posting on this thread. Coverity has a complaints about aset.c CID 1497225 (#1 of 2): Out-of-bounds write (OVERRUN)3. overrun-local: Overrunning array set->freelist of 11 8-byte elements at element index 1073741823 (byte offset 8589934591) using index fidx (which evaluates to

Re: plpgsql-trigger.html: Format TG_ variables as table (patch)

2022-09-01 Thread Christoph Berg
Re: Dagfinn Ilmari Mannsåker > > Actually, just omitting the whole prefix works best. > > > > TG_WHEN (text) > > > > BEFORE, AFTER, or INSTEAD OF, depending on the trigger's definition. > > The attached patch does not reflect this, did you attach an old version? Forgot to git commit before

Re: POC: GROUP BY optimization

2022-09-01 Thread Tomas Vondra
On 8/30/22 15:15, Jonathan S. Katz wrote: > On 8/18/22 3:29 AM, Tomas Vondra wrote: >> >> >> On 8/18/22 03:32, David Rowley wrote: > >>> Here are a couple of patches to demo the idea. >>> >> >> Yeah, that's an option too. I should have mentioned it along with the >> cpu_operator_cost. >> >>

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

2022-09-01 Thread Richard Guo
On Wed, Aug 31, 2022 at 2:35 PM Andrey Lepikhov wrote: > Before flattening procedure we just look through the quals of subquery, > pull to the upper level OpExpr's containing variables from the upper > relation and replace their positions in the quals with true expression. > Further, the

Re: TAP output format in pg_regress

2022-09-01 Thread Daniel Gustafsson
> On 18 Aug 2022, at 16:40, Andrew Dunstan wrote: > > On 2022-08-18 Th 07:24, Daniel Gustafsson wrote: >> >> One thing I haven't researched yet is if the Buildfarm or CFBot parses the >> current output in any way or just check the exit status of the testrun. > > Buildfarm: just the status.

Re: Tracking last scan time

2022-09-01 Thread Matthias van de Meent
On Wed, 31 Aug 2022 at 20:56, Andres Freund wrote: > > Hi, > > On 2022-08-31 19:52:49 +0200, Matthias van de Meent wrote: > > As for having a lower granularity and preventing the > > one-syscall-per-Relation issue, can't we reuse the query_start or > > state_change timestamps that appear in

Re: Tracking last scan time

2022-09-01 Thread Dave Page
On Thu, 1 Sept 2022 at 13:04, Bruce Momjian wrote: > On Thu, Sep 1, 2022 at 09:46:59AM +0100, Dave Page wrote: > > On Wed, 31 Aug 2022 at 17:13, Bruce Momjian wrote: > > Wow. I was just thinking you need second-level accuracy, which must > be > > cheap somewhere. > > > > > >

Re: [PATCH v1] fix potential memory leak in untransformRelOptions

2022-09-01 Thread Daniel Gustafsson
> On 1 Sep 2022, at 10:36, Junwang Zhao wrote: > *TextDatumGetCString* calls palloc to alloc memory for the option > text datum, in some cases the the memory is allocated in > *TopTransactionContext*, this may cause memory leak for a long > running backend. Wouldn't that be a fairly

Proposal: Allow walsenders to send WAL directly from wal_buffers to replicas

2022-09-01 Thread Bharath Rupireddy
Hi, walsenders currently read WAL data from disk to send it to all replicas (standbys or subscribers connected via streaming or logical replication respectively). This means that walsenders have to wait until the WAL data is flushed to the disk. There are a few issues with this approach: 1. IO

Re: Tracking last scan time

2022-09-01 Thread Bruce Momjian
On Thu, Sep 1, 2022 at 09:46:59AM +0100, Dave Page wrote: > On Wed, 31 Aug 2022 at 17:13, Bruce Momjian wrote: > Wow.  I was just thinking you need second-level accuracy, which must be > cheap somewhere. > > > Second-level accuracy would indeed be fine for this. Frankly, for my use

Re: pg_rewind WAL segments deletion pitfall

2022-09-01 Thread Polina Bungina
Terribly sorry for misspelling your name and for the topposting! Regards, Polina Bungina

Re: Avoid overhead open-close indexes (catalog updates)

2022-09-01 Thread Ranier Vilela
Em qua., 31 de ago. de 2022 às 22:12, Kyotaro Horiguchi < horikyota@gmail.com> escreveu: > At Wed, 31 Aug 2022 08:16:55 -0300, Ranier Vilela > wrote in > > Hi, > > > > The commit > > > https://github.com/postgres/postgres/commit/b17ff07aa3eb142d2cde2ea00e4a4e8f63686f96 > > Introduced the

Re: pg_rewind WAL segments deletion pitfall

2022-09-01 Thread Polina Bungina
Hello Kayotaro, Here is the new version of the patch that includes the changes you suggested. It is smaller now but I doubt if it is as easy to understand as it used to be. The need of manipulations with the target’s pg_wal/archive_status directory is a question to discuss… At first glance it

Re: pg15b3: recovery fails with wal prefetch enabled

2022-09-01 Thread Thomas Munro
On Thu, Sep 1, 2022 at 5:52 PM Justin Pryzby wrote: > compression method: zstd Ahh, problem repro'd here with WAL compression. More soon.

Re: Column Filtering in Logical Replication

2022-09-01 Thread Amit Kapila
On Fri, Aug 26, 2022 at 7:33 AM Peter Smith wrote: > Few comments on both the patches: v4-0001* = 1. Furthermore, if the table uses + REPLICA IDENTITY FULL, specifying a column list is not + allowed (it will cause publication errors for UPDATE or + DELETE operations). This line

Re: broken table formatting in psql

2022-09-01 Thread Kyotaro Horiguchi
At Thu, 1 Sep 2022 15:00:38 +0700, John Naylor wrote in > On Thu, Sep 1, 2022 at 2:13 PM Pavel Stehule wrote: > > problem is in bad width of invisible char 200E > > I removed this comment in bab982161e since it didn't match the code. > I'd be interested to see what happened after v12. > > -

Re: Solaris "sed" versus pre-v13 plpython tests

2022-09-01 Thread Alvaro Herrera
On 2022-Aug-31, Noah Misch wrote: > On Wed, Aug 31, 2022 at 06:25:01PM -0400, Tom Lane wrote: > > I am not completely sure why buildfarm member wrasse isn't failing > > similarly > > wrasse disabled plpython in v12-, from day one, due to this and a crash bug > that I shelved. I will be

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

2022-09-01 Thread Alvaro Herrera
On 2022-Aug-19, Justin Pryzby wrote: > That would be a memory leak or some other bug, except that it also seems to be > dead code ? > > https://coverage.postgresql.org/src/backend/commands/trigger.c.gcov.html#1166 > > Is it somwhow possible to call CreateTrigger() to create a FOR EACH ROW >

Re: Tracking last scan time

2022-09-01 Thread Dave Page
On Wed, 31 Aug 2022 at 17:13, Bruce Momjian wrote: > On Wed, Aug 31, 2022 at 05:02:33PM +0100, Dave Page wrote: > > > > > > On Tue, 30 Aug 2022 at 19:46, Bruce Momjian wrote: > > > > On Fri, Aug 26, 2022 at 02:05:36PM +0100, Dave Page wrote: > > > On Thu, 25 Aug 2022 at 01:44, David

[PATCH v1] fix potential memory leak in untransformRelOptions

2022-09-01 Thread Junwang Zhao
*TextDatumGetCString* calls palloc to alloc memory for the option text datum, in some cases the the memory is allocated in *TopTransactionContext*, this may cause memory leak for a long running backend. --- src/backend/access/common/reloptions.c | 1 + 1 file changed, 1 insertion(+) diff --git

use NoLock instead of the magic number 0

2022-09-01 Thread Junwang Zhao
Inside *add_local_<>_reloption*, we should pass NoLock instead of the magic 0 to init_<>_reloption, which makes more sense. -- Regards Junwang Zhao 0001-use-NoLock-instead-of-the-magic-0.patch Description: Binary data

Re: broken table formatting in psql

2022-09-01 Thread John Naylor
On Thu, Sep 1, 2022 at 2:13 PM Pavel Stehule wrote: > problem is in bad width of invisible char 200E I removed this comment in bab982161e since it didn't match the code. I'd be interested to see what happened after v12. - * - Other format characters (general category code Cf in the

Re: struct Trigger definition in trigger.sgml

2022-09-01 Thread Richard Guo
On Thu, Sep 1, 2022 at 2:18 PM Etsuro Fujita wrote: > While working on something else, I noticed that commit 487e9861d added > a new field to struct Trigger, but failed to update $SUBJECT to match. > Attached is a small patch for that. +1. Good catch. Thanks Richard

[PATCH] minor bug fix for pg_dump --clean

2022-09-01 Thread Frédéric Yhuel
Hello, When using pg_dump (or pg_restore) with option "--clean", there is some SQL code to drop every objects at the beginning. The DROP statement for a view involving circular dependencies is : CREATE OR REPLACE VIEW [...] (see commit message of d8c05aff for a much better explanation) If

broken table formatting in psql

2022-09-01 Thread Pavel Stehule
Hi I found some data that are badly formatted in psql create table foo(a varchar); insert into foo values('Dětská šperkovnice Goki ‎15545'); insert into foo values('Tlakoměr Omron Evolv s Bluetooth připojením'); insert into foo values('Řetěz KMC ‎BE08SEP22 stříbrný'); psql older than 12 shows

Re: [PATCH v1] [doc] polish the comments of reloptions

2022-09-01 Thread Junwang Zhao
thoughts? On Tue, Aug 30, 2022 at 11:56 AM Junwang Zhao wrote: > > When adding an option, we have 5 choices (bool, integer, real, enum, string), > so the comments seem stale. > > There are some sentences missing *at ShareUpdateExclusiveLock*, this > patch adds them to make the sentences

Re: [PATCH] Use indexes on the subscriber when REPLICA IDENTITY is full on the publisher

2022-09-01 Thread Önder Kalacı
Hi again, > == > > 1. Commit message > > 1a. > With this patch, I'm proposing the following change: If there is an > index on the subscriber, use the index as long as the planner > sub-modules picks any index over sequential scan. The index should be > a btree index, not a partital index.

Re: [PATCH] Use indexes on the subscriber when REPLICA IDENTITY is full on the publisher

2022-09-01 Thread Önder Kalacı
Hi Peter, Thanks for the reviews! I'll reply to both of your reviews separately. > >> 10. > >> > >> + /* we only need to allocate once */ > >> + if (eq == NULL) > >> + eq = palloc0(sizeof(*eq) * outslot->tts_tupleDescriptor->natts); > >> > >> But shouldn't you also free this 'eq' before the

struct Trigger definition in trigger.sgml

2022-09-01 Thread Etsuro Fujita
Hi, While working on something else, I noticed that commit 487e9861d added a new field to struct Trigger, but failed to update $SUBJECT to match. Attached is a small patch for that. Best regards, Etsuro Fujita doc-trigger-def.patch Description: Binary data