Re: Make COPY format extendable: Extract COPY TO format implementations

2024-01-11 Thread Junwang Zhao
Hi, On Wed, Jan 10, 2024 at 2:20 PM Sutou Kouhei wrote: > > Hi, > > In > "Re: Make COPY format extendable: Extract COPY TO format implementations" > on Fri, 22 Dec 2023 10:58:05 +0800, > Junwang Zhao wrote: > > >> 1. Add an opaque space for custo

Re: speed up a logical replica setup

2024-01-13 Thread Junwang Zhao
n connection. + What is *local logical replication*? I can't find any clue in the patch, can you give me some hint? > > -- > Euler Taveira > EDB https://www.enterprisedb.com/ > -- Regards Junwang Zhao

Re: make pg_ctl more friendly

2024-01-15 Thread Junwang Zhao
uot; > perhaps we could say "shut down while in recovery." Make sense. Fixed. See V4 > And maybe we should > point to the specific settings in the latter message. I've changed this latter message to: update recovery target settings for startup again if needed What do y

Re: make pg_ctl more friendly

2024-01-17 Thread Junwang Zhao
V5, thanks for the wording ;) > > -- > Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/ > "Now I have my system running, not a byte was off the shelf; > It rarely breaks and when it does I fix the code myself. > It's stable, clean and elegant, and lightning fast as well, > And it doesn't cost a nickel, so Bill Gates can go to hell." -- Regards Junwang Zhao v5-0001-PITR-shutdown-should-not-report-error-by-pg_ctl.patch Description: Binary data

Re: make dist using git archive

2024-01-22 Thread Junwang Zhao
archive --format tar.gz --prefix postgresql-17devel/ HEAD -o postgresql-`git describe --tags`.tar.gz > > and it produces the same set of tarballs as before, except it's done > differently. > > The actual build scripts need some fine-tuning, but the general idea is > correct, I think. I think this is a good idea, thanks for working on this. -- Regards Junwang Zhao

Re: make dist using git archive

2024-01-22 Thread Junwang Zhao
On Tue, Jan 23, 2024 at 2:36 AM Peter Eisentraut wrote: > > On 22.01.24 13:10, Junwang Zhao wrote: > > I played this with meson build on macOS, the packages are generated > > in source root but not build root, I'm sure if this is by design but I think > > polluting *w

Re: Make COPY format extendable: Extract COPY TO format implementations

2024-01-26 Thread Junwang Zhao
; -- > kou Hi Kou-san, In the current implementation, there is no way that one can check incompatibility options in ProcessCopyOptions, we can postpone the check in CopyFromStart or CopyToStart, but I think it is a little bit late. Do you think adding an extra check for incompatible options hook is acceptable (PFA)? -- Regards Junwang Zhao 0001-add-check-incomptiblity-options-hooks.patch Description: Binary data

Re: Make COPY format extendable: Extract COPY TO format implementations

2024-01-26 Thread Junwang Zhao
On Fri, Jan 26, 2024 at 4:32 PM Sutou Kouhei wrote: > > Hi, > > In > "Re: Make COPY format extendable: Extract COPY TO format implementations" > on Fri, 26 Jan 2024 16:18:14 +0800, > Junwang Zhao wrote: > > > In the current implementa

Re: Make COPY format extendable: Extract COPY TO format implementations

2024-01-26 Thread Junwang Zhao
On Fri, Jan 26, 2024 at 4:55 PM Sutou Kouhei wrote: > > Hi, > > In > "Re: Make COPY format extendable: Extract COPY TO format implementations" > on Fri, 26 Jan 2024 16:41:50 +0800, > Junwang Zhao wrote: > > > CopyToProcessOption()/CopyFromProcessOp

Re: Make COPY format extendable: Extract COPY TO format implementations

2024-01-28 Thread Junwang Zhao
On Mon, Jan 29, 2024 at 10:42 AM Masahiko Sawada wrote: > > On Fri, Jan 26, 2024 at 6:02 PM Junwang Zhao wrote: > > > > On Fri, Jan 26, 2024 at 4:55 PM Sutou Kouhei wrote: > > > > > > Hi, > > > > > > In > > > "Re: Make COPY

Re: Make COPY format extendable: Extract COPY TO format implementations

2024-01-28 Thread Junwang Zhao
On Mon, Jan 29, 2024 at 11:22 AM Masahiko Sawada wrote: > > On Mon, Jan 29, 2024 at 12:10 PM Junwang Zhao wrote: > > > > On Mon, Jan 29, 2024 at 10:42 AM Masahiko Sawada > > wrote: > > > > > > On Fri, Jan 26, 2024 at 6:02 PM Junwang Zhao wrote: >

Re: Make COPY format extendable: Extract COPY TO format implementations

2024-01-28 Thread Junwang Zhao
On Mon, Jan 29, 2024 at 2:03 PM Sutou Kouhei wrote: > > Hi, > > In > "Re: Make COPY format extendable: Extract COPY TO format implementations" > on Sat, 27 Jan 2024 14:15:02 +0800, > Junwang Zhao wrote: > > > I have been working on a *COPY TO JSON*

Re: UUID v7

2024-01-29 Thread Junwang Zhao
and 7. For > > other > > versions and variants this function returns NULL. The extracted timestamp > > does not necessarily equate to the time of UUID generation. How close it is > > to the actual time depends on the implementation that generated to UUID. > > The uuidv7() function provided PostgreSQL will normally store the actual > > time of > > generation to in the UUID, but if large batches of UUIDs are generated at > > the > > same time it's possible that some UUIDs will store a time that is slightly > > later > > than their actual generation time. > > -- Regards Junwang Zhao

Re: UUID v7

2024-01-30 Thread Junwang Zhao
e rewritten this phrase, hope it’s more clear now. > > > Best regards, Andrey Borodin. +Datum +uuid_extract_var(PG_FUNCTION_ARGS) +{ + pg_uuid_t *uuid = PG_GETARG_UUID_P(0); + uint16_t result; + result = uuid->data[8] >> 6; + + PG_RETURN_UINT16(result); +} \ No newline at end of file It's always good to add a newline at the end of a source file, though this might be nitpicky. -- Regards Junwang Zhao

Re: Emitting JSON to file using COPY TO

2024-01-31 Thread Junwang Zhao
Hi Vignesh, On Wed, Jan 31, 2024 at 5:50 PM vignesh C wrote: > > On Sat, 27 Jan 2024 at 11:25, Junwang Zhao wrote: > > > > Hi hackers, > > > > Kou-san(CCed) has been working on *Make COPY format extendable[1]*, so > > I think making *copy to json* b

Re: Make COPY format extendable: Extract COPY TO format implementations

2024-01-31 Thread Junwang Zhao
Time: 3341.328 ms (00:03.341) COPY 1000 Time: 3621.564 ms (00:03.622) COPY 1000 Time: 3700.911 ms (00:03.701) COPY 1000 Time: 3717.992 ms (00:03.718) COPY 1000 Time: 3708.350 ms (00:03.708) COPY 1000 Time: 3704.367 ms (00:03.704) COPY 1000 Time: 3724.281 ms (00:03.724) COPY 1000 Time: 3703.335 ms (00:03.703) COPY 1000 Time: 3728.629 ms (00:03.729) COPY 1000 Time: 3758.135 ms (00:03.758) The first 6 rounds are like 10% better than the later 9 rounds, is this normal? -- Regards Junwang Zhao

Re: Make COPY format extendable: Extract COPY TO format implementations

2024-01-31 Thread Junwang Zhao
On Thu, Feb 1, 2024 at 11:56 AM Michael Paquier wrote: > > On Thu, Feb 01, 2024 at 11:43:07AM +0800, Junwang Zhao wrote: > > The first 6 rounds are like 10% better than the later 9 rounds, is this > > normal? > > Even with HEAD? Perhaps you have some OS cache eviction i

Re: Make COPY format extendable: Extract COPY TO format implementations

2024-02-01 Thread Junwang Zhao
ast point about these extra > callbacks? > -- > Michael If V7 and V10 have no performance reduction, then I think V6 is also good with performance, since most of the time goes to CopyToOneRow and CopyFromOneRow. I just think we should take the *extendable* into consideration at the beginning. -- Regards Junwang Zhao

fix a typo in file src/backend/utils/adt/xid8funcs.c comment

2023-03-24 Thread Junwang Zhao
%s/pg_current_xact/pg_current_xact_id -- Regards Junwang Zhao 0001-typo-replace-pg_current_xact-with-pg_current_xact_id.patch Description: Binary data

Use INT_MAX for wal size related gucs's max value

2023-04-18 Thread Junwang Zhao
The wal size related gucs use the MB unit, so we should just use INT_MAX instead of MAX_KILOBYTES as the max value. -- Regards Junwang Zhao 0001-use-INT_MAX-for-wal-size-related-max-value.patch Description: Binary data

Re: Use INT_MAX for wal size related gucs's max value

2023-04-18 Thread Junwang Zhao
) / (1024 * 1024))) On Wed, Apr 19, 2023 at 11:33 AM Tom Lane wrote: > > Junwang Zhao writes: > > The wal size related gucs use the MB unit, so we should just use > > INT_MAX instead of MAX_KILOBYTES as the max value. > > The point of MAX_KILOBYTES is to avoid over

[pg_rewind] use the passing callback instead of global function

2023-04-25 Thread Junwang Zhao
`local_traverse_files` and `libpq_traverse_files` both have a callback parameter but instead use the global process_source_file which is no good for function encapsulation. -- Regards Junwang Zhao 0001-pg_rewind-use-the-passing-callback-instead-of-global.patch Description: Binary data

[PATCH v1] remove redundant check of item pointer

2022-04-27 Thread Junwang Zhao
In function ItemPointerEquals, the ItemPointerGetBlockNumber already checked the ItemPointer if valid, there is no need to check it again in ItemPointerGetOffset, so use ItemPointerGetOffsetNumberNoCheck instead. Signed-off-by: Junwang Zhao --- src/backend/storage/page/itemptr.c | 4 ++-- 1

remove redundant check of item pointer

2022-04-27 Thread Junwang Zhao
In function ItemPointerEquals, the ItemPointerGetBlockNumber already checked the ItemPointer if valid, there is no need to check it again in ItemPointerGetOffset, so use ItemPointerGetOffsetNumberNoCheck instead. -- Regards Junwang Zhao v1-0001-remove-redundant-check-of-item-pointer.patch

Re: remove redundant check of item pointer

2022-04-27 Thread Junwang Zhao
got it, thanks for the explanation. On Wed, Apr 27, 2022 at 11:34 PM Tom Lane wrote: > > Junwang Zhao writes: > > In function ItemPointerEquals, the ItemPointerGetBlockNumber > > already checked the ItemPointer if valid, there is no need > > to check it again in Item

Re: Add trailing commas to enum definitions

2023-10-23 Thread Junwang Zhao
iles of libpq and ecpg, in > case people want to use those with older compilers. There were also a > small number of cases where the enum type wasn't used anywhere (but the > enum values were), which ended up confusing pgindent a bit. -- Regards Junwang Zhao

Re: Add trailing commas to enum definitions

2023-10-23 Thread Junwang Zhao
On Tue, Oct 24, 2023 at 4:34 AM Nathan Bossart wrote: > > On Mon, Oct 23, 2023 at 05:55:32PM +0800, Junwang Zhao wrote: > > On Mon, Oct 23, 2023 at 2:37 PM Peter Eisentraut > > wrote: > >> Since C99, there can be a trailing comma after the last value in an enum >

Re: Simplify xlogreader.c with XLogRec* macros

2023-10-31 Thread Junwang Zhao
these can also be rewrite to: if (!XLogRecHasBlockRef(record, block_id)) -- Regards Junwang Zhao

Re: Don't pass NULL pointer to strcmp().

2023-11-01 Thread Junwang Zhao
ttatched. > > [1] https://github.com/higuoxing/guc_crash/tree/pg > Can we set a string guc to NULL? If not, `*lconf->variable == NULL` would be unnecessary. > -- > Best Regards, > Xing -- Regards Junwang Zhao

Re: make pg_ctl more friendly

2023-11-08 Thread Junwang Zhao
e >> > recovery.done. >> >> DB_SHUTDOWNED cannot be encountered while recovery is ongoing. If there was a >> hard crash, you'd see DB_IN_ARCHIVE_RECOVERY or such, if the command was shut >> down orderly before PITR has finished, you'd see DB_SHUTDOWNED_IN

Re: make pg_ctl more friendly

2023-11-08 Thread Junwang Zhao
On Thu, Nov 9, 2023 at 3:08 PM Junwang Zhao wrote: > > On Thu, Nov 9, 2023 at 9:57 AM Crisp Lee wrote: > > > > Hi, > > > > I know it. But my question is not that. I did a PITR operation with > > recovery_target_name and recovery_target_action('shutdow

Re: Re: How to solve the problem of one backend process crashing and causing other processes to restart?

2023-11-13 Thread Junwang Zhao
extensible) architecture, and they also have an army of > >> programmers to deal with minutiae like undoing resource acquisition. > >> Even with that, you'd have to wonder about the number of bugs > >> existing in such necessarily-poorly-tested code paths. > > > >Yes. > >I think that PostgreSQL's approach is superior: rather than investing in > >code to mitigate the impact of data corruption caused by a crash, invest > >in quality code that doesn't crash in the first place. > > > >Euphemistically naming a crash "ORA-600 error" seems to be part of > >their strategy. > > > >Yours, > >Laurenz Albe > > -- Regards Junwang Zhao

Re: Make COPY format extendable: Extract COPY TO format implementations

2023-12-05 Thread Junwang Zhao
ro, etc.), will they be implemented as extensions or in core? The patch looks good except for a pair of extra curly braces. > > [1]: > https://www.postgresql.org/message-id/flat/3741749.1655952719%40sss.pgh.pa.us#2bb7af4a3d2c7669f9a49808d777a20d > > > Thanks, > -- > kou > > -- Regards Junwang Zhao

Re: Make COPY format extendable: Extract COPY TO format implementations

2023-12-05 Thread Junwang Zhao
On Wed, Dec 6, 2023 at 2:19 PM Sutou Kouhei wrote: > > Hi, > > In > "Re: Make COPY format extendable: Extract COPY TO format implementations" > on Wed, 6 Dec 2023 11:18:35 +0800, > Junwang Zhao wrote: > > > For the modern formats(parquet, orc, avro

Re: Make COPY format extendable: Extract COPY TO format implementations

2023-12-06 Thread Junwang Zhao
On Wed, Dec 6, 2023 at 3:28 PM Sutou Kouhei wrote: > > Hi, > > In > "Re: Make COPY format extendable: Extract COPY TO format implementations" > on Wed, 6 Dec 2023 15:11:34 +0800, > Junwang Zhao wrote: > > > For the extra curly br

Re: Make COPY format extendable: Extract COPY TO format implementations

2023-12-06 Thread Junwang Zhao
- > Daniel Vérité > https://postgresql.verite.pro/ > Twitter: @DanielVerite > > -- Regards Junwang Zhao

Re: Make COPY format extendable: Extract COPY TO format implementations

2023-12-07 Thread Junwang Zhao
On Thu, Dec 7, 2023 at 8:39 AM Michael Paquier wrote: > > On Wed, Dec 06, 2023 at 10:07:51PM +0800, Junwang Zhao wrote: > > I read the thread[1] you posted and I think Andres's suggestion sounds > > great. > > > > Should we extract both *copy to* and *cop

Re: Make COPY format extendable: Extract COPY TO format implementations

2023-12-07 Thread Junwang Zhao
On Thu, Dec 7, 2023 at 1:05 PM Sutou Kouhei wrote: > > Hi, > > In > "Re: Make COPY format extendable: Extract COPY TO format implementations" > on Wed, 6 Dec 2023 22:07:51 +0800, > Junwang Zhao wrote: > > > Should we extract both *copy to* and

Re: Make COPY format extendable: Extract COPY TO format implementations

2023-12-07 Thread Junwang Zhao
On Fri, Dec 8, 2023 at 3:27 AM Masahiko Sawada wrote: > > On Fri, Dec 8, 2023 at 1:39 AM Andrew Dunstan wrote: > > > > > > On 2023-12-07 Th 03:37, Junwang Zhao wrote: > > > > > > The point of this refactor (from my view) is to make it possible to add &

Re: Make COPY format extendable: Extract COPY TO format implementations

2023-12-09 Thread Junwang Zhao
ot > *slot); > +extern void CopyToFormatBinaryEnd(CopyToState cstate); > +extern void CopyFromFormatBinaryStart(CopyFromState cstate, TupleDesc > tupDesc); > +extern bool CopyFromFormatBinaryNext(CopyFromState cstate, > ExprContext *econtext, > + > Datum *values, bool *nulls); > +extern void CopyFromFormatBinaryErrorCallback(CopyFromState cstate); > ``` > > FYI - If you add files for {text|csv|binary}, these declarations can be > removed. > > Best Regards, > Hayato Kuroda > FUJITSU LIMITED > Thanks for all the valuable suggestions. -- Regards Junwang Zhao

Re: Make COPY format extendable: Extract COPY TO format implementations

2023-12-09 Thread Junwang Zhao
or bringing this up. Forgive me for making so much noise about approach 2, I just want to hear about more suggestions of the final shape of this feature. > > Thanks, > -- > kou -- Regards Junwang Zhao

Re: Make COPY format extendable: Extract COPY TO format implementations

2023-12-11 Thread Junwang Zhao
; Btw, will any of you here be in Prague next week ? > Would be a good opportunity to discuss this in person. Sorry, no. > > > Best Regards > Hannu > > On Sat, Dec 9, 2023 at 9:39 AM Junwang Zhao wrote: > > > > On Sat, Dec 9, 2023 at 10:43 AM Hayato Kuroda (Fujitsu) &g

Re: Make COPY format extendable: Extract COPY TO format implementations

2023-12-11 Thread Junwang Zhao
> I've sketched the above idea including a test module in > src/test/module/test_copy_format, based on v2 patch. It's not splitted > and is dirty so just for discussion. > The test_copy_format extension doesn't use the fields of CopyToState and CopyFromState in this patch, I think we should move CopyFromStateData and CopyToStateData to commands/copy.h, what do you think? The framework in the patch LGTM. > > Regards, > > -- > Masahiko Sawada > Amazon Web Services: https://aws.amazon.com -- Regards Junwang Zhao

[meson] expose buildtype debug/optimization info to pg_config

2023-12-12 Thread Junwang Zhao
build system using configure set VAL_CFLAGS with debug and optimization flags, so pg_config will show these infos. Some extensions depend on the mechanism. This patch exposes these flags with a typo fixed together. -- Regards Junwang Zhao 0001-meson-expose-buildtype-debug-optimization-info-to

Re: Simplify newNode()

2023-12-13 Thread Junwang Zhao
e comments /* need the tag, at least */ after result->type > = tag; by the way? I don't think so, the comment has the meaning of the requested size should at least the size of Node, which contains just a NodeTag. typedef struct Node { NodeTag type; } Node; > > > > Zhang Mingli > www.hashdata.xyz -- Regards Junwang Zhao

Re: [meson] expose buildtype debug/optimization info to pg_config

2023-12-14 Thread Junwang Zhao
Hi Peter, Thanks for looking into this. On Thu, Dec 14, 2023 at 4:50 PM Peter Eisentraut wrote: > > On 12.12.23 11:40, Junwang Zhao wrote: > > build system using configure set VAL_CFLAGS with debug and > > optimization flags, so pg_config will show these infos. Some > >

Re: Make COPY format extendable: Extract COPY TO format implementations

2023-12-14 Thread Junwang Zhao
licitly is a bit > inconvenient. Because only one handler will be installed in > most use cases. In the case, users don't need to choose one > handler. > > If we choose this option, it may be better that we also > provide a mechanism that can work without HANDLER. Searching > a function by name like tablesample method does is an option. > > > [1]: https://github.com/simdjson/simdjson > > > Thanks, > -- > kou -- Regards Junwang Zhao

Re: Make COPY format extendable: Extract COPY TO format implementations

2023-12-14 Thread Junwang Zhao
On Fri, Dec 15, 2023 at 12:45 PM Sutou Kouhei wrote: > > Hi, > > In > "Re: Make COPY format extendable: Extract COPY TO format implementations" > on Fri, 15 Dec 2023 11:27:30 +0800, > Junwang Zhao wrote: > > >> > Adding a prefix or suf

Re: Transaction timeout

2023-12-19 Thread Junwang Zhao
+ When transaction_timeout is *equal* to idle_in_transaction_session_timeout or statement_timeout, idle_in_transaction_session_timeout and statement_timeout will also be invalidated, the logic in the code seems right, though this document is a little bit inaccurate. -- Regards Junwang Zhao

Re: Transaction timeout

2023-12-19 Thread Junwang Zhao
On Tue, Dec 19, 2023 at 10:51 PM Junwang Zhao wrote: > > On Tue, Dec 19, 2023 at 6:27 PM Andrey M. Borodin > wrote: > > > > > > > > > On 19 Dec 2023, at 13:26, Andrey M. Borodin wrote: > > > > > > I don’t have Windows machine, so I h

Re: Transaction timeout

2023-12-19 Thread Junwang Zhao
On Wed, Dec 20, 2023 at 9:58 AM Thomas wen wrote: > > Hi Junwang Zhao > #should we invalidate lock_timeout? Or maybe just document this. > I think you mean when lock_time is greater than trasaction-time invalidate > lock_timeout or needs to be logged ? > I mean the interl

Re: Make COPY format extendable: Extract COPY TO format implementations

2023-12-21 Thread Junwang Zhao
e tries for design discussion for the first >implementation? If we need, what should we try? > > > Thanks, > -- > kou +PG_FUNCTION_INFO_V1(copy_testfmt_handler); +Datum +copy_testfmt_handler(PG_FUNCTION_ARGS) +{ + bool is_from = PG_GETARG_BOOL(0); + CopyFormatRoutine *cp = makeNode(CopyFormatRoutine);; + extra semicolon. -- Regards Junwang Zhao

Re: [meson] expose buildtype debug/optimization info to pg_config

2023-12-22 Thread Junwang Zhao
Hi, On Fri, Dec 15, 2023 at 10:20 PM Andres Freund wrote: > > Hi, > > On 2023-12-14 17:24:58 +0800, Junwang Zhao wrote: > > On Thu, Dec 14, 2023 at 4:50 PM Peter Eisentraut > > wrote: > > > > > > On 12.12.23 11:40, Junwang Zhao wrote: > > >

Re: Transaction timeout

2023-12-22 Thread Junwang Zhao
is is expected? I'm not read all the threads, > am I missing something? I think this is by design, if you debug statement_timeout, it's the same behaviour, the timeout will be set for each command after the second command was called, you just aren't aware of this. I doubt people will set this in a transaction. > > [1] https://cirrus-ci.com/build/6574686130143232 > > -- > Regrads, > Japin Li > ChengDu WenWu Information Technology Co., Ltd. > -- Regards Junwang Zhao

Re: Transaction timeout

2023-12-22 Thread Junwang Zhao
On Fri, Dec 22, 2023 at 10:25 PM Japin Li wrote: > > > On Fri, 22 Dec 2023 at 20:29, Junwang Zhao wrote: > > On Fri, Dec 22, 2023 at 1:39 PM Japin Li wrote: > >> > >> > >> On Tue, 19 Dec 2023 at 22:06, Japin Li wrote: > >> > On Tue,

Re: Transaction timeout

2023-12-22 Thread Junwang Zhao
On Fri, Dec 22, 2023 at 10:44 PM Japin Li wrote: > > > On Fri, 22 Dec 2023 at 22:37, Junwang Zhao wrote: > > On Fri, Dec 22, 2023 at 10:25 PM Japin Li wrote: > >> I try to set idle_in_transaction_session_timeout after begin transaction, > >> i

Re: Transaction timeout

2023-12-22 Thread Junwang Zhao
On Sat, Dec 23, 2023 at 10:40 AM Japin Li wrote: > > > On Sat, 23 Dec 2023 at 08:32, Japin Li wrote: > > On Fri, 22 Dec 2023 at 23:30, Junwang Zhao wrote: > >> On Fri, Dec 22, 2023 at 10:44 PM Japin Li wrote: > >>> > >>> > >>> On Fr

Re: Transaction timeout

2023-12-22 Thread Junwang Zhao
On Sat, Dec 23, 2023 at 11:17 AM Japin Li wrote: > > a > On Sat, 23 Dec 2023 at 10:40, Japin Li wrote: > > On Sat, 23 Dec 2023 at 08:32, Japin Li wrote: > >> On Fri, 22 Dec 2023 at 23:30, Junwang Zhao wrote: > >>> On Fri, Dec 22, 2023 at 10:44 PM Japin Li

Re: Transaction timeout

2023-12-24 Thread Junwang Zhao
ently we only allow > to disable other timeouts... Also, if we are already in transaction, > shouldn't we also subtract current transaction span from timeout? idle_in_transaction_session_timeout is already the behavior Japin suggested, it is enabled before backend sends *read for query* to client. > I think making this functionality as another step of the patchset was a good > idea. > > Thanks! > > > Best regards, Andrey Borodin. -- Regards Junwang Zhao

Re: Proposal to include --exclude-extension Flag in pg_dump

2023-12-25 Thread Junwang Zhao
options, does the following make sense to you? printf(_(" --enable-row-security enable row security (dump only content user has\n" "access to)\n")); + printf(_(" --exclude-extension=PATTERN do NOT dump the specified extension(s)\n")); printf(_(" --exclude-table-and-children=PATTERN\n" -- Regards Junwang Zhao

Re: Transaction timeout

2023-12-28 Thread Junwang Zhao
p; !get_timeout_active(TRANSACTION_TIMEOUT)) enable_timeout_after(TRANSACTION_TIMEOUT, TransactionTimeout); xact_started = true; > > > Best regards, Andrey Borodin. -- Regards Junwang Zhao

Re: Transaction timeout

2023-12-29 Thread Junwang Zhao
On Fri, Dec 29, 2023 at 6:00 PM Andrey M. Borodin wrote: > > > > > On 28 Dec 2023, at 21:02, Junwang Zhao wrote: > > > > Seems V5~V17 doesn't work as expected for Nikolay's case: > > > > Yeah, that's a problem. > > So I propose the f

Re: Change GUC hashtable to use simplehash?

2024-01-07 Thread Junwang Zhao
nts/examples, > but I think it's mostly there. I'll return to it by next week. > > + * Portions Copyright (c) 2018-2023, PostgreSQL Global Development Group A kind reminder, it's already 2024 :) I'm also curious why the 2018, is there any convention for that? -- Regards Junwang Zhao

Re: make pg_ctl more friendly

2024-01-09 Thread Junwang Zhao
Hi Nazir, On Tue, Jan 9, 2024 at 9:23 PM Nazir Bilal Yavuz wrote: > > Hi, > > Thank you for working on this! I agree that the current message is not > friendly. > > On Thu, 9 Nov 2023 at 10:19, Junwang Zhao wrote: > > > > On Thu, Nov 9, 2023 at 3:08 PM Junwang

Re: [PATCH v1] PQputCopyEnd never returns 0, fix the inaccurate comment

2023-08-29 Thread Junwang Zhao
On Tue, Aug 29, 2023 at 6:40 AM Michael Paquier wrote: > > On Mon, Aug 28, 2023 at 09:46:07PM +0800, Junwang Zhao wrote: > > Yeah, it makes sense to me, or maybe just `PQputCopyEnd(...) == -1`, > > let's wait for some other opinions. > > One can argue that PQputC

Re: Should we use MemSet or {0} for struct initialization?

2023-08-31 Thread Junwang Zhao
adding to 0 as well, but since we will not access the alignment/padding, so they give the same effect. I bet {0} should be faster since there is no function call, but I'm not 100% sure ;) -- Regards Junwang Zhao

Re: Should we use MemSet or {0} for struct initialization?

2023-08-31 Thread Junwang Zhao
e5f8-3c37-d185-4bbc-1de163ac4b10%40enterprisedb.com > > (If so, it deserves a comment to keep people from trying to change it...) > > > > And with a rough scan the MemSet calls in pg_stat_get_backend_subxact() > > > can also be replaced with {0}, so include that in the pa

Re: [BackendXidGetPid] only access allProcs when xid matches

2023-09-07 Thread Junwang Zhao
x]]; > result = proc->pid; > break; > > Saying that, moving the declarations into the inner loop is usually a > good practice, but I would just keep two variables instead of one for > the sake of readability. That's a nit, sure. I remember I sp

Re: [BackendXidGetPid] only access allProcs when xid matches

2023-09-07 Thread Junwang Zhao
oke the given function a million times. That > > way we might be able to catch some miniscule improvement per row. > > > > If the performance is measurable, we can mark the CF entry as ready > > for committer. > > > > -- > > Best Wishes, > > Ashuto

[dynahash] do not refill the hashkey after hash_search

2023-09-12 Thread Junwang Zhao
h the key field after insert it into the dynahash. This patch fixed some most abnormal ones, instead of refilling the key field of primitive types, adding some assert might be a better choice. -- Regards Junwang Zhao 0001-do-not-refill-the-hashkey-after-hash_search.patch Description: Binary data

Re: [dynahash] do not refill the hashkey after hash_search

2023-09-13 Thread Junwang Zhao
On Wed, Sep 13, 2023 at 4:22 PM John Naylor wrote: > > > On Wed, Sep 13, 2023 at 1:47 PM Junwang Zhao wrote: > > > > Hi hackers, > > > > It's not necessary to fill the key field for most cases, since > > hash_search has already done that for you. For

Re: [dynahash] do not refill the hashkey after hash_search

2023-09-14 Thread Junwang Zhao
On Wed, Sep 13, 2023 at 5:28 PM John Naylor wrote: > > > On Wed, Sep 13, 2023 at 3:46 PM Junwang Zhao wrote: > > > > On Wed, Sep 13, 2023 at 4:22 PM John Naylor > > wrote: > > > > - memset(part_entry, 0, sizeof(LogicalRepPartMapEntry)); > > >

Re: [patch] Adding an assertion to report too long hash table name

2022-09-29 Thread Junwang Zhao
ated > successfully. > > I know this is a corner case, but it's difficult to figure it out when run > into it. So I add > an assertion to prevent it. > > > Thanks, > Xiaoran -- Regards Junwang Zhao

[PATCH v1] [meson] add a default option prefix=/usr/local/pgsql

2022-09-30 Thread Junwang Zhao
autoconf set PREFIX to /usr/local/pgsql, so I think we should do the same in meson build. This will group all the targets generated by postgres in the same directory. -- Regards Junwang Zhao 0001-meson-add-a-default-option-prefix-usr-local-pgsql.patch Description: Binary data

[PATCH v1] [meson] fix some typo to make it more readable

2022-10-05 Thread Junwang Zhao
Hi Andres, Seems there are some typo in file src/backend/meson.build comment, pls have a look. -- Regards Junwang Zhao 0001-meson-fix-some-typo-to-make-it-more-readable.patch Description: Binary data

Re: Non-decimal integer literals

2022-10-10 Thread Junwang Zhao
gt; > Two open issues from my notes: > > Technically, numeric_in() should be made aware of this, but that seems > relatively complicated and maybe not necessary for the first iteration. > > Taking another look around ecpg to see how this interacts with C-syntax > integer literals. I'm not aware of any particular issues, but it's > understandably tricky. > > Other than that, this seems pretty complete as a start. -- Regards Junwang Zhao

Re: Non-decimal integer literals

2022-10-11 Thread Junwang Zhao
On Tue, Oct 11, 2022 at 4:59 PM Peter Eisentraut wrote: > > On 11.10.22 05:29, Junwang Zhao wrote: > > What do you think if we move these code into a static inline function? like: > > > > static inline char* > > process_digits(char *ptr, int32 *result) > > { &g

[meson] add missing pg_attribute_aligned for MSVC in meson build

2022-10-13 Thread Junwang Zhao
Hi Andres, Commit ec3c9cc add pg_attribute_aligned in MSVC[1], which was pushed one day before the meson commits, so meson build missed this feature. [1]: https://www.postgresql.org/message-id/caaaqye-hbtzvr3msomtk+hyw2s0e0oapzmw8icsmytma+mn...@mail.gmail.com -- Regards Junwang Zhao 0001

Re: i.e. and e.g.

2022-07-13 Thread Junwang Zhao
"i.e.". It should be fixed if this is correct. I'm not sure > > whether to keep using Latin-origin acronyms like this, but in the > > attached I used "i.e.". > > Oops! There's another use of that word in the same context. > Attached contains two fixes. > > regards. > > -- > Kyotaro Horiguchi > NTT Open Source Software Center -- Regards Junwang Zhao

Re: Memory leak fix in psql

2022-07-19 Thread Junwang Zhao
atch version is V3. > > What about the argument of upthread where we could use a goto in > functions where there are multiple pattern validation checks? Per se > v4 attached. > -- > Michael -- Regards Junwang Zhao

Re: Memory leak fix in psql

2022-07-19 Thread Junwang Zhao
Got it, thanks! On Wed, Jul 20, 2022 at 1:14 PM Michael Paquier wrote: > > On Wed, Jul 20, 2022 at 12:51:24PM +0800, Junwang Zhao wrote: > > Though the patch looks good, I myself think the patch should be edited > > and submitted by Tang > > It's easy to atta

Re: Memory leak fix in psql

2022-07-20 Thread Junwang Zhao
Thanks for your explanation, this time I know how it works, thanks ;) On Wed, Jul 20, 2022 at 3:04 PM tanghy.f...@fujitsu.com wrote: > > > On Wed, Jul 20, 2022 at 12:51:24PM +0800, Junwang Zhao wrote: > > > Though the patch looks good, I myself think the patch should b

[PATCH v1] eliminate duplicate code in table.c

2022-07-21 Thread Junwang Zhao
There are some duplicate code in table.c, add a static inline function to eliminate the duplicates. -- Regards Junwang Zhao 0001-eliminate-duplicate-code-in-table.c.patch Description: Binary data

add a missing space

2022-07-21 Thread Junwang Zhao
This is a minor fix that adds a missing space in file lockdefs.h -- Regards Junwang Zhao 0001-add-a-missing-space.patch Description: Binary data

Re: add a missing space

2022-07-21 Thread Junwang Zhao
Great, thanks! On Thu, Jul 21, 2022 at 6:13 PM Amit Kapila wrote: > > On Thu, Jul 21, 2022 at 2:08 PM Junwang Zhao wrote: > > > > This is a minor fix that adds a missing space in file lockdefs.h > > > > LGTM. I'll push this in some time. > > -- >

Re: [PATCH v1] eliminate duplicate code in table.c

2022-07-21 Thread Junwang Zhao
yeah, IMHO validate_relation_kind() is better ;) On Thu, Jul 21, 2022 at 10:21 PM Aleksander Alekseev wrote: > > Hi Amit, > > > Yep, validate_relation_type() sounds better. > > Or maybe validate_relation_kind() after all? > > -- > Best regards, > Aleksander Alekseev -- Regards Junwang Zhao

Re: [PATCH v1] eliminate duplicate code in table.c

2022-07-21 Thread Junwang Zhao
o generic > > object being passed? > > Yep, validate_relation_type() sounds better. > > -- > Best regards, > Aleksander Alekseev -- Regards Junwang Zhao

Re: [PATCH v1] eliminate duplicate code in table.c

2022-07-21 Thread Junwang Zhao
anks! > > -- > Best regards, > Aleksander Alekseev -- Regards Junwang Zhao

question about `static inline` functions in header files

2022-07-21 Thread Junwang Zhao
ction compiled multiple times and may waste some space? IMHO, the header files should only include the inline function's declaration, and the definition should be in c files. I am not sure why this kind of coding style came along, appreciate if some one can give me some clue, thanks :) -- Regar

Re: question about `static inline` functions in header files

2022-07-21 Thread Junwang Zhao
Ok, thanks for the clarification. On Fri, Jul 22, 2022 at 11:03 AM Tom Lane wrote: > > Junwang Zhao writes: > > I notice that there are lots of *static inline functions* in header files, > > the header file's content will go into each translation unit at preprocess > &

Re: [PATCH v1] eliminate duplicate code in table.c

2022-07-22 Thread Junwang Zhao
> Other callers of errdetail_relkind_not_supported() describing > > operations concretely. In that sense we I think should say "cannot > > open relation \"%s\"" here. > > > > Sounds reasonable to me. This will give more precise information to the user. > &

[PATCH v1] strengthen backup history filename check

2022-07-25 Thread Junwang Zhao
This patch makes the backup history filename check more tight. -- Regards Junwang Zhao 0001-strengthen-backup-history-filename-check.patch Description: Binary data

Re: [PATCH v1] strengthen backup history filename check

2022-07-25 Thread Junwang Zhao
On Mon, Jul 25, 2022 at 7:39 PM Bharath Rupireddy wrote: > > On Mon, Jul 25, 2022 at 5:01 PM Junwang Zhao wrote: > > > > This patch makes the backup history filename check more tight. > > Can you please elaborate a bit on the issue with existing > IsBackupHistor

[PATCH] Add a inline function to eliminate duplicate code

2022-08-02 Thread Junwang Zhao
abstract the logic of `scankey change attribute num to index col number` to change_sk_attno_to_index_column_num, which is a static inline function. -- Regards Junwang Zhao 0001-add-a-inline-function-to-eliminate-duplicate-code.patch Description: Binary data

[doc] fix a potential grammer mistake

2022-08-03 Thread Junwang Zhao
. * Start a subtransaction. (DefineSavepoint already did * PushTransaction, so as to have someplace to put the SUBBEGIN * state.) ``` -- Regards Junwang Zhao 0001-doc-fix-a-potential-grammer-mistake.patch Description: Binary

Re: [doc] fix a potential grammer mistake

2022-08-03 Thread Junwang Zhao
On Wed, Aug 3, 2022 at 4:23 PM Daniel Gustafsson wrote: > > > On 3 Aug 2022, at 10:10, Junwang Zhao wrote: > > > > I think in the following sentence, were should be replaced with have, > > what do you think? > > > > ``` > >/

Re: [doc] fix a potential grammer mistake

2022-08-03 Thread Junwang Zhao
yeah, not a grammar mistake at all, "were" should be used here, thanks for pointing that out ;) On Wed, Aug 3, 2022 at 4:27 PM Erikjan Rijkers wrote: > > Op 03-08-2022 om 10:10 schreef Junwang Zhao: > > I think in the following sentence, were should be replaced with have,

Re: [doc] fix a potential grammer mistake

2022-08-03 Thread Junwang Zhao
ot;have issued" is the correct phrasing. > > Possibly "The user issued ..." would work. > > regards, tom lane -- Regards Junwang Zhao 0001-doc-rewrite-some-comments-to-make-them-more-precise.patch Description: Binary data

Re: [doc] fix a potential grammer mistake

2022-08-03 Thread Junwang Zhao
On Thu, Aug 4, 2022 at 12:42 AM Robert Treat wrote: > > On Wed, Aug 3, 2022 at 11:15 AM Junwang Zhao wrote: > > > > Attachment is a corrected version based on Tom's suggestion. > > > > Thanks. > > > > On Wed, Aug 3, 2022 at 9:56 PM Tom Lane wrote:

Re: [PATCH] Add a inline function to eliminate duplicate code

2022-08-05 Thread Junwang Zhao
Any more reviews? On Tue, Aug 2, 2022 at 9:24 PM mahendrakar s wrote: > > Patch is looking good to me. > > Thanks, > Mahendrakar. > > On Tue, 2 Aug 2022 at 16:57, Junwang Zhao wrote: >> >> abstract the logic of `scankey change attribu

  1   2   3   >