RE: Fix some newly modified tab-complete changes

2022-11-16 Thread shiy.f...@fujitsu.com
On Thu, Nov 10, 2022 12:54 PM Michael Paquier wrote: > > On Tue, Oct 18, 2022 at 05:17:32PM +1100, Peter Smith wrote: > > I re-tested and confirm that the patch does indeed fix the quirk I'd > > previously reported. > > > > But, looking at the patch code, I don't know if it is the best way to > >

Re: closing file in adjust_data_dir

2022-11-16 Thread Peter Eisentraut
On 16.11.22 04:31, Ted Yu wrote: On Wed, 16 Nov 2022 at 11:15, Ted Yu mailto:yuzhih...@gmail.com>> wrote: > On Tue, Nov 15, 2022 at 7:12 PM Japin Li mailto:japi...@hotmail.com>> wrote: >> After some rethinking, I find the origin code do not have problems. >> >> If fd is NU

Fix the README file for MERGE command

2022-11-16 Thread Waithant Myo (Fujitsu)
Hi Hackers, This is Myo Wai Thant. I found out that there is a mistake written in executor/README file. The actions of MERGE command can be specified as follows: INSERT, UPDATE, DELETE and DO NOTHING. However, in the README file, the ‘UPDATE’ word is described 2 times instead of ‘DELETE’. Ther

Re: Assertion failure in SnapBuildInitialSnapshot()

2022-11-16 Thread Amit Kapila
On Wed, Nov 16, 2022 at 7:30 AM Andres Freund wrote: > > On 2022-11-15 16:20:00 +0530, Amit Kapila wrote: > > On Tue, Nov 15, 2022 at 8:08 AM Andres Freund wrote: > > > nor do we enforce in an obvious place that we > > > don't already hold a snapshot. > > > > > > > We have a check for (FirstXactS

Re: when the startup process doesn't (logging startup delays)

2022-11-16 Thread Simon Riggs
On Wed, 16 Nov 2022 at 06:47, Bharath Rupireddy wrote: > > On Tue, Nov 15, 2022 at 10:55 PM Robert Haas wrote: > > > > On Tue, Nov 15, 2022 at 8:33 AM Bharath Rupireddy > > wrote: > > > Please review the v2 patch. > > > > It seems to me that this will call disable_startup_progress_timeout > > on

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

2022-11-16 Thread wangw.f...@fujitsu.com
On Mon, Nov 14, 2022 at 0:56 AM vignesh C wrote: > > > > Attach new patches. > Thanks for your comments. > Here we are having tables list to store the relids and table_infos > list which stores pubid along with relid. Here tables list acts as a > temporary list to get filter_partitions and then

Re: Reducing power consumption on idle servers

2022-11-16 Thread Simon Riggs
On Sun, 13 Nov 2022 at 23:07, Simon Riggs wrote: > > On Sun, 13 Nov 2022 at 21:28, Thomas Munro wrote: > > > > On Mon, Nov 14, 2022 at 5:52 AM Simon Riggs > > wrote: > > > The attached patch is a reduced version of the original. It covers only: > > > * deprecation of the promote_trigger_file - t

Re: [PATCH] Teach pg_waldump to extract FPIs from the WAL

2022-11-16 Thread Bharath Rupireddy
On Wed, Nov 16, 2022 at 1:20 AM David Christensen wrote: > > Enclosed is v9. > > - code style consistency (FPI instead of FPW) internally. > - cleanup of no-longer needed checksum-related pieces from code and tests. > - test cleanup/simplification. > - other comment cleanup. > > Passes all CI chec

Re: pg_basebackup's --gzip switch misbehaves

2022-11-16 Thread Daniel Gustafsson
> On 16 Nov 2022, at 02:02, Michael Paquier wrote: > On Tue, Nov 15, 2022 at 11:09:54AM +0100, Daniel Gustafsson wrote: >>> On 15 Nov 2022, at 00:58, Michael Paquier wrote: >>> It looks like there is a second one in install-windows.sgml. >> >> Not sure I follow. IPC::Run is already linked to wi

Re: when the startup process doesn't (logging startup delays)

2022-11-16 Thread Bharath Rupireddy
On Wed, Nov 16, 2022 at 2:28 PM Simon Riggs wrote: > > On Wed, 16 Nov 2022 at 06:47, Bharath Rupireddy > wrote: > > > > On Tue, Nov 15, 2022 at 10:55 PM Robert Haas wrote: > > > > > > On Tue, Nov 15, 2022 at 8:33 AM Bharath Rupireddy > > > wrote: > > > > Please review the v2 patch. > > > > > >

Re: Meson add host_system to PG_VERSION_STR

2022-11-16 Thread Peter Eisentraut
On 16.11.22 01:01, Michael Paquier wrote: On Wed, Nov 16, 2022 at 12:08:56AM +0100, Juan José Santamaría Flecha wrote: As mentioned here [1] it might be interesting to complete the returned information by version() when compiled with meson by including the host_system. The meson build provides

Re: HOT chain validation in verify_heapam()

2022-11-16 Thread Himanshu Upadhyaya
On Wed, Nov 16, 2022 at 1:58 AM Robert Haas wrote: > On Tue, Nov 15, 2022 at 2:50 PM Andres Freund wrote: > > On 2022-11-15 11:36:21 -0500, Robert Haas wrote: > > > On Mon, Nov 14, 2022 at 5:02 PM Andres Freund > wrote: > > > > It seems like we should do a bit more validation within a chain of

Re: meson oddities

2022-11-16 Thread Peter Eisentraut
On 16.11.22 00:40, Andres Freund wrote: Somewhat relatedly, I wonder if we should have a better way to enable/disable the 'pgsql' path logic. It's pretty annoying that prefix basically doesn't work if it doesn't contain 'pgsql' or 'postgres'. Could you explain this in more detail?

Re: Add 64-bit XIDs into PostgreSQL 15

2022-11-16 Thread Aleksander Alekseev
Hi hackers, > Dilip Kumar asked a good question in the thread about the 0001..0003 > subset [1]. I would like to duplicate it here to make sure it was not > missed by mistake: > > """ > Have we measured the WAL overhead because of this patch set? maybe > these particular patches will not impact bu

Re: Skipping schema changes in publication

2022-11-16 Thread vignesh C
On Wed, 16 Nov 2022 at 09:34, Ian Lawrence Barwick wrote: > > 2022年11月7日(月) 22:39 vignesh C : > > > > On Fri, 4 Nov 2022 at 08:19, Ian Lawrence Barwick wrote: > > > > > > Hi > > > > > > cfbot reports the patch no longer applies [1]. As CommitFest 2022-11 is > > > currently underway, this would be

Re: Add sub-transaction overflow status in pg_stat_activity

2022-11-16 Thread Dilip Kumar
On Tue, Nov 15, 2022 at 7:34 PM Robert Haas wrote: > > On Mon, Nov 14, 2022 at 4:17 PM Andres Freund wrote: > > Perhaps this would better be tackled by a new "visibility" view. It could > > show > > - number of sessions with a snapshot > > - max age of backend xmin > > - pid with max backend xmi

Re: Report checkpoint progress with pg_stat_progress_checkpoint (was: Report checkpoint progress in server logs)

2022-11-16 Thread Bharath Rupireddy
On Wed, Nov 16, 2022 at 1:35 AM Robert Haas wrote: > > On Fri, Nov 4, 2022 at 4:27 AM Drouvot, Bertrand > wrote: > > Please find attached a rebase in v7. > > I don't think it's a good thing that this patch is using the > progress-reporting machinery. The point of that machinery is that we > want

const qualifier for list APIs

2022-11-16 Thread Ashutosh Bapat
Hi All, Functions like lappend_*() in list.c do not modify the second argument. So it can be qualified as const. Any reason why we don't do that? Is it because the target pointer ptr_value is not const qualified? In my code, I am using lappend() and passing it the output of pq_getmsgstring() which

Re: BUG #17434: CREATE/DROP DATABASE can be executed in the same transaction with other commands

2022-11-16 Thread Yugo NAGATA
On Thu, 10 Nov 2022 15:33:37 -0500 Tom Lane wrote: > Yugo NAGATA writes: > > Tom Lane wrote: > >> Hmm. Maybe the right way to think about this is "if we have completed an > >> EXECUTE, and not yet received a following SYNC, then report that we are in > >> a transaction block"? But I'm not sur

Re: Add palloc_aligned() to allow arbitrary power of 2 memory alignment

2022-11-16 Thread David Rowley
On Wed, 16 Nov 2022 at 08:19, Andres Freund wrote: > We already rely on memory context returning MAXIMUM_ALIGNOF aligned > allocations. Adding the special case, I think, means that the we could safely > over-allocate by "only" > alignto + sizeof(MemoryChunk) - MAXIMUM_ALIGNOF > > Which would be

Re: PGDOCS - Logical replication GUCs - added some xrefs

2022-11-16 Thread vignesh C
On Tue, 15 Nov 2022 at 11:17, Peter Smith wrote: > > On Sun, Nov 13, 2022 at 11:47 AM vignesh C wrote: > > > > On Mon, 24 Oct 2022 at 13:15, Peter Smith wrote: > > > > > > Hi hackers. > > > > > > There is a docs Logical Replication section "31.10 Configuration > > > Settings" [1] which describes

Re: Avoid overhead open-close indexes (catalog updates)

2022-11-16 Thread Ranier Vilela
Em qua., 16 de nov. de 2022 às 04:23, Michael Paquier escreveu: > On Wed, Nov 16, 2022 at 06:58:01AM +0900, Michael Paquier wrote: > > This one has been left out on purpose. I was tempting to use > > WithInfo() with a CatalogIndexState opened optionally but I got the > > impression that it makes

Re: Slow standby snapshot

2022-11-16 Thread Michail Nikolaev
Hello everyone. > However ... I tried to reproduce the original complaint, and > failed entirely. I do see KnownAssignedXidsGetAndSetXmin > eating a bit of time in the standby backends, but it's under 1% > and doesn't seem to be rising over time. Perhaps we've already > applied some optimization

Re: Reducing power consumption on idle servers

2022-11-16 Thread Bharath Rupireddy
On Wed, Nov 16, 2022 at 2:34 PM Simon Riggs wrote: > > Reposting v6 now so that patch tester doesn't think this has failed > when the patch on other thread gets applied. Intention of the patch, that is, to get rid of promote_trigger_file GUC sometime in future, looks good to me. However, the time

Re: out of memory in crosstab()

2022-11-16 Thread Joe Conway
On 11/16/22 02:47, Amit Langote wrote: A customer seems to have run into $subject. Here's a reproducer they shared: With the following logged: LOG: server process (PID 121846) was terminated by signal 9: Killed That's the Linux OOM killer. Was this running in a container or under systemd

[PoC] configurable out of disk space elog level

2022-11-16 Thread Maxim Orlov
Hi! PROBLEM Our customer stumble onto the next behaviour of the Postgres cluster: if disk space is exhausted, Postgres continues to work until WAL can be successfully written. Thus, upon disk space exhaustion, clients will get an “ERROR: could not extend file “base/X/X”: No space left on

Re: Commit fest 2022-11

2022-11-16 Thread Ian Lawrence Barwick
2022年11月14日(月) 22:38 Ian Lawrence Barwick : > > 2022年11月14日(月) 22:23 James Coleman : > > > > On Mon, Nov 14, 2022 at 7:08 AM Ian Lawrence Barwick > > wrote: > > > > > > 2022年11月9日(水) 8:12 Justin Pryzby : > > > > > > If my script is not wrong, these patches add TAP tests, but don't update > >

Re: Meson add host_system to PG_VERSION_STR

2022-11-16 Thread Juan José Santamaría Flecha
On Wed, Nov 16, 2022 at 10:50 AM Peter Eisentraut < peter.eisentr...@enterprisedb.com> wrote: > On 16.11.22 01:01, Michael Paquier wrote: > > > > The meson build provides extra_version, which would be able to do the > > same, no? The information would be appended to PG_VERSION_STR through > > PG_

Re: Add LSN along with offset to error messages reported for WAL file read/write/validate header failures

2022-11-16 Thread Maxim Orlov
On Tue, 15 Nov 2022 at 13:02, Bharath Rupireddy < bharath.rupireddyforpostg...@gmail.com> wrote: > On Fri, Nov 11, 2022 at 5:52 PM Maxim Orlov wrote: > > > But, in my view, some improvements may be proposed. We should be more, > let's say, cautious (or a paranoid if you wish), > > in pg_walfile_o

Re: [PoC] configurable out of disk space elog level

2022-11-16 Thread Pavel Borisov
Hi, Maxim! > My proposal is to add a tablespace option in order to be able to configure > which behaviour is appropriate for a > particular user. I've decided to call this option “on_no_space” for now. If > anyone has a better naming for this feature, > please, report. > > So, the idea is to add

Re: Table AM and DROP TABLE [ Was: Table AM and DDLs]

2022-11-16 Thread Mats Kindahl
Hello all, I think the discussion went a little sideways, so let me recap what I'm suggesting: 1. I mentioned that there is a missing callback when the filenode is unlinked and this is particularly evident when dropping a table. 2. It was correctly pointed out to me that an implementor n

Re: closing file in adjust_data_dir

2022-11-16 Thread Ted Yu
On Wed, Nov 16, 2022 at 12:28 AM Peter Eisentraut < peter.eisentr...@enterprisedb.com> wrote: > On 16.11.22 04:31, Ted Yu wrote: > > On Wed, 16 Nov 2022 at 11:15, Ted Yu > > wrote: > > > On Tue, Nov 15, 2022 at 7:12 PM Japin Li >

Make a 100_bugs.pl test more faster.

2022-11-16 Thread Anton A. Melnikov
Hello! The previous discussion was here: https://www.postgresql.org/message-id/flat/b570c367-ba38-95f3-f62d-5f59b9808226%40inbox.ru On 15.11.2022 04:59, Tom Lane wrote: "Anton A. Melnikov" writes: Additionally i've tried to reduce overall number of nodes previously used in this test in a sim

Re: const qualifier for list APIs

2022-11-16 Thread Tom Lane
Ashutosh Bapat writes: > Functions like lappend_*() in list.c do not modify the second > argument. So it can be qualified as const. Any reason why we don't do > that? Is it because the target pointer ptr_value is not const > qualified? It would be a lie in many (most?) cases, wherever somebody la

MERGE regress test

2022-11-16 Thread Teja Mupparti
Hi, A quick question on merge regress-test https://github.com/postgres/postgres/blob/REL_15_STABLE/src/test/regress/expected/merge.out#L846

Re: [BUG] Logical replica crash if there was an error in a function.

2022-11-16 Thread Anton A. Melnikov
Thanks a lot for the fast reply! On 03.11.2022 18:29, Tom Lane wrote: If we were just adding a query or two to an existing scenario, that could be okay; but spinning up and syncing a whole new primary and standby database is *expensive* when you multiply it by the number of times developers and

Re: Reducing power consumption on idle servers

2022-11-16 Thread Simon Riggs
On Wed, 16 Nov 2022 at 12:47, Bharath Rupireddy wrote: > > On Wed, Nov 16, 2022 at 2:34 PM Simon Riggs > wrote: > > > > Reposting v6 now so that patch tester doesn't think this has failed > > when the patch on other thread gets applied. > > Intention of the patch, that is, to get rid of promote_t

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

2022-11-16 Thread Masahiko Sawada
On Wed, Nov 16, 2022 at 4:39 PM John Naylor wrote: > > > On Wed, Nov 16, 2022 at 12:33 PM Masahiko Sawada > wrote: > > > > On Wed, Nov 16, 2022 at 1:46 PM John Naylor > > wrote: > > > > > > > > > On Tue, Nov 15, 2022 at 11:59 AM Masahiko Sawada > > > wrote: > > > > Thanks! Please let me know

Re: SUBTRANS: Minimizing calls to SubTransSetParent()

2022-11-16 Thread Tom Lane
Simon Riggs writes: > On Wed, 16 Nov 2022 at 00:09, Tom Lane wrote: >> No, that's not what XidInMVCCSnapshot does. If snapshot->suboverflowed >> is set (ie, somebody somewhere/somewhen overflowed), then it does >> SubTransGetTopmostTransaction and searches only the xips with the result. >> This b

Re: heapgettup refactoring

2022-11-16 Thread Peter Eisentraut
On 04.11.22 16:51, Melanie Plageman wrote: Thanks for the review! Attached is v2 with feedback addressed. Your 0001 had already been pushed. I have pushed your 0002. I have also pushed the renaming of page -> block, dp -> page separately. This should reduce the size of your 0003 a bit. Pl

Re: meson oddities

2022-11-16 Thread Andres Freund
Hi, On 2022-11-16 10:53:59 +0100, Peter Eisentraut wrote: > On 16.11.22 00:40, Andres Freund wrote: > > Somewhat relatedly, I wonder if we should have a better way to > > enable/disable > > the 'pgsql' path logic. It's pretty annoying that prefix basically doesn't > > work if it doesn't contain '

Re: [PoC] Reducing planning time when tables have many partitions

2022-11-16 Thread Thom Brown
On Mon, 7 Nov 2022 at 06:33, Zhang Mingli wrote: > > HI, > > Regards, > Zhang Mingli > On Nov 7, 2022, 14:26 +0800, Tom Lane , wrote: > > Andrey Lepikhov writes: > > I'm still in review of your patch now. At most it seems ok, but are you > really need both eq_sources and eq_derives lists now? > >

Re: meson oddities

2022-11-16 Thread Tom Lane
Andres Freund writes: > On 2022-11-16 10:53:59 +0100, Peter Eisentraut wrote: >> Could you explain this in more detail? > If I just want to install postgres into a prefix without 'postgresql' added in > a bunch of directories, e.g. because I already have pg-$version to be in the > prefix, there's

Re: meson oddities

2022-11-16 Thread Andres Freund
Hi, On 2022-11-16 11:54:10 -0500, Tom Lane wrote: > Andres Freund writes: > > On 2022-11-16 10:53:59 +0100, Peter Eisentraut wrote: > >> Could you explain this in more detail? > > > If I just want to install postgres into a prefix without 'postgresql' added > > in > > a bunch of directories, e.

Re: [PoC] Let libpq reject unexpected authentication requests

2022-11-16 Thread Jacob Champion
On Tue, Nov 15, 2022 at 11:07 PM Michael Paquier wrote: > I am beginning to look at the last version proposed, which has been > marked as RfC. Does this patch need a refresh in light of a9e9a9f and > 0873b2d? The changes for libpq_append_conn_error() should be > straight-forward. Updated in v13

Re: MERGE regress test

2022-11-16 Thread Alvaro Herrera
On 2022-Nov-16, Teja Mupparti wrote: > A quick question on merge regress-test > > https://github.com/postgres/postgres/blob/REL_15_STABLE/src/test/regress/expected/merge.out#L846 j > should there be an ERROR or comment needs a fix? What's the expected behavior? Hmm, good find. As I recall, I w

Re: Make a 100_bugs.pl test more faster.

2022-11-16 Thread Tom Lane
"Anton A. Melnikov" writes: > Here is a separate patch for the node usage optimization mentioned above. > It decreases the CPU usage during 100_bugs.pl by about 30%. Hmm ... as written, this isn't testing the same thing, because you didn't disable the FOR ALL TABLES publications created in the ea

Re: [PoC] configurable out of disk space elog level

2022-11-16 Thread Andres Freund
Hi, On 2022-11-16 15:59:09 +0300, Maxim Orlov wrote: > Patch is posted as PoC is attached. > --- a/src/backend/storage/smgr/md.c > +++ b/src/backend/storage/smgr/md.c > @@ -40,6 +40,7 @@ > #include "storage/sync.h" > #include "utils/hsearch.h" > #include "utils/memutils.h" > +#include "utils/s

Re: HOT chain validation in verify_heapam()

2022-11-16 Thread Robert Haas
On Wed, Nov 16, 2022 at 4:51 AM Himanshu Upadhyaya wrote: > yes, got it, have tried to test and it is giving false corruption in case of > subtransaction. > I think a better way to have this check is, we need to check that if > pred_xmin is > aborted then current_xmin should be aborted only. So

Re: Small miscellaneous fixes

2022-11-16 Thread Ranier Vilela
Em qua., 16 de nov. de 2022 às 03:59, Michael Paquier escreveu: > On Tue, Oct 04, 2022 at 08:23:16AM -0300, Ranier Vilela wrote: > > Both are correct, I missed the pqsignal calls. > > > > Attached patch to change this. > > The change for pgbench is missing and this is only changing > pg_test_fsyn

Re: Add sub-transaction overflow status in pg_stat_activity

2022-11-16 Thread Robert Haas
On Tue, Nov 15, 2022 at 2:29 PM Andres Freund wrote: > Hence the suggestion to show the pid of the session with the most subxacts. We > probably also should add a bunch of accessor functions for people that want > more detail... But just seeing in one place what's problematic would be the > big ge

Re: Table AM and DROP TABLE [ Was: Table AM and DDLs]

2022-11-16 Thread Andres Freund
Hi, On 2022-11-16 14:49:59 +0100, Mats Kindahl wrote: > I think the discussion went a little sideways, so let me recap what I'm > suggesting: > >1. I mentioned that there is a missing callback when the filenode is >unlinked and this is particularly evident when dropping a table. >2. I

Re: Report checkpoint progress with pg_stat_progress_checkpoint (was: Report checkpoint progress in server logs)

2022-11-16 Thread Andres Freund
Hi, On 2022-11-16 16:01:55 +0530, Bharath Rupireddy wrote: > -1 for CheckpointerShmemStruct as it is being used for running > checkpoints and I don't think adding stats to it is a great idea. Why? Imo the data needed for progress reporting aren't really "stats". We'd not accumulate counters over

Re: Assertion failure in SnapBuildInitialSnapshot()

2022-11-16 Thread Andres Freund
Hi, On 2022-11-16 14:22:01 +0530, Amit Kapila wrote: > On Wed, Nov 16, 2022 at 7:30 AM Andres Freund wrote: > > > > On 2022-11-15 16:20:00 +0530, Amit Kapila wrote: > > > On Tue, Nov 15, 2022 at 8:08 AM Andres Freund wrote: > > > > nor do we enforce in an obvious place that we > > > > don't alre

Re: libpq support for NegotiateProtocolVersion

2022-11-16 Thread Jacob Champion
On Tue, Nov 15, 2022 at 2:19 AM Peter Eisentraut wrote: > I think for the current code, the following would be an appropriate > adjustment: > > diff --git a/src/interfaces/libpq/fe-connect.c > b/src/interfaces/libpq/fe-connect.c > index 746e9b4f1efc..d15fb96572d9 100644 > --- a/src/interfaces/libp

Re: when the startup process doesn't (logging startup delays)

2022-11-16 Thread Robert Haas
On Wed, Nov 16, 2022 at 1:47 AM Bharath Rupireddy wrote: > That can be done, only if we can disable the timeout in another place > when the StandbyMode is set to true in ReadRecord(), that is, after > the standby server finishes crash recovery and enters standby mode. Oh, interesting. I didn't re

locale -a missing on Alpine Linux?

2022-11-16 Thread Peter Eisentraut
Since 2fe3bdbd691a, initdb has been failing on malleefowl: performing post-bootstrap initialization ... sh: locale: not found 2022-11-15 23:48:44.288 EST [10436] FATAL: could not execute command "locale -a": command not found 2022-11-15 23:48:44.288 EST [10436] STATEMENT: SELECT pg_import_sys

Re: Meson add host_system to PG_VERSION_STR

2022-11-16 Thread Andres Freund
Hi, On 2022-11-16 09:01:04 +0900, Michael Paquier wrote: > On Wed, Nov 16, 2022 at 12:08:56AM +0100, Juan José Santamaría Flecha wrote: > > As mentioned here [1] it might be interesting to complete the returned > > information by version() when compiled with meson by including the > > host_system.

Re: Report checkpoint progress with pg_stat_progress_checkpoint (was: Report checkpoint progress in server logs)

2022-11-16 Thread Robert Haas
On Wed, Nov 16, 2022 at 5:32 AM Bharath Rupireddy wrote: > -1 for CheckpointerShmemStruct as it is being used for running > checkpoints and I don't think adding stats to it is a great idea. > Instead, extending PgStat_CheckpointerStats and using shared memory > stats for reporting progress/last ch

Re: locale -a missing on Alpine Linux?

2022-11-16 Thread Christoph Moench-Tegeder
## Peter Eisentraut (peter.eisentr...@enterprisedb.com): > First of all, is this a standard installation of this OS, or is perhaps > something incomplete, broken, or unusual about the current OS installation? Alpine uses musl libc, on which you need package musl-locales to get a /usr/bin/locale.

Re: locale -a missing on Alpine Linux?

2022-11-16 Thread Tom Lane
Christoph Moench-Tegeder writes: > ## Peter Eisentraut (peter.eisentr...@enterprisedb.com): >> First of all, is this a standard installation of this OS, or is perhaps >> something incomplete, broken, or unusual about the current OS installation? > Alpine uses musl libc, on which you need package

Re: Report checkpoint progress with pg_stat_progress_checkpoint (was: Report checkpoint progress in server logs)

2022-11-16 Thread Andres Freund
Hi, On 2022-11-16 14:19:32 -0500, Robert Haas wrote: > I have never really understood why we drive background writer or > checkpointer statistics through the statistics collector. To some degree it is required for durability - the stats system needs to know how to write out those stats. But that

Re: predefined role(s) for VACUUM and ANALYZE

2022-11-16 Thread Andrew Dunstan
On 2022-11-15 Tu 00:08, Nathan Bossart wrote: > On Mon, Nov 14, 2022 at 03:40:04PM -0800, Nathan Bossart wrote: >> Thanks for taking a look! Here is a rebased version of the patch set. > Oops, apparently object_aclcheck() cannot be used for pg_class. Here is > another version that uses pg_class

Re: Split index and table statistics into different types of stats

2022-11-16 Thread Andres Freund
Hi, On 2022-11-15 10:48:40 +0100, Drouvot, Bertrand wrote: > diff --git a/src/backend/utils/adt/pgstatfuncs.c > b/src/backend/utils/adt/pgstatfuncs.c > index ae3365d917..be7f175bf1 100644 > --- a/src/backend/utils/adt/pgstatfuncs.c > +++ b/src/backend/utils/adt/pgstatfuncs.c > @@ -36,24 +36,34 @@

Re: Making Vars outer-join aware

2022-11-16 Thread Tom Lane
Richard Guo writes: > I'm reviewing the part about multiple version clauses, and I find a case > that may not work as expected. I tried with some query as below > (A leftjoin (B leftjoin C on (Pbc)) on (Pab)) left join D on (Pcd) > Assume Pbc is strict for B and Pcd is strict for C. > According

Re: logical decoding and replication of sequences, take 2

2022-11-16 Thread Robert Haas
On Fri, Nov 11, 2022 at 5:49 PM Tomas Vondra wrote: > The other option might be to make these messages non-transactional, in > which case we'd separate the ordering from COMMIT ordering, evading the > reordering problem. > > That'd mean we'd ignore rollbacks (which seems fine), we could probably >

Re: About displaying NestLoopParam

2022-11-16 Thread Greg Stark
So I guess I don't have much to add since I don't really understand the Param infrastructure, certainly not any better than you seem to. I do note that the code in question was added in this commit in 2010. That predates the addition of LATERAL in 2013. I suppose those comments may be talking abou

ScanSourceDatabasePgClass

2022-11-16 Thread David Christensen
Hi Robert, In 9c08aea6a you introduce the block-by-block strategy for creating a copy of the database. In the main loop, this utilizes this call: buf = ReadBufferWithoutRelcache(rlocator, MAIN_FORKNUM, blkno, RBM_NORMAL, bstrategy, false); Here, the last parameter is "false" for the permanence

Re: Meson add host_system to PG_VERSION_STR

2022-11-16 Thread Juan José Santamaría Flecha
On Wed, Nov 16, 2022 at 8:02 PM Andres Freund wrote: > > Given we're looking at improving this, should we also add 32/64-bit piece? > > If so, we probably should move building PG_VERSION_STR to later so we can > use > SIZEOF_VOID_P - configure.ac does that too. > > With extra_version set to -andr

Re: [DOCS] Stats views and functions not in order?

2022-11-16 Thread David G. Johnston
On Tue, Nov 15, 2022 at 6:39 PM Peter Smith wrote: > > I was also wondering (but have not yet done) if the content *outside* > the tables should be reordered to match the table 28.1/28.2 order. > > Thoughts? > > I would love to do away with the ToC listing of view names in 28.2 altogether. Also,

Re: PATCH: Using BRIN indexes for sorted output

2022-11-16 Thread Greg Stark
Fwiw tuplesort does do something like what you want for the top-k case. At least it used to last I looked -- not sure if it went out with the tapesort ... For top-k it inserts new tuples into the heap data structure and then pops the top element out of the hash. That keeps a fixed number of elemen

Re: Allow single table VACUUM in transaction block

2022-11-16 Thread Greg Stark
I think the idea of being able to request an autovacuum worker for a specific table is actually very good. I think it's what most users actually want when they are running vacuum. In fact in previous jobs people have built infrastructure that basically duplicates autovacuum just so they could do th

Re: Standardizing how pg_waldump presents recovery conflict XID cutoffs

2022-11-16 Thread Peter Geoghegan
On Tue, Nov 15, 2022 at 8:48 PM Peter Geoghegan wrote: > Okay, let's go with snapshotConflictHorizon. I'll use that name in the > next revision, which I should be able to post tomorrow. Attached is a somewhat cleaned up version that uses that symbol name for everything. -- Peter Geoghegan v2-0

Re: Allow single table VACUUM in transaction block

2022-11-16 Thread Tom Lane
Greg Stark writes: > I think this requesting autovacuum worker should be a distinct > command. Or at least an explicit option to vacuum. +1. That'd reduce confusion, and perhaps we could remove some of the restrictions. regards, tom lane

Re: Index not getting cleaned even though vacuum is running

2022-11-16 Thread Matheus Alcantara
Hi --- Original Message --- On Tuesday, November 15th, 2022 at 12:38, Karthik Jagadish (kjagadis) wrote: > Hi, > > We notice that vacuum is happening at regular intervals but the space > occupied by indexes is always increasing. Any pointers as to why would this > happen? > > Some

Re: Suppressing useless wakeups in walreceiver

2022-11-16 Thread Thomas Munro
On Wed, Nov 16, 2022 at 5:24 PM Nathan Bossart wrote: > On Wed, Nov 16, 2022 at 04:57:08PM +1300, Thomas Munro wrote: > > On Tue, Nov 15, 2022 at 5:49 PM Nathan Bossart > > wrote: > >> Another option might be to just force initial reply/feedback messages when > >> streaming starts. The attached

Re: [PATCH] Support % wildcard in extension upgrade filenames

2022-11-16 Thread 'Sandro Santilli'
On Sun, Nov 13, 2022 at 11:46:50PM -0500, Regina Obe wrote: > > Re: Sandro Santilli > > > I'm attaching an updated version of the patch. This time the patch is > > > tested. Nothing changes unless the .control file for the subject > > > extension doesn't have a "wildcard_upgrades = true" statement.

RE: [PATCH] Support % wildcard in extension upgrade filenames

2022-11-16 Thread Regina Obe
> On Sun, Nov 13, 2022 at 11:46:50PM -0500, Regina Obe wrote: > > > Re: Sandro Santilli > > > > I'm attaching an updated version of the patch. This time the patch > > > > is tested. Nothing changes unless the .control file for the > > > > subject extension doesn't have a "wildcard_upgrades = true"

Re: [PATCH] Support % wildcard in extension upgrade filenames

2022-11-16 Thread Justin Pryzby
Note that the patch is passing tests when using autoconf build but failing for meson builds. http://cfbot.cputube.org/sandro-santilli.html I imagine you need to make the corresponding change to ./meson.build that you made to ./Makefile. https://wiki.postgresql.org/wiki/Meson_for_patch_authors ht

Re: Standardizing how pg_waldump presents recovery conflict XID cutoffs

2022-11-16 Thread Andres Freund
Hi, On 2022-11-16 14:14:30 -0800, Peter Geoghegan wrote: > /* > - * If 'tuple' contains any visible XID greater than latestRemovedXid, > - * ratchet forwards latestRemovedXid to the greatest one found. > - * This is used as the basis for generating Hot Standby conflicts, so > - * if a tuple was n

Re: Standardizing how pg_waldump presents recovery conflict XID cutoffs

2022-11-16 Thread Peter Geoghegan
On Wed, Nov 16, 2022 at 3:27 PM Andres Freund wrote: > The "(also...) formulation seems a bit odd. How about "an obsolescent heap > tuple that the caller is physically removing, e.g. via HOT pruning or index > deletion." or such? Okay, WFM. > > + * snapshotConflictHorizon format values are how a

Re: PATCH: Using BRIN indexes for sorted output

2022-11-16 Thread Tomas Vondra
On 11/16/22 22:52, Greg Stark wrote: > Fwiw tuplesort does do something like what you want for the top-k > case. At least it used to last I looked -- not sure if it went out > with the tapesort ... > > For top-k it inserts new tuples into the heap data structure and then > pops the top element out

Re: About displaying NestLoopParam

2022-11-16 Thread Tom Lane
Greg Stark writes: > I do note that the code in question was added in this commit in 2010. > That predates the addition of LATERAL in 2013. Yeah. It's pretty clear from the comments that I was concerned about false matches of PARAM_EXEC numbers. I think that was a live issue at the time but is

Re: Standardizing how pg_waldump presents recovery conflict XID cutoffs

2022-11-16 Thread Andres Freund
Hi, On 2022-11-16 15:37:40 -0800, Peter Geoghegan wrote: > On Wed, Nov 16, 2022 at 3:27 PM Andres Freund wrote: > > What are "snapshotConflictHorizon format XIDs"? I guess you mean format in > > the > > sense of having the semantics of snapshotConflictHorizon? > > Yes. That is the only possible

Re: libpq compression (part 2)

2022-11-16 Thread Andrey Borodin
On Tue, Nov 15, 2022 at 7:17 PM Justin Pryzby wrote: > Also I've found one more TODO item for the patch. Currently in fe-connect.c patch is doing buffer reset: conn->inStart = conn->inCursor = conn->inEnd = 0; This effectively consumes butes up tu current cursor. However, packet inspection is con

Re: Standardizing how pg_waldump presents recovery conflict XID cutoffs

2022-11-16 Thread Peter Geoghegan
On Wed, Nov 16, 2022 at 4:25 PM Andres Freund wrote: > > Anyway, worth calling this out directly in these comments IMV. We're > > addressing two closely related things that assign opposite meanings to > > InvalidTransactionId, which is rather confusing. > > It makes sense to call this out, but I'd

Re: when the startup process doesn't (logging startup delays)

2022-11-16 Thread Thomas Munro
On Thu, Nov 17, 2022 at 7:51 AM Robert Haas wrote: + * up, since standby mode is a state that is intendeded to persist typo Otherwise LGTM.

Re: Fix the README file for MERGE command

2022-11-16 Thread Richard Guo
On Wed, Nov 16, 2022 at 4:37 PM Waithant Myo (Fujitsu) < myo.waith...@fujitsu.com> wrote: > The actions of MERGE command can be specified as follows: INSERT, UPDATE, > DELETE and DO NOTHING. > > However, in the README file, the ‘UPDATE’ word is described 2 times > instead of ‘DELETE’. > > > > Ther

Re: logical decoding and replication of sequences, take 2

2022-11-16 Thread Tomas Vondra
On 11/16/22 22:05, Robert Haas wrote: > On Fri, Nov 11, 2022 at 5:49 PM Tomas Vondra > wrote: >> The other option might be to make these messages non-transactional, in >> which case we'd separate the ordering from COMMIT ordering, evading the >> reordering problem. >> >> That'd mean we'd ignore

ubsan fails on 32bit builds

2022-11-16 Thread Andres Freund
Hi, I am working on polishing my patch to make CI use sanitizers. Unfortunately using -fsanitize=alignment,undefined causes tests to fail on 32bit builds. https://cirrus-ci.com/task/5092504471601152 https://api.cirrus-ci.com/v1/artifact/task/5092504471601152/testrun/build-32/testrun/recovery/022_

Re: Allow file inclusion in pg_hba and pg_ident files

2022-11-16 Thread Michael Paquier
On Wed, Nov 16, 2022 at 10:53:02AM +0800, Julien Rouhaud wrote: > While being the same inclusion infrastructure, it's likely that people will > have different usage. I'm assuming that for GUCs the main usage is to have > your automation tool put one of your template conf for instance > (small_vm.

Re: Meson add host_system to PG_VERSION_STR

2022-11-16 Thread Michael Paquier
On Wed, Nov 16, 2022 at 02:12:05PM +0100, Juan José Santamaría Flecha wrote: > On Wed, Nov 16, 2022 at 10:50 AM Peter Eisentraut < > peter.eisentr...@enterprisedb.com> wrote: >> Perhaps some examples before and after on different platforms could be >> shown. > > Yes, that would make clear what the

Re: logical decoding and replication of sequences, take 2

2022-11-16 Thread Andres Freund
Hi, On 2022-11-17 02:41:14 +0100, Tomas Vondra wrote: > Well, yeah - we can either try to perform the stuff independently of the > transactions that triggered it, or we can try making it part of some of > the transactions. Each of those options has problems, though :-( > > The first version of th

Re: User functions for building SCRAM secrets

2022-11-16 Thread Michael Paquier
On Thu, Nov 10, 2022 at 11:14:34PM -0500, Jonathan S. Katz wrote: > On 10/31/22 8:56 PM, Michael Paquier wrote: >> Well, one could pass a salt based on something generated by random() >> to emulate what we currently do in the default case, as well. The >> salt length is an extra possibility, letti

Re: pg_upgrade test failure

2022-11-16 Thread Justin Pryzby
On Tue, Nov 08, 2022 at 01:16:09AM +1300, Thomas Munro wrote: > So [1] on its own didn't fix this. My next guess is that the attached > might help. I took the liberty of adding a CF entry for this https://commitfest.postgresql.org/41/4011/ And afterwards figured I could be a little bit wasteful

Is the plan for IN(1,2,3) always the same as for =ANY('{1,2,3}') when using PQexec with no params?

2022-11-16 Thread Dmitry Koterov
Hi. PG13+. Assume we have two identical queries with no arguments (as a plain text, e.g. passed to PQexec - NOT to PQexecParams!): - one with "a=X AND b IN(...)" - and one with "a=X and b=ANY('{...}') The question: is it guaranteed that the planner will always choose identical plans for them (or

Re: CI and test improvements

2022-11-16 Thread Andres Freund
Hi, On 2022-10-02 14:54:21 -0700, Andres Freund wrote: > On 2022-10-02 16:35:06 -0500, Justin Pryzby wrote: > > On Sun, Oct 02, 2022 at 01:52:01PM -0700, Andres Freund wrote: > > > On 2022-10-01 18:36:41 -0700, Andres Freund wrote: > > > > I am wondering if we should instead introduce a new "quick

Re: Is the plan for IN(1,2,3) always the same as for =ANY('{1,2,3}') when using PQexec with no params?

2022-11-16 Thread Tom Lane
Dmitry Koterov writes: > PG13+. Assume we have two identical queries with no arguments (as a plain > text, e.g. passed to PQexec - NOT to PQexecParams!): > - one with "a=X AND b IN(...)" > - and one with "a=X and b=ANY('{...}') > The question: is it guaranteed that the planner will always choose

Re: HOT chain validation in verify_heapam()

2022-11-16 Thread Himanshu Upadhyaya
On Wed, Nov 16, 2022 at 11:23 PM Robert Haas wrote: > On Wed, Nov 16, 2022 at 4:51 AM Himanshu Upadhyaya > wrote: > > yes, got it, have tried to test and it is giving false corruption in > case of subtransaction. > > I think a better way to have this check is, we need to check that if > pred_xmi

Re: CI and test improvements

2022-11-16 Thread Justin Pryzby
On Wed, Nov 16, 2022 at 07:48:14PM -0800, Andres Freund wrote: > I've used this a bunch on personal branches, and I think it's the way to > go. It doesn't take long, saves a lot of cycles when one pushes something > broken. Starts to runs the CompilerWarnings task after a minimal amount of > sanity

  1   2   >