Re: Handle infinite recursion in logical replication setup

2022-04-19 Thread Peter Smith
Below are my review comments for the v9-0002 patch (TAP test part only). (The order of my comments is a bit muddled because I jumped around in the file a bit while reviewing it). == 1. create_subscription - missing comment. +sub create_subscription +{ + my ($node_subscriber,

Re: Intermittent buildfarm failures on wrasse

2022-04-19 Thread Masahiko Sawada
On Wed, Apr 20, 2022 at 3:29 AM Tom Lane wrote: > > Alvaro Herrera writes: > > On 2022-Apr-15, Tom Lane wrote: > >> Here's a WIP patch for that. The only exciting thing in it is that > >> because of some undocumented cowboy programming in walsender.c, the > >> Assert((proc->statusFlags &

Re: TRAP: FailedAssertion("tabstat->trans == trans", File: "pgstat_relation.c", Line: 508

2022-04-19 Thread Kyotaro Horiguchi
At Tue, 19 Apr 2022 10:55:26 -0700, Andres Freund wrote in > Hi, > > On 2022-04-19 10:36:24 -0700, Andres Freund wrote: > > On 2022-04-19 13:50:25 +0200, Erik Rijkers wrote: > > > The 12th run of statbug.sh crashed and gave a corefile. > > > > I ran through quite a few iterations by now,

Re: typos

2022-04-19 Thread Amit Kapila
On Tue, Apr 19, 2022 at 4:35 PM Alvaro Herrera wrote: > > Yeah, more invasive rewording seems called for. I propose this: > >For publications containing partitioned tables, the row filter for each >partition is taken from the published partitioned table if the >publication parameter

effective_io_concurrency and NVMe devices

2022-04-19 Thread Bruce Momjian
NVMe devices have a maximum queue length of 64k: https://blog.westerndigital.com/nvme-queues-explained/ but our effective_io_concurrency maximum is 1,000: test=> set effective_io_concurrency = 1001; ERROR: 1001 is outside the valid range for parameter

RE: Logical replication timeout problem

2022-04-19 Thread wangw.f...@fujitsu.com
On Mon, Apr 18, 2022 at 00:36 PM Amit Kapila wrote: > On Mon, Apr 18, 2022 at 9:29 AM Amit Kapila wrote: > > > > On Thu, Apr 14, 2022 at 5:52 PM Euler Taveira wrote: > > > > > > On Wed, Apr 13, 2022, at 7:45 AM, Amit Kapila wrote: > > > > > > Sawada-San, Euler, do you have any opinion on this

Re: Postgres restart in the middle of exclusive backup and the presence of backup_label file

2022-04-19 Thread Michael Paquier
On Tue, Apr 19, 2022 at 10:12:32PM -0300, Martín Marqués wrote: > The typo is in `exist in in a running cluster`. There's two `in` in a row. Thanks, fixed. -- Michael signature.asc Description: PGP signature

Re: Dump/Restore of non-default PKs

2022-04-19 Thread David G. Johnston
On Tue, Apr 19, 2022 at 9:14 AM Simon Riggs wrote: > On Mon, 18 Apr 2022 at 22:05, Simon Riggs > wrote: > > > > On Mon, 18 Apr 2022 at 21:48, Tom Lane wrote: > > > > > > "David G. Johnston" writes: > > > > On Mon, Apr 18, 2022 at 1:00 PM Simon Riggs < > simon.ri...@enterprisedb.com> > > > >

Re: Handle infinite recursion in logical replication setup

2022-04-19 Thread Peter Smith
Below are my review comments for the v9-0002 patch (except I did not yet look at the TAP tests). ~~~ 1. General comment - describe.c I wondered why the copy_data enum value is not displayed by the psql \drs+ command. Should it be? ~~~ 2. General comment - SUBOPT_LOCAL_ONLY @@ -1134,7 +1204,7

Re: using an end-of-recovery record in all cases

2022-04-19 Thread Kyotaro Horiguchi
At Tue, 19 Apr 2022 13:37:59 -0700, Nathan Bossart wrote in > On Mon, Apr 18, 2022 at 04:44:03PM -0400, Robert Haas wrote: > > Here is a new version of the patch which, unlike v1, I think is > > something we could seriously consider applying (not before v16, of > > course). It now removes

Re: minor MERGE cleanups

2022-04-19 Thread Michael Paquier
On Tue, Apr 19, 2022 at 03:45:22PM +0200, Alvaro Herrera wrote: > I expect these fixups in new code should be uncontroversial. The whole set looks rather sane to me. -- Michael signature.asc Description: PGP signature

Re: Postgres restart in the middle of exclusive backup and the presence of backup_label file

2022-04-19 Thread Martín Marqués
Hi, I was looking at the commit for this patch and noticed this small typo in the comment in `basebackup.c`: ``` diff --git a/src/backend/replication/basebackup.c b/src/backend/replication/basebackup.c index 6884cad2c00af1632eacec07903098e7e1874393..815681ada7dd0c135af584ad5da2dd13c9a12465

Re: Odd off-by-one dirty buffers and checkpoint buffers written

2022-04-19 Thread David G. Johnston
On Tue, Apr 19, 2022 at 4:36 PM Nathan Bossart wrote: > On Tue, Apr 19, 2022 at 04:21:21PM -0700, David G. Johnston wrote: > > I've done this four times in a row and while the number of dirty buffers > > shown each time vary (see below) I see that "wrote N buffers" is always > > exactly one more

Re: Replace open mode with PG_BINARY_R/W/A macros

2022-04-19 Thread Japin Li
On Tue, 19 Apr 2022 at 22:21, Tom Lane wrote: > Japin Li writes: >> On Tue, 19 Apr 2022 at 14:20, Tom Lane wrote: >>> I think the comment's at best misleading. See e.g. 66f8687a8. >>> It might be okay to use "rb" to read a text file when there >>> is actually \r-stripping logic present, but

Re: Postgres perl module namespace

2022-04-19 Thread Michael Paquier
On Tue, Apr 19, 2022 at 07:24:58PM -0400, Andrew Dunstan wrote: > On 2022-04-19 Tu 18:39, Michael Paquier wrote: >> +*generate_ascii_string = *TestLib::generate_ascii_string; >> +*slurp_dir = *TestLib::slurp_dir; >> +*slurp_file = *TestLib::slurp_file; >> >> I am not sure if it is possible and my

Re: [PATCH] Add native windows on arm64 support

2022-04-19 Thread Michael Paquier
On Tue, Apr 19, 2022 at 03:22:30PM +0100, Niyas Sait wrote: > Sorry for the delay! Configuring the scripts took some time. I have > successfully run the builfarm animal script using my git repository [1] > which contains the proposed patch on a Windows Arm64 machine. > > I made a request to add a

Re: DBT-5 Stored Procedure Development (2022)

2022-04-19 Thread Peter Geoghegan
On Tue, Apr 19, 2022 at 11:31 AM Mark Wong wrote: > As some of tasks proposed are actually in place, one other task could be > updating egen (the TPC supplied code.) The kit was last developed again > 1.12 and 1.14 is current as this email. As you know, I have had some false starts with using

Re: Odd off-by-one dirty buffers and checkpoint buffers written

2022-04-19 Thread Nathan Bossart
On Tue, Apr 19, 2022 at 04:21:21PM -0700, David G. Johnston wrote: > I've done this four times in a row and while the number of dirty buffers > shown each time vary (see below) I see that "wrote N buffers" is always > exactly one more than the total count of dirty buffers. I'm just curious > if

Re: Postgres perl module namespace

2022-04-19 Thread Andrew Dunstan
On 2022-04-19 Tu 18:39, Michael Paquier wrote: > On Tue, Apr 19, 2022 at 04:06:28PM -0400, Andrew Dunstan wrote: >> Here's a version with a fixed third patch that corrects a file misnaming >> and fixes the export issue referred to above. Passes my testing so far. > Wow. That's really cool. You

Odd off-by-one dirty buffers and checkpoint buffers written

2022-04-19 Thread David G. Johnston
view bc is just a joining wrapper around pg_buffercache. regression=# select datname, relname, count(*), sum(count(*)) over () AS total from bc where isdirty group by datname, relname; datname | relname | count | total -+-+---+--- (0 rows) regression=# update tenk1 set

Re: Postgres perl module namespace

2022-04-19 Thread Michael Paquier
On Tue, Apr 19, 2022 at 04:06:28PM -0400, Andrew Dunstan wrote: > Here's a version with a fixed third patch that corrects a file misnaming > and fixes the export issue referred to above. Passes my testing so far. Wow. That's really cool. You are combining the best of both worlds here to ease

Re: Estimating HugePages Requirements?

2022-04-19 Thread Michael Paquier
On Thu, Mar 24, 2022 at 02:07:26PM +0100, Magnus Hagander wrote: > But neither would the suggestion of redirecting stderr to /dev/null. > In fact, doing the redirect it will *also* throw away any FATAL that > happens. In fact, using the 2>/dev/null method, we *also* remove the > message that says

Re: Bad estimate with partial index

2022-04-19 Thread Tom Lane
I wrote: > it looks like the problem is that the extended stats haven't been used > while forming the estimate of the number of index entries retrieved, so > we overestimate the cost of using this index. > That seems like a bug. Tomas? I dug into this enough to locate the source of the problem.

Re: using an end-of-recovery record in all cases

2022-04-19 Thread Nathan Bossart
On Mon, Apr 18, 2022 at 04:44:03PM -0400, Robert Haas wrote: > Here is a new version of the patch which, unlike v1, I think is > something we could seriously consider applying (not before v16, of > course). It now removes CHECKPOINT_END_OF_RECOVERY completely, and I > attach a second patch as well

Re: Postgres perl module namespace

2022-04-19 Thread Andrew Dunstan
On 2022-04-19 Tu 11:36, Andrew Dunstan wrote: > On 2022-04-18 Mo 14:07, Tom Lane wrote: >> Andrew Dunstan writes: >>> No, I think we could probably just port the whole of src/test/PostreSQL >>> back if required, and have it live alongside the old modules. Each TAP >>> test is a separate miracle

Re: postgres_fdw: commit remote (sub)transactions in parallel during pre-commit

2022-04-19 Thread David Zhang
I tried to apply the patch to master and plan to run some tests, but got below errors due to other commits. $ git apply --check v7-0003-postgres-fdw-Add-support-for-parallel-abort.patch error: patch failed: doc/src/sgml/postgres-fdw.sgml:479 error: doc/src/sgml/postgres-fdw.sgml: patch does

Re: error handling in pqRowProcessor broken

2022-04-19 Thread Tom Lane
Peter Eisentraut writes: > I find that this doesn't work anymore. If you set *errmsgp = "some > message" and return 0, then psql will just print a result set with zero > rows. Ah, I see the problem: a few places in fe-protocol3 didn't get the memo that conn->error_result represents a "pending"

Re: Readd use of TAP subtests

2022-04-19 Thread Daniel Gustafsson
> On 19 Apr 2022, at 21:07, Jacob Champion wrote: > > On Mon, 2022-02-28 at 17:02 +0100, Peter Eisentraut wrote: >> Perhaps in another 7 years or so this will be resolved and we can make >> another attempt at this. ;-) > > For what it's worth, the TAP 14 spec was officially released today:

Re: Extract epoch from Interval weird behavior

2022-04-19 Thread Peter Eisentraut
On 08.04.22 15:10, Tom Lane wrote: Peter Eisentraut writes: We really wanted to avoid doing calculations in numeric as much as possible. So we should figure out a different way to write this. The attached patch works for me. It's a bit ugly since it hardcodes some factors. Maybe we can

Re: Readd use of TAP subtests

2022-04-19 Thread Jacob Champion
On Mon, 2022-02-28 at 17:02 +0100, Peter Eisentraut wrote: > Perhaps in another 7 years or so this will be resolved and we can make > another attempt at this. ;-) For what it's worth, the TAP 14 spec was officially released today: https://testanything.org/tap-version-14-specification.html

Re: pg14 psql broke \d datname.nspname.relname

2022-04-19 Thread Vik Fearing
On 4/19/22 16:00, Robert Haas wrote: On Mon, Apr 18, 2022 at 3:39 PM Mark Dilger wrote: Since there hasn't been any agreement on that point, I've just rebased the patch to apply cleanly against the current master: This looks OK to me. There may be better ways to do some of it, but there's

Re: DBT-5 Stored Procedure Development (2022)

2022-04-19 Thread Mark Wong
Hi Mahesh, On Tue, Apr 19, 2022 at 02:01:54PM -0400, Mahesh Gouru wrote: > Dear all, > > Please review the attached for my jerry-rigged project proposal. I am > seeking to continually refactor the proposal as I can! My comments might briefer that they should be, but I need to write this

Re: Intermittent buildfarm failures on wrasse

2022-04-19 Thread Tom Lane
Alvaro Herrera writes: > On 2022-Apr-15, Tom Lane wrote: >> Here's a WIP patch for that. The only exciting thing in it is that >> because of some undocumented cowboy programming in walsender.c, the >> Assert((proc->statusFlags & (~PROC_COPYABLE_FLAGS)) == 0); >> in ProcArrayInstallRestoredXmin

Re: Intermittent buildfarm failures on wrasse

2022-04-19 Thread Alvaro Herrera
On 2022-Apr-15, Tom Lane wrote: > Here's a WIP patch for that. The only exciting thing in it is that > because of some undocumented cowboy programming in walsender.c, the > Assert((proc->statusFlags & (~PROC_COPYABLE_FLAGS)) == 0); > in ProcArrayInstallRestoredXmin fires unless we skip

Re: DBT-5 Stored Procedure Development (2022)

2022-04-19 Thread Peter Geoghegan
On Tue, Apr 19, 2022 at 11:02 AM Mahesh Gouru wrote: > Please review the attached for my jerry-rigged project proposal. I am seeking > to continually refactor the proposal as I can! I for one see a lot of value in this proposal. I think it would be great to revive DBT-5, since TPC-E has a

Re: TRAP: FailedAssertion("tabstat->trans == trans", File: "pgstat_relation.c", Line: 508

2022-04-19 Thread Erik Rijkers
Op 19-04-2022 om 19:36 schreef Andres Freund: Hi, On 2022-04-19 13:50:25 +0200, Erik Rijkers wrote: The 12th run of statbug.sh crashed and gave a corefile. I ran through quite a few iterations by now, without reproducing :( I guess there's some timing issue and you're hitting on your system

DBT-5 Stored Procedure Development (2022)

2022-04-19 Thread Mahesh Gouru
Dear all, Please review the attached for my jerry-rigged project proposal. I am seeking to continually refactor the proposal as I can! Thanks, Mahesh GSoC (2022) - Proposal for PostgreSQL-Gouru.pdf Description: Adobe PDF document

Re: Bad estimate with partial index

2022-04-19 Thread Tom Lane
=?iso-8859-1?Q?Andr=E9_H=E4nsel?= writes: > I have a case where Postgres chooses the wrong index and I'm not sure what > to do about it: The core problem here seems to be a poor estimate for the selectivity of "WHERE cropped AND NOT resized": regression=# EXPLAIN ANALYZE SELECT count(*) FROM t

Re: TRAP: FailedAssertion("tabstat->trans == trans", File: "pgstat_relation.c", Line: 508

2022-04-19 Thread Andres Freund
Hi, On 2022-04-19 10:36:24 -0700, Andres Freund wrote: > On 2022-04-19 13:50:25 +0200, Erik Rijkers wrote: > > The 12th run of statbug.sh crashed and gave a corefile. > > I ran through quite a few iterations by now, without reproducing :( > > I guess there's some timing issue and you're hitting

Re: TRAP: FailedAssertion("tabstat->trans == trans", File: "pgstat_relation.c", Line: 508

2022-04-19 Thread Andres Freund
Hi, On 2022-04-19 13:50:25 +0200, Erik Rijkers wrote: > The 12th run of statbug.sh crashed and gave a corefile. I ran through quite a few iterations by now, without reproducing :( I guess there's some timing issue and you're hitting on your system due to the slower disks. > Program terminated

Re: Postgres perl module namespace

2022-04-19 Thread Andres Freund
Hi, On 2022-04-19 11:36:44 -0400, Andrew Dunstan wrote: > The attached three patches basically implement the new naming scheme for > the back branches without doing away with the old scheme or doing a > wholesale copy of the new modules. That sounds like good plan! I don't know perl enough to

Re: Defer selection of asynchronous subplans until the executor initialization stage

2022-04-19 Thread Zhihong Yu
On Tue, Apr 19, 2022 at 2:01 AM Etsuro Fujita wrote: > Hi, > > On Sun, Apr 17, 2022 at 7:30 PM Zhihong Yu wrote: > > On Sun, Apr 17, 2022 at 1:48 AM Etsuro Fujita > wrote: > >> I think we might support more cases in the switch statement in the > >> future. My concern about your proposal is

Re: GSoC: Database Load Stress Benchmark (2022)

2022-04-19 Thread Mark Wong
Hi! On Mon, Apr 18, 2022 at 03:40:23PM +0200, Mohammad Zain Abbas wrote: > Dear concerned, > > I hope you are doing well. > > I am Mohammad Zain Abbas, currently enrolled in Erasmus Mundus (BDMA) > program. I would like you to have a look at my proposal for the "*Database > Load Stress

Re: Dump/Restore of non-default PKs

2022-04-19 Thread Simon Riggs
On Mon, 18 Apr 2022 at 22:05, Simon Riggs wrote: > > On Mon, 18 Apr 2022 at 21:48, Tom Lane wrote: > > > > "David G. Johnston" writes: > > > On Mon, Apr 18, 2022 at 1:00 PM Simon Riggs > > > wrote: > > >> I propose that we change pg_dump so that when it creates a PK it does > > >> so in 2

Re: Add --{no-,}bypassrls flags to createuser

2022-04-19 Thread Robert Haas
On Mon, Apr 18, 2022 at 9:50 PM Kyotaro Horiguchi wrote: > Hmm.. So, "-r/--role" and "-m/--member(ship)" is the (least worse) way > to go? Or we can give up adding -m for the reason of being hard to > name it.. Hmm, yeah, I hadn't quite realized what the problem was when I wrote that. I

Re: TRAP: FailedAssertion("HaveRegisteredOrActiveSnapshot()", File: "toast_internals.c", Line: 670, PID: 19403)

2022-04-19 Thread Robert Haas
On Tue, Apr 19, 2022 at 10:36 AM Tom Lane wrote: > I'm not here to claim that there are precisely zero remaining bugs > of this ilk. I'm just saying that I think we've flushed out most > of them. I think there is some value in trying to think of a way > to prove that none remain, but it's not a

Re: make MaxBackends available in _PG_init

2022-04-19 Thread Nathan Bossart
On Tue, Apr 19, 2022 at 05:49:13PM +0800, Julien Rouhaud wrote: > On Mon, Apr 18, 2022 at 08:17:04PM -0400, Tom Lane wrote: >> Nathan Bossart writes: >> > I'm looking for a clean way to ERROR if someone attempts to call >> > RequestAddinShmemSpace() or RequestNamedLWLockTranche() outside of the

Re: Postgres perl module namespace

2022-04-19 Thread Andrew Dunstan
On 2022-04-18 Mo 14:07, Tom Lane wrote: > Andrew Dunstan writes: >> No, I think we could probably just port the whole of src/test/PostreSQL >> back if required, and have it live alongside the old modules. Each TAP >> test is a separate miracle - see comments elsewhere about port >> assignment in

Re: pg14 psql broke \d datname.nspname.relname

2022-04-19 Thread Tom Lane
Justin Pryzby writes: > On Tue, Apr 19, 2022 at 10:00:01AM -0400, Robert Haas wrote: >> (A) This is a new feature. Wait for v16. >> (B) This is a bug fix. Commit it now and back-patch to v14. >> (C) This is a cleanup that is OK to put into v15 even after feature >> freeze but since it is a

Re: error handling in pqRowProcessor broken

2022-04-19 Thread Tom Lane
Peter Eisentraut writes: > The error handling for pqRowProcessor is described as > *Add the received row to the current async result (conn->result). > *Returns 1 if OK, 0 if error occurred. > * > * On error, *errmsgp can be set to an error string to be returned. > * If it is

Re: automatically generating node support functions

2022-04-19 Thread Peter Eisentraut
On 19.04.22 16:39, Tom Lane wrote: Maybe we should fix JsonPathSpec to be less creative while we still can? It's not real clear to me why that typedef even exists, rather than using a String node, or just a plain char * field. Yeah, let's get rid of it and use char *. I see in JsonCommon a

Re: automatically generating node support functions

2022-04-19 Thread Tom Lane
Alvaro Herrera writes: > I rebased this mostly out of curiousity. I fixed some smallish > conflicts and fixed a typedef problem new in JSON support; however, even > with these fixes it doesn't compile, because JsonPathSpec uses a novel > typedef pattern that apparently will need bespoke handling

Re: TRAP: FailedAssertion("HaveRegisteredOrActiveSnapshot()", File: "toast_internals.c", Line: 670, PID: 19403)

2022-04-19 Thread Tom Lane
Robert Haas writes: > On Mon, Apr 18, 2022 at 4:07 PM Tom Lane wrote: >> There may be some corner cases that aren't described by any of these >> three blanket scenarios, but they've got to be pretty few and far >> between. > My first thought whenever anything like this comes up is cursors, >

error handling in pqRowProcessor broken

2022-04-19 Thread Peter Eisentraut
The error handling for pqRowProcessor is described as *Add the received row to the current async result (conn->result). *Returns 1 if OK, 0 if error occurred. * * On error, *errmsgp can be set to an error string to be returned. * If it is left NULL, the error is presumed to be "out

Re: Add version and data directory to initdb output

2022-04-19 Thread Daniel Gustafsson
> On 19 Apr 2022, at 15:56, David G. Johnston > wrote: > The motivating situation had me placing it as close to the last line as > possible so my 8 line or so tmux panel would show it to me without scrolling. > The version is all I cared about, but when writing the patch the path seemed >

Re: pg14 psql broke \d datname.nspname.relname

2022-04-19 Thread Justin Pryzby
On Tue, Apr 19, 2022 at 10:00:01AM -0400, Robert Haas wrote: > (A) This is a new feature. Wait for v16. > (B) This is a bug fix. Commit it now and back-patch to v14. > (C) This is a cleanup that is OK to put into v15 even after feature > freeze but since it is a behavior change we shouldn't

Re: [PATCH] Add native windows on arm64 support

2022-04-19 Thread Niyas Sait
> Niyas, any updates on that? Sorry for the delay! Configuring the scripts took some time. I have successfully run the builfarm animal script using my git repository [1] which contains the proposed patch on a Windows Arm64 machine. I made a request to add a new machine to build farm through

Re: Replace open mode with PG_BINARY_R/W/A macros

2022-04-19 Thread Tom Lane
Japin Li writes: > On Tue, 19 Apr 2022 at 14:20, Tom Lane wrote: >> I think the comment's at best misleading. See e.g. 66f8687a8. >> It might be okay to use "rb" to read a text file when there >> is actually \r-stripping logic present, but you need to check >> that. Using "wb" to write a text

Re: pg14 psql broke \d datname.nspname.relname

2022-04-19 Thread David G. Johnston
On Tue, Apr 19, 2022 at 7:00 AM Robert Haas wrote: > On Mon, Apr 18, 2022 at 3:39 PM Mark Dilger > wrote: > > Since there hasn't been any agreement on that point, I've just rebased > the patch to apply cleanly against the current master: > > This looks OK to me. There may be better ways to do

Re: GSoC Proposal Submission.

2022-04-19 Thread Stephen Frost
Greetings, An actual message would be better when sending to this list in the future. Thanks for your GSoC proposal. Stephen signature.asc Description: PGP signature

Re: Proposal for New and improved website for pgjdbc (JDBC) for GSOC 2022

2022-04-19 Thread Stephen Frost
Greetings, * Vedant Gokhale (gokhalevedan...@gmail.com) wrote: > I was reading the contributor guidelines and it mentioned sending the > proposal to this email address. The guidelines also mentioned that you must > be subscribed to the mailing list. Please let me know if something more has > to

Re: pg14 psql broke \d datname.nspname.relname

2022-04-19 Thread Robert Haas
On Mon, Apr 18, 2022 at 3:39 PM Mark Dilger wrote: > Since there hasn't been any agreement on that point, I've just rebased the > patch to apply cleanly against the current master: This looks OK to me. There may be better ways to do some of it, but there's no rule against further improving the

Re: A qsort template

2022-04-19 Thread John Naylor
> Okay, this makes logical sense and is a smaller patch to boot. I've > re-run my tests (attached) to make sure we have our bases covered. I'm > sharing the min-of-five, as before, but locally I tried . The My sentence there was supposed to read "I tried using median and it was a bit less noisy".

Re: Add version and data directory to initdb output

2022-04-19 Thread David G. Johnston
On Tue, Apr 19, 2022 at 2:28 AM Daniel Gustafsson wrote: > > On 16 Apr 2022, at 01:50, David G. Johnston > wrote: > > > initdb is already pretty chatty, and the version of the cluster being > installed seems useful to include as well. > > That seems quite reasonable. > > > The data directory is

Re: A qsort template

2022-04-19 Thread John Naylor
On Tue, Apr 19, 2022 at 12:30 PM David Rowley wrote: > > Thanks for looking at this. > > On Tue, 19 Apr 2022 at 02:11, John Naylor > wrote: > > IIUC, this function is called by tuplesort_begin_common, which in turn > > is called by tuplesort_begin_{heap, indexes, etc}. The latter callers > >

minor MERGE cleanups

2022-04-19 Thread Alvaro Herrera
There's a complain from Coverity about outer_plan being referenced while possibly NULL, which can be silenced by using an existing local variable. 0001 does that. 0002 and 0003 are unrelated: in the former, we avoid creating a separate local variable planSlot when we can just refer to the

Re: Fwd: Declarative partitioning and partition pruning/check (+postgis)

2022-04-19 Thread Justin Pryzby
On Tue, Apr 19, 2022 at 02:39:12PM +0200, Mats Taraldsvik wrote: > I'm re-trying this email here, as there were no answers in the psql-general > list. Hope that's ok. (please cc me when answering as I'm not subscribed > (yet) ) -hackers is for development and bug reports, so this isn't the right

Re: automatically generating node support functions

2022-04-19 Thread Alvaro Herrera
I rebased this mostly out of curiousity. I fixed some smallish conflicts and fixed a typedef problem new in JSON support; however, even with these fixes it doesn't compile, because JsonPathSpec uses a novel typedef pattern that apparently will need bespoke handling in the gen_nodes_support.pl

Re: TRAP: FailedAssertion("tabstat->trans == trans", File: "pgstat_relation.c", Line: 508

2022-04-19 Thread Alvaro Herrera
On 2022-Apr-19, Erik Rijkers wrote: > (gdb) p tabstat > $1 = (PgStat_TableStatus *) 0x319e630 > (gdb) p *tabstat > $2 = {t_id = 2139062143, t_shared = 127, trans = 0x7f7f7f7f7f7f7f7f, > t_counts = {t_numscans = 9187201950435737471, t_tuples_returned = > 9187201950435737471, t_tuples_fetched =

Fwd: Declarative partitioning and partition pruning/check

2022-04-19 Thread Mats Taraldsvik
I'm re-trying this email here, as there were no answers in the psql-general list. Hope that's ok. (please cc me when answering as I'm not subscribed (yet) ) Hi, I have tried to read about Oracle's spatial partitioning feature (

Re: Patch a potential memory leak in describeOneTableDetails()

2022-04-19 Thread Daniel Gustafsson
> On 24 Feb 2022, at 14:55, Daniel Gustafsson wrote: >> On 24 Feb 2022, at 07:32, Kyotaro Horiguchi wrote: >> So the attached does that. > > I think this is reasonable, since it's pretty clear that more(1) supporting > "-x" is fairly rare. I'll await others commenting. The original patch

Re: using an end-of-recovery record in all cases

2022-04-19 Thread Robert Haas
On Mon, Apr 18, 2022 at 11:56 PM Amul Sul wrote: > I think RequestCheckpoint() should be called conditionally. What is the need > of the checkpoint if we haven't been through the recovery, in other words, > starting up from a clean shutdown? Good point. v5 attached. -- Robert Haas EDB:

Re: postgres_fdw: batch inserts vs. before row triggers

2022-04-19 Thread Tomas Vondra
On 4/19/22 11:16, Etsuro Fujita wrote: > On Sun, Apr 17, 2022 at 6:20 PM Etsuro Fujita wrote: >> Here >> is an example using HEAD: >> >> create extension postgres_fdw; >> create server loopback foreign data wrapper postgres_fdw options >> (dbname 'postgres'); >> create user mapping for

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

2022-04-19 Thread Fabien COELHO
It find it a little annoying that there is no change in tests, it means that the format is not checked at all:-( Yeah. Perhaps it's a little bit hard to perform this kind of tests in the TAP test? Not really. I'll look into it. -- Fabien.

Re: TRAP: FailedAssertion("tabstat->trans == trans", File: "pgstat_relation.c", Line: 508

2022-04-19 Thread Erik Rijkers
Op 19-04-2022 om 11:25 schreef Kyotaro Horiguchi: Thaks Erik. At Tue, 19 Apr 2022 07:00:30 +0200, Erik Rijkers wrote in Op 19-04-2022 om 02:15 schreef Kyotaro Horiguchi: Could you read tabstat, *tabstat, trans, *trans here? To be honest I'm not sure how to, but I gave it a try: I

Re: TRAP: FailedAssertion("HaveRegisteredOrActiveSnapshot()", File: "toast_internals.c", Line: 670, PID: 19403)

2022-04-19 Thread Robert Haas
On Mon, Apr 18, 2022 at 4:07 PM Tom Lane wrote: > There may be some corner cases that aren't described by any of these > three blanket scenarios, but they've got to be pretty few and far > between. My first thought whenever anything like this comes up is cursors, especially but not only holdable

Bad estimate with partial index

2022-04-19 Thread André Hänsel
Hi list, I have a case where Postgres chooses the wrong index and I'm not sure what to do about it: https://dbfiddle.uk/?rdbms=postgres_14=f356fd56a920ea8a93c192f5a8c16b 1c Setup: CREATE TABLE t ( filename int, cropped bool not null default false, resized bool not null default

Re: typos

2022-04-19 Thread Alvaro Herrera
CCing Amit K, because I propose a few relatively minor changes to logical rep docs. On 2022-Apr-13, Justin Pryzby wrote: > $ git grep -F ", the default)" > doc/src/sgml/ref/create_publication.sgml: partition's row filter (if the > parameter is false, the default) or the root > > Maybe what's

Re: Fix NULL pointer reference in _outPathTarget()

2022-04-19 Thread Alvaro Herrera
On 2022-Apr-18, Tom Lane wrote: > I suppose that Peter was trying to remove special cases from the > outfuncs.c code, but do we want to put this one back? Richard's > proposal would not accurately reflect the contents of the data > structure, so I'm not too thrilled with it. Yeah -- looking at

Re: make MaxBackends available in _PG_init

2022-04-19 Thread Julien Rouhaud
Hi, On Mon, Apr 18, 2022 at 08:17:04PM -0400, Tom Lane wrote: > Nathan Bossart writes: > > I'm looking for a clean way to ERROR if someone attempts to call > > RequestAddinShmemSpace() or RequestNamedLWLockTranche() outside of the > > hook. Currently, we are using static variables in ipci.c and

Re: Stabilizing the test_decoding checks, take N

2022-04-19 Thread Amit Kapila
On Tue, Apr 19, 2022 at 11:38 AM Dilip Kumar wrote: > > On Mon, Apr 18, 2022 at 3:29 PM Dilip Kumar wrote: > > > > > This needs to be verified once by doing some manual testing as it may > > not be easily reproducible every time. If this happens to be true then > > I think your suggestion

Re: Add version and data directory to initdb output

2022-04-19 Thread Daniel Gustafsson
> On 16 Apr 2022, at 01:50, David G. Johnston > wrote: > initdb is already pretty chatty, and the version of the cluster being > installed seems useful to include as well. That seems quite reasonable. > The data directory is probably less so - though I am thinking that the > absolute path

Re: TRAP: FailedAssertion("tabstat->trans == trans", File: "pgstat_relation.c", Line: 508

2022-04-19 Thread Kyotaro Horiguchi
Thaks Erik. At Tue, 19 Apr 2022 07:00:30 +0200, Erik Rijkers wrote in > Op 19-04-2022 om 02:15 schreef Kyotaro Horiguchi: > > Could you read tabstat, *tabstat, trans, *trans here? > > To be honest I'm not sure how to, but I gave it a try: > > (gdb) p tabstat > $1 = Great! It is that. But

Re: postgres_fdw: batch inserts vs. before row triggers

2022-04-19 Thread Etsuro Fujita
On Sun, Apr 17, 2022 at 6:20 PM Etsuro Fujita wrote: > Here > is an example using HEAD: > > create extension postgres_fdw; > create server loopback foreign data wrapper postgres_fdw options > (dbname 'postgres'); > create user mapping for current_user server loopback; > create table t (a int); >

Re: Defer selection of asynchronous subplans until the executor initialization stage

2022-04-19 Thread Etsuro Fujita
Hi, On Sun, Apr 17, 2022 at 7:30 PM Zhihong Yu wrote: > On Sun, Apr 17, 2022 at 1:48 AM Etsuro Fujita wrote: >> I think we might support more cases in the switch statement in the >> future. My concern about your proposal is that it might make it hard >> to add new cases to the statement. I

RE: Data is copied twice when specifying both child and parent table in publication

2022-04-19 Thread shiy.f...@fujitsu.com
On Tue, Apr 19, 2022 3:05 PM houzj.f...@fujitsu.com wrote: > > > -Original Message- > > From: Wang, Wei/王 威 > On Thursday, April 7, 2022 11:08 AM > > > > On Thur, Mar 10, 2021 at 10:08 AM houzj.f...@fujitsu.com wrote: > > > Hi, > > > > > > When reviewing some logical replication related

Re: Crash in new pgstats code

2022-04-19 Thread Thomas Munro
On Tue, Apr 19, 2022 at 2:50 AM Andres Freund wrote: > Kestrel won't go that far back even - I set it up 23 days ago... Here's a ~6 month old example from mylodon (I can't see much further back than that with HTTP requests... I guess BF records are purged?):

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

2022-04-19 Thread Tatsuo Ishii
>>> Ok. Fine with me. Possibly at some point there was the idea that there >>> could be other failures counted, but there are none. Also, there has >>> been questions about the failures detailed option, or whether the >>> reports should always be detailed, and the result may be some kind of >>>

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

2022-04-19 Thread Fabien COELHO
Ok. Fine with me. Possibly at some point there was the idea that there could be other failures counted, but there are none. Also, there has been questions about the failures detailed option, or whether the reports should always be detailed, and the result may be some kind of not convincing

Re: Replace open mode with PG_BINARY_R/W/A macros

2022-04-19 Thread Japin Li
On Tue, 19 Apr 2022 at 14:20, Tom Lane wrote: > Japin Li writes: >> On Mon, 18 Apr 2022 at 22:41, Tom Lane wrote: >>> A lot of these changes look wrong to me: they are substituting "rb" for >>> "r", etc, in places that mean to read text files. You have to think >>> about the Windows

Re: Replace open mode with PG_BINARY_R/W/A macros

2022-04-19 Thread Japin Li
On Tue, 19 Apr 2022 at 14:14, Michael Paquier wrote: > On Tue, Apr 19, 2022 at 01:29:18PM +0800, Japin Li wrote: >> On Mon, 18 Apr 2022 at 22:41, Tom Lane wrote: >>> Japin Li writes: I found we defined PG_BINARY_R/W/A macros for opening files, however, there are some places use the

Re: Postgres perl module namespace

2022-04-19 Thread Daniel Gustafsson
> On 18 Apr 2022, at 19:59, Andrew Dunstan wrote: > On 2022-04-18 Mo 13:43, Tom Lane wrote: >> Another thing that ought to be on the table is back-patching >> 549ec201d (Replace Test::More plans with done_testing). Those >> test counts are an even huger pain for back-patching than the >>

RE: Data is copied twice when specifying both child and parent table in publication

2022-04-19 Thread houzj.f...@fujitsu.com
> -Original Message- > From: Wang, Wei/王 威 On Thursday, April 7, 2022 11:08 AM > > On Thur, Mar 10, 2021 at 10:08 AM houzj.f...@fujitsu.com wrote: > > Hi, > > > > When reviewing some logical replication related features. I noticed another > > possible problem if the subscriber

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

2022-04-19 Thread Amit Kapila
On Thu, Apr 14, 2022 at 9:12 AM houzj.f...@fujitsu.com wrote: > > On Friday, April 8, 2022 5:14 PM houzj.f...@fujitsu.com > wrote: > > Attach a new version patch which improved the error handling and handled the > case > when there is no more worker available (will spill the data to the temp

Re: Replace open mode with PG_BINARY_R/W/A macros

2022-04-19 Thread Tom Lane
Japin Li writes: > On Mon, 18 Apr 2022 at 22:41, Tom Lane wrote: >> A lot of these changes look wrong to me: they are substituting "rb" for >> "r", etc, in places that mean to read text files. You have to think >> about the Windows semantics. > I do this substituting, since the comment says it

Re: Replace open mode with PG_BINARY_R/W/A macros

2022-04-19 Thread Michael Paquier
On Tue, Apr 19, 2022 at 01:29:18PM +0800, Japin Li wrote: > On Mon, 18 Apr 2022 at 22:41, Tom Lane wrote: >> Japin Li writes: >>> I found we defined PG_BINARY_R/W/A macros for opening files, however, >>> there are some places use the constant strings. IMO we should use >>> those macros instead

Re: Stabilizing the test_decoding checks, take N

2022-04-19 Thread Dilip Kumar
On Mon, Apr 18, 2022 at 3:29 PM Dilip Kumar wrote: > > This needs to be verified once by doing some manual testing as it may > not be easily reproducible every time. If this happens to be true then > I think your suggestion related to increasing autovacuum_naptime would > work. > > > I will try