Re: identifying the backend that owns a temporary schema

2022-09-26 Thread Tom Lane
Nathan Bossart writes: > On Sat, Sep 24, 2022 at 01:41:38PM -0400, Tom Lane wrote: >> One thing I don't like about it documentation-wise is that it leaves >> the concept of backend ID pretty much completely undefined. > How specific do you think this definition ought to be? Fairly specific, I

cirrus-ci cross-build interactions?

2022-09-26 Thread James Coleman
I had a build on Cirrus CI fail tonight in what I have to assume was either a problem with caching across builds or some such similar flakiness. In the Debian task [1] I received this error: su postgres -c "make -s -j${BUILD_JOBS} world-bin" In file included from parser.c:25: ./gramparse.h:29:10:

Re: [RFC] building postgres with meson - v13

2022-09-26 Thread Peter Geoghegan
On Sun, Sep 25, 2022 at 5:38 PM Andres Freund wrote: > # run just the main pg_regress tests against existing server > meson test --setup running main/regress-running > Peter, would this address your use case? I tried out your v16 patchset, which seems to mostly work as I'd hoped it would. Some

RE: [small patch] Change datatype of ParallelMessagePending from "volatile bool" to "volatile sig_atomic_t"

2022-09-26 Thread kuroda.hay...@fujitsu.com
Dear Michael, > Done this one. I have scanned the code, but did not notice a similar > mistake. I found your commit, thanks! > It is worth noting that we have only one remaining "volatile > bool" in the headers now. Maybe you mentioned about sigint_interrupt_enabled, and it also seems to be

Re: kerberos/001_auth test fails on arm CPU darwin

2022-09-26 Thread Andres Freund
Hi, On 2022-09-27 10:25:07 +0900, Michael Paquier wrote: > On Mon, Sep 26, 2022 at 04:39:36PM +0200, Peter Eisentraut wrote: > > On 26.09.22 13:14, Tom Lane wrote: > >> Bilal Yavuz writes: > >> > It seems that kerberos is installed at the '/opt/homebrew/opt/krb5' path > >> > on > >> > ARM CPU

Re: has_privs_of_role vs. is_member_of_role, redux

2022-09-26 Thread Stephen Frost
Greetings, * Robert Haas (robertmh...@gmail.com) wrote: > On Thu, Sep 8, 2022 at 1:06 PM wrote: > > In theory, I could also inherit that privilege, but that's not how the > > system works today. By using is_member_of_role, the decision was already > > made that this should not depend on

Re: identifying the backend that owns a temporary schema

2022-09-26 Thread Nathan Bossart
On Mon, Sep 26, 2022 at 03:50:09PM -0400, Tom Lane wrote: > Nathan Bossart writes: >> On Sat, Sep 24, 2022 at 01:41:38PM -0400, Tom Lane wrote: >>> One thing I don't like about it documentation-wise is that it leaves >>> the concept of backend ID pretty much completely undefined. > >> How

Re: cirrus-ci cross-build interactions?

2022-09-26 Thread Andres Freund
Hi, On 2022-09-26 22:36:24 -0400, James Coleman wrote: > I had a build on Cirrus CI fail tonight in what I have to assume was > either a problem with caching across builds or some such similar > flakiness. In the Debian task [1] I received this error: > > su postgres -c "make -s -j${BUILD_JOBS}

Re: has_privs_of_role vs. is_member_of_role, redux

2022-09-26 Thread Stephen Frost
Greetings, * Wolfgang Walther (walt...@technowledgy.de) wrote: > Robert Haas: > > I don't think we're going to be very happy if we redefine inheriting > > the privileges of another role to mean inheriting only some of them. > > That seems pretty counterintuitive to me. I also think that this > >

Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes?

2022-09-26 Thread Thomas Munro
On Tue, Sep 27, 2022 at 10:27 AM Nathan Bossart wrote: > On Mon, Sep 26, 2022 at 08:33:53PM +0530, Bharath Rupireddy wrote: > > Irrespective of what Windows does with file pointers in WriteFile(), > > should we add lseek(SEEK_SET) in our own pwrite()'s implementation, > > something like [5]? This

Re: Refactor backup related code (was: Is it correct to say, "invalid data in file \"%s\"", BACKUP_LABEL_FILE in do_pg_backup_stop?)

2022-09-26 Thread Michael Paquier
On Mon, Sep 26, 2022 at 05:10:16PM +0900, Kyotaro Horiguchi wrote: > - if (strcmp(backupfrom, "standby") == 0 && !backup_started_in_recovery) > + if (state->started_in_recovery == true && > + backup_stopped_in_recovery == false) > > Using == for Booleans may not be great?

Re: [small patch] Change datatype of ParallelMessagePending from "volatile bool" to "volatile sig_atomic_t"

2022-09-26 Thread Michael Paquier
On Mon, Sep 26, 2022 at 04:50:36PM +0900, Michael Paquier wrote: > You are right. bool is not usually a problem in a signal handler, but > sig_atomic_t is the type we ought to use. I'll go adjust that. Done this one. I have scanned the code, but did not notice a similar mistake. It is worth

Re: GUC tables - use designated initializers

2022-09-26 Thread Michael Paquier
On Tue, Sep 27, 2022 at 09:27:48AM +1000, Peter Smith wrote: > But why not use designated initializers to enforce what the comments > are hoping for? This is a C99 thing as far as I understand, adding one safety net. Why not for these cases.. > Doing this also exposed a minor typo in the

Re: [PoC] Federated Authn/z with OAUTHBEARER

2022-09-26 Thread Andrey Chudnovsky
>>> Libpq passing toked directly from an upstream client is useful in other >>> scenarios: >>> 1. Enterprise clients, built with .Net / Java and using provider-specific >>> authentication libraries, like MSAL for AAD. Those can also support more >>> advanced provider-specific token acquisition

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

2022-09-26 Thread Thomas Munro
On Sun, Sep 4, 2022 at 2:42 PM Tom Lane wrote: > Here's a draft patch for this. It seems to work on Linux, > but the Windows code is just speculation. In particular, > I did > > path = _fullpath(NULL, fname, 0); > if (path == NULL) > _dosmaperr(GetLastError()); >

Re: Pluggable toaster

2022-09-26 Thread Nikita Malakhov
Hi, Meson build for the patchset failed, meson build files attached and README/Doc package reworked with more detailed explanation of virtual function table along with other corrections. On Sun, Sep 25, 2022 at 1:41 AM Nikita Malakhov wrote: > Hi hackers! > Last patchset has an invalid patch

Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes?

2022-09-26 Thread Nathan Bossart
On Mon, Sep 26, 2022 at 08:33:53PM +0530, Bharath Rupireddy wrote: > Irrespective of what Windows does with file pointers in WriteFile(), > should we add lseek(SEEK_SET) in our own pwrite()'s implementation, > something like [5]? This is rather hackish without fully knowing what > Windows does

GUC values - recommended way to declare the C variables?

2022-09-26 Thread Peter Smith
Hi hackers. I have a question about the recommended way to declare the C variables used for the GUC values. Here are some examples from the code: ~ The GUC boot values are defined in src/backend.utils/misc/guc_tables.c e.g. See the 4, and 2 below { {"max_logical_replication_workers",

Re: GUC values - recommended way to declare the C variables?

2022-09-26 Thread Tom Lane
Peter Smith writes: > It seems confusing to me that for the above code the initial value is > "hardwired" in multiple places. Specifically, it looks tempting to > just change the variable declaration value, but IIUC that's going to > achieve nothing because it will just be overwritten by the >

Re: START_REPLICATION SLOT causing a crash in an assert build

2022-09-26 Thread Kyotaro Horiguchi
At Mon, 19 Sep 2022 11:04:03 -0500, Jaime Casanova wrote in > On Fri, Sep 16, 2022 at 02:37:17PM +0900, Kyotaro Horiguchi wrote: > > At Thu, 15 Sep 2022 11:15:12 -0500, Jaime Casanova > > wrote in > > > It fails at ./src/backend/utils/activity/pgstat_shmem.c:530 inside > > > > Thanks for

Re: [RFC] building postgres with meson - v13

2022-09-26 Thread Peter Geoghegan
On Mon, Sep 26, 2022 at 1:27 PM Andres Freund wrote: > > Some feedback: > > * I gather that "running" as it appears in commands like "meson test > > --setup running" refers to a particular setup named "running", that > > you invented as part of creating a meson-ish substitute for > >

Re: Enables to call Unregister*XactCallback() in Call*XactCallback()

2022-09-26 Thread Tom Lane
Andres Freund writes: > On 2022-03-29 14:48:54 +0800, Hao Wu wrote: >> It's a natural requirement to unregister the callback for transaction or >> subtransaction when the callback is invoked, so we don't have to >> unregister the callback somewhere. > You normally shouldn'd need to do this

GUC tables - use designated initializers

2022-09-26 Thread Peter Smith
Hi hackers, Enums index a number of the GUC tables. This all relies on the elements being carefully arranged to be in the same order as those enums. There are comments to say what enum index belongs to each table element. But why not use designated initializers to enforce what the comments are

[Commitfest 2022-09] Last days

2022-09-26 Thread Ibrar Ahmed
Just a reminder that only some days left of "September 2022 commitfest" As of now, there are "295" patches in total. Out of these 295 patches, "18" patches required committer attention, and 167 patches needed reviews. Total: 295. Needs review: 167. Waiting on Author: 44. Ready for Committer: 18.

Re: kerberos/001_auth test fails on arm CPU darwin

2022-09-26 Thread Larry Rosenman
On 09/26/2022 8:25 pm, Michael Paquier wrote: On Mon, Sep 26, 2022 at 04:39:36PM +0200, Peter Eisentraut wrote: On 26.09.22 13:14, Tom Lane wrote: Bilal Yavuz writes: > It seems that kerberos is installed at the '/opt/homebrew/opt/krb5' path on > ARM CPU darwin instances instead of the

Re: cirrus-ci cross-build interactions?

2022-09-26 Thread James Coleman
On Mon, Sep 26, 2022 at 10:36 PM James Coleman wrote: > > I had a build on Cirrus CI fail tonight in what I have to assume was > either a problem with caching across builds or some such similar > flakiness. In the Debian task [1] I received this error: > > su postgres -c "make -s -j${BUILD_JOBS}

Re: HOT chain validation in verify_heapam()

2022-09-26 Thread Robert Haas
On Sat, Sep 24, 2022 at 8:45 AM Himanshu Upadhyaya wrote: > Here our objective is to validate if both Predecessor's xmin and current > Tuple's xmin are same then cmin of predecessor must be less than current > Tuple's cmin. In case when both tuple xmin's are same then I think > predecessor's

Re: [PATCH] Introduce array_shuffle() and array_sample()

2022-09-26 Thread Tom Lane
Martin Kalcher writes: > [ v4-0001-Introduce-array_shuffle-and-array_sample.patch ] I think this idea of exporting drandom()'s PRNG for all and sundry to use is completely misguided. If we go down that path we'll be right back in the swamp that we were in when we used random(3), namely that (a)

Re: has_privs_of_role vs. is_member_of_role, redux

2022-09-26 Thread Robert Haas
On Mon, Sep 26, 2022 at 3:16 PM Wolfgang Walther wrote: > Robert Haas: > > I don't think we're going to be very happy if we redefine inheriting > > the privileges of another role to mean inheriting only some of them. > > That seems pretty counterintuitive to me. I also think that this > >

Re: First draft of the PG 15 release notes

2022-09-26 Thread David Rowley
On Tue, 27 Sept 2022 at 10:45, Tom Lane wrote: > > David Rowley writes: > > On Tue, 13 Sept 2022 at 09:31, Jonathan S. Katz > > wrote: > >> Separately, per[1], including dense_rank() in the list of window > >> functions with optimizations (dense-rank.diff). > > > This one might have been

Re: Enables to call Unregister*XactCallback() in Call*XactCallback()

2022-09-26 Thread Nathan Bossart
On Mon, Sep 26, 2022 at 06:05:34PM -0400, Tom Lane wrote: > Yeah. Whether it's efficient or not, seems like it should *work*. > I'm a bit inclined to call this a bug-fix and backpatch it. > > I went looking for other occurrences of this code in places that have > an unregister function, and

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

2022-09-26 Thread David Rowley
On Tue, 20 Sept 2022 at 13:23, Tom Lane wrote: > > David Rowley writes: > > Aside from that, I don't have any ideas on how to get rid of the > > possible additional datumCopy() from non-Var arguments to these window > > functions. Should we just suffer it? It's quite likely that most > >

Re: has_privs_of_role vs. is_member_of_role, redux

2022-09-26 Thread Wolfgang Walther
Robert Haas: I don't think we're going to be very happy if we redefine inheriting the privileges of another role to mean inheriting only some of them. That seems pretty counterintuitive to me. I also think that this particular definition is pretty fuzzy. Scratch my previous suggestion. A new,

Re: [RFC] building postgres with meson - v13

2022-09-26 Thread Andres Freund
Hi, On 2022-09-26 09:35:16 -0700, Andres Freund wrote: > > 9c00d355d0e9 meson: Add PGXS compatibility > > > > This looks like a reasonable direction to me. How complete is it? It > > says it works for some extensions but not others. How do we define > > the target line here? > > Yea, those are

Re: First draft of the PG 15 release notes

2022-09-26 Thread Tom Lane
David Rowley writes: > On Tue, 13 Sept 2022 at 09:31, Jonathan S. Katz wrote: >> Separately, per[1], including dense_rank() in the list of window >> functions with optimizations (dense-rank.diff). > This one might have been forgotten... ? I can push it shortly if nobody > objects. Yeah, I

Re: A doubt about a newly added errdetail

2022-09-26 Thread Kyotaro Horiguchi
At Mon, 26 Sep 2022 17:33:46 +0530, Amit Kapila wrote in > On Mon, Sep 26, 2022 at 4:45 PM houzj.f...@fujitsu.com > wrote: > > > > > > Attach the patch. (The patch can apply on both HEAD and PG15) > > > > The patch looks good to me. > > * > - errmsg("cannot add schema to the publication"), >

Re: kerberos/001_auth test fails on arm CPU darwin

2022-09-26 Thread Tom Lane
Andres Freund writes: > Maybe we should rely on PATH, rather than hardcoding OS dependent locations? My suggestion to consult krb5-config first was meant to allow PATH to influence the results. However, if that doesn't work, it's important IMO to have a sane list of hardwired places to look in.

Re: [RFC] building postgres with meson - v13

2022-09-26 Thread Andres Freund
Hi, On 2022-09-26 12:47:14 -0700, Peter Geoghegan wrote: > On Sun, Sep 25, 2022 at 5:38 PM Andres Freund wrote: > > # run just the main pg_regress tests against existing server > > meson test --setup running main/regress-running > > > Peter, would this address your use case? > > I tried out

Re: First draft of the PG 15 release notes

2022-09-26 Thread David Rowley
On Tue, 13 Sept 2022 at 09:31, Jonathan S. Katz wrote: > Separately, per[1], including dense_rank() in the list of window > functions with optimizations (dense-rank.diff). This one might have been forgotten... ? I can push it shortly if nobody objects. David > [1] >

Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes?

2022-09-26 Thread Nathan Bossart
On Tue, Sep 27, 2022 at 10:37:38AM +1300, Thomas Munro wrote: > I don't think so, that's an extra kernel call. I think I'll just have > to revert part of my recent change that removed the pg_ prefix from > those function names in our code, and restore the comment that warns > you about the

Re: Refactor backup related code (was: Is it correct to say, "invalid data in file \"%s\"", BACKUP_LABEL_FILE in do_pg_backup_stop?)

2022-09-26 Thread Michael Paquier
On Mon, Sep 26, 2022 at 11:57:58AM +0530, Bharath Rupireddy wrote: > +1 because callers don't use returned StringInfo structure outside of > build_backup_content(). The patch looks good to me. Thanks for looking. > I think it will be > good to add a note about the caller freeing up the retired

Re: GUC values - recommended way to declare the C variables?

2022-09-26 Thread Peter Smith
On Tue, Sep 27, 2022 at 10:08 AM Tom Lane wrote: > > Peter Smith writes: > > It seems confusing to me that for the above code the initial value is > > "hardwired" in multiple places. Specifically, it looks tempting to > > just change the variable declaration value, but IIUC that's going to > >

Re: kerberos/001_auth test fails on arm CPU darwin

2022-09-26 Thread Michael Paquier
On Mon, Sep 26, 2022 at 04:39:36PM +0200, Peter Eisentraut wrote: > On 26.09.22 13:14, Tom Lane wrote: >> Bilal Yavuz writes: >> > It seems that kerberos is installed at the '/opt/homebrew/opt/krb5' path on >> > ARM CPU darwin instances instead of the '/usr/local/opt/krb5' path. >> I think this

Re: Add common function ReplicationOriginName.

2022-09-26 Thread Peter Smith
On Tue, Sep 20, 2022 at 6:36 PM Aleksander Alekseev wrote: > > Hi Amit, > > > I think it is better to use Size. Even though, it may not fail now as > > the size of names for origin will always be much lesser but it is > > better if we are consistent. If we agree with this, then as a first > >

Re: pgstat: stats added in ReadPageInternal() aren't getting reported via pg_stat_wal

2022-09-26 Thread Kyotaro Horiguchi
At Mon, 19 Sep 2022 18:46:17 +0530, Bharath Rupireddy wrote in > walsener.c might work, but that didn't help either. Can anyone please > let me know why the stats that I added aren't shown via pg_stat_wal > view despite the walsender doing pgstat_initialize() -> > pgstat_init_wal()? Am I

Add hint about downloadable logs to CI README

2022-09-26 Thread James Coleman
I was wondering about how to debug failed builds on Cirrus CI, and after poking at the interface I realized we helpfully upload the logs from CI runs for user download. In an effort to save the next person a few minutes I thought the attached minor patch would help. Thanks, James Coleman

Re: Add hint about downloadable logs to CI README

2022-09-26 Thread Andres Freund
Hi, On 2022-09-26 22:08:12 -0400, James Coleman wrote: > I was wondering about how to debug failed builds on Cirrus CI, and > after poking at the interface I realized we helpfully upload the logs > from CI runs for user download. > > In an effort to save the next person a few minutes I thought

Re: START_REPLICATION SLOT causing a crash in an assert build

2022-09-26 Thread Kyotaro Horiguchi
Thanks! At Mon, 26 Sep 2022 19:53:02 -0700, Andres Freund wrote in > I wonder if the correct fix here wouldn't be to move the slotname out of > PgStat_StatReplSlotEntry? Ugh. Right. I thought its outer struct as purely the part for the common header. But we can freely place anything after the

Adding a clang-format file

2022-09-26 Thread Peter Geoghegan
Like other Postgres hackers [1], I have a custom .clang-format file that I use for my work on Postgres. It's a useful tool, despite some notable problems. First, I should mention the problems. The config that I use makes an awkward trade-off that results in function declarations getting mangled.

Re: Parallelize correlated subqueries that execute within each worker

2022-09-26 Thread James Coleman
On Mon, Mar 21, 2022 at 8:48 PM Andres Freund wrote: > > Hi, > > On 2022-01-22 20:25:19 -0500, James Coleman wrote: > > On the other hand this is a dramatically simpler patch series. > > Assuming the approach is sound, it should much easier to maintain than > > the previous version. > > > > The

Re: cirrus-ci cross-build interactions?

2022-09-26 Thread James Coleman
On Mon, Sep 26, 2022 at 10:48 PM Andres Freund wrote: > > Hi, > > On 2022-09-26 22:36:24 -0400, James Coleman wrote: > > I had a build on Cirrus CI fail tonight in what I have to assume was > > either a problem with caching across builds or some such similar > > flakiness. In the Debian task [1]

Re: Add LSN along with offset to error messages reported for WAL file read/write/validate header failures

2022-09-26 Thread Kyotaro Horiguchi
At Tue, 20 Sep 2022 17:40:36 +0530, Bharath Rupireddy wrote in > On Tue, Sep 20, 2022 at 12:57 PM Alvaro Herrera > wrote: > > > > On 2022-Sep-19, Bharath Rupireddy wrote: > > > > > We have a bunch of messages [1] that have an offset, but not LSN in > > > the error message. Firstly, is there

ci: reduce macos test concurrency

2022-09-26 Thread Andres Freund
Hi, The x86 mac VMs from cirrus-ci claim to have 12 CPUs, but when working on initdb caching for tests I noticed that using all those CPUs for tests hurts the test times noticably. See [1] (note that the overall time is influenced by different degrees of cache hit ratios): concurrency test

Re: Apple's ranlib warns about protocol_openssl.c

2022-09-26 Thread Andres Freund
Hi, On 2021-12-16 21:13:20 +0100, Daniel Gustafsson wrote: > > On 16 Dec 2021, at 19:22, Tom Lane wrote: > > > Having said that, I'm not seeing any such warning when I build > > with openssl 1.1.1k on my own Mac, so I'm a bit confused why > > Thomas sees it. > > Maybe it's dependant on

Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes?

2022-09-26 Thread Bharath Rupireddy
On Tue, Sep 27, 2022 at 3:08 AM Thomas Munro wrote: > > I don't think so, that's an extra kernel call. I think I'll just have > to revert part of my recent change that removed the pg_ prefix from > those function names in our code, and restore the comment that warns > you about the portability

Re: START_REPLICATION SLOT causing a crash in an assert build

2022-09-26 Thread Andres Freund
Hi, I wonder if the correct fix here wouldn't be to move the slotname out of PgStat_StatReplSlotEntry? On 2022-09-16 14:37:17 +0900, Kyotaro Horiguchi wrote: > diff --git a/src/backend/utils/activity/pgstat.c > b/src/backend/utils/activity/pgstat.c > index 6224c498c2..ed3f3af4d9 100644 > ---

Re: [RFC] building postgres with meson - v13

2022-09-26 Thread Thomas Munro
On Tue, Sep 27, 2022 at 2:19 PM Andres Freund wrote: > Subject: [PATCH v17 15/23] windows: Set UMDF_USING_NTSTATUS globally, include > ntstatus.h No Windows expertise here, but this looks reasonable. I originally tried to contain UMDF_USING_NTSTATUS to small translation units for fear of

Re: [RFC] building postgres with meson - v13

2022-09-26 Thread Andres Freund
Hi, On 2022-09-27 17:29:27 +1300, Thomas Munro wrote: > On Tue, Sep 27, 2022 at 2:19 PM Andres Freund wrote: > > Subject: [PATCH v17 15/23] windows: Set UMDF_USING_NTSTATUS globally, > > include ntstatus.h > > No Windows expertise here, but this looks reasonable. I originally > tried to

Re: Make ON_ERROR_STOP stop on shell script failure

2022-09-26 Thread Kyotaro Horiguchi
At Wed, 21 Sep 2022 11:45:07 +0900, Fujii Masao wrote in > > > On 2022/09/20 15:15, bt22nakamorit wrote: > I thought that this action is rather unexpected since, based on the > word """ON_ERROR_STOP""", ones may expect that failures of shell > scripts should halt the incoming

Re: Differentiate MERGE queries with different structures

2022-09-26 Thread Julien Rouhaud
Hi, On Mon, Sep 26, 2022 at 03:12:46PM +0900, bt22nakamorit wrote: > > pg_stat_statements module distinguishes queries with different structures, > but some visibly different MERGE queries were combined as one > pg_stat_statements entry. > For example, > MERGE INTO test1 USING test2 ON test1.id =

Re: Query Jumbling for CALL and SET utility statements

2022-09-26 Thread Drouvot, Bertrand
Hi, On 9/21/22 6:07 PM, Fujii Masao wrote: On 2022/09/19 15:29, Drouvot, Bertrand wrote: Please find attached v6 taking care of the remarks mentioned above. Thanks for updating the patch! +SET pg_stat_statements.track_utility = TRUE; + +-- PL/pgSQL procedure and pg_stat_statements.track

Re: kerberos/001_auth test fails on arm CPU darwin

2022-09-26 Thread Tom Lane
Bilal Yavuz writes: > It seems that kerberos is installed at the '/opt/homebrew/opt/krb5' path on > ARM CPU darwin instances instead of the '/usr/local/opt/krb5' path. I think this also needs to account for MacPorts, which would likely put it under /opt/local/sbin. (I wonder where

RE: A doubt about a newly added errdetail

2022-09-26 Thread houzj.f...@fujitsu.com
On Monday, September 26, 2022 5:03 PM houzj.f...@fujitsu.com wrote: > > On Monday, September 26, 2022 4:57 PM Amit Kapila > > > > > On Mon, Sep 26, 2022 at 2:03 PM Alvaro Herrera > > > > wrote: > > > > > > On 2022-Sep-26, Amit Kapila wrote: > > > > > > > On Mon, Sep 26, 2022 at 1:10 PM Alvaro

RE: A doubt about a newly added errdetail

2022-09-26 Thread houzj.f...@fujitsu.com
On Monday, September 26, 2022 4:57 PM Amit Kapila > > On Mon, Sep 26, 2022 at 2:03 PM Alvaro Herrera > wrote: > > > > On 2022-Sep-26, Amit Kapila wrote: > > > > > On Mon, Sep 26, 2022 at 1:10 PM Alvaro Herrera > wrote: > > > > > > ERROR: cannot use column list for relation "%s.%s" in

Re: Add ON CONFLICT DO RETURN clause

2022-09-26 Thread Dagfinn Ilmari Mannsåker
Wolfgang Walther writes: > Peter Geoghegan: >> On Sun, Sep 25, 2022 at 8:55 AM Wolfgang Walther >> wrote: >>> The attached patch adds a DO RETURN clause to be able to do this: >>> >>> INSERT INTO x (id) VALUES (1) >>> ON CONFLICT DO RETURN >>> RETURNING created_at; >>> >>> Much simpler.

Re: CFM Manager

2022-09-26 Thread Ibrar Ahmed
On Tue, Sep 20, 2022 at 10:45 PM Jacob Champion wrote: > On Thu, Sep 8, 2022 at 2:34 PM Jacob Champion > wrote: > > I still have yet to update the section "5 to 7 days before end of CF" > > and onward. > > Well, I've saved the hardest part for last... > > Ibrar, Hamid, have the checklist

kerberos/001_auth test fails on arm CPU darwin

2022-09-26 Thread Bilal Yavuz
Hi hackers, I wanted to add ARM CPU darwin to the CI but it seems that kerberos/001_auth fails on ARM CPU darwin. OS: Darwin admins-Virtual-Machine.local 21.6.0 Darwin Kernel Version 21.6.0: Wed Aug 10 14:26:07 PDT 2022; root:xnu-8020.141.5~2/RELEASE_ARM64_VMAPPLE arm64 Error message: Can't

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

2022-09-26 Thread Amit Kapila
On Mon, Sep 26, 2022 at 8:41 AM wangw.f...@fujitsu.com wrote: > > On Thur, Sep 22, 2022 at 18:12 PM Amit Kapila wrote: > > > 3. > > ApplyWorkerMain() > > { > > ... > > ... > > + > > + if (server_version >= 16 && > > + MySubscription->stream == SUBSTREAM_PARALLEL) > > +

Re: Differentiate MERGE queries with different structures

2022-09-26 Thread Alvaro Herrera
On 2022-Sep-26, Julien Rouhaud wrote: > On Mon, Sep 26, 2022 at 03:12:46PM +0900, bt22nakamorit wrote: > > I attached a patch file that adds information about MERGE queries on the > > documentation of pg_stat_statements, and lines of code that helps with the > > calculation of queryid hash value

Re: pg_rewind WAL segments deletion pitfall

2022-09-26 Thread Alexander Kukushkin
Hello Kyotaro, any further thoughts on it? Regards, -- Alexander Kukushkin

Re: Make mesage at end-of-recovery less scary.

2022-09-26 Thread Kyotaro Horiguchi
At Fri, 16 Sep 2022 23:21:50 -0500, Justin Pryzby wrote in > @cfbot: rebased over adb466150, which did the same thing as one of the > hunks in xlogreader.c. Oops. Thanks! And then this gets a further conflict (param names harmonization). So further rebased. And removed an extra blank line you

Re: A doubt about a newly added errdetail

2022-09-26 Thread Alvaro Herrera
On 2022-Sep-26, Kyotaro Horiguchi wrote: > I saw the following message recently added to publicationcmds.c. > > (ERROR: cannot use publication column list for relation "%s.%s"") > > DETAIL: Column list cannot be specified if any schema is part of the > > publication or specified in the list. >

Re: DROP OWNED BY is broken on master branch.

2022-09-26 Thread Michael Paquier
On Mon, Sep 26, 2022 at 01:13:53PM +0530, Rushabh Lathia wrote: > Please find the attached patch which fixes the case. Could it be possible to stress this stuff in the regression tests? There is a gap here. (I have not looked at what you are proposing.) -- Michael signature.asc Description:

Re: Refactor backup related code (was: Is it correct to say, "invalid data in file \"%s\"", BACKUP_LABEL_FILE in do_pg_backup_stop?)

2022-09-26 Thread Kyotaro Horiguchi
At Mon, 26 Sep 2022 11:57:58 +0530, Bharath Rupireddy wrote in > On Mon, Sep 26, 2022 at 8:13 AM Michael Paquier wrote: > > > > What I had at hand seemed fine on a second look, so applied after > > tweaking a couple of comments. One thing that I have been wondering > > after-the-fact is

Re: A doubt about a newly added errdetail

2022-09-26 Thread Alvaro Herrera
On 2022-Sep-26, Amit Kapila wrote: > On Mon, Sep 26, 2022 at 1:10 PM Alvaro Herrera > wrote: > > ERROR: cannot use column list for relation "%s.%s" in publication "%s" > > DETAIL: Column lists cannot be specified in publications containing FOR > > TABLES IN SCHEMA elements. > > This looks

Re: pg_stat_have_stats() returns true for dropped indexes (or for index creation transaction rolled back)

2022-09-26 Thread Drouvot, Bertrand
Hi, On 9/23/22 10:45 PM, Andres Freund wrote: Hi, On 2022-09-01 08:40:54 +0200, Drouvot, Bertrand wrote: Thanks for the suggestion, I'm coming up with this proposal in v4 attached: I pushed the bugfix / related test portion to 15, master. Thanks! Thanks! I left the replication

Re: fix stats_fetch_consistency value in postgresql.conf.sample

2022-09-26 Thread Kyotaro Horiguchi
At Sat, 17 Sep 2022 23:53:07 -0500, Justin Pryzby wrote in > This is an alternative implementation, which still relies on adding the > GUC_DYNAMIC, flag but doesn't require adding a new, sql-accessible > function to convert the GUC to a pretty/human display value. Thanks! I'm not sure

Differentiate MERGE queries with different structures

2022-09-26 Thread bt22nakamorit
Hi, pg_stat_statements module distinguishes queries with different structures, but some visibly different MERGE queries were combined as one pg_stat_statements entry. For example, MERGE INTO test1 USING test2 ON test1.id = test2.id WHEN MATCHED THEN UPDATE var = 1; MERGE INTO test1 USING

DROP OWNED BY is broken on master branch.

2022-09-26 Thread Rushabh Lathia
Hi All, Consider the below test: postgres@53130=#create role test WITH login createdb; CREATE ROLE postgres@53130=#\c - test You are now connected to database "postgres" as user "test". postgres@53150=#create database test; CREATE DATABASE postgres@53150=#\c - rushabh You are now connected to

Re: [small patch] Change datatype of ParallelMessagePending from "volatile bool" to "volatile sig_atomic_t"

2022-09-26 Thread Michael Paquier
On Mon, Sep 26, 2022 at 06:57:28AM +, kuroda.hay...@fujitsu.com wrote: > While reviewing [1], I and Amit noticed that a flag ParallelMessagePending is > defined > as "volatile bool", but other flags set by signal handlers are defined as > "volatile sig_atomic_t". > > How do you think? You

Re: [RFC] building postgres with meson - v13

2022-09-26 Thread John Naylor
On Wed, Sep 21, 2022 at 7:11 AM Andres Freund wrote: > > I added installation instructions for meson for a bunch of platforms, but A couple more things for the wiki: 1) /opt/homebrew/ seems to be an "Apple silicon" path? Either way it doesn't exist on this machine. I was able to get a working

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

2022-09-26 Thread kuroda.hay...@fujitsu.com
Dear Wang, Thanks for updating patch!... but cfbot says that it cannot be accepted [1]. I thought the header should be included, like miscadmin.h. [1]: https://cirrus-ci.com/task/5909508684775424 Best Regards, Hayato Kuroda FUJITSU LIMITED

Re: A doubt about a newly added errdetail

2022-09-26 Thread Amit Kapila
On Mon, Sep 26, 2022 at 2:03 PM Alvaro Herrera wrote: > > On 2022-Sep-26, Amit Kapila wrote: > > > On Mon, Sep 26, 2022 at 1:10 PM Alvaro Herrera > > wrote: > > > > ERROR: cannot use column list for relation "%s.%s" in publication "%s" > > > DETAIL: Column lists cannot be specified in

RE: [RFC] building postgres with meson - v13

2022-09-26 Thread wangw.f...@fujitsu.com
Hi, I tried to use meson and ninja and they are really efficient. But when I tried to specify "c_args", it did not take effect. Attached my steps: [In the HEAD (7d708093b7)] $ meson setup build --prefix /home/wangw/install/parallel_apply/ -Dcassert=true -Dtap_tests=enabled -Dicu=enabled

Re: Refactor backup related code (was: Is it correct to say, "invalid data in file \"%s\"", BACKUP_LABEL_FILE in do_pg_backup_stop?)

2022-09-26 Thread Bharath Rupireddy
On Mon, Sep 26, 2022 at 8:13 AM Michael Paquier wrote: > > What I had at hand seemed fine on a second look, so applied after > tweaking a couple of comments. One thing that I have been wondering > after-the-fact is whether it would be cleaner to return the contents > of the backup history file

Re: Allow foreign keys to reference a superset of unique columns

2022-09-26 Thread Wolfgang Walther
James Coleman: If we have a declared constraint on x,y where x is unique based on an index including on x I do not think we should have that fk constraint work differently than a constraint on x,y where there is a unique index on x,y. That would seem to be incredibly confusing behavior (even if

A doubt about a newly added errdetail

2022-09-26 Thread Kyotaro Horiguchi
I saw the following message recently added to publicationcmds.c. (ERROR: cannot use publication column list for relation "%s.%s"") > DETAIL: Column list cannot be specified if any schema is part of the > publication or specified in the list. As my reading, the "the list" at the end

RE: [RFC] building postgres with meson - v13

2022-09-26 Thread wangw.f...@fujitsu.com
On Mon, Sep 26, 2022 at 14:47 PM Andres Freund wrote: > Hi, > > On 2022-09-26 06:24:42 +, wangw.f...@fujitsu.com wrote: > > I tried to use meson and ninja and they are really efficient. > > But when I tried to specify "c_args", it did not take effect. > > They should take effect, but won't

Re: A doubt about a newly added errdetail

2022-09-26 Thread Amit Kapila
On Mon, Sep 26, 2022 at 1:10 PM Alvaro Herrera wrote: > > On 2022-Sep-26, Kyotaro Horiguchi wrote: > > > I saw the following message recently added to publicationcmds.c. > > > > (ERROR: cannot use publication column list for relation "%s.%s"") > > > DETAIL: Column list cannot be specified if any

Re: [RFC] building postgres with meson - v13

2022-09-26 Thread Alvaro Herrera
On 2022-Sep-25, Andres Freund wrote: > From 3eb0ca196084da314d94d1e51c7b775012a4773c Mon Sep 17 00:00:00 2001 > From: Andres Freund > Date: Wed, 21 Sep 2022 11:03:07 -0700 > Subject: [PATCH v16 04/16] meson: Add windows resource files > diff --git a/src/backend/jit/llvm/meson.build >

Re: Fix typos in code comments

2022-09-26 Thread Amit Kapila
On Sat, Sep 24, 2022 at 4:00 AM Justin Pryzby wrote: > > On Mon, Sep 19, 2022 at 06:10:00AM -0500, Justin Pryzby wrote: > > On Mon, Sep 19, 2022 at 11:05:24AM +0800, Zhang Mingli wrote: > > > Good catch. There is a similar typo in doc, runtime.sgml. > > > ```using TLS protocols enabled by by

Re: Add ON CONFLICT DO RETURN clause

2022-09-26 Thread Wolfgang Walther
Peter Geoghegan: On Sun, Sep 25, 2022 at 8:55 AM Wolfgang Walther wrote: The attached patch adds a DO RETURN clause to be able to do this: INSERT INTO x (id) VALUES (1) ON CONFLICT DO RETURN RETURNING created_at; Much simpler. This will either insert or do nothing - but in both cases

Re: [RFC] building postgres with meson - v13

2022-09-26 Thread Andres Freund
Hi, On 2022-09-26 06:24:42 +, wangw.f...@fujitsu.com wrote: > I tried to use meson and ninja and they are really efficient. > But when I tried to specify "c_args", it did not take effect. They should take effect, but won't be shown in the summary section currently. That currently only shows

[small patch] Change datatype of ParallelMessagePending from "volatile bool" to "volatile sig_atomic_t"

2022-09-26 Thread kuroda.hay...@fujitsu.com
Hi hackers, While reviewing [1], I and Amit noticed that a flag ParallelMessagePending is defined as "volatile bool", but other flags set by signal handlers are defined as "volatile sig_atomic_t". The datatype has been defined in standard C, and it says that variables referred by signal

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

2022-09-26 Thread Amit Kapila
On Thu, Sep 22, 2022 at 9:44 PM Önder Kalacı wrote: > > Also, do you think is this a good time for me to mark the patch "Ready for > committer" in the commit fest? Not sure when and who should change the state, > but it seems I can change. I couldn't find any documentation on how that >

Re: A doubt about a newly added errdetail

2022-09-26 Thread Amit Kapila
On Mon, Sep 26, 2022 at 4:45 PM houzj.f...@fujitsu.com wrote: > > > Attach the patch. (The patch can apply on both HEAD and PG15) > The patch looks good to me. * - errmsg("cannot add schema to the publication"), + errmsg("cannot add schema to publication \"%s\"", +stmt->pubname), I see

Re: SYSTEM_USER reserved word implementation

2022-09-26 Thread Drouvot, Bertrand
Hi, On 9/7/22 5:48 PM, Jacob Champion wrote: On 9/7/22 07:46, Drouvot, Bertrand wrote: Except the Nit above, that looks all good to me. A few additional comments: +assigned a database role. It is represented as +auth_method:identity or +NULL if the user has not been

Avoid memory leaks during base backups

2022-09-26 Thread Bharath Rupireddy
Hi, Postgres currently can leak memory if a failure occurs during base backup in do_pg_backup_start() or do_pg_backup_stop() or perform_base_backup(). The palloc'd memory such as backup_state or tablespace_map in xlogfuncs.c or basebackup.c or tablespaceinfo or the memory that gets allocated by

Re: Allow foreign keys to reference a superset of unique columns

2022-09-26 Thread Wolfgang Walther
James Coleman: So the broader point I'm trying to make is that, as I understand it, indexes backing foreign key constraints is an implementation detail. The SQL standard details the behavior of foreign key constraints regardless of implementation details like a backing index. That means that the

Re: Avoid memory leaks during base backups

2022-09-26 Thread Tom Lane
Bharath Rupireddy writes: > Postgres currently can leak memory if a failure occurs during base > backup in do_pg_backup_start() or do_pg_backup_stop() or > perform_base_backup(). The palloc'd memory such as backup_state or > tablespace_map in xlogfuncs.c or basebackup.c or tablespaceinfo or the >

  1   2   >