Re: Conflict Detection and Resolution

2024-05-26 Thread shveta malik
On Sat, May 25, 2024 at 2:39 AM Tomas Vondra wrote: > > On 5/23/24 08:36, shveta malik wrote: > > Hello hackers, > > > > Please find the proposal for Conflict Detection and Resolution (CDR) > > for Logical replication. > > > below details.> > > > > Introduction > > > > In case

Re: Avoid possible dereference null pointer (src/backend/catalog/pg_depend.c)

2024-05-26 Thread Michael Paquier
On Fri, May 24, 2024 at 09:05:35AM -0300, Ranier Vilela wrote: > The function *get_attname* palloc the result name (pstrdup). > Isn't it necessary to free the memory here (pfree)? This is going to be freed with the current memory context, and all the callers of getIdentitySequence() are in query

Re: Speed up JSON escape processing with SIMD plus other optimisations

2024-05-26 Thread David Rowley
On Fri, 24 May 2024 at 08:34, Andrew Dunstan wrote: > That's all pretty nice! I'd take the win on this rather than wait for > some hypothetical patch that changes how output functions work. On re-think of that, even if we changed the output functions to write directly to a StringInfo, we

Re: Improve conditional compilation for direct I/O alignment checks

2024-05-26 Thread Peter Eisentraut
On 26.05.24 09:16, Junwang Zhao wrote: This patch refactors the alignment checks for direct I/O to preprocess phase, thereby reducing some CPU cycles. This patch replaces for example if (PG_O_DIRECT != 0 && PG_IO_ALIGN_SIZE <= BLCKSZ) Assert((uintptr_t) buffer ==

Re: DROP OWNED BY fails to clean out pg_init_privs grants

2024-05-26 Thread Daniel Gustafsson
> On 26 May 2024, at 23:25, Tom Lane wrote: > > Hannu Krosing writes: >> Attached is a minimal patch to allow missing roles in REVOKE command > > FTR, I think this is a very bad idea. Agreed, this is papering over a bug. If we are worried about pg_upgrade it would be better to add a check to

Re: DROP OWNED BY fails to clean out pg_init_privs grants

2024-05-26 Thread Tom Lane
Hannu Krosing writes: > Attached is a minimal patch to allow missing roles in REVOKE command FTR, I think this is a very bad idea. It might be OK if we added some kind of IF EXISTS option, but I'm not eager about that concept either. The right thing here is to fix the backend so that pg_dump

Re: DROP OWNED BY fails to clean out pg_init_privs grants

2024-05-26 Thread Hannu Krosing
Attached is a minimal patch to allow missing roles in REVOKE command This should fix the pg_upgrade issue and also a case where somebody has dropped a role you are trying to revoke privileges from : smalltest=# create table revoketest(); CREATE TABLE smalltest=# revoke select on revoketest from

Re: DISCARD ALL does not force re-planning of plpgsql functions/procedures

2024-05-26 Thread Jelte Fennema-Nio
On Sun, May 26, 2024, 12:26 Jelte Fennema-Nio wrote: > DISCARD PLANS should probably forget about it though indeed. > DISCARD PLANS should probably **not** forget about it > > Note that any change in behavior there would affect prepared > > statements in general, not only plpgsql. > > DISCARD

Re: DISCARD ALL does not force re-planning of plpgsql functions/procedures

2024-05-26 Thread Pavel Stehule
ne 26. 5. 2024 v 21:27 odesílatel Jelte Fennema-Nio napsal: > On Sun, 26 May 2024 at 19:39, Tom Lane wrote: > > Hm, should it be? That's hard-won knowledge, and I'm not sure there > > is a good reason to believe it's no longer applicable. > > I think for DISCARD ALL it would probably make

Re: DISCARD ALL does not force re-planning of plpgsql functions/procedures

2024-05-26 Thread Jelte Fennema-Nio
On Sun, 26 May 2024 at 19:39, Tom Lane wrote: > Hm, should it be? That's hard-won knowledge, and I'm not sure there > is a good reason to believe it's no longer applicable. I think for DISCARD ALL it would probably make sense to forget this knowledge . Since that is advertised as "reset the

Re: DISCARD ALL does not force re-planning of plpgsql functions/procedures

2024-05-26 Thread Tom Lane
Jelte Fennema-Nio writes: > I got a report on the PgBouncer repo[1] that running DISCARD ALL was > not sufficient between connection handoffs to force replanning of > stored procedures. Turns out that while DISCARD AL and DISCARD PLAN > reset the plan cache they do not reset the num_custom_plans

DISCARD ALL does not force re-planning of plpgsql functions/procedures

2024-05-26 Thread Jelte Fennema-Nio
I got a report on the PgBouncer repo[1] that running DISCARD ALL was not sufficient between connection handoffs to force replanning of stored procedures. Turns out that while DISCARD AL and DISCARD PLAN reset the plan cache they do not reset the num_custom_plans fields of the existing PlanSources.

Re: First draft of PG 17 release notes

2024-05-26 Thread Bruce Momjian
On Sun, May 26, 2024 at 10:10:00AM +0200, Álvaro Herrera wrote: > On 2024-May-25, Bruce Momjian wrote: > > > On Thu, May 23, 2024 at 01:22:51PM +0200, Álvaro Herrera wrote: > > > > Can we make them a single item? Maybe something like > > > > > > : Improve reset routines for shared statistics

Re: Improving tracking/processing of buildfarm test failures

2024-05-26 Thread Andrew Dunstan
On 2024-05-24 Fr 16:00, Noah Misch wrote: On Thu, May 23, 2024 at 02:00:00PM +0300, Alexander Lakhin wrote: I'd like to discuss ways to improve the buildfarm experience for anyone who are interested in using information which buildfarm gives to us. Unless I'm missing something, as of now

Re: Fix an incorrect assertion condition in mdwritev().

2024-05-26 Thread Michael Paquier
On Sun, May 26, 2024 at 12:08:46AM -0400, Tom Lane wrote: > After a few minutes' thought, how about: > > Assert((uint64) blocknum + (uint64) nblocks <= (uint64) mdnblocks(reln, > forknum)); LGTM. Yeah that should be OK this way. -- Michael signature.asc Description: PGP signature

Re: Improve conditional compilation for direct I/O alignment checks

2024-05-26 Thread Junwang Zhao
On Sun, May 26, 2024 at 3:16 PM Junwang Zhao wrote: > > This patch refactors the alignment checks for direct I/O to preprocess phase, > thereby reducing some CPU cycles. > > -- > Regards > Junwang Zhao Patch v2 with some additional minor polishment of the comments in `mdwriteback`. -- Regards

Re: First draft of PG 17 release notes

2024-05-26 Thread Alvaro Herrera
On 2024-May-25, Bruce Momjian wrote: > On Thu, May 23, 2024 at 01:22:51PM +0200, Álvaro Herrera wrote: > > Can we make them a single item? Maybe something like > > > > : Improve reset routines for shared statistics (Atsushi Torikoshi, Bharath > > Rupireddy) > > : > > : Resetting all shared

Improve conditional compilation for direct I/O alignment checks

2024-05-26 Thread Junwang Zhao
This patch refactors the alignment checks for direct I/O to preprocess phase, thereby reducing some CPU cycles. -- Regards Junwang Zhao 0001-Improve-conditional-compilation-for-direct-I-O-align.patch Description: Binary data