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

2023-09-13 Thread Amit Kapila
On Thu, Sep 14, 2023 at 10:37 AM Dilip Kumar wrote: > > On Thu, Sep 14, 2023 at 10:00 AM Amit Kapila wrote: > > > > On Thu, Sep 14, 2023 at 9:21 AM Dilip Kumar wrote: > > > > > --- > > > > > > > > 3) Introduce a new pg_upgrade option(e.g. skip_slot_check), and suggest > > > > if user >

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

2023-09-13 Thread Dilip Kumar
On Thu, Sep 14, 2023 at 10:00 AM Amit Kapila wrote: > > On Thu, Sep 14, 2023 at 9:21 AM Dilip Kumar wrote: > > > Cons: Although we have some examples for using functions > > > (binary_upgrade_set_next_pg_enum_oid ...) to set some variables during > > > upgrade > > > , but not sure if it's a

Re: JSON Path and GIN Questions

2023-09-13 Thread Tom Lane
Erik Rijkers writes: > p 9/13/23 om 22:01 schreef David E. Wheeler: >> On Sep 13, 2023, at 01:11, Erik Rijkers wrote: >>> "All use of json*() functions preclude index usage." >> Where did that come from? Why wouldn’t JSON* functions use indexes? I see >> that the docs only mention operators;

Re: Have better wording for snapshot file reading failure

2023-09-13 Thread Michael Paquier
On Wed, Sep 13, 2023 at 07:09:32PM -0700, Andres Freund wrote: > On 2023-09-13 19:07:24 -0700, Andres Freund wrote: >> Huh. I don't think this is a good idea - and certainly not in the back >> branches. The prior message made more sense, imo. The fact that the snapshot >> identifier is a file is

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

2023-09-13 Thread Amit Kapila
On Thu, Sep 14, 2023 at 9:21 AM Dilip Kumar wrote: > > On Thu, Sep 14, 2023 at 8:40 AM Zhijie Hou (Fujitsu) > wrote: > > > > > Here are some more ideas about the issue for reference. > > > > 1) Extending the controlfile. > > > > We can dd a new field (e.g. non_upgrade_checkPoint) to record the

Re: CHECK Constraint Deferrable

2023-09-13 Thread vignesh C
On Thu, 7 Sept 2023 at 17:26, Himanshu Upadhyaya wrote: > > Attached is v2 of the patch, rebased against the latest HEAD. Few issues: 1) Create domain fails but alter domain is successful, I feel we should support create domain too: postgres=# create domain d1 as int check(value<>0) deferrable;

Re: JSON Path and GIN Questions

2023-09-13 Thread Erik Rijkers
p 9/13/23 om 22:01 schreef David E. Wheeler: On Sep 13, 2023, at 01:11, Erik Rijkers wrote: "All use of json*() functions preclude index usage." That sentence is missing from the documentation. Where did that come from? Why wouldn’t JSON* functions use indexes? I see that the docs only

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

2023-09-13 Thread Dilip Kumar
On Thu, Sep 14, 2023 at 8:40 AM Zhijie Hou (Fujitsu) wrote: > > Here are some more ideas about the issue for reference. > > 1) Extending the controlfile. > > We can dd a new field (e.g. non_upgrade_checkPoint) to record the last check > point > ptr happened in non-upgrade mode. The new field

Re: Inefficiency in parallel pg_restore with many tables

2023-09-13 Thread Nathan Bossart
On Wed, Sep 13, 2023 at 08:01:39PM -0400, Tom Lane wrote: > Nathan Bossart writes: >> Upon closer inspection, I found a rather nasty problem. The qsort >> comparator expects a TocEntry **, but the binaryheap comparator expects a >> TocEntry *, and we simply pass the arguments through to the

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

2023-09-13 Thread Dilip Kumar
On Wed, Sep 13, 2023 at 7:22 PM Hayato Kuroda (Fujitsu) wrote: > > Dear Amit, > > Thank you for reviewing! Before making a patch I can reply the important > point. > > > 1. One thing to note is that if user checks whether the old cluster is > > upgradable with --check option and then try to

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

2023-09-13 Thread Zhijie Hou (Fujitsu)
On Wednesday, September 13, 2023 9:52 PM Kuroda, Hayato/黒田 隼人 wrote: > > Dear Amit, > > Thank you for reviewing! Before making a patch I can reply the important > point. > > > 1. One thing to note is that if user checks whether the old cluster is > > upgradable with --check option and then

Re: BufferUsage counters' values have changed

2023-09-13 Thread Andres Freund
Hi, On 2023-09-13 11:59:39 -0700, Andres Freund wrote: > Running the attached patch through CI, planning to push after that succeeds, > unless somebody has a comment? And pushed. Thanks Karina for the report and fix! Greetings, Andres Freund

Re: Have better wording for snapshot file reading failure

2023-09-13 Thread Andres Freund
Hi, On 2023-09-13 19:07:24 -0700, Andres Freund wrote: > On 2023-09-14 10:33:33 +0900, Michael Paquier wrote: > > On Wed, Sep 13, 2023 at 01:19:38PM +0200, Daniel Gustafsson wrote: > > > +1. This errmsg is already present so it eases the translation burden as > > > well. > > > > I was thinking

Re: Have better wording for snapshot file reading failure

2023-09-13 Thread Andres Freund
Hi, On 2023-09-14 10:33:33 +0900, Michael Paquier wrote: > On Wed, Sep 13, 2023 at 01:19:38PM +0200, Daniel Gustafsson wrote: > > +1. This errmsg is already present so it eases the translation burden as > > well. > > I was thinking about doing only that on HEAD, but there is an argument > that

Re: persist logical slots to disk during shutdown checkpoint

2023-09-13 Thread Michael Paquier
On Wed, Sep 13, 2023 at 04:20:37PM +0530, Amit Kapila wrote: > The patch is updated as per recent discussion. WFM. Thanks for the updated version. -- Michael signature.asc Description: PGP signature

Re: Have better wording for snapshot file reading failure

2023-09-13 Thread Michael Paquier
On Wed, Sep 13, 2023 at 01:19:38PM +0200, Daniel Gustafsson wrote: > +1. This errmsg is already present so it eases the translation burden as well. I was thinking about doing only that on HEAD, but there is an argument that one could get confusing errors when dealing with snapshot imports on

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

2023-09-13 Thread Michael Paquier
On Wed, Sep 13, 2023 at 08:14:11AM -0700, Jeff Davis wrote: > Looks good to me, thank you. Applied, then. Thanks. -- Michael signature.asc Description: PGP signature

Re: Redundant Unique plan node for table with a unique index

2023-09-13 Thread Andy Fan
> > > I don't think this is a good way to do this. The method you're using > only supports this optimisation when querying a table directly. If > there were subqueries, joins, etc then it wouldn't work as there are > no unique indexes. You should probably have a look at [1] to see > further

Re: Inefficiency in parallel pg_restore with many tables

2023-09-13 Thread Tom Lane
Nathan Bossart writes: > Upon closer inspection, I found a rather nasty problem. The qsort > comparator expects a TocEntry **, but the binaryheap comparator expects a > TocEntry *, and we simply pass the arguments through to the qsort > comparator. In v9, I added the requisite ampersands.

Re: Surely this code in setrefs.c is wrong?

2023-09-13 Thread David Rowley
On Sun, 10 Sept 2023 at 21:07, David Rowley wrote: > > On Sun, 10 Sept 2023 at 11:22, Tom Lane wrote: > > if (!OidIsValid(saop->hashfuncid)) > > record_plan_function_dependency(root, saop->hashfuncid); > > > > if (!OidIsValid(saop->negfuncid)) > >

Re: Redundant Unique plan node for table with a unique index

2023-09-13 Thread David Rowley
On Thu, 14 Sept 2023 at 02:28, Damir Belyalov wrote: > create table a (n int); > insert into a (n) select x from generate_series(1, 14) as g(x); > create unique index on a (n); > explain select distinct n from a; > QUERY PLAN >

Re: Jumble the CALL command in pg_stat_statements

2023-09-13 Thread Imseih (AWS), Sami
> Still this grouping is much better than having thousands of entries > with different values. I am not sure if we should bother improving > that more than what you suggest that, especially as FuncExpr->args can > itself include Const nodes as far as I recall. I agree. > As far as the SET

Re: Inefficiency in parallel pg_restore with many tables

2023-09-13 Thread Nathan Bossart
On Wed, Sep 13, 2023 at 11:34:50AM -0700, Nathan Bossart wrote: > On Sun, Sep 10, 2023 at 12:35:10PM -0400, Tom Lane wrote: >> Other than those nitpicks, I like v6. I'll mark this RfC. > > Great. I've posted a v8 with your comments addressed in order to get one > more round of cfbot coverage.

Re: Support prepared statement invalidation when result types change

2023-09-13 Thread Euler Taveira
On Tue, Sep 12, 2023, at 10:17 AM, Jelte Fennema wrote: > When running the Postgres JDBC tests with this patchset I found dumb > mistake in my last patch where I didn't initialize the contents of > orig_params correctly. This new patchset fixes that. > 0001: Don't you want to execute this code

Re: Extract numeric filed in JSONB more effectively

2023-09-13 Thread Chapman Flack
On 2023-09-04 10:35, Andy Fan wrote: 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 Apologies for the delay. I like the way this is

Re: BufferUsage counters' values have changed

2023-09-13 Thread Andres Freund
Hi, On 2023-09-11 09:23:59 +0300, Karina Litskevich wrote: > On Mon, Sep 11, 2023 at 9:08 AM Karina Litskevich < > litskevichkar...@gmail.com> wrote: > > > I found a bug that causes one of the differences. Wrong counter is > > incremented > > in ExtendBufferedRelLocal(). The attached patch fixes

Re: JSON Path and GIN Questions

2023-09-13 Thread David E. Wheeler
On Sep 13, 2023, at 01:11, Erik Rijkers wrote: > "All use of json*() functions preclude index usage." > > That sentence is missing from the documentation. Where did that come from? Why wouldn’t JSON* functions use indexes? I see that the docs only mention operators; why would the

Re: [PATCH] Add native windows on arm64 support

2023-09-13 Thread Peter Eisentraut
On 31.08.23 06:44, Tom Lane wrote: I agree. I'm really uncomfortable with claiming support for Windows-on-ARM if we don't have a buildfarm member testing it. For other platforms that have a track record of multiple hardware support, it might not be a stretch ... but Windows was so resolutely

Re: [PATCH] Add native windows on arm64 support

2023-09-13 Thread Andres Freund
Hi, On 2023-08-31 14:33:56 +0900, Michael Paquier wrote: > On Thu, Aug 31, 2023 at 01:06:53AM -0400, Tom Lane wrote: > > That's a good point. The hardware resources to support a buildfarm > > animal are really pretty trivial these days. What is important is > > an animal owner who is willing to

Re: RFC: pg_stat_logmsg

2023-09-13 Thread Joe Conway
On 7/9/23 14:13, Joe Conway wrote: On 7/7/23 01:38, Gurjeet Singh wrote: In this case, the error message stored in pg_stat_logmsg is just '%s'. The filename and line number columns might help identify the actual error but it requires users to read the source code and cannot know the actual

Re: Inefficiency in parallel pg_restore with many tables

2023-09-13 Thread Nathan Bossart
On Sun, Sep 10, 2023 at 12:35:10PM -0400, Tom Lane wrote: > Hmm ... I do not like v7 very much at all. It requires rather ugly > changes to all of the existing callers, and what are we actually > buying? If anything, it makes things slower for pass-by-value items > like integers. I'd stick with

Re: BufferUsage counters' values have changed

2023-09-13 Thread Andres Freund
Hi, On 2023-09-13 16:04:00 +0300, Nazir Bilal Yavuz wrote: > On Mon, 11 Sept 2023 at 14:28, Karina Litskevich > wrote: > > > > Hi hackers, > > > > I noticed that BufferUsage counters' values are strangely different for the > > same queries on REL_15_STABLE and REL_16_STABLE. For example, I run >

Re: [PATCH] Add native windows on arm64 support

2023-09-13 Thread Peter Eisentraut
On 02.05.23 09:51, Niyas Sait wrote: diff --git a/doc/src/sgml/install-windows.sgml b/doc/src/sgml/install-windows.sgml index cbc70a039c..2ecd5fcf38 100644 --- a/doc/src/sgml/install-windows.sgml +++ b/doc/src/sgml/install-windows.sgml @@ -352,7 +352,8 @@ $ENV{MSBFLAGS}="/m"; Special

Re: pg_resetwal tests, logging, and docs update

2023-09-13 Thread Peter Eisentraut
On 13.09.23 16:36, Aleksander Alekseev wrote: ``` +// FIXME: why 2? if (set_oldest_commit_ts_xid < 2 && ``` Should we rewrite this to < FrozenTransactionId ? That's what I suspect, but we should confirm that. ``` +$mult = 32 * $blcksz * 4; # FIXME ```

Re: Add 'worker_type' to pg_stat_subscription

2023-09-13 Thread Nathan Bossart
On Wed, Sep 13, 2023 at 09:59:04AM -0700, Nathan Bossart wrote: > On Wed, Sep 13, 2023 at 05:06:28PM +0300, Maxim Orlov wrote: >> So, should we mark this thread as RfC? > > I've done so. Barring additional feedback, I intend to commit this in the > next few days. Note to self: this needs a

Re: Make --help output fit within 80 columns per line

2023-09-13 Thread Greg Sabino Mullane
On Tue, Jul 4, 2023 at 9:47 PM torikoshia wrote: > Since it seems preferable to have consistent line break policy and some > people use 80-column terminal, wouldn't it be better to make all commands > in 80 > columns per line? > All this seems an awful lot of work to support this mythical

Re: Eliminate redundant tuple visibility check in vacuum

2023-09-13 Thread Andres Freund
Hi, On 2023-09-07 18:23:22 -0400, Melanie Plageman wrote: > From e986940e546171d1f1d06f62a101d695a8481e7a Mon Sep 17 00:00:00 2001 > From: Melanie Plageman > Date: Wed, 6 Sep 2023 14:57:20 -0400 > Subject: [PATCH v4 2/3] Move heap_page_prune output parameters into struct > > Add PruneResult, a

Re: Possibility to disable `ALTER SYSTEM`

2023-09-13 Thread Greg Sabino Mullane
Seems to be some resistance to getting this in core, so why not just use an extension? I was able to create a quick POC to do just that. Hook into PG and look for AlterSystemStmt, throw a "Sorry, ALTER SYSTEM is not currently allowed" error. Put into shared_preload_libraries and you're done. As a

Re: Add 'worker_type' to pg_stat_subscription

2023-09-13 Thread Nathan Bossart
On Wed, Sep 13, 2023 at 05:06:28PM +0300, Maxim Orlov wrote: > I did a look at the patch, like the idea. The overall code is in a good > condition, implements the described feature. Thanks for reviewing. > Side note: this is not a problem of this particular patch, but in >

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

2023-09-13 Thread Jeff Davis
On Wed, 2023-09-13 at 11:48 +0900, Michael Paquier wrote: > Hmm.  I see your point, one could be confused that the function name > is the provider with this wording.  How about that instead: >  ERROR:  unsupported collprovider for %s: %c > > I've hidden that in a macro that uses __func__ as Jeff

Re: pg_resetwal tests, logging, and docs update

2023-09-13 Thread Aleksander Alekseev
Hi, > I noticed that pg_resetwal has poor test coverage. There are some TAP > tests, but they all run with -n, so they don't actually test the full > functionality. (There is a non-dry-run call of pg_resetwal in the > recovery test suite, but that is incidental.) > > So I added a bunch of more

Re: Reducing connection overhead in pg_upgrade compat check phase

2023-09-13 Thread Peter Eisentraut
On 31.08.23 23:34, Daniel Gustafsson wrote: On 12 Jul 2023, at 01:36, Nathan Bossart wrote: On Wed, Jul 12, 2023 at 12:43:14AM +0200, Daniel Gustafsson wrote: I did have coffee before now, but only found time to actually address this now so here is a v7 with just that change and a fresh

Re: Add 'worker_type' to pg_stat_subscription

2023-09-13 Thread Maxim Orlov
Hi! I did a look at the patch, like the idea. The overall code is in a good condition, implements the described feature. Side note: this is not a problem of this particular patch, but in pg_stat_get_subscription and many other places, there is a switch with worker types. Can we use a default

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

2023-09-13 Thread Hayato Kuroda (Fujitsu)
Dear Amit, Thank you for reviewing! Before making a patch I can reply the important point. > 1. One thing to note is that if user checks whether the old cluster is > upgradable with --check option and then try to upgrade, that will also > fail. Because during the --check run there would at least

Re: [ psql - review request ] review request for \d+ tablename, \d+ indexname indenting

2023-09-13 Thread Peter Eisentraut
On 12.09.23 09:27, 쿼리트릭스 wrote: Thank you for letting me know more about the test method. As you said, we applied the patch using git diff and created a test case on the src/test/regress/sql. Because of the change of the psql output, a lot of existing test cases are now failing. You should

Re: Redundant Unique plan node for table with a unique index

2023-09-13 Thread Daniel Gustafsson
> On 13 Sep 2023, at 15:22, Damir Belyalov wrote: > There is a table with a unique index on it and we have a query that searching > DISTINCT values on this table on columns of unique index. > We can see that Unique node is redundant for this case. So I implemented a > simple patch that

Redundant Unique plan node for table with a unique index

2023-09-13 Thread Damir Belyalov
Hello! There is a table with a unique index on it and we have a query that searching DISTINCT values on this table on columns of unique index. Example: create table a (n int); insert into a (n) select x from generate_series(1, 14) as g(x); create unique index on a (n); explain select

Re: logical decoding and replication of sequences, take 2

2023-09-13 Thread Ashutosh Bapat
On Fri, Aug 18, 2023 at 4:28 PM Amit Kapila wrote: > > On Fri, Aug 18, 2023 at 10:37 AM Amit Kapila wrote: > > > > On Thu, Aug 17, 2023 at 7:13 PM Ashutosh Bapat > > wrote: > > > > > > On Wed, Aug 16, 2023 at 7:56 PM Tomas Vondra > > > wrote: > > > > > > > > > > > > > > But whether or not

Re: BufferUsage counters' values have changed

2023-09-13 Thread Nazir Bilal Yavuz
Hi, On Mon, 11 Sept 2023 at 14:28, Karina Litskevich wrote: > > Hi hackers, > > I noticed that BufferUsage counters' values are strangely different for the > same queries on REL_15_STABLE and REL_16_STABLE. For example, I run > > CREATE EXTENSION pg_stat_statements; > CREATE TEMP TABLE test(b

Re: Make --help output fit within 80 columns per line

2023-09-13 Thread torikoshia
On 2023-09-12 15:27, Peter Eisentraut wrote: I like this work a lot. It's good to give developers easy to verify guidance about formatting the --help messages. However, I think instead of just adding a bunch of line breaks to satisfy the test, we should really try to make the lines shorter by

Re: Row pattern recognition

2023-09-13 Thread Tatsuo Ishii
> On 9/13/23 07:14, Tatsuo Ishii wrote: >>> >> I was looking for this but I only found ISO/IEC 19075-5:2021. >> https://www.iso.org/standard/78936.html >> Maybe 19075-5:2021 is the latest one? > > Yes, probably. Sorry. No problem. Thanks for confirmation. Best reagards, -- Tatsuo Ishii SRA

Re: make add_paths_to_append_rel aware of startup cost

2023-09-13 Thread Andy Fan
> - We shouldn't do the optimization if there are still more tables to join, > the reason is similar to has_multiple_baserels(root) in > set_subquery_pathlist. > After some internal discussion, we have 2 different choices here. Let's call the current choice as method-a, and the new choice as

Re: Quoting filename in using facing log messages

2023-09-13 Thread Daniel Gustafsson
> On 13 Sep 2023, at 13:55, Peter Eisentraut wrote: > > On 13.09.23 13:48, Daniel Gustafsson wrote: >> Looking at zqfugous5du4d...@paquier.xyz I noticed that we had a a few >> instances >> of filenames in userfacing log messages (ie not elog or DEBUGx etc) not being >> quoted, where the vast

Re: Quoting filename in using facing log messages

2023-09-13 Thread Peter Eisentraut
On 13.09.23 13:48, Daniel Gustafsson wrote: Looking at zqfugous5du4d...@paquier.xyz I noticed that we had a a few instances of filenames in userfacing log messages (ie not elog or DEBUGx etc) not being quoted, where the vast majority are quoted like \"%s\". Any reason not to quote them as per

Re: Synchronizing slots from primary to standby

2023-09-13 Thread Amit Kapila
On Wed, Sep 13, 2023 at 4:54 PM shveta malik wrote: > > PFA v17. It has below changes: > @@ -2498,6 +2500,13 @@ ReorderBufferProcessTXN(ReorderBuffer *rb, ReorderBufferTXN *txn, } else { + /* + * Before we send out the last set of changes to logical decoding + * output plugin, wait for

Quoting filename in using facing log messages

2023-09-13 Thread Daniel Gustafsson
Looking at zqfugous5du4d...@paquier.xyz I noticed that we had a a few instances of filenames in userfacing log messages (ie not elog or DEBUGx etc) not being quoted, where the vast majority are quoted like \"%s\". Any reason not to quote them as per the attached to be consistent across all log

Re: logical decoding and replication of sequences, take 2

2023-09-13 Thread Ashutosh Bapat
On Thu, Aug 17, 2023 at 7:13 PM Ashutosh Bapat wrote: > > > > The attached patch merges the earlier improvements, except for the part > > that experimented with adding a "fake" transaction (which turned out to > > have a number of difficult issues). > > 0004 looks good to me. But I need to review

Re: Row pattern recognition

2023-09-13 Thread Vik Fearing
On 9/13/23 07:14, Tatsuo Ishii wrote: I was looking for this but I only found ISO/IEC 19075-5:2021. https://www.iso.org/standard/78936.html Maybe 19075-5:2021 is the latest one? Yes, probably. Sorry. -- Vik Fearing

Re: Synchronizing slots from primary to standby

2023-09-13 Thread shveta malik
On Wed, Sep 6, 2023 at 2:18 PM shveta malik wrote: > > On Fri, Sep 1, 2023 at 1:59 PM Peter Smith wrote: > > > > Hi Shveta. Here are some comments for patch v14-0002 > > > > The patch is large, so my code review is a WIP... more later next week... > > > > Thanks Peter for the feedback. I have

Re: Have better wording for snapshot file reading failure

2023-09-13 Thread Daniel Gustafsson
> On 13 Sep 2023, at 08:18, Michael Paquier wrote: > f = AllocateFile(path, PG_BINARY_R); > if (!f) > ereport(ERROR, > -(errcode(ERRCODE_INVALID_PARAMETER_VALUE), > - errmsg("invalid snapshot identifier: \"%s\"", idstr))); > +

RE: Synchronizing slots from primary to standby

2023-09-13 Thread Hayato Kuroda (Fujitsu)
Dear Shveta, Sorry for the late response. > Thanks Kuroda-san for the feedback. > > > > 01. General > > > > I think the documentation can be added, not only GUCs. How about adding > examples > > for combinations of physical and logical replications? You can say that > > both of > > physical

Re: Detoasting optionally to make Explain-Analyze less misleading

2023-09-13 Thread Jehan-Guillaume de Rorthais
Hi Stepan & all, On Tue, 12 Sep 2023 17:16:00 +0200 stepan rutz wrote: ... > Attached a new patch. Hoping for feedback, Nice addition to EXPLAIN! On the feature front, what about adding the actual detoasting/serializing time in the explain output? That could be: => explain

Re: Have better wording for snapshot file reading failure

2023-09-13 Thread Bharath Rupireddy
On Wed, Sep 13, 2023 at 3:32 PM Yogesh Sharma wrote: > > On 9/13/23 02:10, Bharath Rupireddy wrote: > > Hi, > > > > When a snapshot file reading fails in ImportSnapshot(), it errors out > > with "invalid snapshot identifier". This message better suits for > > snapshot identifier parsing errors

Re: persist logical slots to disk during shutdown checkpoint

2023-09-13 Thread Amit Kapila
On Wed, Sep 13, 2023 at 12:45 PM Michael Paquier wrote: > > On Wed, Sep 13, 2023 at 12:07:12PM +0530, Amit Kapila wrote: > > Consider if we move this call to bgwriter (aka flushing slots is no > > longer part of a checkpoint), Would that be okay? Previously, I think > > it was okay but not now. I

Re: Have better wording for snapshot file reading failure

2023-09-13 Thread Yogesh Sharma
On 9/13/23 02:10, Bharath Rupireddy wrote: Hi, When a snapshot file reading fails in ImportSnapshot(), it errors out with "invalid snapshot identifier". This message better suits for snapshot identifier parsing errors which is being done just before the file reading. The attached patch adds a

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

2023-09-13 Thread Amit Kapila
On Tue, Sep 12, 2023 at 5:20 PM Hayato Kuroda (Fujitsu) wrote: > Few comments: = 1. One thing to note is that if user checks whether the old cluster is upgradable with --check option and then try to upgrade, that will also fail. Because during the --check run there would at least one

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

2023-09-13 Thread John Naylor
On Wed, Sep 13, 2023 at 3:46 PM Junwang Zhao wrote: > > On Wed, Sep 13, 2023 at 4:22 PM John Naylor > wrote: > > - memset(part_entry, 0, sizeof(LogicalRepPartMapEntry)); > > - part_entry->partoid = partOid; > > + Assert(part_entry->partoid == partOid); > > + memset(entry, 0,

Re: POC: GUC option for skipping shared buffers in core dumps

2023-09-13 Thread Lepikhov Andrei
On Wed, Feb 12, 2020, at 7:55 AM, tsunakawa.ta...@fujitsu.com wrote: > From: Craig Ringer >> Currently my options are "dump all shmem including shared_buffers" or >> "dump no shmem". But I usually want "dump all shmem except >> shared_buffers". It's tolerable to just dump s_b on a test system

Re: ALTER COLUMN ... SET EXPRESSION to alter stored generated column's expression

2023-09-13 Thread Maxim Orlov
Hi! I'm pretty much like the idea of the patch. Looks like an overlook in SQL standard for me. Anyway, patch apply with no conflicts and implements described functionality. On Fri, 25 Aug 2023 at 03:06, Vik Fearing wrote: > > I don't like this part of the patch at all. Not only is the >

Re: Cleaning up array_in()

2023-09-13 Thread jian he
On Wed, Sep 13, 2023 at 2:00 PM Alexander Lakhin wrote: > > > Now I see only a few wrinkles. > 1) A minor asymmetry in providing details appeared: > select E'{"a"a}'::text[]; > ERROR: malformed array literal: "{"a"a}" > LINE 1: select E'{"a"a}'::text[]; > ^ > DETAIL: Unexpected

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

2023-09-13 Thread Junwang Zhao
On Wed, Sep 13, 2023 at 4:22 PM John Naylor wrote: > > > On Wed, Sep 13, 2023 at 1:47 PM Junwang Zhao wrote: > > > > Hi hackers, > > > > It's not necessary to fill the key field for most cases, since > > hash_search has already done that for you. For developer that > > using memset to zero the

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

2023-09-13 Thread John Naylor
On Wed, Sep 13, 2023 at 1:47 PM Junwang Zhao wrote: > > Hi hackers, > > It's not necessary to fill the key field for most cases, since > hash_search has already done that for you. For developer that > using memset to zero the entry structure after enter it, fill the > key field is a must, but

Re: PSQL error: total cell count of XXX exceeded

2023-09-13 Thread Hongxu Ma
After double check, looks `int64` of src/include/c.h is the proper type for it. Uploaded the v4 patch to fix it. Thanks. From: Hongxu Ma Sent: Wednesday, September 13, 2023 10:22 To: Tom Lane ; Michael Paquier Cc: PostgreSQL Hackers Subject: Re: PSQL error:

Re: pg_upgrade and logical replication

2023-09-13 Thread Michael Paquier
On Tue, Sep 12, 2023 at 01:22:50PM +, Zhijie Hou (Fujitsu) wrote: > +/* > + * binary_upgrade_sub_replication_origin_advance > + * > + * Update the remote_lsn for the subscriber's replication origin. > + */ > +Datum > +binary_upgrade_sub_replication_origin_advance(PG_FUNCTION_ARGS) > +{ > > Is

Re: persist logical slots to disk during shutdown checkpoint

2023-09-13 Thread Michael Paquier
On Wed, Sep 13, 2023 at 12:07:12PM +0530, Amit Kapila wrote: > Consider if we move this call to bgwriter (aka flushing slots is no > longer part of a checkpoint), Would that be okay? Previously, I think > it was okay but not now. I see an argument to keep that as it is as > well because we have

Re: pg_rewind WAL segments deletion pitfall

2023-09-13 Thread Alexander Kukushkin
Hi, Please find attached v6. Changes compared to v5: 1. use "perl -e 'exit(1)'" instead of "false" as archive_command, so it also works on Windows 2. fixed the test name Regards, -- Alexander Kukushkin From 3e1e6c9d968e9b829357b6eb0a7dfa366b550668 Mon Sep 17 00:00:00 2001 From: Alexander

Re: Tab completion for ATTACH PARTITION

2023-09-13 Thread Alvaro Herrera
On 2023-Sep-13, bt23nguyent wrote: > Hi, > > Currently, the psql's tab completion feature does not support properly for > ATTACH PARTITION. When key is typed after "ALTER TABLE > ATTACH PARTITION ", all possible table names should be displayed, however, > foreign table names are not displayed.

Re: pg_ctl start may return 0 even if the postmaster has been already started on Windows

2023-09-13 Thread Kyotaro Horiguchi
At Fri, 8 Sep 2023 08:02:57 +, "Hayato Kuroda (Fujitsu)" wrote in > > > Ditching cmd.exe seems like a big hassle. So, on the flip side, I > > > tried to identify the postmaster PID using the shell's PID, and it > > > seem to work. The APIs used are avaiable from XP/2003 onwards. > >

[dynahash] do not refill the hashkey after hash_search

2023-09-13 Thread Junwang Zhao
Hi hackers, It's not necessary to fill the key field for most cases, since hash_search has already done that for you. For developer that using memset to zero the entry structure after enter it, fill the key field is a must, but IMHO that is not good coding style, we really should not touch the

Re: pg_upgrade and logical replication

2023-09-13 Thread Michael Paquier
On Mon, Sep 11, 2023 at 05:19:27PM +0530, vignesh C wrote: > Added a function binary_upgrade_sub_replication_origin_advance which > will: a) check if the subscription exists, b) get the replication name > for subscription and c) advance the replication origin. > > These are handled as part of v7

Re: persist logical slots to disk during shutdown checkpoint

2023-09-13 Thread Amit Kapila
On Wed, Sep 13, 2023 at 10:57 AM Michael Paquier wrote: > > On Tue, Sep 12, 2023 at 03:15:44PM +0530, Amit Kapila wrote: > >> > >> - Not sure that there is any point to mention the other code paths in > >> the tree where ReplicationSlotSave() can be called, and a slot can be > >> saved in other

Re: Have better wording for snapshot file reading failure

2023-09-13 Thread Michael Paquier
On Wed, Sep 13, 2023 at 11:40:25AM +0530, Bharath Rupireddy wrote: > When a snapshot file reading fails in ImportSnapshot(), it errors out > with "invalid snapshot identifier". This message better suits for > snapshot identifier parsing errors which is being done just before the > file reading.

Have better wording for snapshot file reading failure

2023-09-13 Thread Bharath Rupireddy
Hi, When a snapshot file reading fails in ImportSnapshot(), it errors out with "invalid snapshot identifier". This message better suits for snapshot identifier parsing errors which is being done just before the file reading. The attached patch adds a generic file reading error message with path

Re: Is the member name of hashctl inappropriate?

2023-09-13 Thread ywgrit
You are right, I came to this erroneous conclusion based on the following mishandled experiment: My test program is shown below. typedef struct ColumnIdentifier { Oidrelid; AttrNumber resno; } ColumnIdentifier; typedef struct ColumnType { ColumnIdentifier colId;

Re: Cleaning up array_in()

2023-09-13 Thread Alexander Lakhin
12.09.2023 11:45, jian he wrote: On Mon, Sep 11, 2023 at 8:00 PM Alexander Lakhin wrote: I can confirm that all those anomalies are fixed now. But new version brings a warning when compiled with gcc: arrayfuncs.c:659:9: warning: variable 'prev_tok' is uninitialized when used here