Re: Assert name/short_desc to prevent SHOW ALL segfault

2022-05-27 Thread Tom Lane
Michael Paquier writes: > And I've learnt today that we enforce a definition of __has_attribute > at the top of c.h, and that we already rely on that. So I agree that > what you are doing in 0002 should be enough. Should we wait until 16~ > opens for business though? I don't see a strong

Re: Assert name/short_desc to prevent SHOW ALL segfault

2022-05-27 Thread Michael Paquier
On Fri, May 27, 2022 at 10:43:17AM -0700, Nathan Bossart wrote: > Makes sense. Here's a new patch set. 0001 is the part intended for > back-patching, and 0002 is the rest (i.e., adding pg_attribute_nonnull()). > I switched to using __has_attribute to discover whether nonnull was Okay, I have

Re: SLRUs in the main buffer pool, redux

2022-05-27 Thread Thomas Munro
On Fri, May 27, 2022 at 11:24 PM Thomas Munro wrote: > Rebased, debugged and fleshed out a tiny bit more, but still with > plenty of TODO notes and questions. I will talk about this idea at > PGCon, so I figured it'd help to have a patch that actually applies, > even if it doesn't work quite

Re: Improving connection scalability (src/backend/storage/ipc/procarray.c)

2022-05-27 Thread Ranier Vilela
Em sex., 27 de mai. de 2022 às 18:22, Andres Freund escreveu: > Hi, > > On 2022-05-27 10:35:08 -0300, Ranier Vilela wrote: > > Em qui., 26 de mai. de 2022 às 22:30, Tomas Vondra < > > tomas.von...@enterprisedb.com> escreveu: > > > > > On 5/27/22 02:11, Ranier Vilela wrote: > > > > > > > > ... >

Re: Improving connection scalability (src/backend/storage/ipc/procarray.c)

2022-05-27 Thread Ranier Vilela
Em sex., 27 de mai. de 2022 às 18:08, Andres Freund escreveu: > Hi, > > On 2022-05-27 03:30:46 +0200, Tomas Vondra wrote: > > On 5/27/22 02:11, Ranier Vilela wrote: > > > ./pgbench -M prepared -c $conns -j $conns -T 60 -S -n -U postgres > > > > > > pgbench (15beta1) > > > transaction type: > >

RE: [PATCH] Support % wildcard in extension upgrade filenames

2022-05-27 Thread Regina Obe
> At PostGIS we've been thinking of ways to have better support, from > PostgreSQL proper, to our upgrade strategy, which has always consisted in a > SINGLE upgrade file good for upgrading from any older version. > > The current lack of such support for EXTENSIONs forced us to install a lot of >

Re: Improving connection scalability (src/backend/storage/ipc/procarray.c)

2022-05-27 Thread Andres Freund
Hi, On 2022-05-27 10:35:08 -0300, Ranier Vilela wrote: > Em qui., 26 de mai. de 2022 às 22:30, Tomas Vondra < > tomas.von...@enterprisedb.com> escreveu: > > > On 5/27/22 02:11, Ranier Vilela wrote: > > > > > > ... > > > > > > Here the results with -T 60: > > > > Might be a good idea to share your

Ignore heap rewrites for materialized views in logical replication

2022-05-27 Thread Euler Taveira
Hi, While investigating an internal report, I concluded that it is a bug. The reproducible test case is simple (check 0002) and it consists of a FOR ALL TABLES publication and a non-empty materialized view on publisher. After the setup, if you refresh the MV, you got the following message on the

Re: Improving connection scalability (src/backend/storage/ipc/procarray.c)

2022-05-27 Thread Andres Freund
Hi, On 2022-05-27 03:30:46 +0200, Tomas Vondra wrote: > On 5/27/22 02:11, Ranier Vilela wrote: > > ./pgbench -M prepared -c $conns -j $conns -T 60 -S -n -U postgres > > > > pgbench (15beta1) > > transaction type: > > scaling factor: 1 > > query mode: prepared > > number of clients: 100 > >

Re: Bump MIN_WINNT to 0x0600 (Vista) as minimal runtime in 16~

2022-05-27 Thread Thomas Munro
On Fri, May 27, 2022 at 3:53 PM Michael Paquier wrote: > Windows 8 ends its support > in 2023, it seems, so that sounds short even for PG16. I guess you meant 8.1 here, and corresponding server release 2012 R2. These will come to the end of their "extended" support phase in 2023, before PG16

Re: "ERROR: latch already owned" on gharial

2022-05-27 Thread Tom Lane
Robert Haas writes: > On Fri, May 27, 2022 at 10:21 AM Tom Lane wrote: >> What I'd suggest is to promote that failure to elog(PANIC), which >> would at least give us the PID and if we're lucky a stack trace. > That proposed change is fine with me. > As to the question of whether it's a real

Re: generic plans and "initial" pruning

2022-05-27 Thread Zhihong Yu
On Fri, May 27, 2022 at 1:10 AM Amit Langote wrote: > On Mon, Apr 11, 2022 at 12:53 PM Zhihong Yu wrote: > > On Sun, Apr 10, 2022 at 8:05 PM Amit Langote > wrote: > >> Sending v15 that fixes that to keep the cfbot green for now. > > > > Hi, > > > > + /* RT index of the partitione

Re: "ERROR: latch already owned" on gharial

2022-05-27 Thread Robert Haas
On Fri, May 27, 2022 at 10:21 AM Tom Lane wrote: > That's possible, certainly. It's also possible that it's a real bug > that so far has only manifested there for (say) timing reasons. > The buildfarm is not so large that we can write off single-machine > failures as being unlikely to hit in the

Re: suboverflowed subtransactions concurrency performance optimize

2022-05-27 Thread Peter Geoghegan
On Fri, May 27, 2022 at 11:59 AM Andres Freund wrote: > On 2022-05-27 11:48:45 -0700, Peter Geoghegan wrote: > > I find it hard to believe that there wasn't even a cursory effort at > > performance validation before this was committed, but that's what it > > looks like. > > Yea. Imo this pretty

Re: Allowing REINDEX to have an optional name

2022-05-27 Thread Cary Huang
The following review has been posted through the commitfest application: make installcheck-world: tested, passed Implements feature: tested, passed Spec compliant: tested, passed Documentation:tested, passed Hello The patch applies and tests fine and I think this

Re: suboverflowed subtransactions concurrency performance optimize

2022-05-27 Thread Andres Freund
On 2022-05-27 11:48:45 -0700, Peter Geoghegan wrote: > On Fri, May 27, 2022 at 8:55 AM Andres Freund wrote: > > > Anyway, how about if we clear this cache for subtrans whenever > > > TransactionXmin is advanced and cachedFetchSubXid precedes it? The > > > comments atop

Re: suboverflowed subtransactions concurrency performance optimize

2022-05-27 Thread Peter Geoghegan
On Fri, May 27, 2022 at 8:55 AM Andres Freund wrote: > > Anyway, how about if we clear this cache for subtrans whenever > > TransactionXmin is advanced and cachedFetchSubXid precedes it? The > > comments atop SubTransGetTopmostTransaction seem to state that we > > don't care about the exact

Re: Assert name/short_desc to prevent SHOW ALL segfault

2022-05-27 Thread Nathan Bossart
On Thu, May 26, 2022 at 11:01:44PM -0400, Tom Lane wrote: > Michael Paquier writes: >> FWIW, I would be fine to backpatch the NULL handling for short_desc, >> while treating the addition of nonnull as a HEAD-only change. > > Yeah, sounds about right to me. My guess is that we will need > a

Re: postgres and initdb not working inside docker

2022-05-27 Thread Roffild
Only in an ideal world are all standards observed... Docker has different standards inside. $ ls -l /home/neo/ drwxr-xr-x2 pgsql pgsql 8192 May 27 10:37 data drwxr-sr-x2 pgsql pgsql 4096 May 24 09:35 data2 /home/pgsql/data - mounted volume. Therefore, the

Re: Support logical replication of DDLs

2022-05-27 Thread Masahiko Sawada
On Fri, May 27, 2022 at 7:19 AM Zheng Li wrote: > > Hi Masahiko, > > > Thank you for updating the patches! > > > > I've not looked at these patches in-depth yet but with this approach, > > what do you think we can handle the DDL syntax differences between > > major versions? DDL syntax or

Re: selectivity function

2022-05-27 Thread Greg Hennessy
On Thu, May 26, 2022 at 3:10 PM Tom Lane wrote: Can you do anything useful with attaching selectivity estimates to the functions it references, instead? I may have been doing down a bad path before. The function I'm working to improve has five argument, the last being "degrees", which is the

Re: suboverflowed subtransactions concurrency performance optimize

2022-05-27 Thread Andres Freund
Hi, On 2022-05-27 15:44:39 +0530, Amit Kapila wrote: > On Thu, May 26, 2022 at 12:53 PM Michael Paquier wrote: > > > > On Tue, May 24, 2022 at 04:52:50PM -0700, Andres Freund wrote: > > > > > 2) xid wraparound. There's nothing forcing > > > SubTransGetTopmostTransaction() to > > >be called

Re: PG15 beta1 sort performance regression due to Generation context change

2022-05-27 Thread Tom Lane
Yura Sokolov writes: > В Вт, 24/05/2022 в 17:39 -0700, Andres Freund пишет: >> A variation on your patch would be to only store the offset to the block >> header - that should always fit into 32bit (huge allocations being their own >> block, which is why this wouldn't work for storing an offset

Re: "ERROR: latch already owned" on gharial

2022-05-27 Thread Tom Lane
Robert Haas writes: > On Fri, May 27, 2022 at 7:55 AM Thomas Munro wrote: >> Thanks. Hmm. So far it's always a parallel worker. The best idea I >> have is to include the ID of the mystery PID in the error message and >> see if that provides a clue next time. > ... Even if we find a bug in

Re: "ERROR: latch already owned" on gharial

2022-05-27 Thread Robert Haas
On Fri, May 27, 2022 at 7:55 AM Thomas Munro wrote: > Thanks. Hmm. So far it's always a parallel worker. The best idea I > have is to include the ID of the mystery PID in the error message and > see if that provides a clue next time. What I'm inclined to do is get gharial and anole removed

Re: Improving connection scalability (src/backend/storage/ipc/procarray.c)

2022-05-27 Thread Ranier Vilela
Em qui., 26 de mai. de 2022 às 22:30, Tomas Vondra < tomas.von...@enterprisedb.com> escreveu: > On 5/27/22 02:11, Ranier Vilela wrote: > > > > ... > > > > Here the results with -T 60: > > Might be a good idea to share your analysis / interpretation of the > results, not just the raw data. After

Re: PG15 beta1 sort performance regression due to Generation context change

2022-05-27 Thread Yura Sokolov
В Вт, 24/05/2022 в 17:39 -0700, Andres Freund пишет: > > A variation on your patch would be to only store the offset to the block > header - that should always fit into 32bit (huge allocations being their own > block, which is why this wouldn't work for storing an offset to the > context). With a

Re: pg_upgrade test writes to source directory

2022-05-27 Thread Peter Eisentraut
On 26.05.22 22:52, Justin Pryzby wrote: On Fri, May 27, 2022 at 05:43:04AM +0900, Michael Paquier wrote: On Thu, May 26, 2022 at 04:36:47PM +0200, Peter Eisentraut wrote: I chose TESTOUTDIR because it corresponds to the tmp_check directory, so that the output files of the pg_upgrade run are

Re: enable/disable broken for statement triggers on partitioned tables

2022-05-27 Thread Amit Langote
On Fri, May 27, 2022 at 5:11 PM Peter Eisentraut wrote: > On 24.05.22 23:23, Zhihong Yu wrote: > > Hi, > > > > AT_EnableTrig, /* ENABLE TRIGGER name */ > > + AT_EnableTrigRecurse, /* internal to commands/tablecmds.c */ > > AT_EnableAlwaysTrig,/* ENABLE

Re: doc: CREATE FOREIGN TABLE .. PARTITION OF .. DEFAULT

2022-05-27 Thread Amit Langote
On Fri, May 27, 2022 at 7:15 PM Etsuro Fujita wrote: > On Fri, May 27, 2022 at 1:58 AM Robert Haas wrote: > > Committed, except I adjusted the v11 version so that the CREATE > > FOREIGN TABLE documentation would match the CREATE TABLE documentation > > in that branch. > > I think we should fix

Re: allow building trusted languages without the untrusted versions

2022-05-27 Thread Peter Eisentraut
On 24.05.22 22:58, Nathan Bossart wrote: FWIW this was my original thinking. I can choose to build/install extensions separately, but when it comes to PL/Tcl and PL/Perl, you've got to build the trusted and untrusted stuff at the same time, and the untrusted symbols remain even if you remove

Re: Prevent writes on large objects in read-only transactions

2022-05-27 Thread Laurenz Albe
On Fri, 2022-05-27 at 15:30 +0900, Yugo NAGATA wrote: > Currently, lo_creat(e), lo_import, lo_unlink, lowrite, lo_put, > and lo_from_bytea are allowed even in read-only transactions. > By using them, pg_largeobject and pg_largeobject_metatable can > be modified in read-only transactions and the

Re: "ERROR: latch already owned" on gharial

2022-05-27 Thread Thomas Munro
On Thu, May 26, 2022 at 2:35 PM Tom Lane wrote: > Thomas Munro writes: > > On a more practical note, I don't have access to the BF database right > > now. Would you mind checking if "latch already owned" has occurred on > > any other animals? > > Looking back 6 months, these are the only

Re: doc: CREATE FOREIGN TABLE .. PARTITION OF .. DEFAULT

2022-05-27 Thread Etsuro Fujita
On Fri, May 27, 2022 at 1:58 AM Robert Haas wrote: > Committed, except I adjusted the v11 version so that the CREATE > FOREIGN TABLE documentation would match the CREATE TABLE documentation > in that branch. I think we should fix the syntax synopsis in the Parameters section of the CREATE

Re: suboverflowed subtransactions concurrency performance optimize

2022-05-27 Thread Amit Kapila
On Thu, May 26, 2022 at 12:53 PM Michael Paquier wrote: > > On Tue, May 24, 2022 at 04:52:50PM -0700, Andres Freund wrote: > > > 2) xid wraparound. There's nothing forcing SubTransGetTopmostTransaction() > > to > >be called regularly, so even if a backend isn't idle, the cache could > >

Re: Handle infinite recursion in logical replication setup

2022-05-27 Thread Peter Smith
On Fri, May 27, 2022 at 5:04 PM shiy.f...@fujitsu.com wrote: > > On Wed, May 25, 2022 7:55 PM vignesh C wrote: > > > > The attached v16 patch has the changes for the same. > > > > Thanks for updating the patch. > > Some comments for the document in 0002 patch. > > 1. > + > +Lock the

Remove useless tests about TRUNCATE on foreign table

2022-05-27 Thread Yugo NAGATA
Hello, I found that tests for TRUNCATE on foreign tables are left in the foreign_data regression test. Now TRUNCATE on foreign tables are allowed, so I think the tests should be removed. Currently, the results of the test is "ERROR: foreign-data wrapper "dummy" has no handler", but it is just

Re: enable/disable broken for statement triggers on partitioned tables

2022-05-27 Thread Peter Eisentraut
On 24.05.22 23:23, Zhihong Yu wrote: Hi,     AT_EnableTrig,              /* ENABLE TRIGGER name */ +   AT_EnableTrigRecurse,       /* internal to commands/tablecmds.c */     AT_EnableAlwaysTrig,        /* ENABLE ALWAYS TRIGGER name */ +   AT_EnableAlwaysTrigRecurse, /* internal to

RE: bogus: logical replication rows/cols combinations

2022-05-27 Thread houzj.f...@fujitsu.com
On Friday, May 27, 2022 1:54 PM Justin Pryzby wrote: > > On Fri, May 27, 2022 at 11:17:00AM +0530, Amit Kapila wrote: > > On Tue, May 24, 2022 at 11:03 AM houzj.f...@fujitsu.com > wrote: > > > > > > On Friday, May 20, 2022 11:06 AM Amit Kapila > wrote: > > > > > > Thanks for pointing it out.

RE: Handle infinite recursion in logical replication setup

2022-05-27 Thread shiy.f...@fujitsu.com
On Wed, May 25, 2022 7:55 PM vignesh C wrote: > > The attached v16 patch has the changes for the same. > Thanks for updating the patch. Some comments for the document in 0002 patch. 1. + +Lock the required tables in node1 and +node2 till the setup is completed. + + + +

Re: [BUG] Panic due to incorrect missingContrecPtr after promotion

2022-05-27 Thread Kyotaro Horiguchi
At Fri, 27 May 2022 02:01:27 +, "Imseih (AWS), Sami" wrote in > After further research, we found the following. > > Testing on 13.6 with the attached patch we see > that the missingContrecPtr is being incorrectly > set on the standby and the promote in the tap > test fails. > > Per the

Prevent writes on large objects in read-only transactions

2022-05-27 Thread Yugo NAGATA
Hello, Currently, lo_creat(e), lo_import, lo_unlink, lowrite, lo_put, and lo_from_bytea are allowed even in read-only transactions. By using them, pg_largeobject and pg_largeobject_metatable can be modified in read-only transactions and the effect remains after the transaction finished. Is it

Re: doc phrase: "inheritance child"

2022-05-27 Thread Amit Langote
On Wed, May 25, 2022 at 1:30 PM Ashutosh Bapat wrote: > > - If true, the stats include inheritance child columns, not just the > + If true, the stats include child tables, not just the > > We are replacing columns with tables; is that intentional? > > Partitioned tables do not