dropping privileges on windows vs privileged accounts

2024-07-06 Thread Andres Freund
Hi, While working to address some of Dave's concerns at [1], I encountered the odd issue of tests failing because postmaster not being allowed to open pg_control. This did not happen for all tests, but for a lot of tests. For example, the only output in pg_upgrade/003_logical_slots/log/003_logic

Re: 回复: An implementation of multi-key sort

2024-07-06 Thread Konstantin Knizhnik
On 04/07/2024 3:45 pm, Yao Wang wrote: Generally, the benefit of mksort is mainly from duplicated values and sort keys: the more duplicated values and sort keys are, the bigger benefit it gets. ... 1. Use distinct stats info of table to enable mksort It's kind of heuristics: in optimizer, ch

Re: tests fail on windows with default git settings

2024-07-06 Thread Andres Freund
Hi, On 2024-07-07 01:26:13 -0400, Tom Lane wrote: > Andres Freund writes: > > Do we want to support checking out with core.autocrlf? > > -1. It would be a constant source of breakage, and you could never > expect that (for example) making a tarball from such a checkout > would match anyone else'

Re: tests fail on windows with default git settings

2024-07-06 Thread Tom Lane
Andres Freund writes: > Do we want to support checking out with core.autocrlf? -1. It would be a constant source of breakage, and you could never expect that (for example) making a tarball from such a checkout would match anyone else's results. > If we do not want to support that, ISTM we ought

tests fail on windows with default git settings

2024-07-06 Thread Andres Freund
Hi, Git on windows defaults to core.autocrlf being enabled. Which means that a normal git clone will convert all lineendings in text files. Unfortunately that causes a few tests to fail, at least: test_json_parser/001_test_json_parser_incremental test_json_parser/003_test_semantic pg_bsd_in

Re: Eager aggregation, take 3

2024-07-06 Thread Paul George
Richard: Thanks for reviving this patch and for all of your work on it! Eager aggregation pushdown will be beneficial for my work and I'm hoping to see it land. I was playing around with v9 of the patches and was specifically curious about this previous statement... >This patch also makes eager

Re: Remove dependence on integer wrapping

2024-07-06 Thread Joseph Koshakow
On Thu, Jun 13, 2024 at 12:00 AM Alexander Lakhin wrote: > SELECT '[]'::jsonb -> -2147483648; > > #4 0x7efe232d67f3 in __GI_abort () at ./stdlib/abort.c:79 > #5 0x55e8fde9f211 in __negvsi2 () > #6 0x55e8fdcca62c in jsonb_array_element (fcinfo=0x55e8fec28220) at jsonfuncs.c:948 > > (

Re: Vectored I/O in bulk_write.c

2024-07-06 Thread Noah Misch
On Tue, Apr 09, 2024 at 04:51:52PM +1200, Thomas Munro wrote: > Here's a rebase. I decided against committing this for v17 in the > end. There's not much wrong with it AFAIK, except perhaps an > unprincipled chopping up of writes with large io_combine_limit due to > simplistic flow control, and I

Re: Built-in CTYPE provider

2024-07-06 Thread Jeremy Schneider
> > On Jul 6, 2024, at 12:51 PM, Noah Misch wrote: > Behavior after that: > > -- 2 rows w/ seq scan, 0 rows w/ index scan > SELECT 1 FROM t WHERE s ~ '[[:alpha:]]'; > SET enable_seqscan = off; > SELECT 1 FROM t WHERE s ~ '[[:alpha:]]'; > > -- ERROR: heap tuple (0,1) from table "t" lacks match

Re: Built-in CTYPE provider

2024-07-06 Thread Tom Lane
Noah Misch writes: > As a released feature, NORMALIZE() has a different set of remedies to choose > from, and I'm not proposing one. I may have sidetracked this thread by > talking about remedies without an agreement that pg_c_utf8 has a problem. My > question for the PostgreSQL maintainers is t

Re: Built-in CTYPE provider

2024-07-06 Thread Noah Misch
On Fri, Jul 05, 2024 at 02:38:45PM -0700, Jeff Davis wrote: > On Thu, 2024-07-04 at 14:26 -0700, Noah Misch wrote: > > I think you're saying that if some Unicode update changes the results > > of a > > STABLE function but does not change the result of any IMMUTABLE > > function, we > > may as well

Re: XML test error on Arch Linux

2024-07-06 Thread Tom Lane
I wrote: > One angle that ought to be considered is that some of this stuff may > be flat-out bugs in 2.13.0. I see at > https://gitlab.gnome.org/GNOME/libxml2/-/releases > that both 2.13.1 and 2.13.2 contain fixes for "regressions" in 2.13.0. > I'm disinclined to spend much effort on working arou

Refactoring postmaster's code to cleanup after child exit

2024-07-06 Thread Heikki Linnakangas
Reading through postmaster code, I spotted some refactoring opportunities to make it slightly more readable. Currently, when a child process exits, the postmaster first scans through BackgroundWorkerList to see if it was a bgworker process. If not found, it scans through the BackendList to see

Re: Remove dependence on integer wrapping

2024-07-06 Thread Joseph Koshakow
On Thu, Jun 13, 2024 at 12:00 AM Alexander Lakhin wrote: > > And one more with array... > CREATE TABLE t (ia int[]); > INSERT INTO t(ia[2147483647:2147483647]) VALUES ('{}'); I've added another patch, 0003, to resolve this wrap-around. In fact I discovered a bug that the following statement is ac

Re: XML test error on Arch Linux

2024-07-06 Thread Tom Lane
Erik Wienhold writes: > On 2024-07-06 16:25 +0200, Tom Lane wrote: >> Yeah, apparently --- I get what look like the same diffs with >> libxml2 2.13.0 recently supplied by MacPorts. Grumble. >> Somebody's going to have to look into that. > Here's a patch that fixes just the xmlserialize and names

Re: XML test error on Arch Linux

2024-07-06 Thread Erik Wienhold
On 2024-07-06 16:25 +0200, Tom Lane wrote: > Erik Wienhold writes: > > So, there must be breaking changes in 2.13.0: > > https://gitlab.gnome.org/GNOME/libxml2/-/releases/v2.13.0 > > Yeah, apparently --- I get what look like the same diffs with > libxml2 2.13.0 recently supplied by MacPorts. Gru

Re: Add LSN <-> time conversion functionality

2024-07-06 Thread Andrey M . Borodin
Hi! I’m doing another iteration over the patchset. PgStartLSN = GetXLogInsertRecPtr(); Should this be kind of RecoveryEndPtr? How is it expected to behave on Standby in HA cluster, which was doing a crash recovery of 1y WALs in a day, then is in startup for a year as a Hot Standby, and then is

Simplifying width_bucket_numeric()

2024-07-06 Thread Dean Rasheed
In the numeric width_bucket() code, we currently do the following: mul_var(&operand_var, count_var, &operand_var, operand_var.dscale + count_var->dscale); div_var(&operand_var, &bound2_var, result_var, select_div_scale(&operand_var, &bound2_var), true); if (cmp

Re: XML test error on Arch Linux

2024-07-06 Thread Tom Lane
Erik Wienhold writes: > So, there must be breaking changes in 2.13.0: > https://gitlab.gnome.org/GNOME/libxml2/-/releases/v2.13.0 Yeah, apparently --- I get what look like the same diffs with libxml2 2.13.0 recently supplied by MacPorts. Grumble. Somebody's going to have to look into that.

Re: walsender.c comment with no context is hard to understand

2024-07-06 Thread Bertrand Drouvot
Hi, On Fri, Jul 05, 2024 at 11:10:00AM +0530, Amit Kapila wrote: > On Fri, Jun 28, 2024 at 6:30 PM Bertrand Drouvot > wrote: > > > > On Fri, Jun 28, 2024 at 03:15:22PM +0530, Amit Kapila wrote: > > > On Fri, Jun 28, 2024 at 12:55 PM Peter Smith > > > wrote: > > > > > > > > > > I don't know whet

Re: Add GiST support for mixed-width integer operators

2024-07-06 Thread Andrey M. Borodin
> On 5 Jul 2024, at 23:46, Paul Jungwirth wrote: > > this commit adds support for all combinations of int2/int4/int8 for all five > btree operators (=/>). Looks like a nice feature to have. Would it make sense to do something similar to float8? Or, perhaps, some other types from btree_gist?

Re: XML test error on Arch Linux

2024-07-06 Thread Erik Wienhold
On 2024-07-06 11:57 +0200, Frank Streitzig wrote: > >> My system is a Arch Linux. > >> I get after upgrade the libxml2 package (from 2.12.7-1 to 2.13.1-1) > >> test errors for xml: > >> > >> not ok 202 + xml 1464 ms > >> [...snip...] > >> # 1 of 222 tests fai

Add memory/disk usage for WindowAgg nodes in EXPLAIN

2024-07-06 Thread Tatsuo Ishii
1eff8279d4 added memory/disk usage for materialize nodes in EXPLAIN ANALYZE. In the commit message: > There are a few other executor node types that use tuplestores, so we > could also consider adding these details to the EXPLAIN ANALYZE for > those nodes too. So I wanted to Add memory/disk usage

Re: Optimize numeric multiplication for one and two base-NBASE digit multiplicands.

2024-07-06 Thread Joel Jacobson
On Sat, Jul 6, 2024, at 11:34, Dean Rasheed wrote: > On Fri, 5 Jul 2024 at 18:37, Joel Jacobson wrote: >> >> On Fri, Jul 5, 2024, at 18:42, Joel Jacobson wrote: >> > Very nice, v7-optimize-numeric-mul_var-small-var1-arbitrary-var2.patch >> > is now the winner on all my CPUs: >> >> I thought it wou

Re: XML test error on Arch Linux

2024-07-06 Thread Frank Streitzig
>> My system is a Arch Linux. >> I get after upgrade the libxml2 package (from 2.12.7-1 to 2.13.1-1) >> test errors for xml: >> >> not ok 202 + xml 1464 ms >> [...snip...] >> # 1 of 222 tests failed. >> # The differences that caused some tests to fail can be

Re: Should we document how column DEFAULT expressions work?

2024-07-06 Thread Pantelis Theodosiou
On Thu, Jun 27, 2024 at 1:11 AM Tom Lane wrote: > > David Rowley writes: > > Maybe I'm slow on the uptake, but I've yet to see anything here where > > time literals act in a special way DEFAULT constraints. This is why I > > couldn't understand why we should be adding documentation about this > >

Re: Optimize numeric multiplication for one and two base-NBASE digit multiplicands.

2024-07-06 Thread Dean Rasheed
On Fri, 5 Jul 2024 at 18:37, Joel Jacobson wrote: > > On Fri, Jul 5, 2024, at 18:42, Joel Jacobson wrote: > > Very nice, v7-optimize-numeric-mul_var-small-var1-arbitrary-var2.patch > > is now the winner on all my CPUs: > > I thought it would be interesting to also measure the isolated effect > on

Re: Should consider materializing the cheapest inner path in consider_parallel_nestloop()

2024-07-06 Thread Richard Guo
On Wed, Jun 19, 2024 at 10:55 AM Tender Wang wrote: > Richard Guo 于2024年6月18日周二 17:24写道: >> I updated the patch to include a check in consider_parallel_nestloop >> ensuring that inner_cheapest_total is not parameterized by outerrel >> before materializing it. I also tweaked the comments, test ca

Re: Show WAL write and fsync stats in pg_stat_io

2024-07-06 Thread Nitin Jadhav
> Perhaps Nitin was thinking of a scenario in which WAL hits are counted > as hits on the same IOObject as shared buffer hits. Since this thread > has been going on for awhile and we haven't recently had a schema > overview, I could understand if there was some confusion Yes. I was considering a s

MERGE/SPLIT partition commands should create new partitions in the parent's tablespace?

2024-07-06 Thread Fujii Masao
Hi, I noticed that ALTER TABLE MERGE PARTITIONS and SPLIT PARTITION commands always create new partitions in the default tablespace, regardless of the parent's tablespace. However, the indexes of these new partitions inherit the tablespaces of their parent indexes. This inconsistency seems odd. I