Re: Proper object locking for GRANT/REVOKE

2024-11-10 Thread Bertrand Drouvot
Hi, On Sat, Nov 09, 2024 at 01:43:13PM +0100, Peter Eisentraut wrote: > On 31.10.24 15:26, Bertrand Drouvot wrote: > > + address = get_object_address(objtype, lfirst(cell), &relation, lockmode, > > false); > > + Assert(relation == NULL); > > > > Worth to explain why we do expect relation to be

Re: Skip collecting decoded changes of already-aborted transactions

2024-11-10 Thread Peter Smith
Hi Sawada-San, here are some review comments for the patch v5-0001. == Commit message. 1. This commit introduces an additional check to determine if a transaction is already aborted by a CLOG lookup, so the logical decoding skips further change also when it doesn't touch system catalogs. ~

Re: RFC: Additional Directory for Extensions

2024-11-10 Thread Peter Eisentraut
I implemented a patch along the lines Craig had suggested. It's a new GUC variable that is a path for extension control files. It's called extension_control_path, and it works exactly the same way as dynamic_library_path. Except that the magic token is called $system instead of $libdir. In

Re: Fix small typo, use InvalidRelFileNumber instead of InvalidOid

2024-11-10 Thread Dilip Kumar
On Sat, Nov 9, 2024 at 12:41 PM Dilip Kumar wrote: > > On Fri, Nov 8, 2024 at 8:36 PM Tom Lane wrote: >> >> Dilip Kumar writes: >> > IIRC, In catalog we intentionally left it as Oid because RelFileNumber is >> > an internal typedef bug, it is not an exposed datatype, so probably we can >> > not

Re: define pg_structiszero(addr, s, r)

2024-11-10 Thread Bertrand Drouvot
Hi, On Sat, Nov 09, 2024 at 04:15:04AM +, Bertrand Drouvot wrote: > Hi, > > On Fri, Nov 08, 2024 at 11:18:09PM +1300, David Rowley wrote: > > I tried with [1] and the > > latest gcc does not seem to be smart enough to figure this out. I > > tried adding some additional len checks that the co

Re: Virtual generated columns

2024-11-10 Thread vignesh C
On Tue, 5 Nov 2024 at 21:48, Peter Eisentraut wrote: > > On 30.09.24 04:09, Peter Eisentraut wrote: > > I'm attaching a consolidated patch here, so we have something up to date > > on the record. I haven't worked through all the other recent feedback > > from Jian He yet; I'll do that next. > > N

Re: Avoiding superfluous buffer locking during nbtree backwards scans

2024-11-10 Thread Masahiro Ikeda
On 2024-11-11 12:19, Peter Geoghegan wrote: On Sun, Nov 10, 2024 at 9:53 PM Masahiro Ikeda wrote: I understand, thanks to your explanation. Cool. Now, there is a case where _bt_readnextpage() calls _bt_parallel_seize(), _bt_readpage() sets so->needPrimScan=true, and _bt_parallel_done() is c

Re: Add html-serve target to autotools and meson

2024-11-10 Thread Michael Paquier
On Sat, Nov 09, 2024 at 09:26:20AM +0100, Peter Eisentraut wrote: > What is the advantage of using an http server over just opening the file > directly in a web browser (file:// scheme)? Not sure to see any on sight. I just use file:// to check the state of the docs produced by any patch sent to

Re: meson and check-tests

2024-11-10 Thread jian he
hi. Actually, there is a difference compared to make. make works fine with many whitespaces. but meson you can only have one whitespace. meson test -C $BUILD7 --num-processes 20 --suite setup --verbose export TESTS="test_setup boolean char" meson test -C $BUILD7 --suite regress --

Re: Avoiding superfluous buffer locking during nbtree backwards scans

2024-11-10 Thread Peter Geoghegan
On Sun, Nov 10, 2024 at 9:53 PM Masahiro Ikeda wrote: > I understand, thanks to your explanation. Cool. > Now, there is a case where _bt_readnextpage() calls > _bt_parallel_seize(), > _bt_readpage() sets so->needPrimScan=true, and _bt_parallel_done() is > called > with so->needPrimScan=true. Pri

Re: Avoiding superfluous buffer locking during nbtree backwards scans

2024-11-10 Thread Masahiro Ikeda
On 2024-11-09 03:40, Peter Geoghegan wrote: On Fri, Nov 8, 2024 at 8:25 AM Masahiro Ikeda wrote: Since I couldn't understand the reason, I have a question: is the following deletion related to this change? @@ -770,7 +785,7 @@ _bt_parallel_done(IndexScanDesc scan) /* * Shoul

Re: Add parallel columns for seq scan and index scan on pg_stat_all_tables and _indexes

2024-11-10 Thread Michael Paquier
On Tue, Oct 08, 2024 at 06:24:54PM +0300, Alena Rybakina wrote: > yes, I agree with you. Even when I experimented with vacuum settings for > database and used my vacuum statistics patch [0] for analyzes , I first > looked at this change in the number of blocks or deleted rows at the > database leve

Re: Parallel workers stats in pg_stat_database

2024-11-10 Thread Michael Paquier
On Fri, Nov 08, 2024 at 03:13:35PM +0100, Benoit Lobréau wrote: > I just reread the patch. > Thanks for the changes. It looks great. Okidoki, applied. If tweaks are necessary depending on the feedback, like column names, let's tackle things as required. We still have a good chunk of time for thi

Re: In-placre persistance change of a relation

2024-11-10 Thread Kyotaro Horiguchi
A bit out of the blue, but I remembered the reason why I could make that change I previously agreed seemed off. Just thought I’d let you know. At Tue, 05 Nov 2024 13:25:26 +0900 (JST), Kyotaro Horiguchi wrote in me> > the commit process to keep the window as small as possible, but if it me> > n

Re: doc fail about ALTER TABLE ATTACH re. NO INHERIT

2024-11-10 Thread Amit Langote
On Fri, Nov 8, 2024 at 2:54 AM Alvaro Herrera wrote: > On 2024-Nov-07, Amit Langote wrote: > > > On Wed, Nov 6, 2024 at 9:34 PM Alvaro Herrera > > wrote: > > > > Oh, hmm, that makes sense I guess. Still, while this restriction makes > > > sense for inheritance, it doesn't IMO for partitioned ta

Re: Eager aggregation, take 3

2024-11-10 Thread Richard Guo
On Wed, Nov 6, 2024 at 11:43 PM Robert Haas wrote: > On Wed, Nov 6, 2024 at 3:22 AM Richard Guo wrote: > > Yeah, ordered aggregates could be a blocker. I think it might be best > > to prevent the use of eager aggregation if root->numOrderedAggs > 0 > > for now. > > > > I've been thinking about t

Re: remaining sql/json patches

2024-11-10 Thread Amit Langote
Hi Nikita, On Sat, Nov 9, 2024 at 5:22 PM Nikita Malakhov wrote: > > Hi! > > We'd like to help to implement SQL/JSON in v18 and have adapted the > JSON_TABLE PLAN clause code > from patch v45-0001-JSON_TABLE.patch. Nice, thanks. I think it might be better to start a new thread for your patch a

Re: pg_stat_statements: Avoid holding excessive lock

2024-11-10 Thread Michael Paquier
On Fri, Nov 08, 2024 at 05:49:45PM +0800, wenhui qiu wrote: > Agree , It reduces the lock time , The new comment are short and concise, > It sounds good . Thanks for the double-check. Applied on HEAD. -- Michael signature.asc Description: PGP signature

Re: Allowing pg_recvlogical to create temporary replication slots

2024-11-10 Thread Dickson Guedes
Hello Torsten! While reviewing your patch for pg_recvlogical, I’m curious about the expected behavior when using --if-not-exists in conjunction with --temporary-slot. If an existing slot is reused under these options, will it behave as a temporary slot and be removed when the connection ends?

Re: index prefetching

2024-11-10 Thread Peter Geoghegan
On Sun, Nov 10, 2024 at 4:41 PM Tomas Vondra wrote: > Is it a good idea to make this part (in indexam.c) aware of / > responsible for managing stuff like pins? My sense is that that's the right long term architectural direction. I can't really prove it. > Perhaps it'd work fine for > index AMs t

Re: [BUG] psql: Make \copy from 'text' and 'csv' formats fail on NUL bytes

2024-11-10 Thread Tom Lane
"Joel Jacobson" writes: > On Sun, Nov 10, 2024, at 22:37, Tom Lane wrote: >> That seems like a hack, as it also changes the behavior w.r.t. >> prompts and EOF-mark detection, neither for the better. > Hmm, in what way does it change the behavior? > I ran almost all the tests, including the TAP on

Re: [BUG] psql: Make \copy from 'text' and 'csv' formats fail on NUL bytes

2024-11-10 Thread Joel Jacobson
On Sun, Nov 10, 2024, at 22:37, Tom Lane wrote: > "Joel Jacobson" writes: >> Fix by adjusting handleCopyIn() to use the binary code path also when the >> copy >> source is a file (i.e., copystream != pset.cur_cmd_source), even in textual >> copies. > > That seems like a hack, as it also changes t

Re: index prefetching

2024-11-10 Thread Tomas Vondra
On 11/8/24 02:35, Peter Geoghegan wrote: > On Thu, Nov 7, 2024 at 4:34 PM Tomas Vondra wrote: >> Not sure I understand, but I think I'm somewhat confused by "index AM" >> vs. indexam. Are you suggesting the individual index AMs should know as >> little about the batching as possible, and instead i

Re: [BUG] psql: Make \copy from 'text' and 'csv' formats fail on NUL bytes

2024-11-10 Thread Tom Lane
"Joel Jacobson" writes: > Fix by adjusting handleCopyIn() to use the binary code path also when the copy > source is a file (i.e., copystream != pset.cur_cmd_source), even in textual > copies. That seems like a hack, as it also changes the behavior w.r.t. prompts and EOF-mark detection, neither f

Re: Interrupts vs signals

2024-11-10 Thread Heikki Linnakangas
On 05/11/2024 22:21, Jelte Fennema-Nio wrote: On Mon, 4 Nov 2024 at 20:42, Heikki Linnakangas wrote: Having spent some time playing with this, I quite like option C: break compatibility, but provide an out-of-tree header file with *forward*-compatibility macros. That encourages extension author

[BUG] psql: Make \copy from 'text' and 'csv' formats fail on NUL bytes

2024-11-10 Thread Joel Jacobson
Hi hackers, When using \copy from in psql to import files containing NUL bytes (\0) in 'text' or 'csv' format, the NUL bytes were not detected and did not result in an error, leading to silent data corruption. This behavior is inconsistent with server-side COPY FROM, which reports an error upon e

Re: Draft back-branch release notes are up

2024-11-10 Thread Tom Lane
Nathan Bossart writes: > I've just committed 0a883a0 to v17. I'm not sure if that's worth > mentioning, though. Yeah, I concluded it probably isn't. (I do normally add in any last-minute commits on the release Sunday.) regards, tom lane

Re: Showing primitive index scan count in EXPLAIN ANALYZE (for skip scan and SAOP scans)

2024-11-10 Thread Alena Rybakina
On 09.11.2024 21:46, Peter Geoghegan wrote: On Sat, Nov 9, 2024 at 12:37 PM Alena Rybakina wrote: I noticed that the "Index Searches" cases shown in the regression tests are only for partitioned tables, maybe something you should add some tests for regular tables like tenk1. I allowed the p

Re: [PoC] XMLCast (SQL/XML X025)

2024-11-10 Thread Jim Jones
rebase. -- Jim From a43036de62a69c00d0c5c4469af02c8ded438530 Mon Sep 17 00:00:00 2001 From: Jim Jones Date: Sun, 10 Nov 2024 16:13:18 +0100 Subject: [PATCH v4] Add XMLCast function (SQL/XML X025) This function implements the SQL/XML function xmlcast, which enables conversions between SQL data t

Re: proposal: schema variables

2024-11-10 Thread Pavel Stehule
ne 10. 11. 2024 v 18:51 odesílatel Pavel Stehule napsal: > > > ne 10. 11. 2024 v 17:19 odesílatel Pavel Stehule > napsal: > >> >> >> ne 10. 11. 2024 v 16:24 odesílatel Dmitry Dolgov <9erthali...@gmail.com> >> napsal: >> >>> Hi folks, >>> >>> Thanks for continuing this work. As a side note, I wou

Re: proposal: schema variables

2024-11-10 Thread Pavel Stehule
ne 10. 11. 2024 v 18:41 odesílatel Dmitry Dolgov <9erthali...@gmail.com> napsal: > > On Sun, Nov 10, 2024 at 05:19:09PM GMT, Pavel Stehule wrote: > > ne 10. 11. 2024 v 16:24 odesílatel Dmitry Dolgov <9erthali...@gmail.com> > > napsal: > > > > > Hi folks, > > > > > > Thanks for continuing this work

Re: proposal: schema variables

2024-11-10 Thread Pavel Stehule
ne 10. 11. 2024 v 17:19 odesílatel Pavel Stehule napsal: > > > ne 10. 11. 2024 v 16:24 odesílatel Dmitry Dolgov <9erthali...@gmail.com> > napsal: > >> Hi folks, >> >> Thanks for continuing this work. As a side note, I would like to mention >> how strange the situation in this CF item is. If I und

Re: proposal: schema variables

2024-11-10 Thread Dmitry Dolgov
> On Sun, Nov 10, 2024 at 05:19:09PM GMT, Pavel Stehule wrote: > ne 10. 11. 2024 v 16:24 odesílatel Dmitry Dolgov <9erthali...@gmail.com> > napsal: > > > Hi folks, > > > > Thanks for continuing this work. As a side note, I would like to mention > > how strange the situation in this CF item is. If I

Re: Vacuum statistics

2024-11-10 Thread Ilia Evdokimov
On 08.11.2024 22:23, Alena Rybakina wrote: Hi! Thank you for review! On 07.11.2024 17:49, Ilia Evdokimov wrote: Thank you for fixing it. 1) I have found some typos in the test output files (out-files) when running 'make check' and 'make check-world'. These typos might cause minor discrepan

Re: proposal: schema variables

2024-11-10 Thread Pavel Stehule
ne 10. 11. 2024 v 16:24 odesílatel Dmitry Dolgov <9erthali...@gmail.com> napsal: > Hi folks, > > Thanks for continuing this work. As a side note, I would like to mention > how strange the situation in this CF item is. If I understand correctly, > there are two hackers threads discussing the same p

Re: Join removal and attr_needed cleanup

2024-11-10 Thread Tom Lane
Bennie Swart writes: > -- join elimination fails > -- expect both b and c to be eliminated, but b remains > explain (costs off) >   select a.* >     from foo a >   left join foo b on (b.id1, b.id2) = (a.id1, a.id2) >   left join foo c on (c.id1, c.id2) = (a.id1, b.id2); >

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

2024-11-10 Thread Tom Lane
Alvaro Herrera writes: > So it looks like we should suggest to save the output of the query, > execute each DROP followed by each ADD, and if the latter fails, fix the > violations and retry the ADD. Right. I'll make it so -- thanks for doing the legwork on creating the query!

Re: proposal: schema variables

2024-11-10 Thread Dmitry Dolgov
Hi folks, Thanks for continuing this work. As a side note, I would like to mention how strange the situation in this CF item is. If I understand correctly, there are two hackers threads discussing the same patch, with recent patches posted in both of them. This is obviously confusing, e.g. the mai

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

2024-11-10 Thread Alvaro Herrera
On 2024-Nov-08, Tom Lane wrote: > Hmm ... interestingly, if I run this in HEAD's regression database, > I get > > constrained table | constraint | references > ---+---+- > clstr_tst | clstr_tst_con | clstr_tst_s > (1 row) Eeek. > So it look

Re: Add missing tab completion for ALTER TABLE ADD COLUMN IF NOT EXISTS

2024-11-10 Thread Kirill Reshke
On Thu, 7 Nov 2024 at 22:33, Karina Litskevich wrote: > > I looked through the new set of patches. > > On Thu, Nov 7, 2024 at 2:42 PM Kirill Reshke wrote: > > v3-0002 patch actually mixes two types of completion. First one, which > > adds a data type completion for ADD ATTRIBUTE, is pretty useful

Re: New GUC autovacuum_max_threshold ?

2024-11-10 Thread wenhui qiu
Hi Nathan Bossart > AFAICT the main advantage of these formulas is that you don't need another > GUC, but they also makes the existing ones more difficult to configure. > Plus, there's no way to go back to the existing behavior. There is indeed this problem,But I think this formula should not be a

Re: Join removal and attr_needed cleanup

2024-11-10 Thread Bennie Swart
We are encountering this issue which results in poor planning for some views. Some examples to illustrate the issue: -- setup create table foo as   select id1, id2     from generate_series(1, 100) id1, generate_series(1, 100) id2; alter table foo add unique (id1, id2); -- join elimina

Re: New "single" COPY format

2024-11-10 Thread Joel Jacobson
On Sun, Nov 10, 2024, at 09:00, Joel Jacobson wrote: >> It's a bit of a hack, but I kinda like it., since it seems like the >> only option without an error situation. I forgot about the error situation when a textual contain newline characters, that remains the same for option A, B and C. /Joel

Re: New "single" COPY format

2024-11-10 Thread Joel Jacobson
On Sun, Nov 10, 2024, at 08:48, Joel Jacobson wrote: > On Sun, Nov 10, 2024, at 08:32, Joel Jacobson wrote: >> Option A: >> COPY TO: Empty string field gets exported as an empty line. NULL field >> is an error. >> COPY FROM: Empty line is imported as an empty string. >> >> Option B: >> COPY TO: NU