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

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: 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: 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: 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: 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: 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: 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: 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

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: 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

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: 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: 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: Assertion failure when autovacuum drops orphan temp indexes.

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

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: 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: 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: 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: 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: 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: 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. >

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: 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: 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: 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: 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: 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: 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 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: 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: 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: 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: 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: -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: 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: 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: [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: 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: 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 Mon, Oct 28, 2024 at 12:27 PM Peter Smith wrote: > > On Mon, Oct 28, 2024 at 4:34 PM Amit Kapila wrote: > > > > On Mon, Oct 28, 2024 at 7:43 AM Peter Smith wrote: > > > > > > Hi, here are my review comments for patch v43-0001. > > > > > > == > > > src/backend/replication/logical/proto.c >

Re: Add ExprState hashing for GROUP BY and hashed SubPlans

2024-10-28 Thread Andrei Lepikhov
On 9/1/24 18:49, David Rowley wrote: adf97c156 added support to allow ExprStates to support hashing and adjusted Hash Join to make use of that. That allowed a speedup in hash value generation as it allowed JIT compilation of hash values. It also allowed more efficient tuple deforming as all requi

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

2024-10-28 Thread Tender Wang
Alvaro Herrera 于2024年10月25日周五 23:14写道: > On 2024-Oct-25, Alexander Lakhin wrote: > > > I've also discovered another anomaly with a similar setup, but it's not > > related to 53af9491a. > > Hmm, it may well be a preexisting problem, but I do think it involves > the same code. As far as I can tell

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! Glad to see update in this thread. Little question about v24 0002 patch: would it be better to move the implementation of TableModifyIsMultiInsertsSupported to somewhere for table AM level? Seems it is a common function for future use, not a specific one for matview. --- Regards, Jingtang

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: msvc directory missing in PostgreSQL 17.0

2024-10-28 Thread 黄铎彦
On 2024-10-28 09:42 GMT+8 Umar Hayat wrote: >[0] >https://www.postgresql.org/message-id/flat/CADK3HHLQ1MNmfXqEvQi36D_MQrheOZPcXv2H3s6otMbSmfwjzg%40mail.gmail.com It worked! Thank you Umar! My poor searching ability QwQ. But may be a small bug about the order of generation. After I first execute

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: Add isolation test template in injection_points for wait/wakeup/detach

2024-10-28 Thread Bertrand Drouvot
Hi, On Fri, Oct 25, 2024 at 09:33:12AM +0900, Michael Paquier wrote: > This is in the first permutation of the test done with "wait1 wakeup2 > detach2", and the diff means that the backend running the "wait" > callback is reported as finished after the detach is done, > injection_points_run being

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

2024-10-28 Thread jian he
* 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, RestrictInfo *rinfo, int indexcol,

Re: further #include cleanup (IWYU)

2024-10-28 Thread Peter Eisentraut
On 20.10.24 11:37, Alvaro Herrera wrote: On 2024-Oct-20, Peter Eisentraut wrote: diff --git a/contrib/tablefunc/tablefunc.h b/contrib/tablefunc/tablefunc.h index 2009382ce7d..b78030044b5 100644 --- a/contrib/tablefunc/tablefunc.h +++ b/contrib/tablefunc/tablefunc.h @@ -34,6 +34,4 @@ #ifndef T

Re: further #include cleanup (IWYU)

2024-10-28 Thread Peter Eisentraut
On 20.10.24 11:53, Alvaro Herrera wrote: On 2024-Oct-20, Peter Eisentraut wrote: diff --git a/src/bin/pg_dump/pg_backup_utils.c b/src/bin/pg_dump/pg_backup_utils.c index a0045cf5e58..80715979a1a 100644 --- a/src/bin/pg_dump/pg_backup_utils.c +++ b/src/bin/pg_dump/pg_backup_utils.c @@ -13,7 +13,

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

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

2024-10-28 Thread Dilip Kumar
On Sat, Oct 26, 2024 at 5:30 PM Melanie Plageman wrote: > On Sat, Oct 26, 2024 at 12:17 AM Dilip Kumar > wrote: > > > > On Fri, Oct 25, 2024 at 10:07 PM Melanie Plageman < > melanieplage...@gmail.com> wrote: > >> > >> On Fri, Oct 25, 2024 at 10:29 AM Melanie Plageman > >> wrote: > >> > > >> > T

Re: Pgoutput not capturing the generated columns

2024-10-28 Thread Peter Smith
On Mon, Oct 28, 2024 at 5:45 PM Amit Kapila wrote: > > On Mon, Oct 28, 2024 at 7:43 AM Peter Smith wrote: > > > > 7. > > +$node_publisher->wait_for_catchup('sub_gen'); > > + > > +is( $node_subscriber->safe_psql( > > + 'postgres', "SELECT * FROM test_gen ORDER BY a"), > > + qq(1|2), > > + 'replica

Re: Inval reliability, especially for inplace updates

2024-10-28 Thread Nitin Motiani
On Thu, Oct 24, 2024 at 8:24 AM Noah Misch wrote: > > With the releases wrapping in 2.5 weeks, I'm ambivalent about pushing this > before the release or after. Pushing before means fewer occurrences of > corruption, but pushing after gives more bake time to discover these changes > were defective

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

2024-10-28 Thread Alexander Lakhin
Hello Tom, 27.10.2024 20:41, Tom Lane wrote: I wrote: In the no-good-deed-goes-unpunished department: buildfarm member hamerkop doesn't like this patch [1]. The diffs look like ... So what I'd like to do to fix this is to change - if ((file = AllocateFile(filename, PG_BINARY_R)) == NULL)

Re: sslinfo extension - add notbefore and notafter timestamps

2024-10-28 Thread Daniel Gustafsson
The recent bump in minmum required versions of OpenSSL and LibreSSL made me remember to revisit this patch which was previously reverted due to library incompatibility (with *both* OpenSSL and LibreSSL on different APIs). The attached removes the timestamp conversion workaround which is no longer

Re: New "raw" COPY format

2024-10-28 Thread Joel Jacobson
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 || > + opts_out->force_quote_all)) > ereport(ERROR, > (errcode(

Re: Reordering DISTINCT keys to match input path's pathkeys

2024-10-28 Thread Andrei Lepikhov
On 6/7/24 16:46, Richard Guo wrote: On Mon, Feb 5, 2024 at 11:18 AM Richard Guo wrote: cfbot reminds that this patch does not apply any more. So I've rebased it on master, and also adjusted the test cases a bit. This patch does not apply any more, so here is a new rebase, with some tweaks to

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

2024-10-28 Thread Alvaro Herrera
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 here: we're grabbing the wrong lock type on the reference

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: 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: [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: 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, 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,

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: 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

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,

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: 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: 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: 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: 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: 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: [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: 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 "=

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: 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

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: [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: 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

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: 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

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: 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: 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: [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: 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: 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 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: 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: 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 >

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

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

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

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: 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: 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: 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 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%

  1   2   >