Re: postgres_fdw: batch inserts vs. before row triggers

2022-12-01 Thread Etsuro Fujita
On Sun, Nov 27, 2022 at 12:11 AM Tom Lane wrote: > Etsuro Fujita writes: > > On Sat, Nov 26, 2022 at 1:57 AM Tom Lane wrote: > >> Couldn't we add the field to ModifyTableState, instead? > > > We could probably do so, but I thought having a global list would be > > more efficient to handle pendin

Optimize common expressions in projection evaluation

2022-12-01 Thread Peifeng Qiu
Hi hackers. When a star(*) expands into multiple fields, our current implementation is to generate multiple copies of the expression and do FieldSelects. This is very inefficient because the same expression get evaluated multiple times but actually we only need to do it once. This is stated in Exp

Re: HOT chain validation in verify_heapam()

2022-12-01 Thread Himanshu Upadhyaya
Hi, On Fri, Dec 2, 2022 at 5:43 AM Andres Freund wrote: > > > + curr_htup = (HeapTupleHeader) PageGetItem(ctx.page, > curr_lp); > > + curr_xmin = HeapTupleHeaderGetXmin(curr_htup); > > + xid_status = get_xid_status(curr_xmin, &ctx, > &

Re: ExecRTCheckPerms() and many prunable partitions

2022-12-01 Thread Amit Langote
Hi Alvaro, On Wed, Nov 30, 2022 at 5:32 PM Alvaro Herrera wrote: > > On Tue, Nov 29, 2022 at 6:27 PM Alvaro Herrera > > wrote: > > Thanks, I've merged all. I do wonder that it is only in PlannedStmt > > that the list is called something that is not "rtepermlist", but I'm > > fine with it if yo

Re: Introduce a new view for checkpointer related stats

2022-12-01 Thread Drouvot, Bertrand
Hi, On 12/2/22 6:50 AM, Bharath Rupireddy wrote: On Wed, Nov 30, 2022 at 5:15 PM Bharath Rupireddy wrote: I don't have a strong opinion about changing column names. However, if we were to change it, I prefer to use names that PgStat_CheckpointerStats has. BTW, that's what PgStat_BgWriterStats

Re: Improve performance of pg_strtointNN functions

2022-12-01 Thread Peter Eisentraut
On 01.12.22 06:38, David Rowley wrote: If this was going to cause huge conflicts with Peter's patch then I might think differently. I feel like it's a fairly trivial task to rebase. If the consensus is that we should fix this afterwards, then I'm happy to delay. If we are happy with this patch

refactor ExecGrant_*() functions

2022-12-01 Thread Peter Eisentraut
Continuing the ideas in [0], this patch refactors the ExecGrant_Foo() functions and replaces many of them by a common function that is driven by the ObjectProperty table. It would be nice to do more here, for example ExecGrant_Language(), which has additional non-generalizable checks, but I th

Re: Introduce a new view for checkpointer related stats

2022-12-01 Thread Bharath Rupireddy
On Fri, Dec 2, 2022 at 12:54 PM sirisha chamarthi wrote: > > On Thu, Dec 1, 2022 at 9:50 PM Bharath Rupireddy > wrote: >> >> On Wed, Nov 30, 2022 at 5:15 PM Bharath Rupireddy >> wrote: >> > >> > I don't have a strong opinion about changing column names. However, if >> > we were to change it, I

Re: Missing MaterialPath support in reparameterize_path_by_child

2022-12-01 Thread Richard Guo
On Fri, Dec 2, 2022 at 10:55 AM Tom Lane wrote: > I traced that to the fact that reparameterize_path_by_child() > omits support for MaterialPath, so that if the only surviving > path(s) for a child join include materialization steps, we'll > fail outright to produce a plan for the parent join.

Re: Introduce a new view for checkpointer related stats

2022-12-01 Thread sirisha chamarthi
On Thu, Dec 1, 2022 at 9:50 PM Bharath Rupireddy < bharath.rupireddyforpostg...@gmail.com> wrote: > On Wed, Nov 30, 2022 at 5:15 PM Bharath Rupireddy > wrote: > > > > I don't have a strong opinion about changing column names. However, if > > we were to change it, I prefer to use names that > > Pg

Re: Add LSN along with offset to error messages reported for WAL file read/write/validate header failures

2022-12-01 Thread Michael Paquier
On Thu, Nov 17, 2022 at 11:53:23AM +0530, Bharath Rupireddy wrote: > Please do, if you feel so. Thanks for your review. I don't really mind the addition of the LSN when operating on a given record where we are reading a location, like in the five error paths for the header validation or the three

Re: pg_dump: Remove "blob" terminology

2022-12-01 Thread Peter Eisentraut
On 30.11.22 09:07, Daniel Gustafsson wrote: The commit message contains a typo: functinos fixed * called for both BLOB and TABLE data; it is the responsibility of - * the format to manage each kind of data using StartBlob/StartData. + * the format to manage each kind of data using StartLO/

Re: Time delayed LR (WAS Re: logical replication restrictions)

2022-12-01 Thread Amit Kapila
On Tue, Nov 15, 2022 at 12:33 PM Amit Kapila wrote: > > On Mon, Nov 14, 2022 at 6:52 PM Hayato Kuroda (Fujitsu) > wrote: > > > > Dear Amit, > > > > > > > It seems to me Kuroda-San has proposed this change [1] to fix the test > > > > > but it is not clear to me why such a change is required. Why c

Re: initdb: Refactor PG_CMD_PUTS loops

2022-12-01 Thread John Naylor
On Thu, Dec 1, 2022 at 5:02 PM Peter Eisentraut < peter.eisentr...@enterprisedb.com> wrote: > > Keeping the SQL commands that initdb runs in string arrays before > feeding them to PG_CMD_PUTS() seems unnecessarily verbose and > inflexible. In some cases, the array only has one member. In other >

Re: O(n) tasks cause lengthy startups and checkpoints

2022-12-01 Thread Bharath Rupireddy
On Fri, Dec 2, 2022 at 3:10 AM Nathan Bossart wrote: > > >> 4. Is it a good idea to add log messages in the DoCustodianTasks() > >> loop? Maybe at a debug level? The log message can say the current task > >> the custodian is processing. And/Or setting the custodian's status on > >> the ps display

Re: Failed Assert in pgstat_assoc_relation

2022-12-01 Thread Tom Lane
Andres Freund writes: > On December 1, 2022 9:48:48 PM PST, Tom Lane wrote: >> I'd suggest putting in an assertion that the relkind isn't changing, >> instead. > Sounds like a plan. Will you do that when you remove the table-to-view hack? I'd suggest committing it concurrently with the v15 fix

Re: Failed Assert in pgstat_assoc_relation

2022-12-01 Thread Andres Freund
Hi, On December 1, 2022 9:48:48 PM PST, Tom Lane wrote: >Andres Freund writes: >> On 2022-12-02 00:08:20 -0500, Tom Lane wrote: >>> Just the table-to-view hack. I'm not aware that there are any other >>> cases, and it seems hard to credit that there ever will be any. > >> I can see some halfwa

Re: Introduce a new view for checkpointer related stats

2022-12-01 Thread Bharath Rupireddy
On Wed, Nov 30, 2022 at 5:15 PM Bharath Rupireddy wrote: > > I don't have a strong opinion about changing column names. However, if > we were to change it, I prefer to use names that > PgStat_CheckpointerStats has. BTW, that's what > PgStat_BgWriterStats/pg_stat_bgwriter and > PgStat_ArchiverStats

Re: Failed Assert in pgstat_assoc_relation

2022-12-01 Thread Tom Lane
Andres Freund writes: > On 2022-12-02 00:08:20 -0500, Tom Lane wrote: >> Just the table-to-view hack. I'm not aware that there are any other >> cases, and it seems hard to credit that there ever will be any. > I can see some halfway credible scenarios. E.g. converting a view to a > matview, or a

Re: [PATCH] Add native windows on arm64 support

2022-12-01 Thread John Naylor
On Fri, Dec 2, 2022 at 12:20 AM Niyas Sait wrote: > > > On 07/11/2022 06:58, Michael Paquier wrote: > > Seems so. Hmm, where does _ARM64_BARRIER_SY come from? Perhaps it > > would be better to have a comment referring to it from a different > > place than the forums of arm, like some actual docs

Re: Failed Assert in pgstat_assoc_relation

2022-12-01 Thread Andres Freund
Hi, On 2022-12-02 00:08:20 -0500, Tom Lane wrote: > Andres Freund writes: > > Do we have any cases of relcache entries changing their relkind? > > Just the table-to-view hack. I'm not aware that there are any other > cases, and it seems hard to credit that there ever will be any. I can see some

Re: [PATCH] Add `verify-system` sslmode to use system CA pool for server cert

2022-12-01 Thread Michael Paquier
On Mon, Nov 07, 2022 at 05:04:14PM -0800, Jacob Champion wrote: > Done. sslrootcert=system now prevents you from explicitly setting a > weaker sslmode, to try to cement it as a Do What I Mean sort of > feature. If you need something weird then you can still jump through > the hoops by setting sslro

Re: Non-replayable WAL records through overflows and >MaxAllocSize lengths

2022-12-01 Thread Michael Paquier
On Fri, Nov 04, 2022 at 09:52:39AM +0900, Ian Lawrence Barwick wrote: > CommitFest 2022-11 is currently underway, so if you are interested > in moving this patch forward, now would be a good time to update it. No replies after 4 weeks, so I have marked this entry as returned with feedback. I am s

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

2022-12-01 Thread Michael Paquier
On Mon, Nov 21, 2022 at 12:21:09PM +0300, Aleksander Alekseev wrote: > After merging 1489b1ce [1] the patchset needed a rebase. PFA v47. > > [1]: https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=1489b1ce The CF bot is showing some failures here. You may want to double-check. -- Mic

Re: Failed Assert in pgstat_assoc_relation

2022-12-01 Thread Tom Lane
Andres Freund writes: > Do we have any cases of relcache entries changing their relkind? Just the table-to-view hack. I'm not aware that there are any other cases, and it seems hard to credit that there ever will be any. I think we could get rid of table-to-view in HEAD, and use your patch only

Re: [PATCH] Add native windows on arm64 support

2022-12-01 Thread Michael Paquier
On Thu, Dec 01, 2022 at 05:53:47PM +, Niyas Sait wrote: > I've attached a new revision of the patch (v4) and includes following > changes, > > 1. Add support for meson build system > 2. Extend MSVC scripts to handle ARM64 platform. > 3. Add arm64 definition of spin_delay function. > 4. Exclude

Re: Failed Assert in pgstat_assoc_relation

2022-12-01 Thread Andres Freund
Hi, On 2022-11-28 16:33:20 -0500, Tom Lane wrote: > Andres Freund writes: > > Something like the attached. Still needs a bit of polish, e.g. adding the > > test > > case from above. > > > I'm a bit uncomfortable adding a function call below > > * Perform swapping of the relcache ent

Re: Failed Assert while pgstat_unlink_relation

2022-12-01 Thread Andres Freund
Hi, On 2022-11-29 15:42:45 +0900, Kyotaro Horiguchi wrote: > At Mon, 28 Nov 2022 14:01:30 +0530, vignesh C wrote in > > Hi, > > > > While reviewing/testing one of the patches I found the following Assert: > > #0 0x55c6312ba639 in pgstat_unlink_relation (rel=0x7fb73bcbac58) > > at pgstat_re

Re: Warning When Creating FOR EACH STATEMENT Trigger On Logical Replication Subscriber Side

2022-12-01 Thread Amit Kapila
On Thu, Dec 1, 2022 at 7:29 PM Avi Weinberg wrote: > > > There is no error or warning when creating FOR EACH STATEMENT trigger on > Logical Replication subscriber side, but it is not doing anything. Shouldn't > a warning be helpful? > > > > CREATE TRIGGER set_updated_time_trig > >AFTER INS

Missing MaterialPath support in reparameterize_path_by_child

2022-12-01 Thread Tom Lane
Whilst fooling with my outer-join-aware-Vars patch, I tripped across a multi-way join query that failed with ERROR: could not devise a query plan for the given query when enable_partitionwise_join is on. I traced that to the fact that reparameterize_path_by_child() omits support for MaterialPat

Re: Using WaitEventSet in the postmaster

2022-12-01 Thread Thomas Munro
On Fri, Dec 2, 2022 at 2:40 PM Andres Freund wrote: > On 2022-12-02 10:12:25 +1300, Thomas Munro wrote: > > with a latch as the wakeup mechanism for "PM signals" (requests from > > backends to do things like start a background worker, etc). > > Hm - is that directly related? ISTM that using a WES

Re: Using AF_UNIX sockets always for tests on Windows

2022-12-01 Thread Andres Freund
Hi, On 2022-12-01 20:56:18 -0500, Tom Lane wrote: > Andres Freund writes: > > On 2022-12-01 20:30:36 -0500, Tom Lane wrote: > >> If we remove that, won't we have a whole lot of code that's not > >> tested at all on any platform, ie all the TCP-socket code? > > > There's some coverage via the aut

Re: Add LZ4 compression in pg_dump

2022-12-01 Thread Michael Paquier
On Thu, Dec 01, 2022 at 02:58:35PM +, gkokola...@pm.me wrote: > Nuking the warning from orbit and changing the behaviour around disabling > the requested compression when the libraries are not present, should not > mean that we need to change the behaviour of default values for different > form

Re: Using AF_UNIX sockets always for tests on Windows

2022-12-01 Thread Tom Lane
Andres Freund writes: > On 2022-12-01 20:30:36 -0500, Tom Lane wrote: >> If we remove that, won't we have a whole lot of code that's not >> tested at all on any platform, ie all the TCP-socket code? > There's some coverage via the auth and ssl tests. But I agree it's an > issue. But to me the fix

Re: Prefetch the next tuple's memory during seqscans

2022-12-01 Thread David Rowley
On Thu, 1 Dec 2022 at 18:18, John Naylor wrote: > I then tested a Power8 machine (also kernel 3.10 gcc 4.8). Configure reports > "checking for __builtin_prefetch... yes", but I don't think it does anything > here, as the results are within noise level. A quick search didn't turn up > anything i

Re: Using AF_UNIX sockets always for tests on Windows

2022-12-01 Thread Andres Freund
Hi, On 2022-12-01 20:30:36 -0500, Tom Lane wrote: > Thomas Munro writes: > > Commit f5580882 established that all supported computers have AF_UNIX. > > One of the follow-up consequences that was left unfinished is that we > > could simplify our test harness code to make it the same on all > > pla

Re: Using WaitEventSet in the postmaster

2022-12-01 Thread Andres Freund
Hi, On 2022-12-02 10:12:25 +1300, Thomas Munro wrote: > Here's a work-in-progress patch that uses WaitEventSet for the main > event loop in the postmaster Wee! > with a latch as the wakeup mechanism for "PM signals" (requests from > backends to do things like start a background worker, etc). H

Re: Using AF_UNIX sockets always for tests on Windows

2022-12-01 Thread Tom Lane
Thomas Munro writes: > Commit f5580882 established that all supported computers have AF_UNIX. > One of the follow-up consequences that was left unfinished is that we > could simplify our test harness code to make it the same on all > platforms. Currently we have hundreds of lines of C and perl to

Re: pg_upgrade: Make testing different transfer modes easier

2022-12-01 Thread Kyotaro Horiguchi
At Thu, 1 Dec 2022 16:18:21 +0100, Peter Eisentraut wrote in > I wanted to test the different pg_upgrade transfer modes (--link, > --clone), but that was not that easy, because there is more than one > place in the test script you have to find and manually change. So I > wrote a little patch to

Re: Avoid LWLockWaitForVar() for currently held WAL insertion lock in WaitXLogInsertionsToFinish()

2022-12-01 Thread Andres Freund
On 2022-11-25 16:54:19 +0530, Bharath Rupireddy wrote: > On Fri, Nov 25, 2022 at 12:16 AM Andres Freund wrote: > > I think we could improve this code more significantly by avoiding the call > > to > > LWLockWaitForVar() for all locks that aren't acquired or don't have a > > conflicting insertingA

Re: wake up logical workers after ALTER SUBSCRIPTION

2022-12-01 Thread Nathan Bossart
On Tue, Nov 29, 2022 at 09:04:41PM -0800, Nathan Bossart wrote: > I don't mind fixing it! There are a couple more I'd like to track down > before posting another revision. Okay, here is a new version of the patch. This seems to clear up everything that I could find via the tests. Thanks to this

Re: HOT chain validation in verify_heapam()

2022-12-01 Thread Andres Freund
Hi, On 2022-11-30 16:09:19 +0530, Himanshu Upadhyaya wrote: > has been updated to handle cases of sub-transaction. Thanks! > + /* Loop over offsets and validate the data in the predecessor > array. */ > + for (OffsetNumber currentoffnum = FirstOffsetNumber; > currentof

Using AF_UNIX sockets always for tests on Windows

2022-12-01 Thread Thomas Munro
Hi, Commit f5580882 established that all supported computers have AF_UNIX. One of the follow-up consequences that was left unfinished is that we could simplify our test harness code to make it the same on all platforms. Currently we have hundreds of lines of C and perl to use secure TCP connectio

Re: Asynchronous execution support for Custom Scan

2022-12-01 Thread Kohei KaiGai
> > IIUC, we already can use ctid in the where clause on the latest > > PostgreSQL, can't we? > > Oh, sorry, I missed the TidRangeScan. My apologies for the noise. > I made the ctidscan extension when we developed CustomScan API towards v9.5 or v9.6, IIRC. It would make sense just an example of Cus

Re: Error-safe user functions

2022-12-01 Thread Tom Lane
Robert Haas writes: > It sounds to me like we're crafting something that is specific to and > can only be used with type input and output functions, so the name > probably should reflect that rather than being something totally > generic like ereturn() or error_stash() or whatever. My opinion is

Re: Questions regarding distinct operation implementation

2022-12-01 Thread David G. Johnston
On Thu, Dec 1, 2022 at 2:37 PM David Rowley wrote: > > The question is, what do you want to make work? If you're not worried > about supporting DISTINCT when there is an ORDER BY clause and the > frame options are effectively ROWS BETWEEN UNBOUNDED PRECEDING AND > UNBOUNDED FOLLOWING, then it's

Re: Allow round() function to accept float and double precision

2022-12-01 Thread David G. Johnston
On Thu, Dec 1, 2022 at 2:21 PM David Rowley wrote: > On Fri, 2 Dec 2022 at 09:02, Tom Lane wrote: > > > > David Rowley writes: > > > I don't really agree that it will work fine in all cases though. If > > > the numeric has more than 1000 digits left of the decimal point then > > > the method wo

Re: O(n) tasks cause lengthy startups and checkpoints

2022-12-01 Thread Nathan Bossart
On Wed, Nov 30, 2022 at 05:27:10PM +0530, Bharath Rupireddy wrote: > On Wed, Nov 30, 2022 at 4:52 PM Bharath Rupireddy > wrote: >> Thanks for the patches. I spent some time on reviewing v17 patch set >> and here are my comments: Thanks for reviewing! >> 0001: >> 1. I think the custodian process

Re: Questions regarding distinct operation implementation

2022-12-01 Thread David Rowley
On Fri, 2 Dec 2022 at 08:10, Ankit Kumar Pandey wrote: > select avg(distinct id) over (partition by name) from mytable (in oracle db) > yields: > 2 > 2 > 2 > 2 > 10 > > From this, it is seen distinct is taken across the all rows in the partition. Due to the lack of ORDER BY clause, all rows in t

Re: Allow round() function to accept float and double precision

2022-12-01 Thread David Rowley
On Fri, 2 Dec 2022 at 09:02, Tom Lane wrote: > > David Rowley writes: > > I don't really agree that it will work fine in all cases though. If > > the numeric has more than 1000 digits left of the decimal point then > > the method won't work at all. > > But what we're talking about is starting fro

Re: Error-safe user functions

2022-12-01 Thread Robert Haas
On Thu, Dec 1, 2022 at 3:49 PM Tom Lane wrote: > > I don't think it's sensible to make decisions about important syntax > > on the basis of byte-length. Reindenting is a one-time effort; code > > clarity will be with us forever. > > Sure, but without a proposal for a better name, that's irrelevant

Using WaitEventSet in the postmaster

2022-12-01 Thread Thomas Munro
Hi, Here's a work-in-progress patch that uses WaitEventSet for the main event loop in the postmaster, with a latch as the wakeup mechanism for "PM signals" (requests from backends to do things like start a background worker, etc). There are still raw signals that are part of the external interfac

Re: Lazy JIT IR code generation to increase JIT speed with partitions

2022-12-01 Thread Dmitry Dolgov
> On Thu, Jul 14, 2022 at 02:45:29PM +0200, David Geier wrote: > On Mon, Jul 4, 2022 at 10:32 PM Andres Freund wrote: > > On 2022-06-27 16:55:55 +0200, David Geier wrote: > > > Indeed, the total JIT time increases the more modules are used. The > > reason > > > for this to happen is that the inlin

Re: Error-safe user functions

2022-12-01 Thread Tom Lane
Robert Haas writes: > On Thu, Dec 1, 2022 at 2:41 PM Tom Lane wrote: >> I'd be the first to agree that "ereturn" >> doesn't capture that detail very well, but I don't have a better name. >> (And I do like the fact that this name is the same length as "ereport", >> so that we won't end up with lot

Re: meson PGXS compatibility

2022-12-01 Thread Andres Freund
Hi, On 2022-12-01 08:43:19 +0100, Peter Eisentraut wrote: > On 13.10.22 07:23, Andres Freund wrote: > > > > 0005: meson: Add PGXS compatibility > > > > > > > > The actual meson PGXS compatibility. Plenty more replacements to > > > > do, but > > > > suffices to build common extensions on

Re: Error-safe user functions

2022-12-01 Thread Robert Haas
On Thu, Dec 1, 2022 at 2:41 PM Tom Lane wrote: > Robert Haas writes: > > It sounds like you're imagining that ereturn doesn't return, which > > seems confusing. But I don't know that I'd like it better if it did. > > The spec I had in mind was that it would behave as ereport(ERROR) > unless a sui

Re: Allow round() function to accept float and double precision

2022-12-01 Thread Tom Lane
David Rowley writes: > I don't really agree that it will work fine in all cases though. If > the numeric has more than 1000 digits left of the decimal point then > the method won't work at all. But what we're talking about is starting from a float4 or float8 input, so it can't be more than ~308 d

Re: Allow round() function to accept float and double precision

2022-12-01 Thread David Rowley
On Thu, 1 Dec 2022 at 21:55, Dean Rasheed wrote: > Casting to numeric(1000, n) will work fine in all cases AFAICS (1000 > being the maximum allowed precision in a numeric typemod, and somewhat > more memorable). I wasn't aware of the typemod limit. I don't really agree that it will work fine in

Re: Error-safe user functions

2022-12-01 Thread Tom Lane
Robert Haas writes: > It sounds like you're imagining that ereturn doesn't return, which > seems confusing. But I don't know that I'd like it better if it did. The spec I had in mind was that it would behave as ereport(ERROR) unless a suitable FuncErrorContext node is passed, in which case it'd s

Re: Allow round() function to accept float and double precision

2022-12-01 Thread David G. Johnston
On Thu, Dec 1, 2022 at 7:39 AM Tom Lane wrote: > Dean Rasheed writes: > > > The fact that passing a negative scale to round() isn't documented > > does seem like an oversight though... > > Agreed, will do something about that. > > Thanks. I'm a bit surprised you left "Rounds v to s decimal place

Re: Temporary tables versus wraparound... again

2022-12-01 Thread Andres Freund
Hi, On 2022-12-01 11:13:01 -0500, Greg Stark wrote: > On Sat, 5 Nov 2022 at 11:34, Tom Lane wrote: > > > > 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_

Re: Questions regarding distinct operation implementation

2022-12-01 Thread Ankit Kumar Pandey
On 25/11/22 11:00, Ankit Kumar Pandey wrote: On 25/11/22 02:14, David Rowley wrote: On Fri, 25 Nov 2022 at 06:57, Ankit Kumar Pandey wrote: Please let me know any opinions on this. I think if you're planning on working on this then step 1 would have to be checking the SQL standard to see wh

Re: Error-safe user functions

2022-12-01 Thread Robert Haas
On Thu, Dec 1, 2022 at 1:14 PM Tom Lane wrote: > The main objection is that we shouldn't be passing back a "char *" > error string (though I observe that your 0003 and 0004 patches aren't > even bothering to do that much). I think we want to pass back a > fully populated ErrorData struct so that

Re: New docs chapter on Transaction Management and related changes

2022-12-01 Thread Alvaro Herrera
On 2022-Dec-01, Bruce Momjian wrote: > Patch reverted in all back branches. I was hoping to get support for > more aggressive backpatches of docs, but obviously failed. I should > have been clearer about my intent to backpatch, and will have to > consider these issues in future doc backpatches.

Re: Error-safe user functions

2022-12-01 Thread Tom Lane
Andrew Dunstan writes: > OK, here's a set of minimal patches based on Nikita's earlier work and > also some work by my colleague Amul Sul. It tries to follow Tom's > original outline at [1], and do as little else as possible. This is not really close at all to what I had in mind. The main object

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

2022-12-01 Thread Justin Pryzby
On Sat, Nov 05, 2022 at 10:43:07AM -0400, Tom Lane wrote: > 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 t

Re: [PATCH] Add native windows on arm64 support

2022-12-01 Thread Niyas Sait
Hello, I've attached a new revision of the patch (v4) and includes following changes, 1. Add support for meson build system 2. Extend MSVC scripts to handle ARM64 platform. 3. Add arm64 definition of spin_delay function. 4. Exclude arm_acle.h import with MSVC compiler. V3->V4: Add support for

Re: Error-safe user functions

2022-12-01 Thread Andrew Dunstan
On 2022-11-21 Mo 00:26, Tom Lane wrote: > Corey Huinker writes: >> On Tue, Nov 15, 2022 at 11:36 AM Andrew Dunstan wrote: >>> Nikita, >>> just checking in, are you making progress on this? I think we really >>> need to get this reviewed and committed ASAP if we are to have a chance >>> to get th

Re: Documentation for building with meson

2022-12-01 Thread Andres Freund
Hi, On 2022-12-01 15:58:39 +0100, Peter Eisentraut wrote: > On 23.11.22 22:24, samay sharma wrote: > > Thank you. Attaching v7 addressing most of the points below. > > I have committed this, after some editing and making some structural > changes. Thanks. I was working on that too, but somehow f

Re: [PATCH] Add native windows on arm64 support

2022-12-01 Thread Niyas Sait
On 07/11/2022 06:58, Michael Paquier wrote: #if defined(_WIN64) static __forceinline void spin_delay(void) { +#ifdef _M_ARM64 + /* +* arm64 way of hinting processor for spin loops optimisations +* ref: https://community.arm.com/support-forums/f/infrastructure-solu

Re: [PATCH] Add native windows on arm64 support

2022-12-01 Thread Niyas Sait
On 05/11/2022 18:31, Andres Freund wrote: 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

Re: Partial aggregates pushdown

2022-12-01 Thread Alexander Pyhalov
fujii.y...@df.mitsubishielectric.co.jp писал 2022-12-01 05:23: Hi Mr.Pyhalov. Hi. Attaching minor fixes. I haven't proof-read all comments (but perhaps, they need attention from some native speaker). Tested it with queries from https://github.com/swarm64/s64da-benchmark-toolkit, works as e

Re: Temporary tables versus wraparound... again

2022-12-01 Thread Greg Stark
On Sat, 5 Nov 2022 at 11:34, Tom Lane wrote: > > 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

Re: New docs chapter on Transaction Management and related changes

2022-12-01 Thread Bruce Momjian
On Wed, Nov 30, 2022 at 12:31:55PM -0500, Tom Lane wrote: > Alvaro Herrera writes: > > I find it a bit shocking to have had it backpatched, even to 15 -- a > > whole chapter in the documentation? I don't see why it wouldn't be > > treated like any other "major feature" patch, which we only consid

pg_upgrade: Make testing different transfer modes easier

2022-12-01 Thread Peter Eisentraut
I wanted to test the different pg_upgrade transfer modes (--link, --clone), but that was not that easy, because there is more than one place in the test script you have to find and manually change. So I wrote a little patch to make that easier. It's still manual, but it's a start. (In princi

Re: File API cleanup

2022-12-01 Thread Peter Eisentraut
On 01.12.22 09:55, Bharath Rupireddy wrote: can we have a generic, single function file_exists() in fd.c/file_utils.c so that both backend and frontend code can use it? I see there are 3 uses and definitions of it in jit.c, dfmgr.c and pg_regress.c. This will reduce the code duplication. Thoughts

Re: Documentation for building with meson

2022-12-01 Thread Peter Eisentraut
On 23.11.22 22:24, samay sharma wrote: Thank you. Attaching v7 addressing most of the points below. I have committed this, after some editing and making some structural changes. I moved the "Requirements" section back to the top level. It did not look appealing to have to maintain two copie

Re: Add LZ4 compression in pg_dump

2022-12-01 Thread gkokolatos
--- Original Message --- On Thursday, December 1st, 2022 at 3:05 AM, Michael Paquier wrote: > > > On Wed, Nov 30, 2022 at 05:11:44PM +, gkokola...@pm.me wrote: > > > Fair enough. The atteched v11 does that. 0001 introduces compression > > specification and is using it throug

Re: Allow round() function to accept float and double precision

2022-12-01 Thread Tom Lane
Dean Rasheed writes: > I don't really see the point of such a function either. > Casting to numeric(1000, n) will work fine in all cases AFAICS (1000 > being the maximum allowed precision in a numeric typemod, and somewhat > more memorable). Right, but I think what the OP wants is to not have to

Re: [DOCS] Stats views and functions not in order?

2022-12-01 Thread David G. Johnston
On Thu, Dec 1, 2022 at 2:20 AM Peter Eisentraut < peter.eisentr...@enterprisedb.com> wrote: > On 29.11.22 08:29, Peter Smith wrote: > > PSA v8* patches. > > > > Here, patches 0001 and 0002 are unchanged, but 0003 has many changes > > per David's suggestion [1] to change all these views to > > blo

Re: pgsql: Revoke PUBLIC CREATE from public schema, now owned by pg_databas

2022-12-01 Thread Tom Lane
Alvaro Herrera writes: > On 2022-Dec-01, Noah Misch wrote: >> This is free from the problem found in ddl-create-public-reorg-really.patch. >> However, the word "other" doesn't belong there. (The per-user schemas should >> not have public CREATE privilege.) I would also move that same sentence up

Warning When Creating FOR EACH STATEMENT Trigger On Logical Replication Subscriber Side

2022-12-01 Thread Avi Weinberg
Hi Hackers, There is no error or warning when creating FOR EACH STATEMENT trigger on Logical Replication subscriber side, but it is not doing anything. Shouldn't a warning be helpful? CREATE TRIGGER set_updated_time_trig AFTER INSERT OR UPDATE OR DELETE ON test FOR EACH STATEMENT EXECU

Re: Asynchronous execution support for Custom Scan

2022-12-01 Thread Ronan Dunklau
> IIUC, we already can use ctid in the where clause on the latest > PostgreSQL, can't we? Oh, sorry, I missed the TidRangeScan. My apologies for the noise. Best regards, -- Ronan Dunklau

Re: Collation version tracking for macOS

2022-12-01 Thread Dagfinn Ilmari Mannsåker
Jeff Davis writes: > On Mon, 2022-11-28 at 19:36 -0800, Jeff Davis wrote: >> On Mon, 2022-11-28 at 21:57 -0500, Robert Haas wrote: >> > That is ... astonishingly bad. >> >> https://unicode-org.atlassian.net/browse/CLDR-16175 > > Oops, reported in CLDR instead of ICU. Moved to: > > https://unicod

Re: Asynchronous execution support for Custom Scan

2022-12-01 Thread Kazutaka Onishi
Thank you for your comment. I've removed the tabs. > I can think of at least a few use cases where this customscan is helpful and > not merely testing code. IIUC, we already can use ctid in the where clause on the latest PostgreSQL, can't we? 2022年11月22日(火) 18:07 Ronan Dunklau : > > Le mardi 6

Re: Support logical replication of DDLs

2022-12-01 Thread li jie
I applied patch 0005. I think this modification is a bit overdone. This design skips all subcommands, which results in many ddl replication failures. For example: ``` CREATE TABLE datatype_table (id SERIAL); ``` deparsed ddl is: CREATE TABLE public.datatype_table (id pg_catalog.int4 STORAGE plai

Optimizing Node Files Support

2022-12-01 Thread Ranier Vilela
Hi, I believe that has room for improving generation node files. The patch attached reduced the size of generated files by 27 kbytes. >From 891 kbytes to 864 kbytes. About the patch: 1. Avoid useless attribution when from->field is NULL, once that the new node is palloc0. 2. Avoid useless decla

Re: generic plans and "initial" pruning

2022-12-01 Thread Amit Langote
On Thu, Dec 1, 2022 at 8:21 PM Alvaro Herrera wrote: > On 2022-Dec-01, Amit Langote wrote: > > Hmm, how about keeping the [Merge]Append's parent relation's RT index > > in the PartitionPruneInfo and passing it down to > > ExecInitPartitionPruning() from ExecInit[Merge]Append() for > > cross-checki

Re: Perform streaming logical transactions by background workers and parallel apply

2022-12-01 Thread Amit Kapila
On Wed, Nov 30, 2022 at 4:23 PM Amit Kapila wrote: > > 2. > + /* > + * The stream lock is released when processing changes in a > + * streaming block, so the leader needs to acquire the lock here > + * before entering PARTIAL_SERIALIZE mode to ensure that the > + * parallel apply worker will wait

Re: Bug in row_number() optimization

2022-12-01 Thread Sergey Shinderuk
On 01.12.2022 11:18, Richard Guo wrote: On Mon, Nov 28, 2022 at 5:59 PM Sergey Shinderuk mailto:s.shinde...@postgrespro.ru>> wrote: Not quite sure that we don't need to do anything for the WINDOWAGG_PASSTHROUGH_STRICT case. Although, we won't return any more tuples for the current

Re: generic plans and "initial" pruning

2022-12-01 Thread Alvaro Herrera
On 2022-Dec-01, Amit Langote wrote: > Hmm, how about keeping the [Merge]Append's parent relation's RT index > in the PartitionPruneInfo and passing it down to > ExecInitPartitionPruning() from ExecInit[Merge]Append() for > cross-checking? Both Append and MergeAppend already have a > 'apprelids' f

Re: pgsql: Revoke PUBLIC CREATE from public schema, now owned by pg_databas

2022-12-01 Thread Alvaro Herrera
On 2022-Dec-01, Noah Misch wrote: > This is free from the problem found in ddl-create-public-reorg-really.patch. > However, the word "other" doesn't belong there. (The per-user schemas should > not have public CREATE privilege.) I would also move that same sentence up > front, like this: > >

Re: ExecRTCheckPerms() and many prunable partitions

2022-12-01 Thread Alvaro Herrera
Hello, This didn't apply, so I rebased it on current master, excluding the one I already pushed. No further changes. -- Álvaro HerreraBreisgau, Deutschland — https://www.EnterpriseDB.com/ "No me acuerdo, pero no es cierto. No es cierto, y si fuera cierto, no me acuerdo."

RE: Perform streaming logical transactions by background workers and parallel apply

2022-12-01 Thread houzj.f...@fujitsu.com
On Thursday, December 1, 2022 3:58 PM Masahiko Sawada wrote: > > On Wed, Nov 30, 2022 at 10:51 PM houzj.f...@fujitsu.com > wrote: > > > > On Wednesday, November 30, 2022 9:41 PM houzj.f...@fujitsu.com > wrote: > > > > > > On Tuesday, November 29, 2022 8:34 PM Amit Kapila > > > > Review comment

initdb: Refactor PG_CMD_PUTS loops

2022-12-01 Thread Peter Eisentraut
Keeping the SQL commands that initdb runs in string arrays before feeding them to PG_CMD_PUTS() seems unnecessarily verbose and inflexible. In some cases, the array only has one member. In other cases, one might want to use PG_CMD_PRINTF() instead, to parametrize a command, but that would requir

Re: Improve performance of pg_strtointNN functions

2022-12-01 Thread Dean Rasheed
On Thu, 1 Dec 2022 at 05:38, David Rowley wrote: > > On Thu, 1 Dec 2022 at 18:27, John Naylor wrote: > > I don't see why the non-decimal literal patch needs to be "immediately" > > faster? If doing this first leads to less code churn, that's another > > consideration, but you haven't made that

Re: pg_upgrade allows itself to be run twice

2022-12-01 Thread Peter Eisentraut
On 01.11.22 14:07, Justin Pryzby wrote: On Tue, Nov 01, 2022 at 01:54:35PM +0100, Peter Eisentraut wrote: On 07.07.22 08:22, Justin Pryzby wrote: This one comes from NextOID in the control data file after a fresh initdb, and GetNewObjectId() would enforce that in a postmaster environment to be

Re: [DOCS] Stats views and functions not in order?

2022-12-01 Thread Peter Eisentraut
On 29.11.22 08:29, Peter Smith wrote: PSA v8* patches. Here, patches 0001 and 0002 are unchanged, but 0003 has many changes per David's suggestion [1] to change all these views to blocks. I don't understand what order 0001 is trying to achieve. I know we didn't necessarily want to go fully

Re: Allow round() function to accept float and double precision

2022-12-01 Thread Dean Rasheed
On Thu, 1 Dec 2022 at 02:58, David Rowley wrote: > > On Thu, 1 Dec 2022 at 15:41, David G. Johnston > wrote: > > I don't get the point of adding a function here (or at least one called > > round) - the type itself is inexact so, as you say, it is actually more of > > a type conversion with an a

Re: File API cleanup

2022-12-01 Thread Bharath Rupireddy
On Thu, Dec 1, 2022 at 1:55 PM Peter Eisentraut wrote: > > Here are a couple of patches that clean up the internal File API and > related things a bit: > > 0001-Update-types-in-File-API.patch > > Make the argument types of the File API match stdio better: > > - Change the data buffer to

  1   2   >