Re: IndexAmRoutine aminsertcleanup function can be NULL?

2025-07-16 Thread Japin Li
lso in the documentation... [2] > > == > [1] > https://github.com/postgres/postgres/blob/master/src/include/access/amapi.h > [2] https://www.postgresql.org/docs/devel/index-api.html > How about asserting the existence of all required callbacks, similar to GetTableAmRoutine()? -- Regards, Japin Li

Re: Requested WAL segment xxx has already been removed

2025-07-15 Thread Japin Li
On Tue, 15 Jul 2025 at 11:24, Alexander Kukushkin wrote: > Hi, > > On Mon, 14 Jul 2025 at 11:24, Japin Li wrote: > > The configuration is as expected. My test script simulates two distinct hosts > by utilizing local archive storage. > > For physical replication acros

Re: Requested WAL segment xxx has already been removed

2025-07-14 Thread Japin Li
On Mon, 14 Jul 2025 at 20:33, Fujii Masao wrote: > On 2025/07/14 17:08, Japin Li wrote: >> Hi all, >> I recently hit an error with our streaming replication setup: >>2025-07-14 11:52:59.361 >> CST,"replicator","",728458,"10.9.9.74:35724&qu

Re: [WIP]Vertical Clustered Index (columnar store extension) - take2

2025-07-14 Thread Japin Li
On Mon, 14 Jul 2025 at 18:47, Peter Smith wrote: > Hi Japin, > > Thanks for your README questions. > > On Fri, Jul 11, 2025 at 7:18 PM Japin Li wrote: > ... >> >> 3. >> In the README, 'TID' seems to have conflicting definitions: >> Trans

Re: Requested WAL segment xxx has already been removed

2025-07-14 Thread Japin Li
On Mon, 14 Jul 2025 at 10:21, Alexander Kukushkin wrote: > On Mon, 14 Jul 2025 at 10:08, Japin Li wrote: > > Hi all, > > I recently hit an error with our streaming replication setup: > >2025-07-14 11:52:59.361 > > CST,"replicator","&

Requested WAL segment xxx has already been removed

2025-07-14 Thread Japin Li
the archive if restore_command is set? I found that Fujii Masao also requested this feature [1], but it seems there wasn't a consensus. I've attached a script to reproduce this issue. [1] https://www.postgresql.org/message-id/AANLkTinN%3DxsPOoaXzVFSp1OkfMDAB1f_d-F91xjEZDV8%40mail.gmail.co

Re: track needed attributes in plan nodes for executor use

2025-07-11 Thread Japin Li
ason > to avoid enabling this optimization more broadly across plan nodes. > > I'll post the PoC patches and performance measurements. Posting this > in advance to get feedback on the proposed direction and where best to > place attr_used. > That's interesting. If I understand correctly, this approach wouldn't work if the first attribute is variable-length, right? -- Regards, Japin Li

Re: [WIP]Vertical Clustered Index (columnar store extension) - take2

2025-07-11 Thread Japin Li
On Fri, 11 Jul 2025 at 16:31, Peter Smith wrote: > Hi. Here is the latest patch set v12* > > Main differences are: > > Patch 0001 (core) > - removed SizeOfIptrData macro, as reported by Tomas [1] and Japin [2] > > Patch 0002 (vci module) > - Made fixes so the "ROS

Re: [WIP]Vertical Clustered Index (columnar store extension) - take2

2025-07-10 Thread Japin Li
On Thu, 10 Jul 2025 at 17:51, Peter Smith wrote: > On Thu, Jul 10, 2025 at 4:07 PM Japin Li wrote: > ... >> I'm still trying to understand the patches. >> >> diff --git a/src/include/storage/itemptr.h b/src/include/storage/itemptr.h >> index 74b87a9..d97d1c5

Re: [WIP]Vertical Clustered Index (columnar store extension) - take2

2025-07-09 Thread Japin Li
On Tue, 08 Jul 2025 at 10:11, Peter Smith wrote: > Hi. Here is the latest patch set. > > Main differences are: > > Patch 0001 (core) > - removed embedded vci code from autovacuum.c / postinit.c (now these > are same as master) > > Patch 0002 (vci module) > - a few changes to facilitate the fix to

Re: Inconsistent LSN format in pg_waldump output

2025-07-07 Thread Japin Li
On Mon, 07 Jul 2025 at 14:18, Álvaro Herrera wrote: > On 2025-Jul-05, Masahiko Sawada wrote: > >> On Fri, Jul 4, 2025 at 8:01 PM Álvaro Herrera wrote: >> > >> > On 2025-Jul-04, Japin Li wrote: >> > >> > > I've opted to directly use %

Re: Inconsistent LSN format in pg_waldump output

2025-07-07 Thread Japin Li
On Mon, 07 Jul 2025 at 19:34, Ashutosh Bapat wrote: > On Fri, Jul 4, 2025 at 5:18 PM Álvaro Herrera wrote: >> >> On 2025-Jul-04, Japin Li wrote: >> >> > I've opted to directly use %X/%08X for LSN formatting in this patch, with >> > an >> > a

Re: [WIP]Vertical Clustered Index (columnar store extension) - take2

2025-07-03 Thread Japin Li
imur suggests that this also unused code anyway. Investigating...) >> > > Fixed (removed) in v10. > Hi, Perter When trying vic, I received the following error: TRAP: failed Assert("TransactionIdIsNormal(xmax)"), File: "/data/Codes/pg/master/build/../src/backend/acc

Re: Making pg_rewind faster

2025-07-03 Thread Japin Li
On Thu, 03 Jul 2025 at 12:59, John H wrote: > Hi, > > On Wed, Jul 2, 2025 at 6:40 PM Japin Li wrote: >> >> > >> >> Splitting the logs from $PGDATA is definitely better. The question is whether >> it's worth implementing this directly in core or if

Re: Inconsistent LSN format in pg_waldump output

2025-07-03 Thread Japin Li
and add the description to the LSN_FORMAT_ARGS macro. > The GNU gettext manual suggests you can print the value to a string > variable and then use %s to include that in the translatable string, but > I doubt that's an improvement over just using %X/%08X directly. > Bottom of this page here: > https://www.gnu.org/software/gettext/manual/html_node/No-string-concatenation.html > Yes, I don't consider that an improvement. -- Regards, Japin Li

Re: Fix outdated comments for IndexInfo

2025-07-02 Thread Japin Li
On Wed, 02 Jul 2025 at 09:57, Peter Eisentraut wrote: > On 01.05.25 15:47, Japin Li wrote: >> On Thu, 01 May 2025 at 12:13, Peter Eisentraut wrote: >>> On 30.04.25 17:48, Japin Li wrote: >>>> While working on [1], I found outdated comments in IndexInfo. >>

Re: Making pg_rewind faster

2025-07-02 Thread Japin Li
gt; off as well. I'd also think you would want to avoid putting the logs > in $PGDATA to have smaller backups if you are using tools like > pg_basebackup. > Splitting the logs from $PGDATA is definitely better. The question is whether it's worth implementing this directly in cor

Re: Making pg_rewind faster

2025-07-01 Thread Japin Li
tion for handling file content types? 2. Perhaps decide_wal_file_action() could be defined in filemap.c. While this is unrelated to WAL logging, it could also contribute to faster pg_rewind operations. Should we consider ignoring log files under PGDATA (e.g., those in the default log/ directory)? -- Regards, Japin Li

Re: Inconsistent LSN format in pg_waldump output

2025-07-01 Thread Japin Li
On Tue, 01 Jul 2025 at 13:39, Álvaro Herrera wrote: > On 2025-Jul-01, Japin Li wrote: > >> This inconsistency, while minor, could be confusing when cross-referencing >> LSNs within pg_waldump's own output or when parsing it programmatically. > > I agree that we should

Inconsistent LSN format in pg_waldump output

2025-07-01 Thread Japin Li
t;rmgr: %-11s len (rec/tot): %6u/%6u, tx: %10u, lsn: %X/%08X, prev %X/%08X, ", This inconsistency, while minor, could be confusing when cross-referencing LSNs within pg_waldump's own output or when parsing it programmatically. -- Regards, Japin Li >From b38d020375481ae54aaf745bee58

pg_probackup build issue with PostgreSQL 18beta1 due to pg_detoast_datum_packed()

2025-06-04 Thread Japin Li
Hi, hackers I've run into a build issue when trying to use pg_probackup with PostgreSQL 18beta1. After some adjustments to pg_probackup, I encountered the following linker errors: /usr/bin/ld: src/pg_crc.o: in function `crc32_bytea': /home/japin/Codes/extensions/pg_probackup/src/pg

Re: Encapsulate io_uring process count calculation

2025-06-03 Thread Japin Li
On Tue, 03 Jun 2025 at 13:27, Michael Paquier wrote: > On Tue, Jun 03, 2025 at 12:16:21PM +0800, Japin Li wrote: >> I've replaced the hardcoded arithmetic expression for calculating TotalProcs >> within the pgaio_uring_shmem_init() with a call to the dedicated >> pg

Encapsulate io_uring process count calculation

2025-06-02 Thread Japin Li
be updated in one place. -- Regards, Japin Li >From c3477213ff64788d32430361a8298c8f8a958238 Mon Sep 17 00:00:00 2001 From: Japin Li Date: Tue, 3 Jun 2025 12:07:04 +0800 Subject: [PATCH v1] Encapsulate io_uring process count calculation Replace the direct arithmetic expression for TotalProc

Re: Fix outdated comments for IndexInfo

2025-05-01 Thread Japin Li
Hi, Peter and Richard On Thu, 01 May 2025 at 12:13, Peter Eisentraut wrote: > On 30.04.25 17:48, Japin Li wrote: >> While working on [1], I found outdated comments in IndexInfo. >> The attached patch corrects them. >> [1] >> https://www.postgresql.org/message

Fix outdated comments for IndexInfo

2025-04-30 Thread Japin Li
Hi, all While working on [1], I found outdated comments in IndexInfo. The attached patch corrects them. [1] https://www.postgresql.org/message-id/2A40921D-83AB-411E-ADA6-7E509A46F1E4%40logansw.com -- Regrads, Japin Li >From 7c01644860a32ca9ab93367c2f8e34047c9d703f Mon Sep 17 00:00:00 2

Re: Disallow redundant indexes

2025-04-29 Thread Japin Li
> meta-command will be > very useful when there are indexes that are the same except for the > name (and do > not enforce constraints?). This will at least help DBAs quickly spot > such indexes in > their tables. > I agree that psql annotations are helpful, but to accommodate users who don't use it, should we also consider adding a view? -- Regrads, Japin Li

Re: libpq: Add PQapplicationname() function

2025-04-29 Thread Japin Li
and fallback_application_name? Additionally, if a SET application_name TO xxx command is issued during a subsequent connection, will the appname field within the PGconn structure be updated promptly? -- Regrads, Japin Li

Re: Disallow redundant indexes

2025-04-24 Thread Japin Li
Hi, Greg and David Thank you for your feedback. On Thu, 24 Apr 2025 at 08:26, Greg Sabino Mullane wrote: > On Thu, Apr 24, 2025 at 7:31 AM David Rowley wrote: > > On Thu, 24 Apr 2025 at 21:27, Japin Li wrote: > > I propose that PostgreSQL prevent redundant index creation

Disallow redundant indexes

2025-04-24 Thread Japin Li
nance - Enhance efficiency and user flexibility I’d love to hear your feedback or suggestions for improvement. [1] https://docs.oracle.com/en/error-help/db/ora-01408/?r=19c -- Regrads, Japin Li

Re: Remove unnecessary static type qualifiers

2025-04-08 Thread Japin Li
sizeof(qbuf), "set client_encoding to > '%s'", encoding); > + if (len >= sizeof(qbuf)) > return -1; > > /* ok, now send a query */ > - sprintf(qbuf, query, encoding); > res = PQexec(conn, qbuf); > > if (res == NULL) > Thank you for all the explanations! The above code looks good to me, except for a minor issue; since snprintf may return a negative value, should we check for this? -- Regrads, Japin Li

Remove unnecessary static type qualifiers

2025-04-08 Thread Japin Li
;%s'"; PGresult *res; int status; -- Regrads, Japin Li

Remove unused header file in pqcomm.c

2025-02-26 Thread Japin Li
omm.c +++ b/src/backend/libpq/pqcomm.c @@ -53,9 +53,6 @@ */ #include "postgres.h" -#ifdef HAVE_POLL_H -#include -#endif #include #include #include -- Regrads, Japin Li

Re: test_escape: invalid option -- 'c'

2025-02-18 Thread Japin Li
ils even for successes\n" " -q, --quiet only show failures\n" - " --force-unsupported test invalid input even if unsupported\n" + " -f, --force-unsupported test invalid input even if unsupported\n" ); if (hint) -- Regrads, Japin Li

Re: Modify an incorrect regression test case in the group by key value elimination function

2025-02-18 Thread Japin Li
NOT NULL "c" > Access method: heap > > postgres=# > > I think this test case does not fully reflect the original meaning. So I made > a small change to this and look forward to > your feedback. Thanks! > Yeah, the primary key of t3 is deferred, so only the t3_c_uidx can be used. The test case is inconsistent with comments. It seems that the t2 does not have a unique index on z, do you forget to create it in the patch? -- Regrads, Japin Li

test_escape: invalid option -- 'c'

2025-02-17 Thread Japin Li
ng_options, &option_index)) != -1) + while ((c = getopt_long(argc, argv, "c:vqh", long_options, &option_index)) != -1) { switch (c) { -- Regrads, Japin Li

Re: Incorrect translator comment for ListenServerPort()?

2025-02-17 Thread Japin Li
On Mon, 17 Feb 2025 at 15:45, Daniel Gustafsson wrote: >> On 17 Feb 2025, at 15:39, Japin Li wrote: > >> When I read the ListenServerPort(), I noticed two incorrect translator >> implementations: 1) the translator for setsockopt(SO_REUSEADDR), which >> should not be &q

Incorrect translator comment for ListenServerPort()?

2025-02-17 Thread Japin Li
ot;, familyDesc, addrDesc))); -- Regrads, Japin Li

Re: [RFC] Lock-free XLog Reservation from WAL

2025-02-10 Thread Japin Li
On Mon, 10 Feb 2025 at 22:12, "Zhou, Zhiguo" wrote: > On 2/5/2025 4:32 PM, Japin Li wrote: >> On Mon, 27 Jan 2025 at 17:30, "Zhou, Zhiguo" wrote: >>> On 1/26/2025 10:59 PM, Yura Sokolov wrote: >>>> 24.01.2025 12:07, Japin Li пишет: >>>

Re: proposal - plpgsql - support standard syntax for named arguments for cursors

2025-02-08 Thread Japin Li
y peeked, so the error should never +* Eat the ":=" and "=>". We already peeked, so the error should never * happen. */ tok2 = yylex(yylvalp, yyllocp, yyscanner); -- Regrads, Japin Li

Re: Modern SHA2- based password hashes for pgcrypto

2025-02-07 Thread Japin Li
On Fri, 07 Feb 2025 at 10:31, Alvaro Herrera wrote: > On 2025-Feb-07, Japin Li wrote: > >> Since there is no standard, how do we handle this? I prefer to use >> the strict mode like passlib. > > I definitely like that passlib have documented their thought process > th

Re: Modern SHA2- based password hashes for pgcrypto

2025-02-07 Thread Japin Li
s > should be viewed as an absolute minimum). > > This "Password Hashing Competition" organization hardly seems an > authority though. It'd be great to have an IETF standard about this ... Yeah. Since there is no standard, how do we handle this? I prefer to use the strict mode like passlib. -- Regrads, Japin Li

Re: Trigger more frequent autovacuums of heavy insert tables

2025-02-06 Thread Japin Li
file or on the server command line; but the setting can be overridden for individual tables by -- Regrads, Japin Li

Re: Remove unnecessary static specifier

2025-02-05 Thread Japin Li
t" modifiers at use sites, too.) > > Good point, from the link referenced it's clear that FreeBSD has made that > change as well. I'll fix that at the same time. > Oh, I didn't notice this. +1. -- Regrads, Japin Li

Remove unnecessary static specifier

2025-02-05 Thread Japin Li
[2] https://reviews.freebsd.org/D7306 -- Regrads, Japin Li

Re: [RFC] Lock-free XLog Reservation from WAL

2025-02-05 Thread Japin Li
On Mon, 27 Jan 2025 at 17:30, "Zhou, Zhiguo" wrote: > On 1/26/2025 10:59 PM, Yura Sokolov wrote: >> 24.01.2025 12:07, Japin Li пишет: >>> On Thu, 23 Jan 2025 at 21:44, Japin Li wrote: >>>> On Thu, 23 Jan 2025 at 15:03, Yura Sokolov >>>> wrot

Re: Modern SHA2- based password hashes for pgcrypto

2025-01-26 Thread Japin Li
ad security and should be rejected. If we did so in the past > without noticing, that's bad already, but we should not replicate that > behavior any further. > I agree with this point, so maybe we should fix this for px_crypt_md(). -- Regrads, Japin Li

Re: [RFC] Lock-free XLog Reservation from WAL

2025-01-24 Thread Japin Li
On Thu, 23 Jan 2025 at 21:44, Japin Li wrote: > On Thu, 23 Jan 2025 at 15:03, Yura Sokolov wrote: >> 23.01.2025 11:46, Japin Li пишет: >>> On Wed, 22 Jan 2025 at 22:44, Japin Li wrote: >>>> On Wed, 22 Jan 2025 at 17:02, Yura Sokolov >>>> wrote: >&g

Re: Compression of bigger WAL records

2025-01-23 Thread Japin Li
l branch and stop patching, run "git am --abort". I see the patch compresses the WAL record according to the wal_compression, IIRC the wal_compression is only used for FPI, right? Maybe we should update the description of this parameter. I see that the wal_compression_threshold defaults to 512. I wonder if you chose this value based on testing or randomly. -- Regrads, Japin Li

Re: Increase NUM_XLOGINSERT_LOCKS

2025-01-23 Thread Japin Li
On Thu, 23 Jan 2025 at 15:50, Yura Sokolov wrote: > 23.01.2025 08:41, wenhui qiu wrote: >> HI Japin >>      Thank you for you test ,It seems NUM_XLOGINSERT_LOCKS 64 >> is great , I think it doesn't need to grow much,What do you think? > > I agree: while 128 shows

Re: [RFC] Lock-free XLog Reservation from WAL

2025-01-23 Thread Japin Li
On Thu, 23 Jan 2025 at 15:03, Yura Sokolov wrote: > 23.01.2025 11:46, Japin Li пишет: >> On Wed, 22 Jan 2025 at 22:44, Japin Li wrote: >>> On Wed, 22 Jan 2025 at 17:02, Yura Sokolov wrote: >>>> I believe, I know why it happens: I was in hurry making v2 by >>&

Re: Modern SHA2- based password hashes for pgcrypto

2025-01-23 Thread Japin Li
g the `l` suffix, since both PX_SHACRYPT_ROUNDS_MIN and PX_SHACRYPT_ROUNDS_MAX have this suffix. 5. Does the following work as expected? postgres=# select crypt('hello', '$5$$6$rounds=1$/Zg436s2vmTwsoSz'); crypt - $5$$TCRu/ts4Npu8OJyeWy2WnUHCe/6bKVMSi0sROUrPh48 (1 row) postgres=# select crypt('hello', '$5$rounds=1$/Zg436s2vmTwsoSz'); crypt -- $5$rounds=1$/Zg436s2vmTwsoSz$N4Ad0oGzE6ak30z4EGSEXOc2OXQOpmauicPT3560lY2 (1 row) According to the documentation, I think the first should output as following: $5$rounds=5000$TCRu/ts4Npu8OJyeWy2WnUHCe/6bKVMSi0sROUrPh48 -- Regrads, Japin Li

Re: [RFC] Lock-free XLog Reservation from WAL

2025-01-23 Thread Japin Li
On Wed, 22 Jan 2025 at 22:44, Japin Li wrote: > On Wed, 22 Jan 2025 at 17:02, Yura Sokolov wrote: >> I believe, I know why it happens: I was in hurry making v2 by >> cherry-picking internal version. I reverted some changes in >> CalcCuckooPositions manually and

Re: Increase NUM_XLOGINSERT_LOCKS

2025-01-22 Thread Japin Li
tested the patch on Hygon C86 7490 64-core using benchmarksql 5.0 with 500 warehouses and 256 terminals run time 10 mins: | case | min | avg | max | |+--+--+--| | master (4108440) | 891,225.77 | 904,868.75 | 913,708.17 | | lock 64| 1,007,716.95 | 1,012,013.22 | 1,018,674.00 | | lock 64 attempt 1 | 1,016,716.07 | 1,017,735.55 | 1,019,328.36 | | lock 64 attempt 2 | 1,015,328.31 | 1,018,147.74 | 1,021,513.14 | | lock 128 | 1,010,147.38 | 1,014,128.11 | 1,018,672.01 | | lock 128 attempt 1 | 1,018,154.79 | 1,023,348.35 | 1,031,365.42 | | lock 128 attempt 2 | 1,013,245.56 | 1,018,984.78 | 1,023,696.00 | I didn't NUM_XLOGINSERT_LOCKS with 16 and 32, however, I tested it with 256, and got the following error: 2025-01-23 02:23:23.828 CST [333524] PANIC: too many LWLocks taken I hope this test will be helpful. -- Regrads, Japin Li

Re: [RFC] Lock-free XLog Reservation from WAL

2025-01-22 Thread Japin Li
tegies + "8 positions in two cache-lines" strategy. > > You may play with switching PREV_LINKS_HASH_STRATEGY to 2 or 3 and see > if it affects measurably. Thanks for your quick fixing. I will retest it tomorrow. -- Regrads, Japin Li

Re: [RFC] Lock-free XLog Reservation from WAL

2025-01-22 Thread Japin Li
On Wed, 22 Jan 2025 at 16:49, Japin Li wrote: > On Wed, 22 Jan 2025 at 11:22, Yura Sokolov wrote: >> 22.01.2025 10:54, Japin Li пишет: >>> On Wed, 22 Jan 2025 at 10:25, Yura Sokolov wrote: >>>> 22.01.2025 09:09, Japin Li пишет: >>>>> Hi, Yura Sokolov

Re: [RFC] Lock-free XLog Reservation from WAL

2025-01-22 Thread Japin Li
On Wed, 22 Jan 2025 at 11:22, Yura Sokolov wrote: > 22.01.2025 10:54, Japin Li пишет: >> On Wed, 22 Jan 2025 at 10:25, Yura Sokolov wrote: >>> 22.01.2025 09:09, Japin Li пишет: >>>> Hi, Yura Sokolov >>>> Thanks for updating the patch. >>>>

Re: [RFC] Lock-free XLog Reservation from WAL

2025-01-21 Thread Japin Li
On Wed, 22 Jan 2025 at 10:25, Yura Sokolov wrote: > 22.01.2025 09:09, Japin Li пишет: >> Hi, Yura Sokolov >> Thanks for updating the patch. >> I test the v2 patch using BenchmarkSQL 1000 warehouse, and here is the tpmC >> result: >> case

Re: [RFC] Lock-free XLog Reservation from WAL

2025-01-21 Thread Japin Li
/patch:37: space before tab in indent. { .git/rebase-apply/patch:38: space before tab in indent. int i; .git/rebase-apply/patch:39: trailing whitespace. .git/rebase-apply/patch:46: space before tab in indent. LWLockReleaseClearVar(&WALInsertLocks[i].l.lock, warning: squelched 4 whitespace errors warning: 9 lines add whitespace errors. 2. And there is a typo: + * PrevLinksHash is a lock-free hash table based on Cuckoo algorith. It is + * mostly 4 way: for every element computed two positions h1, h2, and s/algorith/algorithm/g -- Regrads, Japin Li

Re: RFC: Lock-free XLog Reservation from WAL

2025-01-05 Thread Japin Li
--with-lz4 \ --with-pam \ CFLAGS='-Wmissing-prototypes -Wincompatible-pointer-types' make -j $(nproc) -s && make install -s (cd contrib/ && make -j $(nproc) -s && make install -s) make check-

Re: Modern SHA2- based password hashes for pgcrypto

2025-01-03 Thread Japin Li
On Fri, 03 Jan 2025 at 17:55, Bernd Helmle wrote: > Am Freitag, dem 03.01.2025 um 23:57 +0800 schrieb Japin Li: >> >> Greate!  I have some questions after using it. >> >> When I use the following query, it crashed! >> >> [local]:4012204 postgres=# selec

Re: Modern SHA2- based password hashes for pgcrypto

2025-01-03 Thread Japin Li
6s2vmTwsoSz'); Maybe we should add CHECK_FOR_INTERRUPTS() in step 21. @@ -411,6 +411,7 @@ px_crypt_shacrypt(const char *pw, const char *salt, char *passwd, unsigned dstle *uses the notation "digest A/B" to describe this behavior. */ for (block = 0; block < rounds; block++) { +CHECK_FOR_INTERRUPTS(); /* a) start digest B */ px_md_reset(digestB); -- Regrads, Japin Li

Correct the reference for plpgsql_yyparse()

2024-12-30 Thread Japin Li
Hi, hackers When I read the PL/pgSQL source code, I found that plpgsql_yyparse() is defined in pl_gram.y, however, the comment says it is defined in gram.y. PFA. -- Regrads, Japin Li >From 9629535310eef217f195fc3526d8227b9f6ab29c Mon Sep 17 00:00:00 2001 From: Japin Li Date: Mon, 30

Fix typo in comment of compute_return_type()

2024-12-25 Thread Japin Li
Hi, hackers When I reading the implementation of CreateFunction(), I found there is a typo in comment of compute_return_type(). -- Regrads, Japin Li >From 3a1008c692a919d55a456a7fa34e07d9c93879dd Mon Sep 17 00:00:00 2001 From: Li Jianping Date: Wed, 25 Dec 2024 14:39:15 +0800 Subject: [PA

Re: Parametrization minimum password lenght

2024-12-24 Thread Japin Li
e the original branch and stop patching, run "git am --abort". The comment of prev_check_password_hook has been changed which case the apply failed. -- Regrads, Japin Li

Re: Auto Vacuum optimisation

2024-11-27 Thread Japin Li
On Wed, 27 Nov 2024 at 15:51, wenhui qiu wrote: > HI Japin Li > Thank you for you reply, Do you think that removing the log2 algorithm > because it will be more frequent,I think sql > server chose sqrt algorithm after their long-term verification, I think we > need to retain

Re: UUID v7

2024-11-26 Thread Japin Li
rgey Prokhorenko just draw my attention to the new release of MariaDB >> >> [0]. They are doing very similar UUID v7 generation as we do [1]. >> >> >> > >> > Thank you for the references. It made me think that we can use the >> > function name uuid_v7() rather than uuidv7(). >> >> I think it's a good idea if we will be kind of SQL-compatible. >> > > Okay, let"s rename it. > > I've merged patches and renamed functions (also updated the commit > message). Please find the attachment. > It seems a typo about uuid_v{4,7}. +uuidv_4 () uuid + + These functions return a version 4 (random) UUID. + +uuidv_7 () uuid -- Regrads, Japin Li

Re: Auto Vacuum optimisation

2024-11-26 Thread Japin Li
we need so many autovacuum algorithms here since it makes the choice harder (maybe). -- Regrads, Japin Li

Re: define pg_structiszero(addr, s, r)

2024-11-01 Thread Japin Li
le overflow? + const char *end = &p[len]; How about use MAXALIGN64 macro here? When handling the aligned, is it possible to handle multiple values (such as 4 or 8) in one iteration? It might be faster. However, I'm not tested. -- Regrads, Japin Li

Re: New function normal_rand_array function to contrib/tablefunc.

2024-11-01 Thread Japin Li
ray() functions. .git/rebase-apply/patch:475: trailing whitespace. rand_array warning: 1 line adds whitespace errors. The other looks good to me. -- Regrads, Japin Li

Re: [PATCH] Support Int64 GUCs

2024-09-25 Thread Li Japin
147_483_648" postgres=# alter system set autovacuum_vacuum_threshold to 2_147_483_647; ALTER SYSTEM ``` IIRC, the lexer only supports integers but not int64. -- Best regards, Japin Li

Re: [PATCH] Support Int64 GUCs

2024-09-24 Thread Li Japin
es the delay. context | user vartype | int64 source | default min_val | 0 max_val | 9223372036854775807 enumvals| boot_val| 0 reset_val | 0 sourcefile | sourceline | pending_restart | f ``` [1] https://www.postgresql.org/docs/current/datatype-numeric.html -- Regrads, Japin Li

Re: New function normal_rand_array function to contrib/tablefunc.

2024-08-27 Thread Japin Li
On Wed, 28 Aug 2024 at 12:27, Andy Fan wrote: > Japin Li writes: > > >> Thanks for updating the patch. Here are some comments. >> >> +if (minlen >= maxlen) >> +ereport(ERROR, >> +

Re: New function normal_rand_array function to contrib/tablefunc.

2024-08-27 Thread Japin Li
; 0) + ereport(ERROR, + (errcode(ERRCODE_INVALID_PARAMETER_VALUE), + errmsg("minlen and maxlen must be greater than zero."))); Here the minlen might be zero, so the error message is incorrect. How about use "minlen must be greater than or equal to zero"? -- Regrads, Japin Li

Remove unnecessary forward declaration for heapam_methods variable

2024-07-30 Thread Japin Li
Hi, I think the forward declaration for heapam_methods variable in heapam_handler.c is unnecessary, right? -- Regrads, Japin Li >From 77a6957e94692b3c4c9437c69cdbcb48ea53f3ee Mon Sep 17 00:00:00 2001 From: Japin Li Date: Wed, 31 Jul 2024 10:01:04 +0800 Subject: [PATCH v1 1/1] Rem

Re: Support "Right Semi Join" plan shapes

2024-07-04 Thread Japin Li
in. > > Here is a new rebase. > > Barring objections, I'm planning to push it soon. > Thanks for updating the patch. It looks good to me, except for a minor nitpick: s/right-semijoin/right-semi join/ -- Regrads, Japin Li

Re: Support "Right Semi Join" plan shapes

2024-06-24 Thread Japin Li
On Mon, 24 Jun 2024 at 17:59, Richard Guo wrote: > Thank you for reviewing. > > On Mon, Jun 24, 2024 at 1:27 PM Li Japin wrote: >> + /* >> +* For now we do not support RIGHT_SEMI join in mergejoin or nestloop >> +* join. >> +

Re: Support "Right Semi Join" plan shapes

2024-06-23 Thread Li Japin
Hi, Richard > On Apr 25, 2024, at 11:28, Richard Guo wrote: > > Here is another rebase with a commit message to help review. I also > tweaked some comments. Thank you for updating the patch, here are some comments on the v5 patch. + /* +* For now we do not support RIGHT_SEMI joi

How about add counted_by attribute for flexible-array?

2024-06-20 Thread Japin Li
e-the-new-counted_by-attribute-in-c-and-linux/ [2] https://reviews.llvm.org/D148381 [3] https://godbolt.org/z/5qKsEhG8o -- Regrads, Japin Li

Re: Support event trigger for logoff

2024-04-22 Thread Japin Li
On Sat, 20 Apr 2024 at 01:36, Tom Lane wrote: > Japin Li writes: >> I see [1] has already implemented on login event trigger, why not implement >> the logoff event trigger? > > What happens if the session crashes, or otherwise fails unexpectedly? > I am currently u

Support event trigger for logoff

2024-04-19 Thread Japin Li
might be running concurrently, which may lead to the checking being unstable. Any thoughts? [1] https://www.postgresql.org/message-id/0d46d29f-4558-3af9-9c85-7774e14a7709%40postgrespro.ru -- Regards, Japin Li >From ef7c6aa408d0a6a97d7b0d2e093b71e279b1b0dc Mon Sep 17 00:00:00 2001 From: Japin

Re: Cannot find a working 64-bit integer type on Illumos

2024-04-18 Thread Japin Li
On Fri, 19 Apr 2024 at 05:22, Thomas Munro wrote: > On Thu, Apr 18, 2024 at 6:09 PM Japin Li wrote: >> /home/japin/postgres/build/../src/include/lib/simplehash.h:1138:9: error: >> format '%llu' expects argument of type 'long long unsigned int', but >>

Re: Cannot find a working 64-bit integer type on Illumos

2024-04-17 Thread Japin Li
header pollution, but meson.build doesn't. That's > an inconsistency that should be fixed, but which way? Hmm, commit > 15abc7788e6 said that was done for BeOS, which we de-supported. So > maybe we should get rid of that? Thanks for working on this! I test the patch and it no

Re: Typo about the SetDatatabaseHasLoginEventTriggers?

2024-04-17 Thread Japin Li
On Wed, 17 Apr 2024 at 14:10, Michael Paquier wrote: > On Tue, Apr 16, 2024 at 03:31:49PM +0900, Michael Paquier wrote: >> Indeed, thanks! Will fix and double-check the surroundings. > > And fixed this one. Thanks for the pushing! -- Regards, Japin Li

Typo about the SetDatatabaseHasLoginEventTriggers?

2024-04-15 Thread Japin Li
onnection waiting on the lock. Thus, we are * just trying to acquire the lock conditionally. */ -- Regards, Japin Li

Re: Table AM Interface Enhancements

2024-04-01 Thread Japin Li
_class tuple > (see AllocateRelationDesc). RelationParseRelOptions() is going to > update relation->rd_options, and thus needs a full pg_class tuple to > fetch options out of it. However, it is really unnecessary to access > both tuples at the same time. We can use a full tuple, not > relation->rd_rel, in both cases. See the attached patch. > > -- > Regards, > Alexander Korotkov + Form_pg_class classForm = (Form_pg_class) GETSTRUCT(tuple); +; There is an additional semicolon in the code. -- Regards, Japin Li

Fix parameters order for relation_copy_for_cluster

2024-04-01 Thread Japin Li
cutoff, multi_cutoff, num_tuples, tups_vacuumed, tups_recently_dead); } It's a bit confusing, so attach a patch to fix this. -- Regards, Japin Li diff --git a/src/include/access/tabl

Re: Table AM Interface Enhancements

2024-03-28 Thread Japin Li
bleam = GetHeapamTableAmRoutine(); + } + amoptsfn = relation->rd_indam->amoptions; + } - We can reduce the indentation by moving the classFrom and classTup into the if branch. - Perhaps we could remove the brace of else branch to maintain consistency in the code style. -- Regards, Japin Li

Re: Cannot find a working 64-bit integer type on Illumos

2024-03-24 Thread Japin Li
On Mon, 25 Mar 2024 at 09:32, Tom Lane wrote: > Japin Li writes: >> /home/japin/postgres/debug/../src/bin/pg_dump/pg_dump_sort.c: In function >> 'repairDependencyLoop': >> /home/japin/postgres/debug/../src/bin/pg_dump/pg_dump_sort.c:1276:3: error: >> form

Re: Cannot find a working 64-bit integer type on Illumos

2024-03-24 Thread Japin Li
On Sat, 23 Mar 2024 at 01:22, Japin Li wrote: > On Sat, 23 Mar 2024 at 01:04, Tom Lane wrote: >> Japin Li writes: >>> When I try to configure PostgreSQL 16.2 on Illumos using the following >>> command, >>> it complains $subject. >> >>> .

Re: Cannot find a working 64-bit integer type on Illumos

2024-03-22 Thread Japin Li
On Sat, 23 Mar 2024 at 01:04, Tom Lane wrote: > Japin Li writes: >> When I try to configure PostgreSQL 16.2 on Illumos using the following >> command, >> it complains $subject. > >> ./configure --enable-cassert --enable-debug --enable-nls --with-perl \ >&g

Cannot find a working 64-bit integer type on Illumos

2024-03-22 Thread Japin Li
Hi, hackers, When I try to configure PostgreSQL 16.2 on Illumos using the following command, it complains $subject. ./configure --enable-cassert --enable-debug --enable-nls --with-perl \ --with-python --without-tcl --without-gssapi --with-openssl \ --with-ldap --with-libxml --wi

Re: Table AM Interface Enhancements

2024-03-19 Thread Japin Li
ent_xact_tuple() >> >> I'd propose changes for clarity of this comment: >> %s/a storage tuples/storage tuples/g >> %s/generally//g >> >> Otherwise patch 0005 also looks good to me. >> >> I'm planning to review the remaining pat

Re: Improve readability by using designated initializers when possible

2024-03-11 Thread Japin Li
On Fri, 08 Mar 2024 at 13:21, Michael Paquier wrote: > On Wed, Mar 06, 2024 at 08:24:09AM +0800, Japin Li wrote: >> On Wed, 06 Mar 2024 at 01:53, Jelte Fennema-Nio wrote: >>> I think if you remove the EEO_CASE(EEOP_LAST) block the warning should >>> go away. That

Re: Improve readability by using designated initializers when possible

2024-03-05 Thread Japin Li
On Wed, 06 Mar 2024 at 01:53, Jelte Fennema-Nio wrote: > On Tue, 5 Mar 2024 at 15:30, Japin Li wrote: >> There is a warning if remove it, so I keep it. >> >> /home/japin/Codes/postgres/build/../src/backend/executor/execExprInterp.c:118:33: >> warning: label ‘CASE

Re: Improve readability by using designated initializers when possible

2024-03-05 Thread Japin Li
On Tue, 05 Mar 2024 at 22:03, Jelte Fennema-Nio wrote: > On Tue, 5 Mar 2024 at 14:50, Japin Li wrote: >> Attach a patch to rewrite dispatch_table array using C99-designated >> initializer syntax. > > Looks good. Two small things: Thanks for the review. &

Re: Improve readability by using designated initializers when possible

2024-03-05 Thread Japin Li
gt; previous versions, I think. Hi, Attach a patch to rewrite dispatch_table array using C99-designated initializer syntax. >From f398d6d310e9436c5e415baa6fd273981a9e181f Mon Sep 17 00:00:00 2001 From: Japin Li Date: Tue, 5 Mar 2024 21:32:46 +0800 Subject: [PATCH v1 1/1] Use C99-designated initi

Re: Improve readability by using designated initializers when possible

2024-02-27 Thread Japin Li
On Wed, 28 Feb 2024 at 00:06, Jelte Fennema-Nio wrote: > On Tue, 27 Feb 2024 at 16:04, Japin Li wrote: >> I see the config_group_names[] needs null-terminated because of help_config, >> however, I didn't find the reference in help_config.c. Is this comment >>

Re: Improve readability by using designated initializers when possible

2024-02-27 Thread Japin Li
On Tue, 27 Feb 2024 at 19:55, Jelte Fennema-Nio wrote: > On Tue, 27 Feb 2024 at 12:52, Jelte Fennema-Nio wrote: >> Attached is an updated patchset to also convert pg_enc2icu_tbl and >> pg_enc2gettext_tbl. I converted pg_enc2gettext_tbl in a separate >> commit, because it actually requires some

Re: Improve readability by using designated initializers when possible

2024-02-26 Thread Japin Li
On Mon, 26 Feb 2024 at 16:41, jian he wrote: > Hi. minor issues. > > @@ -2063,12 +2009,12 @@ find_expr_references_walker(Node *node, > CoerceViaIO *iocoerce = (CoerceViaIO *) node; > > /* since there is no exposed function, need to depend on type */ > - add_object_address(OCLASS_TYPE, iocoer

Re: Switching XLog source from archive to streaming when primary available

2024-02-19 Thread Japin Li
On Tue, 20 Feb 2024 at 13:40, Bharath Rupireddy wrote: > On Mon, Feb 19, 2024 at 8:25 PM Japin Li wrote: >> [2] >> +# Ensure checkpoint doesn't come in our way >> +$primary->append_conf('postgresql.conf', qq( >> +min_wal_size = 2MB >> +

  1   2   3   4   5   6   >