Re: Remove MSVC scripts from the tree

2023-11-20 Thread Michael Paquier
On Mon, Nov 20, 2023 at 08:00:09AM +0100, Peter Eisentraut wrote: > I had suggested this arrangement as a way to reduce churn in this patch set. > We'd just move over the existing separate chapter into a new section, and > then later consider further rearrangements. > > It's not always clear where

Re: Simplify if/else logic of walsender CreateReplicationSlot

2023-11-20 Thread Michael Paquier
On Mon, Nov 20, 2023 at 06:01:42PM +1100, Peter Smith wrote: > While reviewing another patch I was looking at the walsender's static > function CreateReplicationSlot > > I found that the current logic seemed to have some unnecessary if/else > checking which can be simplified. Good idea. What you

Inquiry on Generating Bitmaps from Filter Conditions in Index Scans

2023-11-20 Thread Jinjing Zhou
Hi hackers,  I hope this message finds you well. I am reaching out to seek guidance on a specific aspect of PostgreSQL's index scanning functionality. I am currently working on a vector search extension for postgres, where I need to generate bitmaps based on filter conditions during an index sc

Re: Use of backup_label not noted in log

2023-11-20 Thread Michael Paquier
On Sat, Nov 18, 2023 at 01:49:15PM -0800, Andres Freund wrote: > Note that the LSN in the "continuing" case is the one the backup started at, > not where recovery will start. > > I've wondered whether it's worth also adding an explicit message just after > ReachedEndOfBackup(), but it seems far le

Re: SLRU optimization - configurable buffer pool and partitioning the SLRU lock

2023-11-20 Thread Dilip Kumar
On Fri, Nov 17, 2023 at 7:28 PM Alvaro Herrera wrote: > > On 2023-Nov-17, Dilip Kumar wrote: I think I need some more clarification for some of the review comments > > On Thu, Nov 16, 2023 at 3:11 PM Alvaro Herrera > > wrote: > > > > > > I just noticed that 0003 does some changes to > > > Tran

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

2023-11-20 Thread Andrei Lepikhov
On 10/11/2023 16:20, Alena Rybakina wrote: I added log like that: ERROR:  unrecognized node type: 0. I fixed this issue and added some cosmetic refactoring. The changes are presented in the or_patch_changes.diff file. Looking into the patch, I found some trivial improvements (see attachment).

Re: Question about the Implementation of vector32_is_highbit_set on ARM

2023-11-20 Thread John Naylor
On Wed, Nov 8, 2023 at 2:44 PM Xiang Gao wrote: > * function. We could instead adopt the behavior of Arm's vmaxvq_u32(), i.e. > * check each 32-bit element, but that would require an additional mask > * operation on x86. > */ > But I still don't understand why the vmaxvq_u32 intrinsic is not

Stop the search once replication origin is found

2023-11-20 Thread Antonin Houska
Although it's not performance-critical, I think it just makes sense to break the loop in replorigin_session_setup() as soon as we've found the origin. -- Antonin Houska Web: https://www.cybertec-postgresql.com diff --git a/src/backend/replication/logical/origin.c b/src/backend/replication/logica

Re: SLRU optimization - configurable buffer pool and partitioning the SLRU lock

2023-11-20 Thread Andrey M. Borodin
> On 20 Nov 2023, at 13:51, Dilip Kumar wrote: > > 2) Do we really need one separate lwlock tranche for each SLRU? > > IMHO if we use the same lwlock tranche then the wait event will show > the same wait event name, right? And that would be confusing for the > user, whether we are waiting for

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

2023-11-20 Thread a.rybakina
On 20.11.2023 11:52, Andrei Lepikhov wrote: On 10/11/2023 16:20, Alena Rybakina wrote: I added log like that: ERROR: unrecognized node type: 0. I fixed this issue and added some cosmetic refactoring. The changes are presented in the or_patch_changes.diff file. Looking into the patch, I found

Re: PL/pgSQL: Incomplete item Allow handling of %TYPE arrays, e.g. tab.col%TYPE[]

2023-11-20 Thread Pavel Stehule
Hi út 17. 10. 2023 v 3:20 odesílatel Quan Zongliang napsal: > > Attached new patch >More explicit error messages based on type. > > > On 2023/10/16 18:15, Quan Zongliang wrote: > > > > > > Implement TODO item: > > PL/pgSQL > > Incomplete item Allow handling of %TYPE arrays, e.g. tab.col%TYPE

Re: Why is hot_standby_feedback off by default?

2023-11-20 Thread John Naylor
On Tue, Oct 24, 2023 at 3:42 AM Nathan Bossart wrote: > > On Sun, Oct 22, 2023 at 12:07:59PM -0700, Andres Freund wrote: > > Medium term, I think we need an approximate xid->"time of assignment" > > mapping that's continually maintained on the primary. One of the things > > that'd show us to do

Re: Assert failure on 'list_member_ptr(rel->joininfo, restrictinfo)'

2023-11-20 Thread Ashutosh Bapat
On Sun, Nov 19, 2023 at 6:48 AM Alexander Korotkov wrote: > > On Wed, Nov 15, 2023 at 5:07 PM Alexander Korotkov > wrote: > > > > On Wed, Nov 15, 2023 at 8:02 AM Andres Freund wrote: > > > The kinda because there are callers to bms_(add|del)_members() that pass > > > the > > > same bms as a an

Re: Synchronizing slots from primary to standby

2023-11-20 Thread Drouvot, Bertrand
Hi, On 11/18/23 11:45 AM, Amit Kapila wrote: On Fri, Nov 17, 2023 at 5:18 PM Drouvot, Bertrand wrote: On 11/17/23 2:46 AM, Zhijie Hou (Fujitsu) wrote: On Tuesday, November 14, 2023 10:27 PM Drouvot, Bertrand wrote: I feel the WaitForWALToBecomeAvailable may not be the best place to shutdo

Perhaps a possible new feature to a future PostgreSQL release

2023-11-20 Thread Erki Eessaar
Hello Let me assume that there is a table T with columns a, b, c, d, e, f, g, and h. If one wants to select data from all the columns except d and e, then one has to write SELECT a, b, c, f, g, h FROM T; instead of writing SELECT ALL BUT (d, e) FROM T; or something similar (perhaps by using

Re: Perhaps a possible new feature to a future PostgreSQL release

2023-11-20 Thread Laurenz Albe
On Mon, 2023-11-20 at 09:52 +, Erki Eessaar wrote: > Let me assume that there is a table T with columns a, b, c, d, e, f, g, and h. > > If one wants to select data from all the columns except d and e, then one has > to write > > SELECT a, b, c, f, g, h > FROM T; > > instead of writing  > >

Re: should check collations when creating partitioned index

2023-11-20 Thread Peter Eisentraut
On 14.11.23 17:15, Tom Lane wrote: I don't love the patch details though. It seems entirely wrong to check this before we check the opclass match. Not sure why? The order doesn't seem to matter? Also, in at least some cases the code presses on looking for another match if the current opclas

Re: Use of backup_label not noted in log

2023-11-20 Thread Laurenz Albe
I can accept that adding log messages to back branches is ok. Perhaps I am too nervous about things like that, because as an extension developer I have been bitten too often by ABI breaks in minor releases in the past. On Mon, 2023-11-20 at 17:30 +0900, Michael Paquier wrote: > + if (Control

Re: Inquiry on Generating Bitmaps from Filter Conditions in Index Scans

2023-11-20 Thread Tomas Vondra
On 11/19/23 18:19, Jinjing Zhou wrote: > Hi hackers,  > > I hope this message finds you well. I am reaching out to seek guidance > on a specific aspect of PostgreSQL's index scanning functionality. > > I am currently working on a vector search extension for postgres, where > I need to generate

Re: Synchronizing slots from primary to standby

2023-11-20 Thread Amit Kapila
On Sat, Nov 18, 2023 at 4:15 PM Amit Kapila wrote: > > On Fri, Nov 17, 2023 at 5:18 PM Drouvot, Bertrand > wrote: > > More Review for v35-0002* > > More review of v35-0002* 1. +/* + * Helper function to check if local_slot is present in remote_sl

Re: Synchronizing slots from primary to standby

2023-11-20 Thread Amit Kapila
On Mon, Nov 20, 2023 at 3:17 PM Drouvot, Bertrand wrote: > > On 11/18/23 11:45 AM, Amit Kapila wrote: > > On Fri, Nov 17, 2023 at 5:18 PM Drouvot, Bertrand > > wrote: > >> > >> On 11/17/23 2:46 AM, Zhijie Hou (Fujitsu) wrote: > >>> On Tuesday, November 14, 2023 10:27 PM Drouvot, Bertrand > >>>

Re: Stop the search once replication origin is found

2023-11-20 Thread Amit Kapila
On Mon, Nov 20, 2023 at 2:36 PM Antonin Houska wrote: > > Although it's not performance-critical, I think it just makes sense to break > the loop in replorigin_session_setup() as soon as we've found the origin. > Your proposal sounds reasonable to me. -- With Regards, Amit Kapila.

Re: [HACKERS] make async slave to wait for lsn to be replayed

2023-11-20 Thread Картышов Иван
Alexander, thank you for your review and pointing this issues. According to them I made some fixes and rebase all patch. But I can`t repeat your ERROR. Not with hot_standby_feedback = on nor  hot_standby_feedback = off.master: create table test as (select i from generate_series(1,1) i); slav

Re: SLRU optimization - configurable buffer pool and partitioning the SLRU lock

2023-11-20 Thread Dilip Kumar
On Mon, Nov 20, 2023 at 2:37 PM Andrey M. Borodin wrote: > > On 20 Nov 2023, at 13:51, Dilip Kumar wrote: > > > > 2) Do we really need one separate lwlock tranche for each SLRU? > > > > IMHO if we use the same lwlock tranche then the wait event will show > > the same wait event name, right? And

Re: Adding facility for injection points (or probe points?) for more advanced tests

2023-11-20 Thread Ashutosh Bapat
On Wed, Oct 25, 2023 at 9:43 AM Michael Paquier wrote: > > Hi all, > > I don't remember how many times in the last few years when I've had to > hack the backend to produce a test case that involves a weird race > condition across multiple processes running in the backend, to be able > to prove a p

Re: Inquiry on Generating Bitmaps from Filter Conditions in Index Scans

2023-11-20 Thread Matthias van de Meent
On Mon, 20 Nov 2023 at 09:30, Jinjing Zhou wrote: > > Hi hackers, > > I hope this message finds you well. I am reaching out to seek guidance on a > specific aspect of PostgreSQL's index scanning functionality. > > I am currently working on a vector search extension for postgres, where I > need t

Flushing large data immediately in pqcomm

2023-11-20 Thread Melih Mutlu
Hi hackers I've been looking into ways to reduce the overhead we're having in pqcomm and I'd like to propose a small patch to modify how socket_putmessage works. Currently socket_putmessage copies any input data into the pqcomm send buffer (PqSendBuffer) and the size of this buffer is 8K. When th

Re: Synchronizing slots from primary to standby

2023-11-20 Thread Drouvot, Bertrand
On 11/20/23 11:59 AM, Amit Kapila wrote: On Mon, Nov 20, 2023 at 3:17 PM Drouvot, Bertrand wrote: On 11/18/23 11:45 AM, Amit Kapila wrote: On Fri, Nov 17, 2023 at 5:18 PM Drouvot, Bertrand wrote: On 11/17/23 2:46 AM, Zhijie Hou (Fujitsu) wrote: On Tuesday, November 14, 2023 10:27 PM Dr

Re: Add recovery to pg_control and remove backup_label

2023-11-20 Thread David Steele
On 11/19/23 21:15, Michael Paquier wrote: (I am not exactly sure how, but we've lost pgsql-hackers on the way when you sent v5. Now added back in CC with the two latest patches you've proposed attached.) Ugh, I must have hit reply instead of reply all. It's a rookie error and you hate to see

Re: Use of backup_label not noted in log

2023-11-20 Thread David Steele
[Resending since I accidentally replied off-list] On 11/18/23 17:49, Andres Freund wrote: On 2023-11-18 10:01:42 -0800, Andres Freund wrote: What about adding it to the "redo starts at" message, something like redo starts at 12/12345678, taken from control file or redo starts at 12/123

Re: Use of backup_label not noted in log

2023-11-20 Thread David Steele
On 11/20/23 06:35, Laurenz Albe wrote: If we add a message for starting with "backup_label", shouldn't we also add a corresponding message for starting from a checkpoint found in the control file? If you see that in a problem report, you immediately know what is going on. +1. It is easier to

Re: Show WAL write and fsync stats in pg_stat_io

2023-11-20 Thread Nazir Bilal Yavuz
Hi, Thanks for the feedback. On Mon, 20 Nov 2023 at 10:47, Michael Paquier wrote: > > On Thu, Nov 09, 2023 at 02:39:26PM +0300, Nazir Bilal Yavuz wrote: > > There are some differences between pg_stat_wal and pg_stat_io while > > collecting WAL stats. For example in the XLogWrite() function in th

Re: Inquiry on Generating Bitmaps from Filter Conditions in Index Scans

2023-11-20 Thread Jinjing Zhou
Thanks a lot! This is exactly what I'm asking. We've tried the CustomScanAPI at https://github.com/tensorchord/pgvecto.rs/pull/126, but met error with "variable not found in subplan target list". We're still investigating the root cause and thanks for your guidance! Best Jinjing Zhou > From: "M

Re: Inquiry on Generating Bitmaps from Filter Conditions in Index Scans

2023-11-20 Thread Jinjing Zhou
Thanks. Our project is at https://github.com/tensorchord/pgvecto.rs. A custom index is implemented for the vector similarity search, which implements `amgettuples` with direction support to provide candidates for the order by clause.  And we want to inject the filter condition using bitmap into

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

2023-11-20 Thread Willi Mann
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 might cause

Re: Add recovery to pg_control and remove backup_label

2023-11-20 Thread Robert Haas
On Sun, Nov 19, 2023 at 8:16 PM Michael Paquier wrote: > (I am not exactly sure how, but we've lost pgsql-hackers on the way > when you sent v5. Now added back in CC with the two latest patches > you've proposed attached.) > > Here is a short summary of what has been missed by the lists: > - I've

Re: Use of backup_label not noted in log

2023-11-20 Thread Robert Haas
On Mon, Nov 20, 2023 at 5:35 AM Laurenz Albe wrote: > I can accept that adding log messages to back branches is ok. > Perhaps I am too nervous about things like that, because as an extension > developer I have been bitten too often by ABI breaks in minor releases > in the past. I think that addin

Re: should check collations when creating partitioned index

2023-11-20 Thread Tom Lane
Peter Eisentraut writes: > On 14.11.23 17:15, Tom Lane wrote: >> I don't love the patch details though. It seems entirely wrong to check >> this before we check the opclass match. > Not sure why? The order doesn't seem to matter? The case that was bothering me was if we had a non-collated type

Re: On non-Windows, hard depend on uselocale(3)

2023-11-20 Thread Tom Lane
Thomas Munro writes: > If we are sure that we'll *never* want locale-aware printf-family > functions (ie we *always* want "C" locale), then in the thought > experiment above where I suggested we supply replacement _l() > functions, we could just skip that for the printf family, but make > that abo

Re: Use of backup_label not noted in log

2023-11-20 Thread David Steele
On 11/20/23 12:24, Robert Haas wrote: On Mon, Nov 20, 2023 at 5:35 AM Laurenz Albe wrote: I can accept that adding log messages to back branches is ok. Perhaps I am too nervous about things like that, because as an extension developer I have been bitten too often by ABI breaks in minor releases

Re: Wrong rows estimations with joins of CTEs slows queries by more than factor 500

2023-11-20 Thread Tom Lane
Richard Guo writes: > On Fri, Nov 17, 2023 at 11:38 AM Tom Lane wrote: >> That line of argument also leads to the conclusion that it'd be >> okay to expose info about the ordering of the CTE result to the >> upper planner. > In the light of this conclusion, I had a go at propagating the pathkeys

Re: Add recovery to pg_control and remove backup_label

2023-11-20 Thread David Steele
On 11/20/23 12:11, Robert Haas wrote: On Sun, Nov 19, 2023 at 8:16 PM Michael Paquier wrote: (I am not exactly sure how, but we've lost pgsql-hackers on the way when you sent v5. Now added back in CC with the two latest patches you've proposed attached.) Here is a short summary of what has

Re: Use of backup_label not noted in log

2023-11-20 Thread Andres Freund
Hi, On 2023-11-20 11:24:25 -0500, Robert Haas wrote: > I do also think it is worth considering how this proposal interacts > with the proposal to remove backup_label. If that proposal goes > through, then this proposal is obsolete, I believe. I think it's the opposite, if anything. Today you can

Re: Use of backup_label not noted in log

2023-11-20 Thread Andres Freund
Hi, On 2023-11-20 17:30:31 +0900, Michael Paquier wrote: > On Sat, Nov 18, 2023 at 01:49:15PM -0800, Andres Freund wrote: > > Note that the LSN in the "continuing" case is the one the backup started at, > > not where recovery will start. > > > > I've wondered whether it's worth also adding an exp

Re: Add recovery to pg_control and remove backup_label

2023-11-20 Thread Robert Haas
On Mon, Nov 20, 2023 at 12:54 PM David Steele wrote: > Another thing we could do is explicitly error if we see backup_label in > PGDATA during recovery. That's just a few lines of code so would not be > a big deal to maintain. This error would only be visible on restore, so > it presumes that back

Re: Hide exposed impl detail of wchar.c

2023-11-20 Thread Jubilee Young
On Fri, Nov 17, 2023 at 2:26 AM John Naylor wrote: > > On Fri, Nov 17, 2023 at 5:54 AM Nathan Bossart > wrote: > > > > It looks like is_valid_ascii() was originally added to pg_wchar.h so that > > it could easily be used elsewhere [0] [1], but that doesn't seem to have > > happened yet. > > > >

Re: trying again to get incremental backup

2023-11-20 Thread Alvaro Herrera
On 2023-Nov-16, Robert Haas wrote: > On Thu, Nov 16, 2023 at 12:23 PM Alvaro Herrera > wrote: > > I don't understand this point. Currently, the protocol is that > > UPLOAD_MANIFEST is used to send the manifest prior to requesting the > > backup. You seem to be saying that you're thinking of r

Re: Use of backup_label not noted in log

2023-11-20 Thread Andres Freund
Hi, On 2023-11-20 11:35:15 +0100, Laurenz Albe wrote: > On Mon, 2023-11-20 at 17:30 +0900, Michael Paquier wrote: > > + if (ControlFile->backupStartPoint != InvalidXLogRecPtr) > > + ereport(LOG, > > + (errmsg("continuing to start from base backup with redo > > LS

Re: Use of backup_label not noted in log

2023-11-20 Thread David Steele
On 11/20/23 14:27, Andres Freund wrote: Hi, On 2023-11-19 14:28:12 -0400, David Steele wrote: On 11/18/23 17:49, Andres Freund wrote: On 2023-11-18 10:01:42 -0800, Andres Freund wrote: Not enamored with the phrasing of the log messages, but here's a prototype: When starting up with backup_lab

Re: trying again to get incremental backup

2023-11-20 Thread Robert Haas
On Mon, Nov 20, 2023 at 2:03 PM Alvaro Herrera wrote: > That sounds good to me. Not having to parse the manifest server-side > sounds like a win, as does saving the transfer, for the cases where the > manifest is large. OK. I'll look into this next week, hopefully. > Is this meant to support mu

Re: psql's FETCH_COUNT (cursor) is not being respected for CTEs

2023-11-20 Thread Daniel Verite
Hi, Here's a new version to improve the performance of FETCH_COUNT and extend the cases when it can be used. Patch 0001 adds a new mode in libpq to allow the app to retrieve larger chunks of results than the single row of the row-by-row mode. The maximum number of rows per PGresult is set by the

Re: Annoying build warnings from latest Apple toolchain

2023-11-20 Thread Robert Haas
On Sat, Oct 7, 2023 at 12:09 PM Tom Lane wrote: > Done that way. Is there still outstanding work on this thread? Because I'm just now using a new MacBook (M2, Ventura 13.6.2) and I'm getting a lot of this kind of thing in a meson build: [2264/2287] Linking target src/interfaces/ecpg/test/sql/par

Re: trying again to get incremental backup

2023-11-20 Thread Robert Haas
On Mon, Nov 20, 2023 at 2:10 PM Robert Haas wrote: > > Is this meant to support multiple timelines each with non-overlapping > > adjacent ranges, rather than multiple non-adjacent ranges? > > Correct. I don't see how non-adjacent LSN ranges could ever be a > useful thing, but adjacent ranges on di

Re: Use of backup_label not noted in log

2023-11-20 Thread David Steele
On 11/20/23 15:03, Andres Freund wrote: On 2023-11-20 11:35:15 +0100, Laurenz Albe wrote: If we add a message for starting with "backup_label", shouldn't we also add a corresponding message for starting from a checkpoint found in the control file? If you see that in a problem report, you immed

Re: Annoying build warnings from latest Apple toolchain

2023-11-20 Thread Andres Freund
Hi, On 2023-11-20 14:14:00 -0500, Robert Haas wrote: > On Sat, Oct 7, 2023 at 12:09 PM Tom Lane wrote: > > Done that way. > > Is there still outstanding work on this thread? Because I'm just now > using a new MacBook (M2, Ventura 13.6.2) and I'm getting a lot of this > kind of thing in a meson b

Re: Add recovery to pg_control and remove backup_label

2023-11-20 Thread David Steele
On 11/20/23 14:44, Robert Haas wrote: On Mon, Nov 20, 2023 at 12:54 PM David Steele wrote: Another thing we could do is explicitly error if we see backup_label in PGDATA during recovery. That's just a few lines of code so would not be a big deal to maintain. This error would only be visible on

Re: Annoying build warnings from latest Apple toolchain

2023-11-20 Thread Robert Haas
On Mon, Nov 20, 2023 at 2:35 PM Andres Freund wrote: > > Is there still outstanding work on this thread? Because I'm just now > > using a new MacBook (M2, Ventura 13.6.2) and I'm getting a lot of this > > kind of thing in a meson build: > > Ventura? In that case I assume you installed newer develo

Re: Add recovery to pg_control and remove backup_label

2023-11-20 Thread Robert Haas
On Mon, Nov 20, 2023 at 2:41 PM David Steele wrote: > I can't see why a backup would continue to be valid without a manifest > -- that's not very standard for backup software. If you have the > critical info in backup_label, you can't afford to lose that, so why > should backup_manifest be any dif

Re: Parallel CREATE INDEX for BRIN indexes

2023-11-20 Thread Matthias van de Meent
On Wed, 8 Nov 2023 at 12:03, Tomas Vondra wrote: > > Hi, > > here's an updated patch, addressing the review comments, and reworking > how the work is divided between the workers & leader etc. > > 0001 is just v2, rebased to current master > > 0002 and 0003 address most of the issues, in particular

Re: Add recovery to pg_control and remove backup_label

2023-11-20 Thread David Steele
On 11/20/23 15:47, Robert Haas wrote: On Mon, Nov 20, 2023 at 2:41 PM David Steele wrote: I can't see why a backup would continue to be valid without a manifest -- that's not very standard for backup software. If you have the critical info in backup_label, you can't afford to lose that, so why

Re: Annoying build warnings from latest Apple toolchain

2023-11-20 Thread Andres Freund
Hi, On 2023-11-20 14:46:13 -0500, Robert Haas wrote: > On Mon, Nov 20, 2023 at 2:35 PM Andres Freund wrote: > > > Is there still outstanding work on this thread? Because I'm just now > > > using a new MacBook (M2, Ventura 13.6.2) and I'm getting a lot of this > > > kind of thing in a meson build:

Re: Implement missing join selectivity estimation for range types

2023-11-20 Thread Schoemans Maxime
On 14/11/2023 20:46, Tom Lane wrote: > I took a brief look through this very interesting work. I concur > with Tomas that it feels a little odd that range join selectivity > would become smarter than scalar inequality join selectivity, and > that we really ought to prioritize applying these method

Re: Add recovery to pg_control and remove backup_label

2023-11-20 Thread Andres Freund
Hi, 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 than the benefits. +1. The amoun

Re: Add recovery to pg_control and remove backup_label

2023-11-20 Thread Andres Freund
Hi, 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. Also, for external backups, there's no manifest... - An

Re: PSQL error: total cell count of XXX exceeded

2023-11-20 Thread Alvaro Herrera
On 2023-Sep-12, Tom Lane wrote: > I'm more than a bit skeptical about trying to do something about this, > simply because this range of query result sizes is far past what is > practical. The OP clearly hasn't tested his patch on actually > overflowing query results, and I don't care to either.

Re: Partial aggregates pushdown

2023-11-20 Thread Robert Haas
On Mon, Nov 13, 2023 at 3:26 AM fujii.y...@df.mitsubishielectric.co.jp wrote: > In postgres_fdw.sql, I have corrected the output format for floating point > numbers > by extra_float_digits. Looking at this, I find that it's not at all clear to me how the partial aggregate function is defined. Le

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

2023-11-20 Thread Robert Haas
On Tue, Nov 14, 2023 at 11:21 PM Jeff Davis wrote: > After adding the search path cache (recent commit f26c2368dc) hopefully > that helps to make the above suggestion more reasonable performance- > wise. I think we can call that progress. I agree. Not to burden you, but do you know what the overh

Re: Annoying build warnings from latest Apple toolchain

2023-11-20 Thread Tom Lane
Robert Haas writes: > Is there still outstanding work on this thread? Because I'm just now > using a new MacBook (M2, Ventura 13.6.2) and I'm getting a lot of this > kind of thing in a meson build: 13.6.2? longfin's host is on 13.6.1, and the only thing Software Update is showing me is an option

Re: Annoying build warnings from latest Apple toolchain

2023-11-20 Thread Robert Haas
On Mon, Nov 20, 2023 at 3:53 PM Tom Lane wrote: > 13.6.2? longfin's host is on 13.6.1, and the only thing Software > Update is showing me is an option to upgrade to Sonoma. But anyway... Uh, I guess Apple made a special version just for me? That's definitely what it says. > > [2264/2287] Linki

Re: Add recovery to pg_control and remove backup_label

2023-11-20 Thread David G. Johnston
On Mon, Nov 20, 2023 at 1:37 PM 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", that we > set > when creating a streaming base backup > > I thought this was DOA since we don't want

Re: Annoying build warnings from latest Apple toolchain

2023-11-20 Thread Tom Lane
Robert Haas writes: > On Mon, Nov 20, 2023 at 3:53 PM Tom Lane wrote: >> 13.6.2? longfin's host is on 13.6.1, and the only thing Software >> Update is showing me is an option to upgrade to Sonoma. But anyway... > Uh, I guess Apple made a special version just for me? That's > definitely what it

Re: PANIC serves too many masters

2023-11-20 Thread Jeff Davis
Hi, On Sat, 2023-11-18 at 14:29 -0800, Andres Freund wrote: > I don't quite know what we should do. But the current situation > decidedly > doesn't seem great. Agreed. Better classification is nice, but it also requires more discipline and it might not always be obvious which category something f

Re: Annoying build warnings from latest Apple toolchain

2023-11-20 Thread Tom Lane
I wrote: > The autoconf side seems to just be letting this option default. > I'm not sure what the default choice is, but evidently it's not > "-undefined error"? Or were they stupid enough to not allow you > to explicitly select the default behavior? Seems we are not the only project having trou

Re: PANIC serves too many masters

2023-11-20 Thread Tom Lane
Jeff Davis writes: > On Sat, 2023-11-18 at 14:29 -0800, Andres Freund wrote: >> I don't quite know what we should do. But the current situation >> decidedly >> doesn't seem great. > Agreed. +1 > Better classification is nice, but it also requires more > discipline and it might not always be obv

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

2023-11-20 Thread Jeff Davis
On Mon, 2023-11-20 at 15:52 -0500, Robert Haas wrote: > I agree. Not to burden you, but do you know what the overhead is now, > and do you have any plans to further reduce it? I don't believe > that's > the only thing we ought to be doing here, necessarily, but it is one > thing that we definitely

Re: PSQL error: total cell count of XXX exceeded

2023-11-20 Thread Tom Lane
Alvaro Herrera writes: > I think we're bound to hit this limit at some point in the future, and > it seems easy enough to solve. I propose the attached, which is pretty > much what Hongxu last submitted, with some minor changes. This bit needs more work: - content->cells = pg_malloc0((nco

Re: PANIC serves too many masters

2023-11-20 Thread Jeff Davis
On Mon, 2023-11-20 at 17:12 -0500, Tom Lane wrote: > I'd be inclined to keep PANIC with its current meaning, and > incrementally change call sites where we decide that's not the > best behavior.  I think those will be a minority, maybe a small > minority.  (PANIC_EXIT had darn well better be a smal

Re: Partial aggregates pushdown

2023-11-20 Thread Bruce Momjian
On Mon, Nov 20, 2023 at 03:51:33PM -0500, Robert Haas wrote: > On Mon, Nov 13, 2023 at 3:26 AM fujii.y...@df.mitsubishielectric.co.jp > wrote: > > In postgres_fdw.sql, I have corrected the output format for floating point > > numbers > > by extra_float_digits. > > Looking at this, I find that it

Re: Hide exposed impl detail of wchar.c

2023-11-20 Thread Nathan Bossart
On Mon, Nov 20, 2023 at 10:50:36AM -0800, Jubilee Young wrote: > In that case, I took a look across the codebase and saw a > utils/ascii.h that doesn't > seem to have gotten much love, but I suppose one could argue that it's > intended > to be a backend-only header file? That might work. It's no

Re: PANIC serves too many masters

2023-11-20 Thread Tom Lane
Jeff Davis writes: > Is the error level the right way to express what we want to happen? It > seems like what we really want is to decide on the behavior, i.e. > restart or not, and generate core or not. That could be done a > different way, like: > ereport(PANIC, > (errmsg("could not

Re: PANIC serves too many masters

2023-11-20 Thread Andres Freund
Hi, On 2023-11-20 17:55:32 -0500, Tom Lane wrote: > Jeff Davis writes: > > Is the error level the right way to express what we want to happen? It > > seems like what we really want is to decide on the behavior, i.e. > > restart or not, and generate core or not. That could be done a > > different

Re: Add recovery to pg_control and remove backup_label

2023-11-20 Thread Michael Paquier
On Mon, Nov 20, 2023 at 11:11:13AM -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 than the benefits. The last

Re: Add recovery to pg_control and remove backup_label

2023-11-20 Thread Andres Freund
Hi, On 2023-11-20 14:18:15 -0700, David G. Johnston wrote: > On Mon, Nov 20, 2023 at 1:37 PM 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", that we > > set > > when creati

Re: Why is hot_standby_feedback off by default?

2023-11-20 Thread Andres Freund
On 2023-11-20 16:34:47 +0700, John Naylor wrote: > Sounds like a TODO? WFM. I don't personally use or update TODO, as I have my doubts about its usefulness or state of maintenance. But please feel free to add this as a TODO from my end...

Re: Add recovery to pg_control and remove backup_label

2023-11-20 Thread Michael Paquier
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", that we set > when creating a streaming base backup That would mean that one still needs to ta

Re: Add recovery to pg_control and remove backup_label

2023-11-20 Thread Andres Freund
Hi, 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", that we set > > when creating a

Re: Hide exposed impl detail of wchar.c

2023-11-20 Thread Andres Freund
Hi, On 2023-11-16 17:11:03 -0800, Jubilee Young wrote: > We don't directly `#include` C into Rust, but use libclang to preprocess and > compile a wrapping C header into a list of symbols Rust will look for at link > time. Our failure is in libclang and how we steer it: > - The Clang-C API (libclan

Re: Show WAL write and fsync stats in pg_stat_io

2023-11-20 Thread Michael Paquier
On Mon, Nov 20, 2023 at 05:43:17PM +0300, Nazir Bilal Yavuz wrote: > Yes, the timings for the writes and the syncs should work. Another > question I have in mind is the pg_stat_reset_shared() function. When > we call it with 'io' it will reset pg_stat_wal's timings and when we > call it with 'wal'

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

2023-11-20 Thread Alena Rybakina
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 of the node in the get_key_nconst_node(), y

Re: Faster "SET search_path"

2023-11-20 Thread Jeff Davis
On Thu, 2023-11-16 at 16:46 -0800, Jeff Davis wrote: > While I considered OOM during hash key initialization, I missed some > other potential out-of-memory hazards. Attached a fixup patch 0003, > which re-introduces one list copy but it simplifies things > substantially in addition to being safer a

Re: Adding facility for injection points (or probe points?) for more advanced tests

2023-11-20 Thread Michael Paquier
On Mon, Nov 20, 2023 at 04:53:45PM +0530, Ashutosh Bapat wrote: > On Wed, Oct 25, 2023 at 9:43 AM Michael Paquier wrote: >> I have added some documentation to explain that, as well. I am not >> wedded to the name proposed in the patch, so if you feel there is >> better, feel free to propose ideas

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

2023-11-20 Thread Bruce Momjian
On Fri, Sep 8, 2023 at 05:10:51PM -0400, Bruce Momjian wrote: > I knew we only considered the array dimension sizes to be documentation > _in_ the query, but I thought we at least properly displayed the number > of dimensions specified at creation when we described the table in psql, > but it seem

Re: pg_upgrade and logical replication

2023-11-20 Thread Michael Paquier
On Mon, Nov 20, 2023 at 09:49:41AM +0530, Amit Kapila wrote: > On Tue, Nov 14, 2023 at 7:21 AM vignesh C wrote: >> There are couple of things happening here: a) In the first part we >> take care of setting subscription relation to SYNCDONE and dropping >> the replication slot at publisher node, on

Re: meson documentation build open issues

2023-11-20 Thread Andres Freund
Hi, On 2023-11-20 08:27:48 +0100, Peter Eisentraut wrote: > On 17.11.23 19:53, Andres Freund wrote: > > I pushed the first two commits (the selinux stuff) and worked a bit more on > > the subsequent ones. > > Patches 0001 through 0004 look good to me. Cool, I pushed them now. > Some possible s

Re:Re:Re: How to solve the problem of one backend process crashing and causing other processes to restart?

2023-11-20 Thread yuansong
thanks,After reconsideration, I realized that what I really want is for other connections to remain unaffected when a process crashes. This is something that a connection pool cannot solve. At 2023-11-14 09:41:03, "Thomas wen" wrote: Hi yuansong there is connnection pool path (htt

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

2023-11-20 Thread Tom Lane
Bruce Momjian writes: > I would like to apply this patch to master because I think our current > deficiencies in this area are unacceptable. I do not think this is a particularly good idea, because it creates the impression in a couple of places that we track this data, when we do not really do s

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

2023-11-20 Thread Bruce Momjian
On Mon, Nov 20, 2023 at 09:04:21PM -0500, Tom Lane wrote: > Bruce Momjian writes: > > I would like to apply this patch to master because I think our current > > deficiencies in this area are unacceptable. > > I do not think this is a particularly good idea, because it creates > the impression in

simplehash: SH_OPTIMIZE_REPEAT for optimizing repeated lookups of the same key

2023-11-20 Thread Jeff Davis
Patch attached. The caller could do something similar, so this option is not necessary, but it seems like it could be generally useful. It speeds things up for the search_path cache (and is an alternative to another patch I have that implements the same thing in the caller). Thoughts? Regards,

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

2023-11-20 Thread Tom Lane
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 >>> dimensionality. >> I could get behind that, perhaps. It looks like we're not us

Re: Add recovery to pg_control and remove backup_label

2023-11-20 Thread Michael Paquier
On Mon, Nov 20, 2023 at 03:58:55PM -0800, Andres Freund wrote: > I was thinking we'd just set it in the pg_basebackup style path, and we'd > error out if it's set and backup_label is present. But we'd still use > backup_label without the pg_control flag set. > > So it'd just provide a cross-check t

  1   2   >