Re: type cache cleanup improvements

2024-08-25 Thread Andrei Lepikhov
On 25/8/2024 23:22, Alexander Korotkov wrote: On Sun, Aug 25, 2024 at 10:21 PM Alexander Korotkov (This Assert is introduced by c14d4acb8.) Thank you for noticing. I'm checking this. I didn't take into account that TypeCacheEntry could be invalidated while lookup_type_cache() does syscache

Re: Switch PgStat_HashKey.objoid from Oid to uint64

2024-08-25 Thread Heikki Linnakangas
On 26/08/2024 03:58, Michael Paquier wrote: An interesting thing is that I have seen ubsan complain about this patch, due to the way WAL records xl_xact_commit are built with XACT_XINFO_HAS_DROPPED_STATS and parsed as xl_xact_stats_item requires an 8-byte alignment now (see pg_waldump TAP reports

pg_upgrade: Support for upgrading to checksums enabled

2024-08-25 Thread Peter Eisentraut
I'm reposting this patch in a separate thread so I can make a separate commitfest entry for it. The previous discussion is mixed in with [0]. The purpose of this patch is to allow using pg_upgrade between clusters that have different checksum settings. When upgrading between instances with d

Re: Introduce XID age and inactive timeout based replication slot invalidation

2024-08-25 Thread Bharath Rupireddy
On Wed, Aug 14, 2024 at 9:20 AM Ajin Cherian wrote: > > Some minor comments on the patch: Thanks for reviewing. > 1. > + /* > + * Release the lock if it's not yet to keep the cleanup path on > + * error happy. > + */ > > I suggest rephrasing to: " "Release the lock if it hasn't been already to

Support POSITION with nondeterministic collations

2024-08-25 Thread Peter Eisentraut
This patch allows using text position search functions with nondeterministic collations. These functions are - position, strpos - replace - split_part - string_to_array - string_to_table which all use common internal infrastructure. (This complements the patch "Support LIKE with nondeterminis

Re: macOS prefetching support

2024-08-25 Thread Thomas Munro
On Sat, Aug 24, 2024 at 12:28 AM Peter Eisentraut wrote: > In terms of $subject, this patch seems sufficient for now. WFM. I noticed you don't have an EINTR retry loop, but the man page doesn't say you need one, so overall this patch LGTM. + * posix_fadvise() is the simplest standardized interf

Re: Introduce new multi insert Table AM and improve performance of various SQL commands with it for Heap AM

2024-08-25 Thread Bharath Rupireddy
On Wed, Jun 5, 2024 at 12:42 PM Bharath Rupireddy wrote: > > Please find the v22 patches with the above changes. Please find the v23 patches after rebasing 0005 and adapting 0004 for 9758174e2e. -- Bharath Rupireddy PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: http

maybe buggy implementation of NO INDENT in xmlserialize

2024-08-25 Thread Pavel Stehule
Hi I checked our implementation of xmlserialize, and it looks like there are few issues. 1. It doesn't conform to SQL/XML - there is some overlap with the proposed CANONICAL flag, but not full. 2. There is significantly different behaviour of NO INDENT on Oracle and other db, that implements it.

Re: Flush pgstats file during checkpoints

2024-08-25 Thread Michael Paquier
On Fri, Aug 02, 2024 at 02:11:34AM +0900, Michael Paquier wrote: > Applied 0003 for now to add the redo LSN to the pgstats file, adding > the redo LSN to the two DEBUG2 entries when reading and writing while > on it, that I forgot. (It was not 01:57 where I am now.) > > Attached is the last one.

Re: Conflict Detection and Resolution

2024-08-25 Thread Nisha Moond
On Thu, Aug 22, 2024 at 3:45 PM shveta malik wrote: > > On Wed, Aug 21, 2024 at 4:08 PM Nisha Moond wrote: > > > > The patches have been rebased on the latest pgHead following the merge > > of the conflict detection patch [1]. > > Thanks for working on patches. > > Summarizing the issues which ne

Re: Fix memory counter update in reorderbuffer

2024-08-25 Thread Amit Kapila
On Fri, Aug 23, 2024 at 3:44 PM Masahiko Sawada wrote: > > On Tue, Aug 20, 2024 at 9:29 PM Amit Kapila wrote: > > > > I've updated the updated patch with regression tests. > LGTM. -- With Regards, Amit Kapila.

Re: Conflict Detection and Resolution

2024-08-25 Thread shveta malik
On Mon, Aug 26, 2024 at 7:28 AM Peter Smith wrote: > > On Thu, Aug 22, 2024 at 8:15 PM shveta malik wrote: > > > > On Wed, Aug 21, 2024 at 4:08 PM Nisha Moond > > wrote: > > > > > > The patches have been rebased on the latest pgHead following the merge > > > of the conflict detection patch [1].

Re: configure failures on chipmunk

2024-08-25 Thread Alexander Lakhin
Hello Heikki, 21.08.2024 09:29, Heikki Linnakangas wrote: Yeah, I've been slowly upgrading it to a new debian/raspbian version, and "ccache" started segfaulting, not sure why. I compiled ccache from sources, and now it seems to work when I run it on its own. Not sure why the buildfarm run still

Re: Conflict Detection and Resolution

2024-08-25 Thread shveta malik
On Wed, Aug 21, 2024 at 4:08 PM Nisha Moond wrote: > > The patches have been rebased on the latest pgHead following the merge > of the conflict detection patch [1]. The detect_conflict option has > been removed, and conflict detection is now enabled by default. This > change required the following

Re: Set query_id for query contained in utility statement

2024-08-25 Thread jian he
On Mon, Aug 5, 2024 at 3:19 PM Anthonin Bonnefoy wrote: > > I've realised my initial approach was wrong, calling the post parse > for all nested queries in analyze.c prevents extension like pgss to > correctly track the query's nesting level. > > I've changed the approach to replicate what's done

how to log into commitfest.postgresql.org and begin review patch

2024-08-25 Thread 王春桂
hello,all, I am a newcomer who recently joined the PostgreSQL community. I logged into the community using my GitHub account and wanted to start familiarizing myself with community work by reviewing patches. However, I am currently facing an issue. When I log into commitfest.postgresql.org, I en

Re: POC, WIP: OR-clause support for indexes

2024-08-25 Thread jian he
On Fri, Aug 23, 2024 at 8:58 PM Alexander Korotkov wrote: > based on v37. + { + /* + * We have only Const's. In this case we can construct an array + * directly. + */ + int16 typlen; + bool typbyval; + char typalign; + Datum *elems; + int i = 0; + ArrayType *arrayConst; + + get_typlenbyvalal

Re: Segfault in jit tuple deforming on arm64 due to LLVM issue

2024-08-25 Thread Thomas Munro
On Sat, Aug 24, 2024 at 12:22 AM Anthonin Bonnefoy wrote: > On Thu, Aug 22, 2024 at 12:33 PM Thomas Munro wrote: > > I fear that back-porting, for the LLVM project, would mean "we fix it > > in main/20.x, and also back-port it to 19.x". Do distros back-port > > further? > > That's also my fear,

Removing log_cnt from pg_sequence_read_tuple()

2024-08-25 Thread Michael Paquier
Hi all, (Nathan in CC regarding c8b06bb969bf) While rebasing my patch set for sequence AMs, I've looked at what has been done with c8b06bb969bf and pg_sequence_read_tuple() because I can reuse it in the sequence AM patch to grab the last value of a sequence and if it has been called (the patch set

Re: Conflict Detection and Resolution

2024-08-25 Thread Peter Smith
On Thu, Aug 22, 2024 at 8:15 PM shveta malik wrote: > > On Wed, Aug 21, 2024 at 4:08 PM Nisha Moond wrote: > > > > The patches have been rebased on the latest pgHead following the merge > > of the conflict detection patch [1]. > > Thanks for working on patches. > > Summarizing the issues which ne

Switch PgStat_HashKey.objoid from Oid to uint64

2024-08-25 Thread Michael Paquier
Hi all, While working more on the cumulative pgstats and its interactions with pg_stat_statements, one thing that I have been annoyed with is that the dshash key for variable-numbered stats uses a pair of (Oid dboid, Oid objoid), mostly to stick with the fact that most of the stats are dealing wit

Re: Change COPY ... ON_ERROR ignore to ON_ERROR ignore_row

2024-08-25 Thread jian he
hi all. patch updated. simplified the code a lot. idea is same: COPY t_on_error_null FROM STDIN WITH (on_error set_to_null); If the STDIN number of columns is the same as the target table, then InputFunctionCallSafe call failure will make that column values be null. If the STDIN number of colum

Re: Interrupts vs signals

2024-08-25 Thread Thomas Munro
On Sun, Aug 25, 2024 at 5:17 AM Heikki Linnakangas wrote: > On 07/08/2024 17:59, Heikki Linnakangas wrote: > > I'm also wondering about the relationship between interrupts and > > latches. Currently, SendInterrupt sets a latch to wake up the target > > process. I wonder if it should be the other w

Re: type cache cleanup improvements

2024-08-25 Thread Alexander Korotkov
On Sun, Aug 25, 2024 at 10:21 PM Alexander Korotkov wrote: > On Sun, Aug 25, 2024 at 10:00 PM Alexander Lakhin wrote: > > 22.08.2024 19:52, Alexander Korotkov wrotd: > > > If no objections, I'm planning to push this after reverting PARTITION > > > SPLIT/MERGE. > > > > > > > Please try to perform

Re: [PATCH] Add CANONICAL option to xmlserialize

2024-08-25 Thread Pavel Stehule
ne 25. 8. 2024 v 20:57 odesílatel Pavel Stehule napsal: > Hi > > so 24. 8. 2024 v 7:40 odesílatel Jim Jones > napsal: > >> >> On 19.06.24 10:59, Jim Jones wrote: >> > On 09.02.24 14:19, Jim Jones wrote: >> >> v9 attached with rebase due to changes done to primnodes.h in 615f5f6 >> >> >> > v10 at

Re: type cache cleanup improvements

2024-08-25 Thread Alexander Korotkov
On Sun, Aug 25, 2024 at 10:00 PM Alexander Lakhin wrote: > 22.08.2024 19:52, Alexander Korotkov wrotd: > > If no objections, I'm planning to push this after reverting PARTITION > > SPLIT/MERGE. > > > > Please try to perform `make check` against a CLOBBER_CACHE_ALWAYS build. > trilobite failed it:

Re: type cache cleanup improvements

2024-08-25 Thread Alexander Lakhin
Hello Alexander, 22.08.2024 19:52, Alexander Korotkov wrotd: If no objections, I'm planning to push this after reverting PARTITION SPLIT/MERGE. Please try to perform `make check` against a CLOBBER_CACHE_ALWAYS build. trilobite failed it: https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm

Re: [PATCH] Add CANONICAL option to xmlserialize

2024-08-25 Thread Pavel Stehule
Hi so 24. 8. 2024 v 7:40 odesílatel Jim Jones napsal: > > On 19.06.24 10:59, Jim Jones wrote: > > On 09.02.24 14:19, Jim Jones wrote: > >> v9 attached with rebase due to changes done to primnodes.h in 615f5f6 > >> > > v10 attached with rebase due to changes in primnodes, parsenodes.h, and > > gr

Re: Non-trivial condition is only propagated to one side of JOIN

2024-08-25 Thread Tom Lane
Tobias Hoffmann writes: > A more complete example might look more like this: > CREATE VIEW "subview1" AS >   SELECT tbl1.site_id, ... JOIN ... ON tbl1.site_id = tbl2.site_id > WHERE ...; > CREATE VIEW "view1" AS >   SELECT site_id, ... FROM subview1  -- maybe even: WHERE site_id IS > NOT NUL

Re: Better error message when --single is not the first arg to postgres executable

2024-08-25 Thread Greg Sabino Mullane
I'm not opposed to this new method, as long as the error code improves. :) +typedef enum Subprogram +{ + SUBPROGRAM_CHECK, + SUBPROGRAM_BOOT, +#ifdef EXEC_BACKEND + SUBPROGRAM_FORKCHILD, +#endif I'm not happy about making this and the const char[] change their structure based on the ifdefs - coul

Re: Non-trivial condition is only propagated to one side of JOIN

2024-08-25 Thread Tobias Hoffmann
On 25/08/2024 17:35, David G. Johnston wrote: On Sunday, August 25, 2024, Tobias Hoffmann wrote: 3) Problematic example: # EXPLAIN SELECT * FROM tbl1 JOIN tbl2 ON tbl2.site_id = tbl1.site_id WHERE tbl1.site_id = 1 OR tbl1.site_id IS NULL; The “is null” predicate in this query

Re: Non-trivial condition is only propagated to one side of JOIN

2024-08-25 Thread Tom Lane
"David G. Johnston" writes: > On Sunday, August 25, 2024, Tobias Hoffmann > wrote: >> 3) Problematic example: >> >> # EXPLAIN SELECT * FROM tbl1 JOIN tbl2 ON tbl2.site_id = tbl1.site_id >> WHERE tbl1.site_id = 1 OR tbl1.site_id IS NULL; > The “is null” predicate in this query is doing nothing a

Re: Vacuum statistics

2024-08-25 Thread Alena Rybakina
On 22.08.2024 07:29, Kirill Reshke wrote: On Thu, 22 Aug 2024 at 07:48, jian he wrote: On Wed, Aug 21, 2024 at 6:37 AM Alena Rybakina wrote: We check it there: "tabentry->vacuum_ext.type != type". Or were you talking about something else? On 19.08.2024 12:32, jian he wrote: in pg_stats_va

Re: Vacuum statistics

2024-08-25 Thread Alena Rybakina
On 22.08.2024 05:47, jian he wrote: On Wed, Aug 21, 2024 at 6:37 AM Alena Rybakina wrote: We check it there: "tabentry->vacuum_ext.type != type". Or were you talking about something else? On 19.08.2024 12:32, jian he wrote: in pg_stats_vacuum if (type == PGSTAT_EXTVAC_INDEX || type ==

Re: Non-trivial condition is only propagated to one side of JOIN

2024-08-25 Thread David G. Johnston
On Sunday, August 25, 2024, Tobias Hoffmann wrote: > > 3) Problematic example: > > # EXPLAIN SELECT * FROM tbl1 JOIN tbl2 ON tbl2.site_id = tbl1.site_id > WHERE tbl1.site_id = 1 OR tbl1.site_id IS NULL; The “is null” predicate in this query is doing nothing as your next comment alludes to; you

Non-trivial condition is only propagated to one side of JOIN

2024-08-25 Thread Tobias Hoffmann
Hi, using `PostgreSQL 16.2 (Debian 16.2-1.pgdg120+2) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit`, I've observed the following behavior: – keep in mind that this example is as simplified as possible, the original query involves foreign tables, and the failure to

Re: POC, WIP: OR-clause support for indexes

2024-08-25 Thread Andrei Lepikhov
On 23/8/2024 14:58, Alexander Korotkov wrote: On Fri, Aug 23, 2024 at 1:23 PM Andrei Lepikhov wrote: The last query doesn't group clauses into two indexes. The reason is in match_index_to_operand which classifies all 'x=' to one class. I'm not sure because of overhead, but it may be resolved by

Re: Optimising numeric division

2024-08-25 Thread Joel Jacobson
On Sat, Aug 24, 2024, at 14:10, Dean Rasheed wrote: > On Sat, 24 Aug 2024 at 08:26, Joel Jacobson wrote: >> >> On Sat, Aug 24, 2024, at 01:35, Joel Jacobson wrote: >> > On Sat, Aug 24, 2024, at 00:00, Joel Jacobson wrote: >> >> Since statistical tools that rely on normal distributions can't be use