Re: [PATCH] initdb: Treat empty -U argument as unset username

2025-07-05 Thread Jianghua Yang
Hello Daniel, Tom lane I wanted to ask if this patch can be merged first, as it seems to be a separate issue different from the aclitem parsing problem Tom discussed in https://www.postgresql.org/message-id/3792884.1751492172%40sss.pgh.pa.us

Re: [PATCH] initdb: Treat empty -U argument as unset username

2025-07-02 Thread Jianghua Yang
to discuss the `getid()` and `aclitem` parsing behavior in a separate thread. Best regards, Jianghua Yang Peter Eisentraut 于2025年7月2日周三 07:39写道: > On 02.07.25 04:55, Jianghua Yang wrote: > > While working with `initdb`, I noticed that passing an empty string to > > the `-U`

Re: [PATCH] initdb: Treat empty -U argument as unset username

2025-07-02 Thread Jianghua Yang
lso brings consistency with existing checks, such as the one disallowing superuser names starting with `pg_`. Let me know if this looks acceptable or if further refinement is needed. Patch attached. Best regards, Jianghua Yang Daniel Gustafsson 于2025年7月2日周三 00:16写道: > > On 2 Jul 2025, at 06:

Re: [PATCH] initdb: Treat empty -U argument as unset username

2025-07-02 Thread Jianghua Yang
en in the adjacent `--username` test. Let me know if any further adjustments are needed. Best regards, Jianghua Yang Dagfinn Ilmari Mannsåker 于2025年7月2日周三 07:09写道: > Jianghua Yang writes: > > > - A regression test is added to `src/bin/initdb/t/001_initdb.pl` to > verify > >

Re: [PATCH] initdb: Treat empty -U argument as unset username

2025-07-01 Thread Jianghua Yang
check was changed from strlen(username) == 0 to !username, but this inadvertently stopped handling the empty-string case. This patch restores the original intent and makes the behavior consistent. David G. Johnston 于2025年7月1日周二 20:12写道: > On Tue, Jul 1, 2025 at 7:56 PM Jianghua Yang wrote: >

[PATCH] initdb: Treat empty -U argument as unset username

2025-07-01 Thread Jianghua Yang
the logic consistent with the existing behavior when `-U` is omitted Let me know if this approach seems reasonable or if you’d prefer we explicitly reject empty usernames with an error instead. Patch attached. Best regards, Jianghua Yang 0001-initdb-Treat-empty-U-argument-as-unset-username.patch Description: Binary data

Re: [PATCH] Use DatumGetUInt32() for dsm_attach() in test_shm_mq_main()

2025-06-27 Thread Jianghua Yang
Hi Nathan, Thank you for submitting this patch. Best regards, Jianghua Nathan Bossart 于2025年6月27日周五 11:44写道: > Committed. > > -- > nathan >

Re: [PATCH] Use DatumGetUInt32() for dsm_attach() in test_shm_mq_main()

2025-06-26 Thread Jianghua Yang
Int32()`. Thanks, Jianghua yang Nathan Bossart 于2025年6月26日周四 13:31写道: > On Thu, Jun 26, 2025 at 12:51:10PM -0700, Jianghua Yang wrote: > > The argument passed to `dsm_attach()` is expected to be a `uint32`, but > the > > code currently uses `DatumGetInt32()` to ext

[PATCH] Use DatumGetUInt32() for dsm_attach() in test_shm_mq_main()

2025-06-26 Thread Jianghua Yang
'unable to map dynamic shared memory segment'. This patch changes it to use `DatumGetUInt32()` to match the expected type and ensure correctness. Thanks, Jianghua Yang 0001-Fix-type-mismatch-in-dsm_attach-argument-by-using-Da.patch Description: Binary data

[PATCH] Fix potential overflow in binary search mid calculation

2025-03-31 Thread Jianghua Yang
Dear PostgreSQL Developers, I have identified a potential integer overflow issue in the binary search implementation within the DSA size class lookup code. Issue Description In the current implementation, the calculation of mid is performed as: uint16 mid = (max + min) / 2; Since both max and m

Re: Use CLOCK_MONOTONIC_COARSE for instr_time when available

2025-03-27 Thread Jianghua Yang
*I agree, so this patch only affects explain analyze.* *1. This change to CLOCK_MONOTONIC_COARSE only affects EXPLAIN ANALYZE and does not impact other modules.* The patch introduces optional support for CLOCK_MONOTONIC_COARSE specifically within the INSTR_TIMEinstrumentation framework. The modif

Re: Use CLOCK_MONOTONIC_COARSE for instr_time when available

2025-03-26 Thread Jianghua Yang
It Makes sense, but we can distinguish such code which needs ` CLOCK_MONOTONIC`. Now I add the configure option `--with-clock-monotonic-coarse`. Michael Paquier 于2025年3月26日周三 15:34写道: > On Wed, Mar 26, 2025 at 11:14:47AM -0700, 杨江华 wrote: > > This patch modifies the instr_time.h header to pref