Re: Eliminating SPI from RI triggers - take 2

2022-09-29 Thread Amit Langote
On Thu, Sep 29, 2022 at 1:46 PM Amit Langote wrote: > Sorry about the delay. > > So I came up with such a patch that is attached as 0003. > > The main problem I want to fix with it is the need for RI_FKey_check() > to "force"-push the latest snapshot that the PartitionDesc code wants > to use to c

Re: [patch] Adding an assertion to report too long hash table name

2022-09-29 Thread Junwang Zhao
LGTM +1 On Thu, Sep 29, 2022 at 9:38 AM Xiaoran Wang wrote: > > Hi, > > The max size for the shmem hash table name is SHMEM_INDEX_KEYSIZE - 1. > but when the caller uses a longer hash table name, it doesn't report any > error, instead > it just uses the first SHMEM_INDEX_KEYSIZE -1 chars as the

Re: Obsolete comment in ExecInsert()

2022-09-29 Thread Etsuro Fujita
Hi, On Wed, Sep 28, 2022 at 11:42 PM Tom Lane wrote: > Etsuro Fujita writes: > > I think the “or a tuple has come for a different relation than that > > for the accumulated tuples" part in the comment is a leftover from an > > earlier version of the patch [1]. As the code shows, we do not handl

Re: pg_rewind WAL segments deletion pitfall

2022-09-29 Thread Polina Bungina
I agree with your suggestions, so here is the updated version of patch. Hope I haven't missed anything. Regards, Polina Bungina v3-0001-pg_rewind-wal-deletion.patch Description: Binary data

Re: Refactor UnpinBuffer()

2022-09-29 Thread Aleksander Alekseev
Nathan, Zhang, Thanks for the review! > Is it safe to move the call to ResourceOwnerForgetBuffer() to before the > call to GetPrivateRefCountEntry()? From my quick skim of the code, it > seems like it should be safe, but I thought I'd ask the question. > > Same question, have a look, it doesn’t s

Re: Avoid memory leaks during base backups

2022-09-29 Thread Bharath Rupireddy
On Wed, Sep 28, 2022 at 8:46 PM Robert Haas wrote: > > I feel like we ought to be trying to tie > the cleanup into WalSndErrorCleanup() or WalSndResourceCleanup() based > on having the memory context that we ought to be blowing away stored > in a global variable, rather than using a try/catch bloc

Re: Refactor UnpinBuffer()

2022-09-29 Thread Bharath Rupireddy
On Thu, Sep 29, 2022 at 1:52 PM Aleksander Alekseev wrote: > > > Is it safe to move the call to ResourceOwnerForgetBuffer() to before the > > call to GetPrivateRefCountEntry()? From my quick skim of the code, it > > seems like it should be safe, but I thought I'd ask the question. > > > > Same que

do away with ALTER TABLE "Recurse" subcmd types

2022-09-29 Thread Alvaro Herrera
I already mentioned this in [1]: we can remove a few subcmd types that were added to support exec-time recursion, by keeping a separate flag for it. We're already doing that for alter trigger operations, so this patch just extends that to the other subcommand types that need it. There's no visibl

Re: Eliminating SPI from RI triggers - take 2

2022-09-29 Thread Amit Langote
On Thu, Sep 29, 2022 at 4:43 PM Amit Langote wrote: > On Thu, Sep 29, 2022 at 1:46 PM Amit Langote wrote: > > Sorry about the delay. > > > > So I came up with such a patch that is attached as 0003. > > > > The main problem I want to fix with it is the need for RI_FKey_check() > > to "force"-push

Re: Eliminating SPI from RI triggers - take 2

2022-09-29 Thread Amit Langote
On Thu, Sep 29, 2022 at 6:09 PM Amit Langote wrote: > On Thu, Sep 29, 2022 at 4:43 PM Amit Langote wrote: > > On Thu, Sep 29, 2022 at 1:46 PM Amit Langote > > wrote: > > > Sorry about the delay. > > > > > > So I came up with such a patch that is attached as 0003. > > > > > > The main problem I

Re: [PATCH] Introduce array_shuffle() and array_sample()

2022-09-29 Thread Martin Kalcher
Am 28.09.22 um 16:18 schrieb Tom Lane: It is seeded at process start, yes. If you don't feel a need for user control over the sequence used by these functions, then using pg_global_prng_state is fine. (Basically the point to be made here is that we need to keep a tight rein on what can be affec

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

2022-09-29 Thread kuroda.hay...@fujitsu.com
Dear Hou, Thanks for updating patch. I will review yours soon, but I reply to your comment. > > 04. applyparallelworker.c - LogicalParallelApplyLoop() > > > > ``` > > + shmq_res = shm_mq_receive(mqh, &len, &data, false); > > ... > > + if (ConfigReloadPending) > > +

[patch] \g with multiple result sets and \watch with copy queries

2022-09-29 Thread Daniel Verite
Hi, The psql improvement in v15 to output multiple result sets does not behave as one might expect with \g: the output file or program to pipe into is opened/closed on each result set, overwriting the previous ones in the case of \g file. Example: psql -At

Re: Refactor UnpinBuffer()

2022-09-29 Thread Aleksander Alekseev
Hi Bharath, > Also, it looks like changing the order of GetPrivateRefCountEntry() > and ResourceOwnerForgetBuffer() doesn't have any effect as they are > independent, but do we want to actually do that if there's no specific > reason? If we keep the order as it is now the code will become: ```

Re: Generalize ereport_startup_progress infrastructure

2022-09-29 Thread Bharath Rupireddy
On Wed, Aug 17, 2022 at 8:44 PM Robert Haas wrote: > > Well, I don't agree that either of the proposed new uses of this > infrastructure are the right way to solve the problems in question, so > worrying about how to name the GUCs when we have a bunch of uses of > this infrastructure seems to me t

Re: POC PATCH: copy from ... exceptions to: (was Re: VLDB Features)

2022-09-29 Thread Damir Belyalov
> > Do you mean you stop dealing with errors concerned with constraints and > triggers and we should review 0006-COPY_IGNORE_ERRORS? > Yes, this patch is simpler and I think it's worth adding it first. > Hmm, I applied v6 patch and when canceled COPY by sending SIGINT(ctrl + > C), I faced the sam

Re: Avoid memory leaks during base backups

2022-09-29 Thread Robert Haas
On Thu, Sep 29, 2022 at 4:29 AM Bharath Rupireddy wrote: > Please review the attached v3 patch. template1=# select * from pg_backup_start('sdgkljsdgkjdsg', true); pg_backup_start - 0/228 (1 row) template1=# select 1/0; ERROR: division by zero template1=# select * from pg_b

Re: A potential memory leak on Merge Join when Sort node is not below Materialize node

2022-09-29 Thread Ronan Dunklau
> I've just pushed the disable byref Datums patch I posted earlier. I > only made a small adjustment to make use of the TupleDescAttr() macro. > Önder, thank you for the report. Thank you David for taking care of this. > Yeah, I think the same rules around scope apply as > tuplesort_gettupleslot(

Re: A potential memory leak on Merge Join when Sort node is not below Materialize node

2022-09-29 Thread Tom Lane
Ronan Dunklau writes: >> Yeah, I think the same rules around scope apply as >> tuplesort_gettupleslot() with copy==false. We could do it by adding a >> copy flag to the existing function, but I'd rather not add the >> branching to that function. It's probably just better to duplicate it >> and ad

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

2022-09-29 Thread Bharath Rupireddy
On Tue, Sep 27, 2022 at 8:31 AM Kyotaro Horiguchi wrote: > > If all error-emitting site knows the LSN, we don't need the context > message. But *I* would like that the additional message looks like > "while reading record at LSN %X/%X" or slightly shorter version of > it. Because the targetRecPtr

Re: A potential memory leak on Merge Join when Sort node is not below Materialize node

2022-09-29 Thread Ronan Dunklau
Le jeudi 29 septembre 2022, 16:10:03 CEST Tom Lane a écrit : > Ronan Dunklau writes: > >> Yeah, I think the same rules around scope apply as > >> tuplesort_gettupleslot() with copy==false. We could do it by adding a > >> copy flag to the existing function, but I'd rather not add the > >> branchin

Re: disfavoring unparameterized nested loops

2022-09-29 Thread Benjamin Coutu
I'd like to revamp this important discussion. As is well described in this fairly recent paper here https://www.vldb.org/pvldb/vol9/p204-leis.pdf (which also looks at Postgres) "estimation errors quickly grow as the number of joins increases, and that these errors are usually the reason for bad

Re: kerberos/001_auth test fails on arm CPU darwin

2022-09-29 Thread Stephen Frost
Greetings, * Peter Eisentraut (peter.eisentr...@enterprisedb.com) wrote: > On 27.09.22 03:37, Andres Freund wrote: > > Maybe we should rely on PATH, rather than hardcoding OS dependent locations? > > Or at least fall back to seach binaries in PATH? Seems pretty odd to > > hardcode > > all these l

Re: identifying the backend that owns a temporary schema

2022-09-29 Thread Tom Lane
Nathan Bossart writes: > On Wed, Sep 28, 2022 at 06:56:20PM -0400, Tom Lane wrote: >> A point that still bothers me a bit about pg_stat_get_backend_idset is >> that it could miss or duplicate some backend IDs if the user calls >> pg_stat_clear_snapshot() partway through the SRF's run, and we reloa

Re: kerberos/001_auth test fails on arm CPU darwin

2022-09-29 Thread Tom Lane
Stephen Frost writes: > * Peter Eisentraut (peter.eisentr...@enterprisedb.com) wrote: >> Homebrew intentionally does not install the krb5 and openldap packages into >> the path, because they conflict with macOS-provided software. However, those >> macOS-provided variants don't provide all the piec

Re: making relfilenodes 56 bits

2022-09-29 Thread Maxim Orlov
Hi! I'm not in the context of this thread, but I've notice something strange by attempting to rebase my patch set from 64XID thread. As far as I'm aware, this patch set is adding "relfilenumber". So, in pg_control_checkpoint, we have next changes: diff --git a/src/backend/utils/misc/pg_controldat

Re: making relfilenodes 56 bits

2022-09-29 Thread Robert Haas
On Thu, Sep 29, 2022 at 10:50 AM Maxim Orlov wrote: > In other words, we have 19 attributes. But tupdesc here is constructed for 18 > elements: > tupdesc = CreateTemplateTupleDesc(18); > > Is that normal or not? Again, I'm not in this thread and if that is > completely ok, I'm sorry about the no

Re: A potential memory leak on Merge Join when Sort node is not below Materialize node

2022-09-29 Thread Peter Geoghegan
On Thu, Sep 29, 2022 at 7:10 AM Tom Lane wrote: > TBH, I think this is completely ridiculous over-optimization. > There's exactly zero evidence that a second copy of the function > would improve performance, or do anything but contribute to code > bloat (which does have a distributed performance c

Re: Adding CommandID to heap xlog records

2022-09-29 Thread Matthias van de Meent
On Wed, 28 Sept 2022 at 19:40, Bruce Momjian wrote: > > On Thu, Sep 22, 2022 at 11:12:32PM +0200, Matthias van de Meent wrote: > > On Thu, 8 Sept 2022 at 23:24, Tom Lane wrote: > > > > > > Matthias van de Meent writes: > > > > Please find attached a patch that adds the CommandId of the inserting

Should setting TupleTableSlotOps get_heap_tuple=NULL break INSERT..ON CONFLICT DO UPDATE..RETURNING?

2022-09-29 Thread Mark Dilger
Hackers, Per the documentation in TupleTableSlotOps, an AM can choose not to supply a get_heap_tuple function, and instead set this field to NULL. Doing so appears to almost work, but breaks the xmin and xmax returned by a INSERT..ON CONFLICT DO UPDATE..RETURNING. In particular, the call chai

Re: Should setting TupleTableSlotOps get_heap_tuple=NULL break INSERT..ON CONFLICT DO UPDATE..RETURNING?

2022-09-29 Thread Andres Freund
Hi, On 2022-09-29 09:04:42 -0700, Mark Dilger wrote: > Per the documentation in TupleTableSlotOps, an AM can choose not to supply a > get_heap_tuple function, and instead set this field to NULL. Doing so > appears to almost work, but breaks the xmin and xmax returned by a > INSERT..ON CONFLICT DO

Re: identifying the backend that owns a temporary schema

2022-09-29 Thread Nathan Bossart
On Thu, Sep 29, 2022 at 10:47:06AM -0400, Tom Lane wrote: > OK. Will push shortly. Thanks! -- Nathan Bossart Amazon Web Services: https://aws.amazon.com

Re: problems with making relfilenodes 56-bits

2022-09-29 Thread Matthias van de Meent
On Thu, 29 Sep 2022, 00:06 Robert Haas, wrote: > > 2. WAL Size. Block references in the WAL are by RelFileLocator, so if > you make RelFileLocators bigger, WAL gets bigger. We'd have to test > the exact impact of this, but it seems a bit scary: if you have a WAL > stream with few FPIs doing DML on

Re: Should setting TupleTableSlotOps get_heap_tuple=NULL break INSERT..ON CONFLICT DO UPDATE..RETURNING?

2022-09-29 Thread Mark Dilger
> On Sep 29, 2022, at 9:22 AM, Andres Freund wrote: > > I would assume that this can be avoided by the tuple slot implementation, but > without seeing what precisely you did in your pile slot... "pile" is just a copy of "heap" placed into an extension with a slightly smarter version of s/hea

Re: Avoid memory leaks during base backups

2022-09-29 Thread Bharath Rupireddy
On Thu, Sep 29, 2022 at 7:05 PM Robert Haas wrote: > > On Thu, Sep 29, 2022 at 4:29 AM Bharath Rupireddy > wrote: > > Please review the attached v3 patch. > > template1=# select * from pg_backup_start('sdgkljsdgkjdsg', true); > pg_backup_start > - > 0/228 > (1 row) > > templ

Re: [PATCH] Use indexes on the subscriber when REPLICA IDENTITY is full on the publisher

2022-09-29 Thread Önder Kalacı
Hi Hayato Kuroda, Thanks for the review! > > 01 relation.c - general > > Many files are newly included. > I was not sure but some codes related with planner may be able to move to > src/backend/optimizer/plan. > How do you and any other one think? > > My thinking on those functions is that

Re: A potential memory leak on Merge Join when Sort node is not below Materialize node

2022-09-29 Thread Önder Kalacı
Hi David, Tom, all, > I've just pushed the disable byref Datums patch I posted earlier. I > only made a small adjustment to make use of the TupleDescAttr() macro. > Önder, thank you for the report. > > With this commit, I re-run the query patterns where we observed the problem, all looks good now

Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes?

2022-09-29 Thread Nathan Bossart
On Thu, Sep 29, 2022 at 11:32:32AM +0530, Bharath Rupireddy wrote: > On Sat, Sep 24, 2022 at 1:54 AM Nathan Bossart > wrote: >> >> +PGAlignedXLogBlock zbuffer; >> + >> +memset(zbuffer.data, 0, XLOG_BLCKSZ); >> >> This seems excessive for only writing a single byte. > > Yes, I rem

Re: more descriptive message for process termination due to max_slot_wal_keep_size

2022-09-29 Thread Tom Lane
Kyotaro Horiguchi writes: > At Wed, 28 Sep 2022 16:30:37 -0400, Tom Lane wrote in >> I think you should leave the primary message alone and add a DETAIL, >> as the first version of the patch did. > So I'm going to change the mssage as: > LOG: terminating process %d to release replication slot

Re: Refactor UnpinBuffer()

2022-09-29 Thread Nathan Bossart
I've marked this one as ready-for-committer. -- Nathan Bossart Amazon Web Services: https://aws.amazon.com

Re: Question: test "aggregates" failed in 32-bit machine

2022-09-29 Thread Tom Lane
"kuroda.hay...@fujitsu.com" writes: > While running `make check LANC=C` with 32-bit virtual machine, > I found that it was failed at "aggregates". Hmm, we're not seeing any such failures in the buildfarm's 32-bit animals, so there must be some additional condition needed to make it happen. Can y

Re: making relfilenodes 56 bits

2022-09-29 Thread Tom Lane
Robert Haas writes: > On Thu, Sep 29, 2022 at 10:50 AM Maxim Orlov wrote: >> In other words, we have 19 attributes. But tupdesc here is constructed for >> 18 elements: >> tupdesc = CreateTemplateTupleDesc(18); > I think that's a mistake. Thanks for the report. The assertions in TupleDescInitEn

Re: [PATCH] Introduce array_shuffle() and array_sample()

2022-09-29 Thread Tom Lane
Martin Kalcher writes: > New patch: array_shuffle() and array_sample() use pg_global_prng_state now. I took a closer look at the patch today. I find this behavior a bit surprising: +SELECT array_dims(array_sample('[-1:2][2:3]={{1,2},{3,NULL},{5,6},{7,8}}'::int[], 3)); + array_dims +-

Re: problems with making relfilenodes 56-bits

2022-09-29 Thread Robert Haas
On Thu, Sep 29, 2022 at 12:24 PM Matthias van de Meent wrote: > Currently, our minimal WAL record is exactly 24 bytes: length (4B), > TransactionId (4B), previous record pointer (8B), flags (1B), redo > manager (1B), 2 bytes of padding and lastly the 4-byte CRC. Of these > fields, TransactionID co

Re: An attempt to avoid locally-committed-but-not-replicated-to-standby-transactions in synchronous replication

2022-09-29 Thread Bruce Momjian
On Tue, Sep 27, 2022 at 06:52:21PM +0530, Bharath Rupireddy wrote: > On Tue, Aug 9, 2022 at 2:16 PM Bharath Rupireddy > wrote: > > > > I've explained the problem with the current HA setup with synchronous > > replication upthread at [1]. Let me reiterate it here once again. > > > > When a query is

Re: disfavoring unparameterized nested loops

2022-09-29 Thread Peter Geoghegan
On Thu, Sep 29, 2022 at 7:32 AM Benjamin Coutu wrote: > Also, we can expand the multiplier whenever we fall back to using the default > cardinality constant as surely all bets are off at that point - we should > definitely treat nested loop joins as out of favor in this instance and that > coul

Re: disfavoring unparameterized nested loops

2022-09-29 Thread Bruce Momjian
On Thu, Sep 29, 2022 at 04:12:06PM -0700, Peter Geoghegan wrote: > Offhand I'd say it's more likely to be too complicated. Without > meaning to sound glib, the first question that occurs to me is "will > we also need a conviction multiplier conviction multiplier?". Anything > like that is going to

Re: disfavoring unparameterized nested loops

2022-09-29 Thread Peter Geoghegan
On Thu, Sep 29, 2022 at 4:27 PM Bruce Momjian wrote: > I think the point the original poster as making, and I have made in the > past, is that even of two optimizer costs are the same, one might be > more penalized by misestimation than the other, and we don't have a good > way of figuring that in

Re: disfavoring unparameterized nested loops

2022-09-29 Thread Tom Lane
Bruce Momjian writes: > I think the point the original poster as making, and I have made in the > past, is that even of two optimizer costs are the same, one might be > more penalized by misestimation than the other, and we don't have a good > way of figuring that into our plan choices. Agreed, b

Re: disfavoring unparameterized nested loops

2022-09-29 Thread Bruce Momjian
On Thu, Sep 29, 2022 at 07:46:18PM -0400, Tom Lane wrote: > Bruce Momjian writes: > > I think the point the original poster as making, and I have made in the > > past, is that even of two optimizer costs are the same, one might be > > more penalized by misestimation than the other, and we don't ha

Re: [PATCH] Add peer authentication TAP test

2022-09-29 Thread Michael Paquier
On Wed, Sep 28, 2022 at 04:24:44PM +0900, Michael Paquier wrote: > Hmm, indeed. It would be more reliable to rely on the contents > returned by getpeereid()/getpwuid() after one successful peer > connection, then use it in the map. I was wondering whether using > stuff like getpwuid() in the perl

Re: disfavoring unparameterized nested loops

2022-09-29 Thread Peter Geoghegan
On Thu, Sep 29, 2022 at 4:46 PM Tom Lane wrote: > Agreed, but dealing with uncertainty in those numbers is an enormous > task if you want to do it right. "Doing it right", IMV, would start > out by extending all the selectivity estimation functions to include > error bars; then we could have erro

Small miscellaneous fixes

2022-09-29 Thread Ranier Vilela
Hi. There are assorted fixes to the head branch. 1. Avoid useless reassigning var _logsegno (src/backend/access/transam/xlog.c) Commit 7d70809 left a little oversight. XLByteToPrevSeg and XLByteToSeg are macros

Re: making relfilenodes 56 bits

2022-09-29 Thread Michael Paquier
On Thu, Sep 29, 2022 at 02:39:44PM -0400, Tom Lane wrote: > The assertions in TupleDescInitEntry would have caught that, > if only utils/misc/pg_controldata.c had more than zero test coverage. > Seems like somebody ought to do something about that. While passing by, I have noticed this thread. We

Re: longfin and tamandua aren't too happy but I'm not sure why

2022-09-29 Thread Andres Freund
Hi, On 2022-09-28 16:07:13 -0400, Tom Lane wrote: > I agree that it'd be good if CI did some 32-bit testing so it could have > caught (5) and (6), but that's being worked on. I wasn't aware of anybody doing so, thus here's a patch for that. I already added the necessary packages to the image. I

Re: longfin and tamandua aren't too happy but I'm not sure why

2022-09-29 Thread Andres Freund
Hi, On 2022-09-29 17:31:35 -0700, Andres Freund wrote: > I already added the necessary packages to the image. I didn't install llvm for > 32bit because that'd have a) bloated the image unduly b) they can't currently > be installed in parallel afaics. > Attached is the patch adding it to CI. To av

Re: pgbench: using prepared BEGIN statement in a pipeline could cause an error

2022-09-29 Thread Yugo NAGATA
Hi, On Mon, 12 Sep 2022 17:03:43 +0200 Alvaro Herrera wrote: > On 2022-Mar-28, Yugo NAGATA wrote: > > > On Fri, 25 Mar 2022 16:19:54 -0400 > > Tom Lane wrote: > > > > I am not convinced this is a great idea. The current behavior is that > > > a statement is not prepared until it's about to b

Re: SI-read predicate locks on materialized views

2022-09-29 Thread Yugo NAGATA
On Fri, 9 Sep 2022 16:27:45 +0530 Dilip Kumar wrote: > On Tue, Jul 26, 2022 at 3:31 PM Richard Guo wrote: > > > > > > On Tue, Jul 26, 2022 at 3:44 PM Yugo NAGATA wrote: > >> > >> If such two transactions run concurrently, a write skew anomaly occurs, > >> and the result of order_summary refresh

Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes?

2022-09-29 Thread Thomas Munro
On Fri, Sep 30, 2022 at 6:27 AM Nathan Bossart wrote: > On Thu, Sep 29, 2022 at 11:32:32AM +0530, Bharath Rupireddy wrote: > > On Sat, Sep 24, 2022 at 1:54 AM Nathan Bossart > > wrote: > >> > >> +PGAlignedXLogBlock zbuffer; > >> + > >> +memset(zbuffer.data, 0, XLOG_BLCKSZ); > >>

Re: longfin and tamandua aren't too happy but I'm not sure why

2022-09-29 Thread Peter Geoghegan
On Thu, Sep 29, 2022 at 5:40 PM Andres Freund wrote: > Onder if we should vary some build options like ICU or the system collation? > Tom, wasn't there something recently that made you complain about not having > coverage around collations due to system settings? That was related to TRUST_STRXFRM

Re: ubsan

2022-09-29 Thread Andres Freund
Hi, On 2022-03-23 13:54:50 -0400, Tom Lane wrote: > 0002: ugh, but my only real complaint is that __ubsan_default_options > needs more than zero comment. Also, it's not "our" getenv is it? > > 0004: no opinion Attached is a rebased version of this patch. Hopefully with a reasonable amount of co

Re: BUG #17434: CREATE/DROP DATABASE can be executed in the same transaction with other commands

2022-09-29 Thread Yugo NAGATA
Hi, On Tue, 9 Aug 2022 00:21:02 +0900 Yugo NAGATA wrote: > On Wed, 27 Jul 2022 22:50:55 -0400 > Tom Lane wrote: > > > Yugo NAGATA writes: > > > I've looked at the commited fix. What I wonder is whether a change in > > > IsInTransactionBlock() is necessary or not. > > > > I've not examined AN

Re: longfin and tamandua aren't too happy but I'm not sure why

2022-09-29 Thread Andres Freund
Hi, On 2022-09-29 18:16:51 -0700, Peter Geoghegan wrote: > On Thu, Sep 29, 2022 at 5:40 PM Andres Freund wrote: > > Onder if we should vary some build options like ICU or the system collation? > > Tom, wasn't there something recently that made you complain about not having > > coverage around col

Re: making relfilenodes 56 bits

2022-09-29 Thread Tom Lane
Michael Paquier writes: > While passing by, I have noticed this thread. We don't really care > about the contents returned by these functions, and one simple trick > to check their execution is SELECT FROM. Like in the attached, for > example. Hmmm ... I'd tend to do SELECT COUNT(*) FROM. But

Re: longfin and tamandua aren't too happy but I'm not sure why

2022-09-29 Thread Tom Lane
Andres Freund writes: > Tom, wasn't there something recently that made you complain about not having > coverage around collations due to system settings? We found there was a gap for ICU plus LANG=C, IIRC. regards, tom lane

Re: longfin and tamandua aren't too happy but I'm not sure why

2022-09-29 Thread Andres Freund
Hi, On 2022-09-29 21:24:44 -0400, Tom Lane wrote: > Andres Freund writes: > > Tom, wasn't there something recently that made you complain about not having > > coverage around collations due to system settings? > > We found there was a gap for ICU plus LANG=C, IIRC. Using that then. Any opinio

Re: Introduce wait_for_subscription_sync for TAP tests

2022-09-29 Thread Thomas Munro
On Mon, Sep 12, 2022 at 10:42 PM Thomas Munro wrote: > On Sat, Sep 10, 2022 at 10:00 AM Thomas Munro wrote: > > On Sat, Sep 10, 2022 at 9:45 AM Tom Lane wrote: > > > Masahiko Sawada writes: > > > > It's likely that the commit f6c5edb8abcac04eb3eac6da356e59d399b2bcef > > > > is relevant. > > > >

Re: longfin and tamandua aren't too happy but I'm not sure why

2022-09-29 Thread Tom Lane
Andres Freund writes: > Any opinions about whether to do this only in head or backpatch to 15? HEAD should be sufficient, IMO. regards, tom lane

Re: disfavoring unparameterized nested loops

2022-09-29 Thread Bruce Momjian
On Thu, Sep 29, 2022 at 07:51:47PM -0400, Bruce Momjian wrote: > On Thu, Sep 29, 2022 at 07:46:18PM -0400, Tom Lane wrote: > > Agreed, but dealing with uncertainty in those numbers is an enormous > > task if you want to do it right. "Doing it right", IMV, would start > > out by extending all the s

Re: more descriptive message for process termination due to max_slot_wal_keep_size

2022-09-29 Thread Kyotaro Horiguchi
At Thu, 29 Sep 2022 13:31:00 -0400, Tom Lane wrote in > Kyotaro Horiguchi writes: > > At Wed, 28 Sep 2022 16:30:37 -0400, Tom Lane wrote in > > LOG: invalidating *replication* slot \"%s\" > > DETAILS: (ditto) > > HINTS: (ditto) > > I thought the latter was a little *too* short; the primary

Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes?

2022-09-29 Thread Bharath Rupireddy
On Fri, Sep 30, 2022 at 6:46 AM Thomas Munro wrote: > > +1 for just doing it always, with a one-liner comment like > "pg_pwritev*() might move the file position". No reason to spam the > source tree with more explanations of the exact reason. +1 for resetting the file position in a platform-inde

RE: Question: test "aggregates" failed in 32-bit machine

2022-09-29 Thread kuroda.hay...@fujitsu.com
Dear Tom, > Hmm, we're not seeing any such failures in the buildfarm's 32-bit > animals, so there must be some additional condition needed to make > it happen. Can you be more specific? Hmm, I was not sure about additional conditions, sorry. I could reproduce with followings steps: $ git clone

Re: more descriptive message for process termination due to max_slot_wal_keep_size

2022-09-29 Thread Tom Lane
Kyotaro Horiguchi writes: > By the way, I didn't notice at that time (and forgot about the > policy), but the HINT message has variations differing only by the > variable name. > What do you think about the attached? Hmm, maybe, but a quick grep for 'You might need to increase' finds about a doz

Re: SQL/JSON features for v15

2022-09-29 Thread Andrew Dunstan
On 2022-09-01 Th 09:54, Nikita Glukhov wrote: > > On 31.08.2022 23:39, Nikita Glukhov wrote: > >> And here is a quick POC patch with an example for COPY and float4 > I decided to go further and use new API in SQL/JSON functions > (even if it does not make real sense now). > > I have added functi

Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes?

2022-09-29 Thread Nathan Bossart
On Fri, Sep 30, 2022 at 08:09:04AM +0530, Bharath Rupireddy wrote: > I'm attaching the v6 patch set, please review it further. Looks reasonable to me. -- Nathan Bossart Amazon Web Services: https://aws.amazon.com

Re: SQL/JSON features for v15

2022-09-29 Thread Tom Lane
Andrew Dunstan writes: > I suggest just submitting the Input function stuff on its own, I think > that means not patches 3,4,15 at this stage. Maybe we would also need a > small test module to call the functions, or at least some of them. > The earlier we can get this in the earlier SQL/JSON patch

Re: Assign TupleTableSlot->tts_tableOid duplicated in tale AM.

2022-09-29 Thread Wenchao Zhang
Firstly, thank you for your reply. Yeah, I think maybe just assigning tts_tableOid of TTS only once during scanning the same table may be better. That really needs to be thinked over. Regards, Wenchao Peter Geoghegan 于2022年9月28日周三 10:47写道: > On Tue, Sep 20, 2022 at 11:51 PM Wenchao Zhang > wro

Re: Suppressing useless wakeups in walreceiver

2022-09-29 Thread Nathan Bossart
I was surprised to see that this patch was never committed! On Mon, Jan 31, 2022 at 04:28:11PM +0900, Kyotaro Horiguchi wrote: > +static void > +WalRcvComputeNextWakeup(WalRcvInfo *state, > + WalRcvWakeupReason reason, > +

Re: disfavoring unparameterized nested loops

2022-09-29 Thread David Rowley
On Fri, 30 Sept 2022 at 13:06, Peter Geoghegan wrote: > I like the idea of just avoiding unparameterized nested loop joins > altogether when an "equivalent" hash join plan is available because > it's akin to an execution-time mitigation, despite the fact that it > happens during planning. While it

Re: Suppressing useless wakeups in walreceiver

2022-09-29 Thread Thomas Munro
On Fri, Sep 30, 2022 at 4:51 PM Nathan Bossart wrote: > Thomas, are you planning to continue with this patch? If not, I don't mind > picking it up. Hi Nathan, Please go ahead! One thing I had in my notes to check with this patch is whether there might be a bug due to computing all times in mic

interrupted tap tests leave postgres instances around

2022-09-29 Thread Andres Freund
Hi, When tap tests are interrupted (e.g. with ctrl-c), we don't cancel running postgres instances etc. That doesn't strike me as a good thing. In contrast, the postgres instances started by pg_regress do terminate. I assume this is because pg_regress starts postgres directly, whereas tap tests la

Re: longfin and tamandua aren't too happy but I'm not sure why

2022-09-29 Thread Andres Freund
Hi, On 2022-09-29 22:16:10 -0400, Tom Lane wrote: > Andres Freund writes: > > Any opinions about whether to do this only in head or backpatch to 15? > > HEAD should be sufficient, IMO. Pushed. I think we should add some more divergent options to increase the coverage. E.g. a different xlog page

Re: meson vs mingw, plpython, readline and other fun

2022-09-29 Thread Andres Freund
Hi, On 2022-09-28 12:33:17 -0700, Andres Freund wrote: > 0001 - meson: windows: Normalize slashes in prefix > 0002 - meson: pg_regress: Define a HOST_TUPLE sufficient to make resultmap > work > 0003 - meson: mingw: Allow multiple definitions > 0004 - meson: Implement getopt logic from autoconf >

Re: more descriptive message for process termination due to max_slot_wal_keep_size

2022-09-29 Thread Kyotaro Horiguchi
At Thu, 29 Sep 2022 22:49:00 -0400, Tom Lane wrote in > Kyotaro Horiguchi writes: > > By the way, I didn't notice at that time (and forgot about the > > policy), but the HINT message has variations differing only by the > > variable name. > > > What do you think about the attached? > > Hmm, ma

Re: [RFC] building postgres with meson - v13

2022-09-29 Thread John Naylor
On Tue, Sep 27, 2022 at 2:41 PM John Naylor wrote: > > On Tue, Sep 27, 2022 at 2:06 AM Andres Freund wrote: > > > > On 2022-09-26 15:18:29 +0700, John Naylor wrote: > > Yea, it's /usr/local on x86-64, based on what was required to make macos CI > > work. I updated the wiki page, half-blindly - i

Getting rid of SQLValueFunction

2022-09-29 Thread Michael Paquier
Hi all, I have bumped a few days ago on the fact that COERCE_SQL_SYNTAX (introduced by 40c24bf) and SQLValueFunction are around to do the exact same thing, as known as enforcing single-function calls with dedicated SQL keywords. For example, keywords like SESSION_USER, CURRENT_DATE, etc. go throu

Re: disfavoring unparameterized nested loops

2022-09-29 Thread Benjamin Coutu
> Right. But that seems fraught with difficulty. I suspect that the > costs that the planner attributes to each plan often aren't very > reliable in any absolute sense, even when everything is working very > well by every available metric. Even a very noisy cost model with > somewhat inaccurate sel

Re: interrupted tap tests leave postgres instances around

2022-09-29 Thread Michael Paquier
On Thu, Sep 29, 2022 at 09:07:34PM -0700, Andres Freund wrote: > ISTM we should at least install a SIGINT/TERM handler in Cluster.pm that does > the stuff we already do in END. Hmm, indeed. And here I thought that END was actually taking care of that on an interrupt.. -- Michael signature.asc D

Re: disfavoring unparameterized nested loops

2022-09-29 Thread Benjamin Coutu
> In general I suspect that we'd be better off focussing on mitigating > the impact at execution time. There are at least a few things that we > could do there, at least in theory. Mostly very ambitious, long term > things. I think these things are orthogonal. No matter how good the cost model e

Re: Refactor UnpinBuffer()

2022-09-29 Thread Michael Paquier
On Thu, Sep 29, 2022 at 10:35:20AM -0700, Nathan Bossart wrote: > I've marked this one as ready-for-committer. UnpinBuffer() is local to bufmgr.c, so it would not be an issue for external code, and that's 10 callers that don't need to worry about that anymore. 2d115e4 is from 2015, and nobody has