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

2023-11-30 Thread Alena Rybakina
Hi! Honestly, it seems very hard to avoid the conclusion that this transformation is being done at too early a stage. Parse analysis is not the time to try to do query optimization. I can't really believe that there's a way to produce a committable patch along these lines. Ideally, a transform

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

2023-11-30 Thread Alena Rybakina
Sorry, I forgot to apply my patches. For the first experiment was 0001-OR-to-ANY-in-parser-and-ANY-to-OR-in-index.diff and for the second experiment was 0002-OR-to-ANY-in-index.diff. On 30.11.2023 11:00, Alena Rybakina wrote: Hi! Honestly, it seems very hard to avoid the conclusion that th

Re: pg_upgrade and logical replication

2023-11-30 Thread Amit Kapila
On Wed, Nov 29, 2023 at 3:02 PM Amit Kapila wrote: > In general, the test cases are a bit complex to understand, so, it will be difficult to enhance these later. The complexity comes from the fact that one upgrade test is trying to test multiple things (a) Enabled/Disabled subscriptions; (b) rela

Re: [Proposal] global sequence implemented by snowflake ID

2023-11-30 Thread Nikita Malakhov
Hi! I have reviewed the patch in this topic and have a question mentioning the machine ID - INSERT INTO snowflake_sequence.machine_id SELECT round((random() * (0 - 511))::numeric, 0) + 511; This kind of ID generation does not seem to guarantee from not having the same ID in a pool of instance

Re: XID formatting and SLRU refactorings (was: Add 64-bit XIDs into PostgreSQL 15)

2023-11-30 Thread Pavel Borisov
On Thu, 30 Nov 2023 at 08:03, Tom Lane wrote: > Alexander Lakhin writes: > > And a warning: > > $ CC=gcc-12 CFLAGS="-Wall -Wextra -Wno-unused-parameter > -Wno-sign-compare -Wno-clobbered > > -Wno-missing-field-initializers" ./configure -q && make -s > > slru.c:63:1: warning: ‘inline’ is not at b

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

2023-11-30 Thread Andrei Lepikhov
On 30/11/2023 15:00, Alena Rybakina wrote: 2. The second patch is my patch version when I moved the OR transformation in the s index formation stage: So, I got the best query plan despite the possible OR to ANY transformation: If the user uses a clause like "x IN (1,2) AND y=100", it will br

RE: [Proposal] global sequence implemented by snowflake ID

2023-11-30 Thread Hayato Kuroda (Fujitsu)
Dear Nikita, Thanks for reading my patch! > I have reviewed the patch in this topic and have a question mentioning the machine ID - INSERT INTO snowflake_sequence.machine_id SELECT round((random() * (0 - 511))::numeric, 0) + 511; This kind of ID generation does not seem to guarantee from no

Re: [dynahash] do not refill the hashkey after hash_search

2023-11-30 Thread John Naylor
On Thu, Sep 14, 2023 at 3:28 PM Junwang Zhao wrote: > > Add a v2 with some change to fix warnings about unused-parameter. > > I will add this to Commit Fest. Pushed v2 after removing asserts, as well as the unnecessary cast that I complained about earlier. Some advice: I was added as a reviewer

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

2023-11-30 Thread Alena Rybakina
On 30.11.2023 11:30, Andrei Lepikhov wrote: On 30/11/2023 15:00, Alena Rybakina wrote: 2. The second patch is my patch version when I moved the OR transformation in the s index formation stage: So, I got the best query plan despite the possible OR to ANY transformation: If the user uses a c

Re: XID formatting and SLRU refactorings (was: Add 64-bit XIDs into PostgreSQL 15)

2023-11-30 Thread Alexander Korotkov
On Thu, Nov 30, 2023 at 10:29 AM Pavel Borisov wrote: > Agree. The fix is attached. What an oversight. Thank you, pushed! -- Regards, Alexander Korotkov

Proposal: Filter irrelevant change before reassemble transactions during logical decoding

2023-11-30 Thread li jie
Hi, During logical decoding, if there is a large write transaction, some spill files will be written to disk, depending on the setting of max_changes_in_memory. This behavior can effectively avoid OOM, but if the transaction generates a lot of change before commit, a large number of files may fil

Re: [PoC] pg_upgrade: allow to upgrade publisher node

2023-11-30 Thread Amit Kapila
On Wed, Nov 29, 2023 at 7:33 AM Hayato Kuroda (Fujitsu) wrote: > > > > Actually, we do not expect that it won't input NULL. IIUC all of slots > > > have > > > slot_name, and subquery uses its name. But will it be kept forever? I > > > think we > > > can avoid any risk. > > > > > > > I've not tes

RE: Random pg_upgrade test failure on drongo

2023-11-30 Thread Hayato Kuroda (Fujitsu)
Dear Alexander, Andrew, Thanks for your analysis! > I see that behavior on: > Windows 10 Version 1607 (OS Build 14393.0) > Windows Server 2016 Version 1607 (OS Build 14393.0) > Windows Server 2019 Version 1809 (OS Build 17763.1) > > But it's not reproduced on: > Windows 10 Version 1809 (OS Buil

Re: [PGDOCS] Inconsistent linkends to "monitoring" views.

2023-11-30 Thread John Naylor
On Wed, Nov 8, 2023 at 2:02 PM John Naylor wrote: > My 2 cents: Comment typos are visible to readers, so more annoying > when seen in isolation, and less likely to have surroundings that > could change in back branches. Consistency would preferred all else > being equal, but then again nothing is

Re: Is this a problem in GenericXLogFinish()?

2023-11-30 Thread Amit Kapila
On Thu, Nov 30, 2023 at 12:58 PM Hayato Kuroda (Fujitsu) wrote: > > > > > Good catch, thank you for reporting! I will investigate more about it and > > post my > > analysis. > > > > Again, good catch. Here is my analysis and fix patch. > I think it is sufficient to add an initialization for write

Extend pgbench partitioning to pgbench_history

2023-11-30 Thread Gabriele Bartolini
Hi there, While benchmarking a new feature involving tablespace support in CloudNativePG (Kubernetes operator), I wanted to try out the partitioning feature of pgbench. I saw it supporting both range and hash partitioning, but limited to pgbench_accounts. With the attached patch, I extend the par

Re: Various small doc improvements; plpgsql, schemas, permissions, oidvector

2023-11-30 Thread Shubham Khanna
On Thu, Nov 30, 2023 at 3:59 PM David G. Johnston wrote: > > Extending my prior email which is now redundant. > > On Tue, Oct 3, 2023 at 7:00 PM David G. Johnston > wrote: >> >> On Tue, Oct 3, 2023 at 4:15 PM Karl O. Pinc wrote: >>> >>> On Tue, 3 Oct 2023 14:51:31 -0700 >>> "David G. Johnston"

Re: [Proposal] global sequence implemented by snowflake ID

2023-11-30 Thread Amit Kapila
On Thu, Nov 30, 2023 at 6:48 AM Michael Paquier wrote: > > On Tue, Nov 28, 2023 at 02:23:44PM +0530, Amit Kapila wrote: > > It is interesting to see you want to work towards globally distributed > > sequences. I think it would be important to discuss how and what we > > want to achieve with sequen

Re: GUC names in messages

2023-11-30 Thread Alvaro Herrera
> +/* > + * Return whether the GUC name should be enclosed in double-quotes. > + * > + * Quoting is intended for names which could be mistaken for normal English > + * words. Quotes are only applied to GUC names that are written entirely > with > + * lower-case alphabetical characters. > + */ >

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

2023-11-30 Thread Alena Rybakina
On 30.11.2023 11:00, Alena Rybakina wrote: Hi! Honestly, it seems very hard to avoid the conclusion that this transformation is being done at too early a stage. Parse analysis is not the time to try to do query optimization. I can't really believe that there's a way to produce a committable p

Re: Is this a problem in GenericXLogFinish()?

2023-11-30 Thread Alexander Lakhin
Hello Kuroda-san, 30.11.2023 10:28, Hayato Kuroda (Fujitsu) wrote: Again, good catch. Here is my analysis and fix patch. I think it is sufficient to add an initialization for writebuf. I agree with the change. It aligns hash_xlog_squeeze_page() with hash_xlog_move_page_contents() in regard to

Re: Extend pgbench partitioning to pgbench_history

2023-11-30 Thread Gabriele Bartolini
Please discard the previous patch and use this one (it had a leftover comment from an initial attempt to limit this to hash case). Thanks, Gabriele On Thu, 30 Nov 2023 at 11:29, Gabriele Bartolini < gabriele.bartol...@enterprisedb.com> wrote: > Hi there, > > While benchmarking a new feature invo

Re: Report planning memory in EXPLAIN ANALYZE

2023-11-30 Thread Ashutosh Bapat
Hi Alvaro, Thanks for the review and the edits. Sorry for replying late. On Tue, Nov 21, 2023 at 11:56 PM Alvaro Herrera wrote: > > 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

Set all variable-length fields of pg_attribute to null on column drop

2023-11-30 Thread Peter Eisentraut
I noticed that when a column is dropped, RemoveAttributeById() clears out certain fields in pg_attribute, but it leaves the variable-length fields at the end (attacl, attoptions, and attfdwoptions) unchanged. This is probably harmless, but it seems wasteful and unclean, and leaves potentially d

RE: Is this a problem in GenericXLogFinish()?

2023-11-30 Thread Hayato Kuroda (Fujitsu)
Dear Amit, > I think it is acceptable especially if it increases code > coverage. Can you once check that? PSA the screen shot. I did "PROVE_TESTS="t/027*" make check" in src/test/recovery, and generated a report. Line 661 was not hit in the HEAD, but the screen showed that it was executed. [1]

Re: Report planning memory in EXPLAIN ANALYZE

2023-11-30 Thread Alvaro Herrera
On 2023-Nov-30, Ashutosh Bapat wrote: > Hi Alvaro, > Thanks for the review and the edits. Sorry for replying late. > > On Tue, Nov 21, 2023 at 11:56 PM Alvaro Herrera > wrote: > > > > I gave this a quick look. I think the usefulness aspect is already > > established in general terms; the bit I

Re: [PATCH] Native spinlock support on RISC-V

2023-11-30 Thread Christoph Berg
Re: Thomas Munro > I randomly remembered this topic after seeing an s390x announcement > from Christoph[1], and figured he or someone else might be interested > in the same observation about that platform. That is, we finally got > around to defining this for ARM, but I bet one internet point that

Re: [Proposal] global sequence implemented by snowflake ID

2023-11-30 Thread Tomas Vondra
On 11/30/23 11:56, Amit Kapila wrote: > On Thu, Nov 30, 2023 at 6:48 AM Michael Paquier wrote: >> >> On Tue, Nov 28, 2023 at 02:23:44PM +0530, Amit Kapila wrote: >>> It is interesting to see you want to work towards globally distributed >>> sequences. I think it would be important to discuss how a

Re: logical decoding and replication of sequences, take 2

2023-11-30 Thread Amit Kapila
On Thu, Nov 30, 2023 at 5:28 AM Tomas Vondra wrote: > > 3) "bad case" - small transactions that generate a lot of relfilenodes > > select alter_sequence(); > > where the function is defined like this (I did create 1000 sequences > before the test): > > CREATE OR REPLACE FUNCTION alter_sequence

Re: Synchronizing slots from primary to standby

2023-11-30 Thread Ajin Cherian
On Wed, Nov 29, 2023 at 8:17 PM Zhijie Hou (Fujitsu) wrote: > > This has been fixed. > > Best Regards, > Hou zj Thanks for addressing my comments. Some comments from my testing of patch v41 1. In my opinion, the second message "aborting the wait...moving to the next slot" does not hold much valu

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

2023-11-30 Thread Daniel Gustafsson
> On 30 Nov 2023, at 07:13, Pavel Stehule wrote: > čt 30. 11. 2023 v 4:40 odesílatel Tom Lane > napsal: > Daniel Gustafsson mailto:dan...@yesql.se>> writes: > > I took another look at this, found some more polish that was needed, added > > another testcase and ended up

Re: about help message for new pg_dump's --filter option

2023-11-30 Thread Daniel Gustafsson
> On 30 Nov 2023, at 02:52, Kyotaro Horiguchi wrote: > > At Thu, 30 Nov 2023 10:20:40 +0900 (JST), Kyotaro Horiguchi > wrote in >> Hello. >> >> Recently, a new --filter option was added to pg_dump. I might be >> wrong, but the syntax of the help message for this feels off. Is the >> word 'on'

Re: Extra periods in pg_dump messages

2023-11-30 Thread Daniel Gustafsson
> On 30 Nov 2023, at 02:39, Kyotaro Horiguchi wrote: > In the bleeding-edge version of pg_dump, when a conditionspecifying an > index, for example, is described in an object filter file, the > following message is output. However, there is a period at the end of > the line. Shouldn't this be remo

Re: pg_dump/nls.mk is missing a file

2023-11-30 Thread Daniel Gustafsson
> On 30 Nov 2023, at 04:00, Kyotaro Horiguchi wrote: > Upon reviewing my translation, I discovered that filter.c was not > included in the nls.mk of pg_dump. Fixed. I did leave the other headers in there since I don't feel comfortable with changing that part in an otherwise unrelated thread (an

Re: Postgres Partitions Limitations (5.11.2.3)

2023-11-30 Thread Ashutosh Bapat
On Fri, Oct 27, 2023 at 12:28 PM Laurenz Albe wrote: > > On Mon, 2023-01-09 at 16:40 +0100, Laurenz Albe wrote: > > > "Using ONLY to add or drop a constraint on only the partitioned table is > > > supported as long as there are no partitions. Once partitions exist, using > > > ONLY will result in

Re: Implement missing join selectivity estimation for range types

2023-11-30 Thread Alena Rybakina
Hi! Thank you for your work on the subject, I think it's a really useful feature and it allows optimizer to estimate more correctly clauses with such type of operator. I rewieved your patch and noticed that some comments are repeated into multirangejoinsel functions, I suggest combining them

Re: Custom explain options

2023-11-30 Thread Konstantin Knizhnik
On 30/11/2023 5:59 am, Andrei Lepikhov wrote: On 21/10/2023 19:16, Konstantin Knizhnik wrote: EXPLAIN statement has a list of options (i.e. ANALYZE, BUFFERS, COST,...) which help to provide useful details of query execution. In Neon we have added PREFETCH option which shows information about

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

2023-11-30 Thread Pavel Stehule
čt 30. 11. 2023 v 14:05 odesílatel Daniel Gustafsson napsal: > > On 30 Nov 2023, at 07:13, Pavel Stehule wrote: > > čt 30. 11. 2023 v 4:40 odesílatel Tom Lane t...@sss.pgh.pa.us>> napsal: > > Daniel Gustafsson mailto:dan...@yesql.se>> writes: > > > I took another look at this, found some more p

Dumped SQL failed to execute with ERROR "GROUP BY position -1 is not in select list"

2023-11-30 Thread Haotian Chen
Hi hackers, I found that dumped view SQL failed to execute due to the explicit cast of negative number, and I took a look at the defined SQL in view and then found -1 in the group by clause. I suppose it’s the main reason the sql cannot be executed and raised ERROR "GROUP BY position -1 is no

Re: Random pg_upgrade test failure on drongo

2023-11-30 Thread Alexander Lakhin
Hello Andrew and Kuroda-san, 27.11.2023 16:58, Andrew Dunstan wrote: It's also interesting, what is full version/build of OS on drongo and fairywren. It's WS 2019 1809/17763.4252. The latest available AFAICT is 17763.5122 I've updated it to 17763.5122 now. Thank you for the information!

Re: PostgreSql: Canceled on conflict out to old pivot

2023-11-30 Thread Wirch, Eduard
Thanks for the detailed answer, Heikki. > > The longest transaction that could occur is 1 min long. > I hate to drill on this, but are you very sure about that? A transaction in a different database? Don't be sorry for that, drilling down is important. ;) It took me so long to reply because I had

Re: pg_upgrade and logical replication

2023-11-30 Thread vignesh C
On Wed, 29 Nov 2023 at 15:02, Amit Kapila wrote: > > On Tue, Nov 28, 2023 at 4:12 PM vignesh C wrote: > > > > Few comments on the latest patch: > === > 1. > + if (fout->remoteVersion >= 17) > + appendPQExpBufferStr(query, " o.remote_lsn AS suboriginremotelsn,\n"); > +

Re: pg_upgrade and logical replication

2023-11-30 Thread vignesh C
On Thu, 30 Nov 2023 at 06:37, Peter Smith wrote: > > Here are some review comments for patch v20-0001 > > == > > 1. getSubscriptions > > + if (dopt->binary_upgrade && fout->remoteVersion >= 17) > + appendPQExpBufferStr(query, " s.subenabled\n"); > + else > + appendPQExpBufferStr(query, " f

Re: Set all variable-length fields of pg_attribute to null on column drop

2023-11-30 Thread Robert Haas
On Thu, Nov 30, 2023 at 6:24 AM Peter Eisentraut wrote: > I noticed that when a column is dropped, RemoveAttributeById() clears > out certain fields in pg_attribute, but it leaves the variable-length > fields at the end (attacl, attoptions, and attfdwoptions) unchanged. > This is probably harmless

Re: Postgres Partitions Limitations (5.11.2.3)

2023-11-30 Thread Laurenz Albe
On Thu, 2023-11-30 at 19:22 +0530, Ashutosh Bapat wrote: > May be attach the patch to hackers thread (this) as well? If you want, sure. I thought it was good enough if the thread is accessible via the commitfest app. Yours, Laurenz Albe From ecdce740586e33eeb394d47564b10f813896ff11 Mon Sep 17 00

Re: pg_upgrade and logical replication

2023-11-30 Thread vignesh C
On Thu, 30 Nov 2023 at 13:35, Amit Kapila wrote: > > On Wed, Nov 29, 2023 at 3:02 PM Amit Kapila wrote: > > > > In general, the test cases are a bit complex to understand, so, it > will be difficult to enhance these later. The complexity comes from > the fact that one upgrade test is trying to te

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

2023-11-30 Thread Robert Haas
On Wed, Nov 29, 2023 at 5:02 PM Nathan Bossart wrote: > On Wed, Nov 29, 2023 at 04:02:11PM -0500, Robert Haas wrote: > > I'd fully support having good documentation that says "hey, here are > > the low security authentication configurations, here are the > > medium-security ones, here are the high

Re: Transaction timeout

2023-11-30 Thread Andrey M. Borodin
> On 20 Nov 2023, at 06:33, 邱宇航 wrote: Nikolay, Peter, Fujii, Tung, Yuhang, thank you for reviewing this. I'll address feedback soon, this patch has been for a long time on my TODO list. I've started with fixing problem of COMMIT AND CHAIN by restarting timeout counter. Tomorrow I plan to fix r

Re: Parallel CREATE INDEX for BRIN indexes

2023-11-30 Thread Matthias van de Meent
On Thu, 30 Nov 2023 at 01:10, Tomas Vondra wrote: > > On 11/29/23 23:59, Matthias van de Meent wrote: >> On Wed, 29 Nov 2023 at 21:56, Tomas Vondra >> wrote: >>> >>> On 11/29/23 21:30, Matthias van de Meent wrote: On Wed, 29 Nov 2023 at 18:55, Tomas Vondra wrote: > I did try to mea

Re: Refactoring backend fork+exec code

2023-11-30 Thread Tristan Partin
On Wed Nov 29, 2023 at 5:36 PM CST, Heikki Linnakangas wrote: On 11/10/2023 14:12, Heikki Linnakangas wrote: Here's another rebased patch set. Compared to previous version, I did a little more refactoring around CreateSharedMemoryAndSemaphores and InitProcess: - patch 1 splits CreateSharedMem

Add missing error codes to PANIC/FATAL error reports in xlogrecovery

2023-11-30 Thread Krishnakumar R
Hi, Please find a patch attached which adds missing sql error code in error reports which are FATAL or PANIC, in xlogrecovery. This will help with deducing patterns when looking at error reports from multiple postgres instances. -- Thanks and Regards, Krishnakumar (KK). [Microsoft] From 4cc518f25

Re: Add missing error codes to PANIC/FATAL error reports in xlogrecovery

2023-11-30 Thread Andres Freund
Hi, On 2023-11-30 10:54:12 -0800, Krishnakumar R wrote: > diff --git a/src/backend/access/transam/xlogrecovery.c > b/src/backend/access/transam/xlogrecovery.c > index c6156a..2f50928e7e 100644 > --- a/src/backend/access/transam/xlogrecovery.c > +++ b/src/backend/access/transam/xlogrecovery.c

Re: Add missing error codes to PANIC/FATAL error reports in xlogrecovery

2023-11-30 Thread Robert Haas
On Thu, Nov 30, 2023 at 2:47 PM Andres Freund wrote: > Another aside: Isn't the hint here obsolete since we've removed exclusive > backups? I can't think of any scenario now where removing backup_label would > be correct in a non-exclusive backup. That's an extremely good point. -- Robert Haas

Re: Refactoring backend fork+exec code

2023-11-30 Thread Andres Freund
Hi, On 2023-11-30 01:36:25 +0200, Heikki Linnakangas wrote: > - patch 1 splits CreateSharedMemoryAndSemaphores into two functions: > CreateSharedMemoryAndSemaphores is now only called at postmaster startup, > and a new function called AttachSharedMemoryStructs() is called in backends > in EXEC_BAC

Re: Refactoring backend fork+exec code

2023-11-30 Thread Andres Freund
Hi, On 2023-11-30 12:44:33 -0600, Tristan Partin wrote: > > +/* > > + * Set reference point for stack-depth checking. This might seem > > + * redundant in !EXEC_BACKEND builds; but it's not because the > > postmaster > > + * launches its children from signal h

Re: GUC names in messages

2023-11-30 Thread Peter Eisentraut
On 30.11.23 06:59, Michael Paquier wrote: ereport(elevel, (errcode(ERRCODE_UNDEFINED_OBJECT), -errmsg("unrecognized configuration parameter \"%s\" in file \"%s\" line %d", -

postgres_fdw test timeouts

2023-11-30 Thread Nathan Bossart
I noticed that the postgres_fdw test periodically times out on Windows: https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=fairywren&dt=2023-11-10%2003%3A12%3A58 https://cirrus-ci.com/task/5504294095421440 https://cirrus-ci.com/task/4814111003901952 https://ci

Re: Refactoring backend fork+exec code

2023-11-30 Thread Thomas Munro
On Fri, Dec 1, 2023 at 9:31 AM Andres Freund wrote: > On 2023-11-30 12:44:33 -0600, Tristan Partin wrote: > > > +/* > > > + * Set reference point for stack-depth checking. This might > > > seem > > > + * redundant in !EXEC_BACKEND builds; but it's not because the > >

Re: CRC32C Parallel Computation Optimization on ARM

2023-11-30 Thread Nathan Bossart
On Thu, Nov 23, 2023 at 08:05:26AM +, Xiang Gao wrote: > On Date: Wed, 22 Nov 2023 15:06:18PM -0600, Nathan Bossart wrote: >>pg_crc32c_armv8.o: CFLAGS += ${CFLAGS_CRC} ${CFLAGS_CRYPTO} > > It does not work correctly. CFLAGS ='-march=armv8-a+crc, > -march=armv8-a+crypto', what actually works is

Detecting some cases of missing backup_label

2023-11-30 Thread Andres Freund
Hi, I recently mentioned to Robert (and also Heikki earlier), that I think I see a way to detect an omitted backup_label in a relevant subset of the cases (it'd apply to the pg_control as well, if we moved to that). Robert encouraged me to share the idea, even though it does not provide complete

Re: meson: Stop using deprecated way getting path of files

2023-11-30 Thread Tristan Partin
On Wed Nov 29, 2023 at 1:42 PM CST, Andres Freund wrote: Hi, On 2023-11-29 13:11:23 -0600, Tristan Partin wrote: > What is our limiting factor on bumping the minimum Meson version? Old distro versions, particularly ones where the distro just has an older python. It's one thing to require instal

Re: Add missing error codes to PANIC/FATAL error reports in xlogrecovery

2023-11-30 Thread Tom Lane
Andres Freund writes: > Wondering if we should add a ERRCODE_CLUSTER_CORRUPTED for cases like this. We > have ERRCODE_DATA_CORRUPTED and ERRCODE_INDEX_CORRUPTED, which make > ERRCODE_DATA_CORRUPTED feel a bit too specific in this kind of situation? Maybe. We didn't officially define DATA_CORRUPT

Re: Add missing error codes to PANIC/FATAL error reports in xlogrecovery

2023-11-30 Thread Andres Freund
Hi, On 2023-11-30 16:02:55 -0500, Tom Lane wrote: > Andres Freund writes: > > Wondering if we should add a ERRCODE_CLUSTER_CORRUPTED for cases like this. > > We > > have ERRCODE_DATA_CORRUPTED and ERRCODE_INDEX_CORRUPTED, which make > > ERRCODE_DATA_CORRUPTED feel a bit too specific in this kind

Re: meson: Stop using deprecated way getting path of files

2023-11-30 Thread Andrew Dunstan
On 2023-11-30 Th 16:00, Tristan Partin wrote: On Wed Nov 29, 2023 at 1:42 PM CST, Andres Freund wrote: Hi, On 2023-11-29 13:11:23 -0600, Tristan Partin wrote: > What is our limiting factor on bumping the minimum Meson version? Old distro versions, particularly ones where the distro just has

Re: Bug in pgbench prepared statements

2023-11-30 Thread Tristan Partin
On Wed Nov 29, 2023 at 7:38 PM CST, Lev Kokotov wrote: Patch attached, if there is any interest in fixing this small bug. I see prepareCommand() is called one more time in prepareCommandsInPipeline(). Should you also check the return value there? It may also be useful to throw this patch on

Re: Refactoring backend fork+exec code

2023-11-30 Thread Heikki Linnakangas
On 30/11/2023 22:26, Andres Freund wrote: Aside: Somewhat odd that InitAuxiliaryProcess() doesn't call InitLWLockAccess(). Yeah that caught my eye too. It seems to have been an oversight in commit 1c6821be31f. Before that, in 9.4, the lwlock stats were printed for aux processes too, on shutdo

Re: should check collations when creating partitioned index

2023-11-30 Thread Tom Lane
Peter Eisentraut writes: >> Here is an updated patch that works as indicated above. >> >> The behavior if you try to create an index with mismatching collations >> now is that it will skip over the column and complain at the end with >> something like >> >> ERROR:  0A000: unique constraint on

Re: PostgreSql: Canceled on conflict out to old pivot

2023-11-30 Thread Heikki Linnakangas
On 30/11/2023 18:24, Wirch, Eduard wrote: > > The longest transaction that could occur is 1 min long. I hate to drill on this, but are you very sure about that? A transaction in a different database? Don't be sorry for that, drilling down is important. ;) It took me so long to reply because

Re: Refactoring backend fork+exec code

2023-11-30 Thread Heikki Linnakangas
On 30/11/2023 22:26, Andres Freund wrote: On 2023-11-30 01:36:25 +0200, Heikki Linnakangas wrote: From a96b6e92fdeaa947bf32774c425419b8f987b8e2 Mon Sep 17 00:00:00 2001 From: Heikki Linnakangas Date: Thu, 30 Nov 2023 00:01:25 +0200 Subject: [PATCH v3 1/7] Refactor CreateSharedMemoryAndSemaphor

Re: PostgreSql: Canceled on conflict out to old pivot

2023-11-30 Thread Tom Lane
Heikki Linnakangas writes: > On 30/11/2023 18:24, Wirch, Eduard wrote: >> My understanding of serializable isolation is that only transactions >> which can somehow affect each other can conflict. It should be clear >> for PostgreSql, that transactions belonging to different databases >> cannot aff

Re: Something seems weird inside tts_virtual_copyslot()

2023-11-30 Thread Andres Freund
Hi, On 2023-11-06 11:16:26 +1300, David Rowley wrote: > On Sat, 4 Nov 2023 at 15:15, Andres Freund wrote: > > > > On 2023-11-01 11:35:50 +1300, David Rowley wrote: > > > I changed the Assert in tts_virtual_copyslot() to check the natts > > > match in each of the slots and all of the regression te

Re: PostgreSql: Canceled on conflict out to old pivot

2023-11-30 Thread Andres Freund
Hi, On 2023-11-30 18:51:35 -0500, Tom Lane wrote: > On what grounds do you assert that? Operations on shared catalogs > are visible across databases. Admittedly they can't be written by > ordinary DML, and I'm not sure that we make any promises about DDL > writes honoring serializability. But I

Re: [PATCH] ltree hash functions

2023-11-30 Thread Tommy Pavlicek
On Tue, Nov 28, 2023 at 7:38 PM jian he wrote: > you only change Makefile, you also need to change contrib/ltree/meson.build? > Do you need to use EXPLAIN to demo the index usage? Thanks! Yes, I missed the Meson build file. I added additional commands with EXPLAIN (COSTS OFF) as I found in other

Re: Something seems weird inside tts_virtual_copyslot()

2023-11-30 Thread David Rowley
On Fri, 1 Dec 2023 at 13:14, Andres Freund wrote: > So I think adding an assert to ExecCopySlot(), perhaps with a comment saying > that the restriction could be lifted with a bit of work, would be fine. Thanks for looking at this again. How about the attached? I wrote the comment you mentioned

Re: Refactoring backend fork+exec code

2023-11-30 Thread Andres Freund
Hi, On 2023-12-01 01:36:13 +0200, Heikki Linnakangas wrote: > On 30/11/2023 22:26, Andres Freund wrote: > > On 2023-11-30 01:36:25 +0200, Heikki Linnakangas wrote: > > > From a96b6e92fdeaa947bf32774c425419b8f987b8e2 Mon Sep 17 00:00:00 2001 > > > From: Heikki Linnakangas > > > Date: Thu, 30 Nov

Re: Annoying build warnings from latest Apple toolchain

2023-11-30 Thread Andres Freund
Hi, On 2023-11-28 10:48:04 -0500, Robert Haas wrote: > The second conclusion that I draw is that there's something in meson > itself which is adding -Wl,-undefined,error when building binaries. Right. > What a stupid, annoying decision on Apple's part. It seems like > -Wl,-undefined,error is th

Re: Testing autovacuum wraparound (including failsafe)

2023-11-30 Thread Masahiko Sawada
On Thu, Nov 30, 2023 at 4:35 PM Masahiko Sawada wrote: > > On Wed, Nov 29, 2023 at 5:27 AM Masahiko Sawada wrote: > > > > On Tue, Nov 28, 2023 at 7:16 PM Daniel Gustafsson wrote: > > > > > > > On 28 Nov 2023, at 03:00, Masahiko Sawada wrote: > > > > > > > > On Mon, Nov 27, 2023 at 10:40 PM Dani

Re: Annoying build warnings from latest Apple toolchain

2023-11-30 Thread Tom Lane
Andres Freund writes: > On 2023-11-28 10:48:04 -0500, Robert Haas wrote: >> What a stupid, annoying decision on Apple's part. It seems like >> -Wl,-undefined,error is the default behavior, so they could have just >> ignored that flag if present, but instead they complain about being >> asked to do

Re: Report planning memory in EXPLAIN ANALYZE

2023-11-30 Thread Andrei Lepikhov
On 30/11/2023 18:40, Alvaro Herrera wrote: Well, SUMMARY is enabled by default with ANALYZE, and I'd rather not have planner memory consumption displayed by default with all EXPLAIN ANALYZEs. So yeah, I still think this deserves its own option. But let's hear others' opinions on this point. I'

Re: Bug in pgbench prepared statements

2023-11-30 Thread Lev Kokotov
> I see prepareCommand() is called one more time in > prepareCommandsInPipeline(). Should you also check the return value > there? Yes, good catch. New patch attached. > It may also be useful to throw this patch on the January commitfest if > no one else comes along to review/commit it. First ti

Re: optimize atomic exchanges

2023-11-30 Thread Nathan Bossart
On Wed, Nov 29, 2023 at 03:29:05PM -0600, Nathan Bossart wrote: > I haven't done any sort of performance testing on this yet. Some > preliminary web searches suggest that there is unlikely to be much > difference between cmpxchg and xchg, but presumably there's some difference > between xchg and d

Re: Synchronizing slots from primary to standby

2023-11-30 Thread shveta malik
On Thu, Nov 30, 2023 at 5:37 PM Ajin Cherian wrote: > > On Wed, Nov 29, 2023 at 8:17 PM Zhijie Hou (Fujitsu) > wrote: > > > > This has been fixed. > > > > Best Regards, > > Hou zj > > Thanks for addressing my comments. Some comments from my testing of patch v41 > > 1. In my opinion, the second me

Re: optimize atomic exchanges

2023-11-30 Thread Andres Freund
Hi, On 2023-11-30 21:18:15 -0600, Nathan Bossart wrote: > On Wed, Nov 29, 2023 at 03:29:05PM -0600, Nathan Bossart wrote: > > I haven't done any sort of performance testing on this yet. Some > > preliminary web searches suggest that there is unlikely to be much > > difference between cmpxchg and

Re: Custom explain options

2023-11-30 Thread Andrei Lepikhov
On 30/11/2023 22:40, Konstantin Knizhnik wrote: On 30/11/2023 5:59 am, Andrei Lepikhov wrote: On 21/10/2023 19:16, Konstantin Knizhnik wrote: EXPLAIN statement has a list of options (i.e. ANALYZE, BUFFERS, COST,...) which help to provide useful details of query execution. In Neon we have added

Re: [Proposal] global sequence implemented by snowflake ID

2023-11-30 Thread Michael Paquier
On Thu, Nov 30, 2023 at 12:51:38PM +0100, Tomas Vondra wrote: > As for implementation/replication, I haven't checked the code, but I'd > imagine the AM should be able to decide whether something needs to be > replicated (and how) or not. So the traditional sequences would > replicate, and the alter

Re: Annoying build warnings from latest Apple toolchain

2023-11-30 Thread Andres Freund
Hi, On 2023-11-30 21:24:21 -0500, Tom Lane wrote: > Andres Freund writes: > > On 2023-11-28 10:48:04 -0500, Robert Haas wrote: > >> What a stupid, annoying decision on Apple's part. It seems like > >> -Wl,-undefined,error is the default behavior, so they could have just > >> ignored that flag if

Re: meson: Stop using deprecated way getting path of files

2023-11-30 Thread Andres Freund
On 2023-11-29 10:50:53 -0800, Andres Freund wrote: > I plan to apply this soon, unless I hear some opposition / better ideas / Pushed.

RE: Synchronizing slots from primary to standby

2023-11-30 Thread Zhijie Hou (Fujitsu)
On Wednesday, November 29, 2023 5:12 PM Zhijie Hou (Fujitsu) wrote: I was reviewing slotsync worker design and here are few comments on 0002 patch: 1. + if (!WalRcv || + (WalRcv->slotname[0] == '\0') || + XLogRecPtrIsInvalid(WalRcv->latestWalEnd)) I think we'

Re: Add new for_each macros for iterating over a List that do not require ListCell pointer

2023-11-30 Thread Nathan Bossart
On Wed, Oct 25, 2023 at 12:39:01PM +0200, Jelte Fennema wrote: > Attached is a slightly updated version, with a bit simpler > implementation of foreach_delete_current. > Instead of decrementing i and then adding 1 to it when indexing the > list, it now indexes the list using a postfix decrement. B

Re: optimize atomic exchanges

2023-11-30 Thread Nathan Bossart
On Thu, Nov 30, 2023 at 07:56:27PM -0800, Andres Freund wrote: > On 2023-11-30 21:18:15 -0600, Nathan Bossart wrote: >> Some rudimentary tests show a >40% speedup with this patch on x86_64. > > On bigger machines, with contention, the wins are likely much higher. I see > two orders of magnitude hi

Re: Synchronizing slots from primary to standby

2023-11-30 Thread shveta malik
On Fri, Dec 1, 2023 at 9:40 AM Zhijie Hou (Fujitsu) wrote: > > On Wednesday, November 29, 2023 5:12 PM Zhijie Hou (Fujitsu) > wrote: > > I was reviewing slotsync worker design and here > are few comments on 0002 patch: Thanks for reviewing the patch. > > 1. > > + if (!WalRcv || > +

processes stuck in shutdown following OOM/recovery

2023-11-30 Thread Justin Pryzby
If postgres starts, and one of its children is immediately killed, and the cluster is also told to stop, then, instead, the whole system gets wedged. $ initdb -D ./pgdev.dat1 $ pg_ctl -D ./pgdev.dat1 start -o '-c port=5678' $ kill -9 2524495; sleep 0.05; pg_ctl -D ./pgdev.dat1 stop -m fast # 25244

Re: pg_upgrade and logical replication

2023-11-30 Thread Peter Smith
Here are review comments for patch v21-0001 == src/bin/pg_upgrade/check.c 1. check_old_cluster_subscription_state +/* + * check_old_cluster_subscription_state() + * + * Verify that each of the subscriptions has all their corresponding tables in + * i (initialize) or r (ready). + */ +static v

RE: Synchronizing slots from primary to standby

2023-11-30 Thread Zhijie Hou (Fujitsu)
On Friday, December 1, 2023 12:51 PM shveta malik wrote: Hi, > > On Fri, Dec 1, 2023 at 9:40 AM Zhijie Hou (Fujitsu) > wrote: > > > > On Wednesday, November 29, 2023 5:12 PM Zhijie Hou (Fujitsu) > wrote: > > > > I was reviewing slotsync worker design and here > > are few comments on 0002 pat

Re: [Proposal] global sequence implemented by snowflake ID

2023-11-30 Thread Amit Kapila
On Thu, Nov 30, 2023 at 5:21 PM Tomas Vondra wrote: > > On 11/30/23 11:56, Amit Kapila wrote: > > > > > This was the key point that I wanted to discuss or hear opinions > > about. So, if we wish to have some sort of global sequences then it is > > not clear to me what benefits will we get by havin

Materialized view in Postgres from the variables rather than SQL query results

2023-11-30 Thread Nurul Karim Rafi
I have a stored procedure in Postgres. I have generated some variables in that procedure. These variables are generated inside a loop of query result. Suppose if i have 10 rows from my query then for 10 times I am generating those variables. Now I want to create a materialized view where these var

doc: improve document of ECPG host variable

2023-11-30 Thread Ryo Matsumura (Fujitsu)
Hi hackers, I attach a small patch improving document of ECPG host variable. Please back patch to supported version, if possible. Range of 'bool' as type of ECPG is not defined explicitly. Our customer was confused. Additionally, I could not understand clearly what the existing sentence mention

Re: Memory consumed by paths during partitionwise join planning

2023-11-30 Thread Ashutosh Bapat
On Wed, Nov 29, 2023 at 1:10 AM David Rowley wrote: > > On Fri, 28 Jul 2023 at 02:06, Ashutosh Bapat > wrote: > > Table 1: Join between unpartitioned tables > > Number of tables | without patch | with patch | % reduction | > > being joined ||| | > > --

Re: Synchronizing slots from primary to standby

2023-11-30 Thread shveta malik
On Fri, Dec 1, 2023 at 11:17 AM Zhijie Hou (Fujitsu) wrote: > > On Friday, December 1, 2023 12:51 PM shveta malik > wrote: > > Hi, > > > > > On Fri, Dec 1, 2023 at 9:40 AM Zhijie Hou (Fujitsu) > > wrote: > > > > > > On Wednesday, November 29, 2023 5:12 PM Zhijie Hou (Fujitsu) > > wrote: > > >

Re: Bug in pgbench prepared statements

2023-11-30 Thread Michael Paquier
On Thu, Nov 30, 2023 at 07:15:54PM -0800, Lev Kokotov wrote: >> I see prepareCommand() is called one more time in >> prepareCommandsInPipeline(). Should you also check the return value >> there? > > Yes, good catch. New patch attached. Agreed that this is not really helpful as it stands >> It ma

  1   2   >