Re: Change GUC hashtable to use simplehash?

2023-12-06 Thread John Naylor
On Wed, Dec 6, 2023 at 11:48 PM Jeff Davis wrote: > > On Wed, 2023-12-06 at 07:39 +0700, John Naylor wrote: > > "git grep cstring_hash" found nothing, so not sure what you're > > asking. > > Sorry, I meant string_hash(). Your v5-0002 changes the way hashing > works for cstrings, and that means it'

Re: reindexing an invalid index should not use ERRCODE_INDEX_CORRUPTED

2023-12-06 Thread Andres Freund
Hi, This looks good to me! Greetings, Andres Freund

Re: gai_strerror() is not thread-safe on Windows

2023-12-06 Thread Kyotaro Horiguchi
At Thu, 7 Dec 2023 09:43:37 +1300, Thomas Munro wrote in > On Tue, Dec 5, 2023 at 3:43 PM Kyotaro Horiguchi > wrote: > > Windows' gai_strerror outputs messages that correspond to the language > > environment. Similarly, I think that the messages that the messages > > returned by our version sho

Re: pg_upgrade and logical replication

2023-12-06 Thread Masahiko Sawada
On Mon, Dec 4, 2023 at 8:01 PM Amit Kapila wrote: > > On Fri, Dec 1, 2023 at 11:24 PM vignesh C wrote: > > > > The attached v22 version patch has the changes for the same. > > > > I have made minor changes in the comments and code at various places. > See and let me know if you are not happy with

Re: pg_upgrade and logical replication

2023-12-06 Thread Masahiko Sawada
On Tue, Dec 5, 2023 at 6:37 PM Amit Kapila wrote: > > On Tue, Dec 5, 2023 at 10:56 AM Michael Paquier wrote: > > > > On Mon, Dec 04, 2023 at 04:30:49PM +0530, Amit Kapila wrote: > > > I have made minor changes in the comments and code at various places. > > > See and let me know if you are not ha

[PATCH]: Not to invaldiate CatalogSnapshot for local invalidation messages

2023-12-06 Thread Xiaoran Wang
Hi hackers, For local invalidation messages, there is no need to call `InvalidateCatalogSnapshot` to set the CatalogSnapshot to NULL and rebuild it later. Instead, just update the CatalogSnapshot's `curcid` in `SnapshotSetCommandId`, this way can make the CatalogSnapshot work well too. This o

Re: pg_upgrade and logical replication

2023-12-06 Thread Amit Kapila
On Thu, Dec 7, 2023 at 7:26 AM Masahiko Sawada wrote: > > On Tue, Dec 5, 2023 at 6:37 PM Amit Kapila wrote: > > > > On Tue, Dec 5, 2023 at 10:56 AM Michael Paquier wrote: > > > > > > On Mon, Dec 04, 2023 at 04:30:49PM +0530, Amit Kapila wrote: > > > > I have made minor changes in the comments an

Re: Is WAL_DEBUG related code still relevant today?

2023-12-06 Thread Euler Taveira
On Wed, Dec 6, 2023, at 9:51 PM, Michael Paquier wrote: > PerformWalRecovery() with its log for RM_XACT_ID is something that > stresses me a bit though because this is in the main redo loop which > is never free. The same can be said about GenericXLogFinish() because > the extra computation happen

Re: Is WAL_DEBUG related code still relevant today?

2023-12-06 Thread Michael Paquier
On Wed, Dec 06, 2023 at 11:32:19PM -0300, Euler Taveira wrote: > IIUC trace_recovery_messages was a debugging aid in the 9.0 era when the HS > was > introduced. I'm also wondering if anyone used it in the past years. FWIW, I'd be +1 for getting rid of entirely, with its conditional block in Perfo

Re: Emitting JSON to file using COPY TO

2023-12-06 Thread Euler Taveira
On Wed, Dec 6, 2023, at 3:59 PM, Daniel Verite wrote: > The first Copy data message with contents "5b0a" does not qualify > as a row of data with 3 columns as advertised in the CopyOut > message. Isn't that a problem? > > At least the json non-ARRAY case ("json lines") doesn't have > this issue, s

Re: Emitting JSON to file using COPY TO

2023-12-06 Thread Nathan Bossart
On Wed, Dec 06, 2023 at 03:20:46PM -0500, Tom Lane wrote: > If Nathan's perf results hold up elsewhere, it seems like some > micro-optimization around the text-pushing (appendStringInfoString) > might be more useful than caching. The 7% spent in cache lookups > could be worth going after later, bu

Re: remaining sql/json patches

2023-12-06 Thread jian he
On Wed, Dec 6, 2023 at 10:02 PM Amit Langote wrote: > > Finally, I also fixed a couple of silly mistakes in 0003 around > transformJsonBehavior() and some further assorted tightening in the ON > ERROR / EMPTY expression coercion handling code. > typo: + * If a soft-error occurs, it will be check

Re: Transaction timeout

2023-12-06 Thread Japin Li
On Wed, 06 Dec 2023 at 21:05, Andrey M. Borodin wrote: >> On 30 Nov 2023, at 20:06, Andrey M. Borodin wrote: >> >> >> Tomorrow I plan to fix raising of the timeout when the transaction is idle. >> Renaming transaction_timeout to something else (to avoid confusion with >> prepared xacts) also s

Re: [PoC] Improve dead tuple storage for lazy vacuum

2023-12-06 Thread John Naylor
On Mon, Nov 27, 2023 at 1:45 PM Masahiko Sawada wrote: > > On Sat, Oct 28, 2023 at 5:56 PM John Naylor wrote: > bool > RT_SET(RT_RADIX_TREE *tree, uint64 key, RT_VALUE_TYPE *value_p); > or for variable-length value support, > RT_SET(RT_RADIX_TREE *tree, uint64 key, RT_VALUE_TYPE *value_p, size_t

Re: pg16 && GSSAPI && Heimdal/Macos

2023-12-06 Thread Tom Lane
kov...@omniscient.com writes: > Earlier this year, there was a thread about GSSAPI for delegated > credentials and various operating systems ultimately that Heimdal had > atrophied enough that you were comfortable not supporting it anymore as > a GSSAPI library. Yup. > As you may have surmised, I

Re: logical decoding and replication of sequences, take 2

2023-12-06 Thread Amit Kapila
On Wed, Dec 6, 2023 at 7:20 PM Tomas Vondra wrote: > > On 12/6/23 11:19, Amit Kapila wrote: > > On Sun, Dec 3, 2023 at 11:56 PM Tomas Vondra > > wrote: > >> > >> On 12/3/23 18:52, Tomas Vondra wrote: > >>> ... > >>> > >> > >> Another idea is that maybe we could somehow inform ReorderBuffer whethe

RE: pg_upgrade and logical replication

2023-12-06 Thread Zhijie Hou (Fujitsu)
On Thursday, December 7, 2023 10:23 AM Amit Kapila wrote: > > On Thu, Dec 7, 2023 at 7:26 AM Masahiko Sawada > wrote: > > > > On Tue, Dec 5, 2023 at 6:37 PM Amit Kapila > wrote: > > > > > > On Tue, Dec 5, 2023 at 10:56 AM Michael Paquier > wrote: > > > > > > > > On Mon, Dec 04, 2023 at 04:30:

Re: logical decoding and replication of sequences, take 2

2023-12-06 Thread Dilip Kumar
On Wed, Dec 6, 2023 at 7:17 PM Tomas Vondra wrote: > > On 12/6/23 12:05, Dilip Kumar wrote: > > On Wed, Dec 6, 2023 at 3:36 PM Amit Kapila wrote: > >> > >>> Why can't we use the same concept of > >>> SnapBuildDistributeNewCatalogSnapshot(), I mean we keep queuing the > >>> non-transactional chang

Re: logical decoding and replication of sequences, take 2

2023-12-06 Thread Amit Kapila
On Wed, Dec 6, 2023 at 7:17 PM Tomas Vondra wrote: > > On 12/6/23 12:05, Dilip Kumar wrote: > > On Wed, Dec 6, 2023 at 3:36 PM Amit Kapila wrote: > >> > >>> Why can't we use the same concept of > >>> SnapBuildDistributeNewCatalogSnapshot(), I mean we keep queuing the > >>> non-transactional chang

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

2023-12-06 Thread Sutou Kouhei
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 *copy from* for the first step, in that > case we can add the pg_copy_handler catalog smoothly later. I don't obje

Re: logical decoding and replication of sequences, take 2

2023-12-06 Thread Dilip Kumar
On Wed, Dec 6, 2023 at 7:09 PM Tomas Vondra wrote: > > Yes, if something like this happens, that'd be a problem: > > 1) decoding starts, with > >SnapBuildCurrentState(builder) < SNAPBUILD_FULL_SNAPSHOT > > 2) transaction that creates a new refilenode gets decoded, but we skip >it because w

Re: reindexing an invalid index should not use ERRCODE_INDEX_CORRUPTED

2023-12-06 Thread Michael Paquier
On Wed, Dec 06, 2023 at 05:40:44PM -0800, Andres Freund wrote: > This looks good to me! Cool. I've applied this one, then. -- Michael signature.asc Description: PGP signature

Re: undetected deadlock in ALTER SUBSCRIPTION ... REFRESH PUBLICATION

2023-12-06 Thread Shlok Kyal
Hi, > I mean to commit the open transaction at the below place in > wait_for_relation_state_change() > > wait_for_relation_state_change() > { > ... > -- commit the xact > WaitLatch(); > ... > } > > Then start after the wait is over. This is just to test whether it > improves the difference in regr

Re: [PoC] pg_upgrade: allow to upgrade publisher node

2023-12-06 Thread Amit Kapila
On Wed, Dec 6, 2023 at 10:02 AM Amit Kapila wrote: > > On Wed, Dec 6, 2023 at 9:40 AM vignesh C wrote: > > > > On Tue, 5 Dec 2023 at 11:11, Hayato Kuroda (Fujitsu) > > wrote: > > > > > > Dear Sawada-san, hackers, > > > > > > Based on comments I made a fix. PSA the patch. > > > > > > > Thanks for

Re: catalog access with reset GUCs during parallel worker startup

2023-12-06 Thread David Rowley
On Wed, 23 Feb 2022 at 15:51, Andres Freund wrote: > The tests fail: > +ERROR: invalid value for parameter "session_authorization": "andres" > +CONTEXT: while setting parameter "session_authorization" to "andres" > +parallel worker > +while scanning relation "public.pvactst" > > but that's easil

Re: Improve rowcount estimate for UNNEST(column)

2023-12-06 Thread Paul Jungwirth
Hello, On 11/26/23 12:22, Tom Lane wrote: > Yes, this regression test is entirely unacceptable; the numbers will > not be stable enough. Even aside from the different-settings issue, > you can't rely on ANALYZE deriving exactly the same stats every time. > Usually what we try to do is devise a q

Re: catalog access with reset GUCs during parallel worker startup

2023-12-06 Thread David Rowley
On Thu, 10 Feb 2022 at 13:33, Andres Freund wrote: > Postmaster's GUC state will already be loaded via read_nondefault_variables(), > much earlier in startup. Well before bgworkers get control and before > transaction environment is up. > > Setting a watchpoint on enableFsync, in a parallel worker

Proposal to add page headers to SLRU pages

2023-12-06 Thread Li, Yong
Hi all, PostgreSQL currently maintains several data structures in the SLRU cache. The current SLRU pages do not have any header, so it is impossible to checksum a page and verify its integrity. It is very difficult to debug issues caused by corrupted SLRU pages. Also, without a page header,

Re: Remove MSVC scripts from the tree

2023-12-06 Thread Peter Eisentraut
On 06.12.23 21:52, Andrew Dunstan wrote: On 2023-12-06 We 12:24, Peter Eisentraut wrote: On 06.12.23 17:27, Andrew Dunstan wrote: But the VS2019 compiler implements enough of C99 to pass our meson test, unlike VS2017. Maybe the test is too strict. After all, we know we can in fact build with

Re: Synchronizing slots from primary to standby

2023-12-06 Thread Drouvot, Bertrand
Hi, On 12/6/23 11:58 AM, shveta malik wrote: On Wed, Dec 6, 2023 at 3:00 PM Drouvot, Bertrand wrote: Hi, On 12/6/23 7:18 AM, shveta malik wrote: On Wed, Dec 6, 2023 at 10:56 AM Amit Kapila wrote: I feel that is indirectly relying on the fact that the primary won't advance logical slots u

Re: Synchronizing slots from primary to standby

2023-12-06 Thread Drouvot, Bertrand
Hi, On 12/6/23 12:23 PM, shveta malik wrote: On Wed, Dec 6, 2023 at 4:28 PM shveta malik wrote: PFA v43, changes are: Thanks! v43-001: 1) Support of 'failover' dump in pg_dump. It was missing earlier. v43-002: 1) Slot-sync worker now checks validity of primary_slot_name by connecting

<    1   2