Re: Map WAL segment files on PMEM as WAL buffers

2021-11-04 Thread Takashi Menjo
Hi Daniel, The issue you told has been fixed. I attach the v5 patchset to this email. The v5 has all the patches in the v4, and in addition, has the following two new patches: - (v5-0002) Support build with MSVC on Windows: Please have src\tools\msvc\config.pl as follows to "configure --with-li

Re: [PATCH] Added TRANSFORM FOR for COMMENT tab completion

2021-11-04 Thread Michael Paquier
On Fri, Nov 05, 2021 at 12:31:42PM +0900, Ken Kato wrote: > I found unnecessary line deletion in my previous patch, so I made a minor > update for that. I have looked at this version, and this is much simpler than what was proposed upthread. This looks good, so applied after fixing a couple of in

consistently use "ProcSignal" instead of "procsignal" in code comments

2021-11-04 Thread Bharath Rupireddy
Hi, I see that "procsignal" and "ProcSignal" are being used in the code comments which look inconsistent. IMO, "ProcSignal" is the right word to use and let's be consistent across the code comments. Attaching a tiny patch for that. Thoughts? Regards, Bharath Rupireddy. v1-0001-consistently-use

Re: pglz compression performance, take two

2021-11-04 Thread Andrey Borodin
Thanks for the review Mark! Sorry it took too long to reply on my side. > 28 июня 2021 г., в 21:05, Mark Dilger > написал(а): > >> #define PGLZ_HISTORY_SIZE 0x0fff - 1 /* to avoid compare in iteration >> */ > ... >> static PGLZ_HistEntry hist_entries[PGLZ_HISTORY_SIZE + 1]; > ... >>

Re: parallel vacuum comments

2021-11-04 Thread Masahiko Sawada
On Fri, Nov 5, 2021 at 6:25 AM Peter Geoghegan wrote: > > On Thu, Nov 4, 2021 at 12:42 PM Peter Geoghegan wrote: > > Since "The leader process alone processes all parallel-safe indexes in > > the case where no workers are launched" (no change there), I wonder: > > how does the leader *know* that

Re: enhance pg_log_backend_memory_contexts() to log memory contexts of auxiliary processes

2021-11-04 Thread Bharath Rupireddy
On Thu, Nov 4, 2021 at 9:35 AM Bharath Rupireddy wrote: > > I think the reason we need to do this is not that aux processes have > > the invalid backend id (=InvalidBackendId) but that "some" auxiliary > > processes may have a broken proc->backendId in regard to > > SendProcSignal (we know that's

Re: parallel vacuum comments

2021-11-04 Thread Masahiko Sawada
On Fri, Nov 5, 2021 at 4:42 AM Peter Geoghegan wrote: > > On Wed, Nov 3, 2021 at 10:25 PM Masahiko Sawada wrote: > > I've attached a draft patch. The patch incorporated all comments from > > Andres except for the last comment that moves parallel related code to > > another file. I'd like to discu

Re: row filtering for logical replication

2021-11-04 Thread Peter Smith
On Thu, Nov 4, 2021 at 2:21 PM houzj.f...@fujitsu.com wrote: > > Thanks for the patches. > I started to review the patches and here are a few comments. > > 1) > /* > * ALTER PUBLICATION ... ADD TABLE provides a > PublicationTable List > * (Relatio

Re: row filtering for logical replication

2021-11-04 Thread Peter Smith
On Wed, Oct 27, 2021 at 7:21 PM Greg Nancarrow wrote: > > Regarding the v34-0006 patch, shouldn't it also include an update to > the rowfilter_expr_checker() function added by the v34-0002 patch, for > validating the referenced row-filter columns in the case of UPDATE? > I was thinking something l

Re: row filtering for logical replication

2021-11-04 Thread Peter Smith
On Tue, Oct 26, 2021 at 6:26 PM Greg Nancarrow wrote: > > A few comments for some things I have noticed so far: > > 1) scantuple cleanup seems to be missing since the v33-0001 patch. > > 2) I don't think that the ResetExprContext() calls (before > FreeExecutorState()) are needed in the pgoutput_ro

Re: row filtering for logical replication

2021-11-04 Thread Peter Smith
On Thu, Sep 23, 2021 at 10:33 PM Tomas Vondra wrote: > > 5) publicationcmds.c > > I mentioned this in my last review [1] already, but I really dislike the > fact that OpenTableList accepts a list containing one of two entirely > separate node types (PublicationTable or Relation). It was modified t

Re: Logical insert/update/delete WAL records for custom table AMs

2021-11-04 Thread Amit Kapila
On Fri, Nov 5, 2021 at 4:53 AM Jeff Davis wrote: > > On Thu, 2021-11-04 at 14:33 +0530, Amit Kapila wrote: > > Can't different tableAM's have different representations > > for toast or may be some different concept like speculative > > insertions? > > The decoding plugin should just use the common

Re: Add missing function abs (interval)

2021-11-04 Thread Isaac Morland
On Thu, 4 Nov 2021 at 08:08, Daniel Gustafsson wrote: > > On 26 Sep 2021, at 19:58, Isaac Morland wrote: > > > So I think I will prepare a revised patch that uses this formulation; > and if I still have any suggestions that aren't directly related to adding > abs(interval) I will split them off

Re: On login trigger: take three

2021-11-04 Thread Greg Nancarrow
On Thu, Nov 4, 2021 at 7:43 AM Daniel Gustafsson wrote: > > On 3 Nov 2021, at 17:15, Ivan Panchenko wrote: > > Среда, 29 сентября 2021, 15:14 +03:00 от Teodor Sigaev >: > > 2 For logging purpose failing of trigger will cause impossibility to > login, it > > could be workarounded by catching err

Re: [PATCH] Added TRANSFORM FOR for COMMENT tab completion

2021-11-04 Thread Ken Kato
Hi, I found unnecessary line deletion in my previous patch, so I made a minor update for that. -- Best wishes, Ken Kato Advanced Computing Technology Center Research and Development Headquarters NTT DATA CORPORATIONdiff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c index e

Re: Data is copied twice when specifying both child and parent table in publication

2021-11-04 Thread Greg Nancarrow
On Thu, Nov 4, 2021 at 7:10 PM Amit Kapila wrote: > > On Thu, Nov 4, 2021 at 12:23 PM Greg Nancarrow wrote: > > > > On Thu, Nov 4, 2021 at 3:13 PM Amit Kapila wrote: > > > > > > On further thinking about this, I think we should define the behavior > > > of replication among partitioned (on the p

Re: Allow escape in application_name

2021-11-04 Thread Kyotaro Horiguchi
At Fri, 5 Nov 2021 03:14:00 +0900, Fujii Masao wrote in > > > On 2021/11/04 20:42, kuroda.hay...@fujitsu.com wrote: > > Dear Fujii-san, > >Thank you for giving comments! I attached new patches. > > Thanks for updating the patch! > > + > + Note that if embedded strings have Non-ASCII

Re: Teach pg_receivewal to use lz4 compression

2021-11-04 Thread Michael Paquier
On Thu, Nov 04, 2021 at 05:02:28PM +, gkokola...@pm.me wrote: > Removed an extra condinional check while switching over compression_method. Indeed. My rebase was a bit sloppy here. > because compression_method is the global option exposed to the whereas > wal_compression_method is the local

Re: inefficient loop in StandbyReleaseLockList()

2021-11-04 Thread Tom Lane
Michael Paquier writes: > On Thu, Nov 04, 2021 at 08:21:56PM -0400, Tom Lane wrote: >> Hm. I think it's not the only list function with O(N) behavior; >> in fact there used to be more such functions than there are now. >> But I could get behind a patch that annotates all of them. > Documenting t

Re: inefficient loop in StandbyReleaseLockList()

2021-11-04 Thread Michael Paquier
On Thu, Nov 04, 2021 at 08:21:56PM -0400, Tom Lane wrote: > Andres Freund writes: > > I wonder if it's worth adding a note to list_delete_first() mentioning its > > O(N) behaviour. It's not immediately visible from the code, and from the > > list > > name one could very well be excused to not be

RE: parallel vacuum comments

2021-11-04 Thread houzj.f...@fujitsu.com
On Thur, Nov 4, 2021 1:25 PM Masahiko Sawada wrote: > On Wed, Nov 3, 2021 at 1:08 PM Amit Kapila wrote: > > > > On Tue, Nov 2, 2021 at 11:17 AM Masahiko Sawada > > wrote: > > > > > > On Tue, Nov 2, 2021 at 5:57 AM Peter Geoghegan wrote: > > > > > > > > > > > Rather than inventing PARALLEL_VACUU

Re: [sqlsmith] Failed assertion in brin_minmax_multi_distance_float4 on REL_14_STABLE

2021-11-04 Thread Tomas Vondra
On 11/5/21 02:09, Tomas Vondra wrote: Here's a patch that should fix this. > Meh, forgot the attachment, ofc. -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Companydiff --git a/src/backend/access/brin/brin_minmax_multi.c b/src/backend/access/brin/brin_m

Re: [sqlsmith] Failed assertion in brin_minmax_multi_distance_float4 on REL_14_STABLE

2021-11-04 Thread Tomas Vondra
On 11/4/21 23:56, Tomas Vondra wrote: Hi, On 11/4/21 17:53, Justin Pryzby wrote: On Thu, Nov 04, 2021 at 09:46:49AM +0100, Andreas Seltenreich wrote: sqlsmith triggers the following assertion when testing REL_14_STABLE: TRAP: FailedAssertion("a1 <= a2", File: "brin_minmax_multi.c", L

Re: inefficient loop in StandbyReleaseLockList()

2021-11-04 Thread Tom Lane
Andres Freund writes: > I wonder if it's worth adding a note to list_delete_first() mentioning its > O(N) behaviour. It's not immediately visible from the code, and from the list > name one could very well be excused to not be worried about O(N) costs. Hm. I think it's not the only list function

Re: pgsql: Fix WAL replay in presence of an incomplete record

2021-11-04 Thread Tom Lane
[ I'm working on the release notes ] Alvaro Herrera writes: > Fix WAL replay in presence of an incomplete record > ... > Because a new type of WAL record is added, users should be careful to > upgrade standbys first, primaries later. Otherwise they risk the standby > being unable to start if the

Re: WIP: expression evaluation improvements

2021-11-04 Thread Andres Freund
Hi, I pushed a rebased (ugh, that was painul) version of the patches to https://github.com/anarazel/postgres/tree/jit-relative-offsets Besides rebasing I dropped a few patches and did some *minor* cleanup. Besides that there's one substantial improvement, namely that I got rid of one more absolut

Re: Predefined role pg_maintenance for VACUUM, ANALYZE, CHECKPOINT.

2021-11-04 Thread Jeff Davis
On Thu, 2021-11-04 at 15:42 -0700, Andres Freund wrote: > I don't like this. This turns the checkpoint command which previously > didn't > rely on the catalog in the happy path etc into something that > requires most of > the backend to be happily up to work. It seems like this specific approach h

Re: Predefined role pg_maintenance for VACUUM, ANALYZE, CHECKPOINT.

2021-11-04 Thread Jeff Davis
On Thu, 2021-11-04 at 15:46 -0700, Andres Freund wrote: > What about extending GRANT to allow to grant rights on commands? Yes, > it'd be > a bit of work to make that work in the catalogs, but it doesn't seem > too hard > to tackle. You mean for the CHECKPOINT command specifically, or for many com

Re: Logical insert/update/delete WAL records for custom table AMs

2021-11-04 Thread Jeff Davis
On Thu, 2021-11-04 at 14:33 +0530, Amit Kapila wrote: > Can't different tableAM's have different representations > for toast or may be some different concept like speculative > insertions? The decoding plugin should just use the common interfaces to toast, and if the table AM supports toast, every

Re: Extending amcheck to check toast size and compression

2021-11-04 Thread Mark Dilger
> On Nov 4, 2021, at 7:53 AM, Robert Haas wrote: > > But, is it plausible to add test coverage for the new checks, or is > that going to be too much of a pain? It only takes about 20 additional lines in the regression test to check the code paths for raw sizes which are too large and too smal

Re: [sqlsmith] Failed assertion in brin_minmax_multi_distance_float4 on REL_14_STABLE

2021-11-04 Thread Tomas Vondra
Hi, On 11/4/21 17:53, Justin Pryzby wrote: On Thu, Nov 04, 2021 at 09:46:49AM +0100, Andreas Seltenreich wrote: sqlsmith triggers the following assertion when testing REL_14_STABLE: TRAP: FailedAssertion("a1 <= a2", File: "brin_minmax_multi.c", Line: 1879, PID: 631814) I can reproduce i

Re: Predefined role pg_maintenance for VACUUM, ANALYZE, CHECKPOINT.

2021-11-04 Thread Andres Freund
Hi, On 2021-11-04 14:25:54 -0700, Jeff Davis wrote: > On Thu, 2021-11-04 at 12:37 -0400, Robert Haas wrote: > > I don't have anything specific to propose, which I realize is kind of > > unhelpful ... but I don't like this, either. > > We can go back to having a pg_checkpoint predefined role that

Re: Predefined role pg_maintenance for VACUUM, ANALYZE, CHECKPOINT.

2021-11-04 Thread Andres Freund
Hi, On 2021-11-02 10:28:39 -0700, Jeff Davis wrote: > On Mon, 2021-11-01 at 12:50 -0400, Stephen Frost wrote: > > All that said, I wonder if we can have our cake and eat it too. I > > haven't looked into this at all yet and perhaps it's foolish on its > > face, but, could we make CHECKPOINT; basi

Re: inefficient loop in StandbyReleaseLockList()

2021-11-04 Thread Andres Freund
Hi, On 2021-11-02 11:35:55 -0400, Tom Lane wrote: > It's not clear that the remaining list_delete_first > callers have any real problem; and changing them would be complex. I wonder if it's worth adding a note to list_delete_first() mentioning its O(N) behaviour. It's not immediately visible from

Re: Possible Documentation Update for ALTER STATISTICS

2021-11-04 Thread Tomas Vondra
Hi Ahmet, On 11/4/21 14:35, Ahmet Gedemenli wrote: Hey, I've noticed that the current documentation doesn't mention IF EXISTS clause for ALTER STATISTICS in the synopsis section, where PG supports it. https://www.postgresql.org/docs/14/sql-alterstatistics.html

Re: Predefined role pg_maintenance for VACUUM, ANALYZE, CHECKPOINT.

2021-11-04 Thread Jeff Davis
On Thu, 2021-11-04 at 12:37 -0400, Robert Haas wrote: > I don't have anything specific to propose, which I realize is kind of > unhelpful ... but I don't like this, either. We can go back to having a pg_checkpoint predefined role that is only used for the CHECKPOINT command. The only real argumen

Re: parallel vacuum comments

2021-11-04 Thread Peter Geoghegan
On Thu, Nov 4, 2021 at 12:42 PM Peter Geoghegan wrote: > Since "The leader process alone processes all parallel-safe indexes in > the case where no workers are launched" (no change there), I wonder: > how does the leader *know* that it's the leader (and so can always > process any indexes) inside

Re: pglz compression performance, take two

2021-11-04 Thread Tomas Vondra
Hi, I've looked at this patch again and did some testing. I don't have any comments to the code (I see there are two comments from Mark after the last version, though). For the testing, I did a fairly simple benchmark loading either random or compressible data into a bytea column. The tables

Re: Time to drop plpython2?

2021-11-04 Thread Tom Lane
Andres Freund writes: > Another thing I wondered about is what we want to do with the extension > names. Do we want to leave it named plpython3u? Do we want to have a plpython > that depends on plpython3u? I think we want to keep plpython3u. Maybe we can point plpythonu at that, but I'm concerne

Re: should we enable log_checkpoints out of the box?

2021-11-04 Thread Andres Freund
Hi, On 2021-11-02 11:55:23 -0400, Robert Haas wrote: > On Sun, Oct 31, 2021 at 10:59 AM Tom Lane wrote: > > The general policy at the moment is that a normally-functioning server > > should emit *no* log traffic by default (other than a few messages > > at startup and shutdown). log_checkpoints

Re: Time to drop plpython2?

2021-11-04 Thread Andres Freund
Hi, On 2021-11-04 19:58:54 +0100, Peter Eisentraut wrote: > I see you have posted a patch for this in the meson thread > (https://www.postgresql.org/message-id/attachment/127770/v5-0003-plpython-Drop-support-python2.patch). Yea, I was planning to post that here after a bit more polish. I mostly

Re: parallel vacuum comments

2021-11-04 Thread Peter Geoghegan
On Wed, Nov 3, 2021 at 10:25 PM Masahiko Sawada wrote: > I've attached a draft patch. The patch incorporated all comments from > Andres except for the last comment that moves parallel related code to > another file. I'd like to discuss how we split vacuumlazy.c. This looks great! I wonder if thi

Re: parallel vacuum comments

2021-11-04 Thread Andres Freund
Hi, On 2021-11-01 10:44:34 +0900, Masahiko Sawada wrote: > On Sun, Oct 31, 2021 at 6:21 AM Andres Freund wrote: > > But even though we have this space optimized bitmap thing, we actually > > need > > more memory allocated for each index, making this whole thing pointless. > > Right. But is

Re: Time to drop plpython2?

2021-11-04 Thread Peter Eisentraut
I see you have posted a patch for this in the meson thread (https://www.postgresql.org/message-id/attachment/127770/v5-0003-plpython-Drop-support-python2.patch). Here is my review of that. I would change the search order in configure from PGAC_PATH_PROGS(PYTHON, [python python3 python2]) to

Re: [RFC] building postgres with meson -v

2021-11-04 Thread Andres Freund
Hi, On 2021-11-04 19:17:05 +0100, Peter Eisentraut wrote: > On 01.11.21 00:24, Andres Freund wrote: > > - remaining hardcoded configure tests (e.g. ACCEPT_TYPE_ARG*) > > I think we can get rid of that one. Oh, nice! I was somewhat confused by "unsigned int PASCAL" as a type. > That test origi

Re: [RFC] building postgres with meson -v

2021-11-04 Thread Peter Eisentraut
On 01.11.21 00:24, Andres Freund wrote: - remaining hardcoded configure tests (e.g. ACCEPT_TYPE_ARG*) I think we can get rid of that one. That test originally catered to some strange edge cases where the third argument was size_t that was not the same size as int. That is long gone, if it

Re: Allow escape in application_name

2021-11-04 Thread Fujii Masao
On 2021/11/04 20:42, kuroda.hay...@fujitsu.com wrote: Dear Fujii-san, Thank you for giving comments! I attached new patches. Thanks for updating the patch! + + Note that if embedded strings have Non-ASCII, + these characters will be replaced with the question marks (?). +

Re: should we enable log_checkpoints out of the box?

2021-11-04 Thread Bharath Rupireddy
On Thu, Nov 4, 2021 at 10:50 PM Fujii Masao wrote: > > On 2021/11/05 0:04, Robert Haas wrote: > > On Thu, Nov 4, 2021 at 10:59 AM Bharath Rupireddy > > wrote: > >> With log_checkpoints=on, the "./initdb -D data" generates few > >> checkpoints logs [1]. I hope this is okay as it's a one-time thing

Re: should we enable log_checkpoints out of the box?

2021-11-04 Thread Fujii Masao
On 2021/11/05 0:04, Robert Haas wrote: On Thu, Nov 4, 2021 at 10:59 AM Bharath Rupireddy wrote: With log_checkpoints=on, the "./initdb -D data" generates few checkpoints logs [1]. I hope this is okay as it's a one-time thing per database cluster. Thoughts? I think you should arrange to sup

Re: Teach pg_receivewal to use lz4 compression

2021-11-04 Thread gkokolatos
‐‐‐ Original Message ‐‐‐ On Thursday, November 4th, 2021 at 9:21 AM, Michael Paquier wrote: > > +#ifdef HAVE_LIBLZ4 > > +while (readp < readend) > > +{ > > +size_tread_size = 1; > > +size_tout_size = 1; > > + > > +status = LZ4F_decompress

Re: [sqlsmith] Failed assertion in brin_minmax_multi_distance_float4 on REL_14_STABLE

2021-11-04 Thread Justin Pryzby
On Thu, Nov 04, 2021 at 09:46:49AM +0100, Andreas Seltenreich wrote: > sqlsmith triggers the following assertion when testing REL_14_STABLE: > > TRAP: FailedAssertion("a1 <= a2", File: "brin_minmax_multi.c", Line: > 1879, PID: 631814) > > I can reproduce it with the following query on a fres

Re: Predefined role pg_maintenance for VACUUM, ANALYZE, CHECKPOINT.

2021-11-04 Thread Robert Haas
On Thu, Nov 4, 2021 at 12:03 PM Jeff Davis wrote: > The approach of using a function's ACL to represent the ACL of a > higher-level command (as in this patch) does feel right to me. It feels > like something we might extend to similar situations in the future; and > even if we don't, it seems like

Re: WIP: expression evaluation improvements

2021-11-04 Thread Robert Haas
Andres asked me off-list for comments on 0026, so here goes. As a general comment, I think the patches could really benefit from more meaningful commit messages and more comments on individual functions. It would definitely help me review, and it might help other people review, or modify the code

Re: pg14 psql broke \d datname.nspname.relname

2021-11-04 Thread Mark Dilger
> On Nov 4, 2021, at 6:37 AM, Hamlin, Garick L wrote: > >> If we pass the dots through to the POSIX regular expression, we can >> only do that either for the table name or the schema name, not both - >> either the first or last dot must mark the boundary between the two. >> That means that you

Re: Predefined role pg_maintenance for VACUUM, ANALYZE, CHECKPOINT.

2021-11-04 Thread Jeff Davis
On Tue, 2021-11-02 at 14:26 -0400, Stephen Frost wrote: > Think you meant 'Stephen' there. ;) Yes ;-) > > The approach in the patch looks alright to me, but another one > > could > > be to build a SelectStmt when parsing CHECKPOINT. I think that'd > > simplify the standard_ProcessUtility() chang

Re: Why doesn't GiST VACUUM require a super-exclusive lock, like nbtree VACUUM?

2021-11-04 Thread Peter Geoghegan
On Thu, Nov 4, 2021 at 8:52 AM Andrey Borodin wrote: > Let's enumerate steps how things can go wrong. > > Backend1: Index-Only scan returns tid and xs_hitup with index_tuple1 on > index_page1 pointing to heap_tuple1 on page1 > > Backend2: Remove index_tuple1 and heap_tuple1 > > Backend3: Mark pag

Re: Skipping logical replication transactions on subscriber side

2021-11-04 Thread vignesh C
On Fri, Oct 29, 2021 at 10:55 AM Masahiko Sawada wrote: > > On Thu, Oct 28, 2021 at 7:40 PM Amit Kapila wrote: > > > > On Thu, Oct 28, 2021 at 10:36 AM Masahiko Sawada > > wrote: > > > > > > On Wed, Oct 27, 2021 at 7:02 PM Amit Kapila > > > wrote: > > > > > > > > On Thu, Oct 21, 2021 at 10:29

Re: Why doesn't GiST VACUUM require a super-exclusive lock, like nbtree VACUUM?

2021-11-04 Thread Andrey Borodin
  04.11.2021, 04:33, "Peter Geoghegan" :But what about index-only scans, which GiST also supports? I thinkthat the rules are different there, even though index-only scans usean MVCC snapshot.Let's enumerate steps how things can go wrong.Backend1: Index-Only scan returns tid and xs_hitup with index_

Possible Documentation Update for ALTER STATISTICS

2021-11-04 Thread Ahmet Gedemenli
Hey, I've noticed that the current documentation doesn't mention IF EXISTS clause for ALTER STATISTICS in the synopsis section, where PG supports it. https://www.postgresql.org/docs/14/sql-alterstatistics.html (Only for the last item, that is ALTER STATISTICS .. SET STATISTICS; for the others, P

Re: should we enable log_checkpoints out of the box?

2021-11-04 Thread Robert Haas
On Thu, Nov 4, 2021 at 10:59 AM Bharath Rupireddy wrote: > With log_checkpoints=on, the "./initdb -D data" generates few > checkpoints logs [1]. I hope this is okay as it's a one-time thing per > database cluster. Thoughts? I think you should arrange to suppress that output. There's no reason why

Re: Automatic notification of top transaction IDs

2021-11-04 Thread Robert Haas
On Wed, Jun 30, 2021 at 8:56 PM Gurjeet Singh wrote: > As mentioned in that thread, when sending a cancellation signal, the > client cannot be sure if the cancel signal was honored, and if the > transaction was cancelled successfully. In the attached patch, the > backend emits a NotificationRespon

Re: should we enable log_checkpoints out of the box?

2021-11-04 Thread Bharath Rupireddy
On Thu, Nov 4, 2021 at 1:11 PM Michael Paquier wrote: > > On Tue, Nov 02, 2021 at 11:55:23AM -0400, Robert Haas wrote: > > I think shipping with log_checkpoints=on and > > log_autovacuum_min_duration=10m or so would be one of the best things > > we could possibly do to allow ex-post-facto troubles

Re: Extending amcheck to check toast size and compression

2021-11-04 Thread Robert Haas
On Wed, Nov 3, 2021 at 6:56 PM Mark Dilger wrote: > Done that way. I agree with what others have said: this looks fine. But, is it plausible to add test coverage for the new checks, or is that going to be too much of a pain? -- Robert Haas EDB: http://www.enterprisedb.com

Re: Missing include in be-secure-openssl.c?

2021-11-04 Thread Tom Lane
Michael Paquier writes: > On Wed, Nov 03, 2021 at 11:45:26PM -0400, Tom Lane wrote: >> Yeah, I noted the comment about WIN32_LEAN_AND_MEAN in the >> stackoverflow thread too ... but as you say, it seems like >> that should make the problem less probable not more so. >> Still, it's hard to think of

Re: pg14 psql broke \d datname.nspname.relname

2021-11-04 Thread Hamlin, Garick L
On Wed, Oct 13, 2021 at 09:24:53AM -0400, Robert Haas wrote: > > Splitting the pattern on all the dots and throwing away any additional > > leftmost fields is a bug, ... > > I also agree with you right up to here. > > > and when you stop doing that, passing additional dots through to the POSIX >

Re: [PATCH] rename column if exists

2021-11-04 Thread David G. Johnston
On Thursday, November 4, 2021, Daniel Gustafsson wrote: > > On 22 Mar 2021, at 20:40, David Oksman wrote: > > > > Added the ability to specify IF EXISTS when renaming a column of an > object (table, view, etc.). > > For example: ALTER TABLE distributors RENAME COLUMN IF EXISTS address TO > city;

Re: Automatic notification of top transaction IDs

2021-11-04 Thread Daniel Gustafsson
> On 22 Jul 2021, at 07:28, vignesh C wrote: > > On Thu, Jul 1, 2021 at 6:41 AM Gurjeet Singh wrote: >> >> The proposed patch is attached. > > There is one compilation warning: > xid.c:165:1: warning: no previous prototype for > ‘FullTransactionIdToStr’ [-Wmissing-prototypes] > 165 | FullTran

Re: Supply restore_command to pg_rewind via CLI argument

2021-11-04 Thread Daniel Gustafsson
> On 14 Sep 2021, at 16:05, Andrey Borodin wrote: >> Do we actually need --target-restore-command at all? It seems to me >> that we have all we need with --restore-target-wal, and that's not >> really instinctive to pass down a command via another command.. > > Currently we know that --restore-t

Re: RFC: Logging plan of the running query

2021-11-04 Thread torikoshia
On 2021-11-02 20:32, Ekaterina Sokolova wrote: Thanks for your response! Hi! I'm here to answer your questions about contrib/pg_query_state. I only took a quick look at pg_query_state, I have some questions. pg_query_state seems using shm_mq to expose the plan information, but there was a d

Re: pgbench logging broken by time logic changes

2021-11-04 Thread Daniel Gustafsson
> On 11 Jul 2021, at 15:07, Fabien COELHO wrote: > Attached the fully "ignored" version of the time features test as a patch. This version of the patch is failing to apply on top of HEAD, can you please submit a rebased version? -- Daniel Gustafsson https://vmware.com/

Re: standby recovery fails (tablespace related) (tentative patch and discussion)

2021-11-04 Thread Daniel Gustafsson
> On 24 Sep 2021, at 20:14, Tom Lane wrote: > > Robert Haas writes: >> The commit message for 0001 is not clear enough for me to understand >> what problem it's supposed to be fixing. The code comments aren't >> really either. They make it sound like there's some problem with >> copying symlinks

Re: should INSERT SELECT use a BulkInsertState?

2021-11-04 Thread Daniel Gustafsson
> On 27 Sep 2021, at 02:08, Justin Pryzby wrote: > I split off the simple part again. If there's no interest in the 0001 patch > alone, then I guess it should be closed in the CF. Since the thread has stalled, maybe that's the best course of action here. Any objections from anyone on the threa

Re: LogwrtResult contended spinlock

2021-11-04 Thread Daniel Gustafsson
> On 8 Sep 2021, at 17:14, Jaime Casanova wrote: > > On Tue, Feb 02, 2021 at 08:19:19PM -0300, Alvaro Herrera wrote: >> Hello, >> >> So I addressed about half of your comments in this version merely by >> fixing silly bugs. The problem I had which I described as >> "synchronization fails" was o

Re: [PROPOSAL] new diagnostic items for the dynamic sql

2021-11-04 Thread Daniel Gustafsson
> On 9 Sep 2021, at 08:23, Dinesh Chemuduru wrote: > Let me try to fix the suggested case(I tried to fix this case in the past, > but this time I will try to spend more time on this), and will submit a new > patch. This CF entry is marked Waiting on Author, have you had the chance to prepare a

Re: Add missing function abs (interval)

2021-11-04 Thread Daniel Gustafsson
> On 26 Sep 2021, at 19:58, Isaac Morland wrote: > So I think I will prepare a revised patch that uses this formulation; and if > I still have any suggestions that aren't directly related to adding > abs(interval) I will split them off into a separate discussion. This CF entry is marked Waitin

Re: lastOverflowedXid does not handle transaction ID wraparound

2021-11-04 Thread Simon Riggs
On Wed, 3 Nov 2021 at 22:07, Alexander Korotkov wrote: > > Hi! > > On Wed, Nov 3, 2021 at 8:51 PM Simon Riggs > wrote: > > It is however, an undocumented modularity violation. I think that is > > acceptable because of the ProcArrayLock traffic, but needs to have a > > comment to explain this at

RE: Allow escape in application_name

2021-11-04 Thread kuroda.hay...@fujitsu.com
Dear Fujii-san, Thank you for giving comments! I attached new patches. > On second thought, do we really need padding support for application_name > in postgres_fdw? I just thought that when I read the description > "Padding can be useful to aid human readability in log files." in the docs > abou

Re: PROXY protocol support

2021-11-04 Thread Magnus Hagander
On Wed, Nov 3, 2021 at 2:36 PM Daniel Gustafsson wrote: > > On 28 Sep 2021, at 15:23, Magnus Hagander wrote: > > On Fri, Sep 10, 2021 at 1:44 AM Jacob Champion > wrote: > > >> The TAP test will need to be rebased over the changes in 201a76183e. > > > > Done > > And now the TAP test will need to

Re: [PATCH] More docs on what to do and not do in extension code

2021-11-04 Thread Daniel Gustafsson
> On 30 Aug 2021, at 04:20, Craig Ringer wrote: > > On Tue, 29 Jun 2021 at 13:30, Craig Ringer > wrote: > Laurenz, > > Thanks for your comments. Sorry it's taken me so long to get back to you. > Commenting inline below on anything I think needs comment; ot

Re: [PATCH] rename column if exists

2021-11-04 Thread Daniel Gustafsson
> On 22 Mar 2021, at 20:40, David Oksman wrote: > > Added the ability to specify IF EXISTS when renaming a column of an object > (table, view, etc.). > For example: ALTER TABLE distributors RENAME COLUMN IF EXISTS address TO city; > If the column does not exist, a notice is issued instead of thr

Re: Printing backtrace of postgres processes

2021-11-04 Thread Daniel Gustafsson
> On 26 Aug 2021, at 16:56, vignesh C wrote: > The previous patch was failing because of the recent test changes made > by commit 201a76183e2 which unified new and get_new_node, attached > patch has the changes to handle the changes accordingly. This patch now fails because of the test changes m

Re: partial heap only tuples

2021-11-04 Thread Daniel Gustafsson
> On 14 Jul 2021, at 13:34, vignesh C wrote: > The patch does not apply on Head anymore, could you rebase and post a > patch. I'm changing the status to "Waiting for Author". As no update has been posted, the patch still doesn't apply. I'm marking this patch Returned with Feedback, feel free to

Re: [PATCH] Added TRANSFORM FOR for COMMENT tab completion

2021-11-04 Thread Ken Kato
+   else if (Matches("COMMENT", "ON", "PROCEDURAL")) +   COMPLETE_WITH("LANGUAGE"); +   else if (Matches("COMMENT", "ON", "PROCEDURAL", "LANGUAGE")) +   COMPLETE_WITH_QUERY(Query_for_list_of_languages); I don't think that there is much point in being this picky either with the usage of P

Re: Make Append Cost aware of some run time partition prune case

2021-11-04 Thread Daniel Gustafsson
> On 14 Jul 2021, at 17:55, vignesh C wrote: > The patch does not apply on Head anymore, could you rebase and post a > patch. I'm changing the status to "Waiting for Author". As the thread has stalled, this patch still doesn't apply (judging by the log it's likely not too hard to resolve). I'm

Re: Columns correlation and adaptive query optimization

2021-11-04 Thread Daniel Gustafsson
> On 14 Jul 2021, at 13:13, vignesh C wrote: > "C:\projects\postgresql\pgsql.sln" (default target) (1) -> > "C:\projects\postgresql\auto_explain.vcxproj" (default target) (45) -> > (ClCompile target) -> > contrib/auto_explain/auto_explain.c(658): error C2039: 'mt_plans' : is > not a member of 'Mo

Re: Teach pg_receivewal to use lz4 compression

2021-11-04 Thread gkokolatos
‐‐‐ Original Message ‐‐‐ On Thursday, November 4th, 2021 at 9:21 AM, Michael Paquier wrote: > On Thu, Nov 04, 2021 at 04:31:48PM +0900, Michael Paquier wrote: > Thanks. I have looked at 0001 today, and applied it after fixing a > couple of issues. Great! Thank you very much. > Fro

Re: [patch] [doc] Further note required activity aspect of automatic checkpoint and archving

2021-11-04 Thread Daniel Gustafsson
> On 18 Mar 2021, at 16:36, David Steele wrote: > Could you produce a new patch so Peter has something complete to look at? As this thread has been stalled for for a few commitfests by now I'm marking this patch as returned with feedback. Feel free to open a new entry for an updated patch. --

Re: Logical insert/update/delete WAL records for custom table AMs

2021-11-04 Thread Amit Kapila
On Thu, Nov 4, 2021 at 7:09 AM Jeff Davis wrote: > > On Wed, 2021-11-03 at 11:25 +0530, Amit Kapila wrote: > > You have modeled DecodeLogicalInsert based on current DecodeInsert > > and > > it generates the same change message, so not sure how exactly these > > new messages will be different from

Re: CREATE ROLE IF NOT EXISTS

2021-11-04 Thread Daniel Gustafsson
> On 3 Nov 2021, at 23:18, Tom Lane wrote: > I'm generally pretty down on IF NOT EXISTS semantics in all cases, > but it seems particularly dangerous for something as fundamental > to privilege checks as a role. It's not hard at all to conjure up > scenarios in which this permits privilege escal

[sqlsmith] Failed assertion in brin_minmax_multi_distance_float4 on REL_14_STABLE

2021-11-04 Thread Andreas Seltenreich
Hi, sqlsmith triggers the following assertion when testing REL_14_STABLE: TRAP: FailedAssertion("a1 <= a2", File: "brin_minmax_multi.c", Line: 1879, PID: 631814) I can reproduce it with the following query on a fresh regression database: insert into public.brintest_multi (float4col) va

Re: Map WAL segment files on PMEM as WAL buffers

2021-11-04 Thread Takashi Menjo
Hello Daniel, Thank you for your comment. I had the following error message with MSVC on Windows. It looks the same as what you told me. I'll fix it. | > cd src\tools\msvc | > build | (..snipped..) | Copying pg_config_os.h... | Generating configuration headers... | undefined symbol: HAVE_LIBPMEM

Re: Teach pg_receivewal to use lz4 compression

2021-11-04 Thread Michael Paquier
On Thu, Nov 04, 2021 at 04:31:48PM +0900, Michael Paquier wrote: > I would have expected read_size to be (readend - readp) to match with > the remaining data in the read buffer that we still need to read. > Shouldn't out_size also be LZ4_CHUNK_SZ to match with the size of the > output buffer where

Re: Data is copied twice when specifying both child and parent table in publication

2021-11-04 Thread Amit Kapila
On Thu, Nov 4, 2021 at 12:23 PM Greg Nancarrow wrote: > > On Thu, Nov 4, 2021 at 3:13 PM Amit Kapila wrote: > > > > On further thinking about this, I think we should define the behavior > > of replication among partitioned (on the publisher) and > > non-partitioned (on the subscriber) tables a bi

Re: Add proper planner support for ORDER BY / DISTINCT aggregates

2021-11-04 Thread Ronan Dunklau
Le jeudi 22 juillet 2021, 10:42:49 CET Ronan Dunklau a écrit : > Le jeudi 22 juillet 2021, 09:38:50 CEST David Rowley a écrit : > > On Thu, 22 Jul 2021 at 02:01, Ronan Dunklau wrote: > > > I tested the 0001 patch against both HEAD and my proposed bugfix for > > > postgres_fdw. > > > > > > There

Re: should we enable log_checkpoints out of the box?

2021-11-04 Thread Michael Paquier
On Tue, Nov 02, 2021 at 11:55:23AM -0400, Robert Haas wrote: > I think shipping with log_checkpoints=on and > log_autovacuum_min_duration=10m or so would be one of the best things > we could possibly do to allow ex-post-facto troubleshooting of > system-wide performance issues. The idea that users

Re: Missing include in be-secure-openssl.c?

2021-11-04 Thread Michael Paquier
On Wed, Nov 03, 2021 at 11:45:26PM -0400, Tom Lane wrote: > Yeah, I noted the comment about WIN32_LEAN_AND_MEAN in the > stackoverflow thread too ... but as you say, it seems like > that should make the problem less probable not more so. > Still, it's hard to think of any other relevant change. Ye

Re: Teach pg_receivewal to use lz4 compression

2021-11-04 Thread Michael Paquier
On Wed, Nov 03, 2021 at 09:11:24AM +, gkokola...@pm.me wrote: > Please find v9 attached. Thanks. I have looked at 0001 today, and applied it after fixing a couple of issues. From memory: - zlib.h was missing from pg_receivewal.c, issue that I noticed after removing the redefinition of Z_DEFA

Re: CREATEROLE and role ownership hierarchies

2021-11-04 Thread Shinya Kato
On 2021-10-28 07:21, Mark Dilger wrote: On Oct 25, 2021, at 10:09 PM, Shinya Kato wrote: Hi! Thank you for the patch. I too think that CREATEROLE escalation attack is problem. I have three comments. 1. Is there a function to check the owner of a role, it would be nice to be able to check wi