Re: pg_upgrade fails with in-place tablespace[

2023-09-04 Thread Michael Paquier
On Tue, Sep 05, 2023 at 10:28:44AM +0800, Rui Zhao wrote: > It would be highly appreciated if the official PG could also > incorporate support for this feature. This is a development option, and documented as such. You may also want to be aware of the fact that tablespaces in the data folder

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

2023-09-04 Thread Zhijie Hou (Fujitsu)
On Friday, September 1, 2023 9:05 PM Kuroda, Hayato/黒田 隼人 wrote: > Hi, Thanks for updating the patch. I have a comment about the check related to the wal_status. Currently, there are few places where we check the wal_status of slots. e.g.

Re: Autogenerate some wait events code and documentation

2023-09-04 Thread Michael Paquier
On Mon, Sep 04, 2023 at 02:14:58PM +0200, Drouvot, Bertrand wrote: > # Build the descriptions. There are in camel-case. > # LWLock and Lock classes do not need any modifications. > > Nit: 2 whitespaces before "There are in camel" The whitespaces are intentional, the typo in the first

Re: Impact of checkpointer during pg_upgrade

2023-09-04 Thread Amit Kapila
On Tue, Sep 5, 2023 at 10:09 AM Dilip Kumar wrote: > > On Tue, Sep 5, 2023 at 9:38 AM Amit Kapila wrote: > > > > On Mon, Sep 4, 2023 at 4:19 PM Dilip Kumar wrote: > > > > > > Said that there is a possibility that some of the slots which got > > > invalidated even on the previous checkpoint

Re: persist logical slots to disk during shutdown checkpoint

2023-09-04 Thread Dilip Kumar
On Tue, Sep 5, 2023 at 9:58 AM Amit Kapila wrote: > > On Tue, Sep 5, 2023 at 9:10 AM Dilip Kumar wrote: > > > > The comments don't mention anything about why we are just flushing at > > the shutdown checkpoint. I mean the checkpoint is not that frequent > > and we already perform a lot of I/O

Re: Impact of checkpointer during pg_upgrade

2023-09-04 Thread Dilip Kumar
On Tue, Sep 5, 2023 at 9:38 AM Amit Kapila wrote: > > On Mon, Sep 4, 2023 at 4:19 PM Dilip Kumar wrote: > > > > Said that there is a possibility that some of the slots which got > > invalidated even on the previous checkpoint might get the same LSN as > > the slot which got invalidated later if

Re: persist logical slots to disk during shutdown checkpoint

2023-09-04 Thread Amit Kapila
On Tue, Sep 5, 2023 at 9:10 AM Dilip Kumar wrote: > > On Fri, Sep 1, 2023 at 12:16 PM vignesh C wrote: > > > > On Fri, 1 Sept 2023 at 10:06, Amit Kapila wrote: > > > > > > On Thu, Aug 31, 2023 at 6:12 PM Ashutosh Bapat > > > wrote: > > > > > > > > On Thu, Aug 31, 2023 at 2:52 PM Amit Kapila

Re: Impact of checkpointer during pg_upgrade

2023-09-04 Thread Amit Kapila
On Mon, Sep 4, 2023 at 4:19 PM Dilip Kumar wrote: > > Said that there is a possibility that some of the slots which got > invalidated even on the previous checkpoint might get the same LSN as > the slot which got invalidated later if there is no activity between > these two checkpoints. So if we

Re: proposal: psql: show current user in prompt

2023-09-04 Thread Pavel Stehule
po 4. 9. 2023 v 14:24 odesílatel Jelte Fennema napsal: > On Sun, 3 Sept 2023 at 20:58, Pavel Stehule > wrote: > > here is an try > > Overall it does what I had in mind. Below a few suggestions: > > +int > +PQprotocolSubversion(const PGconn *conn) > > Ugh, it's quite annoying that the original

Re: persist logical slots to disk during shutdown checkpoint

2023-09-04 Thread Dilip Kumar
On Fri, Sep 1, 2023 at 12:16 PM vignesh C wrote: > > On Fri, 1 Sept 2023 at 10:06, Amit Kapila wrote: > > > > On Thu, Aug 31, 2023 at 6:12 PM Ashutosh Bapat > > wrote: > > > > > > On Thu, Aug 31, 2023 at 2:52 PM Amit Kapila > > > wrote: > > > > > > > > All but one. Normally, the idea of

Re: Optionally using a better backtrace library?

2023-09-04 Thread Noah Misch
On Mon, Jul 03, 2023 at 11:58:25AM +0200, Alvaro Herrera wrote: > On 2023-Jul-02, Andres Freund wrote: > > I like that we now have a builtin backtrace ability. Unfortunately I think > > the > > backtraces are often not very useful, because only externally visible > > functions are symbolized. >

Re: persist logical slots to disk during shutdown checkpoint

2023-09-04 Thread Amit Kapila
On Tue, Sep 5, 2023 at 7:54 AM Zhijie Hou (Fujitsu) wrote: > > On Monday, September 4, 2023 6:15 PM vignesh C wrote: > > > > On Mon, 4 Sept 2023 at 15:20, Amit Kapila wrote: > > > > > > On Fri, Sep 1, 2023 at 10:50 AM vignesh C wrote: > > > > > > > > On Fri, 1 Sept 2023 at 10:06, Amit Kapila

Re: Report planning memory in EXPLAIN ANALYZE

2023-09-04 Thread Lepikhov Andrei
Using your patch I found out one redundant memory usage in the planner [1]. It can be interesting as an example of how this patch can detect problems. [1] Optimize planner memory consumption for huge arrays

Re: Sync scan & regression tests

2023-09-04 Thread Tom Lane
Heikki Linnakangas writes: > With shared_buffers='20MB', the tests passed. I'm going to change it > back to 10MB now, so that we continue to cover that case. So chipmunk is getting through the core tests now, but instead it is failing in contrib/pg_visibility [1]: diff -U3

RE: Subscription statistics are not dropped at DROP SUBSCRIPTION in some cases

2023-09-04 Thread Zhijie Hou (Fujitsu)
On Monday, September 4, 2023 10:42 PM Masahiko Sawada wrote: Hi, > On Mon, Sep 4, 2023 at 9:38 PM Zhijie Hou (Fujitsu) > wrote: > > > > On Wednesday, July 5, 2023 2:53 PM Masahiko Sawada > wrote: > > > > > Thanks for reviewing the patch. Pushed. > > > > My colleague Vignesh noticed that the

Re: pg_upgrade fails with in-place tablespace[

2023-09-04 Thread Rui Zhao
Thank you for your response. It is evident that there is a need for this features in our system. Firstly, our customers express their desire to utilize tablespaces for table management, without necessarily being concerned about the directory location of these tablespaces. Secondly, currently PG

RE: persist logical slots to disk during shutdown checkpoint

2023-09-04 Thread Zhijie Hou (Fujitsu)
On Monday, September 4, 2023 6:15 PM vignesh C wrote: > > On Mon, 4 Sept 2023 at 15:20, Amit Kapila wrote: > > > > On Fri, Sep 1, 2023 at 10:50 AM vignesh C wrote: > > > > > > On Fri, 1 Sept 2023 at 10:06, Amit Kapila wrote: > > > > > > > > On Thu, Aug 31, 2023 at 6:12 PM Ashutosh Bapat > > >

Re: pg_upgrade fails with in-place tablespace

2023-09-04 Thread Rui Zhao
Thank you for your response. It is evident that there is a need for this features in our system. Firstly, our customers express their desire to utilize tablespaces for table management, without necessarily being concerned about the directory location of these tablespaces. Secondly, currently PG

Re: Cleaning up array_in()

2023-09-04 Thread jian he
On Mon, Sep 4, 2023 at 8:00 AM jian he wrote: > > hi. > attached v4. > v4, 0001 to 0005 is the same as v3 in > https://www.postgresql.org/message-id/5859ce4e-2be4-92b0-c85c-e1e24eab57c6%40iki.fi > > v4-0006 doing some modifications to address the corner case mentioned > in the previous thread

Re: brininsert optimization opportunity

2023-09-04 Thread Soumyadeep Chakraborty
Rebased against latest HEAD. Regards, Soumyadeep (VMware) From 94a8acd3125aa4a613c238e435ed78dba9f40625 Mon Sep 17 00:00:00 2001 From: Soumyadeep Chakraborty Date: Sat, 29 Jul 2023 09:17:49 -0700 Subject: [PATCH v5 1/1] Reuse revmap and brin desc in brininsert brininsert() used to have code

Re: Inefficiency in parallel pg_restore with many tables

2023-09-04 Thread Nathan Bossart
On Sat, Sep 02, 2023 at 11:55:21AM -0700, Nathan Bossart wrote: > I ended up hacking together a (nowhere near committable) patch to see how > hard it would be to allow using any type with binaryheap. It doesn't seem > too bad. I spent some more time on this patch and made the relevant

Re: backtrace_functions emits trace for any elog

2023-09-04 Thread Noah Misch
On Mon, Sep 04, 2023 at 09:30:32PM +0100, Ilya Gladyshev wrote: > I used backtrace_functions to debug one of my ideas and found its behavior > counter-intuitive and contradictory to it own docs. I think the GUC is > supposed to be used to dump backtrace only on elog(ERROR) (should it also be >

Re: Create shorthand for including all extra tests

2023-09-04 Thread Noah Misch
On Mon, Sep 04, 2023 at 04:30:31PM -0400, Tom Lane wrote: > Noah Misch writes: > > On Mon, Sep 04, 2023 at 08:16:44PM +0200, Daniel Gustafsson wrote: > >> On 4 Sep 2023, at 17:01, Tom Lane wrote: > >>> I think this is a seriously bad idea. The entire point of not including > >>> certain tests

Re: information_schema and not-null constraints

2023-09-04 Thread Tom Lane
Alvaro Herrera writes: > In 0002, I took the tests added by Peter's proposed patch and put them > in a separate test file that runs at the end. There are some issues, > however. One is that the ORDER BY clause in the check_constraints view > is not fully deterministic, because the table name is

backtrace_functions emits trace for any elog

2023-09-04 Thread Ilya Gladyshev
Hi, I used backtrace_functions to debug one of my ideas and found its behavior counter-intuitive and contradictory to it own docs. I think the GUC is supposed to be used to dump backtrace only on elog(ERROR) (should it also be done for higher levels? not sure about this), but, in fact, it does

Re: Create shorthand for including all extra tests

2023-09-04 Thread Tom Lane
Noah Misch writes: > On Mon, Sep 04, 2023 at 08:16:44PM +0200, Daniel Gustafsson wrote: >> On 4 Sep 2023, at 17:01, Tom Lane wrote: >>> I think this is a seriously bad idea. The entire point of not including >>> certain tests in check-world by default is that the omitted tests are >>> security

Re: Show various offset arrays for heap WAL records

2023-09-04 Thread Melanie Plageman
On Mon, Jul 10, 2023 at 3:44 AM Heikki Linnakangas wrote: > I'm late to the party, but regarding commit c03c2eae0a, which added the > guidelines for writing formatting desc functions: > > You moved the comment from rmgrdesc_utils.c into rmgrdesc_utils.h, but I > don't think that was a good idea.

Re: Commitfest 2023-09 starts soon

2023-09-04 Thread Melanie Plageman
On Mon, Sep 4, 2023 at 1:01 PM Peter Eisentraut wrote: > > I have done several passes to make sure that patch statuses are more > accurate. As explained in a nearby message, I have set several patches > back from "Ready to Committer" to "Needs review" if additional > discussion happened past the

Re: Create shorthand for including all extra tests

2023-09-04 Thread Noah Misch
On Mon, Sep 04, 2023 at 08:16:44PM +0200, Daniel Gustafsson wrote: > > On 4 Sep 2023, at 17:01, Tom Lane wrote: > > Nazir Bilal Yavuz writes: > >> I created an 'all' option for PG_TEST_EXTRA to enable all test suites > >> defined under PG_TEST_EXTRA. > > > > I think this is a seriously bad

Re: Create shorthand for including all extra tests

2023-09-04 Thread Daniel Gustafsson
> On 4 Sep 2023, at 17:01, Tom Lane wrote: > > Nazir Bilal Yavuz writes: >> I created an 'all' option for PG_TEST_EXTRA to enable all test suites >> defined under PG_TEST_EXTRA. > > I think this is a seriously bad idea. The entire point of not including > certain tests in check-world by

Re: Commitfest 2023-09 starts soon

2023-09-04 Thread Matthias van de Meent
On Mon, 4 Sept 2023 at 18:19, Aleksander Alekseev wrote: > > Hi Matthias, > > > I'm a bit confused about your use of "consensus". True, there was no > > objection, but it looks like no patch author or reviewer was informed > > (cc-ed or directly referenced) that the patch was being discussed > >

Re: proposal: psql: show current user in prompt

2023-09-04 Thread Pavel Stehule
po 4. 9. 2023 v 14:24 odesílatel Jelte Fennema napsal: > On Sun, 3 Sept 2023 at 20:58, Pavel Stehule > wrote: > > here is an try > > Overall it does what I had in mind. Below a few suggestions: > > +int > +PQprotocolSubversion(const PGconn *conn) > > Ugh, it's quite annoying that the original

Re: PATCH: Add REINDEX tag to event triggers

2023-09-04 Thread Jim Jones
On 01.09.23 18:10, jian he wrote: Thanks for pointing this out! Thanks for the fix! also due to commit https://git.postgresql.org/cgit/postgresql.git/commit/?id=11af63fb48d278b86aa948a5b57f136ef03c2bb7 ExecReindex function input arguments also changed. so we need to rebase this patch. change

information_schema and not-null constraints

2023-09-04 Thread Alvaro Herrera
In reference to [1], 0001 attached to this email contains the updated view definitions that I propose. In 0002, I took the tests added by Peter's proposed patch and put them in a separate test file that runs at the end. There are some issues, however. One is that the ORDER BY clause in the

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

2023-09-04 Thread Aleksander Alekseev
Hi, > > Reviewing this now. I think it's almost ready to be committed. > > > > There's another big effort going on to move SLRUs to the regular buffer > > cache (https://commitfest.postgresql.org/43/3514/). I wonder how moving > > to 64 bit page numbers will affect that. BlockNumber is still 32

Re: Commitfest 2023-09 starts soon

2023-09-04 Thread Aleksander Alekseev
Hi Matthias, > I'm a bit confused about your use of "consensus". True, there was no > objection, but it looks like no patch author or reviewer was informed > (cc-ed or directly referenced) that the patch was being discussed > before achieving this "consensus", and the "consensus" was reached >

Re: SLRUs in the main buffer pool, redux

2023-09-04 Thread Aleksander Alekseev
Hi, > > Unfortunately the patchset rotted quite a bit since February and needs a > > rebase. > > A consensus was reached to mark this patch as RwF for now. There > are many patches to be reviewed and this one doesn't seem to be in the > best shape, so we have to prioritise. Please feel free

Re: SLRUs in the main buffer pool - Page Header definitions

2023-09-04 Thread Aleksander Alekseev
Hi, > Agreed that we'd certainly want to make sure it's all correct and to do > performance testing but in terms of how many buffers... isn't much of > the point of this that we have data in memory because it's being used > and if it's not then we evict it? That is, I wouldn't think we'd have >

Re: Commitfest 2023-09 starts soon

2023-09-04 Thread Matthias van de Meent
On Thu, 31 Aug 2023 at 14:35, Aleksander Alekseev wrote: > > Hi, > > On Thu, 31 Aug 2023 at 11:37, Peter Eisentraut wrote: > > > There are a number of patches carried over from the PG16 development > > > cycle that have been in "Waiting on author" for several months. I will > > > aggressively

Re: Query execution in Perl TAP tests needs work

2023-09-04 Thread Andrew Dunstan
On 2023-09-02 Sa 20:17, Thomas Munro wrote: On Sun, Sep 3, 2023 at 6:42 AM Andrew Dunstan wrote: I confess I'm a little reluctant to impose this burden on buildfarm owners. We should think about some sort of fallback in case this isn't supported on some platform, either due to

Re: Suppressing compiler warning on Debian 12/gcc 12.2.0

2023-09-04 Thread Bruce Momjian
On Thu, Aug 31, 2023 at 03:25:09PM -0400, Bruce Momjian wrote: > Being a new user of Debian 12/gcc 12.2.0, I wrote the following shell > script to conditionally add gmake rules with compiler flags to > src/Makefile.custom to suppress warnings for certain files. This allows > me to compile all

Re: Create shorthand for including all extra tests

2023-09-04 Thread Tom Lane
Nazir Bilal Yavuz writes: > I created an 'all' option for PG_TEST_EXTRA to enable all test suites > defined under PG_TEST_EXTRA. I think this is a seriously bad idea. The entire point of not including certain tests in check-world by default is that the omitted tests are security hazards, so a

Create shorthand for including all extra tests

2023-09-04 Thread Nazir Bilal Yavuz
Hi, I realized that I forgot to add the new extra test to my test scripts. So, I thought maybe we can use shorthand for including all extra tests. With that, running a full testsuite is easier without having to keep up with new tests and updates. I created an 'all' option for PG_TEST_EXTRA to

Re: Subscription statistics are not dropped at DROP SUBSCRIPTION in some cases

2023-09-04 Thread Masahiko Sawada
Hi, On Mon, Sep 4, 2023 at 9:38 PM Zhijie Hou (Fujitsu) wrote: > > On Wednesday, July 5, 2023 2:53 PM Masahiko Sawada > wrote: > > Hi, > > > Thanks for reviewing the patch. Pushed. > > My colleague Vignesh noticed that the newly added test cases were failing in > BF animal sungazer[1]. Thank

Re: Commitfest 2023-09 starts soon

2023-09-04 Thread Aleksander Alekseev
Hi Peter, > The patch was first set to "Ready for Committer" on 2023-03-29, and if I > pull up the thread in the web archive view, that is in the middle of the > page. So as a committer, I would expect that someone would review > whatever happened in the second half of that thread before turning

Re: Extract numeric filed in JSONB more effectively

2023-09-04 Thread Andy Fan
Hi, v13 attached. Changes includes: 1. fix the bug Jian provides. 2. reduce more code duplication without DirectFunctionCall. 3. add the overlooked jsonb_path_query and jsonb_path_query_first as candidates -- Best Regards Andy Fan v13-0001-optimize-casting-jsonb-to-a-given-type.patch

Re: Commitfest 2023-09 starts soon

2023-09-04 Thread Peter Eisentraut
I have done several passes to make sure that patch statuses are more accurate. As explained in a nearby message, I have set several patches back from "Ready to Committer" to "Needs review" if additional discussion happened past the first status change. I have also in several cases removed

Re: Commitfest 2023-09 starts soon

2023-09-04 Thread Peter Eisentraut
On 04.09.23 15:22, Aleksander Alekseev wrote: Hi Peter, Okay, here we go, starting with: Status summary: Needs review: 227. Waiting on Author: 37. Ready for Committer: 30. Committed: 40. Rejected: 1. Returned with Feedback: 1. Withdrawn: 1. Total: 337. (which is less than CF 2023-07) I have

Re: Unlogged relation copy is not fsync'd

2023-09-04 Thread Melanie Plageman
On Fri, Aug 25, 2023 at 8:47 AM Heikki Linnakangas wrote: > > I noticed another missing fsync() with unlogged tables, similar to the > one at [1]. > > RelationCopyStorage does this: > > > /* > >* When we WAL-logged rel pages, we must nonetheless fsync them. The > >* reason

Re: Commitfest 2023-09 starts soon

2023-09-04 Thread Aleksander Alekseev
Hi Peter, > Okay, here we go, starting with: > > Status summary: Needs review: 227. Waiting on Author: 37. Ready for > Committer: 30. Committed: 40. Rejected: 1. Returned with Feedback: 1. > Withdrawn: 1. Total: 337. > > (which is less than CF 2023-07) > > I have also already applied one round of

Re: pgsql: Allow tailoring of ICU locales with custom rules

2023-09-04 Thread Amit Kapila
On Tue, Aug 22, 2023 at 10:55 PM Jeff Davis wrote: > > On Mon, 2023-08-14 at 10:34 +0200, Peter Eisentraut wrote: > > I have investigated this. My assessment is that how PostgreSQL > > interfaces with ICU is correct. Whether what ICU does is correct > > might > > be debatable. I have filed a

Re: Speaker Bureau

2023-09-04 Thread Ashutosh Bapat
Added my name to the list. I am available to travel for meetups. -- Best Wishes, Ashutosh Bapat On Sat, Sep 2, 2023 at 12:30 AM Dave Cramer wrote: > > Greetings, > > If you are on the speaker list can you send an email to ugc...@postgresql.us > indicating whether you are available to travel

Re: trying again to get incremental backup

2023-09-04 Thread Dilip Kumar
On Wed, Aug 30, 2023 at 9:20 PM Robert Haas wrote: > Unless someone has a brilliant idea that I lack, this suggests to me > that this whole line of testing is a dead end. I can, of course, write > tests that compare clusters *logically* -- do the correct relations > exist, are they accessible,

RE: Subscription statistics are not dropped at DROP SUBSCRIPTION in some cases

2023-09-04 Thread Zhijie Hou (Fujitsu)
On Wednesday, July 5, 2023 2:53 PM Masahiko Sawada wrote: Hi, > Thanks for reviewing the patch. Pushed. My colleague Vignesh noticed that the newly added test cases were failing in BF animal sungazer[1]. The test failed to drop the slot which is active on publisher. --error-log-- This

Re: A minor adjustment to get_cheapest_path_for_pathkeys

2023-09-04 Thread Aleksander Alekseev
Hi, >> I see the reasoning behind the proposed change, but I'm not convinced >> that there will be any measurable performance improvements. Firstly, >> compare_path_costs() is rather cheap. Secondly, require_parallel_safe >> is `false` in most of the cases. Last but not least, one should prove >>

Re: [17] CREATE SUBSCRIPTION ... SERVER

2023-09-04 Thread Ashutosh Bapat
On Sat, Sep 2, 2023 at 1:41 AM Robert Haas wrote: > > On Fri, Sep 1, 2023 at 4:04 PM Jeff Davis wrote: > > On Thu, 2023-08-31 at 17:17 -0400, Joe Conway wrote: > > > Maybe move postgres_fdw to be a first class built in feature instead > > > of > > > an extension? > > > > That could make sense,

Re: Avoid unncessary always true test (src/backend/storage/buffer/bufmgr.c)

2023-09-04 Thread Peter Eisentraut
On 30.06.23 20:48, Karina Litskevich wrote: So as for me calling LockRelationForExtension() and UnlockRelationForExtension() without testing eb.rel first looks more like a bug here. However, they are never actually called with eb.rel=NULL because of the EB_* flags, so there is no bug here. I

Re: [17] CREATE SUBSCRIPTION ... SERVER

2023-09-04 Thread Ashutosh Bapat
On Sat, Sep 2, 2023 at 12:24 AM Jeff Davis wrote: > > On Fri, 2023-09-01 at 12:28 +0530, Ashutosh Bapat wrote: > > Thinking larger, how about we allow any FDW to be used here. > > That's a possibility, but I think that means the subscription would > need to constantly re-check the parameters

Re: SLRUs in the main buffer pool, redux

2023-09-04 Thread Aleksander Alekseev
Hi, > Unfortunately the patchset rotted quite a bit since February and needs a > rebase. A consensus was reached [1] to mark this patch as RwF for now. There are many patches to be reviewed and this one doesn't seem to be in the best shape, so we have to prioritise. Please feel free

Re: [PATCH] Infinite loop while acquiring new TOAST Oid

2023-09-04 Thread Aleksander Alekseev
Hi, > Aleksander, thank you for reminding me of this patch, try to do it in a few > days. A consensus was reached [1] to mark this patch as RwF for now. There are many patches to be reviewed and this one doesn't seem to be in the best shape, so we have to prioritise. Please feel free

Re: Flush SLRU counters in checkpointer process

2023-09-04 Thread Aleksander Alekseev
Hi, > I think I've managed to reproduce the issue. The test I've added to check > slru flush was the one failing in the regression suite. A consensus was reached [1] to mark this patch as RwF for now. There are many patches to be reviewed and this one doesn't seem to be in the best shape, so we

Re: proposal: psql: show current user in prompt

2023-09-04 Thread Jelte Fennema
On Sun, 3 Sept 2023 at 20:58, Pavel Stehule wrote: > here is an try Overall it does what I had in mind. Below a few suggestions: +int +PQprotocolSubversion(const PGconn *conn) Ugh, it's quite annoying that the original PQprotocolVersion only returns the major version and thus we need this new

Re: Autogenerate some wait events code and documentation

2023-09-04 Thread Drouvot, Bertrand
Hi, On 8/29/23 8:41 AM, Michael Paquier wrote: On Tue, Aug 29, 2023 at 08:17:10AM +0200, Drouvot, Bertrand wrote: That may be a bug in the matrix because of bb90022, as git am can be easily pissed. git am does not complain anymore. + # Generate the element name for the enums based on

Re: Extract numeric filed in JSONB more effectively

2023-09-04 Thread Andy Fan
Hi Jian, SELECT (test_json -> 'field1')::int4 FROM test_jsonb WHERE json_type > = 'object'; > -ERROR: cannot cast jsonb string to type integer > +ERROR: unknown jsonb type: 1125096840 > Thanks for the report! The reason is I return the address of a local variable.

Re: Avoid a possible null pointer (src/backend/utils/adt/pg_locale.c)

2023-09-04 Thread Ranier Vilela
Em dom., 3 de set. de 2023 às 22:01, Michael Paquier escreveu: > On Sat, Sep 02, 2023 at 09:13:11AM -0300, Ranier Vilela wrote: > > I tried to keep the same behavior as before. > > Note that if the locale equals COLLPROVIDER_LIBC, > > the message to the user will be the same. > > -/*

Re: cataloguing NOT NULL constraints

2023-09-04 Thread Alvaro Herrera
Looking at your 0001 patch, which adds tests for some of the information_schema views, I think it's a bad idea to put them in whatever other regression .sql files; they would be subject to concurrent changes depending on what other tests are being executed in the same parallel test. I suggest to

Re: Optimize planner memory consumption for huge arrays

2023-09-04 Thread Dilip Kumar
On Mon, Sep 4, 2023 at 3:49 PM Lepikhov Andrei wrote: > > > + Const *c = makeConst(nominal_element_type, > > + -1, > > + nominal_element_collation, > > + elmlen, > > + elem_values[i], > > + elem_nulls[i], > > + elmbyval); > > + > > + args = list_make2(leftop, c); > > if (is_join_clause) > >

[PATCH] Add inline comments to the pg_hba_file_rules view

2023-09-04 Thread Jim Jones
Hi, This patch proposes the column "comment" to the pg_hba_file_rules view. It basically parses the inline comment (if any) of a valid pg_hba.conf entry and displays it in the new column. For such pg_hba entries ... host db jim 127.0.0.1/32 md5 # foo host db jim 127.0.0.1/32 md5 #bar host

Re: Impact of checkpointer during pg_upgrade

2023-09-04 Thread Dilip Kumar
On Mon, Sep 4, 2023 at 1:41 PM Dilip Kumar wrote: > > > > I think we can do better, like we can just read the latest > > > checkpoint's LSN before starting the old cluster. And now while > > > checking the slot can't we check if the the slot is invalidated then > > > their confirmed_flush_lsn >=

Re: More new SQL/JSON item methods

2023-09-04 Thread Jeevan Chalke
> > Looking at the SQL standard itself, in the 2023 edition section 9.46 > "SQL/JSON path language: syntax and semantics", it shows this: > > ::= > type > | size > | double > | ceiling > | floor > | abs > | datetime [ ] > | keyvalue > | bigint > | boolean > | date > |

Re: Optimize planner memory consumption for huge arrays

2023-09-04 Thread Lepikhov Andrei
On Mon, Sep 4, 2023, at 3:37 PM, Dilip Kumar wrote: > On Mon, Sep 4, 2023 at 11:58 AM Lepikhov Andrei > wrote: >> >> Hi, hackers, >> >> Looking at the planner behaviour with the memory consumption patch [1], I >> figured out that arrays increase memory consumption by the optimizer >>

Re: persist logical slots to disk during shutdown checkpoint

2023-09-04 Thread vignesh C
On Mon, 4 Sept 2023 at 15:20, Amit Kapila wrote: > > On Fri, Sep 1, 2023 at 10:50 AM vignesh C wrote: > > > > On Fri, 1 Sept 2023 at 10:06, Amit Kapila wrote: > > > > > > On Thu, Aug 31, 2023 at 6:12 PM Ashutosh Bapat > > > wrote: > > > > > > > > On Thu, Aug 31, 2023 at 2:52 PM Amit Kapila >

Re: persist logical slots to disk during shutdown checkpoint

2023-09-04 Thread Amit Kapila
On Fri, Sep 1, 2023 at 10:50 AM vignesh C wrote: > > On Fri, 1 Sept 2023 at 10:06, Amit Kapila wrote: > > > > On Thu, Aug 31, 2023 at 6:12 PM Ashutosh Bapat > > wrote: > > > > > > On Thu, Aug 31, 2023 at 2:52 PM Amit Kapila > > > wrote: > > > > > > > > All but one. Normally, the idea of

Re: Incremental View Maintenance, take 2

2023-09-04 Thread jian he
On Sat, Sep 2, 2023 at 7:46 PM Tatsuo Ishii wrote: > > > attached is my refactor. there is some whitespace errors in the > > patches, you need use > > git apply --reject --whitespace=fix > > basedon_v29_matview_c_refactor_update_set_clause.patch > > > > Also you patch cannot use git apply, i

Re: pg_upgrade and logical replication

2023-09-04 Thread Amit Kapila
On Mon, Sep 4, 2023 at 12:15 PM Michael Paquier wrote: > > On Mon, Sep 04, 2023 at 11:51:14AM +0530, Amit Kapila wrote: > > +1 for doing it via function (something like > > binary_upgrade_create_sub_rel_state). We already have the internal > > function AddSubscriptionRelState() that can do the

Re: In-placre persistance change of a relation

2023-09-04 Thread Kyotaro Horiguchi
At Thu, 24 Aug 2023 11:22:32 +0900 (JST), Kyotaro Horiguchi wrote in > I could turn this into something like undo longs in a simple form, but > I'd rather not craft a general-purpose undo log system for this unelss > it's absolutely necessary. This is a patch for a basic undo log

Re: Optimize planner memory consumption for huge arrays

2023-09-04 Thread Dilip Kumar
On Mon, Sep 4, 2023 at 11:58 AM Lepikhov Andrei wrote: > > Hi, hackers, > > Looking at the planner behaviour with the memory consumption patch [1], I > figured out that arrays increase memory consumption by the optimizer > significantly. See init.sql in attachment. > The point here is that the

Re: Impact of checkpointer during pg_upgrade

2023-09-04 Thread Dilip Kumar
On Mon, Sep 4, 2023 at 11:18 AM Amit Kapila wrote: > > On Mon, Sep 4, 2023 at 10:33 AM Dilip Kumar wrote: > > > > On Mon, Sep 4, 2023 at 8:41 AM Amit Kapila wrote: > > > > > > On Sat, Sep 2, 2023 at 6:12 PM Dilip Kumar wrote: > > > > > > > > On Sat, Sep 2, 2023 at 10:09 AM Amit Kapila > > >

Re: Unlogged relation copy is not fsync'd

2023-09-04 Thread Michael Paquier
On Fri, Aug 25, 2023 at 03:47:27PM +0300, Heikki Linnakangas wrote: > That 'copying_initfork' condition is wrong. The first hint of that is that > 'use_wal' is always true for an init fork. I believe this was meant to check > for 'relpersistence == RELPERSISTENCE_UNLOGGED'. Otherwise, this bad

Re: Missing free_var() at end of accum_sum_final()?

2023-09-04 Thread Peter Eisentraut
On 05.03.23 09:53, Joel Jacobson wrote: On Fri, Mar 3, 2023, at 16:11, Dean Rasheed wrote: Attachments: * make-result-using-vars-buf-v2.patch One suggestion: maybe add a comment explaining why the allocated buffer which size is based on strlen(cp) for the decimal digit values, is guaranteed

Re: pg_upgrade and logical replication

2023-09-04 Thread Amit Kapila
On Mon, Sep 4, 2023 at 11:51 AM Amit Kapila wrote: > > On Wed, Jul 19, 2023 at 12:47 PM Michael Paquier wrote: > > > > On Wed, May 10, 2023 at 05:59:24PM +1000, Peter Smith wrote: > > > 1. ALTER SUBSCRIPTION name ADD TABLE (relid = XYZ, state = 'x' [, lsn = > > > 'X/Y']) > > > > > > I was a bit

Re: pg_upgrade and logical replication

2023-09-04 Thread Michael Paquier
On Mon, Sep 04, 2023 at 11:51:14AM +0530, Amit Kapila wrote: > +1 for doing it via function (something like > binary_upgrade_create_sub_rel_state). We already have the internal > function AddSubscriptionRelState() that can do the core work. It is one of these patches that I have let aside for too

Re: pg_upgrade and logical replication

2023-09-04 Thread Amit Kapila
On Thu, Apr 27, 2023 at 1:18 PM Hayato Kuroda (Fujitsu) wrote: > > 03. main > > Currently --preserve-subscription-state and --no-subscriptions can be used > together, but the situation is quite unnatural. Shouldn't we exclude them? > Right, that makes sense to me. -- With Regards, Amit Kapila.

Re: pg_upgrade and logical replication

2023-09-04 Thread Amit Kapila
On Wed, Jul 19, 2023 at 12:47 PM Michael Paquier wrote: > > On Wed, May 10, 2023 at 05:59:24PM +1000, Peter Smith wrote: > > 1. ALTER SUBSCRIPTION name ADD TABLE (relid = XYZ, state = 'x' [, lsn = > > 'X/Y']) > > > > I was a bit confused by this relation 'state' mentioned in multiple > > places.

Re: Exposing the lock manager's WaitForLockers() to SQL

2023-09-04 Thread Will Mortensen
I realized that for our use case, we'd ideally wait for holders of RowExclusiveLock only, and not e.g. VACUUM holding ShareUpdateExclusiveLock. Waiting for lockers in a specific mode seems possible by generalizing/duplicating WaitForLockersMultiple() and GetLockConflicts(), but I'd love to have a