Re: a misbehavior of partition row movement (?)

2022-01-18 Thread Amit Langote
On Wed, Jan 19, 2022 at 4:13 PM Amit Langote wrote: > On Wed, Jan 19, 2022 at 7:29 AM Alvaro Herrera > wrote: > > On 2022-Jan-18, Alvaro Herrera wrote: > > > On 2022-Jan-18, Amit Langote wrote: > > > > > > > Would you like me to update the patch with the above renumbering or > > > > are you

Re: Skipping logical replication transactions on subscriber side

2022-01-18 Thread Masahiko Sawada
On Wed, Jan 19, 2022 at 12:22 PM osumi.takami...@fujitsu.com wrote: > > On Tuesday, January 18, 2022 3:05 PM Masahiko Sawada > wrote: > > I've attached a rebased patch. > Thank you for your rebase ! > > Several review comments on v8. Thank you for the comments! > > (1)

Re: Skipping logical replication transactions on subscriber side

2022-01-18 Thread Greg Nancarrow
On Tue, Jan 18, 2022 at 5:05 PM Masahiko Sawada wrote: > > I've attached a rebased patch. A couple of comments for the v8 patch: doc/src/sgml/logical-replication.sgml (1) Strictly-speaking it's the transaction, not transaction ID, that contains changes, so suggesting minor change: BEFORE: +

Re: a misbehavior of partition row movement (?)

2022-01-18 Thread Amit Langote
On Wed, Jan 19, 2022 at 7:29 AM Alvaro Herrera wrote: > On 2022-Jan-18, Alvaro Herrera wrote: > > On 2022-Jan-18, Amit Langote wrote: > > > > > Would you like me to update the patch with the above renumbering or > > > are you working on a new version yourself? > > > > I have a few very minor

Re: Skipping logical replication transactions on subscriber side

2022-01-18 Thread vignesh C
On Sat, Jan 15, 2022 at 3:58 PM Amit Kapila wrote: > > On Fri, Jan 14, 2022 at 5:35 PM vignesh C wrote: > > > > Thanks for the updated patch, few minor comments: > > 1) Should "SKIP" be "SKIP (" here: > > @@ -1675,7 +1675,7 @@ psql_completion(const char *text, int start, int end) > > /*

Re: do only critical work during single-user vacuum?

2022-01-18 Thread Masahiko Sawada
On Fri, Jan 14, 2022 at 7:04 AM Bossart, Nathan wrote: > > On 1/13/22, 4:58 AM, "John Naylor" wrote: > > On Wed, Jan 12, 2022 at 12:26 PM Bossart, Nathan > > wrote: > >> As I've stated upthread, Sawada-san's suggested approach was my > >> initial reaction to this thread. I'm not wedded to the

Re: Schema variables - new implementation for Postgres 15

2022-01-18 Thread Pavel Stehule
=# " >> CREATE COLLATION >> >> =# create variable myvariable text collate mycollation; >> CREATE VARIABLE >> >> =# select classid::regclass, objid, objsubid, refclassid::regclass, >> refobjid, refobjsubid from pg_depend where classid::regclass::text = >> 'pg_variable' or refclassid::regclass::text

Re: Make relfile tombstone files conditional on WAL level

2022-01-18 Thread Dilip Kumar
On Thu, Jan 6, 2022 at 7:22 PM Robert Haas wrote: > On Thu, Jan 6, 2022 at 3:47 AM Thomas Munro > wrote: > > Another problem is that relfilenodes are normally allocated with > > GetNewOidWithIndex(), and initially match a relation's OID. We'd need > > a new allocator, and they won't be able to

Re: Adding CI to our tree

2022-01-18 Thread Tom Lane
Andres Freund writes: > On 2022-01-18 21:50:07 -0500, Tom Lane wrote: >> This actually causes parallel check-world to fail altogether on florican's >> host, because the initial fsync of the recovered primary takes more than 3 >> minutes when there's conflicting I/O traffic, causing pg_ctl to time

Re: Map WAL segment files on PMEM as WAL buffers

2022-01-18 Thread Takashi Menjo
Hi Justin, I can reproduce the error you reported, with PMEM_IS_PMEM_FORCE=1. Moreover, I can reproduce it **on a real PMem device**. So the causes are in my patchset, not in PMem environment. I'll fix it in the next patchset version. Regards, Takashi -- Takashi Menjo

Re: Adding CI to our tree

2022-01-18 Thread Tom Lane
Andres Freund writes: > On 2022-01-18 21:50:07 -0500, Tom Lane wrote: >> There is no reason for this script to be overriding Cluster.pm's >> fsync = off setting. >> This appears to go back to 917dc7d23 of 2016, so I think it just >> predates our recognition that we should disable fsync in routine

Re: [PATCH] reduce page overlap of GiST indexes built using sorted method

2022-01-18 Thread Andrey Borodin
> 19 янв. 2022 г., в 01:26, sergei sh. написал(а): > > Hi, > > I've addressed Andrey Borodin's concerns about v2 of this patch by Aliaksandr > Kalenik in attached version. Thank you! I'll make a new iteration of review. From a first glance everything looks good, but

Re: Refactoring of compression options in pg_basebackup

2022-01-18 Thread Michael Paquier
On Tue, Jan 18, 2022 at 10:04:56AM -0500, Robert Haas wrote: > I think it could make sense for you implement > --compress=METHOD[:LEVEL], keeping -z and -Z N as synonyms for > --compress=gzip and --compress=gzip:N, and with --compress=N being > interpreted as --compress=gzip:N. Then I'll

Re: Adding CI to our tree

2022-01-18 Thread Andres Freund
Hi, On 2022-01-18 21:50:07 -0500, Tom Lane wrote: > I just found one thing making check-world slower than it ought to be: > src/test/recovery/t/008_fsm_truncation.pl does > > $node_primary->append_conf( > 'postgresql.conf', qq{ > fsync = on > wal_log_hints = on > max_prepared_transactions

Re: docs: pg_replication_origin_oid() description does not match behaviour

2022-01-18 Thread Ian Lawrence Barwick
2022年1月19日(水) 10:40 Michael Paquier : > > On Tue, Jan 18, 2022 at 06:20:22PM +, Bossart, Nathan wrote: > > +1 > > And done. Thanks! Ian Barwick -- EnterpriseDB: https://www.enterprisedb.com

RE: Skipping logical replication transactions on subscriber side

2022-01-18 Thread osumi.takami...@fujitsu.com
On Tuesday, January 18, 2022 3:05 PM Masahiko Sawada wrote: > I've attached a rebased patch. Thank you for your rebase ! Several review comments on v8. (1) doc/src/sgml/logical-replication.sgml + + + To resolve conflicts, you need to consider changing the data on the subscriber so +

Re: A qsort template

2022-01-18 Thread Peter Geoghegan
On Tue, Jan 18, 2022 at 6:39 PM John Naylor wrote: > Editorializing the null position in queries is not very common in my > experience. Not null is interesting since it'd be trivial to pass > constant false to the same Apply[XYZ]SortComparator() and let the > compiler remove all those branches

Re: Adding CI to our tree

2022-01-18 Thread Tom Lane
I just found one thing making check-world slower than it ought to be: src/test/recovery/t/008_fsm_truncation.pl does $node_primary->append_conf( 'postgresql.conf', qq{ fsync = on wal_log_hints = on max_prepared_transactions = 5 autovacuum = off }); There is no reason for this script to

Re: A qsort template

2022-01-18 Thread John Naylor
I wrote: > That said, I think what I'll do next is test the v3-0001 standalone > patch with tuplesort specializations for more data types. I already > have a decent test script that I can build on for this. I've run a test with 10 million records using all types found in the v3 patch "accelerate

Re: pgsql: Modify pg_basebackup to use a new COPY subprotocol for base back

2022-01-18 Thread Tom Lane
Robert Haas writes: > Here's a patch, based in part on some off-list discussion with Andres. > I believe Andres has already confirmed that this fix works, but it > wouldn't hurt if Tom wants to verify it also. WFM too --- at least, pg_basebackup's "make check" passes now.

Re: pgsql: Modify pg_basebackup to use a new COPY subprotocol for base back

2022-01-18 Thread Robert Haas
On Tue, Jan 18, 2022 at 8:55 PM Robert Haas wrote: > Ah, I guess I copied and pasted the options wrong, or something. > Anyway, I have an idea how to fix this. I didn't realize that we were > going to read from the bbsink's buffer like this, and it's not > properly aligned for that. I'll jigger

Re: Add last commit LSN to pg_last_committed_xact()

2022-01-18 Thread Andres Freund
Hi, On 2022-01-18 20:58:01 -0500, James Coleman wrote: > Is something roughly like the attached what you'd envisioned? Roughly, yea. > I think we need a shared ProcArrayLock to read the array, correct? You could perhaps get away without it, but it'd come at the price of needing to look at all

RE: row filtering for logical replication

2022-01-18 Thread houzj.f...@fujitsu.com
On Tues, Jan 18, 2022 9:27 AM Peter Smith wrote: > Here are some review comments for v66-0001 (review of updates since > v65-0001) Thanks for the comments! > ~~~ > > 1. src/backend/catalog/pg_publication.c - GetTopMostAncestorInPublication > > @@ -276,17 +276,45 @@

Re: Add last commit LSN to pg_last_committed_xact()

2022-01-18 Thread James Coleman
On Tue, Jan 18, 2022 at 4:32 PM Andres Freund wrote: > > I wonder if a very different approach could make sense here. Presumably this > wouldn't need to be queried at a very high frequency, right? If so, what about > storing the latest commit LSN for each backend in PGPROC? That could be >

Re: pgsql: Modify pg_basebackup to use a new COPY subprotocol for base back

2022-01-18 Thread Robert Haas
On Tue, Jan 18, 2022 at 5:12 PM Tom Lane wrote: > Now that I re-read what you did, I believe you need both of > > -fsanitize=alignment -fsanitize-trap=alignment > > to enable those traps to happen. That seems to be the case with > Apple's clang, anyway. Ah, I guess I copied and pasted the

Re: pgsql: Modify pg_basebackup to use a new COPY subprotocol for base back

2022-01-18 Thread Andres Freund
On 2022-01-18 17:12:00 -0500, Tom Lane wrote: > Robert Haas writes: > > Unfortunately, I can't reproduce this locally, even with COPT=-Wall > > -Werror -fno-omit-frame-pointer -fsanitize-trap=alignment > > -Wno-deprecated-declarations -DWRITE_READ_PARSE_PLAN_TREES > > -DSTRESS_SORT_INT_MIN

Re: docs: pg_replication_origin_oid() description does not match behaviour

2022-01-18 Thread Michael Paquier
On Tue, Jan 18, 2022 at 06:20:22PM +, Bossart, Nathan wrote: > +1 And done. -- Michael signature.asc Description: PGP signature

Re: Add last commit LSN to pg_last_committed_xact()

2022-01-18 Thread James Coleman
On Tue, Jan 18, 2022 at 8:05 PM Andres Freund wrote: > > Hi, > > On 2022-01-18 18:31:42 -0500, James Coleman wrote: > > One other question on this: if we went with this would you expect a > > new function to parallel pg_last_committed_xact()? > > I don't think I have an opinion the user interface

Re: Adding CI to our tree

2022-01-18 Thread Andres Freund
Hi, On 2022-01-18 15:08:47 -0600, Justin Pryzby wrote: > On Mon, Jan 17, 2022 at 12:16:19PM -0800, Andres Freund wrote: > > I think it might still be worth adding stopgap way of running all tap tests > > on > > windows though. Having a vcregress.pl function to find all directories with > > t/ >

Re: tab-complete COMPLETE_WITH_ATTR can become confused by table-lists.

2022-01-18 Thread Tom Lane
Peter Smith writes: > If there are spaces in the table-list like "t1, t2" then the word is > recognized as "t2" and it works as expected. > But, if there are no spaces in the table-list like "t1,t2" then the > word is recognized as "t1,t2", and since that is no such table name > the

Re: [Ext:] Re: Stream Replication not working

2022-01-18 Thread Allie Crawford
I was able to figure out what the problem was that was preventing my PostgreSQL Stream replication from replicating the changes even though all the health checks queries were showing that the replication had no problems. I am a newbie and I am learning PostgreSQL on my own, so it took me a while

Re: Add last commit LSN to pg_last_committed_xact()

2022-01-18 Thread Andres Freund
Hi, On 2022-01-18 18:31:42 -0500, James Coleman wrote: > One other question on this: if we went with this would you expect a > new function to parallel pg_last_committed_xact()? I don't think I have an opinion the user interface aspect. > Or allow the xid and lsn in the return of

Re: slowest tap tests - split or accelerate?

2022-01-18 Thread Andres Freund
Hi, On 2022-01-18 13:40:40 -0800, Andres Freund wrote: > Maybe we really should do at least the most simplistic caching for initdbs, by > doing one initdb as part of the creation of temp_install. Then Cluster::init > would need logic to only use that if $params{extra} is empty. I hacked this

Re: In-placre persistance change of a relation

2022-01-18 Thread Kyotaro Horiguchi
At Tue, 18 Jan 2022 10:37:53 -0500, Tom Lane wrote in > Julien Rouhaud writes: > > The cfbot is failing on all OS with this version of the patch. Apparently > > v16-0002 introduces some usage of "testtablespace" client-side variable > > that's > > never defined, e.g. > > That test

Re: Replace uses of deprecated Python module distutils.sysconfig

2022-01-18 Thread Tom Lane
I wrote: > Are we sure it's an issue within Python, rather than something we > could dodge by invoking sysconfig differently? It's hard to believe > that sysconfig could be totally unfit for the purpose of finding out > the include path and would remain so for multiple years. I dug up a Debian 9

tab-complete COMPLETE_WITH_ATTR can become confused by table-lists.

2022-01-18 Thread Peter Smith
Hi. I stumbled onto a small quirk/bug in the tab-complete code. There are some places that suggest tab completions using the current table columns. These are coded like: COMPLETE_WITH_ATTR(prev2_wd, ""); The assumption is that the prev2_wd represents the table to select from. Normally, this

Re: Extend compatibility of PostgreSQL::Test::Cluster

2022-01-18 Thread Andrew Dunstan
On 12/31/21 11:22, Andrew Dunstan wrote: > On 12/31/21 11:20, Dagfinn Ilmari Mannsåker wrote: >> Andrew Dunstan writes: >> >>> + my $subclass = __PACKAGE__ . "::V_$maj"; >>> + bless $node, $subclass; >>> + unless ($node->isa(__PACKAGE__)) >>> + { >>> +

Re: is ErrorResponse possible on Sync?

2022-01-18 Thread Rafi Shamim
I used your example and tried it with prepared statements. I captured the traffic with Wireshark. My client sent Bind/Execute/Sync messages, and PostgreSQL 14 sent back BindComplete/CommandComplete/ErrorResponse messages, followed by ReadyForQuery after that. So yes, it looks like ErrorResponse

Re: Add last commit LSN to pg_last_committed_xact()

2022-01-18 Thread James Coleman
On Tue, Jan 18, 2022 at 4:32 PM Andres Freund wrote: > I wonder if a very different approach could make sense here. Presumably this > wouldn't need to be queried at a very high frequency, right? If so, what about > storing the latest commit LSN for each backend in PGPROC? That could be >

Synchronizing slots from primary to standby

2022-01-18 Thread Hsu, John
Hello, The doc mentions that standby_slot_names is to only be used for waiting on physical slots. However, it seems like we calculate the flush_pos for logical slots as well in wait_for_standby_confirmation? Re-posting some of my previous comment since it seems like it got lost... In

Re: Add last commit LSN to pg_last_committed_xact()

2022-01-18 Thread Andres Freund
On 2022-01-18 16:40:25 -0500, James Coleman wrote: > If I read between the lines I imagine you'd see even e.g. every 2s as > not that big of a deal here, right? Right. Even every 0.2s wouldn't be a problem.

Re: a misbehavior of partition row movement (?)

2022-01-18 Thread Alvaro Herrera
On 2022-Jan-18, Alvaro Herrera wrote: > On 2022-Jan-18, Amit Langote wrote: > > > Would you like me to update the patch with the above renumbering or > > are you working on a new version yourself? > > I have a few very minor changes apart from that. Let me see if I can > get this pushed soon;

Re: pgsql: Modify pg_basebackup to use a new COPY subprotocol for base back

2022-01-18 Thread Tom Lane
Robert Haas writes: > Unfortunately, I can't reproduce this locally, even with COPT=-Wall > -Werror -fno-omit-frame-pointer -fsanitize-trap=alignment > -Wno-deprecated-declarations -DWRITE_READ_PARSE_PLAN_TREES > -DSTRESS_SORT_INT_MIN -DENFORCE_REGRESSION_TEST_NAME_RESTRICTIONS. Now that I

Re: pgsql: Modify pg_basebackup to use a new COPY subprotocol for base back

2022-01-18 Thread Tom Lane
I wrote: >> Tom, any chance you can get a stack trace? > Hmm, I'd assumed that was just a cosmic ray or something. My mistake: it's failing because of -fsanitize=alignment. Here's the stack trace: * frame #0: 0x00010885dfd0 postgres`sendFile(sink=0x7fdedf071cb0,

Re: pgsql: Modify pg_basebackup to use a new COPY subprotocol for base back

2022-01-18 Thread Robert Haas
On Tue, Jan 18, 2022 at 4:36 PM Tom Lane wrote: > Robert Haas writes: > > Andres pointed out to me that longfin is sad: > > > 2022-01-18 14:52:35.484 EST [82470:4] LOG: server process (PID 82487) > > was terminated by signal 4: Illegal instruction: 4 > > > Tom, any chance you can get a stack

Re: Allow root ownership of client certificate key

2022-01-18 Thread Tom Lane
David Steele writes: > On 1/18/22 15:41, Tom Lane wrote: >> The only other nitpick I have is that I'd make the cross-references be >> to the two file names, ie like "Note that similar checks are performed >> in fe-secure-openssl.c ..." References to the specific functions seem >> likely to

Re: Allow root ownership of client certificate key

2022-01-18 Thread David Steele
On 1/18/22 15:41, Tom Lane wrote: David Steele writes: I took a quick look at this and agree with the proposed behavior change, but also with your self-criticisms: We may want to do the same on the server side to make the code blocks look more similar. Also, on the server side the S_ISREG()

Re: slowest tap tests - split or accelerate?

2022-01-18 Thread Andres Freund
Hi, On 2022-01-18 12:49:16 -0500, Robert Haas wrote: > Here's a patch that splits up that file. Ah, nice! The split seems sensible to me. > Sadly, we've gained about 2.5 seconds of runtime as the price of > splitting the test. Arguably the options part could be split up a lot > more finely

Re: Add last commit LSN to pg_last_committed_xact()

2022-01-18 Thread James Coleman
On Tue, Jan 18, 2022 at 4:32 PM Andres Freund wrote: > > Hi, > > On 2022-01-17 18:34:16 -0300, Alvaro Herrera wrote: > > Maybe it would work to have a single LSN in shared memory, as an atomic > > variable, which uses monotonic advance[1] to be updated. > > That could be a reasonable approach. >

Re: pgsql: Modify pg_basebackup to use a new COPY subprotocol for base back

2022-01-18 Thread Tom Lane
Robert Haas writes: > Andres pointed out to me that longfin is sad: > 2022-01-18 14:52:35.484 EST [82470:4] LOG: server process (PID 82487) > was terminated by signal 4: Illegal instruction: 4 > Tom, any chance you can get a stack trace? Hmm, I'd assumed that was just a cosmic ray or

Re: Add last commit LSN to pg_last_committed_xact()

2022-01-18 Thread Andres Freund
Hi, On 2022-01-17 18:34:16 -0300, Alvaro Herrera wrote: > Maybe it would work to have a single LSN in shared memory, as an atomic > variable, which uses monotonic advance[1] to be updated. That could be a reasonable approach. > Whether this is updated or not would depend on a new GUC, maybe >

Re: refactoring basebackup.c

2022-01-18 Thread Robert Haas
On Tue, Jan 18, 2022 at 9:43 AM Jeevan Ladhe wrote: > The patch surely needs some grooming, but I am expecting some initial > review, specially in the area where we are trying to close the zstd stream > in bbsink_zstd_end_archive(). We need to tell the zstd library to end the > compression by

Re: [PATCH] allow src/tools/msvc/clean.bat script to be called from the root of the source tree

2022-01-18 Thread Andrew Dunstan
On 1/18/22 15:08, Juan José Santamaría Flecha wrote: > > > > > By the way, are pgbison.bat and pgflex.bat directly called anywhere? > > Not to my knowledge. One of the things that's annoying about them is > that the processor names are hardcoded, so if you install winflexbison >

Re: Adding CI to our tree

2022-01-18 Thread Justin Pryzby
On Mon, Jan 17, 2022 at 12:16:19PM -0800, Andres Freund wrote: > I think it might still be worth adding stopgap way of running all tap tests on > windows though. Having a vcregress.pl function to find all directories with t/ > and run the tests there, shouldn't be a lot of code... I started doing

Re: pgsql: Modify pg_basebackup to use a new COPY subprotocol for base back

2022-01-18 Thread Robert Haas
On Tue, Jan 18, 2022 at 1:51 PM Robert Haas wrote: > Modify pg_basebackup to use a new COPY subprotocol for base backups. Andres pointed out to me that longfin is sad: 2022-01-18 14:52:35.484 EST [82470:4] LOG: server process (PID 82487) was terminated by signal 4: Illegal instruction: 4

Re: [PATCH] reduce page overlap of GiST indexes built using sorted method

2022-01-18 Thread Komяpa
Hello hackers, On Tue, Jan 18, 2022 at 11:26 PM sergei sh. wrote: > Hi, > > I've addressed Andrey Borodin's concerns about v2 of this patch by > Aliaksandr > Kalenik in attached version. > [snip] This patchset got some attention in the PostGIS development channel, as it is important to really

Re: Allow root ownership of client certificate key

2022-01-18 Thread Tom Lane
David Steele writes: > [ client-key-perm-002.patch ] I took a quick look at this and agree with the proposed behavior change, but also with your self-criticisms: > We may want to do the same on the server side to make the code blocks > look more similar. > > Also, on the server side the

Re: [PATCH] reduce page overlap of GiST indexes built using sorted method

2022-01-18 Thread sergei sh.
Hi, I've addressed Andrey Borodin's concerns about v2 of this patch by Aliaksandr Kalenik in attached version. Change list: * Number of pages to collect moved to GUC parameter "gist_sorted_build_page_buffer_size". * GistSortedBuildPageState type renamed to GistSortedBuildLevelState. *

Re: [PATCH] allow src/tools/msvc/clean.bat script to be called from the root of the source tree

2022-01-18 Thread Juan José Santamaría Flecha
On Tue, Jan 18, 2022 at 5:49 PM Andrew Dunstan wrote: > > On 1/18/22 04:41, Juan José Santamaría Flecha wrote: > > In [1] capacity for $SUBJECT was added to most of the batch scripts, > > but clean.bat was not included. I propose to do so with the attached > > patch. > > > That looks a bit ugly.

Re: Push down time-related SQLValue functions to foreign server

2022-01-18 Thread Tom Lane
I wrote: > Alexander Pyhalov writes: >> This means we'll translate something like >> explain select * from t where d > now() - '1 day'::interval; >> to >> select * from t where d > $1; > Right. After thinking about that a bit more, I see that this will result in a major redefinition of what is

Re: O(n) tasks cause lengthy startups and checkpoints

2022-01-18 Thread Bossart, Nathan
On 1/14/22, 11:26 PM, "Bharath Rupireddy" wrote: > On Sat, Jan 15, 2022 at 12:46 AM Bossart, Nathan wrote: >> I'd personally like to avoid creating two code paths for the same >> thing. Are there really cases when this one extra auxiliary process >> would be too many? And if so, how would a

Re: Push down time-related SQLValue functions to foreign server

2022-01-18 Thread Tom Lane
Alexander Pyhalov writes: > Tom Lane писал 2022-01-18 19:53: >> However, before we proceed any further with this patch, I think we >> really ought to stop and think about the question I raised last >> night: why are we building a one-off feature for SQLValueFunction? >> Wouldn't the same

Re: Push down time-related SQLValue functions to foreign server

2022-01-18 Thread Alexander Pyhalov
Tom Lane писал 2022-01-18 19:53: Alexander Pyhalov writes: [ updated patch ] Thanks for updating the patch. (BTW, please attach version numbers to new patch versions, to avoid confusion.) However, before we proceed any further with this patch, I think we really ought to stop and think

Re: Adding CI to our tree

2022-01-18 Thread Andrew Dunstan
On 1/18/22 12:44, Andres Freund wrote: > Hi, > > On 2022-01-18 11:20:08 -0500, Andrew Dunstan wrote: >> Sure, very doable, although we will still need some special logic for >> src/test - there are security implication from running the ssl, ldap and >> kerberos tests by default. See its

Re: Add last commit LSN to pg_last_committed_xact()

2022-01-18 Thread James Coleman
On Tue, Jan 18, 2022 at 1:52 PM Alvaro Herrera wrote: > > On 2022-Jan-18, James Coleman wrote: > > > Reading the code it seems the only usage (besides > > the boolean activation status also stored there) is in > > TransactionIdGetCommitTsData, and the only consumers of that in core > > appear to

Re: refactoring basebackup.c

2022-01-18 Thread Robert Haas
On Tue, Nov 16, 2021 at 4:47 PM Robert Haas wrote: > Here's a new patch set. And here's another one. I've committed the first two patches from the previous set, the second of those just today, and so we're getting down to the meat of the patch set. 0001 adds "server" and "blackhole" as backup

Re: Add last commit LSN to pg_last_committed_xact()

2022-01-18 Thread Alvaro Herrera
On 2022-Jan-18, James Coleman wrote: > Reading the code it seems the only usage (besides > the boolean activation status also stored there) is in > TransactionIdGetCommitTsData, and the only consumers of that in core > appear to be the SQL callable functions to get the latest commit info. > It is

Re: [PATCH] reduce page overlap of GiST indexes built using sorted method

2022-01-18 Thread Andrey Borodin
> 18 янв. 2022 г., в 03:54, Björn Harrtell > написал(а): > > There might be some deep reason in the architecture that I'm unaware of that > could make it difficult to affect the node size but regardless, I believe > there could be a substantial win if node size could be controlled. That's

Re: Removing more vacuumlazy.c special cases, relfrozenxid optimizations

2022-01-18 Thread Peter Geoghegan
On Tue, Jan 18, 2022 at 6:11 AM Robert Haas wrote: > On Tue, Jan 18, 2022 at 12:14 AM Peter Geoghegan wrote: > > I quite clearly said that you'll only get an anti-wraparound VACUUM > > with the patch applied when the only factor that *ever* causes *any* > > autovacuum worker to VACUUM the table

Re: Add last commit LSN to pg_last_committed_xact()

2022-01-18 Thread James Coleman
On Tue, Jan 18, 2022 at 12:50 PM Alvaro Herrera wrote: > > On 2022-Jan-17, James Coleman wrote: > > > I'd be happy to make it a separate GUC, though it seems adding an > > additional atomic access is worse (assuming we can convince ourselves > > putting this into the commit timestamps

Re: [EXTERNAL] Re: PQcancel does not use tcp_user_timeout, connect_timeout and keepalive settings

2022-01-18 Thread Tom Lane
Jelte Fennema writes: > It seems the man page of TCP_USER_TIMEOUT does not align with > reality then. When I use it on my local machine it is effectively used > as a connection timeout too. Huh, I should have thought to try that. I confirm this behavior on RHEL8 (kernel 4.18.0). Not the first

Re: docs: pg_replication_origin_oid() description does not match behaviour

2022-01-18 Thread Bossart, Nathan
On 1/17/22, 5:24 PM, "Michael Paquier" wrote: > On Tue, Jan 18, 2022 at 10:19:41AM +0900, Ian Lawrence Barwick wrote: >> Given that the code has remained unchanged since the function was >> introduced in 9.5, it seems reasonable to change the documentation >> to match the function behaviour

Re: Add last commit LSN to pg_last_committed_xact()

2022-01-18 Thread Alvaro Herrera
On 2022-Jan-17, James Coleman wrote: > I'd be happy to make it a separate GUC, though it seems adding an > additional atomic access is worse (assuming we can convince ourselves > putting this into the commit timestamps infrastructure is acceptable) > given here we're already under a lock. I was

Re: slowest tap tests - split or accelerate?

2022-01-18 Thread Robert Haas
On Mon, Jan 17, 2022 at 2:57 PM Andres Freund wrote: > > pg_basebackup's 010_pg_basebackup.pl looks like it could be split up, > > though. That one, at least to me, looks like people have just kept > > adding semi-related things into the same test file. > > Yea. Here's a patch that splits up

Re: Adding CI to our tree

2022-01-18 Thread Andres Freund
Hi, On 2022-01-18 11:20:08 -0500, Andrew Dunstan wrote: > Sure, very doable, although we will still need some special logic for > src/test - there are security implication from running the ssl, ldap and > kerberos tests by default. See its Makefile. ISTM that we should move the PG_TEST_EXTRA

Re: Per-table storage parameters for TableAM/IndexAM extensions

2022-01-18 Thread Sadhuprasad Patro
On Mon, Jan 17, 2022 at 4:47 PM Jelte Fennema wrote: > > Big +1, this is a great addition! > > I think it would be very useful if there were some tests for this new > feature. Something similar to the tests for storage parameters for > index AMs in src/test/modules/dummy_index_am. > Sure, I will

Re: Replace uses of deprecated Python module distutils.sysconfig

2022-01-18 Thread Tom Lane
Peter Eisentraut writes: > I don't have a clear idea how to fix this in the long run. We would > perhaps need to determine at which points the various platforms had > fixed this issue in their Python installations and select between the > old and the new approach based on that. Seems messy.

Re: Push down time-related SQLValue functions to foreign server

2022-01-18 Thread Tom Lane
Alexander Pyhalov writes: > [ updated patch ] Thanks for updating the patch. (BTW, please attach version numbers to new patch versions, to avoid confusion.) However, before we proceed any further with this patch, I think we really ought to stop and think about the question I raised last night:

Re: [PATCH] allow src/tools/msvc/clean.bat script to be called from the root of the source tree

2022-01-18 Thread Andrew Dunstan
On 1/18/22 04:41, Juan José Santamaría Flecha wrote: > In [1] capacity for $SUBJECT was added to most of the batch scripts, > but clean.bat was not included. I propose to do so with the attached > patch. That looks a bit ugly. How about this (untested) instead? > > By the way, are pgbison.bat

Re: Replace uses of deprecated Python module distutils.sysconfig

2022-01-18 Thread Peter Eisentraut
On 18.01.22 16:24, Tom Lane wrote: Peter Eisentraut writes: Also, considering the failure on prairiedog, I do see now on that the sysconfig module is "New in version 3.2". I had interpreted the fact that it exists in version 2.7 that that

Re: Support for NSS as a libpq TLS backend

2022-01-18 Thread Jacob Champion
On Wed, 2021-12-15 at 23:10 +0100, Daniel Gustafsson wrote: > I've attached a v50 which fixes the issues found by Joshua upthread, as well > as > rebases on top of all the recent SSL and pgcrypto changes. I'm currently tracking down a slot leak. When opening and closing large numbers of NSS

Re: psql - add SHOW_ALL_RESULTS option

2022-01-18 Thread Peter Eisentraut
On 15.01.22 10:00, Fabien COELHO wrote: The reason this test constantly fails on cfbot windows is a use-after-free bug. Indeed! Thanks a lot for the catch and the debug! The ClearOrSaveResult function is quite annoying because it may or may not clear the result as a side effect. Attached

Re: Support for NSS as a libpq TLS backend

2022-01-18 Thread Joshua Brindle
On Tue, Jan 18, 2022 at 7:43 AM Daniel Gustafsson wrote: > > > On 18 Jan 2022, at 07:36, Julien Rouhaud wrote: > > > On Mon, Jan 17, 2022 at 03:09:11PM +0100, Daniel Gustafsson wrote: > >> > >> I must've fat-fingered the "git add -p" for v50 as the fix was in > >> configure.ac > >> but not

Re: Adding CI to our tree

2022-01-18 Thread Andrew Dunstan
On 1/18/22 08:06, Peter Eisentraut wrote: > On 17.01.22 22:13, Andrew Dunstan wrote: >> Well, the logic we use for TAP tests is we run them for the following if >> they have a t subdirectory, subject to configuration settings like >> PG_TEST_EXTRA: >> >>   src/test/bin/* >>   contrib/* >>   

Re: a misbehavior of partition row movement (?)

2022-01-18 Thread Tom Lane
Julien Rouhaud writes: > @@ -133,7 +133,7 @@ > SELECT pg_relation_size('reloptions_test') = 0; > ?column? > -- > - t > + f > (1 row) Some machines have been showing that on HEAD too, so I doubt it's the fault of this patch. That reloptions test isn't stable yet seemingly.

Re: New developer papercut - Makefile references INSTALL

2022-01-18 Thread Tom Lane
Daniel Gustafsson writes: > I plan on applying the attached which address the feedback given. +1 regards, tom lane

Re: Pluggable toaster

2022-01-18 Thread Tomas Vondra
On 1/18/22 15:56, Teodor Sigaev wrote: > Hi! > >> Maybe doing that kind of compression in TOAST is somehow simpler, but >> I don't see it. > Seems, in ideal world, compression should be inside toaster. > I'm not convinced that's universally true. Yes, I'm sure certain TOAST implementations

Re: New developer papercut - Makefile references INSTALL

2022-01-18 Thread Peter Eisentraut
On 18.01.22 16:51, Daniel Gustafsson wrote: On 17 Jan 2022, at 13:26, Daniel Gustafsson wrote: On 17 Jan 2022, at 11:25, Magnus Hagander wrote: That said, I'm not sure we're actually gaining anything by *not* referring to the website as well. TBH, I bet the majority of users will

Re: New developer papercut - Makefile references INSTALL

2022-01-18 Thread Daniel Gustafsson
> On 17 Jan 2022, at 13:26, Daniel Gustafsson wrote: > >> On 17 Jan 2022, at 11:25, Magnus Hagander wrote: > >> That said, I'm not sure we're actually gaining anything by *not* >> referring to the website as well. TBH, I bet the majority of users >> will actually prefer to read them there. So

Re: 32TB relation size make mdnblocks overflow

2022-01-18 Thread 陈佳昕(步真)
​I think we must meet some corner cases about our storage. The relation has 32TB blocks, so 'mdnblocks' gets the unexpected value, we will check it again. Thanks a lot.

Re: [Proposal] Add foreign-server health checks infrastructure

2022-01-18 Thread Fujii Masao
On 2021/12/15 15:40, kuroda.hay...@fujitsu.com wrote: Yeah, remote-checking timeout will be enable even ifa local transaction is opened. In my understanding, postgres cannot distinguish whether opening transactions are using only local object or not. My first idea was that turning on the

Re: In-placre persistance change of a relation

2022-01-18 Thread Tom Lane
Julien Rouhaud writes: > The cfbot is failing on all OS with this version of the patch. Apparently > v16-0002 introduces some usage of "testtablespace" client-side variable that's > never defined, e.g. That test infrastructure got rearranged very recently, see d6d317dbf.

Re: 32TB relation size make mdnblocks overflow

2022-01-18 Thread Tom Lane
Julien Rouhaud writes: > On Tue, Jan 18, 2022 at 02:21:14PM +0800, 陈佳昕(步真) wrote: >> We know that PostgreSQL doesn't support a single relation size over 32TB, >> limited by the MaxBlockNumber. But if we just 'insert into' one relation over >> 32TB, it will get an error message 'unexpected data

Re: Replace uses of deprecated Python module distutils.sysconfig

2022-01-18 Thread Tom Lane
Peter Eisentraut writes: > Also, considering the failure on prairiedog, I do see now on > that the sysconfig > module is "New in version 3.2". I had interpreted the fact that it > exists in version 2.7 that that includes all higher versions,

Re: [PATCH] Add reloption for views to enable RLS

2022-01-18 Thread Christoph Heiss
Hi Laurenz, thanks for the review! I've attached a v2 where I addressed the things you mentioned. On 1/11/22 19:59, Laurenz Albe wrote: [..] You made that an enum with only a single value. What other values could you imagine in the future? I think that this should be a boolean reloption, for

Re: Refactoring of compression options in pg_basebackup

2022-01-18 Thread Robert Haas
On Mon, Jan 17, 2022 at 8:36 PM Michael Paquier wrote: > On Mon, Jan 17, 2022 at 12:48:12PM -0500, Robert Haas wrote: > > Alvaro's proposal is fine with me. I don't see any value in replacing > > --compress with --compression. It's longer but not superior in any way > > that I can see. Having

Re: Add last commit LSN to pg_last_committed_xact()

2022-01-18 Thread Robert Haas
On Tue, Jan 18, 2022 at 9:47 AM James Coleman wrote: > > Well, if you're maintaining an SLRU, you do kind of need to know where > > the leading and lagging ends are. > > As far as I can tell the data in commitTsShared is used purely as an > optimization for the path looking up the timestamp for

Re: Pluggable toaster

2022-01-18 Thread Teodor Sigaev
Hi! Maybe doing that kind of compression in TOAST is somehow simpler, but I don't see it. Seems, in ideal world, compression should be inside toaster. 2 Current toast storage stores chunks in heap accesses method and to provide fast access by toast id it makes an index. Ideas:    - store

Re: generic plans and "initial" pruning

2022-01-18 Thread Robert Haas
On Tue, Jan 18, 2022 at 3:10 AM Amit Langote wrote: > Pursuing that kind of a project would perhaps have been more > worthwhile if the locking issue had affected more than just this > particular case, that is, the case of running prepared statements over > partitioned tables using generic plans.

Re: Add last commit LSN to pg_last_committed_xact()

2022-01-18 Thread James Coleman
On Tue, Jan 18, 2022 at 9:25 AM Robert Haas wrote: > > On Mon, Jan 17, 2022 at 8:39 PM James Coleman wrote: > > I wondered about that, but commit_ts already does more than commit > > timestamps by recording the xid of the last commit. > > Well, if you're maintaining an SLRU, you do kind of need

  1   2   >