Re: Assertion failure when autovacuum drops orphan temp indexes.

2024-10-26 Thread Masahiko Sawada
On Sat, Oct 26, 2024 at 12:13 PM Stepan Neretin wrote: > > > IMHO the best way to handle this is to just unconditionally push a snapshot > > in this code path instead of making assumptions about what callers will do. +1 > > Yes, I agree! I have found the same solution. I attempted to write Perl

Re: heap_inplace_lock vs. autovacuum w/ LOCKTAG_TUPLE

2024-10-26 Thread Alexander Lakhin
Hello Noah, 27.10.2024 07:09, Noah Misch wrote: On Sat, Oct 26, 2024 at 11:49:36AM -0700, Noah Misch wrote: intra-grant-inplace-db.spec got a novel failure today: https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=sarus&dt=2024-10-26%2014%3A08%3A58 The isolationtester_waiting query is sup

Re: heap_inplace_lock vs. autovacuum w/ LOCKTAG_TUPLE

2024-10-26 Thread Noah Misch
On Sat, Oct 26, 2024 at 11:49:36AM -0700, Noah Misch wrote: > intra-grant-inplace-db.spec got a novel failure today: > https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=sarus&dt=2024-10-26%2014%3A08%3A58 > > The isolationtester_waiting query is supposed to detect that step vac2 is > blocked.

Re: -Wformat-signedness

2024-10-26 Thread Andy Fan
Peter Eisentraut writes: Hi, > On 2020-10-29 22:37, Thomas Munro wrote: >> There're probably mostly harmless, being mostly error and debug >> messages and the like, and considering that eg OID parsing tolerates >> negative numbers when reading them back in, but for what it's worth: >> GCC compla

Re: New function normal_rand_array function to contrib/tablefunc.

2024-10-26 Thread Andy Fan
Dean Rasheed writes: > On Sat, 26 Oct 2024 at 01:51, Andy Fan wrote: >> >> > 10). In this error: >> > >> > +elog(ERROR, "unsupported type %d for rand_array function.", >> > + datatype); >> > >> > "datatype" is of type Oid, which is unsigned, and so it should use >> > "%u" not

Re: [BUG] Fix DETACH with FK pointing to a partitioned table fails

2024-10-26 Thread Alvaro Herrera
On 2024-Oct-25, Alvaro Herrera wrote: > On 2024-Oct-25, Tender Wang wrote: > > > Thanks for reporting. I can reproduce this memory invalid access on HEAD. > > After debuging codes, I found the root cause. > > In DetachPartitionFinalize(), below code: > > att = TupleDescAttr(RelationGetDescr(part

Re: Fix C23 compiler warning

2024-10-26 Thread Tom Lane
Alvaro Herrera writes: > Ah, yeah. That was 2.71 actually: > https://postgr.es/m/3838336.1657985...@sss.pgh.pa.us > 1.72 seems to have been released with some fixes from that one. Per > that thread, the related problem you noticed was with m4, and apparently > it was because macOS ships a version

Re: [BUG] Fix DETACH with FK pointing to a partitioned table fails

2024-10-26 Thread Alvaro Herrera
On 2024-Oct-25, Tender Wang wrote: > When I debug codes, I find that the way to access AttrMap almost uses > "attrmp_ptr->attnums[offset]." > The codes now usually don't check if the offset is out of bounds, which > seems unsafe. > Can we wrap an access function? For example: > inline AttrNumber(a

Re: Fix C23 compiler warning

2024-10-26 Thread Alvaro Herrera
On 2024-Oct-25, Tom Lane wrote: > As I recall, we looked at adopting it some years ago and decided it > was too much churn for the value (seeing that the long-term plan is > to go to meson only). Maybe C23 is a reason to rethink, but from > what I recall of that, it won't be a painless update. A

Re: Enhancing Memory Context Statistics Reporting

2024-10-26 Thread Alvaro Herrera
On 2024-Oct-21, Rahila Syed wrote: > I propose enhancing memory context statistics reporting by combining > these capabilities and offering a view of memory statistics for all > PostgreSQL backends and auxiliary processes. Sounds good. > A fixed-size shared memory block, currently accommodating

Re: Assertion failure when autovacuum drops orphan temp indexes.

2024-10-26 Thread Stepan Neretin
> IMHO the best way to handle this is to just unconditionally push a snapshot > in this code path instead of making assumptions about what callers will do. Yes, I agree! I have found the same solution. I attempted to write Perl tests to verify the patch fix, but the autovacuum process is not trigg

make all ereport in gram.y print out relative location

2024-10-26 Thread jian he
hi. it would be better to make all ereport in gram.y print out the relative location. one benefit is quickly locating the error. in insertSelectOptions, some ereport won't call parser_errposition. To handle that I added a location to struct SelectLimit, so we can catch the location in the LIMIT/FE

heap_inplace_lock vs. autovacuum w/ LOCKTAG_TUPLE

2024-10-26 Thread Noah Misch
intra-grant-inplace-db.spec got a novel failure today: https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=sarus&dt=2024-10-26%2014%3A08%3A58 The isolationtester_waiting query is supposed to detect that step vac2 is blocked. vac2 didn't finish within the timeout, but isolationtester_waiting n

Re: Replace current implementations in crypt() and gen_salt() to OpenSSL

2024-10-26 Thread Joe Conway
On 20 Feb 2024, at 13:40, Peter Eisentraut wrote: On 20.02.24 12:39, Daniel Gustafsson wrote: A fifth option is to throw away our in-tree implementations and use the OpenSSL API's for everything, which is where this thread started. If the effort to payoff ratio is palatable to anyone then patch

Re: sunsetting md5 password support

2024-10-26 Thread Nathan Bossart
rebased -- nathan >From 0f867b4b560c83f33b448df5a9b20a6d61ba2611 Mon Sep 17 00:00:00 2001 From: Nathan Bossart Date: Fri, 11 Oct 2024 16:21:09 -0500 Subject: [PATCH v3 1/1] Deprecate MD5 passwords. MD5 has been considered to be unsuitable for use as a cryptographic hash algorithm for some time.

Re: UUID v7

2024-10-26 Thread Andrey M . Borodin
Thanks for the review! > On 18 Oct 2024, at 02:16, Masahiko Sawada wrote: > > On Sun, Aug 4, 2024 at 3:51 AM Andrey M. Borodin wrote: >> >> >> >>> On 28 Jul 2024, at 23:44, Andrey M. Borodin wrote: >>> >>> PFA version accepting offset interval. >> >> There was a bug: when time was not mov

Re: Assertion failure when autovacuum drops orphan temp indexes.

2024-10-26 Thread Nathan Bossart
On Sat, Oct 26, 2024 at 12:43:44AM -0700, Masahiko Sawada wrote: > I got the following assertion failure from an autovaucum worker: > > 2024-10-26 00:32:03.685 PDT [830672] LOG: autovacuum: dropping orphan > temp table "postgres.pg_temp_0.hoge" > TRAP: failed Assert("HaveRegisteredOrActiveSnapsho

Re: Enhancing Memory Context Statistics Reporting

2024-10-26 Thread Nitin Jadhav
Hi Rahila, I’ve spent some time reviewing the patch, and the review is still ongoing. Here are the comments I’ve found so far. 1. The tests are currently missing. Could you please add them? 2. I have some concerns regarding the function name ‘pg_get_remote_backend_memory_contexts’. Specifically,

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

2024-10-26 Thread Bharath Rupireddy
Hi, Thanks for looking into this. On Thu, Aug 29, 2024 at 12:29 PM Jeff Davis wrote: > > I believe we need the branching in the caller anyway: > > 1. If there is a BEFORE row trigger with a volatile function, the > visibility rules[1] mean that the function should see changes from all > the rows

Re: Can rs_cindex be < 0 for bitmap heap scans?

2024-10-26 Thread Melanie Plageman
On Sat, Oct 26, 2024 at 12:17 AM Dilip Kumar wrote: > > On Fri, Oct 25, 2024 at 10:07 PM Melanie Plageman > wrote: >> >> On Fri, Oct 25, 2024 at 10:29 AM Melanie Plageman >> wrote: >> > >> > Tom suggested off-list that if rs_cindex can't be zero, then it should >> > be unsigned. I checked the o

Re: New function normal_rand_array function to contrib/tablefunc.

2024-10-26 Thread Dean Rasheed
On Sat, 26 Oct 2024 at 01:51, Andy Fan wrote: > > > 10). In this error: > > > > +elog(ERROR, "unsupported type %d for rand_array function.", > > + datatype); > > > > "datatype" is of type Oid, which is unsigned, and so it should use > > "%u" not "%d". Also, as above, it should

Re: [PATCH] Add sortsupport for range types and btree_gist

2024-10-26 Thread Andrey M. Borodin
> On 25 Oct 2024, at 19:41, Bernd Helmle wrote: > > So this is a new rebased version of the patches including regression > tests with default (sortsupport) and buffering behavior. I split up the > tests for buffering vs. non-buffering but kept them basically the same > for testing the index bu

Assertion failure when autovacuum drops orphan temp indexes.

2024-10-26 Thread Masahiko Sawada
Hi, I got the following assertion failure from an autovaucum worker: 2024-10-26 00:32:03.685 PDT [830672] LOG: autovacuum: dropping orphan temp table "postgres.pg_temp_0.hoge" TRAP: failed Assert("HaveRegisteredOrActiveSnapshot()"), File: "index.c", Line: 2345, PID: 830672 Here is the stack tra

Re: proposal: plpgsql, new check for extra_errors - strict_expr_check

2024-10-26 Thread Pavel Stehule
Hi fresh rebase Regards Pavel From 0a1e5a4de6d45e2b4e0f047d4aa9dab5ddeb6b2d Mon Sep 17 00:00:00 2001 From: "ok...@github.com" Date: Sun, 16 Jun 2024 08:13:53 +0200 Subject: [PATCH 2/3] simply check of strict-expr-check on regress test This patch enable strict-expr-check by default to be possib