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

2024-03-05 Thread Andres Freund
Hi, On 2024-03-05 16:41:30 +0700, John Naylor wrote: > I'd like to push 0001 and 0002 shortly, and then do another sweep over > 0003, with remaining feedback, and get that in so we get some > buildfarm testing before the remaining polishing work on > tidstore/vacuum. A few ARM buildfarm animals

Re: Hooking into ExplainOneQuery() complicated by missing standard_ExplainOneQuery

2024-03-05 Thread Mats Kindahl
On Wed, Mar 6, 2024 at 3:27 AM Andrei Lepikhov wrote: > On 6/3/2024 06:25, Michael Paquier wrote: > >> Just to elaborate: the intention was to allow a section to be added to > >> every node in the plan containing information from further down and also > >> allow this information to propagate

Re: UUID v7

2024-03-05 Thread Peter Eisentraut
On 30.01.24 14:35, Andrey M. Borodin wrote: On 30 Jan 2024, at 15:33, Junwang Zhao wrote: It's always good to add a newline at the end of a source file, though this might be nitpicky. Thanks, also fixed warning found by CFBot. I have various comments on this patch: -

broken JIT support on Fedora 40

2024-03-05 Thread Pavel Stehule
Hi after today update, the build with --with-llvm produces broken code, and make check fails with crash Upgradehwdata-0.380-1.fc40.noarch @updates-testing Upgraded hwdata-0.379-1.fc40.noarch @@System Upgradellvm-18.1.0~rc4-1.fc40.x86_64

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

2024-03-05 Thread Masahiko Sawada
On Wed, Mar 6, 2024 at 12:59 PM John Naylor wrote: > > On Tue, Mar 5, 2024 at 11:12 PM Masahiko Sawada wrote: > > > > On Tue, Mar 5, 2024 at 6:41 PM John Naylor wrote: > > > > Done in v66-0009. I'd be curious to hear any feedback. I like the > > > aspect that the random numbers come from a

Re: Synchronizing slots from primary to standby

2024-03-05 Thread Masahiko Sawada
On Fri, Mar 1, 2024 at 3:22 PM Peter Smith wrote: > > On Fri, Mar 1, 2024 at 5:11 PM Masahiko Sawada wrote: > > > ... > > +/* > > + * "*" is not accepted as in that case primary will not be able to > > know > > + * for which all standbys to wait for. Even if we have

Re: Make COPY format extendable: Extract COPY TO format implementations

2024-03-05 Thread Michael Paquier
On Tue, Mar 05, 2024 at 05:18:08PM +0900, Sutou Kouhei wrote: > I'll send the following patches after this patch is > merged. I am not sure that my schedule is on track to allow that for this release, unfortunately, especially with all the other items to review and discuss to make this thread

Re: Injection points: some tools to wait and wake

2024-03-05 Thread Michael Paquier
On Tue, Mar 05, 2024 at 09:43:03AM +0100, Jelte Fennema-Nio wrote: > I do think there is quite a bit of a difference from a user > perspective to providing a few custom configure flags and having to go > to a separate directory and run "make install" there too. Simply > because it's yet another

Re: Shared detoast Datum proposal

2024-03-05 Thread Nikita Malakhov
Hi, In addition to the previous message - for the toast_fetch_datum_slice the first (seems obvious) way is to detoast the whole value, save it to cache and get slices from it on demand. I have another one on my mind, but have to play with it first. -- Regards, Nikita Malakhov Postgres

Re: Fix race condition in InvalidatePossiblyObsoleteSlot()

2024-03-05 Thread Michael Paquier
On Tue, Mar 05, 2024 at 10:17:03AM +, Bertrand Drouvot wrote: > On Tue, Mar 05, 2024 at 09:42:20AM +0900, Michael Paquier wrote: >> First, in a build where 818fefd8fd is included, this makes the test >> script a lot slower. Most of the logic is quick, but we're spending >> 10s or so checking

Potential stack overflow in incremental base backup

2024-03-05 Thread Thomas Munro
Hi Robert, I was rebasing my patch to convert RELSEG_SIZE into an initdb-time setting, and thus runtime variable, and I noticed this stack variable in src/backend/backup/basebackup_incremental.c: GetFileBackupMethod(IncrementalBackupInfo *ib, const char *path,

Re: Missing LWLock protection in pgstat_reset_replslot()

2024-03-05 Thread shveta malik
On Tue, Mar 5, 2024 at 6:52 PM Bertrand Drouvot wrote: > > > /* > > * Nothing to do for physical slots as we collect stats only for logical > > * slots. > > */ > > if (SlotIsPhysical(slot)) > > return; > > D'oh! Thanks! Fixed in v2 shared up-thread. Thanks. Can we try to get rid of multiple

Re: Synchronizing slots from primary to standby

2024-03-05 Thread Masahiko Sawada
On Wed, Mar 6, 2024 at 12:47 PM Amit Kapila wrote: > > On Wed, Mar 6, 2024 at 7:36 AM Masahiko Sawada wrote: > > > > On Tue, Mar 5, 2024 at 4:21 PM Zhijie Hou (Fujitsu) > > wrote: > > > > I have one question about PhysicalWakeupLogicalWalSnd(): > > > > +/* > > + * Wake up the logical walsender

Re: Switching XLog source from archive to streaming when primary available

2024-03-05 Thread Bharath Rupireddy
On Wed, Mar 6, 2024 at 1:22 AM Nathan Bossart wrote: > > I was thinking of something more like > > typedef enum > { > NO_FORCE_SWITCH_TO_STREAMING, /* no switch > necessary */ > FORCE_SWITCH_TO_STREAMING_PENDING, /* exhausting pg_wal

Re: remaining sql/json patches

2024-03-05 Thread Amit Langote
Hi Tomas, On Wed, Mar 6, 2024 at 6:30 AM Tomas Vondra wrote: > > Hi, > > I know very little about sql/json and all the json internals, but I > decided to do some black box testing. I built a large JSONB table > (single column, ~7GB of data after loading). And then I did a query > transforming

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

2024-03-05 Thread John Naylor
On Tue, Mar 5, 2024 at 11:12 PM Masahiko Sawada wrote: > > On Tue, Mar 5, 2024 at 6:41 PM John Naylor wrote: > > Done in v66-0009. I'd be curious to hear any feedback. I like the > > aspect that the random numbers come from a different seed every time > > the test runs. > > The new tests look

Re: Synchronizing slots from primary to standby

2024-03-05 Thread Amit Kapila
On Wed, Mar 6, 2024 at 7:36 AM Masahiko Sawada wrote: > > On Tue, Mar 5, 2024 at 4:21 PM Zhijie Hou (Fujitsu) > wrote: > > I have one question about PhysicalWakeupLogicalWalSnd(): > > +/* > + * Wake up the logical walsender processes with logical failover slots if the > + * currently acquired

Re: "type with xxxx does not exist" when doing ExecMemoize()

2024-03-05 Thread Andrei Lepikhov
On 6/3/2024 10:10, Tender Wang wrote: Andrei Lepikhov > 于2024年3月5日周二 17:36写道: On 1/3/2024 14:18, Tender Wang wrote: > During debug, I learned that numeric_add doesn't have type check like > rangetype, so aboved query will not report "type

Re: "type with xxxx does not exist" when doing ExecMemoize()

2024-03-05 Thread Tender Wang
Andrei Lepikhov 于2024年3月5日周二 17:36写道: > On 1/3/2024 14:18, Tender Wang wrote: > > During debug, I learned that numeric_add doesn't have type check like > > rangetype, so aboved query will not report "type with xxx does not > exist". > > > > And I realize that the test case added by Andrei

RE: Synchronizing slots from primary to standby

2024-03-05 Thread Zhijie Hou (Fujitsu)
On Wednesday, March 6, 2024 9:30 AM Masahiko Sawada wrote: Hi, > On Fri, Mar 1, 2024 at 4:21 PM Zhijie Hou (Fujitsu) > wrote: > > > > On Friday, March 1, 2024 2:11 PM Masahiko Sawada > wrote: > > > > > > > > > --- > > > +void > > > +assign_standby_slot_names(const char *newval, void *extra)

Re: CREATE DATABASE with filesystem cloning

2024-03-05 Thread Thomas Munro
On Wed, Mar 6, 2024 at 3:16 PM Thomas Munro wrote: > Here's a rebase. Now with a wait event and a paragraph of documentation. From 9d5a60e9a9cc4a4312de3081be99c254a8876e42 Mon Sep 17 00:00:00 2001 From: Thomas Munro Date: Sat, 2 Sep 2023 22:21:49 +1200 Subject: [PATCH v4] CREATE DATABASE ...

Re: Hooking into ExplainOneQuery() complicated by missing standard_ExplainOneQuery

2024-03-05 Thread Andrei Lepikhov
On 6/3/2024 06:25, Michael Paquier wrote: Just to elaborate: the intention was to allow a section to be added to every node in the plan containing information from further down and also allow this information to propagate upwards. We happen to have buffer information right now, but allowing

Re: Support "Right Semi Join" plan shapes

2024-03-05 Thread wenhui qiu
Hi Alena Rybakina For merge join + /* + * For now we do not support RIGHT_SEMI join in mergejoin. + */ + if (jointype == JOIN_RIGHT_SEMI) + { + *mergejoin_allowed = false; + return NIL; + } + Tanks On Wed, 6 Mar 2024 at 04:10, Alena Rybakina wrote: > To be honest, I didn't see it in the code,

Re: CREATE DATABASE with filesystem cloning

2024-03-05 Thread Thomas Munro
On Wed, Oct 11, 2023 at 7:40 PM Peter Eisentraut wrote: > On 07.10.23 07:51, Thomas Munro wrote: > > Here is an experimental POC of fast/cheap database cloning. > > Here are some previous discussions of this: > > https://www.postgresql.org/message-id/flat/20131001223108.GG23410%40saarenmaa.fi > >

Re: Synchronizing slots from primary to standby

2024-03-05 Thread Masahiko Sawada
On Tue, Mar 5, 2024 at 4:21 PM Zhijie Hou (Fujitsu) wrote: > > On Tuesday, March 5, 2024 2:35 PM shveta malik wrote: > > > > On Tue, Mar 5, 2024 at 9:15 AM Amit Kapila wrote: > > > > > > On Tue, Mar 5, 2024 at 6:10 AM Peter Smith > > wrote: > > > > > > > > == > > > >

Re: speed up a logical replica setup

2024-03-05 Thread Euler Taveira
On Tue, Mar 5, 2024, at 12:48 AM, Shubham Khanna wrote: > I applied the v25 patch and did RUN the 'pg_createsubscriber' command. > I was unable to execute it and experienced the following error: > > $ ./pg_createsubscriber -D node2/ -P "host=localhost port=5432 > dbname=postgres" -d postgres -d

Re: Synchronizing slots from primary to standby

2024-03-05 Thread Masahiko Sawada
On Fri, Mar 1, 2024 at 4:21 PM Zhijie Hou (Fujitsu) wrote: > > On Friday, March 1, 2024 2:11 PM Masahiko Sawada > wrote: > > > > > > --- > > +void > > +assign_standby_slot_names(const char *newval, void *extra) { > > +List *standby_slots; > > +MemoryContext oldcxt; > > +

Re: [PATCH] Exponential backoff for auth_delay

2024-03-05 Thread Jacob Champion
On Tue, Mar 5, 2024 at 1:51 PM Nathan Bossart wrote: > I don't have a strong opinion about making this configurable, but I do > think we should consider making this a hash table so that we can set > MAX_CONN_RECORDS much higher. I'm curious why? It seems like the higher you make

Re: Make query cancellation keys longer

2024-03-05 Thread Bruce Momjian
On Fri, Mar 1, 2024 at 03:19:23PM +0100, Peter Eisentraut wrote: > On 29.02.24 22:25, Heikki Linnakangas wrote: > > Currently, cancel request key is a 32-bit token, which isn't very much > > entropy. If you want to cancel another session's query, you can > > brute-force it. In most environments,

Re: Improve readability by using designated initializers when possible

2024-03-05 Thread Japin Li
On Wed, 06 Mar 2024 at 01:53, Jelte Fennema-Nio wrote: > On Tue, 5 Mar 2024 at 15:30, Japin Li wrote: >> There is a warning if remove it, so I keep it. >> >> /home/japin/Codes/postgres/build/../src/backend/executor/execExprInterp.c:118:33: >> warning: label ‘CASE_EEOP_LAST’ defined but not

Re: Proposal for implementing OCSP Stapling in PostgreSQL

2024-03-05 Thread David Zhang
Hi Hackers, This is the third version patch for "Certificate status check using OCSP Stapling" with ssl regression test cases added. Here is how I run the ssl regression test:     ./configure --enable-tap-tests --with-openssl     make -j     cd src/test/ssl     make sslfiles     make check

Re: Hooking into ExplainOneQuery() complicated by missing standard_ExplainOneQuery

2024-03-05 Thread Michael Paquier
On Tue, Mar 05, 2024 at 08:21:34AM +0100, Mats Kindahl wrote: > I realize that a more advanced system is possible to create where you can > customize the output even more, but in this case I just wanted to add a > section with some additional information related to plan execution. Also, > the code

Re: vacuumdb/clusterdb/reindexdb: allow specifying objects to process in all databases

2024-03-05 Thread Dean Rasheed
On Tue, 5 Mar 2024 at 02:22, Nathan Bossart wrote: > > I saw that this thread was referenced elsewhere [0], so I figured I'd take > a fresh look. From a quick glance, I'd say 0001 and 0002 are pretty > reasonable and could probably be committed for v17. > I'm not sure how useful these changes

Re: pg_upgrade --copy-file-range

2024-03-05 Thread Thomas Munro
On Wed, Mar 6, 2024 at 2:43 AM Peter Eisentraut wrote: > As far as I can tell, the original pg_upgrade patch has been ready to > commit since October. Unless Thomas has any qualms that have not been > made explicit in this thread, I suggest we move ahead with that. pg_upgrade --copy-file-range

Re: Remove unnecessary code from psql's watch command

2024-03-05 Thread Michael Paquier
On Tue, Mar 05, 2024 at 10:05:52PM +0900, Yugo NAGATA wrote: > In the current code of do_watch(), sigsetjmp is called if WIN32 > is defined, but siglongjmp is not called in the signal handler > in this condition. On Windows, currently, cancellation is checked > only by cancel_pressed, and calling

Re: Refactoring backend fork+exec code

2024-03-05 Thread Tristan Partin
On Mon Mar 4, 2024 at 3:05 AM CST, Heikki Linnakangas wrote: I've now completed many of the side-quests, here are the patches that remain. The first three patches form a logical unit. They move the initialization of the Port struct from postmaster to the backend process. Currently, that work

Re: Improving contrib/tablefunc's error reporting

2024-03-05 Thread Tom Lane
Joe Conway writes: > I will have a look at your patches, and the other issue you mention, but > it might be a day or three before I can give it some quality time. No hurry certainly. Thanks for looking. regards, tom lane

Re: Experiments with Postgres and SSL

2024-03-05 Thread Jacob Champion
I keep forgetting -- attached is the diff I'm carrying to plug libpq_encryption into Meson. (The current patchset has a meson.build for it, but it's not connected.) --Jacob commit 64215f1e6b68208378b34cc0736d2f0eb1d45919 Author: Jacob Champion Date: Wed Feb 28 11:28:17 2024 -0800 WIP:

Re: Popcount optimization using AVX512

2024-03-05 Thread Bruce Momjian
On Tue, Mar 5, 2024 at 04:52:23PM +, Amonson, Paul D wrote: > -Original Message- > >From: Nathan Bossart > >Sent: Tuesday, March 5, 2024 8:38 AM > >To: Amonson, Paul D > >Cc: Andres Freund ; Alvaro Herrera > >; Shankaran, Akash ; > >Noah Misch ; Tom Lane ; Matthias van > >de

Re: Improving contrib/tablefunc's error reporting

2024-03-05 Thread Joe Conway
On 3/5/24 17:04, Tom Lane wrote: After reading the thread at [1], I could not escape the feeling that contrib/tablefunc's error reporting is very confusing. Looking into the source code, I soon found that it is also very inconsistent, with similar error reports being phrased quite differently.

Improving contrib/tablefunc's error reporting

2024-03-05 Thread Tom Lane
After reading the thread at [1], I could not escape the feeling that contrib/tablefunc's error reporting is very confusing. Looking into the source code, I soon found that it is also very inconsistent, with similar error reports being phrased quite differently. The terminology for column names

Re: Get rid of the excess semicolon in planner.c

2024-03-05 Thread David Rowley
On Wed, 6 Mar 2024 at 00:43, Richard Guo wrote: > > I think this is a typo introduced in 0452b461b. > > +root->processed_groupClause = list_copy(parse->groupClause);; "git grep -E ";;$" -- *.c *.h" tell me it's the only one. Pushed. David

Re: sslinfo extension - add notbefore and notafter timestamps

2024-03-05 Thread Jacob Champion
On Mon, Mar 4, 2024 at 6:23 AM Daniel Gustafsson wrote: > > On 12 Sep 2023, at 21:40, Jacob Champion wrote: Sorry for the long delay! > >> + ssl_client_get_notbefore() returns text > >> ...> + ssl_client_get_notafter() returns text > > > > I think this should say timestamptz rather

Re: [PATCH] Exponential backoff for auth_delay

2024-03-05 Thread Nathan Bossart
On Mon, Mar 04, 2024 at 08:42:55PM +0100, Michael Banck wrote: > On Wed, Feb 21, 2024 at 10:26:11PM +0100, Tomas Vondra wrote: >> I think it'd be good to consider: >> >> - Making the acr_array a hash table, and larger than 50 entries (I >> wonder if that should be dynamic / customizable by GUC?).

Re: remaining sql/json patches

2024-03-05 Thread Tomas Vondra
Hi, I know very little about sql/json and all the json internals, but I decided to do some black box testing. I built a large JSONB table (single column, ~7GB of data after loading). And then I did a query transforming the data into tabular form using JSON_TABLE. The JSON_TABLE query looks like

Re: processes stuck in shutdown following OOM/recovery

2024-03-05 Thread Thomas Munro
On Sat, Dec 2, 2023 at 3:30 PM Thomas Munro wrote: > On Sat, Dec 2, 2023 at 2:18 PM Thomas Munro wrote: > > On Fri, Dec 1, 2023 at 6:13 PM Justin Pryzby wrote: > > > $ kill -9 2524495; sleep 0.05; pg_ctl -D ./pgdev.dat1 stop -m fast # > > > 2524495 is a child's pid > > > > > This affects v15,

Re: Support "Right Semi Join" plan shapes

2024-03-05 Thread Alena Rybakina
To be honest, I didn't see it in the code, could you tell me where they are, please? On 05.03.2024 05:44, Richard Guo wrote: On Tue, Jan 30, 2024 at 2:51 PM Alena Rybakina wrote: I have reviewed your patch and I think it is better to add an Assert for JOIN_RIGHT_SEMI to the

Re: Revisiting {CREATE INDEX, REINDEX} CONCURRENTLY improvements

2024-03-05 Thread Matthias van de Meent
On Wed, 21 Feb 2024 at 12:37, Michail Nikolaev wrote: > > Hi! > > > How do you suppose this would work differently from a long-lived > > normal snapshot, which is how it works right now? > > Difference in the ability to take new visibility snapshot periodically > during the second phase with

Re: Switching XLog source from archive to streaming when primary available

2024-03-05 Thread Nathan Bossart
On Tue, Mar 05, 2024 at 11:38:37PM +0530, Bharath Rupireddy wrote: > On Tue, Mar 5, 2024 at 7:34 AM Nathan Bossart > wrote: >> Is there any way to simplify this? For >> example, would it be possible to make an enum that tracks the >> streaming_replication_retry_interval state? > > I guess the

Re: Introduce XID age and inactive timeout based replication slot invalidation

2024-03-05 Thread Nathan Bossart
On Wed, Mar 06, 2024 at 12:50:38AM +0530, Bharath Rupireddy wrote: > On Mon, Mar 4, 2024 at 2:11 PM Bertrand Drouvot > wrote: >> On Sun, Mar 03, 2024 at 03:44:34PM -0600, Nathan Bossart wrote: >> > Unless I am misinterpreting some details, ISTM we could rename this column >> > to

Re: Introduce XID age and inactive timeout based replication slot invalidation

2024-03-05 Thread Bharath Rupireddy
On Mon, Mar 4, 2024 at 2:11 PM Bertrand Drouvot wrote: > > On Sun, Mar 03, 2024 at 03:44:34PM -0600, Nathan Bossart wrote: > > On Sun, Mar 03, 2024 at 11:40:00PM +0530, Bharath Rupireddy wrote: > > > On Sat, Mar 2, 2024 at 3:41 AM Nathan Bossart > > > wrote: > > >> Would you ever see "conflict"

Re: Support a wildcard in backtrace_functions

2024-03-05 Thread Alvaro Herrera
On 2024-Mar-06, Bharath Rupireddy wrote: > +1 for disallowing *foo or foo* or foo*bar etc. combinations. Cool. > I think we need to go a bit further and convert backtrace_functions of > type GUC_LIST_INPUT so that check_backtrace_functions can just use > SplitIdentifierString to parse the list

Re: Experiments with Postgres and SSL

2024-03-05 Thread Jacob Champion
On Tue, Mar 5, 2024 at 6:09 AM Heikki Linnakangas wrote: > > I hope I didn't joggle your elbow reviewing this Nope, not at all! > The tests are still not distinguishing whether a connection was > established in direct or negotiated mode. So if we e.g. had a bug that > accidentally disabled

Re: Support a wildcard in backtrace_functions

2024-03-05 Thread Bharath Rupireddy
On Thu, Feb 29, 2024 at 4:05 PM Alvaro Herrera wrote: > > Hmm, so if I write "foo,*" this will work but check all function names > first and on the second entry. But if I write "foo*" the GUC value will > be accepted but match nothing (as will "*foo" or "foo*bar"). I don't > like either of

Re: [PATCH] updates to docs about HOT updates for BRIN

2024-03-05 Thread Jeff Davis
On Tue, 2024-03-05 at 09:53 -0600, Elizabeth Christensen wrote: > Looks good to me. Thanks! Thank you, committed. Regards, Jeff Davis

Re: Switching XLog source from archive to streaming when primary available

2024-03-05 Thread Bharath Rupireddy
On Tue, Mar 5, 2024 at 7:34 AM Nathan Bossart wrote: > > cfbot claims that this one needs another rebase. Yeah, the conflict was with the new TAP test file name in src/test/recovery/meson.build. > I've spent some time thinking about this one. I'll admit I'm a bit worried > about adding more

Re: pgsql: Fix search_path to a safe value during maintenance operations.

2024-03-05 Thread Jeff Davis
On Tue, 2024-03-05 at 17:19 +0100, Alvaro Herrera wrote: > This appears to have upset the sepgsql tests.  In buildfarm member > rhinoceros there's now a bunch of errors like this Thank you, pushed, and it appears to have fixed the problem. Regards, Jeff Davis

Re: Improve readability by using designated initializers when possible

2024-03-05 Thread Jelte Fennema-Nio
On Tue, 5 Mar 2024 at 15:30, Japin Li wrote: > There is a warning if remove it, so I keep it. > > /home/japin/Codes/postgres/build/../src/backend/executor/execExprInterp.c:118:33: > warning: label ‘CASE_EEOP_LAST’ defined but not used [-Wunused-label] > 118 | #define EEO_CASE(name)

Re: Dump-restore loosing 'attnotnull' bit for DEFERRABLE PRIMARY KEY column(s).

2024-03-05 Thread Alvaro Herrera
On 2024-Mar-05, Dean Rasheed wrote: > Looking at the other places that call RelationGetIndexAttrBitmap() > with INDEX_ATTR_BITMAP_PRIMARY_KEY, they all appear to want to include > deferrable PKs, since they are relying on the result to see which > columns are not nullable. Hmm, I find this

RE: Popcount optimization using AVX512

2024-03-05 Thread Amonson, Paul D
-Original Message- >From: Nathan Bossart >Sent: Tuesday, March 5, 2024 8:38 AM >To: Amonson, Paul D >Cc: Andres Freund ; Alvaro Herrera >; Shankaran, Akash ; Noah >Misch ; Tom Lane ; Matthias van de >Meent ; >pgsql-hackers@lists.postgresql.org >Subject: Re: Popcount optimization

Re: Popcount optimization using AVX512

2024-03-05 Thread Nathan Bossart
On Tue, Mar 05, 2024 at 04:31:15PM +, Amonson, Paul D wrote: > I am not sure what "top-post" means but I am not doing anything different > but using "reply to all" in Outlook. Please enlighten me.  The following link provides some more information:

Re: Adding deprecation notices to pgcrypto documentation

2024-03-05 Thread Nathan Bossart
On Tue, Mar 05, 2024 at 11:50:36AM +0100, Daniel Gustafsson wrote: >> On 4 Mar 2024, at 23:49, Nathan Bossart wrote: >> * Should this be a "Warning" and/or moved to the top of the page? This >> seems like a relatively important notice that folks should see when >> beginning to use pgcrypto. >

Re: [PATCH] updates to docs about HOT updates for BRIN

2024-03-05 Thread Stephen Frost
Greetings, * Jeff Davis (pg...@j-davis.com) wrote: > On Tue, 2024-02-27 at 09:48 -0500, Stephen Frost wrote: > > Attached is an updated patch which drops the 'such as' and adds a > > sentence mentioning that BRIN is the only in-core summarizing index. > > The original patch reads more clearly to

Re: Refactoring backend fork+exec code

2024-03-05 Thread Heikki Linnakangas
On 05/03/2024 11:44, Richard Guo wrote: I noticed that there are still three places in backend_status.c where pgstat_get_beentry_by_backend_id() is referenced.  I think we should replace them with pgstat_get_beentry_by_proc_number(). Fixed, thanks! -- Heikki Linnakangas Neon

RE: Popcount optimization using AVX512

2024-03-05 Thread Amonson, Paul D
Hi, I am not sure what "top-post" means but I am not doing anything different but using "reply to all" in Outlook. Please enlighten me.  This is the new patch with the hand edit to remove the offending lines from the patch file. I did a basic test to make the patch would apply and build. It

Re: pgsql: Fix search_path to a safe value during maintenance operations.

2024-03-05 Thread Alvaro Herrera
On 2024-Mar-05, Jeff Davis wrote: > Fix search_path to a safe value during maintenance operations. > > While executing maintenance operations (ANALYZE, CLUSTER, REFRESH > MATERIALIZED VIEW, REINDEX, or VACUUM), set search_path to > 'pg_catalog, pg_temp' to prevent inconsistent behavior. > >

un-revert the MAINTAIN privilege and the pg_maintain predefined role

2024-03-05 Thread Nathan Bossart
Thanks to Jeff's recent work with commits 2af07e2 and 59825d1, the issue that led to the revert of the MAINTAIN privilege and the pg_maintain predefined role (commit 151c22d) should now be resolved. Specifically, there was a concern that roles with the MAINTAIN privilege could use search_path

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

2024-03-05 Thread Masahiko Sawada
On Tue, Mar 5, 2024 at 6:41 PM John Naylor wrote: > > On Tue, Feb 6, 2024 at 9:58 AM Masahiko Sawada wrote: > > > > On Fri, Feb 2, 2024 at 8:47 PM John Naylor wrote: > > > > It's pretty hard to see what test_pattern() is doing, or why it's > > > useful. I wonder if instead the test could use

Re: [PATCH] updates to docs about HOT updates for BRIN

2024-03-05 Thread Elizabeth Christensen
> On Mar 4, 2024, at 5:32 PM, Jeff Davis wrote: > Attached my own suggested wording that hopefully addresses Stephen and > Alvaro's concerns. I agree that it's tricky to write so I took a more > minimalist approach: > > If this is agreeable I can commit it. > > Regards, > Jeff Davis >

Re: Dump-restore loosing 'attnotnull' bit for DEFERRABLE PRIMARY KEY column(s).

2024-03-05 Thread Dean Rasheed
On Tue, 5 Mar 2024 at 12:36, Alvaro Herrera wrote: > > Yeah. As I said upthread, a good fix seems to require no longer relying > on RelationGetIndexAttrBitmap to obtain the columns in the primary key, > because that function does not include deferred primary keys. I came up > with the attached

Re: Improve readability by using designated initializers when possible

2024-03-05 Thread Japin Li
On Tue, 05 Mar 2024 at 22:03, Jelte Fennema-Nio wrote: > On Tue, 5 Mar 2024 at 14:50, Japin Li wrote: >> Attach a patch to rewrite dispatch_table array using C99-designated >> initializer syntax. > > Looks good. Two small things: Thanks for the review. > > + [EEOP_LAST] = &_EEOP_LAST, >

Re: Slow catchup of 2PC (twophase) transactions on replica in LR

2024-03-05 Thread Давыдов Виталий
Hi Heikki, Thank you for the reply. On Tuesday, March 05, 2024 12:05 MSK, Heikki Linnakangas wrote:  In a nutshell, this changes PREPARE TRANSACTION so that if synchronous_commit is 'off', the PREPARE TRANSACTION is not fsync'd to disk. So if you crash after the PREPARE TRANSACTION has

Re: type cache cleanup improvements

2024-03-05 Thread Teodor Sigaev
I would like to tweak the patch a little bit - change some comments, add some Asserts, etc. Don't you mind? You are welcome! -- Teodor Sigaev E-mail: teo...@sigaev.ru WWW: http://www.sigaev.ru/

Re: Experiments with Postgres and SSL

2024-03-05 Thread Heikki Linnakangas
I hope I didn't joggle your elbow reviewing this, Jacob, but I spent some time rebase and fix various little things: - Incorporated Matthias's test changes - Squashed the client, server and documentation patches. Not much point in keeping them separate, as one requires the other, and if

Re: Reducing the log spam

2024-03-05 Thread Jelte Fennema-Nio
On Tue, 5 Mar 2024 at 14:55, Jim Jones wrote: > > So what about a parameter "log_suppress_sqlstates" that suppresses > > logging ERROR and FATAL messages with the enumerated SQL states? Big +1 from me for this idea.

Re: Improve readability by using designated initializers when possible

2024-03-05 Thread Jelte Fennema-Nio
On Tue, 5 Mar 2024 at 14:50, Japin Li wrote: > Attach a patch to rewrite dispatch_table array using C99-designated > initializer syntax. Looks good. Two small things: + [EEOP_LAST] = &_EEOP_LAST, Is EEOP_LAST actually needed in this array? It seems unused afaict. If indeed not needed,

Re: Reducing the log spam

2024-03-05 Thread Pavel Stehule
Hi út 5. 3. 2024 v 14:55 odesílatel Jim Jones napsal: > Hi Laurenz > > On 05.03.24 13:55, Laurenz Albe wrote: > > Inspired by feedback to [1], I thought about how to reduce log spam. > > > > My experience from the field is that a lot of log spam looks like > > > >database/table/... "xy"

Re: Reducing the log spam

2024-03-05 Thread Jim Jones
Hi Laurenz On 05.03.24 13:55, Laurenz Albe wrote: Inspired by feedback to [1], I thought about how to reduce log spam. My experience from the field is that a lot of log spam looks like database/table/... "xy" does not exist duplicate key value violates unique constraint "xy" So what

Re: bug report: some issues about pg_15_stable(8fa4a1ac61189efffb8b851ee77e1bc87360c445)

2024-03-05 Thread Dean Rasheed
[cc'ing Alvaro] On Tue, 5 Mar 2024 at 10:04, zwj wrote: > > If I only execute merge , I will get the following error: > merge into tgt a using src1 c on a.a = c.a when matched then update set > b = c.b when not matched then insert (a,b) values(c.a,c.b); -- excute fail > ERROR: MERGE

Re: Improve readability by using designated initializers when possible

2024-03-05 Thread Japin Li
On Mon, 04 Mar 2024 at 07:46, Michael Paquier wrote: > On Fri, Mar 01, 2024 at 06:30:10AM +0100, Jelte Fennema-Nio wrote: >> On Fri, 1 Mar 2024 at 06:08, Michael Paquier wrote: >>> Mostly OK to me. Just note that this comment is incorrect because >>> pg_enc2gettext_tbl[] includes elements in

Re: pg_upgrade --copy-file-range

2024-03-05 Thread Peter Eisentraut
On 05.01.24 13:40, Jakub Wartak wrote: Random patch notes: - main meat is in v3-0002*, I hope i did not screw something seriously - in worst case: it is opt-in through switch, so the user always can stick to the classic copy - no docs so far - pg_copyfile_offload_supported() should actually be

Re: Preserve subscription OIDs during pg_upgrade

2024-03-05 Thread Aleksander Alekseev
Hi, > It will be better to preserve them as it will be easier to > compare subscription related objects in pg_subscription and > pg_subscription_rel in the old and new clusters. IMO it would be helpful if you could give a little bit more context on why/when this is useful. Personally I find it

Re: Missing LWLock protection in pgstat_reset_replslot()

2024-03-05 Thread Bertrand Drouvot
Hi, On Tue, Mar 05, 2024 at 02:19:19PM +0530, shveta malik wrote: > On Tue, Mar 5, 2024 at 1:25 PM Heikki Linnakangas wrote: > > > SearchNamedReplicationSlot() will also acquire the lock in LW_SHARED > > mode, when you pass need_lock=true. So that at least should be changed > > to false. > > >

Re: Missing LWLock protection in pgstat_reset_replslot()

2024-03-05 Thread Bertrand Drouvot
Hi, On Tue, Mar 05, 2024 at 09:55:32AM +0200, Heikki Linnakangas wrote: > On 01/03/2024 12:15, Bertrand Drouvot wrote: > > Hi hackers, > > > > I think that pgstat_reset_replslot() is missing LWLock protection. Indeed, > > we > > don't have any guarantee that the slot is active (then preventing

Re: [PATCH] Exponential backoff for auth_delay

2024-03-05 Thread Robert Haas
On Mon, Mar 4, 2024 at 4:58 PM Michael Banck wrote: > Alright, I have changed it so that auth_delay.milliseconds and > auth_delay.max_milliseconds are the only GUCs, their default being 0. If > the latter is 0, the former's value is always taken. If the latter is > non-zero and larger than the

Re: a wrong index choose when statistics is out of date

2024-03-05 Thread Andy Fan
Hi, > >> We should do anything like add column options in the meantime. Those >> are hard to remove once added. > > I will try it very soon. Attached is a PoC version. and here is the test case. create table t(a int, b int, c int) with (autovacuum_enabled=off); create index on t(a, b); create

Re: Reducing the log spam

2024-03-05 Thread Pavel Stehule
Hi út 5. 3. 2024 v 13:55 odesílatel Laurenz Albe napsal: > Inspired by feedback to [1], I thought about how to reduce log spam. > > My experience from the field is that a lot of log spam looks like > > database/table/... "xy" does not exist > duplicate key value violates unique constraint

Remove unnecessary code from psql's watch command

2024-03-05 Thread Yugo NAGATA
Hi, In the current code of do_watch(), sigsetjmp is called if WIN32 is defined, but siglongjmp is not called in the signal handler in this condition. On Windows, currently, cancellation is checked only by cancel_pressed, and calling sigsetjmp in do_watch() is unnecessary. Therefore, we can

Re: index prefetching

2024-03-05 Thread Jakub Wartak
On Fri, Mar 1, 2024 at 3:58 PM Tomas Vondra wrote: [..] > TBH I don't have a clear idea what to do. It'd be cool to have at least > some benefits in v17, but I don't know how to do that in a way that > would be useful in the future. > > For example, the v20240124 patch implements this in the

Reducing the log spam

2024-03-05 Thread Laurenz Albe
Inspired by feedback to [1], I thought about how to reduce log spam. My experience from the field is that a lot of log spam looks like database/table/... "xy" does not exist duplicate key value violates unique constraint "xy" So what about a parameter "log_suppress_sqlstates" that

Re: Dump-restore loosing 'attnotnull' bit for DEFERRABLE PRIMARY KEY column(s).

2024-03-05 Thread Alvaro Herrera
On 2024-Mar-04, Dean Rasheed wrote: > I don't think that this is the right fix. ISTM that the real issue is > that dropping a NOT NULL constraint should not mark the column as > nullable if it is part of a PK, whether or not that PK is deferrable > -- a deferrable PK still marks a column as not

Re: type cache cleanup improvements

2024-03-05 Thread Aleksander Alekseev
Hi, > Thank you for interesting in it! > > > These changes look very promising. Unfortunately the proposed patches > > conflict with each other regardless the order of applying: > > > > ``` > > error: patch failed: src/backend/utils/cache/typcache.c:356 > > error:

Re: Avoid is possible a expensive function call (src/backend/utils/adt/varlena.c)

2024-03-05 Thread Ranier Vilela
Em seg., 4 de mar. de 2024 às 20:28, Tom Lane escreveu: > Michael Paquier writes: > > On Mon, Mar 04, 2024 at 03:08:03PM -0300, Ranier Vilela wrote: > >> I can't see any user validation at the function > pg_newlocale_from_collation. > > > Matthias is right, look closer. I can see more than one

Get rid of the excess semicolon in planner.c

2024-03-05 Thread Richard Guo
I think this is a typo introduced in 0452b461b. +root->processed_groupClause = list_copy(parse->groupClause);; The extra empty statement is harmless in most times, but I still think it would be better to get rid of it. Attached is a trivial patch to do that. Thanks Richard

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

2024-03-05 Thread Alvaro Herrera
On 2024-Mar-04, Tom Lane wrote: > In hopes of noticing whether there are other similar thinkos, > I permuted the order of the SlruPageStatus enum values, and > now I get the expected warnings from gcc: Thanks for checking! I pushed the fixes. Maybe we should assign a nonzero value (= 1) to the

Re: Change prefetch and read strategies to use range in pg_prewarm ... and raise a question about posix_fadvise WILLNEED

2024-03-05 Thread Nazir Bilal Yavuz
Hi, Thanks for working on this! The patches are cleanly applied on top of the current master and all tests are passed. On Thu, 4 Jan 2024 at 02:23, Cedric Villemain wrote: > > Hi, > > I wonder what you think of making pg_prewarm use recent addition on > smgrprefetch and readv ? > > > In order

Re: Adding deprecation notices to pgcrypto documentation

2024-03-05 Thread Daniel Gustafsson
> On 4 Mar 2024, at 23:49, Nathan Bossart wrote: > > On Mon, Mar 04, 2024 at 10:03:13PM +0100, Daniel Gustafsson wrote: >> Cleaning out my inbox I came across this which I still think is worth doing, >> any objections to going ahead with it? > > I think the general idea is reasonable, but I

Re: Change GUC hashtable to use simplehash?

2024-03-05 Thread John Naylor
On Tue, Jan 30, 2024 at 5:04 PM John Naylor wrote: > > On Tue, Jan 30, 2024 at 4:13 AM Ants Aasma wrote: > > But given that we know the data length and we have it in a register > > already, it's easy enough to just mask out data past the end with a > > shift. See patch 1. Performance benefit is

Re: Fix race condition in InvalidatePossiblyObsoleteSlot()

2024-03-05 Thread Bertrand Drouvot
Hi, On Tue, Mar 05, 2024 at 09:42:20AM +0900, Michael Paquier wrote: > On Mon, Feb 26, 2024 at 02:01:45PM +, Bertrand Drouvot wrote: > > Though [1] mentioned up-thread is not pushed yet, I'm Sharing the POC patch > > now > > (see the attached). > > I have looked at what you have here.

?????? bug report: some issues about pg_15_stable(8fa4a1ac61189efffb8b851ee77e1bc87360c445)

2024-03-05 Thread zwj
Hi??hackers I may have discovered another issue in the concurrency scenario of merge, and I am currently not sure if this new issue is related to the previous one. It seems that it may also be an issue with the EPQ mechanism in the merge scenario? I will provide this test case, hoping it will

  1   2   >