Re: Accept invalidation messages before the query starts inside a transaction

2024-09-11 Thread David G. Johnston
On Wednesday, September 11, 2024, Andrei Lepikhov wrote: > > > I don't know whether to classify this as a bug. > > [1] https://www.postgresql.org/docs/16/mvcc-caveats.html > > Seems we need to add another sentence to that final paragraph. Something like: However, once an object is accessed withi

Re: Avoid dead code (contrib/pg_visibility/pg_visibility.c)

2024-09-11 Thread Nazir Bilal Yavuz
Hi, On Thu, 12 Sept 2024 at 08:19, Michael Paquier wrote: > > On Wed, Sep 04, 2024 at 01:50:24PM -0300, Ranier Vilela wrote: > > I think that commit c582b75 > > , > > left an oversight. > > > > The report is: >

Re: Separate HEAP WAL replay logic into its own file

2024-09-11 Thread Michael Paquier
On Thu, Sep 12, 2024 at 08:12:30AM +0900, Michael Paquier wrote: > It looks like my mind was wondering away when I wrote this part. > Sorry for the useless noise. I was looking at all that, and this is only moving code around. While the part for heap_xlog_logical_rewrite in rewriteheap.c is a bit

Re: Pgoutput not capturing the generated columns

2024-09-11 Thread Peter Smith
Because this feature is now being implemented as a PUBLICATION option, there is another scenario that might need consideration; I am thinking about where the same table is published by multiple PUBLICATIONS (with different option settings) that are subscribed by a single SUBSCRIPTION. e.g.1 -

Re: Allow CI to only run the compiler warnings task

2024-09-11 Thread Bertrand Drouvot
Hi, On Wed, Sep 11, 2024 at 04:39:57PM +0300, Nazir Bilal Yavuz wrote: > Hi, > > On Wed, 11 Sept 2024 at 15:36, Bertrand Drouvot > wrote: > > > > Hi hackers, > > > > While working on a new pg_logicalinspect module ([1]), I reached a point > > where > > all the CI tests were green except the com

Re: Avoid dead code (contrib/pg_visibility/pg_visibility.c)

2024-09-11 Thread Michael Paquier
On Wed, Sep 04, 2024 at 01:50:24PM -0300, Ranier Vilela wrote: > I think that commit c582b75 > , > left an oversight. > > The report is: > CID 1559993: (#1 of 1): Logically dead code (DEADCODE) > > Trivial patch

Re: Add memory/disk usage for WindowAgg nodes in EXPLAIN

2024-09-11 Thread Tatsuo Ishii
> I pushed a patch to change the API. Thank you! -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp

Re: Add memory/disk usage for WindowAgg nodes in EXPLAIN

2024-09-11 Thread David Rowley
On Thu, 12 Sept 2024 at 14:42, Tatsuo Ishii wrote: > Sorry, I should have asked you first if you are going to write the API > change patch. I pushed a patch to change the API. David

Re: Accept invalidation messages before the query starts inside a transaction

2024-09-11 Thread Andrey M. Borodin
> On 12 Sep 2024, at 00:50, Andrei Lepikhov wrote: > > It happens because of documented behaviour [1], which doesn't guarantee > isolation levels for internal access to the system catalogues. As far as I understood you are proposing not isolation guaranties, but allowed isolation anomaly.

Re: query_id, pg_stat_activity, extended query protocol

2024-09-11 Thread Michael Paquier
On Wed, Sep 11, 2024 at 09:41:58PM -0500, Sami Imseih wrote: >> The tests in pg_stat_statements are one part I'm pretty sure is one >> good way forward. It is not perfect, but with the psql meta-commands > > I played around with BackgrounsPsql. It works and gives us more flexibility > in testing,

Re: Extract numeric filed in JSONB more effectively

2024-09-11 Thread Andy Fan
Hello David, Thanks for checking this! > There's a lot of complexity in the v18 patch that I don't understand > the need for. > > I imagined you'd the patch should create a SupportRequestSimplify > support function for jsonb_numeric() that checks if the input > expression is an OpExpr with

Re: Add memory/disk usage for WindowAgg nodes in EXPLAIN

2024-09-11 Thread Tatsuo Ishii
> On Thu, 12 Sept 2024 at 14:04, Tatsuo Ishii wrote: >> Are you going to push the changes to tuplestore.c anytime soon? I >> would like to rebase my patch[1] but the patch could be affected by >> the tuplestore API change. > > Ok, I'll look at that. Thanks. I had thought you were taking care of

Re: query_id, pg_stat_activity, extended query protocol

2024-09-11 Thread Sami Imseih
> After sleeping on it, I'd tend to slightly favor the last option in > the back-branches and the second option on HEAD where we reduce the > number of report calls. This way, we are a bit more careful in >released branches by being more aggressive in reporting the query ID. I agree with this beca

Re: Trim the heap free memory

2024-09-11 Thread shawn wang
Hi Rafia, I have made the necessary adjustment by replacing the inclusion of malloc.h with stdlib.h in the relevant codebase. This change should address the previous concerns regarding memory allocation functions. Could you please perform another round of testing to ensure that everything is func

Re: Add RESPECT/IGNORE NULLS and FROM FIRST/LAST options

2024-09-11 Thread Tatsuo Ishii
> On Wednesday, September 11, 2024, Tatsuo Ishii wrote: > >> >> test=# SELECT row_number() IGNORE NULLS OVER w FROM t1 WINDOW w AS (ORDER >> BY i); >> row_number >> >> 1 >> 2 >> (2 rows) >> >> The t1 table only contains NULL rows. By using IGNORE NULLS, I think >

Re: Inconsistency in lock structure after reporting "lock already held" error

2024-09-11 Thread 高增琦
The attached patch attempts to fix this. 高增琦 于2024年9月11日周三 14:30写道: > At the end of SetupLockInTable(), there is a check for the "lock already > held" error. > Because the nRequested and requested[lockmode] value of a lock is bumped > before "lock already held" error, and there is no way to redu

Re: Add memory/disk usage for WindowAgg nodes in EXPLAIN

2024-09-11 Thread David Rowley
On Thu, 12 Sept 2024 at 14:04, Tatsuo Ishii wrote: > Are you going to push the changes to tuplestore.c anytime soon? I > would like to rebase my patch[1] but the patch could be affected by > the tuplestore API change. Ok, I'll look at that. I had thought you were taking care of writing the patch.

Re: Remove shadowed declaration warnings

2024-09-11 Thread David Rowley
On Thu, 12 Sept 2024 at 14:03, Tom Lane wrote: > I do grant that sometimes shadowing of locals can cause bugs. I don't > recall right now why we opted for -Wshadow=compatible-local over > -Wshadow=local, but we could certainly take another look at that. I don't recall if it was discussed, but ce

Re: json_query conditional wrapper bug

2024-09-11 Thread Amit Langote
On Wed, Sep 11, 2024 at 8:56 PM Peter Eisentraut wrote: > On 11.09.24 13:25, Amit Langote wrote: > > On Wed, Sep 11, 2024 at 6:57 PM Peter Eisentraut > > wrote: > >> On 11.09.24 09:51, Amit Langote wrote: > > I've updated your patch to include updated test outputs and a nearby > > code c

Re: Pgstattuple on Sequences: Seeking Community Feedback on Potential Patch

2024-09-11 Thread Michael Paquier
On Wed, Sep 11, 2024 at 11:02:43PM +0100, Matthias van de Meent wrote: > On Wed, 11 Sept 2024 at 21:36, Nathan Bossart > wrote: > > > > Barring objections, I'm planning to commit v3 soon. Robert/Matthias, I'm > > not sure you are convinced this is the right thing to do (or worth doing, > > rathe

Re: Add RESPECT/IGNORE NULLS and FROM FIRST/LAST options

2024-09-11 Thread David G. Johnston
On Wednesday, September 11, 2024, Tatsuo Ishii wrote: > > test=# SELECT row_number() IGNORE NULLS OVER w FROM t1 WINDOW w AS (ORDER > BY i); > row_number > > 1 > 2 > (2 rows) > > The t1 table only contains NULL rows. By using IGNORE NULLS, I think > it's no wonde

Re: Opinion poll: Sending an automated email to a thread when it gets added to the commitfest

2024-09-11 Thread David Rowley
On Thu, 15 Aug 2024 at 20:00, Jelte Fennema-Nio wrote: > > On Thu, 15 Aug 2024 at 05:17, Euler Taveira wrote: > > If I understand your proposal correctly, there will be another email to the > > thread if the previous CF was closed and someone opened a new CF entry. > > Sometimes some CF entries a

Re: Add memory/disk usage for WindowAgg nodes in EXPLAIN

2024-09-11 Thread Tatsuo Ishii
> On Fri, 6 Sept 2024 at 19:08, Ashutosh Bapat > wrote: >> The changes look better. A nitpick though. With their definitions >> changed, I think it's better to change the names of the functions >> since their purpose has changed. Right now they report the storage >> type and size used, respectivel

Re: Remove shadowed declaration warnings

2024-09-11 Thread Tom Lane
David Rowley writes: > On Thu, 12 Sept 2024 at 12:33, Peter Smith wrote: >> I normally build the code with warnings enabled (specifically, >> -Wshadow) which exposes many "shadowed" declarations. > 0fe954c28 did add -Wshadow=compatible-local to the standard set of > complication flags. I felt i

Re: Remove useless GROUP BY columns considering unique index

2024-09-11 Thread David Rowley
On Sat, 30 Dec 2023 at 04:05, Zhang Mingli wrote: > So my patch make it easy: check unique index’s columns, it’s a valid > candidate if all of that have NOT NULL constraint. > And we choose a best one who has the least column numbers in > get_min_unique_not_null_attnos(), as the reason: less col

Re: Add RESPECT/IGNORE NULLS and FROM FIRST/LAST options

2024-09-11 Thread Tatsuo Ishii
>> >> On Sat, 6 May 2023, 04:57 Tatsuo Ishii, wrote: >> >>> >> >>> Attached is the patch to implement this (on top of your patch). >> >>> >> >>> test=# SELECT row_number() RESPECT NULLS OVER () FROM (SELECT 1) AS s; >> >>> ERROR: window function row_number cannot have RESPECT NULLS or IGNORE >>

Re: CI, macports, darwin version problems

2024-09-11 Thread Thomas Munro
On Tue, Sep 10, 2024 at 3:04 PM Thomas Munro wrote: > On Mon, Sep 9, 2024 at 1:37 PM Joe Conway wrote: > > Seems the mounted drive got unmounted somehow ¯\_(ツ)_/¯ > > > > Please check it out and let me know if it is working properly now. > > Looks good, thanks! ... but it's broken again.

Re: Incremental Sort Cost Estimation Instability

2024-09-11 Thread David Rowley
On Thu, 27 Jun 2024 at 03:00, Andrei Lepikhov wrote: > I tried to invent a simple solution to fight this minor case. But the > most clear and straightforward way here is to save a reference to the > expression that triggered the PathKey creation inside the PathKey itself. > See the sketch of the p

Re: Remove shadowed declaration warnings

2024-09-11 Thread David Rowley
On Thu, 12 Sept 2024 at 12:33, Peter Smith wrote: > I normally build the code with warnings enabled (specifically, > -Wshadow) which exposes many "shadowed" declarations. > > It would be better to reduce warnings wherever it's easy to do so, > because if we always see/ignore lots of warnings then

Remove shadowed declaration warnings

2024-09-11 Thread Peter Smith
Hi, I normally build the code with warnings enabled (specifically, -Wshadow) which exposes many "shadowed" declarations. It would be better to reduce warnings wherever it's easy to do so, because if we always see/ignore lots of warnings then sooner or later something important may escape attentio

Re: Add 64-bit XIDs into PostgreSQL 15

2024-09-11 Thread Michael Paquier
On Thu, Jul 25, 2024 at 02:09:10PM +0300, Heikki Linnakangas wrote: > On 25/07/2024 13:19, Peter Eisentraut wrote: >> Conversely, if there is still some threshold (not disaster, but >> efficiency or something else), would it still be useful to keep these >> settings well below 2^31?  In which case,

Re: [PATCH] Refactor SLRU to always use long file names

2024-09-11 Thread Michael Paquier
On Wed, Sep 11, 2024 at 04:07:06PM +0300, Aleksander Alekseev wrote: > Commit 4ed8f0913bfd introduced long SLRU file names. The proposed > patch removes SlruCtl->long_segment_names flag and makes SLRU always > use long file names. This simplifies both the code and the API. > Corresponding changes t

Re: [PATCH] pg_stat_activity: make slow/hanging authentication more visible

2024-09-11 Thread Michael Paquier
On Wed, Sep 11, 2024 at 02:29:49PM -0700, Jacob Champion wrote: > On Mon, Sep 9, 2024 at 10:30 PM Michael Paquier wrote: >> No. My question was about splitting pgstat_bestart() and >> pgstat_bestart_pre_auth() in a cleaner way, because authenticated >> connections finish by calling both, meaning

Re: Separate HEAP WAL replay logic into its own file

2024-09-11 Thread Michael Paquier
On Wed, Sep 11, 2024 at 04:41:49PM +0900, Michael Paquier wrote: > +#include "access/heapam_xlog.h" > > This is included in heapam.h, but missing from the patch. I guess > that you fat-fingered a `git add`. It looks like my mind was wondering away when I wrote this part. Sorry for the useless no

Re: query_id, pg_stat_activity, extended query protocol

2024-09-11 Thread Michael Paquier
On Wed, Sep 11, 2024 at 05:02:07PM -0500, Sami Imseih wrote: > In your 0003-Report-query-ID-for-execute-fetch-in-extended-query-.patch > patch, you are still setting the queryId inside exec_execute_message > if (execute_is_fetch). This condition could be removed and don't need to set > the query

Re: libpq: Process buffered SSL read bytes to support records >8kB on async API

2024-09-11 Thread Jacob Champion
On Wed, Sep 11, 2024 at 12:08 PM Lars Kanis wrote: > How did you verify the issue on the server side - with YugabyteDB or > with a modified Postgres server? I'd like to verify the GSSAPI part and > I'm familiar with the Postgres server only. Neither, unfortunately -- I have a protocol testbed tha

Re: [PoC] Federated Authn/z with OAUTHBEARER

2024-09-11 Thread Jacob Champion
(Thanks for the commit, Peter!) On Wed, Sep 11, 2024 at 6:44 AM Daniel Gustafsson wrote: > > > On 11 Sep 2024, at 09:37, Peter Eisentraut wrote: > > > Is there any sense in dealing with the libpq and backend patches separately > > in sequence, or is this split just for ease of handling? > > I t

Using per-transaction memory contexts for storing decoded tuples

2024-09-11 Thread Masahiko Sawada
Hi all, We have several reports that logical decoding uses memory much more than logical_decoding_work_mem[1][2][3]. For instance in one of the reports[1], even though users set logical_decoding_work_mem to '256MB', a walsender process was killed by OOM because of using more than 4GB memory. As p

Re: AIX support

2024-09-11 Thread Thomas Munro
On Thu, Sep 12, 2024 at 9:57 AM Heikki Linnakangas wrote: > If you make no changes to s_lock.h at all, will it work? Why not? It's good to keep the work independent and I don't want to hold up anything happening in this thread, but just for information: I have been poking around at the idea of en

Re: Pgstattuple on Sequences: Seeking Community Feedback on Potential Patch

2024-09-11 Thread Matthias van de Meent
On Wed, 11 Sept 2024 at 21:36, Nathan Bossart wrote: > > Barring objections, I'm planning to commit v3 soon. Robert/Matthias, I'm > not sure you are convinced this is the right thing to do (or worth doing, > rather), but I don't sense that you are actually opposed to it, either. > Please correct

Re: query_id, pg_stat_activity, extended query protocol

2024-09-11 Thread Sami Imseih
I took a look at your patches and here are my comments > 1) ExecutorRun() misses the reports, which happens when a query > does an ExecutorStart(), then a series of ExecutorRun() through a > portal with bind messages. Robert has mentioned that separately a few > days ago at [1]. But that's not e

Re: AIX support

2024-09-11 Thread Heikki Linnakangas
On 11/09/2024 15:38, Srirama Kucherlapati wrote: I still don't understand. We have Linux powerpc systems running happily in the buildfarm. They are happy with the current spinlock implementation. Why is this needed? What happens without it? Not sure, by the time the below commits were made if t

Re: [PATCH] pg_stat_activity: make slow/hanging authentication more visible

2024-09-11 Thread Jacob Champion
On Mon, Sep 9, 2024 at 10:30 PM Michael Paquier wrote: > No. My question was about splitting pgstat_bestart() and > pgstat_bestart_pre_auth() in a cleaner way, because authenticated > connections finish by calling both, meaning that we do twice the same > setup for backend entries depending on th

Re: Support run-time partition pruning for hash join

2024-09-11 Thread David Rowley
On Fri, 6 Sept 2024 at 19:19, Richard Guo wrote: > * Currently, the costing code does not take run-time pruning into > consideration. How should we calculate the costs of the parameterized > paths on partitioned tables? Couldn't we assume total_cost = total_cost / n_apppend_children for equality

Re: Extract numeric filed in JSONB more effectively

2024-09-11 Thread David Rowley
On Wed, 17 Apr 2024 at 17:17, Andy Fan wrote: > rebase to the latest master again. There's a lot of complexity in the v18 patch that I don't understand the need for. I imagined you'd the patch should create a SupportRequestSimplify support function for jsonb_numeric() that checks if the input ex

Re: Pgstattuple on Sequences: Seeking Community Feedback on Potential Patch

2024-09-11 Thread Nathan Bossart
Barring objections, I'm planning to commit v3 soon. Robert/Matthias, I'm not sure you are convinced this is the right thing to do (or worth doing, rather), but I don't sense that you are actually opposed to it, either. Please correct me if I am wrong. -- nathan

Re: Accept invalidation messages before the query starts inside a transaction

2024-09-11 Thread Tom Lane
Andrei Lepikhov writes: > I don't know whether to classify this as a bug. The sketch of the patch > with an example isolation test is attached. This seems like an extremely strange place (and an extremely brute-force way) to insert an AcceptInvalidationMessages call. Under what circumstances wou

Re: Document DateStyle effect on jsonpath string()

2024-09-11 Thread David E. Wheeler
On Sep 11, 2024, at 15:43, Tom Lane wrote: > Seems to me it should be the jsonpath convention. If the spec > does require any specific spelling, surely it must be that one. WFM, though now I’ll have to go change my port 😂. D

Accept invalidation messages before the query starts inside a transaction

2024-09-11 Thread Andrei Lepikhov
Hi, During the PGDAY.Spain'2024 Yurii Rashkovskii found out boring behaviour related to functions versioning: If you open a transaction in one session and execute the function, then replace this function with a new version or drop it in a concurrent session; the first session doesn't see any c

Re: Document DateStyle effect on jsonpath string()

2024-09-11 Thread Tom Lane
"David E. Wheeler" writes: > Should it use the database-native stringification standard or the jsonpath > stringification standard? In the case of the former, output should omit the > “T” time separator and simplify the time zone `07:00` to `07`. But if it’s > the latter case, then it’s good as

Re: not null constraints, again

2024-09-11 Thread Alvaro Herrera
On 2024-Sep-11, jian he wrote: > On Wed, Sep 11, 2024 at 2:18 AM Alvaro Herrera > wrote: > > > > Hello, here's a v2 of this patch. I have fixed --I think-- all the > > issues you and Tender Wang reported (unless I declined a fix in some > > previous email). > > > > + /* > + * The constraint mu

Re: Document DateStyle effect on jsonpath string()

2024-09-11 Thread David E. Wheeler
On Sep 11, 2024, at 15:08, Tom Lane wrote: > Right. I actually lifted the code from convertJsonbScalar in > jsonb_util.c. > > Here's a more fleshed-out patch with docs and regression test > fixes. I figured we could shorten the tests a bit now that > the point is just to verify that datestyle

Re: libpq: Process buffered SSL read bytes to support records >8kB on async API

2024-09-11 Thread Lars Kanis
Thank you Jacob for verifying this issue! Gory details of the packet sizes, if it's helpful: - max TLS record size is 12k, because it made the math easier - server sends DataRow of 32006 bytes, followed by DataRow of 806 bytes, followed by CommandComplete/ReadyForQuery - so there are three TLS r

Re: Document DateStyle effect on jsonpath string()

2024-09-11 Thread Tom Lane
"David E. Wheeler" writes: > On Sep 11, 2024, at 12:26, Tom Lane wrote: >> Building on that thought, maybe we could fix it as attached? > It looks like that’s what datum_to_json_internal() in json.c does, which IIUC > is the default stringification for date and time values. Right. I actually

Re: First draft of PG 17 release notes

2024-09-11 Thread Alvaro Herrera
Hello, I noticed that these two items in the current notes are separate: Allow specification of partitioned table access methods (Justin Pryzby, Soumyadeep Chakraborty, Michael Paquier) Add DEFAULT setting for ALTER TABLE .

Re: Document DateStyle effect on jsonpath string()

2024-09-11 Thread David E. Wheeler
On Sep 11, 2024, at 12:26, Tom Lane wrote: > Building on that thought, maybe we could fix it as attached? > This changes the just-committed test cases of course, and I did > not look at whether there are documentation changes to make. It looks like that’s what datum_to_json_internal() in json.c

Re: Invalid Assert while validating REPLICA IDENTITY?

2024-09-11 Thread vignesh C
On Wed, 11 Sept 2024 at 10:05, Amit Kapila wrote: > > On Tue, Sep 10, 2024 at 2:16 PM Amit Kapila wrote: > > > > On Tue, Sep 10, 2024 at 11:36 AM vignesh C wrote: > > > > > > On Mon, 9 Sept 2024 at 13:12, Amit Kapila wrote: > > > > > > > > The second part of the assertion is incomplete. The > >

Re: Document DateStyle effect on jsonpath string()

2024-09-11 Thread Tom Lane
I wrote: > I think I'd be content to have string() duplicate that behavior > --- in fact, it seems like it'd be odd if it doesn't match. Building on that thought, maybe we could fix it as attached? This changes the just-committed test cases of course, and I did not look at whether there are docume

Re: Document DateStyle effect on jsonpath string()

2024-09-11 Thread Tom Lane
"David E. Wheeler" writes: > On Sep 11, 2024, at 11:11, Tom Lane wrote: >> What "let result be stringified" behavior are you thinking of, >> exactly? AFAICS there's not sensitivity to timezone unless you >> use the _tz variant, otherwise it just regurgitates the input. > There is stringificatio

Re: Document DateStyle effect on jsonpath string()

2024-09-11 Thread David E. Wheeler
On Sep 11, 2024, at 11:11, Tom Lane wrote: > What "let result be stringified" behavior are you thinking of, > exactly? AFAICS there's not sensitivity to timezone unless you > use the _tz variant, otherwise it just regurgitates the input. There is stringification of a time, date, or timestamp va

Re: Use read streams in pg_visibility

2024-09-11 Thread Noah Misch
On Wed, Sep 11, 2024 at 09:19:09AM +0300, Nazir Bilal Yavuz wrote: > On Wed, 11 Sept 2024 at 01:38, Noah Misch wrote: > > I also fixed the mix of tabs and spaces inside test file string literals. > > I ran both pgindent and pgperltidy but they didn't catch them. Is > there an automated way to cat

Re: Detailed release notes

2024-09-11 Thread Bruce Momjian
On Wed, Sep 11, 2024 at 10:16:04AM -0400, Bruce Momjian wrote: > On Sat, Sep 7, 2024 at 10:12:00AM +0800, jian he wrote: > > On Sat, Sep 7, 2024 at 6:30 AM Jelte Fennema-Nio wrote: > > > > > > On Thu, 22 Aug 2024 at 21:34, Marcos Pegoraro wrote: > > > > I understand your point, and agree with th

Re: Document DateStyle effect on jsonpath string()

2024-09-11 Thread Tom Lane
"David E. Wheeler" writes: > I wonder, then, whether .string() should be modified to use the ISO format in > UTC, and therefore be immutable. That’s the format you get if you omit > .string() and let result be stringified from a date/time/timestamp. What "let result be stringified" behavior are

Re: Jargon and acronyms on this mailing list

2024-09-11 Thread Andrew Dunstan
On 2024-09-11 We 8:34 AM, Robert Haas wrote: On Mon, Sep 9, 2024 at 3:54 PM Andrew Dunstan wrote: There are some serious obstacles to changing it all over, though. I don't want to rewrite all the history, for example. Because of the way git works, that really wouldn't be an issue. We'd just

Re: Document DateStyle effect on jsonpath string()

2024-09-11 Thread David E. Wheeler
On Sep 11, 2024, at 10:11, Tom Lane wrote: > [ looks... ] Hmm, it looks like jsonb_path_exists_tz is marked > stable while jsonb_path_exists is claimed to be immutable. > So yeah, there's a problem here. I'm not 100% convinced that > jsonb_path_exists was truly immutable before, but for sure it

Re: BUG #18598: AddressSanitizer detects use after free inside json_unique_hash_match()

2024-09-11 Thread Junwang Zhao
Hi Tomas, On Wed, Sep 11, 2024 at 8:08 PM Tomas Vondra wrote: > > On 9/10/24 21:47, Tomas Vondra wrote: > > ... > > > > The only question that bothers me a little bit is the possibility of a > > memory leak - could it happen that we keep the copied key much longer > > than needed? Or does aggcont

Re: Remove old RULE privilege completely

2024-09-11 Thread Fujii Masao
On 2024/09/10 4:49, Nathan Bossart wrote: Ok, so, patch attached. There was a test to check if has_table_privilege() accepted the keyword RULE. The patch removed it since it's now unnecessary and would only waste cycles testing that has_table_privilege() no longer accepts the keyword. LGTM

Re: Add on_error and log_verbosity options to file_fdw

2024-09-11 Thread Fujii Masao
On 2024/08/08 16:36, torikoshia wrote: Attached patches. 0001 adds new option 'silent' to log_verbosity and 0002 adds on_error and log_verbosity options to file_fdw. Thanks for the patches! Here are the review comments for 0001 patch. + silent excludes verbose messages. This should

Re: First draft of PG 17 release notes

2024-09-11 Thread Nathan Bossart
On Wed, Sep 11, 2024 at 10:12:58AM -0400, Bruce Momjian wrote: > On Tue, Sep 10, 2024 at 09:52:42AM -0700, Masahiko Sawada wrote: >> On Mon, Sep 9, 2024 at 11:29 PM Jelte Fennema-Nio wrote: >> > For 1, I think adding them to the release notes makes total sense, >> > especially if the new APIs are

Re: Detailed release notes

2024-09-11 Thread Bruce Momjian
On Sat, Sep 7, 2024 at 10:12:00AM +0800, jian he wrote: > On Sat, Sep 7, 2024 at 6:30 AM Jelte Fennema-Nio wrote: > > > > On Thu, 22 Aug 2024 at 21:34, Marcos Pegoraro wrote: > > > I understand your point, and agree with that for previous releases, but > > > since we have a month only for versi

Re: First draft of PG 17 release notes

2024-09-11 Thread Bruce Momjian
On Tue, Sep 10, 2024 at 09:52:42AM -0700, Masahiko Sawada wrote: > On Mon, Sep 9, 2024 at 11:29 PM Jelte Fennema-Nio wrote: > > > > On Tue, 10 Sept 2024 at 04:47, Bruce Momjian wrote: > > > Yes. There are so many changes at the source code level it is unwise to > > > try and get them into the ma

Re: First draft of PG 17 release notes

2024-09-11 Thread Bruce Momjian
On Tue, Sep 10, 2024 at 08:28:42AM +0200, Jelte Fennema-Nio wrote: > I think as an extension author there are usually three types of > changes that are relevant: > 1. New APIs/hooks that are meant for extension authors > 2. Stuff that causes my existing code to not compile anymore > 3. Stuff that c

Re: Document DateStyle effect on jsonpath string()

2024-09-11 Thread Tom Lane
Peter Eisentraut writes: > What I'm concerned about is that this makes the behavior of JSON_QUERY > non-immutable. Maybe there are other reasons for it to be > non-immutable, in which case this isn't important. But it might be > worth avoiding that? Fair point, but haven't we already bit tha

Re: Test improvements and minor code fixes for formatting.c.

2024-09-11 Thread Tom Lane
Aleksander Alekseev writes: > I'm having difficulties applying the patch. Could you please do `git > format-patch` and resend it? patch(1) is generally far more forgiving than 'git am'. regards, tom lane

Re: Allow CI to only run the compiler warnings task

2024-09-11 Thread Nazir Bilal Yavuz
Hi, On Wed, 11 Sept 2024 at 15:36, Bertrand Drouvot wrote: > > Hi hackers, > > While working on a new pg_logicalinspect module ([1]), I reached a point where > all the CI tests were green except the compiler warnings one. Then, to save > time > addressing the issue, I modified the .cirrus.tasks.

Re: PG_TEST_EXTRA and meson

2024-09-11 Thread Nazir Bilal Yavuz
Hi, On Wed, 11 Sept 2024 at 13:04, Ashutosh Bapat wrote: > > Thanks Bilal for testing the patch. Can you or Jacob please create one > patchset including both meson and make fixes? Please keep the meson > and make changes in separate patches though. I think the meson patches > come from [1] (they

[PATCH] Refactor SLRU to always use long file names

2024-09-11 Thread Aleksander Alekseev
Hi, Commit 4ed8f0913bfd introduced long SLRU file names. The proposed patch removes SlruCtl->long_segment_names flag and makes SLRU always use long file names. This simplifies both the code and the API. Corresponding changes to pg_upgrade are included. One drawback I see is that technically SLRU

Re: [PATCH] pg_stat_activity: make slow/hanging authentication more visible

2024-09-11 Thread Robert Haas
On Tue, Sep 10, 2024 at 4:58 PM Noah Misch wrote: > ... a rule of "each wait event appears in one > pgstat_report_wait_start()" would be a rule I don't want. As the original committer of the wait event stuff, I intended for the rule that you do not want to be the actual rule. However, I see that

RE: AIX support

2024-09-11 Thread Srirama Kucherlapati
Hi Heikki and Team, Thanks for your comments. Here are some more details > I still don't understand. We have Linux powerpc systems > running happily in the buildfarm. They are happy with the > current spinlock implementation. Why is this needed? > What happens without it? Not sur

Allow CI to only run the compiler warnings task

2024-09-11 Thread Bertrand Drouvot
Hi hackers, While working on a new pg_logicalinspect module ([1]), I reached a point where all the CI tests were green except the compiler warnings one. Then, to save time addressing the issue, I modified the .cirrus.tasks.yml file to $SUBJECT. I think this could be useful for others too, so plea

Re: Jargon and acronyms on this mailing list

2024-09-11 Thread Robert Haas
On Mon, Sep 9, 2024 at 3:54 PM Andrew Dunstan wrote: > There are some serious obstacles to changing it all over, though. I > don't want to rewrite all the history, for example. Because of the way git works, that really wouldn't be an issue. We'd just push the tip of the master branch to main and

Re: BUG #18598: AddressSanitizer detects use after free inside json_unique_hash_match()

2024-09-11 Thread Tomas Vondra
On 9/10/24 21:47, Tomas Vondra wrote: > ... > > The only question that bothers me a little bit is the possibility of a > memory leak - could it happen that we keep the copied key much longer > than needed? Or does aggcontext have with the right life span? AFAICS > that's where we allocate the aggre

Re: json_query conditional wrapper bug

2024-09-11 Thread Peter Eisentraut
On 11.09.24 13:25, Amit Langote wrote: On Wed, Sep 11, 2024 at 6:57 PM Peter Eisentraut wrote: On 11.09.24 09:51, Amit Langote wrote: I've updated your patch to include updated test outputs and a nearby code comment expanded. Do you intend to commit it or do you prefer that I do? This chang

Re: Psql meta-command conninfo+

2024-09-11 Thread Hunaid Sohail
Hi Jim, On Wed, Sep 11, 2024 at 3:03 PM Jim Jones wrote: > Thanks for working on this. > > Any particular reason for the design change? In v28 it returned a table > with a single row and multiple columns --- one column per attribute. But > now it returns multiple rows. In this case, I was expect

Re: Test improvements and minor code fixes for formatting.c.

2024-09-11 Thread Hunaid Sohail
Hi, On Wed, Sep 11, 2024 at 2:33 PM Aleksander Alekseev < aleksan...@timescale.com> wrote: > I'm having difficulties applying the patch. Could you please do `git > format-patch` and resend it? > Yes, I guess there is some issue with the patch but somehow I was able to apply it. make installchec

Re: json_query conditional wrapper bug

2024-09-11 Thread Amit Langote
On Wed, Sep 11, 2024 at 6:57 PM Peter Eisentraut wrote: > On 11.09.24 09:51, Amit Langote wrote: > >>> I've updated your patch to include updated test outputs and a nearby > >>> code comment expanded. Do you intend to commit it or do you prefer > >>> that I do? > >> > >> This change looks unrelat

Make pg_stat_io view count IOs as bytes instead of blocks

2024-09-11 Thread Nazir Bilal Yavuz
Hi, Currently, in the pg_stat_io view, IOs are counted as blocks. However, there are two issues with this approach: 1- The actual number of IO requests to the kernel is lower because IO requests can be merged before sending the final request. Additionally, it appears that all IOs are counted in b

Re: Add contrib/pg_logicalsnapinspect

2024-09-11 Thread Bertrand Drouvot
Hi, On Wed, Sep 11, 2024 at 10:30:37AM +0530, Amit Kapila wrote: > On Tue, Sep 10, 2024 at 8:56 PM Bertrand Drouvot > wrote: > > > > On Mon, Sep 09, 2024 at 04:24:09PM +0530, Amit Kapila wrote: > > > On Fri, Aug 30, 2024 at 5:18 PM Bertrand Drouvot > > > wrote: > > > > as we decided not to expos

Re: Trim the heap free memory

2024-09-11 Thread Rafia Sabih
Unfortunately, I still see a compiling issue with this patch, memtrim.c:15:10: fatal error: 'malloc.h' file not found #include ^~ 1 error generated. On Wed, 28 Aug 2024 at 12:54, shawn wang wrote: > Hi Ashutosh, > > Ashutosh Bapat 于2024年8月26日周一 19:05写道: > >> Hi Shawn, >> It w

Re: Document DateStyle effect on jsonpath string()

2024-09-11 Thread Peter Eisentraut
On 10.09.24 22:16, Tom Lane wrote: Peter Eisentraut writes: These JSON path functions are specified by the SQL standard, so they shouldn't depend on PostgreSQL-specific settings. At least in new functionality we should avoid that, no? Hmm ... but does the standard precisely define the output

Re: PG_TEST_EXTRA and meson

2024-09-11 Thread Ashutosh Bapat
On Mon, Sep 2, 2024 at 8:32 PM Nazir Bilal Yavuz wrote: > > Hi, > > On Fri, 30 Aug 2024 at 21:36, Jacob Champion > wrote: > > > > On Wed, Aug 28, 2024 at 8:21 AM Nazir Bilal Yavuz > > wrote: > > > I do not exactly remember the reason but I think I copied the same > > > behavior as before, PG_TE

Re: Psql meta-command conninfo+

2024-09-11 Thread Jim Jones
On 11.09.24 10:16, Hunaid Sohail wrote: I have made the requested changes. Now output is returned in tabular form. Indentation/whitespace issues are fixed. $bin/psql --port=5430 postgres postgres=# \conninfo+ You are connected to database "postgres" as user "hunaid" via socket in "/tmp" at p

Re: json_query conditional wrapper bug

2024-09-11 Thread Peter Eisentraut
On 11.09.24 09:51, Amit Langote wrote: I've updated your patch to include updated test outputs and a nearby code comment expanded. Do you intend to commit it or do you prefer that I do? This change looks unrelated: -ERROR: new row for relation "test_jsonb_constraints" violates check constrai

Re: broken build - FC 41

2024-09-11 Thread Pavel Stehule
Hi st 11. 9. 2024 v 9:54 odesílatel Daniel Gustafsson napsal: > > On 9 Sep 2024, at 15:20, Pavel Stehule wrote: > > > The question is why the missing header was not detected by configure? > > We don't test for every 3rd party header we include. If engines were > separate > from OpenSSL we'd pr

Re: Test improvements and minor code fixes for formatting.c.

2024-09-11 Thread Aleksander Alekseev
Hi Tom, > Meh ... cfbot points out I did the float-to-int conversions wrong. > v2 attached. I'm having difficulties applying the patch. Could you please do `git format-patch` and resend it? -- Best regards, Aleksander Alekseev

Re: not null constraints, again

2024-09-11 Thread jian he
On Wed, Sep 11, 2024 at 9:11 AM jian he wrote: > > On Wed, Sep 11, 2024 at 2:18 AM Alvaro Herrera > wrote: > > > > Hello, here's a v2 of this patch. I have fixed --I think-- all the > > issues you and Tender Wang reported (unless I declined a fix in some > > previous email). > > after applying

Re: Fix orphaned 2pc file which may casue instance restart failed

2024-09-11 Thread Michael Paquier
On Sun, Sep 08, 2024 at 01:01:37PM +0800, 清浅 wrote: > Hi all, I found that there is a race condition > between two global transaction, which may cause instance restart > failed with error 'could not access status of transaction > xxx","Could not open file ""pg_xact/xxx"": No such file or > directo

Fix orphaned 2pc file which may casue instance restart failed

2024-09-11 Thread ????
Hi all,     I found that there is a race condition between two global transaction, which may cause instance restart failed with error 'could not access status of transaction xxx","Could not open file ""pg_xact/xxx"": No such file or directory'.      The scenery to reproduce the problem is:    

Re: Conflict detection for update_deleted in logical replication

2024-09-11 Thread Amit Kapila
On Wed, Sep 11, 2024 at 8:32 AM Zhijie Hou (Fujitsu) wrote: > > On Tuesday, September 10, 2024 7:25 PM Amit Kapila > wrote: > > > > One minor comment on 0003 > > === > > 1. > > get_slot_confirmed_flush() > > { > > ... > > + /* > > + * To prevent concurrent slot dropping and c

Re: Psql meta-command conninfo+

2024-09-11 Thread Hunaid Sohail
Hi, On Tue, Sep 10, 2024 at 9:16 PM Alvaro Herrera wrote: > On 2024-Sep-10, Jim Jones wrote: > > > Is \conninfo+ no longer supposed to return the results in tabular form? > > At least it wasn't the case till v28. > > I suspect the reason it's no longer a table is that it was previously a > query

  1   2   >