RE: Exit walsender before confirming remote flush in logical replication

2023-02-08 Thread Hayato Kuroda (Fujitsu)
Dear Horiguchi-san, Thank you for checking the patch! PSA new version. > 0002: > > This patch doesn't seem to offer a means to change the default > walsender behavior. We need a subscription option named like > "walsender_exit_mode" to do that. As I said in another mail[1], I'm thinking the fe

Re: Logical replication timeout problem

2023-02-08 Thread Amit Kapila
On Wed, Feb 8, 2023 at 10:57 AM Andres Freund wrote: > > On 2023-02-03 10:13:54 +0530, Amit Kapila wrote: > > I am planning to push this to HEAD sometime next week (by Wednesday). > > To backpatch this, we need to fix it in some non-standard way, like > > without introducing a callback which I am

Re: possible proposal plpgsql GET DIAGNOSTICS oid = PG_ROUTINE_OID

2023-02-08 Thread Pavel Stehule
hi st 8. 2. 2023 v 7:33 odesílatel Julien Rouhaud napsal: > On Tue, Feb 07, 2023 at 08:48:22PM +0100, Pavel Stehule wrote: > > > > I have a question about the possibility of simply getting the name of the > > currently executed function. The reason for this request is > simplification > > of w

Re: bitscan forward/reverse on Windows

2023-02-08 Thread John Naylor
I wrote: > Attached is a quick-and-dirty attempt to add MSVC support for the rightmost/leftmost-one-pos functions. > > 0001 adds asserts to the existing coding. > 0002 adds MSVC support. Tests pass on CI, but it's of course possible that there is some bug that prevents hitting the fastpath. I've mo

RE: Time delayed LR (WAS Re: logical replication restrictions)

2023-02-08 Thread Hayato Kuroda (Fujitsu)
Dear Peter, Thank you for reviewing! PSA new version. > == > doc/src/sgml/glossary.sgml > > 1. > + > + Replication setup that applies time-delayed copy of the data. > + > > That sentence seemed a bit strange to me. > > SUGGESTION > Replication setup that delays the applicatio

Re: daitch_mokotoff module

2023-02-08 Thread Alvaro Herrera
On 2023-Jan-17, Dag Lem wrote: > + * Daitch-Mokotoff Soundex > + * > + * Copyright (c) 2021 Finance Norway > + * Author: Dag Lem Hmm, I don't think we accept copyright lines that aren't "PostgreSQL Global Development Group". Is it okay to use that, and update the year to 2023? (Note that answe

Re: Add sub-transaction overflow status in pg_stat_activity

2023-02-08 Thread Kirill Reshke
On Tue, 20 Dec 2022 at 09:23, Dilip Kumar wrote: > > On Tue, Dec 20, 2022 at 2:32 AM Robert Haas wrote: > > > > On Mon, Dec 19, 2022 at 3:48 PM Ted Yu wrote: > > > It seems the comment for `backend_subxact_overflowed` missed a word. > > > > > > Please see the patch. > > > > Committed this fix, t

Re: Deadlock between logrep apply worker and tablesync worker

2023-02-08 Thread Peter Smith
On Tue, Feb 7, 2023 at 6:46 PM houzj.f...@fujitsu.com wrote: > > On Tuesday, February 7, 2023 12:12 PM Peter Smith > wrote: > > On Fri, Feb 3, 2023 at 6:58 PM houzj.f...@fujitsu.com > > > > wrote: > > > > > ... > > > > Right, I think that case could be addressed by Tom's patch to some > > > >

A bug with ExecCheckPermissions

2023-02-08 Thread o . tselebrovskiy
Greetings, everyone! While working on an extension my colleague and I have found an interesting case; When you try to execute next SQL statements on master branch of PostgreSQL: CREATE TABLE parted_fk_naming ( id bigint NOT NULL default 1, id_abc bigint,

Why cann't simplify stable function in planning phase?

2023-02-08 Thread tender wang
Hi hackers, In evaluate_function(), I find codes as shown below: /* * Ordinarily we are only allowed to simplify immutable functions. But for * purposes of estimation, we consider it okay to simplify functions that * are merely stable; the risk that the result might change from planning

PostgreSQL 16 Dev apt-based Linux unable to install

2023-02-08 Thread André Verwijs
PostgreSQL 16 Dev  apt-based Linux,  unable to install  make sure all dependencies are resolved, like libpq5 (or higher) for testing ... " postgresql-client-16 : Prerequisites: libpq5 (>= 16~~devel) but 15.1-1.pgdg+1+b1 will be installed " -- _

RE: Exit walsender before confirming remote flush in logical replication

2023-02-08 Thread Hayato Kuroda (Fujitsu)
> > Dear Horiguchi-san, > > Thank you for checking the patch! PSA new version. PSA rebased patch that supports updated time-delayed patch[1]. [1]: https://www.postgresql.org/message-id/tyapr01mb5866c11daf8ab04f3cc181d3f5...@tyapr01mb5866.jpnprd01.prod.outlook.com Best Regards, Hayato Kuroda F

Re: pglz compression performance, take two

2023-02-08 Thread Tomas Vondra
On 2/7/23 21:18, Andres Freund wrote: > Hi, > > On 2023-02-05 10:36:39 -0800, Andrey Borodin wrote: >> On Fri, Jan 6, 2023 at 10:02 PM Andrey Borodin wrote: >>> >>> Hello! Please find attached v8. >> >> I got some interesting feedback from some patch users. >> There was an oversight that frequ

Re: Why cann't simplify stable function in planning phase?

2023-02-08 Thread Laurenz Albe
On Wed, 2023-02-08 at 16:59 +0800, tender wang wrote: >    In evaluate_function(), I find codes as shown below: > >  /* >   * Ordinarily we are only allowed to simplify immutable functions. But for >   * purposes of estimation, we consider it okay to simplify functions that >   * are merely stable

Re: Why cann't simplify stable function in planning phase?

2023-02-08 Thread Tomas Vondra
On 2/8/23 09:59, tender wang wrote: > Hi hackers, >    In evaluate_function(), I find codes as shown below: > >  /* >   * Ordinarily we are only allowed to simplify immutable functions. But for >   * purposes of estimation, we consider it okay to simplify functions that >   * are merely stable;

Re: make_ctags: use -I option to ignore pg_node_attr macro

2023-02-08 Thread Fujii Masao
On 2023/02/08 9:49, Tatsuo Ishii wrote: I am not sure if this is good way to check if ctags supports "-e" or not. + thenctags --version 2>&1 | grep -- -e >/dev/null Perhaps, "--help" might be intended rather than "--version" to check supported options? Yeah, that was my mistake.

Re: meson: Optionally disable installation of test modules

2023-02-08 Thread Peter Eisentraut
On 01.02.23 13:41, Nazir Bilal Yavuz wrote: On 1/31/23 11:44, Peter Eisentraut wrote: On 30.01.23 18:42, Andres Freund wrote: Bilal, with a bit of help by me, worked on an alternative approach to this. It's a lot more verbose in the initial change, but wouldn't increase the amount of work/lin

Re: generic plans and "initial" pruning

2023-02-08 Thread Amit Langote
On Tue, Feb 7, 2023 at 23:38 Andres Freund wrote: > Hi, > > On 2023-02-03 22:01:09 +0900, Amit Langote wrote: > > I've added a test case under src/modules/delay_execution by adding a > > new ExecutorStart_hook that works similarly as > > delay_execution_planner(). The test works by allowing a co

Re: deadlock-hard flakiness

2023-02-08 Thread Thomas Munro
On Wed, Feb 8, 2023 at 2:10 PM Andres Freund wrote: > I'm fairly sure I've seen this failure on the buildfarm as well, but I'm too > impatient to wait for the buildfarm database query (it really should be > updated to use lz4 toast compression). Failures in deadlock-hard (excluding crashes, becau

Re: deadlock-hard flakiness

2023-02-08 Thread Thomas Munro
On Wed, Feb 8, 2023 at 11:34 PM Thomas Munro wrote: > On Wed, Feb 8, 2023 at 2:10 PM Andres Freund wrote: > > I'm fairly sure I've seen this failure on the buildfarm as well, but I'm too > > impatient to wait for the buildfarm database query (it really should be > > updated to use lz4 toast compr

Re: Performance issues with parallelism and LIMIT

2023-02-08 Thread Tomas Vondra
On 2/1/23 14:41, David Geier wrote: > Hi hackers, > > While migrating from PostgreSQL 14 to 15, we encountered the following > performance degradation caused by commit 46846433a03dff: "shm_mq: Update > mq_bytes_written less often", discussion in [1]. > > The batching can make queries with a LIMIT

meson: Non-feature feature options

2023-02-08 Thread Peter Eisentraut
Most meson options (meson_options.txt) that enable an external dependency (e.g., icu, ldap) are of type 'feature'. Most of these have a default value of 'auto', which means they are pulled in automatically if found. Some have a default value of 'disabled' for specific reasons (e.g., selinux).

Re: A bug with ExecCheckPermissions

2023-02-08 Thread Alvaro Herrera
On 2023-Feb-08, o.tselebrovs...@postgrespro.ru wrote: > But if you debug function ExecCheckPermissions and look into what is passed > to function (contents of rangeTable and rteperminfos to be exact), > you'll see some strange behaviour: > Both of RangeTableEntries have a perminfoindex of 0 and s

REASSIGN OWNED vs ALTER TABLE OWNER TO permission inconsistencies

2023-02-08 Thread Nazir Bilal Yavuz
Hi, My colleague Adam realized that when transferring ownership, 'REASSIGN OWNED' command doesn't check 'CREATE privilege on the table's schema' on new owner but 'ALTER TABLE OWNER TO' docs state that: To alter the owner, you must also be a direct or indirect member of the new owning role, a

Re: Fix GUC_NO_SHOW_ALL test scenario in 003_check_guc.pl

2023-02-08 Thread Nitin Jadhav
> Okay, the part to add an initialization check for GUC_NO_SHOW_ALL and > GUC_NOT_IN_SAMPLE looked fine by me, so applied after more comment > polishing. > > 0001 has been applied to clean up the existing situation. Thanks for committing these 2 changes. > On top of that, I have noticed an extra

Re: A bug with ExecCheckPermissions

2023-02-08 Thread Amit Langote
On Wed, Feb 8, 2023 at 16:19 Alvaro Herrera wrote: > On 2023-Feb-08, o.tselebrovs...@postgrespro.ru wrote: > > > But if you debug function ExecCheckPermissions and look into what is > passed > > to function (contents of rangeTable and rteperminfos to be exact), > > you'll see some strange behavio

Re: make_ctags: use -I option to ignore pg_node_attr macro

2023-02-08 Thread Tatsuo Ishii
>> Attached is the v2 patch. > > Thanks for the patch! > > With the patch, I got the following error when executing make_etags.. > > $ ./src/tools/make_etags > etags: invalid option -- 'e' > Try 'etags --help' for a complete list of options. > sort: No such file or directory Oops. Thank y

Re: meson: Non-feature feature options

2023-02-08 Thread Nazir Bilal Yavuz
Hi, On 2/8/23 13:45, Peter Eisentraut wrote: The problem is that these features now cannot be automatically enabled and behave annoyingly different from other feature options. Agreed. For the 'ssl' option, we have deprecated the --with-openssl option in configure and replaced it with --w

Re: pgbench: using prepared BEGIN statement in a pipeline could cause an error

2023-02-08 Thread Alvaro Herrera
On 2022-Sep-30, Yugo NAGATA wrote: > Well, I still don't understand why we need to prepare only "the > commands within a pipeline" before starting pipeline. In the current > behavior, the entire script is prepared in advance just before executing > the first SQL command in the script, instead of

Re: pgbench: using prepared BEGIN statement in a pipeline could cause an error

2023-02-08 Thread Alvaro Herrera
On 2023-Feb-08, Alvaro Herrera wrote: > I propose instead the following: each command is prepared just before > it's executed, as previously, and if we see a \startpipeline, then we > prepare all commands starting with the one just after, and until the > \endpipeline. Here's the patch. -- Álvar

Re: OpenSSL 3.0.0 vs old branches

2023-02-08 Thread Andrew Dunstan
On 2023-02-07 Tu 23:37, Tom Lane wrote: Michael Paquier writes: On Tue, Feb 07, 2023 at 01:28:26PM -0500, Tom Lane wrote: I think Peter's misremembering the history, and OpenSSL 3 *is* supported in these branches. There could be an argument for not back-patching f0d2c65f17 on the grounds tha

Re: run pgindent on a regular basis / scripted manner

2023-02-08 Thread Andrew Dunstan
On 2023-02-07 Tu 12:21, Jelte Fennema wrote: On Mon, Feb 6, 2023 at 10:21 AM Andrew Dunstan wrote: Here's a quick patch for 1 and 3. Would also need to adjust the docco. This time with patch. When supplying the --commit flag it still formats all files for me. I was able to fix that by repl

Re: [PATCH] Make ON CONFLICT DO NOTHING and ON CONFLICT DO UPDATE consistent

2023-02-08 Thread Aleksander Alekseev
Hi, > To me it's a pretty fundamental violation of how heap visibility works. I don't think this has much to do with heap visibility. It's true that generally a command doesn't see its own tuples. This is done in order to avoid the Halloween problem which however can't happen in this particular c

Re: daitch_mokotoff module

2023-02-08 Thread Dag Lem
Tomas Vondra writes: > On 2/7/23 18:08, Paul Ramsey wrote: >> >> >>> On Feb 7, 2023, at 6:47 AM, Dag Lem wrote: >>> >>> I just went by to check the status of the patch, and I noticed that >>> you've added yourself as reviewer earlier - great! >>> >>> Please tell me if there is anything I can d

Re: run pgindent on a regular basis / scripted manner

2023-02-08 Thread Andrew Dunstan
On 2023-02-08 We 07:41, Andrew Dunstan wrote: On 2023-02-07 Tu 12:21, Jelte Fennema wrote: Does the code-base flag still make sense if you can simply pass a directory as regular args now? Probably not. I'll look into removing it. What we should probably do is remove all the build st

Re: Parallelize correlated subqueries that execute within each worker

2023-02-08 Thread James Coleman
On Mon, Feb 6, 2023 at 11:39 AM Antonin Houska wrote: > > James Coleman wrote: > > Which this patch we do in fact now see (as expected) rels with > > non-empty lateral_relids showing up in generate_[useful_]gather_paths. > > And the partial paths can now have non-empty required outer rels. I'm >

Re: [PATCH] Reuse Workers and Replication Slots during Logical Replication

2023-02-08 Thread shveta malik
On Tue, Feb 7, 2023 at 8:18 AM shiy.f...@fujitsu.com wrote: > > > On Thu, Feb 2, 2023 11:48 AM shveta malik wrote: > > > > > > So to fix this, I think either we update origin and slot entries in > > the system catalog after the creation has passed or we clean-up the > > system catalog in case of

Re: Hi i am Intrested to contribute

2023-02-08 Thread Aleksander Alekseev
Hi, Shivam! > You may find useful the guide on how to contribute [1]. You can freely > choose what you want (from the list of TODOs linked or anything else) > and work on it, no permission from anyone is necessary. > The downside is that it's not easy to detect what is useful for the > first time,

Wrong rows estimations with joins of CTEs slows queries by more than factor 500

2023-02-08 Thread Hans Buschmann
During data refactoring of our Application I encountered $subject when joining 4 CTEs with left join or inner join. 1. Background PG 15.1 on Windows x64 (OS seems no to have no meening here) I try to collect data from 4 (analyzed) tables (up,li,in,ou) by grouping certain data (4 CTEs qup,qli

Re: PostgreSQL 16 Dev apt-based Linux unable to install

2023-02-08 Thread Justin Pryzby
On Wed, Feb 08, 2023 at 10:46:42AM +0100, André Verwijs wrote: > > PostgreSQL 16 Dev  apt-based Linux,  unable to install  > make sure all dependencies are resolved, like libpq5 (or higher) for testing > ... > > " postgresql-client-16 : Prerequisites: libpq5 (>= 16~~devel) but > 15.1-1.pgdg+

Re: Improve WALRead() to suck data directly from WAL buffers when possible

2023-02-08 Thread Bharath Rupireddy
On Wed, Feb 8, 2023 at 10:33 AM Dilip Kumar wrote: > > On Wed, Feb 8, 2023 at 9:57 AM Bharath Rupireddy > wrote: > > > > I can also do a few other things, but before working on them, I'd like > > to hear from others: > > 1. A separate wait event (WAIT_EVENT_WAL_READ_FROM_BUFFERS) for > > reading

Re: daitch_mokotoff module

2023-02-08 Thread Dag Lem
Alvaro Herrera writes: > On 2023-Jan-17, Dag Lem wrote: > >> + * Daitch-Mokotoff Soundex >> + * >> + * Copyright (c) 2021 Finance Norway >> + * Author: Dag Lem > > Hmm, I don't think we accept copyright lines that aren't "PostgreSQL > Global Development Group". Is it okay to use that, and updat

Re: Why cann't simplify stable function in planning phase?

2023-02-08 Thread Tom Lane
Tomas Vondra writes: > Note: To be precise this is not about "executions" but about snapshots, > and we could probably simplify the function call with isolation levels > that maintain a single snapshot (e.g. REPEATABLE READ). But we don't. We don't do that because, in fact, execution is *never* d

Re: OpenSSL 3.0.0 vs old branches

2023-02-08 Thread Erik Rijkers
Op 08-02-2023 om 05:37 schreef Tom Lane: Michael Paquier writes: On Tue, Feb 07, 2023 at 01:28:26PM -0500, Tom Lane wrote: I think Peter's misremembering the history, and OpenSSL 3 *is* supported in these branches. There could be an argument for not back-patching f0d2c65f17 on the grounds tha

Re: Weird failure with latches in curculio on v15

2023-02-08 Thread Robert Haas
On Sun, Feb 5, 2023 at 7:46 PM Nathan Bossart wrote: > Got it. I suspect we'll want to do something similar for archive modules > eventually, too. +1. I felt like the archive modules work was a step forward when we did, because basic_archive does some things that you're not likely to get right

Re: OpenSSL 3.0.0 vs old branches

2023-02-08 Thread Peter Eisentraut
On 07.02.23 19:28, Tom Lane wrote: I think Peter's misremembering the history, and OpenSSL 3*is* supported in these branches. There could be an argument for not back-patching f0d2c65f17 on the grounds that pre-1.1.1 is also supported there. On the whole though, it seems more useful today for th

Re: [PATCH] Make ON CONFLICT DO NOTHING and ON CONFLICT DO UPDATE consistent

2023-02-08 Thread Andres Freund
Hi, On 2023-02-08 16:08:39 +0300, Aleksander Alekseev wrote: > > To me it's a pretty fundamental violation of how heap visibility works. > > I don't think this has much to do with heap visibility. It's true that > generally a command doesn't see its own tuples. This is done in order > to avoid th

Re: possible proposal plpgsql GET DIAGNOSTICS oid = PG_ROUTINE_OID

2023-02-08 Thread Kirk Wolak
On Wed, Feb 8, 2023 at 3:08 AM Pavel Stehule wrote: > hi > > st 8. 2. 2023 v 7:33 odesílatel Julien Rouhaud > napsal: > >> On Tue, Feb 07, 2023 at 08:48:22PM +0100, Pavel Stehule wrote: >> > >> > GET DIAGNOSTICS _oid = PG_ROUTINE_OID; >> > RAISE NOTICE '... % ... %', _oid, _oid::regproc::text; >

Re: typos

2023-02-08 Thread Justin Pryzby
Some more accumulated/new typos. >From 6c79a0d4e0251dbbac38babb60bb2d0fbae3da8d Mon Sep 17 00:00:00 2001 From: Justin Pryzby Date: Wed, 11 Jan 2023 12:52:25 -0600 Subject: [PATCH 01/10] use "an SQL" rather than a SQL Per 04539e --- doc/src/sgml/ecpg.sgml | 6 +++--- 1 file changed, 3 insertions(

Re: Named Operators

2023-02-08 Thread Tom Lane
Peter Eisentraut writes: > On 12.01.23 14:55, Matthias van de Meent wrote: >>> Matter of taste, I guess. But more importantly, defining an operator >>> gives you many additional features that the planner can use to >>> optimize your query differently, which it can't do with functions. See >>> the

Re: OpenSSL 3.0.0 vs old branches

2023-02-08 Thread Tom Lane
Erik Rijkers writes: > Op 08-02-2023 om 05:37 schreef Tom Lane: >> Question: is anybody around here still testing with 0.9.8 (or 1.0.x) >> at all? The systems I had that had that version on them are dead. > I've hoarded an old centos 6.1 system that I don't really use anymore > but sometimes (o

Re: Why cann't simplify stable function in planning phase?

2023-02-08 Thread Andres Freund
Hi, On 2023-02-08 09:57:04 -0500, Tom Lane wrote: > Tomas Vondra writes: > > Note: To be precise this is not about "executions" but about snapshots, > > and we could probably simplify the function call with isolation levels > > that maintain a single snapshot (e.g. REPEATABLE READ). But we don't.

Re: meson: Non-feature feature options

2023-02-08 Thread Andres Freund
Hi, On 2023-02-08 11:45:05 +0100, Peter Eisentraut wrote: > Most meson options (meson_options.txt) that enable an external dependency > (e.g., icu, ldap) are of type 'feature'. Most of these have a default value > of 'auto', which means they are pulled in automatically if found. Some have > a de

Re: recovery modules

2023-02-08 Thread Andres Freund
Hi, On 2023-02-08 16:23:34 +0900, Michael Paquier wrote: > On Sat, Feb 04, 2023 at 10:14:36AM -0800, Nathan Bossart wrote: > > On Sat, Feb 04, 2023 at 11:59:20AM +0900, Michael Paquier wrote: > >> + ArchiveModuleCallbacks struct filled with the callback function > >> pointers for > >> This need

Re: Named Operators

2023-02-08 Thread Tom Lane
I wrote: > This approach does have a couple of shortcomings: > * You still have to invent an operator name, even if you never > plan to use it in queries. This is just cosmetic though. > It's not going to matter if the operator name is long or looks like > line noise, if you only need to use it a

Re: when the startup process doesn't (logging startup delays)

2023-02-08 Thread Bharath Rupireddy
On Mon, Feb 6, 2023 at 9:39 PM Robert Haas wrote: > > On Mon, Feb 6, 2023 at 11:07 AM Tom Lane wrote: > > Umm ... is this really the sort of patch to be committing on a > > release wrap day? > > Oh, shoot, I wasn't thinking about that. Would you like me to revert > it in v15 for now? Thanks a lo

Re: run pgindent on a regular basis / scripted manner

2023-02-08 Thread Jelte Fennema
With the new patch --commit works as expected for me now. And sounds good to up the script a bit afterwards. On Wed, 8 Feb 2023 at 14:27, Andrew Dunstan wrote: > > > On 2023-02-08 We 07:41, Andrew Dunstan wrote: > > > On 2023-02-07 Tu 12:21, Jelte Fennema wrote: > > > Does the code-base flag stil

Re: recovery modules

2023-02-08 Thread Nathan Bossart
On Wed, Feb 08, 2023 at 08:27:13AM -0800, Andres Freund wrote: > One minor thing: I don't think we really need the AssertVariableIsOfType() for > anything but the Init() one? This is another part that was borrowed from logical decoding output plugins. I'm not sure this adds much since f2b73c8 ("A

Re: recovery modules

2023-02-08 Thread Andres Freund
Hi, On 2023-02-08 09:27:05 -0800, Nathan Bossart wrote: > On Wed, Feb 08, 2023 at 08:27:13AM -0800, Andres Freund wrote: > > One minor thing: I don't think we really need the AssertVariableIsOfType() > > for > > anything but the Init() one? > > This is another part that was borrowed from logical

Re: [PATCH] Make ON CONFLICT DO NOTHING and ON CONFLICT DO UPDATE consistent

2023-02-08 Thread Peter Geoghegan
On Wed, Feb 8, 2023 at 5:08 AM Aleksander Alekseev wrote: > > To me it's a pretty fundamental violation of how heap visibility works. > > I don't think this has much to do with heap visibility. It's true that > generally a command doesn't see its own tuples. This is done in order > to avoid the Ha

Re: when the startup process doesn't (logging startup delays)

2023-02-08 Thread Tom Lane
Bharath Rupireddy writes: > Thanks a lot Robert for taking care of this. The patch is committed on > HEAD and reverted on v15. Now that the minor version branches are > stamped, is it time for us to get this to v15? I can then close the CF > entry - https://commitfest.postgresql.org/42/4012/. No

Re: Weird failure with latches in curculio on v15

2023-02-08 Thread Nathan Bossart
On Wed, Feb 08, 2023 at 10:22:24AM -0500, Robert Haas wrote: > I felt like the archive modules work was a step forward when we did, > because basic_archive does some things that you're not likely to get > right if you do it on your own. And a similar approach to > restore_command might be also be v

Re: HOT chain validation in verify_heapam()

2023-02-08 Thread Robert Haas
On Sun, Feb 5, 2023 at 3:57 AM Himanshu Upadhyaya wrote: > Thanks, yes it's working fine with Prepared Transaction. > Please find attached the v9 patch incorporating all the review comments. I don't know quite how we're still going around in circles about this, but this code makes no sense to me

Re: recovery modules

2023-02-08 Thread Nathan Bossart
On Wed, Feb 08, 2023 at 09:33:44AM -0800, Andres Freund wrote: > And yes, I'd be for a patch to remove all of those assertions. done -- Nathan Bossart Amazon Web Services: https://aws.amazon.com >From 09fcca03d4a91be5757201cc311d3dad08463cd0 Mon Sep 17 00:00:00 2001 From: Nathan Bossart Date: F

Re: make_ctags: use -I option to ignore pg_node_attr macro

2023-02-08 Thread Fujii Masao
On 2023/02/08 20:17, Tatsuo Ishii wrote: Attached is the v2 patch. Thanks for the patch! With the patch, I got the following error when executing make_etags.. $ ./src/tools/make_etags etags: invalid option -- 'e' Try 'etags --help' for a complete list of options. sort: No such file

Re: Logical replication timeout problem

2023-02-08 Thread Andres Freund
Hi, On 2023-02-08 13:36:02 +0530, Amit Kapila wrote: > On Wed, Feb 8, 2023 at 10:57 AM Andres Freund wrote: > > > > On 2023-02-03 10:13:54 +0530, Amit Kapila wrote: > > > I am planning to push this to HEAD sometime next week (by Wednesday). > > > To backpatch this, we need to fix it in some non-s

Re: A bug with ExecCheckPermissions

2023-02-08 Thread Alvaro Herrera
On 2023-Feb-08, Amit Langote wrote: > On Wed, Feb 8, 2023 at 16:19 Alvaro Herrera wrote: > > I think we should also patch ExecCheckPermissions to use forboth(), > > scanning the RTEs as it goes over the perminfos, and make sure that the > > entries are consistent. > > Hmm, we can’t use forboth

Re: recovery modules

2023-02-08 Thread Andres Freund
Hi, On 2023-02-08 09:57:56 -0800, Nathan Bossart wrote: > On Wed, Feb 08, 2023 at 09:33:44AM -0800, Andres Freund wrote: > > And yes, I'd be for a patch to remove all of those assertions. > > done If you'd reorder it so that 0004 applies independently from the other changes, I'd just push that n

Re: Logical replication timeout problem

2023-02-08 Thread Andres Freund
Hi, On 2023-02-08 10:18:41 -0800, Andres Freund wrote: > I don't think the syncrep logic in WalSndUpdateProgress really works as-is - > consider what happens if e.g. the origin filter filters out entire > transactions. We'll afaics never get to WalSndUpdateProgress(). In some cases > we'll be luck

Re: Time delayed LR (WAS Re: logical replication restrictions)

2023-02-08 Thread Peter Smith
On Wed, Feb 8, 2023 at 8:03 PM Hayato Kuroda (Fujitsu) wrote: > ... > > == > > > > src/backend/replication/logical/worker.c > > > > 2. maybe_apply_delay > > > > + if (wal_receiver_status_interval > 0 && > > + diffms > wal_receiver_status_interval * 1000L) > > + { > > + WaitLatch(MyLatch, > > +

Re: recovery modules

2023-02-08 Thread Nathan Bossart
On Wed, Feb 08, 2023 at 10:24:18AM -0800, Andres Freund wrote: > If you'd reorder it so that 0004 applies independently from the other changes, > I'd just push that now. done -- Nathan Bossart Amazon Web Services: https://aws.amazon.com >From 688566e23519f173a805696e4f00345f30d5d8e6 Mon Sep 17 0

Re: Deadlock between logrep apply worker and tablesync worker

2023-02-08 Thread Peter Smith
On Fri, Feb 3, 2023 at 6:58 PM houzj.f...@fujitsu.com wrote: > > On Thursday, February 2, 2023 7:21 PM Amit Kapila > wrote: > > > > On Thu, Feb 2, 2023 at 12:05 PM houzj.f...@fujitsu.com > > wrote: > > > > > > On Tuesday, January 31, 2023 1:07 AM vignesh C > > wrote: > > > > On Mon, 30 Jan 202

Re: Logical replication timeout problem

2023-02-08 Thread Andres Freund
Hi, On 2023-02-08 10:30:37 -0800, Andres Freund wrote: > On 2023-02-08 10:18:41 -0800, Andres Freund wrote: > > I don't think the syncrep logic in WalSndUpdateProgress really works as-is - > > consider what happens if e.g. the origin filter filters out entire > > transactions. We'll afaics never g

Re: Move defaults toward ICU in 16?

2023-02-08 Thread Jeff Davis
On Thu, 2023-02-02 at 18:10 -0500, Tom Lane wrote: > Yeah.  I would be resistant to making ICU a required dependency, > but it doesn't seem unreasonable to start moving towards it being > our default collation support. Patch attached. To get the default locale, the patch initializes a UCollator w

Re: SLRUs in the main buffer pool - Page Header definitions

2023-02-08 Thread Andres Freund
Hi, On 2023-02-08 20:04:52 +, Bagga, Rishu wrote: > To summarize, our underlying effort is to move the SLRUs to the buffer > cache. We were working with Thomas Munro off a patch he introduced here > [1]. Munro’s patch moves SLRUs to the buffer cache by introducing the > pseudo db id 9 to denot

Re: [PATCH] Add pretty-printed XML output option

2023-02-08 Thread Jim Jones
while working on another item of the TODO list I realized that I should be using a PG_TRY() block in he xmlDocDumpFormatMemory call. Fixed in v5. Best regards, Jim From f503b25c7fd8d984d29536e78577741e5e7c5e9f Mon Sep 17 00:00:00 2001 From: Jim Jones Date: Thu, 2 Feb 2023 21:27:16 +0100 Subjec

Re: Can we do something to help stop users mistakenly using force_parallel_mode?

2023-02-08 Thread David Rowley
On Thu, 2 Feb 2023 at 01:24, John Naylor wrote: > > > On Wed, Feb 1, 2023 at 6:41 PM David Rowley wrote: > > > > I don't really share Laurenz's worry [2] about compatibility break > > from renaming this GUC. I think the legitimate usages of this setting > > are probably far more rare than the ill

Re: daitch_mokotoff module

2023-02-08 Thread Tomas Vondra
On 2/8/23 15:31, Dag Lem wrote: > Alvaro Herrera writes: > >> On 2023-Jan-17, Dag Lem wrote: >> >>> + * Daitch-Mokotoff Soundex >>> + * >>> + * Copyright (c) 2021 Finance Norway >>> + * Author: Dag Lem >> >> Hmm, I don't think we accept copyright lines that aren't "PostgreSQL >> Global Develo

Re: Weird failure with latches in curculio on v15

2023-02-08 Thread Robert Haas
On Wed, Feb 8, 2023 at 12:43 PM Nathan Bossart wrote: > I think this could be a good approach if we decide not to bake too much > into PostgreSQL itself (e.g., such as creating multiple archive workers > that each call out to the module). Archive module authors would > effectively need to write t

Re: Wrong rows estimations with joins of CTEs slows queries by more than factor 500

2023-02-08 Thread Tomas Vondra
On 2/8/23 14:55, Hans Buschmann wrote: > During data refactoring of our Application I encountered $subject when > joining 4 CTEs with left join or inner join. > > > 1. Background > > PG 15.1 on Windows x64 (OS seems no to have no meening here) > > > I try to collect data from 4 (analyzed) tabl

Re: OpenSSL 3.0.0 vs old branches

2023-02-08 Thread Andrew Dunstan
On 2023-02-08 We 10:42, Peter Eisentraut wrote: On 07.02.23 19:28, Tom Lane wrote: I think Peter's misremembering the history, and OpenSSL 3*is* supported in these branches.  There could be an argument for not back-patching f0d2c65f17 on the grounds that pre-1.1.1 is also supported there.  On t

Re: tests against running server occasionally fail, postgres_fdw & tenk1

2023-02-08 Thread Peter Geoghegan
On Tue, Feb 7, 2023 at 6:47 PM Andres Freund wrote: > One thing I'm not quite sure what to do about is that we atm use a hardcoded > DEBUG2 (not controlled by VERBOSE) in a bunch of places: > > ereport(DEBUG2, > (errmsg("table \"%s\": removed %lld dead item > ident

Re: WAL Insertion Lock Improvements

2023-02-08 Thread Nathan Bossart
+ pg_atomic_exchange_u64(valptr, val); nitpick: I'd add a (void) at the beginning of these calls to pg_atomic_exchange_u64() so that it's clear that we are discarding the return value. + /* +* Update the lock variable atomically first without having to acquire wait +*

Re: First draft of back-branch release notes is done

2023-02-08 Thread Justin Pryzby
On Fri, Feb 03, 2023 at 02:32:39PM -0500, Tom Lane wrote: > ... at > > https://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=f282b026787da69d88a35404cf62f1cc21cfbb7c > > As usual, please send corrections/comments by Sunday. It's of no concern, but I was curious why this one wasn't i

Re: run pgindent on a regular basis / scripted manner

2023-02-08 Thread Andrew Dunstan
On 2023-02-08 We 12:06, Jelte Fennema wrote: With the new patch --commit works as expected for me now. And sounds good to up the script a bit afterwards. Thanks, I have committed this. Still looking at Robert's other request. cheers andrew -- Andrew Dunstan EDB:https://www.enterprisedb.

Re: deadlock-hard flakiness

2023-02-08 Thread Andres Freund
Hi, On 2023-02-07 17:10:21 -0800, Andres Freund wrote: > diff -U3 /tmp/cirrus-ci-build/src/test/isolation/expected/deadlock-hard.out > /tmp/cirrus-ci-build/build/testrun/isolation-running/isolation/results/deadlock-hard.out > --- /tmp/cirrus-ci-build/src/test/isolation/expected/deadlock-hard.out

Re: deadlock-hard flakiness

2023-02-08 Thread Andres Freund
Hi, On 2023-02-08 14:11:45 -0800, Andres Freund wrote: > On 2023-02-07 17:10:21 -0800, Andres Freund wrote: > I don't really understand how GetSafeSnapshotBlockingPids() can end up finding > deadlock-hard's sessions being blocked by a safe snapshot. Afaict nothing uses > serializable in that test.

Re: Support logical replication of DDLs

2023-02-08 Thread Peter Smith
Hi Vignesh, thanks for addressing my v63-0002 review comments. I confirmed most of the changes. Below is a quick follow-up for the remaining ones. On Mon, Feb 6, 2023 at 10:32 PM vignesh C wrote: > > On Mon, 6 Feb 2023 at 06:47, Peter Smith wrote: > > ... > > > > 8. > > + value = findJsonbValue

Re: MacOS: xsltproc fails with "warning: failed to load external entity"

2023-02-08 Thread Tom Lane
I pushed the discussed documentation improvements, and changed the behavior of "ninja docs" to only build the HTML docs. However, I've not done anything about documenting what is the minimum ninja version. regards, tom lane

Re: First draft of back-branch release notes is done

2023-02-08 Thread Tom Lane
Justin Pryzby writes: > It's of no concern, but I was curious why this one wasn't included: > commit 72aea955d49712a17c08748aa9abcbcf98c32fc5 > Author: Thomas Munro > Date: Fri Jan 6 16:38:46 2023 +1300 > Fix pg_truncate() on Windows. > Commit 57faaf376 added pg_truncate(const ch

Re: Weird failure with latches in curculio on v15

2023-02-08 Thread Nathan Bossart
On Wed, Feb 08, 2023 at 04:24:15PM -0500, Robert Haas wrote: > On Wed, Feb 8, 2023 at 12:43 PM Nathan Bossart > wrote: >> I think this could be a good approach if we decide not to bake too much >> into PostgreSQL itself (e.g., such as creating multiple archive workers >> that each call out to the

Re: Can we do something to help stop users mistakenly using force_parallel_mode?

2023-02-08 Thread Tom Lane
David Rowley writes: > I've attached a patch which does the renaming to debug_parallel_query. > I've made it so the old name can still be used. There's a better way to do that last, which is to add the translation to map_old_guc_names[]. I am not very sure what happens if you have multiple GUC e

Re: Progress report of CREATE INDEX for nested partitioned tables

2023-02-08 Thread Justin Pryzby
On Thu, Feb 02, 2023 at 09:18:07AM -0600, Justin Pryzby wrote: > On Wed, Feb 01, 2023 at 07:24:48PM +0100, Matthias van de Meent wrote: > > On Wed, 1 Feb 2023 at 18:51, Ilya Gladyshev > > wrote: > > > 1 февр. 2023 г., в 20:27, Matthias van de Meent > > > написал(а): > > > > > >> In HEAD we set

Re: Can we do something to help stop users mistakenly using force_parallel_mode?

2023-02-08 Thread David Rowley
On Thu, 9 Feb 2023 at 11:26, Tom Lane wrote: > > David Rowley writes: > > I've attached a patch which does the renaming to debug_parallel_query. > > I've made it so the old name can still be used. > > There's a better way to do that last, which is to add the translation to > map_old_guc_names[].

Re: Improve logging when using Huge Pages

2023-02-08 Thread Nathan Bossart
On Thu, Feb 02, 2023 at 04:53:37PM +0100, Alvaro Herrera wrote: > Maybe I misread the code (actually I only read the patch), but -- does > it set active=true when huge_pages=on? I think the code only works when > huge_pages=try. That might be pretty confusing; I think it should say > "on" in both

Re: [PATCH] Add pretty-printed XML output option

2023-02-08 Thread Peter Smith
On Thu, Feb 9, 2023 at 7:31 AM Jim Jones wrote: > > while working on another item of the TODO list I realized that I should > be using a PG_TRY() block in he xmlDocDumpFormatMemory call. > > Fixed in v5. > I noticed the xmlFreeDoc(doc) within the PG_CATCH is guarded but the other xmlFreeDoc(doc)

Re: RFC: WAL infrastructure issues, updates and improvements

2023-02-08 Thread Matthias van de Meent
Hi, Various users and threads on -hackers (incl. [0] specifically) have complained about the overhead of our WAL format. One example of this is that we write at least 44 bytes to register any changes to a single relation's page: There is a 24-byte WAL record header, a 4-byte block record header, p

Re: Improve logging when using Huge Pages

2023-02-08 Thread Justin Pryzby
On Thu, Feb 02, 2023 at 04:53:37PM +0100, Alvaro Herrera wrote: > On 2023-Jan-24, Justin Pryzby wrote: > > On Mon, Jan 23, 2023 at 05:33:35PM -0800, Andres Freund wrote: > > > I'm ok with this being a GUC, it doesn't feel elegant, but I suspect > > > there's > > > no realistic elegant answer. > >

Re: [PATCH] Add pretty-printed XML output option

2023-02-08 Thread Jim Jones
On 09.02.23 00:09, Peter Smith wrote: I noticed the xmlFreeDoc(doc) within the PG_CATCH is guarded but the other xmlFreeDoc(doc) is not. As the doc is assigned outside the PG_TRY shouldn't those both be the same? Hi Peter, My logic there was the following: if program reached that part of the

Re: Weird failure with latches in curculio on v15

2023-02-08 Thread Michael Paquier
On Wed, Feb 08, 2023 at 02:25:54PM -0800, Nathan Bossart wrote: > These are all good points. Perhaps there could be a base archiver > implementation that shell_archive uses (and that other modules could use if > desired, which might be important for backward compatibility with the > existing callb

  1   2   >