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

2023-09-10 Thread David Rowley
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)) > record_plan_function_dependency(root, saop->negfuncid); > > Surely those if

Re: Cleaning up array_in()

2023-09-10 Thread Alexander Lakhin
Hello Jian, 05.09.2023 02:53, jian he wrote: 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 men

Re: Inefficiency in parallel pg_restore with many tables

2023-09-10 Thread Tom Lane
Nathan Bossart writes: > I spent some more time on this patch and made the relevant adjustments to > the rest of the set. 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 slow

Re: proposal: psql: show current user in prompt

2023-09-10 Thread Pavel Stehule
pá 8. 9. 2023 v 21:07 odesílatel Pavel Stehule napsal: > Hi > > Another thing that should be described there is that this falls >> outside of the transaction flow, i.e. it's changes are not reverted on >> ROLLBACK. But that leaves an important consideration: What happens >> when an error occurs o

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

2023-09-10 Thread Ranier Vilela
Em sex., 8 de set. de 2023 às 03:24, Michael Paquier escreveu: > On Wed, Sep 06, 2023 at 07:57:03AM -0300, Ranier Vilela wrote: > > I think no one objected. > > Looking closer, there is much more inconsistency in this file > depending on the routine called. How about something like the v2 > atta

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

2023-09-10 Thread Michael Paquier
On Sun, Sep 10, 2023 at 06:28:08PM -0300, Ranier Vilela wrote: > +1 > But as Jeff mentioned, when the locale is NULL, > the provider is known to be COLLPROVIDER_LIBC. > > I think we can use this to provide an error message, > when the locale is NULL. > > What do you think about v3 attached? This

Re: [PATCH] Add inline comments to the pg_hba_file_rules view

2023-09-10 Thread Michael Paquier
On Mon, Sep 04, 2023 at 12:54:15PM +0200, Jim Jones wrote: > The patch slightly changes the test 004_file_inclusion.pl to accommodate the > new column and the hba comments. > > Discussion: > https://www.postgresql.org/message-id/flat/3fec6550-93b0-b542-b203-b0054aaee83b%40uni-muenster.de Well, i

Re: Oversight in reparameterize_path_by_child leading to executor crash

2023-09-10 Thread Richard Guo
On Fri, Sep 8, 2023 at 3:04 PM Ashutosh Bapat wrote: > When the clause s.t1b = s.a is presented to distribute_qual_to_rels() > it has form PHV(t1.b) = t2.b. The PHV's ph_eval_at is 4, which is what > is returned as varno to pull_varnos(). The other Var in the caluse has > varno = 4 already so pu

Re: Impact of checkpointer during pg_upgrade

2023-09-10 Thread Dilip Kumar
On Fri, Sep 8, 2023 at 11:59 AM Amit Kapila wrote: > > On Fri, Sep 8, 2023 at 10:10 AM Michael Paquier wrote: > > > > On Fri, Sep 08, 2023 at 09:14:59AM +0530, Amit Kapila wrote: > > > On Fri, Sep 8, 2023 at 9:00 AM Zhijie Hou (Fujitsu) > > > wrote: > > >>> I > > >>> mean that doing the latter

Re: pg_logical_emit_message() misses a XLogFlush()

2023-09-10 Thread Fujii Masao
On 2023/08/16 16:51, Michael Paquier wrote: Anyway, attached is a patch to add a 4th argument "flush" that defaults to false. Thoughts about this version are welcome. When the "transactional" option is set to true, WAL including the record generated by the pg_logical_emit_message() function

Re: Synchronizing slots from primary to standby

2023-09-10 Thread shveta malik
On Fri, Sep 8, 2023 at 4:40 PM Hayato Kuroda (Fujitsu) wrote: > > Dear Shveta, > > I resumed to check the thread. Here are my high-level comments. > Sorry if you have been already discussed. Thanks Kuroda-san for the feedback. > > 01. General > > I think the documentation can be added, not only G

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

2023-09-10 Thread Pavel Stehule
Hi only rebase Regards Pavel From b62d99f51da03b1fb8dae577fc49420bf36a3bad Mon Sep 17 00:00:00 2001 From: "ok...@github.com" Date: Thu, 16 Mar 2023 08:18:08 +0100 Subject: [PATCH] possibility to read options for dump from file --- doc/src/sgml/ref/pg_dump.sgml | 114 doc/sr

Re: MergeJoin beats HashJoin in the case of multiple hash clauses

2023-09-10 Thread Andy Fan
Hi, On Thu, Jun 15, 2023 at 4:30 PM Andrey Lepikhov wrote: > Hi, all. > > Some of my clients use JOIN's with three - four clauses. Quite > frequently, I see complaints on unreasonable switch of JOIN algorithm to > Merge Join instead of Hash Join. Quick research have shown one weak > place - esti

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

2023-09-10 Thread Pavel Stehule
Hi po 11. 9. 2023 v 6:34 odesílatel Pavel Stehule napsal: > Hi > > only rebase > Unfortunately this rebase was not correct. I am sorry. fixed version Regards Pavel > > Regards > > Pavel > > From 32ea3d180ccd976b266bb48c5445c96a1aaf7a54 Mon Sep 17 00:00:00 2001 From: "ok...@github.com" Dat

Re: pg_logical_emit_message() misses a XLogFlush()

2023-09-10 Thread Michael Paquier
On Mon, Sep 11, 2023 at 12:54:11PM +0900, Fujii Masao wrote: > However, in the current patch, if "transactional" is set to false and > "flush" is true, the function flushes the WAL immediately without > considering synchronous_commit. Is this the intended behavior? > I'm not sure how the function s

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

2023-09-10 Thread Dilip Kumar
On Fri, Sep 8, 2023 at 6:31 PM Hayato Kuroda (Fujitsu) wrote: Comments on the latest patch. 1. Note that slot restoration must be done after the final pg_resetwal command during the upgrade because pg_resetwal will remove WALs that are required by the slots. Due to this restriction, the timing o

Re: Cleaning up array_in()

2023-09-10 Thread jian he
On Sun, Sep 10, 2023 at 6:00 PM Alexander Lakhin wrote: > Case 1: > SELECT '{1,'::integer[]; > ERROR: malformed array literal: "{1," > LINE 1: SELECT '{1,'::integer[]; > ^ > DETAIL: Unexpected end of input. > > vs > > ERROR: malformed array literal: "{1," > LINE 1: SELECT '{1,':

Re: pg_logical_emit_message() misses a XLogFlush()

2023-09-10 Thread bt23nguyent
On 2023-09-11 14:02, Michael Paquier wrote: On Mon, Sep 11, 2023 at 12:54:11PM +0900, Fujii Masao wrote: However, in the current patch, if "transactional" is set to false and "flush" is true, the function flushes the WAL immediately without considering synchronous_commit. Is this the intended be

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

2023-09-10 Thread Amit Kapila
On Mon, Sep 11, 2023 at 10:39 AM Dilip Kumar wrote: > > 3. > - with the primary.) Replication slots are not copied and must > - be recreated. > + with the primary.) Replication slots on the old standby are not > copied. > + Only logical slots on the primary are migrated

BufferUsage counters' values have changed

2023-09-10 Thread Karina Litskevich
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 int); INSERT INTO test(b) SELECT generate_series(1,1000); SELECT query, local_b

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

2023-09-10 Thread Dilip Kumar
On Mon, Sep 11, 2023 at 11:16 AM Amit Kapila wrote: > > On Mon, Sep 11, 2023 at 10:39 AM Dilip Kumar wrote: > > > > 3. > > - with the primary.) Replication slots are not copied and must > > - be recreated. > > + with the primary.) Replication slots on the old standby are not

Re: BufferUsage counters' values have changed

2023-09-10 Thread Karina Litskevich
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 it and should be > applied > to REL_16_STABLE and master. > I've forgo

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

2023-09-10 Thread Pavel Stehule
Hi po 11. 9. 2023 v 6:57 odesílatel Pavel Stehule napsal: > Hi > > po 11. 9. 2023 v 6:34 odesílatel Pavel Stehule > napsal: > >> Hi >> >> only rebase >> > > Unfortunately this rebase was not correct. I am sorry. > > fixed version > and fixed forgotten "break" in switch Regards Pavel > > R

Re: persist logical slots to disk during shutdown checkpoint

2023-09-10 Thread Michael Paquier
On Fri, Sep 08, 2023 at 11:50:37AM +0530, Amit Kapila wrote: > On Fri, Sep 8, 2023 at 10:08 AM Michael Paquier wrote: >> >> >> +/* >> + * This is used to track the last persisted confirmed_flush LSN value to >> + * detect any divergence in the in-memory and on-disk values for the >> s

Re: PSQL error: total cell count of XXX exceeded

2023-09-10 Thread Hongxu Ma
I created a patch to fix it. Really appreciate to anyone can help to review it. Thanks. From: Hongxu Ma Sent: Saturday, August 26, 2023 19:19 To: David G. Johnston Cc: PostgreSQL Hackers Subject: Re: PSQL error: total cell count of XXX exceeded Thank you David.

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

2023-09-10 Thread Amit Kapila
On Fri, Sep 8, 2023 at 6:31 PM Hayato Kuroda (Fujitsu) wrote: > > Thank you for reviewing! PSA new version! PSA new version. > Few comments: == 1. + pg_replication_slots.confirmed_flush_lsn + of all slots on the old cluster must be the same as the latest + checkpoint