Re: Todo: Teach planner to evaluate multiple windows in the optimal order

2023-02-15 Thread David Rowley
On Wed, 15 Feb 2023 at 17:23, John Naylor wrote: > HEAD: > > 4 ^ 8: latency average = 113.976 ms > 5 ^ 8: latency average = 783.830 ms > 6 ^ 8: latency average = 3990.351 ms > 7 ^ 8: latency average = 15793.629 ms > > Skip rechecking first key: > > 4 ^ 8: latency average = 107.028 ms > 5 ^ 8: late

Re: Todo: Teach planner to evaluate multiple windows in the optimal order

2023-02-15 Thread John Naylor
I wrote: > it might be worthwhile to "zoom in" with more measurements, but haven't done that yet. I've attached the script and image for 1 million / random / varying the mod by quarter-log intervals. Unfortunately I didn't get as good results as yesterday. Immediately going from mod 1 to mod 2, so

Fix the description of GUC "max_locks_per_transaction" and "max_pred_locks_per_transaction" in guc_table.c

2023-02-15 Thread wangw.f...@fujitsu.com
Hi, When I refer to the GUC "max_locks_per_transaction", I find that the description of the shared lock table size in pg-doc[1] is inconsistent with the code (guc_table.c). BTW, the GUC "max_predicate_locks_per_xact" has similar problems. I think the descriptions in pg-doc are correct. - GUC "max

Re: Reconcile stats in find_tabstat_entry() and get rid of PgStat_BackendFunctionEntry

2023-02-15 Thread Drouvot, Bertrand
Hi, On 2/15/23 1:56 AM, Kyotaro Horiguchi wrote: At Tue, 14 Feb 2023 15:43:26 +0100, "Drouvot, Bertrand" wrote in The comment assumed that the function directly returns an entry from shared memory, but now it copies the entry's contents into a palloc'ed memory and stores the sums of some coun

Re: Support logical replication of DDLs

2023-02-15 Thread Alvaro Herrera
On 2023-Feb-15, Peter Smith wrote: > On Thu, Feb 9, 2023 at 8:55 PM Ajin Cherian wrote: > > > > On Fri, Feb 3, 2023 at 11:41 AM Peter Smith wrote: > > > 3. ExecuteGrantStmt > > > > > > + /* Copy the grantor id needed for DDL deparsing of Grant */ > > > + istmt.grantor_uid = grantor; > > > > > >

Use of additional index columns in rows filtering

2023-02-15 Thread Maxim Ivanov
Hi All, I'd like to report what seems to be a missing optimization opportunity or understand why it is not possible to achieve. TLDR; additional index column B specified in CREATE INDEX .. (A) INCLUDE(B) is not used to filter rows in queries like WHERE B = $1 ORDER BY A during IndexScan. https

Re: [PATCH] Add pretty-printed XML output option

2023-02-15 Thread Peter Smith
On Wed, Feb 15, 2023 at 6:10 PM Jim Jones wrote: > > On 15.02.23 02:09, Peter Smith wrote: > > With v8, in my environment, in psql I see something slightly different: > > > > > > test_pub=# SET XML OPTION CONTENT; > > SET > > test_pub=# SELECT xmlformat(''); > > ERROR: invalid XML document > > DE

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

2023-02-15 Thread Amit Kapila
On Wed, Feb 15, 2023 at 8:55 AM houzj.f...@fujitsu.com wrote: > > On Wednesday, February 15, 2023 10:34 AM Amit Kapila > wrote: > > > > > > > > > > So names like the below seem correct format: > > > > > > > > a) WAIT_EVENT_LOGICAL_APPLY_SEND_DATA > > > > b) WAIT_EVENT_LOGICAL_LEADER_SEND_DATA >

Re: [PATCH] Add pretty-printed XML output option

2023-02-15 Thread Jim Jones
On 15.02.23 10:06, Peter Smith wrote: Bingo!! Your v9 patch now passes all 'make check' tests for me. Nice! It also passed all tests in the patch tester. But I'll leave it to a committer to decide if this VERBOSITY toggle is the best fix. I see now other test cases in the xml.sql file that al

Re: Support logical replication of DDLs

2023-02-15 Thread Amit Kapila
On Wed, Feb 15, 2023 at 2:02 PM Alvaro Herrera wrote: > > On 2023-Feb-15, Peter Smith wrote: > > > On Thu, Feb 9, 2023 at 8:55 PM Ajin Cherian wrote: > > > > > > On Fri, Feb 3, 2023 at 11:41 AM Peter Smith wrote: > > > > > 3. ExecuteGrantStmt > > > > > > > > + /* Copy the grantor id needed for D

Re: [EXTERNAL] Re: [PATCH] Support using "all" for the db user in pg_ident.conf

2023-02-15 Thread Pavel Luzanov
On 15.02.2023 10:11, Michael Paquier wrote: Which comes down to blame me for both of them. My only intention was to make postgres better.I'm sorry you took it that way. So, please find attached a patch to close the gap the sample files, for both things, with descriptions of all the field v

Re: [PATCH] Add pretty-printed XML output option

2023-02-15 Thread Alvaro Herrera
On 2023-Feb-13, Peter Smith wrote: > Something is misbehaving. > > Using the latest HEAD, and before applying the v6 patch, 'make check' > is working OK. > > But after applying the v6 patch, some XML regression tests are failing > because the DETAIL part of the message indicating the wrong synta

Re: [EXTERNAL] Re: [PATCH] Support using "all" for the db user in pg_ident.conf

2023-02-15 Thread Michael Paquier
On Wed, Feb 15, 2023 at 01:05:04PM +0300, Pavel Luzanov wrote: > On 15.02.2023 10:11, Michael Paquier wrote: >> Which comes down to blame me for both of them. > > My only intention was to make postgres better.I'm sorry you took it that > way. You have no need to feel sorry about that. I really a

Re: [PATCH] Add pretty-printed XML output option

2023-02-15 Thread Jim Jones
On 15.02.23 11:11, Alvaro Herrera wrote: Note that there's another file, xml_2.out, which does not contain the additional part of the DETAIL message. I suspect in Peter's case it's xml_2.out that was originally being used as a comparison basis (not xml.out), but that one is not getting patched,

Re: Can we do something to help stop users mistakenly using force_parallel_mode?

2023-02-15 Thread David Rowley
On Wed, 15 Feb 2023 at 14:10, Andrew Dunstan wrote: > We'll email them once this is in. Most people are fairly reponsive. I pushed the rename patch earlier. How should we go about making contact with the owners? I'm thinking it may be better coming from you, especially if you think technical de

Re: [PATCH] Add pretty-printed XML output option

2023-02-15 Thread Alvaro Herrera
On 2023-Feb-15, Jim Jones wrote: > Hi Álvaro, > > As my test cases were not specifically about how the error message looks > like, I thought that suppressing part of the error messages by setting > VERBOSITY terse would suffice.[1] Is this approach not recommended? Well, I don't see why we would

Re: run pgindent on a regular basis / scripted manner

2023-02-15 Thread Jelte Fennema
> (ITYM "remove as many hurdles as possible"). yes, I messed up rewriting that sentence from "having as few hurdles as possible" to "removing as many hurdles as possible" > So far, we have had the following categories suggested: dirty, staged, > dirty+staged, untracked. Are there any others? Th

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

2023-02-15 Thread Hayato Kuroda (Fujitsu)
Dear Andres and other hackers, > OTOH, if we want to implement the functionality on publisher-side, > I think we need to first consider the interface. > We can think of two options (a) Have it as a subscription parameter as the > patch > has now and > then pass it as an option to the publisher wh

Re: Todo: Teach planner to evaluate multiple windows in the optimal order

2023-02-15 Thread John Naylor
patch only helped marginally. I'm still not sure why the results from yesterday looked better than today. -- John Naylor EDB: http://www.enterprisedb.com bench_windowsort_workmem-20230215.sh Description: application/shellscript

Re: Refactoring postgres_fdw/connection.c

2023-02-15 Thread Etsuro Fujita
On Tue, Jan 31, 2023 at 3:44 PM Fujii Masao wrote: > On 2023/01/29 19:31, Etsuro Fujita wrote: > > I agree that if the name of an existing function was bad, we should > > rename it, but I do not think the name pgfdw_get_cleanup_result is > > bad; I think it is good in the sense that it well repres

Re: [PATCH] Add pretty-printed XML output option

2023-02-15 Thread Jim Jones
On 15.02.23 12:11, Alvaro Herrera wrote: Well, I don't see why we would depart from what we've been doing in the rest of the XML tests. I did see that patch and I thought it was taking the wrong approach. Fair point. v10 patches the xml.out to xml_2.out - manually removing the additional lin

Re: Minimal logical decoding on standbys

2023-02-15 Thread Ashutosh Sharma
On Thu, Jan 12, 2023 at 11:46 PM Andres Freund wrote: > > Hi, > > On 2023-01-12 20:08:55 +0530, Ashutosh Sharma wrote: > > I previously participated in the discussion on "Synchronizing the > > logical replication slots from Primary to Standby" and one of the > > purposes of that project was to syn

Re: Can we do something to help stop users mistakenly using force_parallel_mode?

2023-02-15 Thread Andrew Dunstan
On 2023-02-15 We 06:05, David Rowley wrote: On Wed, 15 Feb 2023 at 14:10, Andrew Dunstan wrote: We'll email them once this is in. Most people are fairly reponsive. I pushed the rename patch earlier. How should we go about making contact with the owners? I'm thinking it may be better coming

Re: pg_statistic MCVs use float4 but extended stats use float8

2023-02-15 Thread Tomas Vondra
Hi, On 2/15/23 02:20, Justin Pryzby wrote: > It seems odd that stats_ext uses double: > > postgres=# SELECT attrelid::regclass, attname, atttypid::regtype, relkind > FROM pg_attribute a JOIN pg_class c ON c.oid=a.attrelid WHERE > attname='most_common_freqs'; > attrelid | attname

Re: Use of additional index columns in rows filtering

2023-02-15 Thread Tomas Vondra
On 2/15/23 09:57, Maxim Ivanov wrote: > Hi All, > > I'd like to report what seems to be a missing optimization > opportunity or understand why it is not possible to achieve. > > TLDR; additional index column B specified in CREATE INDEX .. (A) > INCLUDE(B) is not used to filter rows in querie

Re: [PATCH] Add pretty-printed XML output option

2023-02-15 Thread Jim Jones
Accidentally left the VERBOSE settings out -- sorry! Now it matches the approach used in a xpath test in xml.sql, xml.out, xml_1.out and xml_2.out -- Since different libxml versions emit slightly different -- error messages, we suppress the DETAIL in this test. \set VERBOSITY terse SELECT xpat

RE: Add LZ4 compression in pg_dump

2023-02-15 Thread shiy.f...@fujitsu.com
On Fri, Jan 27, 2023 2:04 AM gkokola...@pm.me wrote: > > --- Original Message --- > On Thursday, January 26th, 2023 at 12:53 PM, Michael Paquier > wrote: > > > > > > > > On Thu, Jan 26, 2023 at 11:24:47AM +, gkokola...@pm.me wrote: > > > > > I gave this a little bit of thought. I t

Re: Minimal logical decoding on standbys

2023-02-15 Thread Drouvot, Bertrand
Hi, On 2/15/23 1:32 PM, Ashutosh Sharma wrote: Thanks Andres. I have one more query (both for you and Bertrand). I don't know if this has already been answered somewhere in this mail thread, if yes, please let me know the mail that answers this query. Will there be a problem if we mandate the u

Re: [EXTERNAL] Re: [PATCH] Support using "all" for the db user in pg_ident.conf

2023-02-15 Thread Jelte Fennema
On Wed, 15 Feb 2023 at 08:11, Michael Paquier wrote: > Hmm, I am not sure that adding more examples in the sample files is > worth the duplication with the docs. I think you misunderstood what I meant (because I admittedly didn't write it down clearly). I meant the docs for pg_ident don't include

Re: [PATCH] Add pretty-printed XML output option

2023-02-15 Thread Tom Lane
Alvaro Herrera writes: > Note that there's another file, xml_2.out, which does not contain the > additional part of the DETAIL message. I suspect in Peter's case it's > xml_2.out that was originally being used as a comparison basis (not > xml.out), but that one is not getting patched, and ultimat

Silent overflow of interval type

2023-02-15 Thread Nikolai
Hello hackers, I've been testing various edge-cases of timestamptz and related types and noticed that despite being a 16-byte wide type, interval overflows for some timestamptz (8-byte) subtractions (timestamp_mi). A simple example of this would be: select timestamptz'294276-12-31 23:59:59 UTC' -

Re: Use of additional index columns in rows filtering

2023-02-15 Thread Tom Lane
Tomas Vondra writes: > On 2/15/23 09:57, Maxim Ivanov wrote: >> TLDR; additional index column B specified in CREATE INDEX .. (A) >> INCLUDE(B) is not used to filter rows in queries like WHERE B = $1 >> ORDER BY A during IndexScan. https://dbfiddle.uk/iehtq44L > Seems doable, unless I'm missing s

Re: DDL result is lost by CREATE DATABASE with WAL_LOG strategy

2023-02-15 Thread Justin Pryzby
On Wed, Feb 15, 2023 at 04:49:38AM +, Ryo Matsumura (Fujitsu) wrote: > Hi, hackers. > > I found that CREATE DATABASE occurs lost of DDL result after crash server. > The direct cause is that the checkpoint skips sync for page of template1's > main fork > because buffer status is not marked as

Re: Use of additional index columns in rows filtering

2023-02-15 Thread Tomas Vondra
On 2/15/23 16:18, Tom Lane wrote: > Tomas Vondra writes: >> On 2/15/23 09:57, Maxim Ivanov wrote: >>> TLDR; additional index column B specified in CREATE INDEX .. (A) >>> INCLUDE(B) is not used to filter rows in queries like WHERE B = $1 >>> ORDER BY A during IndexScan. https://dbfiddle.uk/ieh

Re: Use of additional index columns in rows filtering

2023-02-15 Thread Maxim Ivanov
> This isn't a problem for operators found in operator families, because > we trust those to not have undesirable side effects like raising > data-dependent errors. But it'd be an issue if we started to apply > quals that aren't index quals directly to index rows before doing > the heap liveness ch

Re: We shouldn't signal process groups with SIGQUIT

2023-02-15 Thread Nathan Bossart
On Tue, Feb 14, 2023 at 04:20:59PM -0800, Andres Freund wrote: > On 2023-02-14 14:23:32 -0800, Nathan Bossart wrote: >> On Tue, Feb 14, 2023 at 12:47:12PM -0800, Andres Freund wrote: >> > Not really related: I do wonder how often we end up self deadlocking in >> > quickdie(), due to the ereport() n

Re: some namespace.c refactoring

2023-02-15 Thread Alvaro Herrera
On 2023-Feb-15, Tom Lane wrote: > Peter Eisentraut writes: > > Here are two patches that refactor the mostly repetitive "${object} is > > visible" and get_${object}_oid() functions in namespace.c. This uses > > the functions in objectaddress.c to look up the appropriate per-catalog > > system

Re: We shouldn't signal process groups with SIGQUIT

2023-02-15 Thread Andres Freund
Hi, On 2023-02-15 09:57:41 -0800, Nathan Bossart wrote: > On Tue, Feb 14, 2023 at 04:20:59PM -0800, Andres Freund wrote: > > On 2023-02-14 14:23:32 -0800, Nathan Bossart wrote: > >> On Tue, Feb 14, 2023 at 12:47:12PM -0800, Andres Freund wrote: > >> > Not really related: I do wonder how often we e

Re: Improve logging when using Huge Pages

2023-02-15 Thread Nathan Bossart
On Tue, Feb 14, 2023 at 07:32:56PM -0600, Justin Pryzby wrote: > On Mon, Feb 13, 2023 at 08:18:52PM -0800, Nathan Bossart wrote: >> On Mon, Feb 13, 2023 at 05:22:45PM -0600, Justin Pryzby wrote: >> nitpick: Does this need to be initialized here? > > None of the GUCs' C vars need to be initialized,

Re: We shouldn't signal process groups with SIGQUIT

2023-02-15 Thread Nathan Bossart
On Wed, Feb 15, 2023 at 10:12:58AM -0800, Andres Freund wrote: > On 2023-02-15 09:57:41 -0800, Nathan Bossart wrote: >> Oh, that's nifty. Any reason not to enable send_abort_for_crash, too? > > I think it'd be too noisy. Right now you get just a core dump of the crashed > process, but if we set s

Re: Minimal logical decoding on standbys

2023-02-15 Thread Andres Freund
Hi, On 2023-02-15 18:02:11 +0530, Ashutosh Sharma wrote: > Thanks Andres. I have one more query (both for you and Bertrand). I > don't know if this has already been answered somewhere in this mail > thread, if yes, please let me know the mail that answers this query. > > Will there be a problem i

Re: recovery modules

2023-02-15 Thread Nathan Bossart
On Wed, Feb 15, 2023 at 03:38:21PM +0900, Michael Paquier wrote: > On Mon, Feb 13, 2023 at 05:02:37PM -0800, Nathan Bossart wrote: >> Sorry for then noise, cfbot alerted me to a missing #include, which I've >> added in v13. Sorry for more noise. I noticed that I missed updating the IDENTIFICATION

Re: run pgindent on a regular basis / scripted manner

2023-02-15 Thread Justin Pryzby
On Mon, Feb 13, 2023 at 07:57:25AM -0500, Andrew Dunstan wrote: > > On 2023-02-12 Su 15:59, Justin Pryzby wrote: > > It seems like if pgindent knows about git, it ought to process only > > tracked files. Then, it wouldn't need to manually exclude generated > > files, and it wouldn't process vpath

Re: Move defaults toward ICU in 16?

2023-02-15 Thread Jeff Davis
On Tue, 2023-02-14 at 16:27 -0500, Jonathan S. Katz wrote: > Would it be any different than a vulnerability in OpenSSL et al? In principle, no, but sometimes the details matter. I'm just trying to add data to the discussion. > It seems that > in general, users would see performance gains switchi

Re: doc: add missing "id" attributes to extension packaging page

2023-02-15 Thread Karl O. Pinc
On Tue, 14 Feb 2023 12:13:18 -0800 Andres Freund wrote: > A small note: As-is this fails on CI, because we don't allow network > access during the docs build anymore (since it always fails these > days): > > https://cirrus-ci.com/task/5474029402849280?logs=docs_build#L297 > > [17:02:03.114] tim

Re: Silent overflow of interval type

2023-02-15 Thread Andrey Borodin
On Wed, Feb 15, 2023 at 7:08 AM Nikolai wrote: > > The patch attached simply throws an error when an overflow is > detected. However I'm not sure this is a reasonable approach for a > code path that could be very hot in some workloads. Given the extraordinary amount of overflow checks in the near

Re: doc: add missing "id" attributes to extension packaging page

2023-02-15 Thread Andres Freund
Hi, On 2023-02-15 13:34:37 -0600, Karl O. Pinc wrote: > This makes me think that it would be useful to add --nonet to the > xsltproc invocations. That would catch this error before it goes to > CI. We are doing that now :) commit 969509c3f2e3b4c32dcf264f9d642b5ef01319f3 Author: Tom Lane Date:

Re: run pgindent on a regular basis / scripted manner

2023-02-15 Thread Jelte Fennema
> Also, it makes a more sense to "add" the file before indenting it, to > allow checking the output and remove unrelated changes. So that doesn't > seem to me like a restriction of any significance. For my workflow it would be the same, but afaik there's two ways that people commonly use git (min

[PATCH] FIx alloc_var() ndigits thinko

2023-02-15 Thread Joel Jacobson
Hi, I came across another harmless thinko in numeric.c. It is harmless since 20/DEC_DIGITS and 40/DEC_DIGITS happens to be exactly 5 and 10 since DEC_DIGITS == 4, but should be fixed anyway for correctness IMO. - alloc_var(var, 20 / DEC_DIGITS); + alloc_var(var, (20 + DEC_DIGITS - 1

Re: psql: Add role's membership options to the \du+ command

2023-02-15 Thread David Zhang
On 2023-02-10 2:27 p.m., David G. Johnston wrote: On Fri, Feb 10, 2023 at 2:08 PM David Zhang wrote: I noticed the document psql-ref.sgml has been updated for both `du+` and `dg+`, but only `du` and `\du+` are covered in regression test. Is that because `dg+` is treated exa

Re: psql: Add role's membership options to the \du+ command

2023-02-15 Thread David G. Johnston
On Wed, Feb 15, 2023 at 2:31 PM David Zhang wrote: > There is a default built-in role `pg_monitor` and the behavior changed > after the patch. If `\dg+` and `\du+` is treated as the same, and `make > check` all pass, then I assume there is no test case to verify the output > of `duS+`. My point i

Re: [EXTERNAL] Re: [PATCH] Support using "all" for the db user in pg_ident.conf

2023-02-15 Thread Michael Paquier
On Wed, Feb 15, 2023 at 03:40:26PM +0100, Jelte Fennema wrote: > On Wed, 15 Feb 2023 at 08:11, Michael Paquier wrote: >> Hmm, I am not sure that adding more examples in the sample files is >> worth the duplication with the docs. > > I think you misunderstood what I meant (because I admittedly did

Re: psql: Add role's membership options to the \du+ command

2023-02-15 Thread David Zhang
On 2023-02-15 1:37 p.m., David G. Johnston wrote: On Wed, Feb 15, 2023 at 2:31 PM David Zhang wrote: There is a default built-in role `pg_monitor` and the behavior changed after the patch. If `\dg+` and `\du+` is treated as the same, and `make check` all pass, then I assume there i

Re: [PATCH] Add pretty-printed XML output option

2023-02-15 Thread Peter Smith
On Thu, Feb 16, 2023 at 12:49 AM Jim Jones wrote: > > Accidentally left the VERBOSE settings out -- sorry! > > Now it matches the approach used in a xpath test in xml.sql, xml.out, > xml_1.out and xml_2.out > > -- Since different libxml versions emit slightly different > -- error messages, we supp

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

2023-02-15 Thread Peter Smith
LGTM. My only comment is about the commit message. == Commit message d9d7fe6 reuse existing wait event when sending data in apply worker. But we should have invent a new wait state if we are waiting at a new place, so fix this. ~ SUGGESTION d9d7fe6 made use of an existing wait event when se

Re: DDL result is lost by CREATE DATABASE with WAL_LOG strategy

2023-02-15 Thread Nathan Bossart
On Wed, Feb 15, 2023 at 04:49:38AM +, Ryo Matsumura (Fujitsu) wrote: > The above is occured by the following call. > The argument 'permanent' of ReadBufferWithoutRelcache() is passed to > BufferAlloc() as 'relpersistence'. > > [src/backend/commands/] > 298 buf = ReadBufferWithoutRelca

Re: Silent overflow of interval type

2023-02-15 Thread Tom Lane
Andrey Borodin writes: > On Wed, Feb 15, 2023 at 7:08 AM Nikolai wrote: >> The patch attached simply throws an error when an overflow is >> detected. However I'm not sure this is a reasonable approach for a >> code path that could be very hot in some workloads. > Given the extraordinary amount o

Re: Normalization of utility queries in pg_stat_statements

2023-02-15 Thread Michael Paquier
On Wed, Feb 08, 2023 at 12:05:24PM +0900, Michael Paquier wrote: > Thoughts and comments are welcome. 0001 and 0002 are useful on their > own to keep track of utilities that use Const and A_Const after going > through the query jumbling, even if an approach based on query string > or the automated

Make set_ps_display faster and easier to use

2023-02-15 Thread David Rowley
While doing some benchmarking of some fast-to-execute queries, I see that set_ps_display() popping up on the profiles. Looking a little deeper, there are some inefficiencies in there that we could fix. For example, the following is pretty poor: strlcpy(ps_buffer + ps_buffer_fixed_size, activity,

Bug in processing conditions on multi-column BRIN indexes

2023-02-15 Thread Tomas Vondra
Hi, While working on the BRIN SK_SEARCHARRAY patch I noticed a silly bug in handling clauses on multi-column BRIN indexes, introduced in PG13. Consider a simple table with two columns (a,b) and a multi-columns BRIN index on them: create table t (a int, b int); insert into t select

Re: Todo: Teach planner to evaluate multiple windows in the optimal order

2023-02-15 Thread David Rowley
On Thu, 16 Feb 2023 at 00:45, John Naylor wrote: > Okay, here's a rerun including the sort hack, and it looks like incremental > sort is only ahead with the smallest set, otherwise same or maybe slightly > slower: > > HEAD: > > 4 ^ 8: latency average = 113.461 ms > 5 ^ 8: latency average = 786.0

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

2023-02-15 Thread Masahiko Sawada
On Tue, Feb 14, 2023 at 8:24 PM John Naylor wrote: > > On Mon, Feb 13, 2023 at 2:51 PM Masahiko Sawada wrote: > > > > On Sat, Feb 11, 2023 at 2:33 PM John Naylor > > wrote: > > > > > > I didn't get any closer to radix-tree regression, > > > > Me neither. It seems that in v26, inserting chunks in

Dead code in ps_status.c

2023-02-15 Thread Thomas Munro
Hi, Here's some archeology I did a while back, but was reminded to post when I saw David's nearby performance improvements for ps_status.c. * there are no systems with HAVE_PS_STRINGS (ancient BSD) * setproctitle_fast() is in all live FreeBSD releases * setproctitle() is in all other BSDs * P

Re: Support logical replication of DDLs

2023-02-15 Thread Amit Kapila
On Thu, Feb 16, 2023 at 3:46 AM Zheng Li wrote: > > We have not discussed much about the ownership of replicated objects. > Currently, replicated > objects belong to the subscription owner. However, it makes sense to > allow replicated > objects to keep the same owner from the publisher for certai

Re: REASSIGN OWNED vs ALTER TABLE OWNER TO permission inconsistencies

2023-02-15 Thread Robert Haas
On Wed, Feb 15, 2023 at 9:01 AM Stephen Frost wrote: > I don't think I really agree that "because a superuser can arrange for > it to not be valid" that it follows that requiring the recipient to have > CREATE permission on the parent object doesn't make sense. Surely for > any of these scenarios

Re: run pgindent on a regular basis / scripted manner

2023-02-15 Thread Noah Misch
On Wed, Feb 15, 2023 at 12:45:52PM -0600, Justin Pryzby wrote: > On Mon, Feb 13, 2023 at 07:57:25AM -0500, Andrew Dunstan wrote: > > On 2023-02-12 Su 15:59, Justin Pryzby wrote: > > > It seems like if pgindent knows about git, it ought to process only > > > tracked files. Then, it wouldn't need to

Re: some namespace.c refactoring

2023-02-15 Thread Noah Misch
On Tue, Feb 14, 2023 at 02:32:04PM +0100, Peter Eisentraut wrote: > Notes on 0001-Refactor-is-visible-functions.patch: > > Among the functions that are being unified, some check temp schemas and some > skip them. I suppose that this is because some (most) object types cannot > normally be in temp

Re: [PATCH] Add pretty-printed XML output option

2023-02-15 Thread Nikolay Samokhvalov
On Thu, Feb 9, 2023 at 2:31 AM Peter Eisentraut < peter.eisentr...@enterprisedb.com> wrote: > I suggest we call it "xmlformat", which is an established term for this. > Some very-very old, rusted memory told me that there was something in standard – and indeed, it seems it described an optional F

Re: Minimal logical decoding on standbys

2023-02-15 Thread Ashutosh Sharma
On Wed, Feb 15, 2023 at 11:48 PM Andres Freund wrote: > > Hi, > > On 2023-02-15 18:02:11 +0530, Ashutosh Sharma wrote: > > Thanks Andres. I have one more query (both for you and Bertrand). I > > don't know if this has already been answered somewhere in this mail > > thread, if yes, please let me k

Re: Is psSocketPoll doing the right thing?

2023-02-15 Thread Katsuragi Yuta
On 2023-02-10 10:42, Kyotaro Horiguchi wrote: On 2023/02/09 11:50, Kyotaro Horiguchi wrote: > Hello. > While looking a patch, I found that pqSocketPoll passes through the > result from poll(2) to the caller and throws away revents. If I > understand it correctly, poll() *doesn't* return -1 nor er

Re: DDL result is lost by CREATE DATABASE with WAL_LOG strategy

2023-02-15 Thread Dilip Kumar
On Thu, Feb 16, 2023 at 5:37 AM Nathan Bossart wrote: > > On Wed, Feb 15, 2023 at 04:49:38AM +, Ryo Matsumura (Fujitsu) wrote: > > The above is occured by the following call. > > The argument 'permanent' of ReadBufferWithoutRelcache() is passed to > > BufferAlloc() as 'relpersistence'. > > > >

Re: Force testing of query jumbling code in TAP tests

2023-02-15 Thread Michael Paquier
On Tue, Feb 14, 2023 at 10:11:21AM -0800, Andres Freund wrote: > I didn't mean printing in the sense of outputting the statements to the tap > log. Maybe creating a temp table or such for all the queries. And yes, then > doing some top-level analysis on it like you describe sounds like a good idea.

RE: Allow logical replication to copy tables in binary format

2023-02-15 Thread Takamichi Osumi (Fujitsu)
Hi, Melih On Monday, January 30, 2023 7:50 PM Melih Mutlu wrote: > Thanks for reviewing. ... > Well, with this patch, it will begin to fail in the table copy phase... The latest patch doesn't get updated for more than two weeks after some review comments. If you don't have time, I would like to

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

2023-02-15 Thread Kyotaro Horiguchi
At Wed, 15 Feb 2023 11:29:18 +, "Hayato Kuroda (Fujitsu)" wrote in > Dear Andres and other hackers, > > > OTOH, if we want to implement the functionality on publisher-side, > > I think we need to first consider the interface. > > We can think of two options (a) Have it as a subscription par

Re: DDL result is lost by CREATE DATABASE with WAL_LOG strategy

2023-02-15 Thread Michael Paquier
On Thu, Feb 16, 2023 at 10:24:13AM +0530, Dilip Kumar wrote: > Yes, there is no reason to pass this as false, seems like this is > passed false by mistake. And your patch fixes the issue. So, if I am understanding this stuff right, this issue can create data corruption once a DDL updates any page

Re: Dead code in ps_status.c

2023-02-15 Thread Tom Lane
Thomas Munro writes: > Therefore I think it is safe to drop the PS_USE_PS_STRING and > PS_USE_CHANGE_ARGV code branches, remove a bunch of outdated comments > and macro tests, and prune the defunct configure/meson probe. Seems reasonable. Patch passes an eyeball check. > I guess (defined(sun) &

remove duplicate comment.

2023-02-15 Thread Amul Sul
Hi, The attached patch removes the comment line noting the same as the previous paragraph of the ExecUpdateAct() prolog comment. -- Regards, Amul Sul EDB: http://www.enterprisedb.com diff --git a/src/backend/executor/nodeModifyTable.c b/src/backend/executor/nodeModifyTable.c index f419c47065a..64

Missing free_var() at end of accum_sum_final()?

2023-02-15 Thread Joel Jacobson
Hi, I noticed the NumericVar's pos_var and neg_var are not free_var()'d at the end of accum_sum_final(). The potential memory leak seems small, since the function is called only once per sum() per worker (and from a few more places), but maybe they should be free'd anyways for correctness? /J

Re: Dead code in ps_status.c

2023-02-15 Thread Thomas Munro
On Thu, Feb 16, 2023 at 6:34 PM Tom Lane wrote: > Thomas Munro writes: > > Therefore I think it is safe to drop the PS_USE_PS_STRING and > > PS_USE_CHANGE_ARGV code branches, remove a bunch of outdated comments > > and macro tests, and prune the defunct configure/meson probe. > > Seems reasonable

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

2023-02-15 Thread Hayato Kuroda (Fujitsu)
Dear Horiguchi-san, Thank you for responding! Before modifying patches, I want to confirm something you said. > As Amit-K mentioned, we may need to change the name of the option in > this version, since the delay mechanism in this version causes a delay > in sending from publisher than delaying a

Re: Missing free_var() at end of accum_sum_final()?

2023-02-15 Thread Michael Paquier
On Thu, Feb 16, 2023 at 06:59:13AM +0100, Joel Jacobson wrote: > I noticed the NumericVar's pos_var and neg_var are not free_var()'d > at the end of accum_sum_final(). > > The potential memory leak seems small, since the function is called > only once per sum() per worker (and from a few more plac

Re: Support logical replication of global object commands

2023-02-15 Thread Amit Kapila
On Tue, Aug 30, 2022 at 8:09 AM Zheng Li wrote: > > > > I think a publication of ALL OBJECTS sounds intuitive. Does it mean we'll > > > publish all DDL commands, all commit and abort operations in every > > > database if there is such publication of ALL OBJECTS? > > > > > > > Actually, I intend so

Re: DDL result is lost by CREATE DATABASE with WAL_LOG strategy

2023-02-15 Thread Nathan Bossart
On Thu, Feb 16, 2023 at 02:26:55PM +0900, Michael Paquier wrote: > So, if I am understanding this stuff right, this issue can create data > corruption once a DDL updates any pages of pg_class stored in a > template database that gets copied by this routine. In this case, the > patch sent makes sur

Re: remove duplicate comment.

2023-02-15 Thread Michael Paquier
On Thu, Feb 16, 2023 at 11:05:13AM +0530, Amul Sul wrote: > The attached patch removes the comment line noting the same as the > previous paragraph of the ExecUpdateAct() prolog comment. - * Caller is in charge of doing EvalPlanQual as necessary, and of keeping - * indexes current for the update.

Re: DDL result is lost by CREATE DATABASE with WAL_LOG strategy

2023-02-15 Thread Dilip Kumar
On Thu, Feb 16, 2023 at 12:11 PM Nathan Bossart wrote: > > On Thu, Feb 16, 2023 at 02:26:55PM +0900, Michael Paquier wrote: > > So, if I am understanding this stuff right, this issue can create data > > corruption once a DDL updates any pages of pg_class stored in a > > template database that gets

Re: DDL result is lost by CREATE DATABASE with WAL_LOG strategy

2023-02-15 Thread Robert Haas
On Thu, Feb 16, 2023 at 12:32 PM Dilip Kumar wrote: > I think the below change is not relevant to this bug right? > > diff --git a/src/test/recovery/meson.build b/src/test/recovery/meson.build > index 209118a639..6e9f8a7c7f 100644 > --- a/src/test/recovery/meson.build > +++ b/src/test/recovery/mes

Re: [PATCH] Add pretty-printed XML output option

2023-02-15 Thread Jim Jones
On 16.02.23 05:38, Nikolay Samokhvalov wrote: On Thu, Feb 9, 2023 at 2:31 AM Peter Eisentraut wrote: I suggest we call it "xmlformat", which is an established term for this. Some very-very old, rusted memory told me that there was something in standard – and indeed, it seems it desc

Re: Missing free_var() at end of accum_sum_final()?

2023-02-15 Thread Joel Jacobson
On Thu, Feb 16, 2023, at 07:26, Michael Paquier wrote: > Indeed, it is true that any code path of numeric.c that relies on a > NumericVar with an allocation done in its buffer is careful enough to > free it, except for generate_series's SRF where one step of the > computation is done. I don't see

wrong query result due to wang plan

2023-02-15 Thread tender wang
Hi hackers, I have this query as shown below: select ref_1.r_comment as c0, subq_0.c1 as c1 from public.region as sample_0 right join public.partsupp as sample_1 right join public.lineitem as sample_2 on (cast(null as path) = cast(null as path)) on (cast(null as "timestamp") < cast(null as "timest

Re: DDL result is lost by CREATE DATABASE with WAL_LOG strategy

2023-02-15 Thread Michael Paquier
On Thu, Feb 16, 2023 at 12:37:57PM +0530, Robert Haas wrote: > Why not? The patch creates 100_bugs.pl so it also adds it to meson.build. It would not matter for REL_15_STABLE, but on HEAD all the new TAP test files have to be added in their respective meson.build. If you don't do that, the CFBot

Re: Missing free_var() at end of accum_sum_final()?

2023-02-15 Thread Michael Paquier
On Thu, Feb 16, 2023 at 08:08:37AM +0100, Joel Jacobson wrote: > I added the free_var() calls after strip_var() to match the similar > existing code at the end of sqrt_var(). > Not that it matters, but thought it looked nicer to keep them in the > same order. WFM. Thanks! -- Michael signature.

Re: [PATCH] Add pretty-printed XML output option

2023-02-15 Thread Jim Jones
On 16.02.23 00:13, Peter Smith wrote: Today I fetched and tried the latest v11. It is failing too, but only just. - see attached file pretty-v11-results It looks only due to a whitespace EOF issue in the xml_2.out @@ -1679,4 +1679,4 @@ -- XML format: empty string SELECT xmlformat(''); ER

Re: DDL result is lost by CREATE DATABASE with WAL_LOG strategy

2023-02-15 Thread Dilip Kumar
On Thu, Feb 16, 2023 at 12:38 PM Robert Haas wrote: > > On Thu, Feb 16, 2023 at 12:32 PM Dilip Kumar wrote: > > I think the below change is not relevant to this bug right? > > > > diff --git a/src/test/recovery/meson.build b/src/test/recovery/meson.build > > index 209118a639..6e9f8a7c7f 100644 >

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

2023-02-15 Thread Michael Paquier
On Wed, Feb 15, 2023 at 01:00:00PM +0530, Bharath Rupireddy wrote: > The v3 patch reduces initialization of iovec array elements which is a > clear win when pg_pwrite_zeros is called for sizes less than BLCKSZ > many times (I assume this is what is needed for the relation extension > lock improveme