Re: Synchronizing slots from primary to standby

2023-11-21 Thread Peter Smith
In addition to my recent v35-0001 comment not yet addressed [1], here are some review comments for patch v37-0001. == src/backend/replication/walsender.c 1. PhysicalWakeupLogicalWalSnd +/* + * Wake up logical walsenders with failover-enabled slots if the physical slot + * of the current

Re: remaining sql/json patches

2023-11-21 Thread Andres Freund
Hi, On 2023-11-22 15:09:36 +0900, Amit Langote wrote: > OK, I will keep polishing 0001-0003 with the intent to push it next > week barring objections / damning findings. I don't think the patchset is quite there yet. It's definitely getting closer though! I'll try to do another review next

Re: Make mesage at end-of-recovery less scary.

2023-11-21 Thread Kyotaro Horiguchi
Anyway, this requires rebsaing, and done. Thanks for John (Naylor) for pointing this out. regards. -- Kyotaro Horiguchi NTT Open Source Software Center >From e56f1f24523e3e562a4db166dfeaadc79fd7b27a Mon Sep 17 00:00:00 2001 From: Kyotaro Horiguchi Date: Tue, 7 Mar 2023 14:55:58 +0900 Subject:

initdb --no-locale=C doesn't work as specified when the environment is not C

2023-11-21 Thread Kyotaro Horiguchi
Commit 3e51b278db leaves lc_* conf lines as commented-out when their value is "C". This leads to the following behavior. $ echo LANG ja_JP.UTF8 $ initdb --no-locale hoge $ grep lc_ hoge/postgresql.conf #lc_messages = 'C' # locale for system error message #lc_monetary = 'C'

Re: Change GUC hashtable to use simplehash?

2023-11-21 Thread John Naylor
On Wed, Nov 22, 2023 at 12:00 AM Jeff Davis wrote: > > On Tue, 2023-11-21 at 16:42 +0700, John Naylor wrote: > > The strlen call required for hashbytes() is not free. > > Should we have a hash_string() that's like hash_bytes() but checks for > the NUL terminator itself? > > That wouldn't be

Re: WIP: libpq: add a possibility to not send D(escribe) when executing a prepared statement

2023-11-21 Thread Andrey M. Borodin
Hi Ivan, thank you for the patch. > On 22 Nov 2023, at 03:58, Ivan Trofimov wrote: > > Currently libpq sends B(ind), D(escribe), E(execute), S(ync) when executing a > prepared statement. > The response for that D message is a RowDescription, which doesn't change > during prepared > statement

Re: Partial aggregates pushdown

2023-11-21 Thread Alexander Pyhalov
Robert Haas писал 2023-11-21 20:16: > I don't think the patch does a good job explaining why HAVING, > DISTINCT, and ORDER BY are a problem. It seems to me that HAVING > shouldn't really be a problem, because HAVING is basically a WHERE > clause that occurs after aggregation is complete, and

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

2023-11-21 Thread Andrei Lepikhov
Thanks for detaied answer, On 3/11/2023 00:37, Tomas Vondra wrote: On 9/25/23 06:30, Andrey Lepikhov wrote: ... I can't stop thinking about this issue. It is bizarre when Postgres chooses a non-unique index if a unique index gives us proof of minimum scan. That's true, but no one implemented

Re: Schema variables - new implementation for Postgres 15

2023-11-21 Thread Julien Rouhaud
Hi, On Tue, Oct 17, 2023 at 08:52:13AM +0200, Pavel Stehule wrote: > > When I thought about global temporary tables, I got one maybe interesting > idea. The one significant problem of global temporary tables is place for > storing info about size or column statistics. > > I think so these data

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

2023-11-21 Thread Yuya Watari
Hello Alena, Andrei, and all, Thank you for reviewing this patch. I really apologize for not updating this thread for a while. On Sat, Nov 18, 2023 at 6:04 AM Alena Rybakina wrote: > Hi, all! > > While I was reviewing the patches, I noticed that they needed some rebasing, > and in one of the

RE: Synchronizing slots from primary to standby

2023-11-21 Thread Zhijie Hou (Fujitsu)
On Tuesday, November 21, 2023 5:33 PM shveta malik wrote: > > > v37 fails to apply to HEAD due to a recent commit e83aa9f92fdd, rebased the > patches. PFA v37_2 patches. Thanks for updating the patches. I'd like to discuss one issue related to the correct handling of failover flag when

Re: proposal: possibility to read dumped table's name from file

2023-11-21 Thread Erik Rijkers
Op 11/21/23 om 22:10 schreef Daniel Gustafsson: On 20 Nov 2023, at 06:20, Pavel Stehule wrote: The attached is pretty close to a committable patch IMO, review is welcome on both the patch and commit message. I tried to identify all reviewers over the past 3+ years but I might have missed

Re: [HACKERS] Changing references of password encryption to hashing

2023-11-21 Thread Bruce Momjian
Is there any interest in fixing our documentation that says encrypted when it means hashed? Should I pursue this? --- On Fri, Mar 10, 2017 at 11:16:02AM +0900, Michael Paquier wrote: > Hi all, > > As discussed here: >

Re: [PATCH] fix race condition in libpq (related to ssl connections)

2023-11-21 Thread Thomas Munro
On Wed, Nov 22, 2023 at 2:44 PM Michael Paquier wrote: > On Tue, Nov 21, 2023 at 12:14:16PM +0300, Aleksander Alekseev wrote: > > I wonder if we should just document that libpq is thread safe as of PG > > v??? and deprecate PQisthreadsafe() at some point. Currently the > > documentation gives an

Re: [PATCH] fix race condition in libpq (related to ssl connections)

2023-11-21 Thread Michael Paquier
On Tue, Nov 21, 2023 at 12:14:16PM +0300, Aleksander Alekseev wrote: > Please add the patch to the nearest open commit fest [2]. The patch > will be automatically picked up by cfbot [3] and tested on different > platforms. Also this way it will not be lost among other patches. I have noticed that

Re: [PATCH] fix race condition in libpq (related to ssl connections)

2023-11-21 Thread Michael Paquier
On Tue, Nov 21, 2023 at 12:14:16PM +0300, Aleksander Alekseev wrote: Thanks for the report, Willi, and the test case! Thanks Aleksander for the reply. > I wonder if we should just document that libpq is thread safe as of PG > v??? and deprecate PQisthreadsafe() at some point. Currently the >

dblink query interruptibility

2023-11-21 Thread Noah Misch
=== Background Something as simple as the following doesn't respond to cancellation. In v15+, any DROP DATABASE will hang as long as it's running: SELECT dblink_exec( $$dbname='$$||current_database()||$$' port=$$||current_setting('port'), 'SELECT pg_sleep(15)');

Re: pg_upgrade and logical replication

2023-11-21 Thread Peter Smith
Thanks for addressing my past review comments. Here are some more review comments for patch v16-0001 == doc/src/sgml/ref/pgupgrade.sgml 1. + + Create all the new tables that were created in the publication during + upgrade and refresh the publication by executing +

Re: Typo with amtype = 's' in opr_sanity.sql

2023-11-21 Thread Michael Paquier
On Tue, Nov 21, 2023 at 01:02:40PM +0300, Aleksander Alekseev wrote: >> It seems to me that this has been copy-pasted on HEAD from the >> sequence AM patch, but forgot to update amtype to 't'. While that's >> maybe cosmetic, I think that this could lead to unexpected results, so >> perhaps there

Re: [HACKERS] legitimacy of using PG_TRY , PG_CATCH , PG_END_TRY in C function

2023-11-21 Thread Bruce Momjian
On Mon, Oct 23, 2017 at 01:27:43AM -0700, Andres Freund wrote: > On 2017-10-22 23:04:50 -0400, Tom Lane wrote: > > John Lumby writes: > > > I have a C function (a trigger function) which uses the PG_TRY() > > > construct to handle certain ERROR conditions. > > > One example is where invoked as

WIP: libpq: add a possibility to not send D(escribe) when executing a prepared statement

2023-11-21 Thread Ivan Trofimov
Hi! Currently libpq sends B(ind), D(escribe), E(execute), S(ync) when executing a prepared statement. The response for that D message is a RowDescription, which doesn't change during prepared statement lifetime (with the attributes format being an exception, as they aren't know before

Re: common signal handler protection

2023-11-21 Thread Nathan Bossart
On Tue, Nov 21, 2023 at 03:20:08PM -0600, Nathan Bossart wrote: > +#ifdef NSIG > +#define PG_NSIG (NSIG) > +#else > +#define PG_NSIG (64) /* XXX: wild guess */ > +#endif > + Assert(signo < PG_NSIG); cfbot seems unhappy with this on Windows. IIUC we need to use

Re: Changing baserel to foreignrel in postgres_fdw functions

2023-11-21 Thread Bruce Momjian
Should this patch be applied? --- On Thu, Feb 15, 2018 at 06:57:50PM +0530, Ashutosh Bapat wrote: > Hi, > I noticed that functions is_foreign_expr(), classifyConditions() and > appendOrderByClause() had variables/arguments

Re: Remove distprep

2023-11-21 Thread Andrew Dunstan
On 2023-11-21 Tu 13:23, Tom Lane wrote: Alvaro Herrera writes: Hmm, do we still need to have README.git as a separate file from README? Also, looking at README, I see it refers to the INSTALL file in the root, but that doesn't exist. "make -C doc/src/sgml INSTALL" creates it, but it's not

common signal handler protection

2023-11-21 Thread Nathan Bossart
In commit 97550c0, I added a "MyProcPid == getpid()" check in the SIGTERM handler for the startup process. This ensures that processes forked by system(3) (i.e., for restore_command) that have yet to install their own signal handlers do not call proc_exit() upon receiving SIGTERM. Without this

Re: proposal: possibility to read dumped table's name from file

2023-11-21 Thread Daniel Gustafsson
> On 20 Nov 2023, at 06:20, Pavel Stehule wrote: > I was pondering replacing the is_include handling with returning an enum for > the operation, to keep things more future proof in case we add more operations > (and also a bit less magic IMHO). > > +1 > > I did it. Nice, I think it's an

Re: pg_class.reltuples of brin indexes

2023-11-21 Thread Bruce Momjian
On Tue, Mar 27, 2018 at 08:58:11PM +0900, Masahiko Sawada wrote: > Hi, > > I found that pg_class.reltuples of brin indexes can be either the > number of index tuples or the number of heap tuples. > > =# create table test as select generate_series(1,10) as c; > =# create index test_brin on

Re: Partial aggregates pushdown

2023-11-21 Thread Bruce Momjian
On Tue, Nov 21, 2023 at 12:16:41PM -0500, Robert Haas wrote: > On Mon, Nov 20, 2023 at 5:48 PM Bruce Momjian wrote: > > > I do have a concern about this, though. It adds a lot of bloat. It > > > adds a whole lot of additional entries to pg_aggregate, and every new > > > aggregate we add in the

Re: vacuum_cost_limit doc description patch

2023-11-21 Thread Bruce Momjian
On Fri, Apr 13, 2018 at 09:56:18AM -0300, Martín Marqués wrote: > El 11/04/18 a las 02:04, David Rowley escribió: > > On 11 April 2018 at 09:13, Martín Marqués wrote: > >> This is a patch to add some further description, plus the upper and > >> lower limits it has. > > > > Hi, > > > > +

Re: Locks on unlogged tables are locked?!

2023-11-21 Thread Bruce Momjian
On Tue, Nov 21, 2023 at 01:16:19PM -0500, Tom Lane wrote: > Bruce Momjian writes: > > Uh, was this ever addressed? I don't see the patch applied or the code > > in this area modified. > > This patch as-is would surely be disastrous: having LockAcquire > try to open the relcache entry for the

Re: Add recovery to pg_control and remove backup_label

2023-11-21 Thread David Steele
On 11/21/23 16:00, Andres Freund wrote: Hi, On 2023-11-21 14:48:59 -0400, David Steele wrote: I'd not call 7.06->4.77 or 6.76->4.77 "virtually free". OK, but how does that look with compression With compression it's obviously somewhat different - but that part is done in parallel,

Re: Add recovery to pg_control and remove backup_label

2023-11-21 Thread Andres Freund
Hi, On 2023-11-21 14:48:59 -0400, David Steele wrote: > > I'd not call 7.06->4.77 or 6.76->4.77 "virtually free". > > OK, but how does that look with compression With compression it's obviously somewhat different - but that part is done in parallel, potentially on a different machine with

Re: Add recovery to pg_control and remove backup_label

2023-11-21 Thread David Steele
On 11/21/23 13:59, Andres Freund wrote: On 2023-11-21 13:41:15 -0400, David Steele wrote: On 11/20/23 16:41, Andres Freund wrote: On 2023-11-20 15:56:19 -0400, David Steele wrote: I understand this is an option -- but does it need to be? What is the benefit of excluding the manifest? It's

Re: simplehash: SH_OPTIMIZE_REPEAT for optimizing repeated lookups of the same key

2023-11-21 Thread Jeff Davis
On Tue, 2023-11-21 at 08:51 -0800, Andres Freund wrote: > I am not quite sure this kind of cache best lives in simplehash - > ISTM that > quite often it'd be more beneficial to have a cache that you can test > more > cheaply higher up. Yeah. I suppose when a few more callers are likely to benefit

Re: Report planning memory in EXPLAIN ANALYZE

2023-11-21 Thread Alvaro Herrera
I gave this a quick look. I think the usefulness aspect is already established in general terms; the bit I'm not so sure about is whether we want it enabled by default. For many cases it'd just be noise. Perhaps we want it hidden behind something like "EXPLAIN (MEMORY)" or such, particularly

Re: Remove distprep

2023-11-21 Thread Tom Lane
Alvaro Herrera writes: > Hmm, do we still need to have README.git as a separate file from README? > Also, looking at README, I see it refers to the INSTALL file in the > root, but that doesn't exist. "make -C doc/src/sgml INSTALL" creates > it, but it's not copied to the root directory. Do we

Re: Locks on unlogged tables are locked?!

2023-11-21 Thread Tom Lane
Bruce Momjian writes: > Uh, was this ever addressed? I don't see the patch applied or the code > in this area modified. This patch as-is would surely be disastrous: having LockAcquire try to open the relcache entry for the thing we're trying to lock is going to be circular in at least some

Re: Add recovery to pg_control and remove backup_label

2023-11-21 Thread David Steele
On 11/20/23 16:37, Andres Freund wrote: On 2023-11-20 11:11:13 -0500, Robert Haas wrote: I think we need more votes to make a change this big. I have a concern, which I think I've expressed before, that we keep whacking around the backup APIs, and that has a cost which is potentially larger

Re: PSQL error: total cell count of XXX exceeded

2023-11-21 Thread Tom Lane
Alvaro Herrera writes: > On 2023-Nov-21, Tom Lane wrote: >> Alvaro Herrera writes: >>> It's a bit annoying that the error recovery decision of this code is to >>> exit the process with an error. [...] >>> TBH though, I've never hit that code in real usage. >> Yeah, I think the reason it's

Re: Add recovery to pg_control and remove backup_label

2023-11-21 Thread Andres Freund
Hi, On 2023-11-21 13:41:15 -0400, David Steele wrote: > On 11/20/23 16:41, Andres Freund wrote: > > > > On 2023-11-20 15:56:19 -0400, David Steele wrote: > > > I understand this is an option -- but does it need to be? What is the > > > benefit of excluding the manifest? > > > > It's not free to

Re: Add recovery to pg_control and remove backup_label

2023-11-21 Thread David Steele
On 11/20/23 16:41, Andres Freund wrote: On 2023-11-20 15:56:19 -0400, David Steele wrote: I understand this is an option -- but does it need to be? What is the benefit of excluding the manifest? It's not free to create the manifest, particularly if checksums are enabled. It's virtually

Re: pg_upgrade and logical replication

2023-11-21 Thread vignesh C
On Mon, 20 Nov 2023 at 10:44, Peter Smith wrote: > > Here are some review comments for patch v15-0001 > > == > src/bin/pg_dump/pg_dump.c > > 1. getSubscriptions > > + if (fout->remoteVersion >= 17) > + appendPQExpBufferStr(query, "o.remote_lsn AS suboriginremotelsn\n"); > + else > +

Re: Hide exposed impl detail of wchar.c

2023-11-21 Thread Eric Ridge
(I hope you don't mind I'm reposting your reply -- I accidentally replied directly to you b/c phone) > On Nov 21, 2023, at 11:56 AM, Andres Freund wrote: > > Hi, > > On 2023-11-21 10:11:18 -0500, Eric Ridge wrote: >> On Mon, Nov 20, 2023 at 7:10 PM Andres Freund wrote: >> And I don’t know

Re: Locks on unlogged tables are locked?!

2023-11-21 Thread Robert Haas
On Tue, Nov 21, 2023 at 11:49 AM Bruce Momjian wrote: > Uh, was this ever addressed? I don't see the patch applied or the code > in this area modified. I never saw this email originally, but I don't think I believe Laurenz's argument. Are all AEL-requiring operations on unlogged tables safe to

Re: Add recovery to pg_control and remove backup_label

2023-11-21 Thread David Steele
On 11/21/23 12:41, Andres Freund wrote: On 2023-11-21 07:42:42 -0400, David Steele wrote: On 11/20/23 19:58, Andres Freund wrote: On 2023-11-21 08:52:08 +0900, Michael Paquier wrote: On Mon, Nov 20, 2023 at 12:37:46PM -0800, Andres Freund wrote: Given that, I wonder if what we should do is

Re: Partial aggregates pushdown

2023-11-21 Thread Robert Haas
On Mon, Nov 20, 2023 at 5:48 PM Bruce Momjian wrote: > > I do have a concern about this, though. It adds a lot of bloat. It > > adds a whole lot of additional entries to pg_aggregate, and every new > > aggregate we add in the future will require a bonus entry for this, > > and it needs a bunch of

Re: Change GUC hashtable to use simplehash?

2023-11-21 Thread Jeff Davis
On Tue, 2023-11-21 at 16:42 +0700, John Naylor wrote: > The strlen call required for hashbytes() is not free. Should we have a hash_string() that's like hash_bytes() but checks for the NUL terminator itself? That wouldn't be inlinable, but it would save on the strlen() call. It might benefit

Re: simplehash: SH_OPTIMIZE_REPEAT for optimizing repeated lookups of the same key

2023-11-21 Thread Andres Freund
Hi, On 2023-11-20 22:37:47 -0800, Jeff Davis wrote: > On Mon, 2023-11-20 at 22:50 -0600, Nathan Bossart wrote: > > I'm mostly thinking out loud here, but could we just always do this?  > > I > > guess you might want to avoid it if your SH_EQUAL is particularly > > expensive > > and you know

Re: Locks on unlogged tables are locked?!

2023-11-21 Thread Bruce Momjian
Uh, was this ever addressed? I don't see the patch applied or the code in this area modified. --- On Thu, May 24, 2018 at 04:33:11PM +0200, Laurenz Albe wrote: > While looking at this: >

Re: Add recovery to pg_control and remove backup_label

2023-11-21 Thread Andres Freund
Hi, On 2023-11-21 07:42:42 -0400, David Steele wrote: > On 11/20/23 19:58, Andres Freund wrote: > > On 2023-11-21 08:52:08 +0900, Michael Paquier wrote: > > > On Mon, Nov 20, 2023 at 12:37:46PM -0800, Andres Freund wrote: > > > > Given that, I wonder if what we should do is to just add a new

Re: PSQL error: total cell count of XXX exceeded

2023-11-21 Thread Alvaro Herrera
On 2023-Nov-21, Tom Lane wrote: > Alvaro Herrera writes: > > Right. I made a few more adjustments, including the additional overflow > > check in printTableInit that Tom Lane suggested, and pushed this. > > Committed patch LGTM. Thanks for looking! > > It's a bit annoying that the error

Re: Remove distprep

2023-11-21 Thread Alvaro Herrera
On 2023-Nov-07, Michael Paquier wrote: > On Mon, Nov 06, 2023 at 04:21:40PM +0100, Peter Eisentraut wrote: > > done > > Nice to see 721856ff24b3 in, thanks! Hmm, do we still need to have README.git as a separate file from README? Also, looking at README, I see it refers to the INSTALL file in

Re: simplehash: SH_OPTIMIZE_REPEAT for optimizing repeated lookups of the same key

2023-11-21 Thread Nathan Bossart
On Mon, Nov 20, 2023 at 10:37:47PM -0800, Jeff Davis wrote: > It would be interesting to know how often it's a good idea to turn it > on, though. I could try turning it on for various other uses of > simplehash, and see where it tends to win. That seems worthwhile to me. -- Nathan Bossart

Re: Do away with a few backwards compatibility macros

2023-11-21 Thread Nathan Bossart
On Tue, Nov 21, 2023 at 12:05:36AM -0500, Tom Lane wrote: > No objection here, but should we try to establish some sort of project > policy around this sort of change (ie, removal of backwards-compatibility > support)? "Once it no longer matters for any supported version" sounds > about right to

Re: Annoying build warnings from latest Apple toolchain

2023-11-21 Thread Aleksander Alekseev
Hi, > > On Mon, Nov 20, 2023 at 11:37 PM Andres Freund wrote: > >> WRT Robert seeing those warnings and Tom not: There's something odd going > >> on. I couldn't immediately reproduce it. Then I realized it reproduces > >> against > >> a homebrew install but not a macports one. > >> > >> Robert,

Re: Hide exposed impl detail of wchar.c

2023-11-21 Thread Eric Ridge
> On Nov 20, 2023, at 7:10 PM, Andres Freund wrote: > > > What I don't quite get is why SIMD headers are particularly more problematic > than others - there's other headers that are compiler specific? The short answer is the rust-based bindings generation tool pgrx uses (bindgen) is a little

Re: How to accurately determine when a relation should use local buffers?

2023-11-21 Thread Aleksander Alekseev
Hi, > Furthermore, there is some possible inconsistency in the code show below > (REL_16_STABLE) in bufmgr.c file: > > FlushRelationBuffers, PrefetchBuffer uses RelationUsesLocalBuffers(rel). > ExtendBufferedRel_common finally use BufferManagerRelation.relpersistence > which is actually

Re: Annoying build warnings from latest Apple toolchain

2023-11-21 Thread Peter Eisentraut
On 21.11.23 14:35, Robert Haas wrote: On Mon, Nov 20, 2023 at 11:37 PM Andres Freund wrote: WRT Robert seeing those warnings and Tom not: There's something odd going on. I couldn't immediately reproduce it. Then I realized it reproduces against a homebrew install but not a macports one.

Re: meson documentation build open issues

2023-11-21 Thread Peter Eisentraut
On 21.11.23 14:23, Peter Eisentraut wrote: On 21.11.23 02:56, Andres Freund wrote: One remaining question is whether we should adjust install-doc-{html,man} to be install-{html,man}, to match the docs targets. Ah didn't notice that one; yes please. I think this was done?

Re: PSQL error: total cell count of XXX exceeded

2023-11-21 Thread Tom Lane
Alvaro Herrera writes: > Right. I made a few more adjustments, including the additional overflow > check in printTableInit that Tom Lane suggested, and pushed this. Committed patch LGTM. > It's a bit annoying that the error recovery decision of this code is to > exit the process with an error.

pg_class.relpages not updated for toast index

2023-11-21 Thread Fabrízio de Royes Mello
Hi all, Was doing a relation size estimation based on pg_class.relpages of the relation and the related objects (index, toast) and noticed that it is not updated for the toast index, for example: fabrizio=# CREATE TABLE t(c TEXT); INSERT INTO t VALUES (repeat('x', (8192^2)::int)); VACUUM

Re: PSQL error: total cell count of XXX exceeded

2023-11-21 Thread Alvaro Herrera
On 2023-Sep-13, Hongxu Ma wrote: > After double check, looks `int64` of src/include/c.h is the proper type for > it. > Uploaded the v4 patch to fix it. Right. I made a few more adjustments, including the additional overflow check in printTableInit that Tom Lane suggested, and pushed this.

Re: CREATE FUNCTION ... SEARCH { DEFAULT | SYSTEM | SESSION }

2023-11-21 Thread Robert Haas
On Mon, Nov 20, 2023 at 5:27 PM Jeff Davis wrote: > Of course I welcome others to profile and see what they can do. There's > a setjmp() call, and a couple allocations, and maybe some other stuff > to look at. There are also higher-level ideas, like avoiding calling > into guc.c in some cases,

Re: About #13489, array dimensions and CREATE TABLE ... LIKE

2023-11-21 Thread Bruce Momjian
On Tue, Nov 21, 2023 at 09:33:18AM +0100, Laurenz Albe wrote: > On Mon, 2023-11-20 at 21:13 -0500, Tom Lane wrote: > > Bruce Momjian writes: > > > On Mon, Nov 20, 2023 at 09:04:21PM -0500, Tom Lane wrote: > > > > Bruce Momjian writes: > > > > > An alternate approach would > > > > > be to remove

Re: trying again to get incremental backup

2023-11-21 Thread Jakub Wartak
On Mon, Nov 20, 2023 at 4:43 PM Robert Haas wrote: > > On Fri, Nov 17, 2023 at 5:01 AM Alvaro Herrera > wrote: > > I made a pass over pg_combinebackup for NLS. I propose the attached > > patch. > > This doesn't quite compile for me so I changed a few things and > incorporated it. Hopefully I

Re: Annoying build warnings from latest Apple toolchain

2023-11-21 Thread Robert Haas
On Mon, Nov 20, 2023 at 11:37 PM Andres Freund wrote: > WRT Robert seeing those warnings and Tom not: There's something odd going > on. I couldn't immediately reproduce it. Then I realized it reproduces against > a homebrew install but not a macports one. > > Robert, which are you using?

Re: undetected deadlock in ALTER SUBSCRIPTION ... REFRESH PUBLICATION

2023-11-21 Thread Tomas Vondra
On 11/21/23 14:16, Amit Kapila wrote: > On Tue, Nov 21, 2023 at 5:17 PM Tomas Vondra > wrote: >> >> I decided to do some stress-testing of the built-in logical replication, >> as part of the sequence decoding work. And I soon ran into an undetected >> deadlock related to ALTER SUBSCRIPTION ...

Re: meson documentation build open issues

2023-11-21 Thread Peter Eisentraut
On 21.11.23 02:56, Andres Freund wrote: One remaining question is whether we should adjust install-doc-{html,man} to be install-{html,man}, to match the docs targets. Ah didn't notice that one; yes please.

Re: undetected deadlock in ALTER SUBSCRIPTION ... REFRESH PUBLICATION

2023-11-21 Thread Amit Kapila
On Tue, Nov 21, 2023 at 5:17 PM Tomas Vondra wrote: > > I decided to do some stress-testing of the built-in logical replication, > as part of the sequence decoding work. And I soon ran into an undetected > deadlock related to ALTER SUBSCRIPTION ... REFRESH PUBLICATION :-( > > The attached bash

undetected deadlock in ALTER SUBSCRIPTION ... REFRESH PUBLICATION

2023-11-21 Thread Tomas Vondra
Hi, I decided to do some stress-testing of the built-in logical replication, as part of the sequence decoding work. And I soon ran into an undetected deadlock related to ALTER SUBSCRIPTION ... REFRESH PUBLICATION :-( The attached bash scripts triggers that in a couple seconds for me. The script

Re: Add recovery to pg_control and remove backup_label

2023-11-21 Thread David Steele
On 11/20/23 19:58, Andres Freund wrote: On 2023-11-21 08:52:08 +0900, Michael Paquier wrote: On Mon, Nov 20, 2023 at 12:37:46PM -0800, Andres Freund wrote: Given that, I wonder if what we should do is to just add a new field to pg_control that says "error out if backup_label does not exist",

Re: POC, WIP: OR-clause support for indexes

2023-11-21 Thread Alena Rybakina
On 21.11.2023 03:50, Alena Rybakina wrote: On 20.11.2023 11:52, Andrei Lepikhov wrote: Looking into the patch, I found some trivial improvements (see attachment). Also, it is not obvious that using a string representation of the clause as a hash table key is needed here. Also, by making a copy

Re: Use of backup_label not noted in log

2023-11-21 Thread David Steele
On 11/20/23 23:54, Michael Paquier wrote: On Mon, Nov 20, 2023 at 03:31:20PM -0400, David Steele wrote: I still wonder if we need "base backup" in the messages? That sort of implies (at least to me) you used pg_basebackup but that may not be the case. Or just s/base backup/backup/? That's

Re: Synchronizing slots from primary to standby

2023-11-21 Thread Drouvot, Bertrand
Hi, On 11/21/23 10:32 AM, shveta malik wrote: On Tue, Nov 21, 2023 at 2:02 PM shveta malik wrote: v37 fails to apply to HEAD due to a recent commit e83aa9f92fdd, rebased the patches. PFA v37_2 patches. Thanks! Regarding the promotion flow: If the primary is available and reachable I

Re: Why is src/test/modules/committs/t/002_standby.pl flaky?

2023-11-21 Thread Alexander Lakhin
Hello Thomas, 10.11.2023 06:31, Thomas Munro wrote: Here is a new attempt to fix this mess. Disclaimer: this based entirely on reading the manual and vicariously hacking a computer I don't have via CI. As it also might (and I would like it to) be the final attempt, I decided to gather

RE: Random pg_upgrade test failure on drongo

2023-11-21 Thread Hayato Kuroda (Fujitsu)
Dear hackers, This email tells an update. The machine drongo failed the test a week ago [1] and finally got logfiles. PSA files. ## Observed failure pg_upgrade_server.log is a server log during the pg_upgrade command. According to it, the TRUNCATE command seemed to be failed due to a "File

Re: How to accurately determine when a relation should use local buffers?

2023-11-21 Thread Vitaly Davydov
Hi Aleksander, Thank you for the reply. > Could you please provide a specific example when the current code willdo > something wrong/unintended? I can't say that something is wrong in vanilla. But if you decide to replicate DDL in some solutions like multimaster, you might want to replicate

Re: Typo with amtype = 's' in opr_sanity.sql

2023-11-21 Thread Aleksander Alekseev
Hi, > While rebasing a patch from 2016 related to sequence AMs (more about > that later), I've bumped on a mistake from 8586bf7ed888 in > opr_sanity.sql, as of: > +SELECT p1.oid, p1.amname, p2.oid, p2.proname > +FROM pg_am AS p1, pg_proc AS p2 > +WHERE p2.oid = p1.amhandler AND p1.amtype = 's'

Re: Change GUC hashtable to use simplehash?

2023-11-21 Thread John Naylor
On Mon, Nov 20, 2023 at 5:54 AM Jeff Davis wrote: > > Attached are a bunch of tiny patches and some perf numbers based on > simple test described here: > > https://www.postgresql.org/message-id/04c8592dbd694e4114a3ed87139a7a04e4363030.camel%40j-davis.com I tried taking I/O out, like this,

Re: [PATCH] fix race condition in libpq (related to ssl connections)

2023-11-21 Thread Aleksander Alekseev
Hi, > I've found a race condition in libpq. It is about the initialization of > the my_bio_methods static variable in fe-secure-openssl.c, which is not > protected by any lock. The race condition may make the initialization of > the connection fail, and as an additional weird consequence, it

Re: How to accurately determine when a relation should use local buffers?

2023-11-21 Thread Aleksander Alekseev
Hi, > I would like to clarify, what the correct way is to determine that a given > relation is using local buffers. Local buffers, as far as I know, are used > for temporary tables in backends. There are two functions/macros (bufmgr.c): > SmgrIsTemp, RelationUsesLocalBuffers. The first

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

2023-11-21 Thread Amit Kapila
On Sat, Nov 18, 2023 at 4:54 PM Amit Kapila wrote: > > On Thu, Nov 16, 2023 at 6:09 PM Bharath Rupireddy > wrote: > > PSA v18 patch. > > > > LGTM. I'll push this early next week unless there are further > suggestions or comments. > Pushed. -- With Regards, Amit Kapila.

Re: About #13489, array dimensions and CREATE TABLE ... LIKE

2023-11-21 Thread Laurenz Albe
On Mon, 2023-11-20 at 21:13 -0500, Tom Lane wrote: > Bruce Momjian writes: > > On Mon, Nov 20, 2023 at 09:04:21PM -0500, Tom Lane wrote: > > > Bruce Momjian writes: > > > > An alternate approach would > > > > be to remove pg_attribute.attndims so we don't even try to preserve > > > >

Re: Synchronizing slots from primary to standby

2023-11-21 Thread shveta malik
On Tue, Nov 21, 2023 at 1:13 PM Drouvot, Bertrand wrote: > > Hi, > > On 11/21/23 6:16 AM, Amit Kapila wrote: > > On Mon, Nov 20, 2023 at 6:51 PM Drouvot, Bertrand > > wrote: > >> As far the 'i' state here, from what I see, it is currently useful for: > >> > >> 1. Cascading standby to not sync

Re: Synchronizing slots from primary to standby

2023-11-21 Thread shveta malik
On Tue, Nov 21, 2023 at 10:02 AM Zhijie Hou (Fujitsu) wrote: > > On Friday, November 17, 2023 7:39 PM Amit Kapila > wrote: > > > > On Thu, Nov 16, 2023 at 5:34 PM shveta malik > > wrote: > > > > > > PFA v35. > > > > > > > Review v35-0002* > > == > > Thanks for the comments. > > >