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

2023-12-18 Thread John Naylor
On Tue, Dec 19, 2023 at 12:37 PM Masahiko Sawada wrote: > > On Mon, Dec 18, 2023 at 3:41 PM John Naylor wrote: > > Let's do it in just one place. In TidStoreCreate(), do > > > > /* clamp max_bytes to at least the size of the empty tree with > > allocated blocks, so it doesn't immediately appear f

Re: Change GUC hashtable to use simplehash?

2023-12-18 Thread Jeff Davis
On Mon, 2023-12-18 at 13:39 +0700, John Naylor wrote: > For now just two: > v10-0002 is Jeff's change to the search path cache, but with the > chunked interface that I found to be faster. Did you consider specializing for the case of an aligned pointer? If it's a string (c string or byte string) i

Re: Proposal to add page headers to SLRU pages

2023-12-18 Thread Li, Yong
> This work is being done in file.c – it seems to me the proper way to > proceed would be to continue writing on-disk upgrade logic here. > Besides that this looks good to me, would like to hear what others have to > say. Thank you, Rishu for taking time to review the code. I've updated the pat

Re: "pgoutput" options missing on documentation

2023-12-18 Thread Amit Kapila
On Tue, Dec 19, 2023 at 12:07 PM Peter Smith wrote: > > On Tue, Dec 19, 2023 at 1:35 AM Emre Hasegeli wrote: > > > > > Fair enough. I think we should push your first patch only in HEAD as > > > this is a minor improvement over the current behaviour. What do you > > > think? > > > > I agree. > > P

Re: [DOC] Introducing Quick Start Guide to PL/pgSQL and PL/Python Documentation

2023-12-18 Thread Japin Li
On Sat, 16 Dec 2023 at 18:49, Ishaan Adarsh wrote: > Hi > > I have made some documentation enhancements for PL/pgSQL and PL/Python > sections. The changes include the addition of a Quick Start Guide to > facilitate a smoother onboarding experience for users. > > Patch File Name: > 0001-plpyhton-

Re: "pgoutput" options missing on documentation

2023-12-18 Thread Peter Smith
On Tue, Dec 19, 2023 at 1:35 AM Emre Hasegeli wrote: > > > Fair enough. I think we should push your first patch only in HEAD as > > this is a minor improvement over the current behaviour. What do you > > think? > > I agree. Patch 0001 AFAICT parse_output_parameters possible errors are never test

Update the comment in nodes.h to cover Cardinality

2023-12-18 Thread Richard Guo
By chance I discovered that the comment for the typedefs of "double"s does not cover Cardinality. Should we update that comment accordingly, maybe something like below? - * Typedefs for identifying qualifier selectivities and plan costs as such. - * These are just plain "double"s, but declaring a

Re: Synchronizing slots from primary to standby

2023-12-18 Thread Amit Kapila
On Tue, Dec 19, 2023 at 4:51 AM Peter Smith wrote: > > > == > doc/src/sgml/system-views.sgml > > 3. > + > + The hot standby can have any of these sync_state values for the slots > but > + on a hot standby, the slots with state 'r' and 'i' can neither be used > + for logic

Re: Making the initial and maximum DSA segment sizes configurable

2023-12-18 Thread Masahiko Sawada
Hi, On Wed, Mar 22, 2023 at 12:15 AM Masahiko Sawada wrote: > > Hi all, > > I started this new thread from another thread[1] where we're > discussing a new storage for TIDs, TidStore, since we found a > difficulty about the memory usage limit for TidStores on DSA. > > TidStore is a new data struc

Re: Add a perl function in Cluster.pm to generate WAL

2023-12-18 Thread Bharath Rupireddy
On Tue, Dec 19, 2023 at 9:51 AM Michael Paquier wrote: > > On Mon, Dec 18, 2023 at 08:48:09AM -0300, Euler Taveira wrote: > > It is cheaper. > > Agreed that this could just use a set of pg_logical_emit_message() > when jumping across N segments. Thanks. I missed the point of using pg_logical_emit

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

2023-12-18 Thread Masahiko Sawada
On Mon, Dec 18, 2023 at 3:41 PM John Naylor wrote: > > On Fri, Dec 15, 2023 at 3:15 PM Masahiko Sawada wrote: > > > > On Fri, Dec 15, 2023 at 10:30 AM John Naylor > > wrote: > > > > parallel_vacuum_init(Relation rel, Relation *indrels, int nindexes, > > > - int nrequested_workers, int max_item

Re: SLRU optimization - configurable buffer pool and partitioning the SLRU lock

2023-12-18 Thread Dilip Kumar
On Mon, Dec 18, 2023 at 11:00 PM Robert Haas wrote: > > On Mon, Dec 18, 2023 at 12:04 PM Robert Haas wrote: > > certain sense they are competing for the same job. However, they do > > aim to alleviate different TYPES of contention: the group XID update > > stuff should be most valuable when lots

Re: Synchronizing slots from primary to standby

2023-12-18 Thread Amit Kapila
On Tue, Dec 19, 2023 at 6:58 AM Peter Smith wrote: > > Here are some comments for the patch v49-0002. > > (This is in addition to my review comments for v48-0002 [1]) > > == > src/backend/access/transam/xlogrecovery.c > > > 1. FinishWalRecovery > > + * > + * We do not update the sync_state fro

Re: Clang optimiser vs preproc.c

2023-12-18 Thread Thomas Munro
On Tue, Dec 19, 2023 at 11:42 AM Thomas Munro wrote: > Hrmph. Well something weird is going on, but it might indeed involve > me being confused about debug options of the compiler itself. How can > one find out which build options were used for clang/llvm compiler + > libraries? My earlier repo

Re: Add a perl function in Cluster.pm to generate WAL

2023-12-18 Thread Michael Paquier
On Mon, Dec 18, 2023 at 08:48:09AM -0300, Euler Taveira wrote: > It is cheaper. Agreed that this could just use a set of pg_logical_emit_message() when jumping across N segments. Another thing that seems quite important to me is to force a flush of WAL with the last segment switch, and the new "f

Re: WAL Insertion Lock Improvements

2023-12-18 Thread Nathan Bossart
On Tue, Jul 25, 2023 at 04:43:16PM +0900, Michael Paquier wrote: > 0001 has been now applied. I have done more tests while looking at > this patch since yesterday and was surprised to see higher TPS numbers > on HEAD with the same tests as previously, and the patch was still > shining with more th

Re: Improve eviction algorithm in ReorderBuffer

2023-12-18 Thread Masahiko Sawada
On Sun, Dec 17, 2023 at 11:40 AM Amit Kapila wrote: > > On Fri, Dec 15, 2023 at 11:29 AM Masahiko Sawada > wrote: > > > > On Fri, Dec 15, 2023 at 12:37 PM Amit Kapila > > wrote: > > > > > > On Wed, Dec 13, 2023 at 6:01 AM Masahiko Sawada > > > wrote: > > > > > > > > > > IIUC, you are giving

Re: add non-option reordering to in-tree getopt_long

2023-12-18 Thread Tom Lane
Nathan Bossart writes: > On Mon, Dec 18, 2023 at 02:41:22PM -0500, Tom Lane wrote: >> We just had a user complaint that seems to trace to exactly this >> bogus reporting in pg_ctl [1]. Although I was originally not >> very pleased with changing our getopt_long to do switch reordering, >> I'm now

Re: Proposal to add page headers to SLRU pages

2023-12-18 Thread Bagga, Rishu
On Thu, Dec 8, 2023 at 1:36 AM Li, Yong wrote: >Given so many different approaches were discussed, I have started a >wiki to record and collaborate all efforts towards SLRU >improvements. The wiki provides a concise overview of all the ideas >discussed and can serve as a portal for all histo

Re: Synchronizing slots from primary to standby

2023-12-18 Thread Peter Smith
Here are some comments for the patch v49-0002. (This is in addition to my review comments for v48-0002 [1]) == src/backend/access/transam/xlogrecovery.c 1. FinishWalRecovery + * + * We do not update the sync_state from READY to NONE here, as any failed + * update could leave some slots in

Re: Transaction timeout

2023-12-18 Thread Japin Li
On Mon, 18 Dec 2023 at 17:40, Andrey M. Borodin wrote: >> On 18 Dec 2023, at 14:32, Japin Li wrote: >> >> >> Thanks for updating the patch > > Sorry for the noise, but commitfest bot found one more bug in handling > statement timeout. PFA v11. > On Windows, there still have an error: diff -w

Re: POC PATCH: copy from ... exceptions to: (was Re: VLDB Features)

2023-12-18 Thread Masahiko Sawada
On Mon, Dec 18, 2023 at 4:41 PM jian he wrote: > > On Mon, Dec 18, 2023 at 1:09 PM torikoshia wrote: > > > > Hi, > > > > > save the error metadata to system catalogs would be more expensive, > > > please see below explanation. > > > I have no knowledge of publications. > > > but i feel there is

Re: POC PATCH: copy from ... exceptions to: (was Re: VLDB Features)

2023-12-18 Thread Masahiko Sawada
On Mon, Dec 18, 2023 at 9:16 AM jian he wrote: > > On Fri, Dec 15, 2023 at 4:49 AM Masahiko Sawada wrote: > > > > Hi, > > > > I've read this thread and the latest patch. IIUC with SAVE_ERROR > > option, COPY FROM creates an error table for the target table and > > writes error information there.

Re: Synchronizing slots from primary to standby

2023-12-18 Thread Peter Smith
Here are some review comments for v48-0002 == doc/src/sgml/config.sgml 1. + If slot synchronization is enabled then it is also necessary to + specify dbname in the + primary_conninfo string. This will only be used for + slot synchronization. It is ignored f

Re: Clang optimiser vs preproc.c

2023-12-18 Thread Thomas Munro
On Sun, Dec 17, 2023 at 1:29 AM Andres Freund wrote: > On 2023-12-15 22:19:56 -0500, Tom Lane wrote: > > Thomas Munro writes: > > > On Sat, Dec 16, 2023 at 3:44 PM Tom Lane wrote: > > >> Thomas Munro writes: > > >>> FYI, it looks like there is a big jump in CPU time to compile preproc.c > > >>

Re: add non-option reordering to in-tree getopt_long

2023-12-18 Thread Nathan Bossart
On Mon, Dec 18, 2023 at 02:41:22PM -0500, Tom Lane wrote: > We just had a user complaint that seems to trace to exactly this > bogus reporting in pg_ctl [1]. Although I was originally not > very pleased with changing our getopt_long to do switch reordering, > I'm now wondering if we should back-pa

Re: Add --check option to pgindent

2023-12-18 Thread Tristan Partin
On Mon Dec 18, 2023 at 11:21 AM CST, Jelte Fennema-Nio wrote: On Mon, 18 Dec 2023 at 17:50, Tristan Partin wrote: > I could propose something. It would help if I had an example of such > a tool that already exists. Basically the same behaviour as what you're trying to add now for --check, only

Re: Add --check option to pgindent

2023-12-18 Thread Tristan Partin
On Mon Dec 18, 2023 at 10:50 AM CST, Tristan Partin wrote: On Mon Dec 18, 2023 at 10:14 AM CST, Jelte Fennema-Nio wrote: > On Mon, 18 Dec 2023 at 13:42, Daniel Gustafsson wrote: > > I think this is pretty much ready to go, the attached v4 squashes the changes > > and fixes the man-page which al

Re: index prefetching

2023-12-18 Thread Robert Haas
On Sat, Dec 9, 2023 at 1:08 PM Tomas Vondra wrote: > But there's a layering problem that I don't know how to solve - I don't > see how we could make indexam.c entirely oblivious to the prefetching, > and move it entirely to the executor. Because how else would you know > what to prefetch? Yeah, t

Re: encoding affects ICU regex character classification

2023-12-18 Thread Jeff Davis
On Fri, 2023-12-15 at 16:48 -0800, Jeremy Schneider wrote: > This goes back to my other thread (which sadly got very little > discussion): PosgreSQL really needs to be safe by /default/ Doesn't a built-in provider help create a safer option? The built-in provider's version of Unicode will be cons

Fixing backslash dot for COPY FROM...CSV

2023-12-18 Thread Daniel Verite
Hi, PFA a patch that attempts to fix the bug that \. on a line by itself is handled incorrectly by COPY FROM ... CSV. This issue has been discussed several times previously, for instance in [1] and [2], and mentioned in the doc for \copy in commit 42d3125. There's one case that works today: whe

Re: Built-in CTYPE provider

2023-12-18 Thread Jeff Davis
On Fri, 2023-12-15 at 16:30 -0800, Jeremy Schneider wrote: > Looking closer, patches 3 and 4 look like an incremental extension of > this earlier idea; Yes, it's essentially the same thing extended to a few more files. I don't know if "incremental" is the right word though; this is a substantial e

Re: add non-option reordering to in-tree getopt_long

2023-12-18 Thread Tom Lane
Michael Paquier writes: > On Thu, Jul 13, 2023 at 09:38:42PM -0700, Nathan Bossart wrote: >> Take the following examples of client programs that accept one non-option: >> >> ~$ pg_resetwal a b c >> pg_resetwal: error: too many command-line arguments (first is "b") >> pg_resetwal: hint: Try "pg_re

Re: trying again to get incremental backup

2023-12-18 Thread Robert Haas
On Fri, Dec 15, 2023 at 6:58 AM Peter Eisentraut wrote: > A separate bikeshedding topic: The GUC "summarize_wal", could that be > "wal_something" instead? (wal_summarize? wal_summarizer?) It would be > nice if these settings names group together a bit, both with existing > wal_* ones and also wi

Re: trying again to get incremental backup

2023-12-18 Thread Robert Haas
On Fri, Dec 15, 2023 at 6:53 AM Peter Eisentraut wrote: > The first fixes up some things in nls.mk related to a file move. The > second is some cleanup because some function you are using has been > removed in the meantime; you probably found that yourself while rebasing. Incorporated these. As

Re: SLRU optimization - configurable buffer pool and partitioning the SLRU lock

2023-12-18 Thread Robert Haas
On Mon, Dec 18, 2023 at 12:53 PM Andrey M. Borodin wrote: > One page still accommodates 32K transaction statuses under one lock. It feels > like a lot. About 1 second of transactions on a typical installation. > > When the group commit was committed did we have a benchmark to estimate > efficien

Re: SLRU optimization - configurable buffer pool and partitioning the SLRU lock

2023-12-18 Thread Andrey M. Borodin
> On 18 Dec 2023, at 22:30, Robert Haas wrote: > > On Mon, Dec 18, 2023 at 12:04 PM Robert Haas wrote: >> certain sense they are competing for the same job. However, they do >> aim to alleviate different TYPES of contention: the group XID update >> stuff should be most valuable when lots of p

Re: common signal handler protection

2023-12-18 Thread Nathan Bossart
rebased for cfbot -- Nathan Bossart Amazon Web Services: https://aws.amazon.com >From c5fc2186960c483d53789f27fcf84771e98c5ca3 Mon Sep 17 00:00:00 2001 From: Nathan Bossart Date: Tue, 28 Nov 2023 14:58:20 -0600 Subject: [PATCH v5 1/3] Check that MyProcPid == getpid() in all signal handlers. In

Re: SLRU optimization - configurable buffer pool and partitioning the SLRU lock

2023-12-18 Thread Robert Haas
On Mon, Dec 18, 2023 at 12:04 PM Robert Haas wrote: > certain sense they are competing for the same job. However, they do > aim to alleviate different TYPES of contention: the group XID update > stuff should be most valuable when lots of processes are trying to > update the same page, and the bank

Re: Add --check option to pgindent

2023-12-18 Thread Jelte Fennema-Nio
On Mon, 18 Dec 2023 at 17:50, Tristan Partin wrote: > I could propose something. It would help if I had an example of such > a tool that already exists. Basically the same behaviour as what you're trying to add now for --check, only instead of printing the diff it would actually change the files

Re: SLRU optimization - configurable buffer pool and partitioning the SLRU lock

2023-12-18 Thread Robert Haas
On Tue, Dec 12, 2023 at 8:29 AM Alvaro Herrera wrote: > The problem I see is that the group update mechanism is designed around > contention of the global xact-SLRU control lock; it uses atomics to > coordinate a single queue when the lock is contended. So if we split up > the global SLRU control

Re: optimize atomic exchanges

2023-12-18 Thread Nathan Bossart
On Fri, Dec 15, 2023 at 04:56:27AM -0800, Andres Freund wrote: > I don't think we need the inline asm. Otherwise looks good. Committed with that change. Thanks for reviewing! I am going to watch the buildfarm especially closely for this one. -- Nathan Bossart Amazon Web Services: https://aws.a

Re: Add --check option to pgindent

2023-12-18 Thread Tristan Partin
On Mon Dec 18, 2023 at 10:14 AM CST, Jelte Fennema-Nio wrote: On Mon, 18 Dec 2023 at 13:42, Daniel Gustafsson wrote: > I think this is pretty much ready to go, the attached v4 squashes the changes > and fixes the man-page which also needed an update. The referenced Wiki page > will need an edit

Re: micro-optimizing json.c

2023-12-18 Thread Nathan Bossart
On Fri, Dec 08, 2023 at 05:56:20PM -0500, Tom Lane wrote: > Nathan Bossart writes: >> Here are a couple more easy micro-optimizations in nearby code. I've split >> them into individual patches for review, but I'll probably just combine >> them into one patch before committing. > > LGTM Committe

Re: psql JSON output format

2023-12-18 Thread Jelte Fennema-Nio
On Mon, 18 Dec 2023 at 16:38, Christoph Berg wrote: > We'd want both patches even if they do the same thing on two different > levels, I'd say. Makes sense. One thing I was still wondering is if it wouldn't be easier to wrap all queries in "copy (select whatever) to stdout (format json)" automati

Re: Add --check option to pgindent

2023-12-18 Thread Jelte Fennema-Nio
On Mon, 18 Dec 2023 at 17:14, Jelte Fennema-Nio wrote: > One thing I'm wondering: When both --check and --diff are passed, > should pgindent still early exit with 2 on the first incorrectly > formatted file? Or should it show diffs for all failing files? I'm > leaning towards the latter making mor

Re: Add --check option to pgindent

2023-12-18 Thread Jelte Fennema-Nio
On Mon, 18 Dec 2023 at 13:42, Daniel Gustafsson wrote: > I think this is pretty much ready to go, the attached v4 squashes the changes > and fixes the man-page which also needed an update. The referenced Wiki page > will need an edit or two after this goes in, but that's easy enough. One thing I

Re: Add --check option to pgindent

2023-12-18 Thread Matthias van de Meent
On Mon, 18 Dec 2023 at 16:45, Tristan Partin wrote: > > On Mon Dec 18, 2023 at 6:41 AM CST, Daniel Gustafsson wrote: > > > On 15 Dec 2023, at 16:43, Tristan Partin wrote: > > > > > Here is a v3. > > > > I think this is pretty much ready to go, the attached v4 squashes the > > changes > > and fix

Re: Add --check option to pgindent

2023-12-18 Thread Tristan Partin
On Mon Dec 18, 2023 at 7:56 AM CST, Euler Taveira wrote: On Mon, Dec 18, 2023, at 9:41 AM, Daniel Gustafsson wrote: > > On 15 Dec 2023, at 16:43, Tristan Partin wrote: > > > Here is a v3. > > I think this is pretty much ready to go, the attached v4 squashes the changes > and fixes the man-pag

Re: Add --check option to pgindent

2023-12-18 Thread Tristan Partin
On Mon Dec 18, 2023 at 6:41 AM CST, Daniel Gustafsson wrote: > On 15 Dec 2023, at 16:43, Tristan Partin wrote: > Here is a v3. I think this is pretty much ready to go, the attached v4 squashes the changes and fixes the man-page which also needed an update. The referenced Wiki page will need a

Re: psql JSON output format

2023-12-18 Thread Christoph Berg
Re: Jelte Fennema-Nio > This seems useful to me too, but my usecases would also be solved (and > possibly better solved) by adding JSON support to COPY as proposed > here: > https://www.postgresql.org/message-id/flat/CALvfUkBxTYy5uWPFVwpk_7ii2zgT07t3d-yR_cy4sfrrLU%3Dkcg%40mail.gmail.com Thanks fo

Re: A wrong comment about search_indexed_tlist_for_var

2023-12-18 Thread Matt Skelley
The following review has been posted through the commitfest application: make installcheck-world: not tested Implements feature: tested, passed Spec compliant: tested, passed Documentation:tested, passed Comment is updated correctly.

Re: psql JSON output format

2023-12-18 Thread Jelte Fennema-Nio
On Mon, 18 Dec 2023 at 15:56, Christoph Berg wrote: > I noticed psql was lacking JSON formatting of query results which I > need for a follow-up patch. This seems useful to me too, but my usecases would also be solved (and possibly better solved) by adding JSON support to COPY as proposed here:

Re: psql JSON output format

2023-12-18 Thread Christoph Berg
Re: To PostgreSQL Hackers > On the command line, the format is selected by `psql --json` and `psql -J`. Among other uses, it enables easy post-processing of psql output using `jq`: $ psql -lJ | jq [ { "Name": "myon", "Owner": "myon", "Encoding": "UTF8", "Locale Provider": "libc"

psql JSON output format

2023-12-18 Thread Christoph Berg
I noticed psql was lacking JSON formatting of query results which I need for a follow-up patch. It also seems useful generally, so here's a patch: postgres=# \pset format json Output format is json. postgres=# select * from (values ('one', 2, 'three'), ('four', 5, 'six')) as sub(a, b, c); [ { "a"

Re: Detecting some cases of missing backup_label

2023-12-18 Thread Stephen Frost
Greetings, * Stephen Frost (sfr...@snowman.net) wrote: > * Andres Freund (and...@anarazel.de) wrote: > > I recently mentioned to Robert (and also Heikki earlier), that I think I > > see a > > way to detect an omitted backup_label in a relevant subset of the cases > > (it'd > > apply to the pg_co

Re: "pgoutput" options missing on documentation

2023-12-18 Thread Emre Hasegeli
> Fair enough. I think we should push your first patch only in HEAD as > this is a minor improvement over the current behaviour. What do you > think? I agree.

Re: Simplify newNode()

2023-12-18 Thread Heikki Linnakangas
On 15/12/2023 00:44, Tom Lane wrote: Good point. Looking closer, modern compilers will actually turn the MemSetLoop() in MemoryContextAllocZeroAligned() into a call to memset() anyway! Funny. That is true for recent versions of gcc, clang, and MSVC. Not here ... Hmm, according to godbolt, the

Re: Add --check option to pgindent

2023-12-18 Thread Euler Taveira
On Mon, Dec 18, 2023, at 9:41 AM, Daniel Gustafsson wrote: > > On 15 Dec 2023, at 16:43, Tristan Partin wrote: > > > Here is a v3. > > I think this is pretty much ready to go, the attached v4 squashes the changes > and fixes the man-page which also needed an update. The referenced Wiki page > w

Re: Remove MSVC scripts from the tree

2023-12-18 Thread Peter Eisentraut
On 18.12.23 11:49, vignesh C wrote: Few comments: 1) Now that the MSVC build scripts are removed, should we have the reference to "MSVC build scripts" here? ltree.h: I think this note is correct and can be kept, as it explains the historical context. 2) I had seen that if sed/gzip is not av

Re: Add new for_each macros for iterating over a List that do not require ListCell pointer

2023-12-18 Thread Jelte Fennema-Nio
The more I think about it and look at the code, the more I like the usage of the loop style proposed in the previous 0003 patch (which automatically declares a loop variable for the scope of the loop using a second for loop). I did some testing on godbolt.org and both versions of the macros result

Re: Postgres picks suboptimal index after building of an extended statistics

2023-12-18 Thread Alexander Korotkov
Hi! I'd like to get this subject off the ground. The problem originally described in [1] obviously comes from wrong selectivity estimation. "Dependencies" extended statistics lead to significant selectivity miss 24/1000 instead of 1/1000. When the estimation is correct, the PostgreSQL optimizer

Re: "pgoutput" options missing on documentation

2023-12-18 Thread Amit Kapila
On Mon, Dec 18, 2023 at 1:08 PM Emre Hasegeli wrote: > > > I found the existing error code appropriate because for syntax > > specification, either we need to mandate this at the grammar level or > > at the API level. Also, I think we should give a message similar to an > > existing message: "publ

Re: planner chooses incremental but not the best one

2023-12-18 Thread Tomas Vondra
On 12/18/23 11:40, Richard Guo wrote: > > On Mon, Dec 18, 2023 at 7:31 AM Tomas Vondra > mailto:tomas.von...@enterprisedb.com>> > wrote: > > Oh! Now I see what you meant by using the new formula in 84f9a35e3 > depending on how we sum tuples. I agree that seems like the right thing. >

Re: Add --check option to pgindent

2023-12-18 Thread Daniel Gustafsson
> On 15 Dec 2023, at 16:43, Tristan Partin wrote: > Here is a v3. I think this is pretty much ready to go, the attached v4 squashes the changes and fixes the man-page which also needed an update. The referenced Wiki page will need an edit or two after this goes in, but that's easy enough. -- D

RE: Synchronizing slots from primary to standby

2023-12-18 Thread Zhijie Hou (Fujitsu)
On Monday, December 11, 2023 5:31 PM shveta malik wrote: > > On Thu, Dec 7, 2023 at 1:33 PM Peter Smith > wrote: > > > > Hi. > > > > Here are my review comments for patch v43-0002. > > > > > == > > src/backend/access/transam/xlogrecovery.c > > > > 13. > > + /* > > + * Shutdown the slot syn

Re: [DOC] Introducing Quick Start Guide to PL/pgSQL and PL/Python Documentation

2023-12-18 Thread Euler Taveira
On Sat, Dec 16, 2023, at 7:49 AM, Ishaan Adarsh wrote: > I have made some documentation enhancements for PL/pgSQL and PL/Python > sections. The changes include the addition of a Quick Start Guide to > facilitate a smoother onboarding experience for users. Great! Add your patch to the next CF [1]

Re: Add a perl function in Cluster.pm to generate WAL

2023-12-18 Thread Euler Taveira
On Mon, Dec 18, 2023, at 2:39 AM, Bharath Rupireddy wrote: > Rebase needed, attached v3 patch. I think you don't understand the suggestion proposed by Michael and Kyotaro. If you do a comparison with the following SQL commands: euler=# select pg_walfile_name(pg_current_wal_lsn()); pg_walfile

Re: Synchronizing slots from primary to standby

2023-12-18 Thread Amit Kapila
On Fri, Dec 15, 2023 at 11:03 AM shveta malik wrote: > > Sorry, I missed attaching the patch. PFA v48. > Few comments on v48_0002 1. +static void +slotsync_reread_config(WalReceiverConn *wrconn) { ... + pfree(old_primary_conninfo); + pfree(old_primary_slotname); + + if (r

Re: Remove MSVC scripts from the tree

2023-12-18 Thread vignesh C
On Wed, 6 Dec 2023 at 12:59, Michael Paquier wrote: > > On Wed, Dec 06, 2023 at 12:15:50PM +0530, Shubham Khanna wrote: > > Patch is not applying. Please share the Rebased Version. Please find the > > error: > > Thanks. Here you go with a v6. Few comments: 1) Now that the MSVC build scripts are

Re: planner chooses incremental but not the best one

2023-12-18 Thread Richard Guo
On Mon, Dec 18, 2023 at 7:31 AM Tomas Vondra wrote: > Oh! Now I see what you meant by using the new formula in 84f9a35e3 > depending on how we sum tuples. I agree that seems like the right thing. > > I'm not sure it'll actually help with the issue, though - if I apply the > patch, the plan does n

Re: Move walreceiver state assignment (to WALRCV_STREAMING) in WalReceiverMain()

2023-12-18 Thread Drouvot, Bertrand
Hi, On 12/13/23 3:33 PM, Michael Paquier wrote: On Tue, Dec 12, 2023 at 04:54:32PM -0300, Euler Taveira wrote: Couldn't it give up before starting if you apply your patch? My main concern is due to a slow system, the walrcv_connect() took to long in WalReceiverMain() and the code above kills th

Re: Move walreceiver state assignment (to WALRCV_STREAMING) in WalReceiverMain()

2023-12-18 Thread Drouvot, Bertrand
Hi, On 12/12/23 8:54 PM, Euler Taveira wrote: On Tue, Dec 12, 2023, at 12:58 PM, Drouvot, Bertrand wrote: Currently walrcv->walRcvState is set to WALRCV_STREAMING at the beginning of WalReceiverMain(). But it seems that after this assignment things could be wrong before the walreicever actuall

Re: Simplify newNode()

2023-12-18 Thread John Naylor
On Fri, Dec 15, 2023 at 5:44 AM Tom Lane wrote: > > I did check that the v1 patch successfully inlines newNode() and > reduces it to just a MemoryContextAllocZeroAligned call, so it's > correct that modern compilers do that better than whatever I tested > in 2008. But I wonder what is happening i

Re: remaining sql/json patches

2023-12-18 Thread jian he
Hi! another minor issue I found: +SELECT pg_get_expr(adbin, adrelid) +FROM pg_attrdef +WHERE adrelid = 'test_jsonb_constraints'::regclass +ORDER BY 1; + +SELECT pg_get_expr(adbin, adrelid) FROM pg_attrdef WHERE adrelid = 'test_jsonb_constraints'::regclass; I think these two queries are the same?

Re: Transaction timeout

2023-12-18 Thread Andrey M. Borodin
> On 18 Dec 2023, at 14:32, Japin Li wrote: > > > Thanks for updating the patch Sorry for the noise, but commitfest bot found one more bug in handling statement timeout. PFA v11. Best regards, Andrey Borodin. v11-0001-Introduce-transaction_timeout.patch Description: Binary data

Re: Transaction timeout

2023-12-18 Thread Japin Li
On Mon, 18 Dec 2023 at 13:49, Andrey M. Borodin wrote: >> On 16 Dec 2023, at 05:58, Japin Li wrote: >> >> >> On Fri, 15 Dec 2023 at 17:51, Andrey M. Borodin wrote: On 8 Dec 2023, at 15:29, Japin Li wrote: Thanks for updating the patch. LGTM. >>> >>> PFA v9. Changes: >>> 1. Adde

Re: ALTER COLUMN ... SET EXPRESSION to alter stored generated column's expression

2023-12-18 Thread Peter Eisentraut
On 11.12.23 13:22, Amul Sul wrote: create table t1 (a int, b int generated always as (a + 1) stored); alter table t1 add column c int, alter column b set expression as (a + c); ERROR:  42703: column "c" does not exist I think intuitively, this ought to work.  Maybe just movi

Re: trying again to get incremental backup

2023-12-18 Thread Peter Eisentraut
Another set of comments, about the patch that adds pg_combinebackup: Make sure all the options are listed in a consistent order. We have lately changed everything to be alphabetical. This includes: - reference page pg_combinebackup.sgml - long_options listing - getopt_long() argument - su

Re: introduce dynamic shared memory registry

2023-12-18 Thread Nikita Malakhov
Hi! This patch looks like a good solution for a pain in the ass, I'm too for this patch to be committed. Have looked through the code and agree with Andrei, the code looks good. Just a suggestion - maybe it is worth adding a function for detaching the segment, for cases when we unload and/or re-lo

Re: introduce dynamic shared memory registry

2023-12-18 Thread Andrei Lepikhov
On 18/12/2023 13:39, Andrei Lepikhov wrote: On 5/12/2023 10:46, Nathan Bossart wrote: I don't presently have any concrete plans to use this for anything, but I thought it might be useful for extensions for caching, etc. and wanted to see whether there was any interest in the feature. I am deli