Re: doc: add missing "id" attributes to extension packaging page

2023-03-23 Thread Brar Piening
On 24.03.2023 at 05:09, Karl O. Pinc wrote: Hi Brar, An observation: The # that shows up when hovering over section-level headings is styled as the section-level heading is. But the # that shows up when hovering over varlistentrys has the default text style. This works for me. It's nice to

Re: Should vacuum process config file reload more often

2023-03-23 Thread Masahiko Sawada
On Fri, Mar 24, 2023 at 9:27 AM Melanie Plageman wrote: > > On Thu, Mar 23, 2023 at 2:09 AM Masahiko Sawada wrote: > > On Sun, Mar 19, 2023 at 7:47 AM Melanie Plageman > > wrote: > > Do we need to calculate the number of workers running with > > nworkers_for_balance by iterating over the

Re: [PoC] Let libpq reject unexpected authentication requests

2023-03-23 Thread Michael Paquier
On Thu, Mar 23, 2023 at 03:40:55PM -0700, Jacob Champion wrote: > On Tue, Mar 21, 2023 at 11:01 PM Michael Paquier wrote: >> contrib/sslinfo/ has ssl_client_cert_present(), that we could use in >> the tests to make sure that the client has actually sent a >> certificate? How about adding some of

Re: psql \watch 2nd argument: iteration count

2023-03-23 Thread Yugo NAGATA
Hello, On Thu, 16 Mar 2023 21:15:30 -0700 Andrey Borodin wrote: > On Wed, Mar 15, 2023 at 5:54 PM Michael Paquier wrote: > > > > On Wed, Mar 15, 2023 at 04:58:49PM +0900, Michael Paquier wrote: > > > Yep. You are right. > > > > Fixed that and applied 0001. > Great, thanks! > > > > > +

Re: doc: add missing "id" attributes to extension packaging page

2023-03-23 Thread Brar Piening
On 23.03.2023 at 23:31, Karl O. Pinc wrote: Hi Brar, It occurs to me that I had not actually tested the way the anchor is put only after the last term in a varlistentry. (The code looked obviously right and should work if any varlistentry terms have anchors, which they do, but) Have you

Re: doc: add missing "id" attributes to extension packaging page

2023-03-23 Thread Karl O. Pinc
Hi Brar, An observation: The # that shows up when hovering over section-level headings is styled as the section-level heading is. But the # that shows up when hovering over varlistentrys has the default text style. This works for me. It's nice to have the "section #"s look like the section

Re: Doc: Improve note about copying into postgres_fdw foreign tables in batch

2023-03-23 Thread Etsuro Fujita
On Thu, Mar 23, 2023 at 6:55 PM Daniel Gustafsson wrote: > > seems more appropriate to me as well in this context, so I > > left it alone. > > And just to be clear, I think you are right in leaving it alone given the > context. > > > Attached is an updated version of the patch. > > LGTM. Cool!

Re: Initial Schema Sync for Logical Replication

2023-03-23 Thread Amit Kapila
On Thu, Mar 23, 2023 at 9:24 PM Kumar, Sachin wrote: > > > From: Amit Kapila > > IIUC, this is possible only if tablesync process uses a snapshot different > > than the > > snapshot we have used to perform the initial schema sync, otherwise, this > > shouldn't be a problem. Let me try to

Re: add log messages when replication slots become active and inactive (was Re: Is it worth adding ReplicationSlot active_pid to ReplicationSlotPersistentData?)

2023-03-23 Thread Greg Stark
On Thu, 23 Mar 2023 at 23:30, Bharath Rupireddy wrote: > > > + ereport(log_replication_commands ? LOG : DEBUG3, > > + (errmsg("acquired physical replication slot \"%s\"", > > + slotname))); So this is just a bit of bike-shedding but I don't feel like these log messages really meet the standard

Re: Move backup-related code to xlogbackup.c/.h

2023-03-23 Thread Gregory Stark (as CFM)
On Wed, 26 Oct 2022 at 02:08, Bharath Rupireddy wrote: > > I'm attaching the v9 patch set herewith after rebasing. Please review > it further. It looks like neither reviewer has been really convinced this is the direction they want to go and I think that's why the thread has been pretty dead

Re: add log messages when replication slots become active and inactive (was Re: Is it worth adding ReplicationSlot active_pid to ReplicationSlotPersistentData?)

2023-03-23 Thread Bharath Rupireddy
On Fri, Mar 24, 2023 at 3:11 AM Euler Taveira wrote: > > If you are adding separate functions as suggested, you should add a comment at > the top of ReplicationSlotAcquire() and ReplicationSlotRelease() functions > saying that LogReplicationSlotAquired() and LogReplicationSlotReleased() >

Re: [BUG] pg_stat_statements and extended query protocol

2023-03-23 Thread Yugo NAGATA
On Thu, 23 Mar 2023 09:33:16 +0100 "Drouvot, Bertrand" wrote: > Hi, > > On 3/22/23 10:35 PM, Imseih (AWS), Sami wrote: > >> What about using an uint64 for calls? That seems more appropriate to me > >> (even if > >> queryDesc->totaltime->calls will be passed (which is int64), but that's > >>

Re: Error "initial slot snapshot too large" in create replication slot

2023-03-23 Thread Kyotaro Horiguchi
Thanks for looking this! At Thu, 23 Mar 2023 14:15:12 +0530, Dilip Kumar wrote in > On Thu, Mar 23, 2023 at 10:53 AM Kyotaro Horiguchi > wrote: > Thanks for working on this, your idea looks fine but my only worry is > that in the future if someone tries to change the logic of >

Re: Data is copied twice when specifying both child and parent table in publication

2023-03-23 Thread Peter Smith
BTW, since this patch changes the signature of the API pg_get_publication_tables, I assume the example in the CREATE SUBSCRIPTION Notes [1] may not work anymore. Meanwhile, Tom Lane suggested [2] that the example could be re-written to avoid even mentioning pg_get_publication_tables at all.

Re: Commitfest 2023-03 starting tomorrow!

2023-03-23 Thread Justin Pryzby
On Fri, Mar 24, 2023 at 10:24:43AM +0900, Michael Paquier wrote: > >> * Check consistency of GUC defaults between .sample.conf and > >> pg_settings.boot_val > > - It looks like this was pretty active until last October and might > > have been ready to apply at least partially? But no further

Re: Improve logging when using Huge Pages

2023-03-23 Thread Justin Pryzby
On Thu, Mar 23, 2023 at 05:25:46PM +0900, Kyotaro Horiguchi wrote: > Wouldn't storing the value in the shared memory itself work? Though, > that space does become almost dead for the server's lifetime... I'm sure it's possible, but it's also not worth writing a special implementation just to

Re: Data is copied twice when specifying both child and parent table in publication

2023-03-23 Thread Peter Smith
Hi Wang-san. I looked at the v21-0001 patch. I don't have any new review comments -- only follow-ups for some of my previous v20 comments that were rejected. On Thu, Mar 23, 2023 at 8:11 PM wangw.f...@fujitsu.com wrote: > > On Thu, Mar 23, 2023 at 12:27 PM Peter Smith wrote: > > Here are some

Re: Commitfest 2023-03 starting tomorrow!

2023-03-23 Thread Michael Paquier
On Thu, Mar 23, 2023 at 04:41:39PM -0400, Greg Stark wrote: > * Move backup-related code to xlogbackup.c/.h > - It looks like neither Alvaro Herrera nor Michael Paquier are > particularly convinced this is an improvement and nobody has put more > time in this since last October. I'm inclined to

Re: Commitfest 2023-03 starting tomorrow!

2023-03-23 Thread Masahiko Sawada
On Fri, Mar 24, 2023 at 5:42 AM Greg Stark wrote: > > > > * Fix assertion failure with next_phase_at in snapbuild.c > - It's a bug fix but it doesn't look like the bug has been entirely fixed? > We have a patch fixing the issue and reproducible steps. Another bug was reported late in the

Re: POC: Lock updated tuples in tuple_update() and tuple_delete()

2023-03-23 Thread Andres Freund
Hi, An off-list conversation veered on-topic again. Reposting for posterity: On 2023-03-23 23:24:19 +0300, Alexander Korotkov wrote: > On Thu, Mar 23, 2023 at 8:06 PM Andres Freund wrote: > > I seriously doubt that solving this at the tuple locking level is the right > > thing. If we want to

Re: Should vacuum process config file reload more often

2023-03-23 Thread Melanie Plageman
On Thu, Mar 23, 2023 at 2:09 AM Masahiko Sawada wrote: > On Sun, Mar 19, 2023 at 7:47 AM Melanie Plageman > wrote: > Do we need to calculate the number of workers running with > nworkers_for_balance by iterating over the running worker list? I > guess autovacuum workers can increment/decrement

Re: Generate pg_stat_get_xact*() functions with Macros

2023-03-23 Thread Michael Paquier
On Thu, Mar 02, 2023 at 08:39:14AM +0100, Drouvot, Bertrand wrote: > Yeah, there is some dependencies around this one. > > [1]: depends on it > Current one depends of [2], [3] and [4] > > Waiting on Author is then the right state, thanks for having moved it to that > state. > > [1]: >

Re: Remove nonmeaningful prefixes in PgStat_* fields

2023-03-23 Thread Michael Paquier
On Thu, Mar 23, 2023 at 05:24:22PM +0900, Michael Paquier wrote: > On Thu, Mar 23, 2023 at 07:51:37AM +0100, Drouvot, Bertrand wrote: > > Thank you both for your keen eye! I just did another check too and did not > > find more than the ones you've just reported. > > This matches what I have,

Re: Raising the SCRAM iteration count

2023-03-23 Thread Michael Paquier
On Thu, Mar 23, 2023 at 10:46:56PM +0100, Daniel Gustafsson wrote: > I'm fairly convinced it's a timeout in the interactive psql session. Given > how > ugly the use of that is I'm sort of waiting for Andres' refactoring patch [0] > to > commit this such that I can rewrite the test in a saner

Re: PGDOCS - function pg_get_publication_tables is not documented?

2023-03-23 Thread Peter Smith
On Fri, Mar 24, 2023 at 9:26 AM Tom Lane wrote: > > Peter Smith writes: > > While reviewing another thread [1] I could not find the function > > 'pg_get_publication_tables' described anywhere in the PG > > documentation. > > Should it be mentioned somewhere like the "System Catalog Information >

Re: HOT chain validation in verify_heapam()

2023-03-23 Thread Robert Haas
On Thu, Mar 23, 2023 at 4:36 PM Andres Freund wrote: > Could it be that the tests didn't exercise the path before? Hmm, perhaps. > > Nonetheless, here's a patch. I notice that there's a similar problem > > in another place, too. get_xid_status() is called a total of five > > times and it looks

Re: doc: add missing "id" attributes to extension packaging page

2023-03-23 Thread Karl O. Pinc
This is for the committer, as an FYI. I cut out the portion of the docbook XSLT and diffed it with the code for the same template in the patch. The diff looks like: -- /tmp/sections.xsl2023-03-22 13:00:33.432968357 -0500 +++ /tmp/make_html_ids_discoverable_v3.patch2023-03-22

Re: pg_stats and range statistics

2023-03-23 Thread Tomas Vondra
On 3/20/23 20:54, Egor Rogov wrote: > On 20.03.2023 22:27, Gregory Stark (as CFM) wrote: >> On Sun, 22 Jan 2023 at 18:22, Tomas Vondra >> wrote: >>> I wonder if we have other functions doing something similar, i.e. >>> accepting a polymorphic type and then imposing additional restrictions >>>

Re: [PoC] Let libpq reject unexpected authentication requests

2023-03-23 Thread Jacob Champion
On Tue, Mar 21, 2023 at 11:01 PM Michael Paquier wrote: > - # Function introduced in OpenSSL 1.0.2. > + # Functions introduced in OpenSSL 1.0.2. LibreSSL doesn't have all of > these. >['X509_get_signature_nid'], > + ['SSL_CTX_set_cert_cb'], > > From what I can see,

Re: Making background psql nicer to use in tap tests

2023-03-23 Thread Daniel Gustafsson
> On 18 Mar 2023, at 23:07, Andrew Dunstan wrote: > BTW, a better test than the one above would be > >$package->isa("PostgreSQL::Test::Cluster") Attached is a quick updated v3 of the patch which, to the best of my Perl abilities, tries to address the comments raised here. -- Daniel

Re: doc: add missing "id" attributes to extension packaging page

2023-03-23 Thread Karl O. Pinc
Hi Brar, It occurs to me that I had not actually tested the way the anchor is put only after the last term in a varlistentry. (The code looked obviously right and should work if any varlistentry terms have anchors, which they do, but) Have you tested this? If not, catalog.sgml, the

Re: PGDOCS - function pg_get_publication_tables is not documented?

2023-03-23 Thread Tom Lane
Peter Smith writes: > While reviewing another thread [1] I could not find the function > 'pg_get_publication_tables' described anywhere in the PG > documentation. > Should it be mentioned somewhere like the "System Catalog Information > Functions" table [2], or was this one deliberately omitted

Re: Can we avoid chdir'ing in resolve_symlinks() ?

2023-03-23 Thread Tom Lane
I wrote: > I think that changing pg_config's behavior would be enough to resolve > the complaints you listed, but perhaps I'm missing some fine points. Meanwhile I've gone ahead and pushed my v1 patch (plus Munro's recommendation about _fullpath error handling), so we can see if the buildfarm

Re: Commitfest 2023-03 starting tomorrow!

2023-03-23 Thread Justin Pryzby
On Thu, Mar 23, 2023 at 04:41:39PM -0400, Greg Stark wrote: > * Avoid hiding shared filesets in pg_ls_tmpdir (pg_ls_* functions for > showing metadata ...) > - According to the internet "As part of their 39 month old > development and milestones, your patch should be able to see like an > adult

Re: Data is copied twice when specifying both child and parent table in publication

2023-03-23 Thread Peter Smith
On Thu, Mar 23, 2023 at 5:51 PM Amit Kapila wrote: > > On Thu, Mar 23, 2023 at 9:57 AM Peter Smith wrote: > > > > Here are some review comments for patch v20-0001. > > > > == > > General. > > > > 1. > > That function 'pg_get_publication_tables' does not seem to be > > described in the PG

PGDOCS - function pg_get_publication_tables is not documented?

2023-03-23 Thread Peter Smith
Hi hackers, While reviewing another thread [1] I could not find the function 'pg_get_publication_tables' described anywhere in the PG documentation. Should it be mentioned somewhere like the "System Catalog Information Functions" table [2], or was this one deliberately omitted for some reason?

Re: Orphaned wait event

2023-03-23 Thread Thomas Munro
On Thu, Mar 23, 2023 at 8:10 PM Bharath Rupireddy wrote: > Yeah, commit [1] removed the last trace of it. I wonder if we can add > a WAIT_EVENT_SLRU_FLUSH_SYNC wait event in SlruSyncFileTag(), similar > to mdsyncfiletag. This way, we would have covered all sync_syncfiletag > fsyncs with wait

Re: Raising the SCRAM iteration count

2023-03-23 Thread Daniel Gustafsson
> On 22 Mar 2023, at 04:14, Gregory Stark (as CFM) wrote: > On Tue, 14 Mar 2023 at 14:54, Gregory Stark (as CFM) > wrote: >> >> CFBot is failing with this test failure... I'm not sure if this just >> represents a timing dependency or a bad test or what? > > CFBot is now consistently showing

Re: add log messages when replication slots become active and inactive (was Re: Is it worth adding ReplicationSlot active_pid to ReplicationSlotPersistentData?)

2023-03-23 Thread Euler Taveira
On Thu, Mar 23, 2023, at 2:33 PM, Bharath Rupireddy wrote: > On Thu, Mar 23, 2023 at 3:37 PM Alvaro Herrera > wrote: > > > > On 2023-Mar-22, Amit Kapila wrote: > > > > > I see that you have modified the patch to address the comments from > > > Alvaro. Personally, I feel it would be better to add

Re: add log messages when replication slots become active and inactive (was Re: Is it worth adding ReplicationSlot active_pid to ReplicationSlotPersistentData?)

2023-03-23 Thread Peter Smith
On Fri, Mar 24, 2023 at 4:33 AM Bharath Rupireddy wrote: > > On Thu, Mar 23, 2023 at 3:37 PM Alvaro Herrera > wrote: > > > > On 2023-Mar-22, Amit Kapila wrote: > > > > > I see that you have modified the patch to address the comments from > > > Alvaro. Personally, I feel it would be better to

Re: Commitfest 2023-03 starting tomorrow!

2023-03-23 Thread Tom Lane
Greg Stark writes: > * Simplify find_my_exec by using realpath(3) > - Tom Lane is author but I don't know if he intends to apply this in > this release I'd like to get it done. It's currently stuck because Peter asked for some behavioral changes that I was dubious about, and we're trying to

Re: pg_bsd_indent vs vpath

2023-03-23 Thread Tom Lane
Andrew Dunstan writes: > Looks like we need a little magic to allow pg_bsd_indent to be part of a > vpath build: Yeah, I think I fixed that at dccef0f2f, but fairywren hasn't run since. (I'd thought that it was some weird Msys-ism, but if you say it's VPATH then all is clear, other than why we

Re: Code checks for App Devs, using new options for transaction behavior

2023-03-23 Thread Tom Lane
Greg Stark writes: > On Thu, 27 Oct 2022 at 07:10, Simon Riggs > wrote: >> * nested transactions = off (default) | all | on >> Handle nested BEGIN/COMMIT, which can cause chaos on failure. > I think we've been burned pretty badly by GUCs that control SQL > semantics before. Yeah, this idea is

Re: Commitfest 2023-03 starting tomorrow!

2023-03-23 Thread Greg Stark
So of the patches with no emails since August-December 2022: * New hooks in the connection path * Add log messages when replication slots become active and inactive - Peter Smith and Alvaro Herrera have picked up this one * Remove dead macro exec_subplan_get_plan - Minor cleanup * Consider

Re: HOT chain validation in verify_heapam()

2023-03-23 Thread Andres Freund
Hi, On 2023-03-23 15:37:15 -0400, Robert Haas wrote: > On Wed, Mar 22, 2023 at 8:38 PM Andres Freund wrote: > > skink / valgrind reported in a while back and found another issue: > > > > https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=skink=2023-03-22%2021%3A53%3A41 > > > > ==2490364==

Re: Progress report of CREATE INDEX for nested partitioned tables

2023-03-23 Thread Tom Lane
So I'm still pretty desperately unhappy with count_leaf_partitions. I don't like expending significant cost purely for progress tracking purposes, I don't like the undocumented assumption that NoLock is safe, and what's more, if it is safe then we've already traversed the inheritance tree to lock

Re: Add standard collation UNICODE

2023-03-23 Thread Jeff Davis
On Thu, 2023-03-09 at 11:23 -0800, Jeff Davis wrote: > Looks good to me. Another thought: for ICU, do we want the default collation to be UNICODE (root collation)? What we have now gets the default from the environment, which is consistent with the libc provider. But now that we have the UNICODE

Re: refactoring basebackup.c

2023-03-23 Thread Robert Haas
On Wed, Mar 22, 2023 at 10:09 PM Thomas Munro wrote: > > BaseBackupSync is not documented > > BaseBackupWrite is not documented > > [Resending with trimmed CC: list, because the mailing list told me to > due to a blocked account, sorry if you already got the above.] Bummer. I'll write a patch to

pg_bsd_indent vs vpath

2023-03-23 Thread Andrew Dunstan
Looks like we need a little magic to allow pg_bsd_indent to be part of a vpath build: It succeeded if I added this to the Makefile: CFLAGS += -I$(srcdir)

Re: Code checks for App Devs, using new options for transaction behavior

2023-03-23 Thread Greg Stark
On Thu, 27 Oct 2022 at 07:10, Simon Riggs wrote: > > In the past, developers have wondered how we can provide "--dry-run" > functionality That would be an awesome functionality, indeed. I have concerns of how feasible it is in general but I think providing features to allow developers to build

Re: doc: add missing "id" attributes to extension packaging page

2023-03-23 Thread Corey Huinker
> > TBH I'm a bit afraid that people will immediately start complaining > about the failing docs builds after this got applied since it forces > them to add ids to all varlistenries in a variablelist if they add one, > which can be perceived as quite a burden (also committers and reviewers > will

Re: Non-superuser subscription owners

2023-03-23 Thread Robert Haas
On Thu, Mar 23, 2023 at 1:41 PM Jeff Davis wrote: > Even if my changes don't happen, I would find it less confusing and > more likely that users understand what they're doing. I respectfully but firmly disagree. I think having two predefined roles that are both required to create a subscription

Re: Request for comment on setting binary format output per session

2023-03-23 Thread Dave Cramer
On Wed, 22 Mar 2023 at 15:23, Jeff Davis wrote: > On Wed, 2023-03-22 at 14:42 -0400, Tom Lane wrote: > > This isn't going to help much unless we change the wire protocol > > so that RowDescription messages carry these UUIDs instead of > > (or in addition to?) the OIDs of the column datatypes.

Re: HOT chain validation in verify_heapam()

2023-03-23 Thread Robert Haas
On Wed, Mar 22, 2023 at 8:38 PM Andres Freund wrote: > skink / valgrind reported in a while back and found another issue: > > https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=skink=2023-03-22%2021%3A53%3A41 > > ==2490364== VALGRINDERROR-BEGIN > ==2490364== Conditional jump or move depends

Re: doc: add missing "id" attributes to extension packaging page

2023-03-23 Thread Brar Piening
On 23.03.2023 at 10:35, Alvaro Herrera wrote: As with the patch, we'll need to patch the CSS used in the website for the docs too, as that's the most important place where docs are visited. Ok, I've created and tested a patch for this too. Since the need for ids is starting to grow again

Re: HOT chain validation in verify_heapam()

2023-03-23 Thread Robert Haas
On Thu, Mar 23, 2023 at 1:34 PM Robert Haas wrote: > OK, let me spend some more time on this and I'll post a patch (or > patches) in a bit. All right, here are some more fixups. -- Robert Haas EDB: http://www.enterprisedb.com 0001-amcheck-Tighten-up-validation-of-redirect-line-point.patch

Re: Schema variables - new implementation for Postgres 15

2023-03-23 Thread Pavel Stehule
Hi čt 23. 3. 2023 v 16:33 odesílatel Peter Eisentraut < peter.eisentr...@enterprisedb.com> napsal: > On 17.03.23 21:50, Pavel Stehule wrote: > > Hi > > > > rebase + fix-update pg_dump tests > > > > Regards > > > > Pavel > > > > I have spent several hours studying the code and the past

Re: Memory leak from ExecutorState context?

2023-03-23 Thread Tomas Vondra
On 3/23/23 13:07, Melanie Plageman wrote: > On Fri, Mar 10, 2023 at 1:51 PM Jehan-Guillaume de Rorthais > wrote: >>> So I guess the best thing would be to go through these threads, see what >>> the status is, restart the discussion and propose what to do. If you do >>> that, I'm happy to

Re: Consider parallel for lateral subqueries with limit

2023-03-23 Thread Gregory Stark (as CFM)
This patch has been "Needs Review" and bouncing from CF to CF. It actually looks like it got quite a bit of design discussion and while James Coleman seems convinced of its safety it doesn't sound like Tom Lane and Robert Haas are yet and it doesn't look like that's going to happen in this CF. I

Re: Make EXPLAIN generate a generic plan for a parameterized query

2023-03-23 Thread Laurenz Albe
And here is v10, which includes tab completion for the new option. Yours, Laurenz Albe From dfe6d36d79c74fba7bf70b990fdada166d012ff4 Mon Sep 17 00:00:00 2001 From: Laurenz Albe Date: Thu, 23 Mar 2023 19:28:49 +0100 Subject: [PATCH] Add EXPLAIN option GENERIC_PLAN This allows EXPLAIN to generate

Re: Add n_tup_newpage_upd to pg_stat table views

2023-03-23 Thread Peter Geoghegan
On Wed, Mar 22, 2023 at 10:38 PM Corey Huinker wrote: > That's probably a good move, especially if we start tallying updates that use > TOAST. Okay, pushed. Thanks -- Peter Geoghegan

Re: Non-superuser subscription owners

2023-03-23 Thread Jeff Davis
On Thu, 2023-03-23 at 11:52 -0400, Robert Haas wrote: > What would this amount to concretely? Also adding a > pg_connection_string predefined role and requiring both that and > pg_create_subscription [to CREATE SUBSCRIPTION] Yes. > If so, I don't think that's a good idea. Maybe for some reason

Re: HOT chain validation in verify_heapam()

2023-03-23 Thread Andres Freund
Hi, On 2023-03-23 11:20:04 +0530, Himanshu Upadhyaya wrote: > On Thu, Mar 23, 2023 at 2:15 AM Andres Freund wrote: > > > > > Currently the new verify_heapam() follows ctid chains when XMAX_INVALID is > > set > > and expects to find an item it can dereference - but I don't think that's > >

RE: [EXTERNAL] Re: [PATCH] Report the query string that caused a memory error under Valgrind

2023-03-23 Thread Onur Tirtir
Hey Peter, Thank you for reviewing the patch and for your feedback. I believe the v2 patch should be able to handle other protocol messages too. -Original Message- From: Peter Eisentraut Sent: Wednesday, March 22, 2023 7:00 PM To: Onur Tirtir ; pgsql-hackers@lists.postgresql.org

Re: HOT chain validation in verify_heapam()

2023-03-23 Thread Robert Haas
On Thu, Mar 23, 2023 at 1:26 PM Andres Freund wrote: > E.g. continuing after: > > rditem = PageGetItemId(ctx.page, rdoffnum); > if (!ItemIdIsUsed(rditem)) > report_corruption(, >

Re: add log messages when replication slots become active and inactive (was Re: Is it worth adding ReplicationSlot active_pid to ReplicationSlotPersistentData?)

2023-03-23 Thread Bharath Rupireddy
On Thu, Mar 23, 2023 at 3:37 PM Alvaro Herrera wrote: > > On 2023-Mar-22, Amit Kapila wrote: > > > I see that you have modified the patch to address the comments from > > Alvaro. Personally, I feel it would be better to add such a message at > > a centralized location instead of spreading these

Re: HOT chain validation in verify_heapam()

2023-03-23 Thread Andres Freund
Hi, On 2023-03-23 11:41:52 -0400, Robert Haas wrote: > On Wed, Mar 22, 2023 at 5:56 PM Andres Freund wrote: > > I also think it's not quite right that some of checks inside if > > (ItemIdIsRedirected()) continue in case of corruption, others don't. While > > there's a later continue, that means

Re: Add pg_walinspect function with block info columns

2023-03-23 Thread Bharath Rupireddy
On Mon, Mar 20, 2023 at 8:51 AM Kyotaro Horiguchi wrote: > > + /* Get block references, if any, otherwise continue. */ > + if (!XLogRecHasAnyBlockRefs(xlogreader)) > > code does". I feel we don't need the a comment there. Removed. > This means GetWALBlockInfo

Re: ICU locale validation / canonicalization

2023-03-23 Thread Jeff Davis
On Thu, 2023-03-23 at 07:27 +0100, Peter Eisentraut wrote: > So, does uloc_canonicalize() always convert to ICU locale IDs?  What > if > you pass a language tag, does it convert it to ICU locale ID as well? Yes. The documentation is not clear on that point, but my testing shows that it does.

Re: Add LZ4 compression in pg_dump

2023-03-23 Thread Tomas Vondra
Hi, I looked at this again, and I realized I misunderstood the bit about errno in LZ4File_open_write a bit. I now see it simply just brings the function in line with Gzip_open_write(), so that the callers can just do pg_fatal("%m"). I still think the special "errno" handling in this one place

Re: HOT chain validation in verify_heapam()

2023-03-23 Thread Robert Haas
On Thu, Mar 23, 2023 at 9:42 AM Robert Haas wrote: > Hmph. I didn't think very hard about that code and just assumed > Himanshu had tested it. I don't have convenient access to a Big-endian > test machine myself. Are you able to check whether using 0x00010019 > unconditionally works? Oh, I see

Re: POC: Lock updated tuples in tuple_update() and tuple_delete()

2023-03-23 Thread Andres Freund
Hi, On 2023-03-23 18:08:36 +0300, Alexander Korotkov wrote: > On Thu, Mar 23, 2023 at 3:30 AM Andres Freund wrote: > > On 2023-03-21 01:25:11 +0300, Alexander Korotkov wrote: > > > I'm going to push patchset v15 if no objections. > > > > Just saw that this went in - didn't catch up with the

Re: HOT chain validation in verify_heapam()

2023-03-23 Thread Robert Haas
On Wed, Mar 22, 2023 at 5:42 PM Peter Geoghegan wrote: > However, this "second pass over page" loop has roughly the same > problem as the nearby HeapTupleHeaderIsHotUpdated() coding pattern: it > doesn't account for the fact that a tuple whose xmin was > XID_IN_PROGRESS a little earlier on may

Re: Should vacuum process config file reload more often

2023-03-23 Thread Daniel Gustafsson
> On 23 Mar 2023, at 07:08, Masahiko Sawada wrote: > On Sun, Mar 19, 2023 at 7:47 AM Melanie Plageman > wrote: > It makes sense to me that we need to reload the config file even when > vacuum-delay is disabled. But I think it's not convenient for users > that we don't reload the configuration

Re: Initial Schema Sync for Logical Replication

2023-03-23 Thread Euler Taveira
On Thu, Mar 23, 2023, at 8:44 AM, Amit Kapila wrote: > On Thu, Mar 23, 2023 at 2:48 AM Euler Taveira wrote: > > > > On Tue, Mar 21, 2023, at 8:18 AM, Amit Kapila wrote: > > > > Now, how do we avoid these problems even if we have our own version of > > functionality similar to pg_dump for selected

Re: Transparent column encryption

2023-03-23 Thread Robert Haas
On Thu, Mar 23, 2023 at 9:55 AM Peter Eisentraut wrote: > I thought about this some more. I think we could get rid of > attusertypmod and just hardcode it as -1. The idea would be that if you > ask for an encrypted column of type, say, varchar(500), the server isn't > able to enforce that

RE: Initial Schema Sync for Logical Replication

2023-03-23 Thread Kumar, Sachin
> From: Amit Kapila > IIUC, this is possible only if tablesync process uses a snapshot different > than the > snapshot we have used to perform the initial schema sync, otherwise, this > shouldn't be a problem. Let me try to explain my understanding with an example > (the LSNs used are just

Re: Non-superuser subscription owners

2023-03-23 Thread Robert Haas
On Wed, Mar 22, 2023 at 3:53 PM Jeff Davis wrote: > Is there any chance I can convince you to separate the privileges of > using a connection string and creating a subscription, as I > suggested[1] earlier? What would this amount to concretely? Also adding a pg_connection_string predefined role

Re: HOT chain validation in verify_heapam()

2023-03-23 Thread Robert Haas
On Wed, Mar 22, 2023 at 5:56 PM Andres Freund wrote: > Why are redirections now checked in two places? There already was a > ItemIdIsUsed() check in the "/* Perform tuple checks */" loop, but now there's > the ItemIdIsRedirected() check in the "Update chain validation." loop as well > - and the

Re: WIP Patch: pg_dump structured

2023-03-23 Thread Attila Soki
On 12 Mar 2023, at 22:56, Attila Soki wrote: >> On 12 Mar 2023, at 21:50, Tom Lane wrote: >> Won't this fail completely with SQL objects whose names aren't suitable >> to be pathname components? "A/B" is a perfectly good name so far as >> SQL is concerned. You could also have problems with

Re: Schema variables - new implementation for Postgres 15

2023-03-23 Thread Peter Eisentraut
On 17.03.23 21:50, Pavel Stehule wrote: Hi rebase + fix-update pg_dump tests Regards Pavel I have spent several hours studying the code and the past discussions. The problem I see in general is that everyone who reviews and tests the patches finds more problems, behavioral, weird

Re: POC: Lock updated tuples in tuple_update() and tuple_delete()

2023-03-23 Thread Alexander Korotkov
Hi! On Thu, Mar 23, 2023 at 3:30 AM Andres Freund wrote: > On 2023-03-21 01:25:11 +0300, Alexander Korotkov wrote: > > I'm going to push patchset v15 if no objections. > > Just saw that this went in - didn't catch up with the thread before, > unfortunately. At the very least I'd like to see some

Re: Refactor calculations to use instr_time

2023-03-23 Thread Nazir Bilal Yavuz
Hi, Thanks for the review. On Fri, 17 Mar 2023 at 02:02, Melanie Plageman wrote: > I think you want one less L here? > WALLSTAT_ACC_INSTR_TIME_TYPE -> WALSTAT_ACC_INSTR_TIME_TYPE Done. > Also, I don't quite understand why TYPE is at the end of the name. I > think it would still be clear

Re: HOT chain validation in verify_heapam()

2023-03-23 Thread Robert Haas
On Wed, Mar 22, 2023 at 4:45 PM Andres Freund wrote: > At the very least there's missing verification that tids actually exists in > the > "Update chain validation" loop, leading to: > TRAP: failed Assert("ItemIdHasStorage(itemId)"), File: >

Re: Transparent column encryption

2023-03-23 Thread Peter Eisentraut
On 22.03.23 10:00, Peter Eisentraut wrote: I get that for the type, but why do we need the typmod duplicated as well? Earlier patch versions didn't do that, but that got really confusing about which type the typmod really belonged to, since code currently assumes that typid+typmod makes

Re: [BUG] pg_stat_statements and extended query protocol

2023-03-23 Thread Imseih (AWS), Sami
> How does JDBC test that? Does it have a dependency on > pg_stat_statements? No, at the start of the thread, a sample jdbc script was attached. But I agree, we need to add test coverage. See below. >> But, I'm tempted to say that adding new tests could be addressed >> separately though (as

Re: Dropped and generated columns might cause wrong data on subs when REPLICA IDENTITY FULL

2023-03-23 Thread Amit Kapila
On Wed, Mar 22, 2023 at 1:39 PM shiy.f...@fujitsu.com wrote: > > On Wed, Mar 22, 2023 2:53 PM Önder Kalacı wrote: > > > > We don't really need to, if you check the first patch, we don't have DROP > > for generated case. I mostly > > wanted to make the test a little more interesting, but it also

Re: HOT chain validation in verify_heapam()

2023-03-23 Thread Robert Haas
On Wed, Mar 22, 2023 at 3:27 PM Tom Lane wrote: > My animal mamba doesn't like this one bit. > > I suspect the reason is that it's big-endian (PPC) and the endianness > hacking in the test is simply wrong: > > syswrite($file, > pack("L", $ENDIANNESS eq 'little' ?

Re: Support logical replication of DDLs

2023-03-23 Thread vignesh C
On Thu, 23 Mar 2023 at 09:22, Ajin Cherian wrote: > > On Mon, Mar 20, 2023 at 8:17 PM houzj.f...@fujitsu.com > wrote: > > > > Attach the new patch set which addressed above comments. > > 0002,0003,0004 patch has been updated in this version. > > > > Best Regards, > > Hou zj > > Attached a

Re: doc: add missing "id" attributes to extension packaging page

2023-03-23 Thread Karl O. Pinc
On Thu, 23 Mar 2023 10:35:55 +0100 Alvaro Herrera wrote: > As with the patch, we'll need to patch the CSS used in > the website for the docs too, as that's the most important place > where docs are visited. See this commit for an example: >

Re: doc: add missing "id" attributes to extension packaging page

2023-03-23 Thread Karl O. Pinc
On Thu, 23 Mar 2023 08:24:48 +0100 Brar Piening wrote: > On 23.03.2023 at 04:09, Karl O. Pinc wrote: > > Sorry for the extra work I've put you through. > > No problem. As always I've learnt something which may help me in the > future. I don't know about you, but sadly, my brain eventually

Re: Options to rowwise persist result of stable/immutable function with RECORD result

2023-03-23 Thread Eske Rahn
Hi, Thanks for the quick answer *:-D* That was a nice sideeffect of lateral. In the example, the calling code also gets simplified: WITH x AS ( SELECT clock_timestamp() rowstart, *, clock_timestamp() rowend FROM ( SELECT '1' inp UNION SELECT '2' ) y, LATERAL septima.foo(inp) g )

Re: Save a few bytes in pg_attribute

2023-03-23 Thread Peter Eisentraut
On 21.03.23 18:46, Andres Freund wrote: I don't think we can find enough to make the impact zero bytes. It's also not clear exactly what the impact of each byte would be (compared to possible complications in other parts of the code, for example). But if there are a few low-hanging fruit, it

Re: Memory leak from ExecutorState context?

2023-03-23 Thread Melanie Plageman
On Fri, Mar 10, 2023 at 1:51 PM Jehan-Guillaume de Rorthais wrote: > > So I guess the best thing would be to go through these threads, see what > > the status is, restart the discussion and propose what to do. If you do > > that, I'm happy to rebase the patches, and maybe see if I could improve >

Re: Initial Schema Sync for Logical Replication

2023-03-23 Thread Amit Kapila
On Thu, Mar 23, 2023 at 2:48 AM Euler Taveira wrote: > > On Tue, Mar 21, 2023, at 8:18 AM, Amit Kapila wrote: > > Now, how do we avoid these problems even if we have our own version of > functionality similar to pg_dump for selected objects? I guess we will > face similar problems. If so, we may

Re: Initial Schema Sync for Logical Replication

2023-03-23 Thread Amit Kapila
On Wed, Mar 15, 2023 at 11:12 PM Kumar, Sachin wrote: > > > Concurrent DDL :- > > User can execute a DDL command to table t1 at the same time when subscriber > is trying to sync > > it. pictorial representation https://imgur.com/a/ivrIEv8 [1] > > > > In tablesync process, it makes a connection

Re: doc: add missing "id" attributes to extension packaging page

2023-03-23 Thread Brar Piening
On 23.03.2023 at 10:35, Alvaro Herrera wrote: As with the patch, we'll need to patch the CSS used in the website for the docs too, as that's the most important place where docs are visited. See this commit for an example:

Re: add log messages when replication slots become active and inactive (was Re: Is it worth adding ReplicationSlot active_pid to ReplicationSlotPersistentData?)

2023-03-23 Thread Alvaro Herrera
On 2023-Mar-22, Amit Kapila wrote: > I see that you have modified the patch to address the comments from > Alvaro. Personally, I feel it would be better to add such a message at > a centralized location instead of spreading these in different callers > of slot acquire/release functionality to

Re: Improve the performance of nested loop join in the case of partitioned inner table

2023-03-23 Thread David Rowley
On Thu, 23 Mar 2023 at 19:46, Alexandr Nikulin wrote: > I propose to slightly improve the performance of nested loop join in the case > of partitioned inner table. > As I see in the code, the backend looks for the partition of the inner table > each time after fetch a new row from the outer

Re: Doc: Improve note about copying into postgres_fdw foreign tables in batch

2023-03-23 Thread Daniel Gustafsson
> On 23 Mar 2023, at 10:51, Etsuro Fujita wrote: > seems more appropriate to me as well in this context, so I > left it alone. And just to be clear, I think you are right in leaving it alone given the context. > Attached is an updated version of the patch. LGTM. -- Daniel Gustafsson

  1   2   >