Re: Add WAL recovery messages with log_wal_traffic GUC (was: add recovery, backup, archive, streaming etc. activity messages to server logs along with ps display)

2022-05-16 Thread Bharath Rupireddy
On Fri, May 13, 2022 at 6:41 PM Robert Haas wrote: > > On Fri, Apr 29, 2022 at 5:11 AM Bharath Rupireddy > wrote: > > Here's the rebased v9 patch. > > This seems like it has enormous overlap with the existing > functionality that we have from log_startup_progress_interval. > > I think that

Fix a typo in walreceiver.c

2022-05-16 Thread Bharath Rupireddy
Hi, Attaching a tiny patch to fix a typo - replace primary_slotname with correct parameter name primary_slot_name in walreceiver.c code comments. Regards, Bharath Rupireddy. v1-0001-Replace-primary_slotname-with-primary_slot_name.patch Description: Binary data

Re: Skipping schema changes in publication

2022-05-16 Thread Peter Smith
On Tue, May 17, 2022 at 1:56 PM Amit Kapila wrote: > > On Tue, May 17, 2022 at 7:35 AM Peter Smith wrote: > > > > Below are my review comments for v5-0002. > > > > There may be an overlap with comments recently posted by Osumi-san [1]. > > > > (I also have review comments for v5-0002; will post

Zstandard support for toast compression

2022-05-16 Thread Michael Paquier
Hi all, Toast compression is supported for LZ4, and thanks to the refactoring work done with compression methods assigned to an attribute, adding support for more methods is straight-forward, as long as we don't support more than 4 methods as the compression ID is stored within the first 2 bits

Re: Skipping schema changes in publication

2022-05-16 Thread Amit Kapila
On Tue, May 17, 2022 at 7:35 AM Peter Smith wrote: > > Below are my review comments for v5-0002. > > There may be an overlap with comments recently posted by Osumi-san [1]. > > (I also have review comments for v5-0002; will post them tomorrow) > > == > > 1. General > > Is it really necessary

Re: Minor improvements to test log navigability

2022-05-16 Thread Tom Lane
Thomas Munro writes: > ... Admittedly that is nothing compared to the huge amount of extra log > spam caused by regression.diffs filling up with these: Yeah, that's really the main problem. > I wonder if there would be a good way to filter those "never managed > to connect" cases out... Exit

Re: Backends stunk in wait event IPC/MessageQueueInternal

2022-05-16 Thread Thomas Munro
On Mon, May 16, 2022 at 3:45 PM Japin Li wrote: > Maybe use the __illumos__ macro more accurity. > > +#elif defined(WAIT_USE_EPOLL) && defined(HAVE_SYS_SIGNALFD_H) && \ > + !defined(__sun__) Thanks, updated, and with a new commit message. I don't know much about these OSes (though I used

Re: bogus: logical replication rows/cols combinations

2022-05-16 Thread Amit Kapila
On Mon, May 16, 2022 at 6:50 PM Alvaro Herrera wrote: > > On 2022-May-16, Amit Kapila wrote: > > > > Agreed. If we can get columnlist and rowfilter from > > > pg_publication_tables, it > > > will be more convenient. And I think users that want to fetch the > > > columnlist > > > and rowfilter

RE: bogus: logical replication rows/cols combinations

2022-05-16 Thread shiy.f...@fujitsu.com
On Mon, May 16, 2022 8:34 PM houzj.f...@fujitsu.com wrote: > > Attach the new version patch. > Thanks for your patch. Here are some comments: 1. (0001 patch) /* * Returns Oids of tables in a publication. */ Datum pg_get_publication_tables(PG_FUNCTION_ARGS) Should we modify the comment of

Re: Skipping schema changes in publication

2022-05-16 Thread Peter Smith
Below are my review comments for v5-0002. There may be an overlap with comments recently posted by Osumi-san [1]. (I also have review comments for v5-0002; will post them tomorrow) == 1. General Is it really necessary to have to say "EXCEPT TABLE" instead of just "EXCEPT". It seems

Re: Condition pushdown: why (=) is pushed down into join, but BETWEEN or >= is not?

2022-05-16 Thread Andy Fan
On Tue, May 17, 2022 at 6:52 AM Thomas Munro wrote: > On Thu, Mar 24, 2022 at 3:22 PM Andy Fan wrote: > > Here is the latest code. I have rebased the code with the latest master > a1bc4d3590b. > > FYI this is failing with an unexpected plan in the partition_join test: > > >

Re: Minor improvements to test log navigability

2022-05-16 Thread Thomas Munro
On Tue, May 17, 2022 at 4:18 AM Tom Lane wrote: > Alvaro Herrera writes: > > On 2022-May-16, Thomas Munro wrote: > >> 1. It seems a bit useless to have a load of "FATAL: the database > >> system is in recovery mode" spam whenever the server crashes under > >> src/test/regress. Any reason not

Re: Minor improvements to test log navigability

2022-05-16 Thread Michael Paquier
On Mon, May 16, 2022 at 12:18:24PM -0400, Tom Lane wrote: > Andrew would have to weigh in on whether this'd break the buildfarm, > but if it doesn't, +1. FWIW, the buildfarm client feeds from the contents of the directory tmp_check/log/, so a simple renaming of the main log file would have no

has_wal_read_bug

2022-05-16 Thread Thomas Munro
027_stream_regress.pl has: if (PostgreSQL::Test::Utils::has_wal_read_bug) { # We'd prefer to use Test::More->builder->todo_start, but the bug causes # this test file to die(), not merely to fail. plan skip_all => 'filesystem bug'; } Is the die() referenced there the one from the

Re: Avoid unecessary MemSet call (src/backend/utils/cache/relcache.c)

2022-05-16 Thread David Rowley
On Sun, 15 May 2022 at 09:47, Ranier Vilela wrote: > At function load_relcache_init_file, there is an unnecessary function call, > to initialize pgstat_info pointer to NULL. > > MemSet(>pgstat_info, 0, sizeof(rel->pgstat_info)); What seems to have happened here is the field was changed to become

Re: Condition pushdown: why (=) is pushed down into join, but BETWEEN or >= is not?

2022-05-16 Thread Thomas Munro
On Thu, Mar 24, 2022 at 3:22 PM Andy Fan wrote: > Here is the latest code. I have rebased the code with the latest master > a1bc4d3590b. FYI this is failing with an unexpected plan in the partition_join test:

Re: weird comments in Memoize nodes

2022-05-16 Thread David Rowley
On Tue, 17 May 2022 at 04:21, Peter Eisentraut wrote: > Oid*collations; /* cache keys */ > Is this a mistake, or could this be clarified? Yeah, must be a copy-pasto. I'll fix it with the attached after beta1 is tagged. David diff --git a/src/include/nodes/plannodes.h

Re: JSON Functions and Operators Docs for v15

2022-05-16 Thread Alvaro Herrera
On 2022-May-16, Andrew Dunstan wrote: > Thanks. I have incorporated all of these, added a result for the last > json_table example, and done some more wordsmithing around PLAN DEFAULT. For sure this is a big improvement, thanks. No longer do we have to refer to section 9.16.3.2.2.3 -- that's in

Re: JSON Functions and Operators Docs for v15

2022-05-16 Thread Erik Rijkers
Op 16-05-2022 om 20:53 schreef Andrew Dunstan: On 2022-05-16 Mo 13:52, Erik Rijkers wrote: - 2. This example in func.sgml says it gives 't' but on my instance it returns 'f'.  Is the example correct? jsonb_path_exists_tz('["2015-08-01 12:00:00 -05"]', '$[*] ? (@.datetime() <

Re: JSON Functions and Operators Docs for v15

2022-05-16 Thread Andrew Dunstan
On 2022-05-16 Mo 14:53, Andrew Dunstan wrote: > On 2022-05-16 Mo 13:52, Erik Rijkers wrote: >> Op 16-05-2022 om 16:49 schreef Andrew Dunstan: >> >>> [sqljson-dox-rework-2.patch] >> Two issues, derived from func.sgml: >> >> - >> 1. >> >> I noticed that some json functions, for instance

Re: JSON Functions and Operators Docs for v15

2022-05-16 Thread Andrew Dunstan
On 2022-05-16 Mo 13:52, Erik Rijkers wrote: > Op 16-05-2022 om 16:49 schreef Andrew Dunstan: > >> [sqljson-dox-rework-2.patch] > > Two issues, derived from func.sgml: > > - > 1. > > I noticed that some json functions, for instance json_object(), in > their output insert unexpected spaces

Re: JSON Functions and Operators Docs for v15

2022-05-16 Thread Erik Rijkers
Op 16-05-2022 om 16:49 schreef Andrew Dunstan: [sqljson-dox-rework-2.patch] Two issues, derived from func.sgml: - 1. I noticed that some json functions, for instance json_object(), in their output insert unexpected spaces before the separator-colon: testdb=# select json_object('{a,

postgres_fdw versus regconfig and similar constants

2022-05-16 Thread Tom Lane
Bug #17483 points out that postgres_fdw falls down pretty badly when a potentially shippable clause contains a "regconfig" constant [1]. It doesn't check whether the constant refers to an object that's likely to exist on the remote side, and it fails to ensure that the printed name is properly

Re: First draft of the PG 15 release notes

2022-05-16 Thread Bruce Momjian
On Mon, May 16, 2022 at 11:02:39AM -0500, Justin Pryzby wrote: > On Mon, May 16, 2022 at 05:41:08PM +0200, Alvaro Herrera wrote: > > On 2022-May-10, Bruce Momjian wrote: > > > > > I have completed the first draft of the PG 15 release notes and you can > > > see the results here: > > > > > >

Postgres AST Deparser for Postgres

2022-05-16 Thread Dan Lynch
HI all! I wanted to share a useful tool that I built during the pandemic. One of my deepest projects I’ve created in postgres, and I’m excited to share it with the community and get ideas and feedback. I do a lot of functional programming and needed dynamic SQL. My personal belief is that ORMs

Re: [RFC] building postgres with meson -v8

2022-05-16 Thread Andres Freund
Hi, On 2022-05-16 17:47:24 +0200, Peter Eisentraut wrote: > On 12.05.22 21:30, Andres Freund wrote: > > On 2022-05-11 12:18:58 +0200, Peter Eisentraut wrote: > > > I fixed the Perl detection issue in my macOS environment that I had > > > reported > > > a while ago. > > > > Hm. I wonder if it's

Re: [RFC] building postgres with meson -v8

2022-05-16 Thread Andres Freund
On 2022-05-16 17:48:08 +0200, Peter Eisentraut wrote: > On 14.05.22 01:17, Andres Freund wrote: > > On 2022-05-11 12:18:58 +0200, Peter Eisentraut wrote: > > > This currently only works on macOS. The dtrace -G calls needed on > > > other platforms are not implemented yet. > > > > I looked into

weird comments in Memoize nodes

2022-05-16 Thread Peter Eisentraut
Consider: typedef struct Memoize { Planplan; int numKeys;/* size of the two arrays below */ Oid*hashOperators; /* hash operators for each key */ Oid*collations; /* cache keys */ List *param_exprs;/* exprs containing

Re: Minor improvements to test log navigability

2022-05-16 Thread Tom Lane
Alvaro Herrera writes: > On 2022-May-16, Thomas Munro wrote: >> 1. It seems a bit useless to have a load of "FATAL: the database >> system is in recovery mode" spam whenever the server crashes under >> src/test/regress. Any reason not to just turn that off, as we do for >> the TAP tests? > I

Re: First draft of the PG 15 release notes

2022-05-16 Thread Justin Pryzby
On Mon, May 16, 2022 at 05:41:08PM +0200, Alvaro Herrera wrote: > On 2022-May-10, Bruce Momjian wrote: > > > I have completed the first draft of the PG 15 release notes and you can > > see the results here: > > > > https://momjian.us/pgsql_docs/release-15.html > > Just to be clear --

Re: Convert macros to static inline functions

2022-05-16 Thread Alvaro Herrera
On 2022-May-16, Amul Sul wrote: > +static inline OffsetNumber > +PageGetMaxOffsetNumber(Page page) > +{ > + if (((PageHeader) page)->pd_lower <= SizeOfPageHeaderData) > + return 0; > + else > + return PageHeader) page)->pd_lower - SizeOfPageHeaderData) > / sizeof(ItemIdData));

Re: [RFC] building postgres with meson -v8

2022-05-16 Thread Peter Eisentraut
On 14.05.22 01:17, Andres Freund wrote: On 2022-05-11 12:18:58 +0200, Peter Eisentraut wrote: This currently only works on macOS. The dtrace -G calls needed on other platforms are not implemented yet. I looked into that part. The make rule passes all the backend object files as an option,

Re: [RFC] building postgres with meson -v8

2022-05-16 Thread Peter Eisentraut
On 12.05.22 21:30, Andres Freund wrote: On 2022-05-11 12:18:58 +0200, Peter Eisentraut wrote: I fixed the Perl detection issue in my macOS environment that I had reported a while ago. Hm. I wonder if it's right to check with is_file() - perhaps there are platforms that have split off the

Re: Minor improvements to test log navigability

2022-05-16 Thread Alvaro Herrera
On 2022-May-16, Thomas Munro wrote: > 1. It seems a bit useless to have a load of "FATAL: the database > system is in recovery mode" spam whenever the server crashes under > src/test/regress. Any reason not to just turn that off, as we do for > the TAP tests? I don't know of any. Let's. >

Re: First draft of the PG 15 release notes

2022-05-16 Thread Alvaro Herrera
On 2022-May-10, Bruce Momjian wrote: > I have completed the first draft of the PG 15 release notes and you can > see the results here: > > https://momjian.us/pgsql_docs/release-15.html Just to be clear -- 15beta1 will be released with the "new features and enhancements" list as empty,

Re: removing datlastsysoid

2022-05-16 Thread David Steele
On 5/16/22 11:19 AM, Alvaro Herrera wrote: On 2022-May-16, David Steele wrote: On 5/16/22 10:26 AM, Tom Lane wrote: I think that when we approach the point where the system OID range is saturated, we'll give up the principle of system OIDs being globally unique instead of doing that.

Re: Remove support for Visual Studio 2013

2022-05-16 Thread Tom Lane
Michael Paquier writes: > On Mon, May 16, 2022 at 08:46:31PM +1200, Thomas Munro wrote: >> Looking at the published lifecycle info, 2017 is the oldest still in >> 'mainstream' support[4], so it wouldn't be too crazy to drop VS 2015 >> too, just like those other projects. That said, it sounds

Re: removing datlastsysoid

2022-05-16 Thread Alvaro Herrera
On 2022-May-16, David Steele wrote: > On 5/16/22 10:26 AM, Tom Lane wrote: > > I think that when we approach the point where the system OID range > > is saturated, we'll give up the principle of system OIDs being > > globally unique instead of doing that. There's no fundamental > > reason why

Re: gitmaster access

2022-05-16 Thread Stephen Frost
Greetings, * Tatsuo Ishii (is...@sraoss.co.jp) wrote: > > * Tom Lane (t...@sss.pgh.pa.us) wrote: > >> Bruce Momjian writes: > >> > On Wed, May 11, 2022 at 08:59:26PM -0400, Bruce Momjian wrote: > >> >> On Thu, May 12, 2022 at 09:04:38AM +0900, Tatsuo Ishii wrote: > >> >>> The last line should be

Re: removing datlastsysoid

2022-05-16 Thread David Steele
On 5/16/22 10:26 AM, Tom Lane wrote: Dave Page writes: On Mon, 16 May 2022 at 15:06, David Steele wrote: Out solution was to use the constant: #define FirstNormalObjectId 16384 And treat anything below that as a system oid. This constant has not changed in a very long time

Re: removing datlastsysoid

2022-05-16 Thread Tom Lane
Dave Page writes: > On Mon, 16 May 2022 at 15:06, David Steele wrote: >> Out solution was to use the constant: >> >> #define FirstNormalObjectId 16384 >> >> And treat anything below that as a system oid. This constant has not >> changed in a very long time (if ever) but we added it

Re: First draft of the PG 15 release notes

2022-05-16 Thread Bruce Momjian
On Mon, May 16, 2022 at 10:09:18AM -0400, Bruce Momjian wrote: > On Mon, May 16, 2022 at 01:21:22PM +0700, John Naylor wrote: > > Hi Bruce, > > > > "Improve validation of ASCII and UTF-8 text by processing 16 bytes at > > a time (John Naylor)" > > > > The reader might assume here that ASCII is

Re: removing datlastsysoid

2022-05-16 Thread Dave Page
On Mon, 16 May 2022 at 15:06, David Steele wrote: > On 5/16/22 9:43 AM, Dave Page wrote: > > > > > > On Thu, 20 Jan 2022 at 14:03, Robert Haas > > wrote: > > > > On Mon, Jan 17, 2022 at 3:43 PM Tom Lane > > wrote: > > > +1.

Re: First draft of the PG 15 release notes

2022-05-16 Thread Bruce Momjian
On Mon, May 16, 2022 at 01:21:22PM +0700, John Naylor wrote: > Hi Bruce, > > "Improve validation of ASCII and UTF-8 text by processing 16 bytes at > a time (John Naylor)" > > The reader might assume here that ASCII is optimized regardless of > encoding, but it is only optimized in the context of

Re: removing datlastsysoid

2022-05-16 Thread David Steele
On 5/16/22 9:43 AM, Dave Page wrote: On Thu, 20 Jan 2022 at 14:03, Robert Haas > wrote: On Mon, Jan 17, 2022 at 3:43 PM Tom Lane mailto:t...@sss.pgh.pa.us>> wrote: > +1.  Another reason to get rid of it is that it has nothing to do > with the

Re: removing datlastsysoid

2022-05-16 Thread Dave Page
On Thu, 20 Jan 2022 at 14:03, Robert Haas wrote: > On Mon, Jan 17, 2022 at 3:43 PM Tom Lane wrote: > > +1. Another reason to get rid of it is that it has nothing to do > > with the system OID ranges defined in access/transam.h. > > Agreed. Thanks for looking. Committed. > So we just ran into

Re: make MaxBackends available in _PG_init

2022-05-16 Thread Robert Haas
On Sun, May 15, 2022 at 8:58 AM Julien Rouhaud wrote: > For the record I submitted patches or pull requests this weekend for all > repositories I was aware of to fix the compatibility with this patch, hoping > that it will save some time to the packagers when they will take care of the > beta.

Re: Convert macros to static inline functions

2022-05-16 Thread Amul Sul
On Mon, May 16, 2022 at 1:58 PM Peter Eisentraut wrote: > > > Inspired by [0], I looked to convert more macros to inline functions. > The attached patches are organized "bottom up" in terms of their API > layering; some of the later ones depend on some of the earlier ones. > All the patches look

Re: bogus: logical replication rows/cols combinations

2022-05-16 Thread Alvaro Herrera
On 2022-May-16, Amit Kapila wrote: > > Agreed. If we can get columnlist and rowfilter from pg_publication_tables, > > it > > will be more convenient. And I think users that want to fetch the columnlist > > and rowfilter of table can also benefit from it. > > After the change for this, we will

RE: bogus: logical replication rows/cols combinations

2022-05-16 Thread houzj.f...@fujitsu.com
On Monday, May 16, 2022 2:10 PM Amit Kapila > > On Fri, May 13, 2022 at 11:32 AM houzj.f...@fujitsu.com > wrote: > > > > On Thursday, May 12, 2022 2:45 PM Amit Kapila > wrote: > > > > > > On Wed, May 11, 2022 at 12:55 PM houzj.f...@fujitsu.com > > > wrote: > > > > > > Few comments: > > >

Re: Remove support for Visual Studio 2013

2022-05-16 Thread Andrew Dunstan
On 2022-05-16 Mo 06:34, Michael Paquier wrote: > On Mon, May 16, 2022 at 08:46:31PM +1200, Thomas Munro wrote: >> Looking at the published lifecycle info, 2017 is the oldest still in >> 'mainstream' support[4], so it wouldn't be too crazy to drop VS 2015 >> too, just like those other projects.

Re: Make relfile tombstone files conditional on WAL level

2022-05-16 Thread Dilip Kumar
On Mon, May 16, 2022 at 3:24 PM Thomas Munro wrote: > > I think you can get rid of SYNC_UNLINK_REQUEST, sync_unlinkfiletag, > mdunlinkfiletag as these are all now unused. Correct. > Are there any special hazards here if the plan in [1] goes ahead? IMHO we should not have any problem. In fact,

Re: Remove support for Visual Studio 2013

2022-05-16 Thread Michael Paquier
On Mon, May 16, 2022 at 08:46:31PM +1200, Thomas Munro wrote: > Looking at the published lifecycle info, 2017 is the oldest still in > 'mainstream' support[4], so it wouldn't be too crazy to drop VS 2015 > too, just like those other projects. That said, it sounds like there > is no practical

Re: Make relfile tombstone files conditional on WAL level

2022-05-16 Thread Thomas Munro
I think you can get rid of SYNC_UNLINK_REQUEST, sync_unlinkfiletag, mdunlinkfiletag as these are all now unused. Are there any special hazards here if the plan in [1] goes ahead? If the relfilenode allocation is logged and replayed then it should be fine to crash and recover multiple times in a

Re: Skipping schema changes in publication

2022-05-16 Thread Peter Smith
Below are my review comments for v5-0001. There is some overlap with comments recently posted by Osumi-san [1]. (I also have review comments for v5-0002; will post them tomorrow) == 1. Commit message This patch adds a new RESET clause to ALTER PUBLICATION which will reset the publication

Re: Remove support for Visual Studio 2013

2022-05-16 Thread Thomas Munro
On Mon, May 16, 2022 at 6:58 PM Michael Paquier wrote: > Cutting support for now-unsupported versions of Windows is in the air > for a couple of months, and while looking at the code a first cleanup > that looked rather obvious to me is the removal of support for VS > 2013, as of something to do

RE: Skipping schema changes in publication

2022-05-16 Thread osumi.takami...@fujitsu.com
On Saturday, May 14, 2022 10:33 PM vignesh C wrote: > Thanks for the comments, the attached v5 patch has the changes for the same. > Also I have made the changes for SKIP Table based on the new syntax, the > changes for the same are available in >

Convert macros to static inline functions

2022-05-16 Thread Peter Eisentraut
Inspired by [0], I looked to convert more macros to inline functions. The attached patches are organized "bottom up" in terms of their API layering; some of the later ones depend on some of the earlier ones. Note 1: Some macros that do by-value assignments like #define

Re: RFC: Logging plan of the running query

2022-05-16 Thread torikoshia
On 2022-03-09 19:04, torikoshia wrote: On 2022-02-08 01:13, Fujii Masao wrote: AbortSubTransaction() should reset ActiveQueryDesc to save_ActiveQueryDesc that ExecutorRun() set, instead of NULL? Otherwise ActiveQueryDesc of top-level statement will be unavailable after subtransaction is aborted

Remove support for Visual Studio 2013

2022-05-16 Thread Michael Paquier
Hi all, Cutting support for now-unsupported versions of Windows is in the air for a couple of months, and while looking at the code a first cleanup that looked rather obvious to me is the removal of support for VS 2013, as of something to do for v16~. The website of Microsoft has only

Re: First draft of the PG 15 release notes

2022-05-16 Thread John Naylor
Hi Bruce, "Improve validation of ASCII and UTF-8 text by processing 16 bytes at a time (John Naylor)" The reader might assume here that ASCII is optimized regardless of encoding, but it is only optimized in the context of UTF-8. So I would just mention UTF-8. Thanks! -- John Naylor EDB:

Re: bogus: logical replication rows/cols combinations

2022-05-16 Thread Amit Kapila
On Fri, May 13, 2022 at 11:32 AM houzj.f...@fujitsu.com wrote: > > On Thursday, May 12, 2022 2:45 PM Amit Kapila wrote: > > > > On Wed, May 11, 2022 at 12:55 PM houzj.f...@fujitsu.com > > wrote: > > > > Few comments: > > === > > 1. > > initStringInfo(); > > -

Re: pgbench --partitions=0

2022-05-16 Thread Michael Paquier
On Mon, May 16, 2022 at 02:44:47PM +0900, Amit Langote wrote: > Sounds good to me. (I have added an open item, just in case.) -- Michael signature.asc Description: PGP signature