bug: pg_dump use strange tag for trigger

2022-11-05 Thread Pavel Stehule
Hi, When I played with regression tests for pg_restore, I tested -T filtering triggers too. I had problems with restoring triggers. I found that the name for trigger uses the pattern "tablename triggername" (not just (and correct) triggername). I propose to generate tag just like trigger name

Re: explain analyze rows=%.0f

2022-11-05 Thread Tom Lane
Robert Haas writes: > On Fri, Jul 22, 2022 at 6:47 AM Amit Kapila wr= ote: >> I feel the discussion has slightly deviated which makes it unclear >> whether this patch is required or not? > My opinion is that showing some fractional digits at least when > loops>1 would be better than what we

Re: new option to allow pg_rewind to run without full_page_writes

2022-11-05 Thread Andres Freund
Hi, On 2022-11-03 16:54:13 +0100, Jérémie Grauer wrote: > Currently pg_rewind refuses to run if full_page_writes is off. This is to > prevent it to run into a torn page during operation. > > This is usually a good call, but some file systems like ZFS are naturally > immune to torn page (maybe

Re: Suppressing useless wakeups in walreceiver

2022-11-05 Thread Nathan Bossart
On Sat, Nov 05, 2022 at 03:00:55PM -0700, Nathan Bossart wrote: > On Mon, Oct 17, 2022 at 03:21:18PM +0900, Kyotaro Horiguchi wrote: >> Now that I see the fix for the implicit conversion: >> >> L527: + nap = Max(0, (nextWakeup - now + 999) / >> 1000); >> .. >> L545:

Re: Suppressing useless wakeups in walreceiver

2022-11-05 Thread Nathan Bossart
On Wed, Oct 26, 2022 at 03:05:20PM +0530, Bharath Rupireddy wrote: > A comment on the patch: > Isn't it better we track the soonest wakeup time or min of wakeup[] > array (update the min whenever the array element is updated in > WalRcvComputeNextWakeup()) instead of recomputing everytime by

Re: Suppressing useless wakeups in walreceiver

2022-11-05 Thread Nathan Bossart
On Mon, Oct 17, 2022 at 03:21:18PM +0900, Kyotaro Horiguchi wrote: > Now that I see the fix for the implicit conversion: > > L527: + nap = Max(0, (nextWakeup - now + 999) / > 1000); > .. > L545: +

Re: thinko in basic_archive.c

2022-11-05 Thread Nathan Bossart
On Fri, Oct 21, 2022 at 09:30:16PM +0530, Bharath Rupireddy wrote: > On Fri, Oct 21, 2022 at 10:43 AM Kyotaro Horiguchi > wrote: >> Thanks, but we don't need to wipe out the all bytes. Just putting \0 >> at the beginning of the buffer is sufficient. > > Nah, that's not a clean way IMO. Why not?

Re: Documentation for building with meson

2022-11-05 Thread Andres Freund
Hi, On 2022-10-30 20:51:59 -0700, samay sharma wrote: > +# setup and enter build directory (done only first time) > +meson setup build src --prefix=$PWD/install This command won't work on windows, I think. > + > + Configuring the build > + > + > +The first step of the installation

Re: archive modules

2022-11-05 Thread Nathan Bossart
On Mon, Oct 17, 2022 at 02:49:51PM +0900, Michael Paquier wrote: > And, by the way, this patch would prevent the existence of archive > modules that need to be loaded but *want* an archive_command with > what they want to achieve. That does not strike me as a good idea if > we want to have a

Re: archive modules

2022-11-05 Thread Nathan Bossart
On Fri, Nov 04, 2022 at 12:05:26PM +0900, Ian Lawrence Barwick wrote: > cfbot reports the patch no longer applies [1]. As CommitFest 2022-11 is > currently underway, this would be an excellent time to update the patch. Indeed. Here is a new version of the patch. -- Nathan Bossart Amazon Web

Re: Do we need to pass down nonnullable_vars when reducing outer joins?

2022-11-05 Thread Tom Lane
Richard Guo writes: > AFAICS, the Vars forced nonnullable by given clause are only used to > check if we can reduce JOIN_LEFT to JOIN_ANTI, and it is checking the > join's own quals there. It seems to me we do not need to pass down > nonnullable_vars by upper quals to the children of a join.

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

2022-11-05 Thread Pavel Stehule
Hi pá 4. 11. 2022 v 14:28 odesílatel Julien Rouhaud napsal: > On Fri, Nov 04, 2022 at 07:19:27AM -0500, Justin Pryzby wrote: > > On Fri, Nov 04, 2022 at 07:59:01PM +0800, Julien Rouhaud wrote: > > > On Thu, Nov 03, 2022 at 10:22:15PM +0100, Pavel Stehule wrote: > > > > čt 3. 11. 2022 v 5:09

Re: Check SubPlan clause for nonnullable rels/Vars

2022-11-05 Thread Tom Lane
Richard Guo writes: > [ v2-0001-Check-SubPlan-clause-for-nonnullable-rels-Vars.patch ] Pushed with cosmetic changes: * I don't believe in "add at the end" as a principle for placement of new code. There's usually some other logic that will give more consistent results. In cases like this,

Re: Lockless queue of waiters in LWLock

2022-11-05 Thread Andres Freund
Hi, On 2022-11-05 12:05:43 +0300, Alexander Korotkov wrote: > On Fri, Nov 4, 2022 at 10:07 PM Andres Freund wrote: > > The use of cmpxchg vs lock inc/lock add/xadd is one of the major reasons why > > lwlocks are slower than a spinlock (but obviously are better under > > contention > >

Re: pg_reload_conf() synchronously

2022-11-05 Thread Andres Freund
Hi, On 2022-11-05 12:03:49 -0700, Gurjeet Singh wrote: > For example, I thought of implementing DSM based synchronisation between > processes, so that the invoking backend can be sure that _all_ children of > Postmaster have processed the reload. But that will run into problems as > different

Re: pg_reload_conf() synchronously

2022-11-05 Thread Gurjeet Singh
On Sat, Nov 5, 2022 at 11:23 AM Andres Freund wrote: > > As far as I know, Gurjeet has been annoyed only with non-user-settable > > GUCs for one connection (correct me of course), there was nothing > > fancy with isolation tests, yet. Not saying that this is useless for > > isolation tests, this

Re: ssl tests aren't concurrency safe due to get_free_port()

2022-11-05 Thread Andres Freund
Hi, On 2022-11-03 14:16:51 -0400, Andrew Dunstan wrote: > > Here's a patch which I think does the right thing. > Updated with a couple of thinkos fixed. Thanks! > diff --git a/src/test/perl/PostgreSQL/Test/Cluster.pm > b/src/test/perl/PostgreSQL/Test/Cluster.pm > index d80134b26f..aceca353d3

Re: [PATCH] Add native windows on arm64 support

2022-11-05 Thread Andres Freund
Hi, On 2022-11-03 11:06:46 +, Niyas Sait wrote: > I've attached a new version of the patch which excludes the already merged > ASLR changes and add > small changes to handle latest changes in the build scripts. Note that we're planning to remove the custom windows build scripts before the

Re: pg_reload_conf() synchronously

2022-11-05 Thread Andres Freund
Hi, On 2022-11-05 14:26:44 +0900, Michael Paquier wrote: > On Fri, Nov 04, 2022 at 09:51:08PM -0700, Andres Freund wrote: > > On 2022-11-04 23:35:21 -0400, Tom Lane wrote: > >> True, but do we have any such cases? > > > > I know I hit it twice and gave up on the tests. > > Still, is there any

Re: [PATCH] ALTER TABLE ... SET STORAGE default

2022-11-05 Thread Tom Lane
Aleksander Alekseev writes: > Hi Nikita, >> This seems a little bit confusing and thus very unfriendly for the user, >> because the actual meaning >> of the same 'DEFAULT' option will be different for each data type, and to >> check storage mode user >> has to query full table (or column)

Re: pg_dump: Refactor code that constructs ALTER ... OWNER TO commands

2022-11-05 Thread Corey Huinker
On Wed, Nov 2, 2022 at 5:30 PM Peter Eisentraut < peter.eisentr...@enterprisedb.com> wrote: > On 01.11.22 13:59, Corey Huinker wrote: > > On Mon, Oct 24, 2022 at 5:54 AM Peter Eisentraut > > > > wrote: > > > > Avoid having to list all the possible

Re: Schema variables - new implementation for Postgres 15

2022-11-05 Thread Julien Rouhaud
Hi, On Sat, Nov 05, 2022 at 05:04:31PM +0100, Tomas Vondra wrote: > > I did a quick initial review of this patch series - attached is a > version with "review" commits for some of the parts. The current patch > seems in pretty good shape, most of what I noticed are minor issues. I > plan to do a

Re: [patch] Have psql's \d+ indicate foreign partitions

2022-11-05 Thread Tom Lane
Michael Paquier writes: > On Mon, Oct 24, 2022 at 09:44:18PM +0900, Ian Lawrence Barwick wrote: >> Recently I have been working a lot with partitioned tables which contain a >> mix >> of local and foreign partitions, and find it would be very useful to be able >> to >> easily obtain an overview

Re: Temporary tables versus wraparound... again

2022-11-05 Thread Tom Lane
Greg Stark writes: > Simple Rebase I took a little bit of a look through these. * I find 0001 a bit scary, specifically that it's decided it's okay to apply extract_autovac_opts, pgstat_fetch_stat_tabentry_ext, and especially relation_needs_vacanalyze to another session's temp table. How safe

Re: Add common function ReplicationOriginName.

2022-11-05 Thread Tom Lane
Aleksander Alekseev writes: > This leaves us one patch to deal with. > [ v4-0001-Pass-Size-size_t-as-a-2nd-argument-of-snprintf.patch ] I looked at this and am inclined to reject it. None of these places realistically need to deal with strings longer than MAXPATHLEN or so, let alone multiple

Re: explain_regress, explain(MACHINE), and default to explain(BUFFERS) (was: BUFFERS enabled by default in EXPLAIN (ANALYZE))

2022-11-05 Thread Tom Lane
Justin Pryzby writes: > You set the patch to "waiting on author", which indicates that there's > no need for further input or review. But, I think that's precisely > what's needed - without input from more people, what could I do to > progress the patch ? I don't think it's reasonable to put

Re: explain_regress, explain(MACHINE), and default to explain(BUFFERS) (was: BUFFERS enabled by default in EXPLAIN (ANALYZE))

2022-11-05 Thread Justin Pryzby
On Fri, Nov 04, 2022 at 11:46:03AM +0100, Laurenz Albe wrote: > "explain_regress" reduces the EXPLAIN options you need for regression tests. > This is somewhat useful, but not a big win. Also, it will make backpatching > regression tests slightly harder for the next 5 years. But it doesn't

Re: New docs chapter on Transaction Management and related changes

2022-11-05 Thread Simon Riggs
On Fri, 4 Nov 2022 at 15:17, Laurenz Albe wrote: > > On Sat, 2022-10-15 at 21:08 -0400, Bruce Momjian wrote: > > I therefore merged all three paragraphs into > > one and tried to make the text saner; release_savepoint.sgml diff > > attached, URL content updated. > > I wanted to have a look at

Re: [PoC] Improve dead tuple storage for lazy vacuum

2022-11-05 Thread John Naylor
On Fri, Nov 4, 2022 at 10:25 PM Masahiko Sawada wrote: > > For parallel heap pruning, multiple workers will insert key-value > pairs to the radix tree concurrently. The simplest solution would be a > single lock to protect writes but the performance will not be good. > Another solution would be

Re: Lockless queue of waiters in LWLock

2022-11-05 Thread Alexander Korotkov
Hi, Andres! On Fri, Nov 4, 2022 at 10:07 PM Andres Freund wrote: > The use of cmpxchg vs lock inc/lock add/xadd is one of the major reasons why > lwlocks are slower than a spinlock (but obviously are better under contention > nonetheless). > > > I have a benchmark program that starts a thread

Re: Add proper planner support for ORDER BY / DISTINCT aggregates

2022-11-05 Thread Pavel Luzanov
Hello, While playing with the patch I found a situation where the performance may be degraded compared to previous versions. The test case below. If you create a proper index for the query (a,c), version 16 wins. On my notebook, the query runs ~50% faster. But if there is no index (a,c), but

Re: psql: Add command to use extended query protocol

2022-11-05 Thread Pavel Stehule
so 5. 11. 2022 v 7:35 odesílatel Corey Huinker napsal: > On Fri, Nov 4, 2022 at 11:45 AM Peter Eisentraut < > peter.eisentr...@enterprisedb.com> wrote: > >> On 02.11.22 01:18, Corey Huinker wrote: >> > >> > SELECT $1, $2 \gp 'foo' 'bar' >> > >> > >> > I think this is a great idea, but

Re: remap the .text segment into huge pages at run time

2022-11-05 Thread Andres Freund
Hi, On 2022-11-05 12:54:18 +0700, John Naylor wrote: > On Sat, Nov 5, 2022 at 1:33 AM Andres Freund wrote: > > I hacked in a MADV_COLLAPSE (with setarch -R, so that I could just > hardcode > > the address / length), and it seems to work nicely. > > > > With the weird caveat that on fs one needs

Re: psql: Add command to use extended query protocol

2022-11-05 Thread Corey Huinker
On Fri, Nov 4, 2022 at 11:45 AM Peter Eisentraut < peter.eisentr...@enterprisedb.com> wrote: > On 02.11.22 01:18, Corey Huinker wrote: > > > > SELECT $1, $2 \gp 'foo' 'bar' > > > > > > I think this is a great idea, but I foresee people wanting to send that > > output to a file or a pipe

Re: Reviving lost replication slots

2022-11-05 Thread Amit Kapila
On Fri, Nov 4, 2022 at 1:40 PM sirisha chamarthi wrote: > > A replication slot can be lost when a subscriber is not able to catch up with > the load on the primary and the WAL to catch up exceeds > max_slot_wal_keep_size. When this happens, target has to be reseeded > (pg_dump) from the