Re: -Wformat-signedness

2024-10-28 Thread Michael Paquier
On Tue, Oct 29, 2024 at 07:38:36AM +0100, Peter Eisentraut wrote: > I think it could be useful to set up some better test coverage for various > things overflowing signed integer maximums. For example, maybe you could > hack initdb to advance the OID counter to INT32_MAX+1 or thereabouts and run >

Re: detoast datum into the given buffer as a optimization.

2024-10-28 Thread Andy Fan
Hi, I find some independent improvement in this area. In the detoast_attr, VARATT_IS_EXTERNAL_ONDISK and VARATT_IS_EXTERNAL_INDIRECT are checked first, and then VARATT_IS_EXTERNAL_EXPANDED is checked. However when VARATT_IS_EXTERNAL_EXPANDED is true, detoast_external_attr is called which would ch

Re: Wrong result when enable_partitionwise_join is on if collation of PartitionKey and Column is different.

2024-10-28 Thread Tender Wang
jian he 于2024年10月29日周二 14:15写道: > On Thu, Oct 24, 2024 at 3:01 PM Tender Wang wrote: > > > > I feel that it's hard only to use one struct(for example, X), which just > calls equal(X, expr) > > can check both the expression match and the collation match. > > > > in RelOptInfo->partexprs, maybe we

Re: protocol-level wait-for-LSN

2024-10-28 Thread Peter Eisentraut
On 29.10.24 06:06, Tatsuo Ishii wrote: The patch adds a protocol extension called _pq_.wait_for_lsn as well as a libpq connection option wait_for_lsn to activate the same. (Use e.g., psql -d 'wait_for_lsn=1'.) With this protocol extension, two things are changed: - The ReadyForQuery message se

Re: Pgoutput not capturing the generated columns

2024-10-28 Thread Amit Kapila
On Tue, Oct 29, 2024 at 11:30 AM Peter Smith wrote: > == > src/backend/replication/logical/tablesync.c > > fetch_remote_table_info: > > 2. > +fetch_remote_table_info(char *nspname, char *relname, LogicalRepRelation > *lrel, > + List **qual, bool *remotegencolpresent) > > The name 'remotegenco

RE: [PoC] Partition path cache

2024-10-28 Thread Bykov Ivan
Hello > This sounds like an interesting idea, I like it because it omit the needs for > "global statistics" effort for partitioned table since it just use the first > partition it knows. Of couse it has its drawback that "first" > partition can't represent other partitions. This method uses glo

Re: Forbid to DROP temp tables of other sessions

2024-10-28 Thread Daniil Davydov
Hi, Thanks for your comments, I appreciate them. As I continued to deal with the topic of working with temp tables of other sessions, I noticed something like a bug. For example (REL_17_STABLE): Session 1: =# CREATE TEMP TABLE test(id int); Session 2: =# INSERT INTO pg_temp_0.test VALUES (1); =#

Re: Pgoutput not capturing the generated columns

2024-10-28 Thread Amit Kapila
On Tue, Oct 29, 2024 at 11:19 AM Hayato Kuroda (Fujitsu) wrote: > > 01. fetch_remote_table_info() > > `bool *remotegencolpresent` is accessed unconditionally, but it can cause > crash > if NULL is passed to the function. Should we add an Assert to verify it? > This is a static function being cal

Re: Wrong result when enable_partitionwise_join is on if collation of PartitionKey and Column is different.

2024-10-28 Thread jian he
On Thu, Oct 24, 2024 at 3:01 PM Tender Wang wrote: > > I feel that it's hard only to use one struct(for example, X), which just > calls equal(X, expr) > can check both the expression match and the collation match. > in RelOptInfo->partexprs, maybe we should mention that the partition key collati

Re: Pgoutput not capturing the generated columns

2024-10-28 Thread Peter Smith
Here are my review comments for patch v44-0002. == Commit message. 1. The commit message is missing. == src/backend/replication/logical/tablesync.c fetch_remote_table_info: 2. +fetch_remote_table_info(char *nspname, char *relname, LogicalRepRelation *lrel, + List **qual, bool *remotege

RE: Pgoutput not capturing the generated columns

2024-10-28 Thread Hayato Kuroda (Fujitsu)
Dear Shubham, Thanks for updating the patch! Here are my comments for v44. 01. fetch_remote_table_info() `bool *remotegencolpresent` is accessed unconditionally, but it can cause crash if NULL is passed to the function. Should we add an Assert to verify it? 02. fetch_remote_table_info() ``` +

Re: Alias of VALUES RTE in explain plan

2024-10-28 Thread Yasir
On Mon, Oct 28, 2024 at 8:16 PM Tom Lane wrote: > Ashutosh Bapat writes: > > The patch looks good to me, except the name of the new member. > > > CommonTableExpr *p_parent_cte; /* this query's containing CTE */ > > + Alias*p_parent_alias; /* parent's alias for this query */ > > > the two "

Re: protocol-level wait-for-LSN

2024-10-28 Thread Tatsuo Ishii
> The patch adds a protocol extension called _pq_.wait_for_lsn as well > as a libpq connection option wait_for_lsn to activate the same. (Use > e.g., psql -d 'wait_for_lsn=1'.) > > With this protocol extension, two things are changed: > > - The ReadyForQuery message sends back the current LSN.

Re: Why don't we consider explicit Incremental Sort?

2024-10-28 Thread Andrei Lepikhov
On 10/10/24 09:18, Richard Guo wrote: On Sun, Sep 22, 2024 at 1:38 PM David Rowley wrote: I've pushed this patch after tweaking this part in the commit message. Thank you both for your reviews. My apologies for the late review, but IMO there are some minor weaknesses. Working on the improvement

Re: Pgoutput not capturing the generated columns

2024-10-28 Thread Amit Kapila
On Tue, Oct 29, 2024 at 7:44 AM Peter Smith wrote: > > == > src/backend/replication/logical/proto.c > > 2. > +bool > +logicalrep_should_publish_column(Form_pg_attribute att, Bitmapset *columns) > +{ > + if (att->attisdropped) > + return false; > + > + /* > + * Skip publishing generated columns

Re: Add isolation test template in injection_points for wait/wakeup/detach

2024-10-28 Thread Michael Paquier
On Mon, Oct 28, 2024 at 07:17:28AM +, Bertrand Drouvot wrote: > I think that we can not be 100% sure that the s1 wait will finish before the > s2 detach (easy reproducible with gdb attached on s1 or an hardcoded sleep) > and > that other OS could also report the test as failing for the same re

Re: Reduce one comparison in binaryheap's sift down

2024-10-28 Thread cca5507
Agree, new version patch is attached. -- Regards, ChangAo Chen -- Original -- From: "Nathan Bossart"

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

2024-10-28 Thread Jingtang Zhang
Hi~ Sorry for multiple comments in separate mail. Just found that the initialization seems redundant since we have used palloc0? > +istate = (HeapInsertState *) palloc0(sizeof(HeapInsertState)); > +istate->bistate = NULL; > +istate->mistate = NULL; --- Regards, Jingtang

Re: EXPLAIN IndexOnlyScan shows disabled when enable_indexonlyscan=on

2024-10-28 Thread David Rowley
On Tue, 29 Oct 2024 at 14:41, David G. Johnston wrote: > > On Mon, Oct 28, 2024 at 3:54 PM David Rowley wrote: > -Enables or disables the query planner's use of index-scan plan > -types. The default is on. > +Enables or disables the query planner's use of index-scan and >

Re: Consider the number of columns in the sort cost model

2024-10-28 Thread Andrei Lepikhov
On 10/28/24 16:48, Alena Rybakina wrote: On 23.10.2024 04:39, Andrei Lepikhov wrote: On 15/10/2024 12:15, David Rowley wrote: And the last patch is a demo of how I'm going to use the previous three patches and add one more strategy to improve the order of columns in the GROUP-BY clause. To b

Re: EXPLAIN IndexOnlyScan shows disabled when enable_indexonlyscan=on

2024-10-28 Thread David G. Johnston
On Mon, Oct 28, 2024 at 3:54 PM David Rowley wrote: > > I've attached that in patch form. > > -Enables or disables the query planner's use of index-scan plan -types. The default is on. +Enables or disables the query planner's use of index-scan and +index-only-scan

Re: Pgoutput not capturing the generated columns

2024-10-28 Thread Peter Smith
Here are my review comments for v44-0001. == doc/src/sgml/ref/create_publication.sgml 1. - When a column list is specified, only the named columns are replicated. + When a column list is specified, all columns (except generated columns) + of the table are replicated. If

Re: Statistics Import and Export

2024-10-28 Thread Jeff Davis
On Sun, 2024-10-27 at 14:00 +0300, Alexander Lakhin wrote: > Please look at the following seemingly atypical behavior of the new > functions: ... > SELECT pg_restore_attribute_stats( >    'relation', 'test'::regclass, >    'attname', 'id'::name, >    'inherited', false > ) FROM generate_series(1,

Re: detoast datum into the given buffer as a optimization.

2024-10-28 Thread Andy Fan
Hi Tom, > Andy Fan writes: >> * Note if caller provides a non-NULL buffer, it is the duty of caller >> * to make sure it has enough room for the detoasted format (Usually >> * they can use toast_raw_datum_size to get the size) > > This is a pretty awful, unsafe API design. Sorry that I ex

Re: EXPLAIN IndexOnlyScan shows disabled when enable_indexonlyscan=on

2024-10-28 Thread David G. Johnston
On Mon, Oct 28, 2024 at 6:03 PM David Rowley wrote: > We don't seem to be agreeing on much here... :-( > > On Tue, 29 Oct 2024 at 13:30, David G. Johnston > wrote: > > > > On Mon, Oct 28, 2024 at 3:54 PM David Rowley > wrote: > >> I'm concerned about the wording "all index-scan related". It's

Re: ActiveState Perl is not valid anymore to build PG17 on the Windows 10/11 platforms, So Documentation still suggesting it should be updated

2024-10-28 Thread Michael Paquier
On Mon, Oct 28, 2024 at 01:07:16PM +0100, Daniel Gustafsson wrote: > +1 for applying backpatched to at least 17 but possibly further down judging > by > the linked threads. When using ActiveState perl, being able to call `perl` from a PATH requires one to register into a central service related t

Re: EXPLAIN IndexOnlyScan shows disabled when enable_indexonlyscan=on

2024-10-28 Thread David G. Johnston
On Mon, Oct 28, 2024 at 3:54 PM David Rowley wrote: > On Wed, 23 Oct 2024 at 13:51, David G. Johnston > wrote: > > Went with a slightly different wording that seems to flow better with > the xrefs I added between the two options. > > -Enables or disables the query planner's use of index-

Re: sunsetting md5 password support

2024-10-28 Thread Nathan Bossart
On Mon, Oct 28, 2024 at 04:10:29PM -0500, Jim Nasby wrote: > Patch itself looks good, but it does leave me wondering if cleartext > should also be deprecated? I see that Tom has already chimed in on this point. In any case, this is probably a topic for another thread. > Might also be worth menti

Re: EXPLAIN IndexOnlyScan shows disabled when enable_indexonlyscan=on

2024-10-28 Thread David Rowley
We don't seem to be agreeing on much here... :-( On Tue, 29 Oct 2024 at 13:30, David G. Johnston wrote: > > On Mon, Oct 28, 2024 at 3:54 PM David Rowley wrote: >> I'm concerned about the wording "all index-scan related". It's not >> that clear if that would include Bitmap Index Scans or not. >

freespace.c modifies buffer without any locks

2024-10-28 Thread Andres Freund
Hi, I just noticed that fsm_vacuum_page() modifies a buffer without even holding a shared lock. That quite obviously seems like a violation of the buffer locking protocol: /* * Try to reset the next slot pointer. This encourages the use of * low-numbered pages, increasi

Re: Questions About TODO: Issuing NOTICEs for row count differences in EXPLAIN ANALYZE

2024-10-28 Thread David Rowley
On Tue, 29 Oct 2024 at 12:43, KAZAR Ayoub wrote: > I am currently looking into the following TODO item, "Have EXPLAIN ANALYZE > issue NOTICE messages when the estimated and actual row counts differ by a > specified percentage." > What's the current status of this TODO, and is there any prior dis

Re: On disable_cost

2024-10-28 Thread David Rowley
On Sat, 19 Oct 2024 at 01:09, Laurenz Albe wrote: > Here is my attempt on that paragraph: > > When using the enable/disable flags to disable plan node types, many of > the flags only discourage the use of the corresponding plan node and don't > outright disallow the planner's ability to use

Questions About TODO: Issuing NOTICEs for row count differences in EXPLAIN ANALYZE

2024-10-28 Thread KAZAR Ayoub
Hello Hackers, I am currently looking into the following TODO item, "Have EXPLAIN ANALYZE issue NOTICE messages when the estimated and actual row counts differ by a specified percentage." What's the current status of this TODO, and is there any prior discussion or rationale behind it ? Specifically

Re: Considering fractional paths in Append node

2024-10-28 Thread Andy Fan
Nikita Malakhov writes: > Hi, > > Andy, thank you, I've checked this thread out along with run-time > partition pruning. I'm not sure the relationshipe between this topic and run-time partitioin pruning.. > I've spend some time hovering on the tuple_fraction field usage and would > disagree > w

Re: EXPLAIN IndexOnlyScan shows disabled when enable_indexonlyscan=on

2024-10-28 Thread David Rowley
On Wed, 23 Oct 2024 at 13:51, David G. Johnston wrote: > Went with a slightly different wording that seems to flow better with the > xrefs I added between the two options. -Enables or disables the query planner's use of index-scan plan -types. The default is on. +Enables

Re: define pg_structiszero(addr, s, r)

2024-10-28 Thread Peter Smith
On Thu, Sep 19, 2024 at 4:57 AM Bertrand Drouvot wrote: > > Hi, > > On Wed, Sep 18, 2024 at 10:03:21AM +0200, Peter Eisentraut wrote: > > On 18.09.24 06:16, Bertrand Drouvot wrote: > > > +#define pg_structiszero(addr, s, r) > > >

Re: RFC: Extension Packaging & Lookup

2024-10-28 Thread David E. Wheeler
Greetings Postgres humans, There was much discussion of this proposal at PGConf.eu last week, between Gabriele Bartolini, Peter Eisentraut, Christoph Berg, and Andres Freund (all Cc’d here), and me, among others. We agreed, in principle, to an approach to this feature. Overa

Re: Conflict Detection and Resolution

2024-10-28 Thread Diego Fronza
Hello hackers, Hey I'm Diego and I do work for Percona and started to work on PostgreSQL and I would like to contribute to the project moving forward. I have been following this thread since the beginning, but due to my limited knowledge of the overall code structure, my first review of the provi

Re: Assertion failure when autovacuum drops orphan temp indexes.

2024-10-28 Thread Nathan Bossart
Committed. -- nathan

Re: sunsetting md5 password support

2024-10-28 Thread Tom Lane
Jim Nasby writes: > Patch itself looks good, but it does leave me wondering if cleartext should > also be deprecated? Not much point unless we also deprecate all of the other auth methods that require cleartext password transmission, which from a quick scan include PAM, BSD, LDAP, and RADIUS. S

Re: Reduce one comparison in binaryheap's sift down

2024-10-28 Thread Nathan Bossart
On Mon, Oct 28, 2024 at 12:40:20PM -0400, Robert Haas wrote: > Hmm, so at present we compare the parent to the left child and to the > right child. If it's smaller than neither, everything is OK. If it's > smaller than one, we swap it with that one. If it's smaller than both, > we compare the left

Re: trying again to get incremental backup

2024-10-28 Thread Michael Banck
Hi, So I am a bit confused about the status of the tar format support, and after re-reading the thread (or at least grepping it for ' tar '), this wasn't really much discussed here either. On Wed, Jun 14, 2023 at 02:46:48PM -0400, Robert Haas wrote: > - We only know how to operate on directories,

Re: sunsetting md5 password support

2024-10-28 Thread Jim Nasby
> On Oct 28, 2024, at 3:21 PM, Greg Sabino Mullane wrote: > > On Sat, Oct 26, 2024 at 11:55 AM Nathan Bossart > wrote: >> rebased > > Patch applied without issue and looks good to me. Patch itself looks good, but it does leave me wondering if cleartext should

Re: Vacuum statistics

2024-10-28 Thread Jim Nasby
> On Oct 28, 2024, at 2:07 PM, Alexander Korotkov wrote: > >> I suppose that if we turn off statistics collection for a certain object, we >> can miss it. In addition, the user may not enable the parameter for the >> object in time, because he will forget about it. > > I agree with this poin

Re: sunsetting md5 password support

2024-10-28 Thread Greg Sabino Mullane
On Sat, Oct 26, 2024 at 11:55 AM Nathan Bossart wrote: > rebased > Patch applied without issue and looks good to me. Cheers, Greg

Re: Considering fractional paths in Append node

2024-10-28 Thread Nikita Malakhov
Hi, Andy, thank you, I've checked this thread out along with run-time partition pruning. I've spend some time hovering on the tuple_fraction field usage and would disagree with you on this topic - it is already used on the RelOptInfo level later on, in generate_orderedappend_paths() I mean the fol

Re: MergeAppend could consider sorting cheapest child path

2024-10-28 Thread Nikita Malakhov
Hi! I've checked this thread and examples in it, and do not see stable improvements in base tests. Sometimes base tests are considerably slower with patch, like: explain analyze select t1.* from matest0 t1, matest0 t2 where t1.b = t2.b and t2.c = t2.d order by t1.b limit 10;

Re: pgsql: Implement pg_wal_replay_wait() stored procedure

2024-10-28 Thread Alexander Korotkov
On Mon, Oct 28, 2024 at 11:36 AM Heikki Linnakangas wrote: > > On 25/10/2024 14:56, Alexander Korotkov wrote: > > I see that pg_wal_replay_wait_status() might look weird, but it seems > > to me like the best of feasible solutions. > > I haven't written many procedures, but our docs say: > > > Pro

Re: Better error reporting from extension scripts (Was: Extend ALTER OPERATOR)

2024-10-28 Thread Alexander Lakhin
28.10.2024 19:06, Tom Lane wrote: I've also dumped buf in read_whole_file() and found that in both PG_BINARY_R and "r" modes the 0d 0a ending is preserved. But it changed to 0a with the "rt" mode (see [1]), and it makes the test (and the whole `meson test`) pass for me. Interesting. I believe w

Re: Vacuum statistics

2024-10-28 Thread Alexander Korotkov
On Sun, Sep 29, 2024 at 12:22 AM Alena Rybakina wrote: > Hi! Thank you for your interesting for this patch! > > I took a very brief look at this and was wondering if it was worth > having a way to make the per-table vacuum statistics opt-in (like a > table storage parameter) in order to decrease t

Re: Should we support casting between ARRAYs and JSON(B)?

2024-10-28 Thread Marcos Pegoraro
Em seg., 28 de out. de 2024 às 14:06, Aleksander Alekseev < aleksan...@timescale.com> escreveu: > =# select '[1,2,3]' :: jsonb :: int[]; > I think would be useful, cast int[] to json is not hard select to_json('{1,5,9,12}'::int[]); but json array to int[] is not that easy. select js, js

Inconsistent output handling in 002_pg_upgrade.pl test logs

2024-10-28 Thread Joel Jacobson
Hi hackers, I've noticed some inconsistency in 002_pg_upgrade.pl in how it handles output during test failures. Currently, it uses note to print the header: note "=== contents of $log ===\n"; but print for the log content and footer: print slurp_file($log); print "=== EOF ===\n"; T

Re: New "raw" COPY format

2024-10-28 Thread Masahiko Sawada
On Mon, Oct 28, 2024 at 3:21 AM Joel Jacobson wrote: > > On Mon, Oct 28, 2024, at 10:30, Joel Jacobson wrote: > > On Mon, Oct 28, 2024, at 08:56, jian he wrote: > >> /* Check force_quote */ > >> - if (!opts_out->csv_mode && (opts_out->force_quote || > >> opts_out->force_quote_all)) > >> + if (op

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

2024-10-28 Thread Bernd Helmle
Am Samstag, dem 26.10.2024 um 11:40 +0300 schrieb Andrey M. Borodin: > First patch: > 0. We have PG_FREE_IF_COPY(), does it suits your needs? PG_FREE_IF_COPY() requires FunctionCallInfo (the macro uses PG_GETARG_POINTER() to reference the pointer value to compare), which is not usable in the conte

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

2024-10-28 Thread Jingtang Zhang
Oh, another comments for v24-0001 patch: we are in heam AM now, should we use something like HEAP_INSERT_BAS_BULKWRITE instead of using table AM option, just like other heap AM options do? > + if ((state->options & TABLE_INSERT_BAS_BULKWRITE) != 0) > + istate->bista

Re: protocol-level wait-for-LSN

2024-10-28 Thread Jelte Fennema-Nio
On Mon, 28 Oct 2024 at 17:58, Heikki Linnakangas wrote: > > - The Query message sends an LSN to wait for. (This doesn't handle the > > extended query protocol yet.) > > I'd suggest adding a new message type for this, so that it works the > same with simple and extended query. Or if you just want

Should we support casting between ARRAYs and JSON(B)?

2024-10-28 Thread Aleksander Alekseev
Hi hackers, While reviewing another patch [1] I came to an idea to try something stupid: =# select '{1,2,3}' :: int[]; int4 - {1,2,3} =# select '{1,2,3}' :: int[] :: jsonb[]; ERROR: cannot cast type integer[] to jsonb[] =# select '[1,2,3]' :: jsonb; jsonb --- [1, 2, 3] =#

Re: protocol-level wait-for-LSN

2024-10-28 Thread Jelte Fennema-Nio
On Mon, 28 Oct 2024 at 16:51, Peter Eisentraut wrote: > The idea is to do the equivalent of pg_wal_replay_wait() on the protocol > level, so that it is ideally fully transparent to the application code. > The application just issues queries, and they might be serviced by a > primary or a standby,

Re: protocol-level wait-for-LSN

2024-10-28 Thread Heikki Linnakangas
On 28/10/2024 17:51, Peter Eisentraut wrote: This is something I hacked together on the way back from pgconf.eu. It's highly experimental. The idea is to do the equivalent of pg_wal_replay_wait() on the protocol level, so that it is ideally fully transparent to the application code. The appli

Planner issue with BitmapScan recheck on external TOAST

2024-10-28 Thread Jim Nasby
I’ve been testing use of a BRIN index on record creation date (timestamptz) on a snapshot of a production system. Note that after creating the BRIN index the number of buffers being accessed jumps from 23838 to 191663. Based on what EXPLAIN is showing, I believe the issue is that the planner doe

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

2024-10-28 Thread Alena Rybakina
Hi, Jian! Thank you for your work on this topic! On 28.10.2024 10:19, jian he wrote: * NOTE: returns NULL if clause is an OR or AND clause; it is the * responsibility of higher-level routines to cope with those. */ static IndexClause * match_clause_to_indexcol(PlannerInfo *root,

Re: Avoid possible overflow (src/port/bsearch_arg.c)

2024-10-28 Thread Heikki Linnakangas
On 28/10/2024 17:30, Tomas Vondra wrote: Some of those other implementations have fixed this, others have not. And they all seem to also have the "involes" typo in the comment that we fixed in commit 7ef8b52cf07 :-). Ranier, you might want to submit this fix to those other projects too. Thanks

Re: general purpose array_sort

2024-10-28 Thread Aleksander Alekseev
Hi, > Based on the previous discussion, I split it into two patches in V8. > > 0001 is the general sort part without `is_ascending` or `nulls_first`, > the sort order is determined by the "<" operator of the element type. > It also cached the type entry of both eletyp and the corresponding > array

Re: Reduce one comparison in binaryheap's sift down

2024-10-28 Thread Robert Haas
On Mon, Oct 28, 2024 at 11:22 AM cca5507 wrote: > I think we can reduce one comparison in binaryheap's sift down, right? > > Here is a patch to fix it. Hmm, so at present we compare the parent to the left child and to the right child. If it's smaller than neither, everything is OK. If it's smalle

Re: define pg_structiszero(addr, s, r)

2024-10-28 Thread Ranier Vilela
Em seg., 28 de out. de 2024 às 12:08, Tom Lane escreveu: > Ranier Vilela writes: > > It seems to me that [reversing the loop direction] is more optimized. > > That's far from clear: you're ignoring the possibility that memory > access logic is better optimized for forward scanning than reverse >

Re: [PoC] Federated Authn/z with OAUTHBEARER

2024-10-28 Thread Jacob Champion
On Mon, Oct 28, 2024 at 6:24 AM Daniel Gustafsson wrote: > > On 25 Oct 2024, at 20:22, Jacob Champion > > wrote: > > > I have combed almost all of Daniel's feedback backwards into the main > > patch (just the new bzero code remains, with the open question > > upthread), > > Re-reading I can't se

Re: Better error reporting from extension scripts (Was: Extend ALTER OPERATOR)

2024-10-28 Thread Tom Lane
Alexander Lakhin writes: > 27.10.2024 20:41, Tom Lane wrote: >>> In the no-good-deed-goes-unpunished department: buildfarm member >>> hamerkop doesn't like this patch [1]. The diffs look like > I've managed to reproduce the issue with the core.autocrlf=true git setting > (which sets CR+LF line e

protocol-level wait-for-LSN

2024-10-28 Thread Peter Eisentraut
This is something I hacked together on the way back from pgconf.eu. It's highly experimental. The idea is to do the equivalent of pg_wal_replay_wait() on the protocol level, so that it is ideally fully transparent to the application code. The application just issues queries, and they might be

Re: Inconsistent output handling in 002_pg_upgrade.pl test logs

2024-10-28 Thread Joel Jacobson
On Mon, Oct 28, 2024, at 13:44, Daniel Gustafsson wrote: >> On 28 Oct 2024, at 13:38, Joel Jacobson wrote: >> >> Hi hackers, >> >> I've noticed some inconsistency in 002_pg_upgrade.pl in how it handles output >> during test failures. Currently, it uses note to print the header: >> >>note "=

Re: Avoid possible overflow (src/port/bsearch_arg.c)

2024-10-28 Thread Tomas Vondra
On 10/28/24 13:13, Heikki Linnakangas wrote: > On 09/10/2024 19:16, Ranier Vilela wrote: >> Em ter., 8 de out. de 2024 às 18:28, Nathan Bossart >> mailto:nathandboss...@gmail.com>> escreveu: >> >>     On Tue, Oct 08, 2024 at 04:09:00PM -0300, Ranier Vilela wrote: >> > The port function *bse

Reduce one comparison in binaryheap's sift down

2024-10-28 Thread cca5507
Hi, I think we can reduce one comparison in binaryheap's sift down, right? Here is a patch to fix it. -- Regards, ChangAo Chen v1-0001-Reduce-one-comparison-in-binaryheap-s-sift-down.patch Description: Binary data

Proper object locking for GRANT/REVOKE

2024-10-28 Thread Peter Eisentraut
This patch started out as a refactoring, thinking that objectNamesToOids() in aclchk.c should really mostly be a loop around get_object_address(). This is mostly true, with a few special cases because the node representations are a bit different in some cases, and OBJECT_PARAMETER_ACL, which i

Re: Alias of VALUES RTE in explain plan

2024-10-28 Thread Tom Lane
Ashutosh Bapat writes: > The patch looks good to me, except the name of the new member. > CommonTableExpr *p_parent_cte; /* this query's containing CTE */ > + Alias*p_parent_alias; /* parent's alias for this query */ > the two "parent"s here mean different things and that might lead one >

Re: Assertion failure when autovacuum drops orphan temp indexes.

2024-10-28 Thread Nathan Bossart
On Sun, Oct 27, 2024 at 09:36:38PM -0700, Masahiko Sawada wrote: > Thank you for your suggestion. IMHO I'm not sure we need to have a > regression test for this bug as it's just an oversight of recently > committed code. Agreed. FWIW cfbot seems to catch this already (CTRL+F for "index_drop" in t

Re: define pg_structiszero(addr, s, r)

2024-10-28 Thread Tom Lane
Ranier Vilela writes: > It seems to me that [reversing the loop direction] is more optimized. That's far from clear: you're ignoring the possibility that memory access logic is better optimized for forward scanning than reverse scanning. I'd stick with the forward scan without some extremely det

Re: Alias of VALUES RTE in explain plan

2024-10-28 Thread Tom Lane
Andrei Lepikhov writes: > My goal is to understand why the implementation follows this pattern. As > I see, previously, we had consistent behaviour, according to which we > removed the pulling-up subquery's alias as well. And I want to know, is > it really the only way to break this behavior? M

Re: define pg_structiszero(addr, s, r)

2024-10-28 Thread Ranier Vilela
Em seg., 28 de out. de 2024 às 11:33, Heikki Linnakangas escreveu: > On 18/09/2024 21:57, Bertrand Drouvot wrote: > > On Wed, Sep 18, 2024 at 10:03:21AM +0200, Peter Eisentraut wrote: > >> On 18.09.24 06:16, Bertrand Drouvot wrote: > >>> +#define pg_structiszero(addr, s, r) >

Re: In-placre persistance change of a relation

2024-10-28 Thread Heikki Linnakangas
On 31/08/2024 19:09, Kyotaro Horiguchi wrote: Subject: [PATCH v34 03/16] Remove function for retaining files on outer transaction aborts The function RelationPreserveStorage() was initially created to keep storage files committed in a subtransaction on the abort of outer transactions. It was in

Re: define pg_structiszero(addr, s, r)

2024-10-28 Thread Heikki Linnakangas
On 18/09/2024 21:57, Bertrand Drouvot wrote: On Wed, Sep 18, 2024 at 10:03:21AM +0200, Peter Eisentraut wrote: On 18.09.24 06:16, Bertrand Drouvot wrote: +#define pg_structiszero(addr, s, r) \ + do {

Re: Fix C23 compiler warning

2024-10-28 Thread Tom Lane
=?utf-8?Q?Dagfinn_Ilmari_Manns=C3=A5ker?= writes: > Tom Lane writes: >> So maybe we should revive that idea, though I'd definitely target >> autoconf 2.72 not 2.71. > Just a data point: autoconf 2.72 came out under a year ago, so the most > recent Debian Stable (12) and Ubuntu LTS (24.04) only h

Re: Alias of VALUES RTE in explain plan

2024-10-28 Thread Andrei Lepikhov
On 28/10/2024 20:19, Ashutosh Bapat wrote: On Mon, Oct 28, 2024 at 10:17 AM Andrei Lepikhov wrote: On 10/28/24 03:15, Yasir wrote: By design of my solution, I was not taking it as a bug. But now, I agree with your opinion. I think the case provided by Ashutosh was initially correct, and noth

Re: Vacuum statistics

2024-10-28 Thread Alexander Korotkov
On Sun, Aug 25, 2024 at 6:59 PM Alena Rybakina wrote: > I didn't understand correctly - did you mean that we don't need SRF if > we need to display statistics for a specific object? > > Otherwise, we need this when we display information on all database > objects (tables or indexes): > > while ((e

Re: [PoC] Federated Authn/z with OAUTHBEARER

2024-10-28 Thread Daniel Gustafsson
> On 25 Oct 2024, at 20:22, Jacob Champion > wrote: > I have combed almost all of Daniel's feedback backwards into the main > patch (just the new bzero code remains, with the open question > upthread), Re-reading I can't see a vector there, I guess I am just scarred from what seemed to be harml

Re: Alias of VALUES RTE in explain plan

2024-10-28 Thread Ashutosh Bapat
On Mon, Oct 28, 2024 at 10:17 AM Andrei Lepikhov wrote: > > On 10/28/24 03:15, Yasir wrote: > > By design of my solution, I was not taking it as a bug. But now, I agree > > with your opinion. > I think the case provided by Ashutosh was initially correct, and nothing > needs to change. Look at the

Re: Pgoutput not capturing the generated columns

2024-10-28 Thread Shubham Khanna
On Mon, Oct 28, 2024 at 8:47 AM Hayato Kuroda (Fujitsu) wrote: > > Dear Shubham, > > Thanks for updating the patch! I resumed reviewing the patch set. > Here are only cosmetic comments as my rehabilitation. > > 01. getPublications() > > I feel we could follow the notation like getSubscriptions(),

Re: Pgoutput not capturing the generated columns

2024-10-28 Thread Shubham Khanna
On Mon, Oct 28, 2024 at 7:43 AM Peter Smith wrote: > > Hi, here are my review comments for patch v43-0001. > > == > > 1. Missing docs update? > > The CREATE PUBLICATION docs currently says: > When a column list is specified, only the named columns are > replicated. If no column list is specifi

Re: RFC: Logging plan of the running query

2024-10-28 Thread torikoshia
Hi I've recently resumed work on this proposal. I was revising tests that use the injection point, but given that there was a recent talk at PGConf.EU about further features based on this proposal [1], I thought it might be of interest to some. Therefore, I'll share a patch that removes the i

Re: Avoid possible overflow (src/port/bsearch_arg.c)

2024-10-28 Thread Ranier Vilela
Em seg., 28 de out. de 2024 às 09:13, Heikki Linnakangas escreveu: > On 09/10/2024 19:16, Ranier Vilela wrote: > > Em ter., 8 de out. de 2024 às 18:28, Nathan Bossart > > mailto:nathandboss...@gmail.com>> escreveu: > > > > On Tue, Oct 08, 2024 at 04:09:00PM -0300, Ranier Vilela wrote: > >

Re: Inconsistent output handling in 002_pg_upgrade.pl test logs

2024-10-28 Thread Daniel Gustafsson
> On 28 Oct 2024, at 13:38, Joel Jacobson wrote: > > Hi hackers, > > I've noticed some inconsistency in 002_pg_upgrade.pl in how it handles output > during test failures. Currently, it uses note to print the header: > >note "=== contents of $log ===\n"; > > but print for the log content an

Re: Fix C23 compiler warning

2024-10-28 Thread Dagfinn Ilmari Mannsåker
Tom Lane writes: > 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 bec

Re: ActiveState Perl is not valid anymore to build PG17 on the Windows 10/11 platforms, So Documentation still suggesting it should be updated

2024-10-28 Thread Umar Hayat
Hi Bruce, Patch looks good. In my opinion patch should be committed as more and more people who are trying to build PG 17 on Windows are facing similar issues. Latest issue was reported yesterday [0]. Regards Umar Hayat [0] https://www.postgresql.org/message-id/flat/CA%2BOCxozXN%3DGFPWU8vBjG6ch%

Re: Avoid possible overflow (src/port/bsearch_arg.c)

2024-10-28 Thread Heikki Linnakangas
On 09/10/2024 19:16, Ranier Vilela wrote: Em ter., 8 de out. de 2024 às 18:28, Nathan Bossart mailto:nathandboss...@gmail.com>> escreveu: On Tue, Oct 08, 2024 at 04:09:00PM -0300, Ranier Vilela wrote: > The port function *bsearch_arg* mimics the C function > *bsearch*. >

Re: ActiveState Perl is not valid anymore to build PG17 on the Windows 10/11 platforms, So Documentation still suggesting it should be updated

2024-10-28 Thread Daniel Gustafsson
> On 17 Oct 2024, at 00:35, Bruce Momjian wrote: > On Tue, Jul 16, 2024 at 08:23:11AM -0400, Andrew Dunstan wrote: >> See https://postgr.es/m/4acddcd4-1c08-44e7-ba60-cab102259...@dunslane.net >> >> I agree we should fix the docco. > > I have written the attached patch to make these changes. +

RE: Pgoutput not capturing the generated columns

2024-10-28 Thread Zhijie Hou (Fujitsu)
On Monday, October 28, 2024 2:54 PM Hayato Kuroda (Fujitsu) wrote: > > > 02. 031_column_list.pl > > ``` > -# TEST: Generated and dropped columns are not considered for the column > list. > +# TEST: Dropped columns are not considered for the column list. > # So, the publication having a column

RE: Pgoutput not capturing the generated columns

2024-10-28 Thread Zhijie Hou (Fujitsu)
On Monday, October 28, 2024 1:34 PM Amit Kapila wrote: > > On Mon, Oct 28, 2024 at 7:43 AM Peter Smith > wrote: > > > > > 4. pgoutput_column_list_init > > > > - if (att->attisdropped || att->attgenerated) > > + if (att->attisdropped) > > continue; > > > > + if (att->attgenerated) > > + { > >

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

2024-10-28 Thread Tender Wang
Alvaro Herrera 于2024年10月28日周一 17:16写道: > On 2024-Oct-27, Tender Wang wrote: > > > BTW, while reviewing the v2 patch, I found the parentConTup in > > foreach(cell, fks) block > > didn't need it anymore. We can remove the related codes. > > True. Done so in this v3. > > I noticed another problem h

Re: IPC::Run::time[r|out] vs our TAP tests

2024-10-28 Thread Heikki Linnakangas
On 09/04/2024 20:10, Daniel Gustafsson wrote: Turning the timeout into a timer and returning undef along with logging a test failure in case of expiration seems a bit saner (maybe Andrew can suggest an API which has a better Perl feel to it). Most callsites don't need any changes to accommodate

Re: New "raw" COPY format

2024-10-28 Thread Joel Jacobson
On Mon, Oct 28, 2024, at 10:30, Joel Jacobson wrote: > On Mon, Oct 28, 2024, at 08:56, jian he wrote: >> /* Check force_quote */ >> - if (!opts_out->csv_mode && (opts_out->force_quote || >> opts_out->force_quote_all)) >> + if (opts_out->format != COPY_FORMAT_CSV && (opts_out->force_quote || >> +

Re: Avoid orphaned objects dependencies, take 3

2024-10-28 Thread Bertrand Drouvot
Hi, On Mon, Aug 19, 2024 at 03:35:14PM +, Bertrand Drouvot wrote: > Hi, > > On Wed, Jul 10, 2024 at 07:31:06AM +, Bertrand Drouvot wrote: > > So, to sum up: > > > > A. Locking is now done exclusively with LockNotPinnedObject(Oid classid, > > Oid objid) > > so that it's now always clear

Re: Consider the number of columns in the sort cost model

2024-10-28 Thread Alena Rybakina
Hi! Thank you for your work on this subject! On 23.10.2024 04:39, Andrei Lepikhov wrote: On 15/10/2024 12:15, David Rowley wrote: On Tue, 15 Oct 2024 at 17:48, Andrei Lepikhov wrote: I think maybe what is worth working on is seeing if you can better estimate the number of tiebreak comparisons

  1   2   >