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

2023-09-03 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 to

Re: pg_upgrade and logical replication

2023-09-03 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-03 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-03 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-03 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-03 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 s

Re: Impact of checkpointer during pg_upgrade

2023-09-03 Thread Amit Kapila
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 > > > wrote: > > > > > > > The other possibilities apart from not allowing

Optimize planner memory consumption for huge arrays

2023-09-03 Thread Lepikhov Andrei
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 planner does small memory allocations for each element during estimat

Re: Impact of checkpointer during pg_upgrade

2023-09-03 Thread Dilip Kumar
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 wrote: > > > > > The other possibilities apart from not allowing an upgrade in such a > > > case could be (a) Before starting the old cluste

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

2023-09-03 Thread Dilip Kumar
On Fri, Sep 1, 2023 at 6:34 PM Hayato Kuroda (Fujitsu) wrote: > > Dear Dilip, > > Thank you for reviewing! > > > > > 1. > > + conn = connectToServer(&new_cluster, "template1"); > > + > > + prep_status("Checking for logical replication slots"); > > + > > + res = executeQueryOrDie(conn, "SELECT slot

REL_15_STABLE: pgbench tests randomly failing on CI, Windows only

2023-09-03 Thread Thomas Munro
Hi, Somehow these tests have recently become unstable and have failed a few times: https://github.com/postgres/postgres/commits/REL_15_STABLE The failures are like: [22:32:26.722] # Failed test 'pgbench simple update stdout /(?^:builtin: simple update)/' [22:32:26.722] # at t/001_pgbench_with_s

Re: Impact of checkpointer during pg_upgrade

2023-09-03 Thread Amit Kapila
On Sat, Sep 2, 2023 at 6:12 PM Dilip Kumar wrote: > > On Sat, Sep 2, 2023 at 10:09 AM Amit Kapila wrote: > > > The other possibilities apart from not allowing an upgrade in such a > > case could be (a) Before starting the old cluster, we fetch the slots > > directly from the disk using some tool

Re: Assert failure in ATPrepAddPrimaryKey

2023-09-03 Thread Richard Guo
On Fri, Sep 1, 2023 at 7:48 PM Alvaro Herrera wrote: > On 2023-Sep-01, Richard Guo wrote: > > > I ran into an Assert failure in ATPrepAddPrimaryKey() with the query > > below: > > > > CREATE TABLE t0(c0 boolean); > > CREATE TABLE t1() INHERITS(t0); > > > > # ALTER TABLE t0 ADD CONSTRAINT m EXCLUD

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

2023-09-03 Thread Michael Paquier
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. -/* shouldn't happen */ -elog(ERROR, "unsupported collprovider: %c", locale->provide

Re: Cleaning up array_in()

2023-09-03 Thread jian he
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 (like select '{{1,},{1},}'::text[]). also fixed all these FIXME, H

Re: Why doesn't Vacuum FULL update the VM

2023-09-03 Thread Melanie Plageman
On Fri, Sep 1, 2023 at 8:38 PM Peter Geoghegan wrote: > > On Fri, Sep 1, 2023 at 12:34 PM Melanie Plageman > wrote: > > I don't see why the visibility map shouldn't be updated so that all of > > the pages show all visible and all frozen for this relation after the > > vacuum full. > > There was a

Re: proposal: psql: show current user in prompt

2023-09-03 Thread Pavel Stehule
Hi ne 3. 9. 2023 v 9:59 odesílatel Jelte Fennema napsal: > On Sun, 3 Sept 2023 at 08:24, Pavel Stehule > wrote: > > My personal feeling from this area is that the protocol design is done, > but it is not implemented on libpq level. My feelings can be wrong. The > protocol number is hardcoded in

Re: Inefficiency in parallel pg_restore with many tables

2023-09-03 Thread Nathan Bossart
On Sun, Sep 03, 2023 at 12:04:00PM +0200, Alvaro Herrera wrote: > On 2023-Sep-02, 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. > > Yeah, using void * seem

Re: Buildfarm failures on urocryon

2023-09-03 Thread vignesh C
On Fri, 1 Sept 2023 at 20:20, Mark Wong wrote: > > Hi, > > On Fri, Sep 01, 2023 at 11:27:47AM +0530, vignesh C wrote: > > Hi, > > > > Recently urocryon has been failing with the following errors at [1]: > > checking for icu-uc icu-i18n... no > > configure: error: ICU library not found > > If you h

Re: Inefficiency in parallel pg_restore with many tables

2023-09-03 Thread Alvaro Herrera
On 2023-Sep-02, Nathan Bossart wrote: > On Fri, Sep 01, 2023 at 01:52:48PM -0700, Nathan Bossart wrote: > > Yeah, something similar to simplehash for binary heaps could be nice. That > > being said, I don't know if there's a strong reason to specialize the > > implementation for a given C data t

Re: proposal: psql: show current user in prompt

2023-09-03 Thread Jelte Fennema
On Sun, 3 Sept 2023 at 08:24, Pavel Stehule wrote: > My personal feeling from this area is that the protocol design is done, but > it is not implemented on libpq level. My feelings can be wrong. The protocol > number is hardcoded in libpq, so I cannot change it from the client side. No, I agre