Re: [BUG] Panic due to incorrect missingContrecPtr after promotion

2022-02-22 Thread Alvaro Herrera
On 2022-Feb-22, Imseih (AWS), Sami wrote: > On 13.5 a wal flush PANIC is encountered after a standby is promoted. > > With debugging, it was found that when a standby skips a missing > continuation record on recovery, the missingContrecPtr is not > invalidated after the record is skipped. Therefo

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

2022-02-23 Thread Alvaro Herrera
I think the change to ImmediateCheckpointRequested() makes no sense. Before this patch, that function merely inquires whether there's an immediate checkpoint queued. After this patch, it ... changes a progress-reporting flag? I think it would make more sense to make the progress-report flag chang

Re: convert libpq uri-regress tests to tap test

2022-02-23 Thread Alvaro Herrera
On 2022-Feb-23, Andres Freund wrote: > When verifying that the meson port actually runs all perl based tests I came > across src/interfaces/libpq/test/regress.pl. Instead of running tests yet > another way, it seems better to convert it to a tap test. > > I hope others agree? WFM. > Perhaps we

Re: convert libpq uri-regress tests to tap test

2022-02-23 Thread Alvaro Herrera
On 2022-Feb-23, Andres Freund wrote: > Separately: I don't really understand why we do the whole if USE_PGXS dance in > src/test/modules? Yeah, it seems a bit silly. I'm not opposed to making these makefiles unconditionally do the PGXS thing -- or the non-PGXS thing, if that makes it easier to b

Re: Add id's to various elements in protocol.sgml

2022-02-24 Thread Alvaro Herrera
On 2022-Feb-24, Dagfinn Ilmari Mannsåker wrote: > Peter Eisentraut writes: > > Is there a way to obtain those URLs other than going into the HTML > > sources and checking if there is an anchor near where you want go? > > I use the jump-to-anchor extension: https://github.com/brettz9/jump-to-anc

Re: support for MERGE

2022-02-27 Thread Alvaro Herrera
On 2022-Jan-28, Andres Freund wrote: > Any chance you could split this into something more reviewable? The overall > diff stats are: 102 files changed, 8589 insertions(+), 234 deletions(-) thats > pretty hard to really review. Incremental commits don't realy help with that. I'll work on splitting

Re: support for MERGE

2022-03-12 Thread Alvaro Herrera
FYI I intend to get the ModifyTable split patch (0001+0003) pushed hopefully on Tuesday or Wednesday next week, unless something really ugly is found on it. As for MERGE proper, I'm aiming at getting that one pushed on the week starting March 21st, though of course I'll spend some more time on it

Re: Support logical replication of DDLs

2022-03-16 Thread Alvaro Herrera
Hello I think this is a pretty interesting and useful feature. Did you see some old code I wrote towards this goal? https://www.postgresql.org/message-id/20150215044814.gl3...@alvh.no-ip.org The intention was that DDL would produce some JSON blob that accurately describes the DDL that was run; th

Re: support for MERGE

2022-03-17 Thread Alvaro Herrera
On 2022-Mar-17, Alvaro Herrera wrote: > I'll see what to do about Instrumentation->nfiltered{1,2,3} that was > complained about by Andres upthread. Maybe some additional macros will > help. This turns out not to be as simple as I expected, mostly because we want to keep Ins

Re: a misbehavior of partition row movement (?)

2022-03-18 Thread Alvaro Herrera
nterpriseDB.com/ "World domination is proceeding according to plan"(Andrew Morton) >From 345ed49718708d8ebde9e2dcf06bf963190bc5c8 Mon Sep 17 00:00:00 2001 From: Alvaro Herrera Date: Fri, 18 Mar 2022 11:01:24 +0100 Subject: [PATCH v15] Enforce foreign key correctly during cross

Re: support for MERGE

2022-03-19 Thread Alvaro Herrera
On 2022-Mar-10, Simon Riggs wrote: > Duplicate rows should produce a uniqueness violation error in one of > the transactions, assuming there is a constraint to define the > conflict. Without such a constraint there is no conflict. > > Concurrent inserts are checked by merge-insert-update.spec, wh

Re: a misbehavior of partition row movement (?)

2022-03-19 Thread Alvaro Herrera
39°49'30"S 73°17'W — https://www.EnterpriseDB.com/ "It takes less than 2 seconds to get to 78% complete; that's a good sign. A few seconds later it's at 90%, but it seems to have stuck there. Did somebody make percentages logarithmic while I wasn't l

Re: a misbehavior of partition row movement (?)

2022-03-20 Thread Alvaro Herrera
On 2022-Mar-20, Amit Langote wrote: > On Sun, Mar 20, 2022 at 5:13 AM Alvaro Herrera > wrote: > > On 2022-Mar-18, Zhihong Yu wrote: > > > + if (!partRel->rd_rel->relispartition) > > > + elog(ERROR, "cannot find ancestors of a non-partition resu

Re: standby recovery fails (tablespace related) (tentative patch and discussion)

2022-03-21 Thread Alvaro Herrera
On 2022-Mar-04, Michael Paquier wrote: > d6d317d as solved the issue of tablespace paths across multiple nodes > with the new GUC called allow_in_place_tablespaces, and is getting > successfully used in the recovery tests as of 027_stream_regress.pl. OK, but that means that the test suite is now

Re: Column Filtering in Logical Replication

2022-03-21 Thread Alvaro Herrera
Hello, Please add me to the list of authors of this patch. I made a large number of nontrivial changes to it early on. Thanks. I have modified the entry in the CF app (which sorts alphabetically, it was not my intention to put my name first.) -- Álvaro Herrera PostgreSQL Developer —

Re: standby recovery fails (tablespace related) (tentative patch and discussion)

2022-03-21 Thread Alvaro Herrera
ally, I made the TAP test search the WARNING line in the log. -- Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/ "No tengo por qué estar de acuerdo con lo que pienso" (Carlos Caszeli) >From 6a6fc73a93768a44ec026720c115f77c67d5

Re: standby recovery fails (tablespace related) (tentative patch and discussion)

2022-03-21 Thread Alvaro Herrera
On 2022-Mar-14, Robert Haas wrote: > 2. Why not instead change the code so that the operation can succeed, > by creating the prerequisite parent directories? Do we not have enough > information for that? I'm not saying that we definitely should do it > that way rather than this way, but I think we

Re: LogwrtResult contended spinlock

2022-03-22 Thread Alvaro Herrera
B.com/ "El miedo atento y previsor es la madre de la seguridad" (E. Burke) >From 4d5a8d915b497b79bbe62e18352f7b9d8c1b9bca Mon Sep 17 00:00:00 2001 From: Alvaro Herrera Date: Tue, 2 Feb 2021 14:03:43 -0300 Subject: [PATCH v6 1/2] Change XLogCtl->LogwrtResult to use atomic ops MIME-Vers

Re: SQL/JSON: JSON_TABLE

2022-03-22 Thread Alvaro Herrera
On 2022-Mar-22, Andrew Dunstan wrote: > I'm planning on pushing the functions patch set this week and json-table > next week. I think it'd be a good idea to push the patches one by one and let a day between each. That would make it easier to chase buildfarm issues individually, and make sure the

Re: LogwrtResult contended spinlock

2022-03-22 Thread Alvaro Herrera
pke, Krup you! (West Side Story, "Gee, Officer Krupke") >From dd9b53878faeedba921ea7027e98ddbb433e8647 Mon Sep 17 00:00:00 2001 From: Alvaro Herrera Date: Tue, 2 Feb 2021 14:03:43 -0300 Subject: [PATCH v7 1/3] Change XLogCtl->LogwrtResult to use atomic ops MIME-Version: 1.0 Content-Type: text/plain; charse

Re: LogwrtResult contended spinlock

2022-03-22 Thread Alvaro Herrera
So I've been wondering about this block at the bottom of XLogWrite: /* * Make sure that the shared 'request' values do not fall behind the * 'result' values. This is not absolutely essential, but it saves some * code in a couple of places. */ {

Re: Column Filtering in Logical Replication

2022-03-22 Thread Alvaro Herrera
On 2022-Mar-19, Tomas Vondra wrote: > @@ -174,7 +182,13 @@ ALTER PUBLICATION noinsert SET (publish = 'update, > delete'); > > Add some tables to the publication: > > -ALTER PUBLICATION mypublication ADD TABLE users, departments; > +ALTER PUBLICATION mypublication ADD TABLE users (user_i

Re: ExecRTCheckPerms() and many prunable partitions

2022-03-23 Thread Alvaro Herrera
On 2022-Mar-23, Amit Langote wrote: > As the changes being made with the patch are non-trivial and the patch > hasn't been reviewed very significantly since Alvaro's comments back > in Sept 2021 which I've since addressed, I'm thinking of pushing this > one into the version 16 dev cycle. Let's no

Re: Column Filtering in Logical Replication

2022-03-23 Thread Alvaro Herrera
On 2022-Mar-23, Amit Kapila wrote: > On Wed, Mar 23, 2022 at 12:54 AM Alvaro Herrera > wrote: > > > > On 2022-Mar-19, Tomas Vondra wrote: > > > > > @@ -174,7 +182,13 @@ ALTER PUBLICATION noinsert SET (publish = 'update, > > > delete'); &g

Re: prevent immature WAL streaming

2022-03-23 Thread Alvaro Herrera
On 2021-Sep-03, Alvaro Herrera wrote: > The last commit is something I noticed in pg_rewind ... I had missed this one; it's pushed now. -- Álvaro HerreraBreisgau, Deutschland — https://www.EnterpriseDB.com/ "I can see support will not be a problem. 10 out of 10."

Re: [DOC] Document concurrent index builds waiting on each other

2020-11-30 Thread Alvaro Herrera
stead. I'm not sure on the wording to use; what about this? >From 6c9ad72e4e61dbf05f34146cb67706dd675a38f0 Mon Sep 17 00:00:00 2001 From: Alvaro Herrera Date: Mon, 30 Nov 2020 18:50:06 -0300 Subject: [PATCH v5] Note CIC and RC in vacuum's doc Per James Coleman --- doc/src/sgml/main

Re: runtime error copying oids field

2020-11-30 Thread Alvaro Herrera
On 2020-Nov-30, Zhihong Yu wrote: > This was the line runtime error was raised: > > memcpy(part_oids, partdesc->oids, sizeof(Oid) * nparts); > > From RelationBuildPartitionDesc we can see that: > > if (nparts > 0) > { > PartitionBoundInfo boundinfo; >

Re: error_severity of brin work item

2020-11-30 Thread Alvaro Herrera
The more I look at this, the less I like it. This would set a precedent that any action that can be initiated from an autovac work-item has a requirement of silently being discarded when it referenced a non-existant relation. I'd rather have the code that drops the index go through the list of wo

Re: Huge memory consumption on partitioned table with FKs

2020-11-30 Thread Alvaro Herrera
On 2020-Nov-26, Kyotaro Horiguchi wrote: > This shares RI_ConstraintInfo cache by constraints that shares the > same parent constraints. But you forgot that the cache contains some > members that can differ among partitions. > > Consider the case of attaching a partition that have experienced a >

Re: runtime error copying oids field

2020-12-01 Thread Alvaro Herrera
On 2020-Nov-30, Zhihong Yu wrote: > Alvaro, et al: > Please let me know how to proceed with the patch. > > Running test suite with the patch showed no regression. That's good to hear. I'll get it pushed today. Thanks for following up.

Re: error_severity of brin work item

2020-12-01 Thread Alvaro Herrera
On 2020-Nov-30, Justin Pryzby wrote: > On Mon, Nov 30, 2020 at 08:47:32PM -0300, Alvaro Herrera wrote: > > The more I look at this, the less I like it. This would set a precedent > > that any action that can be initiated from an autovac work-item has a > > requirement of sil

Re: runtime error copying oids field

2020-12-01 Thread Alvaro Herrera
On 2020-Dec-01, Alvaro Herrera wrote: > On 2020-Nov-30, Zhihong Yu wrote: > > > Alvaro, et al: > > Please let me know how to proceed with the patch. > > > > Running test suite with the patch showed no regression. > > That's good to hear. I'll g

Re: ALTER TABLE .. DETACH PARTITION CONCURRENTLY

2020-12-01 Thread Alvaro Herrera
Hi Justin, Thanks for all the comments. I'll incorporate everything and submit an updated version later. On 2020-Nov-30, Justin Pryzby wrote: > On Tue, Nov 03, 2020 at 08:56:06PM -0300, Alvaro Herrera wrote: > > +++ b/src/bin/psql/describe.c > > - print

Re: error_severity of brin work item

2020-12-01 Thread Alvaro Herrera
On 2020-Dec-01, Justin Pryzby wrote: > This was an idea I made up - I don't know any of the details of this, but if > you give a hint I could look at it more. There'd (still) be a race window, > but > I think that's ok. See CommitTransaction() and friends, where AtEOXact_on_commit_actions() and

Re: room for improvement in amcheck btree checking?

2020-12-01 Thread Alvaro Herrera
On 2020-Dec-01, Mark Dilger wrote: > 7) Run a SQL query that uses an index scan on the table and see that it > errors with something like: > >ERROR: could not read block 0 in file "base/13097/16391": read only 0 of > 8192 bytes > > I found it surprising that even when precisely zero of th

Re: [DOC] Document concurrent index builds waiting on each other

2020-12-01 Thread Alvaro Herrera
On 2020-Nov-30, James Coleman wrote: > On Mon, Nov 30, 2020 at 4:53 PM Alvaro Herrera > wrote: > > > > On 2020-Sep-30, Michael Paquier wrote: > > Yeah, I think it might be more sensible to document this in > > maintenance.sgml, as part of the paragraph that dis

Re: wrong link in acronyms.sgml

2020-12-02 Thread Alvaro Herrera
On 2020-Dec-02, Erik Rijkers wrote: > Hi > > I just noticed that in > > https://www.postgresql.org/docs/13/acronyms.html > (i.e., doc/src/sgml/acronyms.sgml) > > there is under lemma 'HOT' a link with URL: > > https://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f=src/backend/acces

Re: convert elog(LOG) calls to ereport

2020-12-02 Thread Alvaro Herrera
On 2020-Dec-02, Peter Eisentraut wrote: > There are a number of elog(LOG) calls that appear to be user-facing, so they > should be ereport()s. This patch changes them. There are more elog(LOG) > calls remaining, but they all appear to be some kind of debugging support. > Also, I changed a few el

Re: Huge memory consumption on partitioned table with FKs

2020-12-03 Thread Alvaro Herrera
Hello I haven't followed this thread's latest posts, but I'm unclear on the lifetime of the new struct that's being allocated in TopMemoryContext. At what point are those structs freed? Also, the comment that was in RI_ConstraintInfo now appears in RI_ConstraintParam, and the new struct (RI_Const

Re: Autovacuum on partitioned table (autoanalyze)

2020-12-03 Thread Alvaro Herrera
Hello Yuzuko, On 2020-Dec-02, yuzuko wrote: > The problem Horiguchi-san mentioned is as follows: > [explanation] Hmm, I see. So the problem is that if some ancestor is analyzed first, then analyze of one of its partition will cause a redundant analyze of the ancestor, because the number of tupl

Re: {CREATE INDEX, REINDEX} CONCURRENTLY improvements

2020-12-04 Thread Alvaro Herrera
On 2020-Dec-04, Dmitry Dolgov wrote: > * This one is mostly for me to understand. There are couple of places > with a commentary that 'PROC_IN_SAFE_IC is not necessary, because the > transaction only takes a snapshot to do some catalog manipulation'. > But for some of them I don't immediatel

Re: walsender bug: stuck during shutdown

2020-12-04 Thread Alvaro Herrera
On 2020-Nov-26, Fujii Masao wrote: > Yes, so the problem here is that walsender goes into the busy loop > in that case. Seems this happens only in logical replication walsender. > In physical replication walsender, WaitLatchOrSocket() in WalSndLoop() > seems to work as expected and prevent it from

Re: POC: Better infrastructure for automated testing of concurrency issues

2020-12-04 Thread Alvaro Herrera
On 2020-Nov-25, Alexander Korotkov wrote: > In the view of above, I'd like to propose a POC patch, which implements new > builtin infrastructure for reproduction of concurrency issues in automated > test suites. The general idea is so-called "stop events", which are > special places in the code,

Re: Improper use about DatumGetInt32

2020-12-04 Thread Alvaro Herrera
On 2020-Dec-03, Peter Eisentraut wrote: > On 2020-11-30 16:32, Alvaro Herrera wrote: > > On 2020-Nov-30, Peter Eisentraut wrote: > > > > > Patch updated this way. I agree it's better that way. > > > > Thanks, LGTM. > > For a change like this, d

Re: Allow CLUSTER, VACUUM FULL and REINDEX to change tablespace on the fly

2020-12-04 Thread Alvaro Herrera
On 2020-Dec-04, Michael Paquier wrote: > VacuumOption does that since 6776142, and ClusterOption since 9ebe057, > so switching ReindexOption to just match the two others still looks > like the most consistent move. 9ebe057 goes to show why this is a bad idea, since it has this: +typedef enum Clu

Re: A few new options for CHECKPOINT

2020-12-04 Thread Alvaro Herrera
On the UI of this patch, you're proposing to add the option FAST. I'm not a fan of this option name and propose that (if we have it) we use the name SPREAD instead (defaults to false). Now we don't actually explain the term "spread" much in the documentation; we just say "the writes are spread".

Re: Removal of operator_precedence_warning

2020-12-04 Thread Alvaro Herrera
On 2020-Dec-04, Tom Lane wrote: > I think it's time for $SUBJECT. We added this GUC in 9.5, which > will be EOL by the time of our next major release, and it was never > meant as more than a transitional aid. Moreover, it's been buggy > as heck (cf abb164655, 05104f693, 01e0cbc4f, 4cae471d1), an

Re: A few new options for CHECKPOINT

2020-12-04 Thread Alvaro Herrera
On 2020-Dec-04, Bossart, Nathan wrote: > On 12/4/20, 1:47 PM, "Alvaro Herrera" wrote: > > On the UI of this patch, you're proposing to add the option FAST. I'm > > not a fan of this option name and propose that (if we have it) we use > > the name SPREAD

Re: Change definitions of bitmap flags to bit-shifting style

2020-12-05 Thread Alvaro Herrera
On 2020-Dec-05, Tom Lane wrote: > FWIW, personally I'd vote for doing the exact opposite. When you are > debugging and examining the contents of a bitmask variable, it's easier to > correlate a value like "0x03" with definitions made in the former style. > Or at least I think so; maybe others see

Re: A few new options for CHECKPOINT

2020-12-05 Thread Alvaro Herrera
On 2020-Dec-05, Stephen Frost wrote: > So- just to be clear, CHECKPOINTs are more-or-less always happening in > PG, and running this command might do something or might end up doing > nothing depending on if a checkpoint is already in progress and this > request just gets consolidated into an exis

Re: Huge memory consumption on partitioned table with FKs

2020-12-07 Thread Alvaro Herrera
On 2020-Dec-07, Amit Langote wrote: > On Fri, Dec 4, 2020 at 12:05 PM Kyotaro Horiguchi > wrote: > > > Also, the comment that was in RI_ConstraintInfo now appears in > > > RI_ConstraintParam, and the new struct (RI_ConstraintInfo) is now > > > undocumented. What is the relationship between those

Re: [bug fix] ALTER TABLE SET LOGGED/UNLOGGED on a partitioned table does nothing silently

2020-12-07 Thread Alvaro Herrera
Does "ALTER TABLE ONLY parent" work correctly? Namely, do not affect existing partitions, but cause future partitions to acquire the new setting. This sounds very much related to previous discussion on REPLICA IDENTITY not propagating to partitions; see https://postgr.es/m/201902041630.gpadougzab

Re: Commitfest statistics

2020-12-07 Thread Alvaro Herrera
On 2020-Dec-07, Tom Lane wrote: > Anastasia Lubennikova writes: > > Firstly, we use it to track patches that we want to see in the nearest > > releases and concentrate our efforts on. And current CFM guideline [1] > > reflects this idea. It suggests, that after the commitfest closure date > >

Re: range_agg

2020-12-07 Thread Alvaro Herrera
On 2020-Dec-08, Alexander Korotkov wrote: > I also found a problem in multirange types naming logic. Consider the > following example. > > create type a_multirange AS (x float, y float); > create type a as range(subtype=text, collation="C"); > create table tbl (x __a_multirange); > drop type a_m

Re: [bug fix] ALTER TABLE SET LOGGED/UNLOGGED on a partitioned table does nothing silently

2020-12-08 Thread Alvaro Herrera
On 2020-Dec-08, tsunakawa.ta...@fujitsu.com wrote: > From: Alvaro Herrera > > Does "ALTER TABLE ONLY parent" work correctly? Namely, do not affect > > existing partitions, but cause future partitions to acquire the new > > setting. > > Yes, it works correct

Re: [bug fix] ALTER TABLE SET LOGGED/UNLOGGED on a partitioned table does nothing silently

2020-12-09 Thread Alvaro Herrera
On 2020-Dec-09, tsunakawa.ta...@fujitsu.com wrote: > From: Alvaro Herrera > > But what happens when you create another partition after you change the > > "loggedness" of the partitioned table? > > The new partition will have a property specified when the user cr

Re: [bug fix] ALTER TABLE SET LOGGED/UNLOGGED on a partitioned table does nothing silently

2020-12-09 Thread Alvaro Herrera
On 2020-Dec-09, Bharath Rupireddy wrote: > I'm not sure how many more of such commands exist which require changes. The other thread has a list. I think it is complete, but if you want to double-check, that would be helpful. > How about doing it this way? > > 1) Have a separate common thread l

Re: Change default of checkpoint_completion_target

2020-12-10 Thread Alvaro Herrera
Howdy, On 2020-Dec-10, Stephen Frost wrote: > * Laurenz Albe (laurenz.a...@cybertec.at) wrote: > > On Tue, 2020-12-08 at 17:29 +, Bossart, Nathan wrote: > > > +1 to setting checkpoint_completion_target to 0.9 by default. > > > > +1 for changing the default or getting rid of it, as Tom sugges

Re: Allow CLUSTER, VACUUM FULL and REINDEX to change tablespace on the fly

2020-12-11 Thread Alvaro Herrera
By the way-- What did you think of the idea of explictly marking the types used for bitmasks using types bits32 and friends, instead of plain int, which is harder to spot?

Re: Allow CLUSTER, VACUUM FULL and REINDEX to change tablespace on the fly

2020-12-15 Thread Alvaro Herrera
On 2020-Dec-12, Peter Eisentraut wrote: > On 2020-12-11 21:27, Alvaro Herrera wrote: > > By the way-- What did you think of the idea of explictly marking the > > types used for bitmasks using types bits32 and friends, instead of plain > > int, which is harder to spot? >

Re: Allow CLUSTER, VACUUM FULL and REINDEX to change tablespace on the fly

2020-12-23 Thread Alvaro Herrera
On 2020-Dec-23, Michael Paquier wrote: > bool > -reindex_relation(Oid relid, int flags, int options) > +reindex_relation(Oid relid, int flags, ReindexOptions *options) > { > Relationrel; > Oid toast_relid; Wait a minute. reindex_relation has 'flags' and

Re: Allow CLUSTER, VACUUM FULL and REINDEX to change tablespace on the fly

2020-12-23 Thread Alvaro Herrera
On 2020-Dec-23, Justin Pryzby wrote: > This was getting ugly: > > extern void reindex_index(Oid indexId, bool skip_constraint_checks, > char relpersistence, int options, Oid > tablespaceOid)Z Is this what I suggested?

Re: list of extended statistics on psql

2021-01-07 Thread Alvaro Herrera
On 2021-Jan-07, Tomas Vondra wrote: > On 1/7/21 1:46 AM, Tatsuro Yamada wrote: > > I overlooked the check for MCV in the logic building query > > because I created the patch as a new feature on PG14. > > I'm not sure whether we should do back patch or not. However, I'll > > add the check on the n

Re: Key management with tests

2021-01-07 Thread Alvaro Herrera
On 2021-Jan-07, Bruce Momjian wrote: > All the tests pass now. The current src/test directory is 19MB, and > adding these tests takes it to 23MB, or a 20% increase. That seems like > a lot. It is testing 128-bit and 256-bit keys --- should we do fewer > tests, or just test 256, or use gzip to c

Re: ALTER TABLE .. DETACH PARTITION CONCURRENTLY

2021-01-08 Thread Alvaro Herrera
On 2020-Dec-01, Alvaro Herrera wrote: > On 2020-Nov-30, Justin Pryzby wrote: > Thanks for all the comments. I'll incorporate everything and submit an > updated version later. Here's a rebased version 5, with the typos fixed. More comments below. > > The attname &

Re: A failure of standby to follow timeline switch

2021-01-08 Thread Alvaro Herrera
Masao-san: Are you intending to act as committer for these? Since the bug is mine I can look into it, but since you already did all the reviewing work, I'm good with you giving it the final push. 0001 looks good to me; let's get that one committed quickly so that we can focus on the interesting s

Re: PATCH: Batch/pipelining support for libpq

2021-02-16 Thread Alvaro Herrera
On 2021-Feb-16, Craig Ringer wrote: > FWIW I'm also thinking of revising the docs to mostly use the term > "pipeline" instead of "batch". Use "pipelining and batching" in the chapter > topic, and mention "batch" in the index, and add a para that explains how > to run batches on top of pipelining,

Re: PATCH: Batch/pipelining support for libpq

2021-02-16 Thread Alvaro Herrera
Here's a new version, where I've renamed everything to "pipeline". I think the docs could use some additional tweaks now in order to make a coherent story on pipeline mode, how it can be used in a batched fashion, etc. Here's the renames I applied. It's mostly mechanical, except PQbatchSendQueue

Re: PATCH: Batch/pipelining support for libpq

2021-02-19 Thread Alvaro Herrera
Hello, thanks for looking at this patch. On 2021-Feb-16, Zhihong Yu wrote: > + if (querymode == QUERY_SIMPLE) > + { > + commandFailed(st, "startpipeline", "cannot use pipeline mode > with the simple query protocol"); > + st->state = CSTATE_ABORTED; > + re

Re: PATCH: Batch/pipelining support for libpq

2021-02-19 Thread Alvaro Herrera
On 2021-Jan-21, Zhihong Yu wrote: > It seems '\\gset or \\aset is not ' would correspond to the check more > closely. > > + if (my_command->argc != 1) > + syntax_error(source, lineno, my_command->first_line, > my_command->argv[0], > > It is possible that my_command->argc == 0 (wh

Re: PATCH: Batch/pipelining support for libpq

2021-02-19 Thread Alvaro Herrera
Hi, On 2021-Feb-19, Zhihong Yu wrote: > Hi, > +static int pqBatchProcessQueue(PGconn *conn); > > I was suggesting changing: > > +int > +PQexitBatchMode(PGconn *conn) > > to: > > +static int > +PQexitBatchMode(PGconn *conn) I understand that, but what I'm saying is that it doesn't work. pqBat

Re: PATCH: Batch/pipelining support for libpq

2021-02-19 Thread Alvaro Herrera
On 2021-Feb-20, Craig Ringer wrote: > On Wed, 17 Feb 2021, 07:13 Alvaro Herrera, wrote: > > I > > think the docs could use some additional tweaks now in order to make a > > coherent story on pipeline mode, how it can be used in a batched > > fashion, etc. > &

Re: Printing page request trace from buffer manager

2021-02-20 Thread Alvaro Herrera
On 2020-Dec-08, Irodotos Terpizis wrote: > Initially, I modified the code within the BufferAlloc method in the > bufmgr.c file, > to log the pages that were requested and were already in the cache, > the pages that were evicted and the pages that > replaced them. However, I feel that this might no

Re: Bizarre behavior of \w in a regular expression bracket construct

2021-02-21 Thread Alvaro Herrera
On 2021-Feb-21, Joel Jacobson wrote: >regex| engine |deduced_ranges > ++--- > ^([a-z])$ | pg | [a-z] > ^([a-z])$ | pl | [a-z] > ^([a-z])$ | v8 | [a-z] > ^([\d-a])$ | pg | > ^([\d-a])$ | pl | [-0-9a] > ^([\d-a])$

Re: Faulty HEAP_XMAX_LOCK_ONLY & HEAP_KEYS_UPDATED hintbit combination

2021-02-23 Thread Alvaro Herrera
On 2021-Feb-05, Julien Rouhaud wrote: > Thanks, that's way better, copied in v3. Thank you, pushed. The code changes are only relevant in master, but I did back-patch the README.tuplock to all live branches. > I'm still a bit worried about that description though, as that flag > isn't consisten

Re: Fix typo about generate_gather_paths

2021-02-23 Thread Alvaro Herrera
On 2020-Dec-22, Tomas Vondra wrote: > Thanks. I started looking at this a bit more closely, and I think most of > the changes are fine - the code was changed to call a different function, > but the comments still reference generate_gather_paths(). Hi, this was forgotten. It seemed better to fix

Re: Bizarre behavior of \w in a regular expression bracket construct

2021-02-24 Thread Alvaro Herrera
On 2021-Feb-23, Tom Lane wrote: > * Create infrastructure to allow treating \w as a character class > in its own right. (I did not expose [[:word:]] as a class name, > though it would be a little more symmetric to do so; should we?) Apparently [:word:] is a GNU extension (or at least a "bash-spe

Re: [PATCH] pgbench: Remove ecnt, a member variable of CState

2021-02-26 Thread Alvaro Herrera
On 2021-Feb-26, Michael Paquier wrote: > On Fri, Feb 26, 2021 at 05:39:31PM +0900, miyake_kouta wrote: > > Also, the current pgbench's client abandons processing after hitting error, > > so this variable is no need, I think. > > Agreed. Its last use was in 12788ae, as far as I can see. So let's

Re: ALTER TABLE .. DETACH PARTITION CONCURRENTLY

2021-02-26 Thread Alvaro Herrera
On 2021-Jan-10, Justin Pryzby wrote: > On Fri, Jan 08, 2021 at 04:14:33PM -0300, Alvaro Herrera wrote: > > > > I ended up with apparently broken constraint when running multiple > > > > loops around > > > > a concurrent detach / attach: > > >

Re: [PATCH] Bug fix in initdb output

2021-03-01 Thread Alvaro Herrera
On 2021-Mar-01, Juan José Santamaría Flecha wrote: > On Mon, Mar 1, 2021 at 5:52 AM Nitin Jadhav > wrote: > > > > >> Please share your thoughts on this. If we go ahead with this change, > > then we need to back-patch. I would be happy to create those patches. > > A full path works, even with th

Re: [PATCH] Bug fix in initdb output

2021-03-01 Thread Alvaro Herrera
On 2021-Mar-01, Juan José Santamaría Flecha wrote: > This is not a problem with the APi, but the shell. e.g. when using a CMD: > > - This works: > c:\>c:\Windows\System32\notepad.exe > c:\>c:/Windows/System32/notepad.exe > c:\>/Windows/System32/notepad.exe > > - This doesn't: > c:\>./Windows/Sys

Re: [PATCH] Bug fix in initdb output

2021-03-01 Thread Alvaro Herrera
On 2021-Mar-01, Juan José Santamaría Flecha wrote: > On Mon, Mar 1, 2021 at 7:50 PM Alvaro Herrera > wrote: > > Ah, so another way to fix it would be to make the path to pg_ctl be > > absolute? > > Yes, that's right. If you call initdb with an absolute path you w

Re: [PATCH] Bug fix in initdb output

2021-03-01 Thread Alvaro Herrera
On 2021-Mar-01, Juan José Santamaría Flecha wrote: > Uhm, now that you point it out, an absolute path would make the message > more consistent and reusable. Well. This code was introduced in a00c58314745, with discussion at http://postgr.es/m/CAHeEsBeAe1FeBypT3E8R1ZVZU0e8xv3A-7BHg6bEOi=jzny...@m

Re: [PATCH] Bug fix in initdb output

2021-03-02 Thread Alvaro Herrera
On 2021-Mar-02, Nitin Jadhav wrote: > > FWIW, I don't think that it is a good idea to come back to this > > decision for *nix platforms, so I would let it as-is, and use > > relative paths if initdb is called using a relative path. > > The command to be displayed either in absolute path or relati

Re: WIP: BRIN multi-range indexes

2021-03-02 Thread Alvaro Herrera
On 2021-Mar-03, Tomas Vondra wrote: > 1) The 0001 patch allows passing of all scan keys to BRIN opclasses, > which is needed for the minmax-multi to work. But it also modifies the > existing opclasses (minmax and inclusion) to do this - but for those > opclasses it does not make much difference, I

Re: WIP: BRIN multi-range indexes

2021-03-02 Thread Alvaro Herrera
On 2021-Mar-03, Tomas Vondra wrote: > That's kinda my point - I agree the size of the patch is not the primary > concern, but it makes the minmax/inclusion code a bit more complicated > (because they now have to loop over the keys), with very little benefit > (there might be some speedup, but IMO

Re: Huge memory consumption on partitioned table with FKs

2021-03-03 Thread Alvaro Herrera
On 2021-Mar-03, Amit Langote wrote: > I don't know of any unaddressed comments on the patch, so I've marked > the entry Ready for Committer. Thanks, I'll look at it later this week. -- Álvaro Herrera39°49'30"S 73°17'W #error "Operator lives in the wrong universe" (

Re: PATCH: Batch/pipelining support for libpq

2021-03-03 Thread 'Alvaro Herrera'
On 2021-Mar-03, k.jami...@fujitsu.com wrote: > I tried applying this patch to test it on top of Iwata-san's libpq trace log > [1]. > In my environment, the compiler complains. > It seems that in libpqwalreceiver.c: libpqrcv_exec() > the switch for PQresultStatus needs to handle the > cases for PG

Re: PATCH: Batch/pipelining support for libpq

2021-03-03 Thread 'Alvaro Herrera'
On 2021-Mar-03, 'Alvaro Herrera' wrote: > I'm much more comfortable with this version, so I'm marking the patch as > Ready for Committer in case anybody else wants to look at this before I > push it. Actually, I just noticed a pretty serious problem, which is tha

Re: PATCH: Batch/pipelining support for libpq

2021-03-03 Thread 'Alvaro Herrera'
On 2021-Mar-03, 'Alvaro Herrera' wrote: > This should obviously not occur. I'm trying to figure out how to repair > it and not break everything again ... I think trying to set up the connection state so that the next query appears in conn->last_query prior to PQgetR

Re: PATCH: Batch/pipelining support for libpq

2021-03-03 Thread 'Alvaro Herrera'
On 2021-Mar-03, 'Alvaro Herrera' wrote: > On 2021-Mar-03, 'Alvaro Herrera' wrote: > > > This should obviously not occur. I'm trying to figure out how to repair > > it and not break everything again ... > > I think trying to set up the connecti

Re: make coverage-html would fail within build directory separate from source tree

2021-03-04 Thread Alvaro Herrera
On 2021-Mar-04, walker wrote: > Hi, hackers > > During installation from source code, I created a build directory separate > from the source tree, and execute the following command in the build > directory: > /home/postgres/postgresql-13.2/configure -- enable-coverage > make > make check > make

Re: make coverage-html would fail within build directory separate from source tree

2021-03-04 Thread Alvaro Herrera
On 2021-Mar-04, Alvaro Herrera wrote: > On 2021-Mar-04, walker wrote: > > > Hi, hackers > > > > During installation from source code, I created a build directory separate > > from the source tree, and execute the following command in the build > > directory

Re: make coverage-html would fail within build directory separate from source tree

2021-03-04 Thread Alvaro Herrera
On 2021-Mar-04, walker wrote: > thanks for your reply. it indeed that there are no .gcon files in source tree > directory, they're in build tree directory, which results in failures. > > > That's a bit wired. > > > Add more detailed testing steps: > mkdir build_dir > cd build_dir > /home/post

Re: make coverage-html would fail within build directory separate from source tree

2021-03-04 Thread Alvaro Herrera
On 2021-Mar-04, walker wrote: > The same, the build directory is outside the source tree. > > > the version of lcov is 1.10 That seems *really* ancient. Please try with a fresher version. -- Álvaro Herrera39°49'30"S 73°17'W "How amazing is that? I call it a night

Re: [HACKERS] PATCH: Batch/pipelining support for libpq

2021-03-04 Thread Alvaro Herrera
On 2021-Mar-04, Ibrar Ahmed wrote: > The build is failing for this patch, can you please take a look at this? > > https://cirrus-ci.com/task/4568547922804736 > https://ci.appveyor.com/project/postgresql-cfbot/postgresql/build/1.0.129221 > > > I am marking the patch "Waiting on Author" I don't

Re: [HACKERS] PATCH: Batch/pipelining support for libpq

2021-03-04 Thread Alvaro Herrera
Apparently, the archives system or the commitfest system is not picking up new messages to the thread, so the CF app is trying to apply a very old patch version. I'm not sure what's up with that. Thomas, any clues on where to look? -- Álvaro Herrera Valdivia, Chile "Oh, great altar of pas

Re: [HACKERS] PATCH: Batch/pipelining support for libpq

2021-03-04 Thread Alvaro Herrera
> I think it's just because you forgot the patch. > https://www.postgresql.org/message-id/20210304142627.GA5978%40alvherre.pgsql -- Álvaro Herrera39°49'30"S 73°17'W diff --git a/doc/src/sgml/libpq.sgml b/doc/src/sgml/libpq.sgml index 0553279314..c16befa314 100644 ---

Re: [HACKERS] PATCH: Batch/pipelining support for libpq

2021-03-04 Thread Alvaro Herrera
v30 contains changes to hopefully make it build on MSVC. -- Álvaro Herrera Valdivia, Chile diff --git a/doc/src/sgml/libpq.sgml b/doc/src/sgml/libpq.sgml index 0553279314..c16befa314 100644 --- a/doc/src/sgml/libpq.sgml +++ b/doc/src/sgml/libpq.sgml @@ -3173,6 +3173,33 @@ ExecStatusType PQr

Re: [HACKERS] PATCH: Batch/pipelining support for libpq

2021-03-04 Thread Alvaro Herrera
On 2021-Mar-04, Alvaro Herrera wrote: > v30 contains changes to hopefully make it build on MSVC. Hm, that didn't work -- appveyor still says: Project "C:\projects\postgresql\pgsql.sln" (1) is building "C:\projects\postgresql\pipeline.vcxproj" (75) on node 1 (defau

  1   2   3   4   5   6   7   8   9   10   >