Re: DROP OWNED BY is broken on master branch.

2022-09-26 Thread Rushabh Lathia
On Mon, Sep 26, 2022 at 11:46 PM Robert Haas wrote: > On Mon, Sep 26, 2022 at 3:44 AM Rushabh Lathia > wrote: > > Commit 6566133c5f52771198aca07ed18f84519fac1be7 ensure that > > pg_auth_members.grantor is always valid. This commit did changes > > into shdepDropOwned() function and combined the

Re: HOT chain validation in verify_heapam()

2022-09-26 Thread Himanshu Upadhyaya
On Tue, Sep 27, 2022 at 1:35 AM Robert Haas wrote: > 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 bo

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

2022-09-26 Thread kuroda.hay...@fujitsu.com
Dear Wang, Followings are comments for your patchset. 0001 01. launcher.c - logicalrep_worker_stop_internal() ``` + + Assert(LWLockHeldByMe(LogicalRepWorkerLock)); + ``` I think it should be Assert(LWLockHeldByMeInMode(LogicalRepWorkerLock, LW_SHARED)) because the lock is released

Re: add checkpoint stats of snapshot and mapping files of pg_logical dir

2022-09-26 Thread Bharath Rupireddy
On Mon, Sep 26, 2022 at 3:21 AM Justin Pryzby wrote: > > > This patch needs an update. It is failing on Windows for the test case > > "33/238 postgresql:pg_upgrade / pg_upgrade/002_pg_upgrade with an > > "exit status 2" error. > > > > The details are available on the cfbot.cputue.org. > > https://

Re: pg_upgrade test failure

2022-09-26 Thread Bharath Rupireddy
On Tue, Sep 20, 2022 at 7:01 AM Justin Pryzby wrote: > > On Mon, Sep 19, 2022 at 02:32:17PM -0700, Andres Freund wrote: > > Hi, > > > > After my last rebase of the meson tree I encountered the following test > > failure: > > > > https://cirrus-ci.com/task/5532444261613568 > > > > [20:23:04.171] --

Re: has_privs_of_role vs. is_member_of_role, redux

2022-09-26 Thread Wolfgang Walther
Robert Haas: Scratch my previous suggestion. A new, less fuzyy definition would be: Ownership is not a privilege itself and as such not inheritable. [...] If I'm understanding correctly, this would amount to a major redefinition of what it means to inherit privileges, and I think the chances of

Re: Avoid memory leaks during base backups

2022-09-26 Thread Bharath Rupireddy
On Mon, Sep 26, 2022 at 7:34 PM Tom Lane wrote: > > > I'm proposing a patch that leverages the error callback mechanism and > > memory context. > > This ... seems like inventing your own shape of wheel. The > normal mechanism for preventing this type of leak is to put the > allocations in a memor

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 h

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 ha

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 contai

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 macOS/XCod

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 uninte

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 time

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 in

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 th

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 an

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] I

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. T

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 fi

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 > --- a/

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} w

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 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} w

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: 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.

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 v1-000

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: 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 missing

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 > > patc

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: [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 f

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 m

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 da

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 '/usr/l

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 al

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 comments

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 > > ac

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 no

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 st

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 > "bo

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? Yes.

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", PGC_POST

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 ho

[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. C

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 > > argumen

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 found

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 freque

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 forgot

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 portabi

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 miss

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: 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] > https://www.postgresql.org/m

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 inte

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 fil

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 > > installcheck.

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 you

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 > > particul

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: 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 specifi

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 t_

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 th

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 f

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: 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 > > p

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 inheritan

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, l

Re: [RFC] building postgres with meson - v13

2022-09-26 Thread Andres Freund
Hi, On 2022-09-26 15:18:29 +0700, John Naylor wrote: > 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? Yea, i

Re: First draft of the PG 15 release notes

2022-09-26 Thread Tom Lane
Justin Pryzby writes: > On Fri, Sep 23, 2022 at 01:33:07PM -0400, Tom Lane wrote: > +Previously such files were left in the current directory, > +requiring manual cleanup. It's still necessary to remove them > +manually afterwards, but now one can just remove that whole >

Re: DROP OWNED BY is broken on master branch.

2022-09-26 Thread Robert Haas
On Mon, Sep 26, 2022 at 3:44 AM Rushabh Lathia wrote: > Commit 6566133c5f52771198aca07ed18f84519fac1be7 ensure that > pg_auth_members.grantor is always valid. This commit did changes > into shdepDropOwned() function and combined the SHARED_DEPENDENCY_ACL > and SHARED_DEPENDENCY_OWNER. In that pr

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

2022-09-26 Thread Tom Lane
Larry Rosenman writes: > On 09/26/2022 11:39 am, Nazir Bilal Yavuz wrote: >> When "krb5-config" binary is used from brew or MacPorts installations' >> path it gives the correct path but there is another "krb5-config" >> binary at "/usr/bin/krb5-config" path on the macOS VMs, when this >> binary

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

2022-09-26 Thread Tom Lane
Peter Eisentraut writes: >> Ok, it has problems with 32-bit platforms.  I can reproduce it locally. >> I'll need to take another look at this.  I have reverted the patch for now. > I have tried to analyze these issues, but I'm quite stuck. If anyone > else has any ideas, it would be helpful.

Re: has_privs_of_role vs. is_member_of_role, redux

2022-09-26 Thread Robert Haas
On Mon, Sep 26, 2022 at 12:16 PM Wolfgang Walther wrote: > I think, when WITH INHERIT TRUE, SET FALSE is set, we should: > - Inherit all explicitly granted privileges > - Not inherit any DDL privileges implicitly given through ownership: > CREATE, REFERENCES, TRIGGER. > - Inherit all other privile

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

2022-09-26 Thread James Coleman
On Mon, Sep 26, 2022 at 10:04 AM Wolfgang Walther wrote: > > James Coleman: > > As I was reading through the email chain I had this thought: could you > > get the same benefit (or 90% of it anyway) by instead allowing the > > creation of a uniqueness constraint that contains more columns than > >

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

2022-09-26 Thread James Coleman
On Mon, Sep 26, 2022 at 9:59 AM Wolfgang Walther wrote: > > 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 > > rega

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

2022-09-26 Thread Larry Rosenman
On 09/26/2022 11:39 am, Nazir Bilal Yavuz wrote: Hi, On 9/26/2022 2:14 PM, Tom Lane wrote: Maybe we should first try "krb5-config --prefix" to see if that gives an answer. I tested that command on multiple OSes and it was correct for freeBSD, debian and openSUSE. I don't have macOS so

Re: Add more docs for pg_surgery?

2022-09-26 Thread Ashutosh Sharma
On Mon, Sep 26, 2022 at 9:29 PM Zhang Mingli wrote: > > Hi, hackers > > heap_force_kill/heap_force_freeze doesn’t consider other transactions that > are using the same tuples even with tuple-locks. > The functions may break transaction semantic, ex: > > session1 > ``` > create table htab(id int);

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

2022-09-26 Thread Nazir Bilal Yavuz
Hi, On 9/26/2022 2:14 PM, Tom Lane wrote: Maybe we should first try "krb5-config --prefix" to see if that gives an answer. I tested that command on multiple OSes and it was correct for freeBSD, debian and openSUSE. I don't have macOS so I tried to use CI for running macOS VMs(both arm a

Re: [RFC] building postgres with meson - v13

2022-09-26 Thread Andres Freund
Hi, On 2022-09-26 15:01:56 +0200, Peter Eisentraut wrote: > Here is some review of the remaining ones (might not match exactly what you > attached, I was working off your branch): Thanks, and makes sense. > 9f789350a7a7 meson: ci: wip: move compilerwarnings task to meson > > This sounds reasona

Re: making relfilenodes 56 bits

2022-09-26 Thread Robert Haas
On Wed, Sep 21, 2022 at 6:09 AM Dilip Kumar wrote: > Yeah you are right we can make it uint64. With respect to this, we > can not directly use uint64 because that is declared in c.h and that > can not be used in > postgres_ext.h IIUC. Ugh. > Can we move the existing definitions from > c.h file

Re: has_privs_of_role vs. is_member_of_role, redux

2022-09-26 Thread Wolfgang Walther
Robert Haas: This shows that if rhaas (or whoever) performs DML on a table owned by pg_read_all_settings, he might trigger arbitrary code written by alice to run under his own user ID. Now, that hazard would exist anyway for tables owned by alice, but now it also exists for any tables owned by pg

Re: identifying the backend that owns a temporary schema

2022-09-26 Thread Nathan Bossart
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? All I've come up with so far is "internal identifie

Add more docs for pg_surgery?

2022-09-26 Thread Zhang Mingli
Hi, hackers heap_force_kill/heap_force_freeze doesn’t consider other transactions that are using the same tuples even with tuple-locks. The functions may break transaction semantic, ex: session1 ``` create table htab(id int); insert into htab values (100), (200), (300), (400), (500); ``` sessio

Re: [RFC] building postgres with meson - v13

2022-09-26 Thread Andres Freund
Hi, On 2022-09-26 10:41:01 +0200, Alvaro Herrera wrote: > 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

Re: has_privs_of_role vs. is_member_of_role, redux

2022-09-26 Thread Robert Haas
On Sun, Sep 25, 2022 at 5:08 AM Wolfgang Walther wrote: > Robert Haas: > > Well, maybe. Suppose that role A has been granted pg_read_all_settings > > WITH INHERIT TRUE, SET TRUE and role B has been granted > > pg_read_all_settings WITH INHERIT TRUE, SET FALSE. A can create a > > table owned by pg_

Re: Add support for DEFAULT specification in COPY FROM

2022-09-26 Thread Zhihong Yu
On Mon, Sep 26, 2022 at 8:12 AM Israel Barth Rubio wrote: > Hello Andrew, > > > . There needs to be a check that this is being used with COPY FROM, and > > the restriction needs to be stated in the docs and tested for. c.f. > > FORCE NULL. > > > > . There needs to be support for this in psql's ta

Re: Consider parallel for lateral subqueries with limit

2022-09-26 Thread James Coleman
On Mon, Sep 26, 2022 at 10:37 AM Robert Haas wrote: > > On Thu, Sep 22, 2022 at 5:19 PM James Coleman wrote: > > > Your sample query gets a plan like this: > > > > > > Nested Loop Left Join (cost=0.00..1700245.00 rows=1 width=8) > > >-> Seq Scan on foo (cost=0.00..145.00 rows=1 wi

Re: Add support for DEFAULT specification in COPY FROM

2022-09-26 Thread Israel Barth Rubio
Hello Andrew, > . There needs to be a check that this is being used with COPY FROM, and > the restriction needs to be stated in the docs and tested for. c.f. > FORCE NULL. > > . There needs to be support for this in psql's tab_complete.c, and > appropriate tests added > > . There needs to be suppo

PostgreSQL 15 GA release date

2022-09-26 Thread Jonathan S. Katz
Hi, The PostgreSQL 15 GA release (15.0) is now scheduled for October 13, 2022. The release team changed this from the planned date of October 6 to allow for additional testing of recent changes. Please let us know if you have any questions. We're excited that we are very close to officially

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 Sat, Sep 24, 2022 at 9:44 AM Thomas Munro wrote: > > Although WriteFile() with a synchronous file handle and an explicit > offset doesn't use the current file position, it appears that it still > changes it. :-( > > You'd think from the documentation[1] that that isn't the case, because it >

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

2022-09-26 Thread Peter Eisentraut
On 12.09.22 19:59, Peter Eisentraut wrote: On 12.09.22 19:03, Julien Rouhaud wrote: On Mon, Sep 12, 2022 at 05:59:09PM +0200, Peter Eisentraut wrote: committed, thanks FTR lapwing is complaining about this commit: https://brekka.postgresql.org/cgi-bin/show_log.pl?nm=lapwing&dt=2022-09-12%201

Re: Extending outfuncs support to utility statements

2022-09-26 Thread Peter Eisentraut
On 22.09.22 23:21, Tom Lane wrote: Anyway, this is a bit far afield from the stated topic of this thread. I think we should commit something approximately like what I posted and then start a new thread specifically about what we'd like to do about utility commands in new-style SQL functions. R

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

2022-09-26 Thread Peter Eisentraut
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 also needs to account for MacPorts, which would likely put it under /opt/local/sbi

Re: Consider parallel for lateral subqueries with limit

2022-09-26 Thread Robert Haas
On Thu, Sep 22, 2022 at 5:19 PM James Coleman wrote: > > Your sample query gets a plan like this: > > > > Nested Loop Left Join (cost=0.00..1700245.00 rows=1 width=8) > >-> Seq Scan on foo (cost=0.00..145.00 rows=1 width=4) > >-> Limit (cost=0.00..170.00 rows=1 width=4) > >

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

2022-09-26 Thread Wolfgang Walther
James Coleman: As I was reading through the email chain I had this thought: could you get the same benefit (or 90% of it anyway) by instead allowing the creation of a uniqueness constraint that contains more columns than the index backing it? So long as the index backing it still guaranteed the u

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 >

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: SUBTRANS: Minimizing calls to SubTransSetParent()

2022-09-26 Thread Simon Riggs
On Fri, 16 Sept 2022 at 13:20, Simon Riggs wrote: > > Thanks for the review. > > v10 attached v11 attached, corrected for recent commit 14ff44f80c09718d43d853363941457f5468cc03. -- Simon Riggshttp://www.EnterpriseDB.com/ 002_minimize_calls_to_SubTransSetParent.v11.patch Descri

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 bb

Re: SYSTEM_USER reserved word implementation

2022-09-26 Thread Drouvot, Bertrand
Hi, On 9/8/22 3:17 AM, Michael Paquier wrote: On Wed, Sep 07, 2022 at 08:48:43AM -0700, Jacob Champion wrote: We could pass the bare auth_method index, or update the documentation for auth_method to state that it's guaranteed to be zero if authn_id is NULL (and then enforce that). c

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/26/22 10:23 AM, Drouvot, Bertrand wrote: 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, maste

  1   2   >