Re: [Doc] Glossary Term Definitions Edits

2023-10-13 Thread Erik Wienhold
On 2023-10-14 06:16 +0200, Andrew Atkinson write: >- When describing options for a command, changed to “option of” instead >of “option to” I think "option to" is not wrong (maybe less common). I've seen this in other texts and took it as "the X option [that applies] to Y". >-

Re: [Doc] Glossary Term Definitions Edits

2023-10-13 Thread David Rowley
On Sat, 14 Oct 2023, 5:20 pm Andrew Atkinson, wrote: > >- Many examples of “an SQL”. I changed those to “a SQL...”. For >example I changed “An SQL command which” to “A SQL command that”. I'm not >an English major so maybe I'm missing something here. > > It would depend on how you

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

2023-10-13 Thread Hayato Kuroda (Fujitsu)
Dear hackers, Here is a new patch. Previously I wrote: > Based on above idea, I made new version patch which some functionalities were > exported from pg_resetwal. In this approach, pg_upgrade itself removed WALs > and > then create logical slots, then pg_resetwal would be called with new

[Doc] Glossary Term Definitions Edits

2023-10-13 Thread Andrew Atkinson
Hello. I started reading through the Glossary[^1] terms to learn from the definitions, and to double check them against what I'd written elsewhere. I found myself making edits. :) I've put the edits together into a patch. My goal was to focus on wording simplifications that are smoother to read,

Re: SLRU optimization - configurable buffer pool and partitioning the SLRU lock

2023-10-13 Thread Amit Kapila
On Wed, Oct 11, 2023 at 4:35 PM Dilip Kumar wrote: > > The small size of the SLRU buffer pools can sometimes become a > performance problem because it’s not difficult to have a workload > where the number of buffers actively in use is larger than the > fixed-size buffer pool. However, just

Re: JSON Path and GIN Questions

2023-10-13 Thread Erik Wienhold
On 2023-10-09 01:13 +0200, David E. Wheeler write: > On Sep 12, 2023, at 21:00, Erik Wienhold wrote: > > >> I posted this question on Stack Overflow > >> (https://stackoverflow.com/q/77046554/79202), > >> and from the suggestion I got there, it seems that @@ expects a boolean to > >> be > >>

Re: Included xid in restoring reorder buffer changes from disk log message

2023-10-13 Thread vignesh C
On Tue, 10 Oct 2023 at 06:59, Kyotaro Horiguchi wrote: > > At Fri, 6 Oct 2023 14:58:13 +0530, vignesh C wrote in > > On Fri, 30 Apr 2021 at 11:53, Dilip Kumar wrote: > > > It makes sense to include xid in the debug message, earlier I thought > > > that will it be a good idea to also print the

Re: Performance degradation on concurrent COPY into a single relation in PG16.

2023-10-13 Thread Andres Freund
Hi, On 2023-10-13 11:30:35 -0700, Andres Freund wrote: > On 2023-10-13 10:39:10 -0700, Andres Freund wrote: > > On 2023-10-12 09:24:19 -0700, Andres Freund wrote: > > > I kind of had hoped somebody would comment on the approach. Given that > > > nobody > > > has, I'll push the minimal fix of

Re: PostgreSQL domains and NOT NULL constraint

2023-10-13 Thread Vik Fearing
On 10/13/23 06:37, Tom Lane wrote: Vik Fearing writes: Regardless of what the spec may or may not say about v1.d, it still remains that nulls should not be allowed in a *base table* if the domain says nulls are not allowed. Not mentioned in this thread but the constraints are also applied

Re: Fix output of zero privileges in psql

2023-10-13 Thread Erik Wienhold
On 2023-10-09 22:34 +0200, David G. Johnston write: > On Mon, Oct 9, 2023 at 12:13 PM Tom Lane wrote: > > Yeah. There is a lot of attraction in having \pset null affect these > > displays just like all other ones. The fact that they act differently > > now is a wart, not something we should

Re: Fix output of zero privileges in psql

2023-10-13 Thread Erik Wienhold
On 2023-10-09 10:29 +0200, Laurenz Albe write: > On Sun, 2023-10-08 at 19:58 -0700, David G. Johnston wrote: > > We probably should add the two terms to the glossary: > > > > empty privileges: all privileges explicitly revoked from the owner and > > PUBLIC > > (where applicable), and none

Re: Fix output of zero privileges in psql

2023-10-13 Thread Erik Wienhold
On 2023-10-09 09:54 +0200, Laurenz Albe write: > > I tinkered a bit with your documentation. For example, the suggestion to > "\pset null" seemed to be in an inappropriate place. Tell me what you think. +1 You're right to put that sentence right after the explanation of empty privileges. --

Re: On login trigger: take three

2023-10-13 Thread Alexander Korotkov
On Fri, Oct 13, 2023 at 11:26 AM Alexander Korotkov wrote: > On Fri, Oct 13, 2023 at 4:18 AM Robert Haas wrote: > > On Thu, Oct 12, 2023 at 6:54 PM Alexander Korotkov > > wrote: > > > On Thu, Oct 12, 2023 at 8:35 PM Robert Haas wrote: > > > > > > Doesn't that mean that if you create the first

Re: LLVM 16 (opaque pointers)

2023-10-13 Thread Thomas Munro
On Sat, Oct 14, 2023 at 3:56 AM Andres Freund wrote: > On 2023-10-13 16:44:13 +0200, Dmitry Dolgov wrote: > > Here is what I had in mind (only this part in the second patch was changed). > > Makes sense to me. I think we'll likely eventually want to use a custom > pipeline anyway, and I think we

Re: LLVM 16 (opaque pointers)

2023-10-13 Thread Thomas Munro
On Wed, Oct 11, 2023 at 10:31 PM Ronan Dunklau wrote: > Le mercredi 11 octobre 2023, 10:59:50 CEST Thomas Munro a écrit : > > The back-patch to 12 was a little trickier than anticipated, but after > > taking a break and trying again I now have PG 12...17 patches that > > I've tested against LLVM

Re: should frontend tools use syncfs() ?

2023-10-13 Thread Nathan Bossart
On Mon, Oct 09, 2023 at 02:34:27PM -0500, Nathan Bossart wrote: > On Mon, Oct 09, 2023 at 11:14:39AM -0500, Nathan Bossart wrote: >> Thanks. I've made a couple of small changes, but otherwise I think this >> one is just about ready. > > I forgot to rename one thing. Here's a v13 with that

Re: Questions about the new subscription parameter: password_required

2023-10-13 Thread Jeff Davis
On Fri, 2023-10-13 at 11:18 +0200, Benoit Lobréau wrote: > I tried adding a section in "Logical Replication > Subscription" with > the text you suggested and links in the CREATE / ALTER SUBSRIPTION > commands. > > Is it better ? Minor comments: * Use possessive "its" instead of the

Re: Performance degradation on concurrent COPY into a single relation in PG16.

2023-10-13 Thread Andres Freund
Hi, On 2023-10-13 10:39:10 -0700, Andres Freund wrote: > On 2023-10-12 09:24:19 -0700, Andres Freund wrote: > > I kind of had hoped somebody would comment on the approach. Given that > > nobody > > has, I'll push the minimal fix of resetting the state in > > ReleaseBulkInsertStatePin(), even

Re: Performance degradation on concurrent COPY into a single relation in PG16.

2023-10-13 Thread Andres Freund
Hi, On 2023-10-12 09:24:19 -0700, Andres Freund wrote: > On 2023-10-12 11:44:09 -0400, Tom Lane wrote: > > Andres Freund writes: > > >> On 2023-09-25 15:42:26 -0400, Tom Lane wrote: > > >>> I just did a git bisect run to discover when the failure documented > > >>> in bug #18130 [1] started.

Re: pg_stat_statements and "IN" conditions

2023-10-13 Thread Nathan Bossart
On Tue, Jul 04, 2023 at 09:02:56PM +0200, Dmitry Dolgov wrote: >> On Mon, Jul 03, 2023 at 09:46:11PM -0700, Nathan Bossart wrote: >> Also, it seems counterintuitive that queries with fewer than 10 >> constants are not merged. > > Why? What would be your intuition using this feature? For the

Re: BRIN minmax multi - incorrect distance for infinite timestamp/date

2023-10-13 Thread Dean Rasheed
On Fri, 13 Oct 2023 at 13:17, Tomas Vondra wrote: > > I do plan to backpatch this, yes. I don't think there are many people > affected by this (few people are using infinite dates/timestamps, but > maybe the overflow could be more common). > OK, though I doubt that such values are common in

Re: LLVM 16 (opaque pointers)

2023-10-13 Thread Andres Freund
On 2023-10-13 16:44:13 +0200, Dmitry Dolgov wrote: > Here is what I had in mind (only this part in the second patch was changed). Makes sense to me. I think we'll likely eventually want to use a custom pipeline anyway, and I think we should consider using an optimization level inbetween "not at

Re: LLVM 16 (opaque pointers)

2023-10-13 Thread Andres Freund
Hi, On 2023-10-13 11:06:21 +0200, Dmitry Dolgov wrote: > > On Thu, Oct 12, 2023 at 04:31:20PM -0700, Andres Freund wrote: > > I also don't think we should add the mem2reg pass outside of -O0 - running > > it > > after a real optimization pipeline doesn't seem useful and might even make > > the

Re: LLVM 16 (opaque pointers)

2023-10-13 Thread Dmitry Dolgov
> On Fri, Oct 13, 2023 at 11:06:21AM +0200, Dmitry Dolgov wrote: > > On Thu, Oct 12, 2023 at 04:31:20PM -0700, Andres Freund wrote: > > I don't think the "function(no-op-function),no-op-module" bit does something > > particularly useful? > > Right, looks like leftovers after verifying which passes

Re: odd buildfarm failure - "pg_ctl: control file appears to be corrupt"

2023-10-13 Thread David Steele
On 10/12/23 19:15, Michael Paquier wrote: On Thu, Oct 12, 2023 at 10:41:39AM -0400, David Steele wrote: After some more thought, I think we could massage the "pg_control in backup_label" method into something that could be back patched, with more advanced features (e.g. error on backup_label

Re: pg_stat_statements and "IN" conditions

2023-10-13 Thread Dmitry Dolgov
> On Fri, Oct 13, 2023 at 05:07:00PM +0900, Michael Paquier wrote: > Now, it doesn't mean that this approach with the "powers" will never > happen, but based on the set of opinions I am gathering on this thread > I would suggest to rework the patch as follows: > - First implement an on/off switch

Re: PostgreSQL domains and NOT NULL constraint

2023-10-13 Thread Erki Eessaar
Hello Equaling a domain with a type is really confusing because why, for instance, in this case the following is possible without defining any additional operators. CREATE DOMAIN d_name VARCHAR(50) NOT NULL; CREATE DOMAIN d_description VARCHAR(1000) NOT NULL; CREATE TABLE x(name d_name,

Re: [RFC] Add jit deform_counter

2023-10-13 Thread Daniel Gustafsson
> On 12 Oct 2023, at 15:40, Daniel Gustafsson wrote: >> On 12 Oct 2023, at 15:37, Nazir Bilal Yavuz wrote: >> I realized that pg_stat_statements is bumped to 1.11 with this patch >> but oldextversions test is not updated. So, I attached a patch for >> updating oldextversions. > > Thanks for

Re: BRIN minmax multi - incorrect distance for infinite timestamp/date

2023-10-13 Thread Tomas Vondra
On 10/13/23 14:04, Dean Rasheed wrote: > On Fri, 13 Oct 2023 at 11:44, Tomas Vondra > wrote: >> >> On 10/13/23 11:21, Dean Rasheed wrote: >>> >>> Is this only inefficient? Or can it also lead to wrong query results? >> >> I don't think it can produce incorrect results. It only affects which >>

Re: BRIN minmax multi - incorrect distance for infinite timestamp/date

2023-10-13 Thread Dean Rasheed
On Fri, 13 Oct 2023 at 11:44, Tomas Vondra wrote: > > On 10/13/23 11:21, Dean Rasheed wrote: > > > > Is this only inefficient? Or can it also lead to wrong query results? > > I don't think it can produce incorrect results. It only affects which > values we "merge" into an interval when building

RE: pg_upgrade's interaction with pg_resetwal seems confusing

2023-10-13 Thread Hayato Kuroda (Fujitsu)
Dear hackers, > > > > > > I mean instead of resetwal directly modifying the control file we > > > > will modify that value in the server using the binary_upgrade function > > > > and then have that value flush to the disk by shutdown checkpoint. > > > > > > > > > > True, the alternative to

Re: BRIN minmax multi - incorrect distance for infinite timestamp/date

2023-10-13 Thread Tomas Vondra
On 10/13/23 11:21, Dean Rasheed wrote: > On Thu, 12 Oct 2023 at 23:43, Tomas Vondra > wrote: >> >> Ashutosh Bapat reported me off-list a possible issue in how BRIN >> minmax-multi calculate distance for infinite timestamp/date values. >> >> The current code does this: >> >> if

Re: pg_upgrade's interaction with pg_resetwal seems confusing

2023-10-13 Thread Amit Kapila
On Fri, Oct 13, 2023 at 2:03 PM Dilip Kumar wrote: > > On Fri, Oct 13, 2023 at 11:07 AM Amit Kapila wrote: > > > > > But is this a problem? basically, we will set the > > > ShmemVariableCache->nextOid counter to the value that we want in the > > > IsBinaryUpgrade-specific function. And then the

Re: Oversight in reparameterize_path_by_child leading to executor crash

2023-10-13 Thread Andrei Lepikhov
On 23/8/2023 12:37, Richard Guo wrote: To fix it we may need to modify RelOptInfos for Path, BitmapHeapPath, ForeignPath and CustomPath, and modify IndexOptInfos for IndexPath.  It seems that that is not easily done without postponing reparameterization of paths until createplan.c. Attached is

Re: pg_logical_emit_message() misses a XLogFlush()

2023-10-13 Thread Amit Kapila
On Mon, Sep 11, 2023 at 5:13 PM Michael Paquier wrote: > > I'll need a bit more input from Fujii-san before doing anything about > his comments, still it looks like a doc issue to me that may need a > backpatch to clarify how the non-transactional case behaves. > I would prefer to associate the

Re: Removing unneeded self joins

2023-10-13 Thread a.rybakina
On 13.10.2023 12:03, Andrei Lepikhov wrote: On 13/10/2023 15:56, a.rybakina wrote: Also I've incorporated improvements from Alena Rybakina except one for skipping SJ removal when no SJ quals is found.  It's not yet clear for me if this check fix some cases. But at least optimization got

Re: BRIN minmax multi - incorrect distance for infinite timestamp/date

2023-10-13 Thread Dean Rasheed
On Thu, 12 Oct 2023 at 23:43, Tomas Vondra wrote: > > Ashutosh Bapat reported me off-list a possible issue in how BRIN > minmax-multi calculate distance for infinite timestamp/date values. > > The current code does this: > > if (TIMESTAMP_NOT_FINITE(dt1) || TIMESTAMP_NOT_FINITE(dt2)) >

Re: Questions about the new subscription parameter: password_required

2023-10-13 Thread Benoit Lobréau
On 9/23/23 03:57, Jeff Davis wrote: IIUC there is really one use case here, which is for superuser to define a subscription including the connection, and then change the owner to a non-superuser to actually run it (without being able to touch the connection string itself). I'd just document that

Re: LLVM 16 (opaque pointers)

2023-10-13 Thread Dmitry Dolgov
> On Thu, Oct 12, 2023 at 04:31:20PM -0700, Andres Freund wrote: > Hi, > > On 2023-10-11 21:59:50 +1300, Thomas Munro wrote: > > +#else > > + LLVMPassBuilderOptionsRef options; > > + LLVMErrorRef err; > > + int compile_optlevel; > > + char *passes; > > + > > +

Re: Removing unneeded self joins

2023-10-13 Thread Andrei Lepikhov
On 13/10/2023 15:56, a.rybakina wrote: Also I've incorporated improvements from Alena Rybakina except one for skipping SJ removal when no SJ quals is found.  It's not yet clear for me if this check fix some cases. But at least optimization got skipped in some useful cases (as you can see in

Re: [PATCH] Clarify the behavior of the system when approaching XID wraparound

2023-10-13 Thread Aleksander Alekseev
Hi, > Those all make sense to me. > > > [...] > > Of course. Your general approach seems wise. > > Thanks for working on this. I will be relieved once this is finally > taken care of. +1, and many thanks for your attention to the patchset and all the details! -- Best regards, Aleksander

Re: Improve the log message output of basic_archive when basic_archive.archive_directory parameter is not set

2023-10-13 Thread Daniel Gustafsson
> On 13 Oct 2023, at 04:25, Nathan Bossart wrote: > > On Tue, Sep 26, 2023 at 08:13:45AM +0200, Daniel Gustafsson wrote: >>> On 26 Sep 2023, at 00:20, Nathan Bossart wrote: >>> >>> On Thu, Sep 21, 2023 at 11:18:00AM +0900, bt23nguyent wrote: -basic_archive_configured(ArchiveModuleState

Re: Removing unneeded self joins

2023-10-13 Thread a.rybakina
Also I've incorporated improvements from Alena Rybakina except one for skipping SJ removal when no SJ quals is found.  It's not yet clear for me if this check fix some cases. But at least optimization got skipped in some useful cases (as you can see in regression tests). Agree. I wouldn't say

Re: A new strategy for pull-up correlated ANY_SUBLINK

2023-10-13 Thread Alena Rybakina
On 13.10.2023 10:04, Andy Fan wrote: It seems to me that the expressions "=" and "IN" are equivalent here due to the fact that the aggregated subquery returns only one value, and the result with the "IN" operation can be considered as the intersection of elements on the left and

Re: pg_upgrade's interaction with pg_resetwal seems confusing

2023-10-13 Thread Dilip Kumar
On Fri, Oct 13, 2023 at 11:07 AM Amit Kapila wrote: > > > But is this a problem? basically, we will set the > > ShmemVariableCache->nextOid counter to the value that we want in the > > IsBinaryUpgrade-specific function. And then the shutdown checkpoint > > will flush that value to the control

Re: On login trigger: take three

2023-10-13 Thread Alexander Korotkov
On Fri, Oct 13, 2023 at 4:18 AM Robert Haas wrote: > On Thu, Oct 12, 2023 at 6:54 PM Alexander Korotkov > wrote: > > On Thu, Oct 12, 2023 at 8:35 PM Robert Haas wrote: > > > > Doesn't that mean that if you create the first login trigger in a > > > database and leave the transaction open,

Re: pg_stat_statements and "IN" conditions

2023-10-13 Thread Michael Paquier
On Tue, Jul 04, 2023 at 09:02:56PM +0200, Dmitry Dolgov wrote: > On Mon, Jul 03, 2023 at 09:46:11PM -0700, Nathan Bossart wrote: >> IMHO this adds way too much complexity to something that most users would >> expect to be an on/off switch. > > This documentation is exclusively to be precise about

Re: Tab completion for AT TIME ZONE

2023-10-13 Thread Michael Paquier
On Fri, Oct 13, 2023 at 08:01:08AM +0200, Vik Fearing wrote: > On 10/13/23 06:31, Michael Paquier wrote: >> but after also removing >> the completion for "ZONE" after typing "AT TIME" because AT would be >> completed by "TIME ZONE". > > Why? The user can tab at any point. IMO this leads to

Re: A new strategy for pull-up correlated ANY_SUBLINK

2023-10-13 Thread Andy Fan
Hi Tom, Would you like to have a look at this? The change is not big and the optimization has also been asked for many times. The attached is the v5 version and I also try my best to write a good commit message. Here is the commit fest entry: https://commitfest.postgresql.org/45/4268/

Re: New WAL record to detect the checkpoint redo location

2023-10-13 Thread Michael Paquier
On Tue, Oct 10, 2023 at 02:43:34PM -0400, Robert Haas wrote: > Here's a new patch set. I think I've incorporated the performance > fixes that you've suggested so far into this version. I also adjusted > a couple of other things: Now looking at 0002, where you should be careful about the code

Re: A new strategy for pull-up correlated ANY_SUBLINK

2023-10-13 Thread Andy Fan
> > It seems to me that the expressions "=" and "IN" are equivalent here due > to the fact that the aggregated subquery returns only one value, and the > result with the "IN" operation can be considered as the intersection of > elements on the left and right. In this query, we have some kind of

Re: [PATCH] Add support function for containment operators

2023-10-13 Thread jian he
On Tue, Aug 1, 2023 at 10:07 AM Laurenz Albe wrote: > > > > > > > I had an idea about this: > > > So far, you only consider constant ranges. But if we have a STABLE range > > > expression, you could use an index scan for "expr <@ range", for example > > > Index Cond (expr >= lower(range) AND

Re: Pro et contra of preserving pg_proc oids during pg_upgrade

2023-10-13 Thread Laurenz Albe
On Thu, 2023-10-12 at 19:56 +0300, Nikita Malakhov wrote: > Say, we have data processed by some user function and we want to keep > reference to this function > in our data. In this case we have two ways - first - store string output of > regprocedure, which is not > very convenient, and the

Re: Tab completion for AT TIME ZONE

2023-10-13 Thread Vik Fearing
On 10/13/23 06:31, Michael Paquier wrote: On Fri, Oct 13, 2023 at 03:07:25AM +0200, Vik Fearing wrote: The SQL committee already has another operator starting with AT which is AT LOCAL. The other patch was the reason why I looked at this one. Thank you for updating and committing this