Re: [PATCH] Add reloption for views to enable RLS

2022-02-15 Thread walther
Laurenz Albe: So even though the view owner "duff" has no permissions on the schema "viewtest", we can still select from the table. Permissions on the schema containing the table are not checked, only permissions on the table itself. I am not sure how to feel about this. It is not what I would

Re: [PATCH] Add reloption for views to enable RLS

2022-02-15 Thread walther
Christoph Heiss: xxx_owner=true would be the default and xxx_owner=false could be set explicitly to get the behavior we are looking for in this patch? I'm not sure if an option which is on by default would be best, IMHO. I would rather have an off-by-default option, so that you explicitly have

Re: logical decoding and replication of sequences

2022-02-15 Thread Peter Eisentraut
On 13.02.22 14:10, Tomas Vondra wrote: Here's the remaining part, rebased, with a small tweak in the TAP test to eliminate the issue with not waiting for sequence increments. I've kept the tweak in a separate patch, so that we can throw it away easily if we happen to resolve the issue. This bas

Re: On login trigger: take three

2022-02-15 Thread Greg Nancarrow
On Mon, Jan 24, 2022 at 1:59 PM Greg Nancarrow wrote: > > I've attached a re-based version (no functional changes from the > previous) to fix cfbot failures. > I've attached a re-based version (no functional changes from the previous) to fix cfbot failures. Regards, Greg Nancarrow Fujitsu Austra

Re: fixing bookindex.html bloat

2022-02-15 Thread Peter Eisentraut
On 15.02.22 00:06, Andres Freund wrote: On 2022-02-14 23:06:20 +0100, Peter Eisentraut wrote: The attached patch cleans up the xhtml namespace declarations properly, I think. Looks good to me. For the xlink business, I don't have a better idea than you, so your workaround proposal seems fin

Re: pg_receivewal.exe unhandled exception in zlib1.dll

2022-02-15 Thread Juan José Santamaría Flecha
On Mon, Feb 14, 2022 at 7:31 AM Michael Paquier wrote: > On Fri, Feb 11, 2022 at 07:50:44AM -0800, Andres Freund wrote: > > > I hit this as well. The problem is really caused by using a debug build > of > > postgres vs a production build of zlib. The use different C runtimes, > with > > different

Re: Skipping logical replication transactions on subscriber side

2022-02-15 Thread Peter Eisentraut
On 14.02.22 10:16, Amit Kapila wrote: I think exposing LSN is a better approach as it doesn't have the dangers of wraparound. And, I think users can use it with the existing function pg_replication_origin_advance() which will save us from adding additional code for this feature. We can explain/ex

Re: Postgres 14.2 Windows can't rename temporary statistics file

2022-02-15 Thread Ranier Vilela
Em seg., 14 de fev. de 2022 às 22:58, Thomas Munro escreveu: > On Tue, Feb 15, 2022 at 2:09 PM Ranier Vilela wrote: > > Em seg., 14 de fev. de 2022 às 21:58, Justin Pryzby < > pry...@telsasoft.com> escreveu: > >> On Mon, Feb 14, 2022 at 09:19:54PM -0300, Ranier Vilela wrote: > >> > I've reported

Re: Fix overflow in justify_interval related functions

2022-02-15 Thread Joseph Koshakow
On Mon, Feb 14, 2022 at 11:23 PM Nathan Bossart wrote: > It's a little weird > that justify_hours() and justify_days() can overflow in cases where there > is still a valid interval representation, but as Tom noted, those functions > have specific charters to follow. Yes it is a bit weird, but thi

Re: Fix overflow in DecodeInterval

2022-02-15 Thread Joseph Koshakow
On Sun, Feb 13, 2022 at 5:12 PM Joseph Koshakow wrote: > > Attached is a new version switching from ints to bools, as requested. > > - Joe Koshakow Tom, Andres, Thanks for your feedback! I'm not super familiar with the process, should I submit this thread to the commitfest or just leave it as is

Re: [Proposal] Fully WAL logged CREATE DATABASE - No Checkpoints

2022-02-15 Thread Dilip Kumar
On Tue, Feb 15, 2022 at 2:01 AM Maciek Sakrejda wrote: > Here is the updated version of the patch, the changes are 1) Fixed review comments given by Robert and one open comment from Ashutosh. 2) Preserved the old create db method. 3) As agreed upthread for now we are using the new strategy only fo

Re: Ensure that STDERR is empty during connect_ok

2022-02-15 Thread Daniel Gustafsson
> On 6 Feb 2022, at 08:00, Michael Paquier wrote: > > On Wed, Feb 02, 2022 at 03:40:39PM +0100, Daniel Gustafsson wrote: >> As part of the NSS patchset, quite a few bugs (and NSS quirks) were found by >> inspecting STDERR in connect_ok and require it to be empty. This is not >> really >> NSS sp

Re: [PATCH] Add reloption for views to enable RLS

2022-02-15 Thread Christoph Heiss
Hi, On 2/15/22 09:37, walt...@technowledgy.de wrote: Christoph Heiss: xxx_owner=true would be the default and xxx_owner=false could be set explicitly to get the behavior we are looking for in this patch? I'm not sure if an option which is on by default would be best, IMHO. I would rather hav

RE: [Proposal] Add foreign-server health checks infrastructure

2022-02-15 Thread kuroda.hay...@fujitsu.com
Dear Hackers, I found patches we depend have been committed, so rebased. https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=50e570a59e7f86bb41f029a66b781fc79b8d50f1 In this version there is a little bit change in part of postgres_fdw. A system checking by WaitEventSetCanReportClosed()

Re: Report checkpoint progress with pg_stat_progress_checkpoint (was: Report checkpoint progress in server logs)

2022-02-15 Thread Nitin Jadhav
> Apart from above fields, I am planning to add few more fields to the > view in the next patch. That is, process ID of the backend process > which triggered a CHECKPOINT command, checkpoint start location, filed > to indicate whether it is a checkpoint or restartpoint and elapsed > time of the che

[PATCH] Fix out-of-bouds access (src/common/wchar.c)

2022-02-15 Thread Ranier Vilela
Hi, Per Coverity. Like the function pg_encoding_max_length_sql (src/backend/utils/mb/mbutils.c) Only assertion is insufficient to avoid accessing array out-of-bounds. This bug is live according Coverity at function: pg_verify_mbstr_len (src/backend/utils/mb/mbutils.c) CID 1469870 (#1 of 1): Out-

Re: Observability in Postgres

2022-02-15 Thread Dave Page
Hi Greg, On Mon, 14 Feb 2022 at 20:16, Greg Stark wrote: > So I've been dealing a lot with building and maintaining dashboards > for (fleets of) Postgres servers. And it's a pain. I have a few > strongly held ideas about where the pain points are and what the right > ways to tackle them are. Som

Re: OpenSSL conflicts with wincrypt.h

2022-02-15 Thread Juan José Santamaría Flecha
On Fri, Feb 11, 2022 at 4:36 PM Tom Lane wrote: > =?UTF-8?Q?Juan_Jos=C3=A9_Santamar=C3=ADa_Flecha?= < > juanjo.santama...@gmail.com> writes: > > There is a comment in 'src/backend/libpq/be-secure-openssl.c' addressing > > this issue, but I have to explicitly undefine X509_NAME. Please find > > at

Re: refactoring basebackup.c

2022-02-15 Thread Jeevan Ladhe
Hi, Please find the attached updated version of patch for ZSTD server side compression. This patch has following changes: - Fixes the issue Tushar reported[1]. - Adds a tap test. - Makes document changes related to zstd. - Updates pg_basebackup help for pg_basebackup. Here I have chosen the sugg

Re: OpenSSL conflicts with wincrypt.h

2022-02-15 Thread Daniel Gustafsson
> On 15 Feb 2022, at 14:12, Juan José Santamaría Flecha > wrote: > After has been included, any inclusion of > will be troublesome. Not that it changes anything here, but FTR: in OpenSSL 3.0.0 and onwards this undef has been moved to -- Daniel Gustafsson https://vmware.com

Re: [PATCH] Add reloption for views to enable RLS

2022-02-15 Thread Laurenz Albe
On Tue, 2022-02-15 at 13:02 +0100, Christoph Heiss wrote: > > > > I converted the option to run_as_owner=true|false in the attached v7. > It now definitely seems like the right way to move forward and getting > more feedback. I think we are straying from the target. "run_as_owner" seems wrong

Re: Mark all GUC variable as PGDLLIMPORT

2022-02-15 Thread Robert Haas
On Mon, Feb 14, 2022 at 8:53 PM Andres Freund wrote: > > An alternative rule which would dodge that particular issue would be > > to just slap PGDLLIMPORT on every global variable in every header > > file. That would arguably be a simpler rule, though it means even more > > PGDLLIMPORT declaration

Re: Observability in Postgres

2022-02-15 Thread Joe Conway
On 2/15/22 07:30, Dave Page wrote: On Mon, 14 Feb 2022 at 20:16, Greg Stark > wrote: So I've been dealing a lot with building and maintaining dashboards for (fleets of) Postgres servers. And it's a pain. I have a few strongly held ideas about where the pain poin

Re: do only critical work during single-user vacuum?

2022-02-15 Thread Robert Haas
On Tue, Feb 15, 2022 at 1:04 AM John Naylor wrote: > Well, the point of inventing this new vacuum mode was because I > thought that upon reaching xidStopLimit, we couldn't issue commands, > period, under the postmaster. If it was easier to get a test instance > to xidStopLimit, I certainly would h

Re: bailing out in tap tests nearly always a bad idea

2022-02-15 Thread Andrew Dunstan
On 2/14/22 12:58, Tom Lane wrote: > Andres Freund writes: >> Even just getting rid of the "Tests were run but no plan was declared and >> done_testing() was not seen." noise would be helpful. So I think using a >> fatal >> error routine that forced a failure to be recognized via ok(0, 'fatal er

Re: Make mesage at end-of-recovery less scary.

2022-02-15 Thread Ashutosh Sharma
On Tue, Feb 15, 2022 at 7:52 AM Kyotaro Horiguchi wrote: > > At Mon, 14 Feb 2022 20:14:11 +0530, Ashutosh Sharma > wrote in > > No, I haven't tried to compare archive recovery to PITR or vice versa, > > instead I was trying to compare crash recovery with PITR. The message > > you're emitting say

Re: How did queensnake corrupt zic.o?

2022-02-15 Thread Filipe Rosset
hi guys, I had to disable ccache on queensnake, all builds are fine right now. Let's see how it goes. due OS migration on queensnake (scientific linux -> centos -> rocky linux) I think it's time to decommission the queensnake and request a new animal for a new server, maybe. On Mon, Feb 14, 2022,

Re: Identify missing publications from publisher while create/alter subscription.

2022-02-15 Thread Ashutosh Sharma
Thanks for working on the review comments. The changes in the new patch look good to me. I am marking it as ready to commit. -- With Regards, Ashutosh Sharma. On Sun, Feb 13, 2022 at 7:34 PM vignesh C wrote: > > On Fri, Feb 11, 2022 at 7:14 PM Ashutosh Sharma wrote: > > > > I have spent little

Re: [PATCH] Add reloption for views to enable RLS

2022-02-15 Thread walther
Laurenz Albe: I converted the option to run_as_owner=true|false in the attached v7. It now definitely seems like the right way to move forward and getting more feedback. I think we are straying from the target. "run_as_owner" seems wrong to me, because it is all about permission checking and*no

Re: fairywren is generating bogus BASE_BACKUP commands

2022-02-15 Thread Andrew Dunstan
On 2/14/22 18:02, Andres Freund wrote: > Hi, > > On 2022-02-14 17:32:11 -0500, Andrew Dunstan wrote: >> About the only thing missing in your recipe is this: > Re requiring out-of-tree builds: Thomas on IM noted that there's the > NoDefaultCurrentDirectoryInExePath environment variable. That shoul

Re: fairywren is generating bogus BASE_BACKUP commands

2022-02-15 Thread Andrew Dunstan
On 2/14/22 17:37, Andres Freund wrote: > On 2022-02-14 17:32:11 -0500, Andrew Dunstan wrote: >> Working on that. There appear to be some issues with third party >> libraries. I might need to rebuild libxml2 and zlib for example. > Any reason not to use the ones from msys2? That seems to work.

Re: [PATCH] Add reloption for views to enable RLS

2022-02-15 Thread Laurenz Albe
On Tue, 2022-02-15 at 16:07 +0100, walt...@technowledgy.de wrote: > Laurenz Albe: > > > I converted the option to run_as_owner=true|false in the attached v7. > > > It now definitely seems like the right way to move forward and getting > > > more feedback. > > I think we are straying from the target

Re: [PATCH] Add reloption for views to enable RLS

2022-02-15 Thread walther
Laurenz Albe: I'd be happy with "check_as_owner", except it is unclear *what* is checked. Yeah, that could be associated with WITH CHECK OPTION, too, as in "do the CHECK OPTION stuff as the owner". "check_permissions_as_owner" is ok with me, but a bit long. check_permissions_as_owner is e

Re: pgsql: Move scanint8() to numutils.c

2022-02-15 Thread Joe Conway
On 2/14/22 16:18, Peter Eisentraut wrote: Move scanint8() to numutils.c Move scanint8() to numutils.c and rename to pg_strtoint64(). We already have a "16" and "32" version of that, and the code inside the functions was aligned, so this move makes all three versions consistent. The API is also

Re: Mark all GUC variable as PGDLLIMPORT

2022-02-15 Thread Andres Freund
Hi, On 2022-02-15 08:58:05 -0500, Robert Haas wrote: > On Mon, Feb 14, 2022 at 8:53 PM Andres Freund wrote: > > > An alternative rule which would dodge that particular issue would be > > > to just slap PGDLLIMPORT on every global variable in every header > > > file. That would arguably be a simpl

Re: How did queensnake corrupt zic.o?

2022-02-15 Thread Andres Freund
Hi, On 2022-02-15 10:00:45 -0300, Filipe Rosset wrote: > I had to disable ccache on queensnake, all builds are fine right now. Let's > see how it goes. > due OS migration on queensnake (scientific linux -> centos -> rocky linux) > I think it's time to decommission the queensnake and request a new

Re: Time to increase hash_mem_multiplier default?

2022-02-15 Thread Justin Pryzby
On Mon, Feb 14, 2022 at 10:32:43PM -0800, Peter Geoghegan wrote: > On Wed, Jan 19, 2022 at 11:32 AM John Naylor > wrote: > > I don't have anything really profound to say here, but in the last > > year I did on a couple occasions recommend clients to raise > > hash_mem_multiplier to 2.0 to fix perf

Re: pg_receivewal.exe unhandled exception in zlib1.dll

2022-02-15 Thread Andres Freund
Hi, On 2022-02-15 11:21:42 +0100, Juan José Santamaría Flecha wrote: > Building with a mix of debug and release components is not a good practice > for issues like this, but is not something that MSVC forbids. It's not a problem if you never need share memory, file descriptors, locales, ... state

Re: Design of pg_stat_subscription_workers vs pgstats

2022-02-15 Thread Andres Freund
Hi, On 2022-02-03 14:35:10 +0900, Masahiko Sawada wrote: > Yes, but if we use shmem IPC, we need to allocate shared memory for > them based on the number of subscriptions, not logical replication > workers (i.e., max_logical_replication_workers). So we cannot estimate > memory in the beginning. Al

Re: refactoring basebackup.c

2022-02-15 Thread Robert Haas
On Wed, Feb 9, 2022 at 8:41 AM Abhijit Menon-Sen wrote: > It took me a while to assimilate these patches, including the backup > targets one, which I hadn't looked at before. Now that I've wrapped my > head around how to put the pieces together, I really like the idea. As > you say, writing non-tr

Re: Fix overflow in DecodeInterval

2022-02-15 Thread Andres Freund
Hi, On 2022-02-15 06:44:40 -0500, Joseph Koshakow wrote: > Thanks for your feedback! I'm not super familiar with the process, > should I submit this thread to the commitfest or just leave it as is? Submit it to the CF - then we get an automatic test on a few platforms. I think we can apply it qui

Re: refactoring basebackup.c

2022-02-15 Thread tushar
On 2/15/22 6:48 PM, Jeevan Ladhe wrote: Please find the attached updated version of patch for ZSTD server side Thanks, Jeevan, I again tested with the attached patch, and as mentioned the crash is fixed now. also, I tested with different labels with gzip V/s zstd against data directory size w

Re: Replication slot drop message is sent after pgstats shutdown.

2022-02-15 Thread Andres Freund
Hi, On 2022-02-15 14:07:26 +0900, Masahiko Sawada wrote: > On Tue, Feb 15, 2022 at 12:09 PM Kyotaro Horiguchi > wrote: > > FWIW I agree to the proposed test on the direction. > > +1 Pushed the test yesterday evening, after Tom checked if it is likely to be problematic. Seems to worked without

Re: Avoid erroring out when unable to remove or parse logical rewrite files to save checkpoint work

2022-02-15 Thread Andres Freund
Hi, On 2022-02-10 21:30:45 +0530, Bharath Rupireddy wrote: > From 4801ff2c3b1e7bc7076205b676d4e3bc4a4ed308 Mon Sep 17 00:00:00 2001 > From: Bharath Rupireddy > Date: Thu, 10 Feb 2022 15:58:58 + > Subject: [PATCH v8] Replace ReadDir with ReadDirExtended > > Replace ReadDir with ReadDirExtende

Re: Mark all GUC variable as PGDLLIMPORT

2022-02-15 Thread Julien Rouhaud
Hi, On Mon, Feb 14, 2022 at 12:45:08PM -0500, Robert Haas wrote: > On Mon, Feb 14, 2022 at 12:34 PM Tom Lane wrote: > > > * There's a moderately sizable subset of GUCs where the underlying > > variable is not visible at all because it's static in guc.c. > > Typically this is because that variabl

Re: Mark all GUC variable as PGDLLIMPORT

2022-02-15 Thread Bruce Momjian
On Wed, Feb 16, 2022 at 01:10:50AM +0800, Julien Rouhaud wrote: > Hi, > > On Mon, Feb 14, 2022 at 12:45:08PM -0500, Robert Haas wrote: > > On Mon, Feb 14, 2022 at 12:34 PM Tom Lane wrote: > > > > > * There's a moderately sizable subset of GUCs where the underlying > > > variable is not visible a

Re: Mark all GUC variable as PGDLLIMPORT

2022-02-15 Thread Julien Rouhaud
Hi, Sorry for taking so much time to answer here. I definitely wanted to work on that but I was under the impression that although we now had an agreement to apply PGDLLIMPORT globally a patch itself wasn't really rushed, so I spent the last two days trying to setup a new Windows environment as m

Re: do only critical work during single-user vacuum?

2022-02-15 Thread Peter Geoghegan
On Mon, Feb 14, 2022 at 10:04 PM John Naylor wrote: > Well, the point of inventing this new vacuum mode was because I > thought that upon reaching xidStopLimit, we couldn't issue commands, > period, under the postmaster. If it was easier to get a test instance > to xidStopLimit, I certainly would

Re: Refactor CheckpointWriteDelay()

2022-02-15 Thread Nitin Jadhav
> Given that CheckpointWriteDelay() is really a hot code path i.e. gets > called for every dirty buffer written to disk, here's an opportunity > for us to improve it by avoiding some function calls. I have reviewed the patch and I agree that the patch improves the code. > Firstly, the AmCheckpoin

Re: Avoid erroring out when unable to remove or parse logical rewrite files to save checkpoint work

2022-02-15 Thread Nathan Bossart
On Tue, Feb 15, 2022 at 09:09:52AM -0800, Andres Freund wrote: > On 2022-02-10 21:30:45 +0530, Bharath Rupireddy wrote: >> Replace ReadDir with ReadDirExtended (in CheckPointSnapBuild) and >> get rid of lstat entirely. > > I think this might be based on a slight misunderstanding / bad phrasing on

Re: refactoring basebackup.c (zstd)

2022-02-15 Thread Justin Pryzby
+++ b/configure @@ -801,6 +805,7 @@ infodir docdir oldincludedir includedir +runstatedir There's superfluous changes to ./configure unrelated to the changes in configure.ac. Probably because you're using a different version of autotools, or a vendor's patched copy. You can remove the changes

Re: refactoring basebackup.c

2022-02-15 Thread Jeevan Ladhe
Thanks Tushar for the testing. I further worked on ZSTD and now have implemented client side compression as well. Attached are the patches for both server-side and client-side compression. The patch 0001 is a server-side patch, and has not changed since the last patch version - v10, but, just bum

Re: Avoid erroring out when unable to remove or parse logical rewrite files to save checkpoint work

2022-02-15 Thread Andres Freund
Hi, On 2022-02-15 09:57:53 -0800, Nathan Bossart wrote: > IIUC you are advocating for something more like the attached patches. At least for patch 1 yes. Don't have the cycles just now to look at the others. I generally think it'd be a good exercise to go through an use get_dirent_type() in near

Re: Design of pg_stat_subscription_workers vs pgstats

2022-02-15 Thread Andres Freund
Hi, On 2022-02-04 09:23:06 +0530, Amit Kapila wrote: > On Thu, Feb 3, 2022 at 3:25 PM Peter Eisentraut > wrote: > > > > On 02.02.22 07:54, Amit Kapila wrote: > > > > > Sure, but is this the reason you want to store all the error info in > > > the system catalog? I agree that providing more error

adding 'zstd' as a compression algorithm

2022-02-15 Thread Robert Haas
Hi, Over on the rather-long "refactoring basebackup.c" thread, there is a proposal, which I endorse, to add base-backup compression via zstd. To do that, we'd need to patch configure.ac to create a new --with-zstd flag and appropriate supporting infrastructure. My colleague Jeevan Ladhe included t

Re: Design of pg_stat_subscription_workers vs pgstats

2022-02-15 Thread Andres Freund
Hi, On 2022-02-03 13:33:08 +0900, Masahiko Sawada wrote: > I see that important information such as error-XID that can be used > for ALTER SUBSCRIPTION SKIP needs to be stored in a reliable way, and > using system catalogs is a reasonable way for this purpose. But it's > still unclear to me why al

Re: Design of pg_stat_subscription_workers vs pgstats

2022-02-15 Thread Robert Haas
On Thu, Jan 27, 2022 at 12:46 AM Andres Freund wrote: > Only if either the user wants to drop all stats, or somehow knows the oids of > already dropped tables... If it's really true that we can end up storing data for dropped objects, I think that's not acceptable and needs to be fixed. I don't

Re: Avoid erroring out when unable to remove or parse logical rewrite files to save checkpoint work

2022-02-15 Thread Nathan Bossart
On Tue, Feb 15, 2022 at 10:10:34AM -0800, Andres Freund wrote: > I generally think it'd be a good exercise to go through an use > get_dirent_type() in nearly all ReadDir() style loops - it's a nice efficiency > win in general, and IIRC a particularly big one on windows. > > It'd probably be good t

Re: pgsql: Move scanint8() to numutils.c

2022-02-15 Thread Robert Haas
On Tue, Feb 15, 2022 at 10:39 AM Joe Conway wrote: > (moving to hackers) > > I guess shame on me for not noticing the thread, but I don't see any > discussion about the potential for breakage to external projects. > > scanint8() is exported, and this change breaks at least two extensions I > maint

Re: Lowering the ever-growing heap->pd_lower

2022-02-15 Thread Matthias van de Meent
On Thu, 2 Dec 2021 at 11:17, Daniel Gustafsson wrote: > > This thread has stalled, and the request for benchmark/test has gone > unanswered > so I'm marking this patch Returned with Feedback. Please feel free to > resubmit > this patch if it is picked up again. Well then, here we go. It took m

Re: adding 'zstd' as a compression algorithm

2022-02-15 Thread Justin Pryzby
I think the WAL patch (4035cd5d4) should support zstd if library support is added. A supplementary patch for that already exists. https://www.postgresql.org/message-id/ynqwd2gsmrnqw...@paquier.xyz There's also some in-progress patches: - Konstantin and Daniil have a patch to add libpq compressi

Re: pgsql: Move scanint8() to numutils.c

2022-02-15 Thread Joe Conway
On 2/15/22 13:47, Robert Haas wrote: On Tue, Feb 15, 2022 at 10:39 AM Joe Conway wrote: (moving to hackers) I guess shame on me for not noticing the thread, but I don't see any discussion about the potential for breakage to external projects. scanint8() is exported, and this change breaks at

Re: pgsql: Move scanint8() to numutils.c

2022-02-15 Thread Tom Lane
Robert Haas writes: > On Tue, Feb 15, 2022 at 10:39 AM Joe Conway wrote: >> scanint8() is exported, and this change breaks at least two extensions I >> maintain. > I don't have a particularly strong view on whether the underlying > change was a good idea here, but the breakage you're talking abo

Re: pg_walinspect - a new extension to get raw WAL data and WAL stats

2022-02-15 Thread Bharath Rupireddy
On Mon, Feb 14, 2022 at 8:32 PM Ashutosh Sharma wrote: > > Here are few comments: Thanks for reviewing the patches. > +/* > + * Verify the authenticity of the given raw WAL record. > + */ > +Datum > +pg_verify_raw_wal_record(PG_FUNCTION_ARGS) > +{ > > > Do we really need this function? I see tha

Re: adding 'zstd' as a compression algorithm

2022-02-15 Thread Peter Geoghegan
On Tue, Feb 15, 2022 at 10:20 AM Robert Haas wrote: > In general, deciding on new compression algorithms can feel a bit like > debating the merits of vi vs. emacs, or one political party vs. > another. Really? I don't get that impression myself. (That's not important, though.) > What I imagine i

Re: adding 'zstd' as a compression algorithm

2022-02-15 Thread Andres Freund
Hi, On 2022-02-15 11:40:20 -0800, Peter Geoghegan wrote: > On Tue, Feb 15, 2022 at 10:20 AM Robert Haas wrote: > > Likewise, I still download the .tar.gz version of anything > > that gives me that option, basically because I'm familiar with the > > format and it's easy for me to just carry on usi

Re: adding 'zstd' as a compression algorithm

2022-02-15 Thread Robert Haas
On Tue, Feb 15, 2022 at 2:40 PM Peter Geoghegan wrote: > On Tue, Feb 15, 2022 at 10:20 AM Robert Haas wrote: > > In general, deciding on new compression algorithms can feel a bit like > > debating the merits of vi vs. emacs, or one political party vs. > > another. > > Really? I don't get that imp

Re: adding 'zstd' as a compression algorithm

2022-02-15 Thread Robert Haas
On Tue, Feb 15, 2022 at 2:54 PM Andres Freund wrote: > There's a difference between downloading a source tarball of 1.5x the size, > and 3x the decompression cost (made up numbers), because the cost of either is > not a relevant factor. I think basebackups are a different story. To be clear, I'm

Re: WIP: System Versioned Temporal Table

2022-02-15 Thread Jean Baro
Would these best practices be applicable by PostgreSQL to help avoid breaking changes for temporal tables? https://blog.datomic.com/2017/01/the-ten-rules-of-schema-growth.html Thanks On Tue, Feb 15, 2022 at 5:08 PM Vik Fearing wrote: > On 1/24/22 00:16, Corey Huinker wrote: > >> - Table schema

Re: adding 'zstd' as a compression algorithm

2022-02-15 Thread Robert Haas
On Tue, Feb 15, 2022 at 1:55 PM Justin Pryzby wrote: > Regarding the patch: > > I suppose it should support windows, and whatever patches use zstd should > update the install instructions. See 9ca40dcd4, 02a93e7ef, 4035cd5d4. Thanks, this is helpful. To me, it looks like we need something simila

Re: pg_walinspect - a new extension to get raw WAL data and WAL stats

2022-02-15 Thread Robert Haas
On Tue, Feb 15, 2022 at 2:31 PM Bharath Rupireddy wrote: > > +/* > > + * Verify the authenticity of the given raw WAL record. > > + */ > > +Datum > > +pg_verify_raw_wal_record(PG_FUNCTION_ARGS) > > +{ > > > > > > Do we really need this function? I see that whenever the record is > > read, we verif

Re: support for CREATE MODULE

2022-02-15 Thread Swaha Miller
On Mon, Feb 14, 2022 at 4:58 PM Bruce Momjian wrote: > On Mon, Feb 14, 2022 at 07:42:21PM -0500, Bruce Momjian wrote: > > On Mon, Feb 14, 2022 at 03:23:07PM -0800, Swaha Miller wrote: > > > A prominent use case for grouping functions into modules would > > > be access control on the group as a wh

Re: adding 'zstd' as a compression algorithm

2022-02-15 Thread Justin Pryzby
On Tue, Feb 15, 2022 at 03:23:30PM -0500, Robert Haas wrote: > On Tue, Feb 15, 2022 at 1:55 PM Justin Pryzby wrote: > > Regarding the patch: > > > > I suppose it should support windows, and whatever patches use zstd should > > update the install instructions. See 9ca40dcd4, 02a93e7ef, 4035cd5d4.

last_archived_wal is not necessary the latest WAL file (was Re: pgsql: Add test case for an archive recovery corner case.)

2022-02-15 Thread Heikki Linnakangas
On 14/02/2022 22:43, Heikki Linnakangas wrote: On 14/02/2022 16:41, Tom Lane wrote: Heikki Linnakangas writes: Add test case for an archive recovery corner case. hoverfly seems not to like this: https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=hoverfly&dt=2022-02-14%2012%3A36%3A12

PGEventProcs must not be allowed to break libpq

2022-02-15 Thread Tom Lane
I've been fooling around with the duplicated-error-text issue discussed in [1], and I think I have a solution that is fairly bulletproof ... except that it cannot cope with this little gem at the bottom of PQgetResult: if (!res->events[i].proc(PGEVT_RESULTCREATE, &evt,

Re: last_archived_wal is not necessary the latest WAL file (was Re: pgsql: Add test case for an archive recovery corner case.)

2022-02-15 Thread Tom Lane
Heikki Linnakangas writes: > That was interesting: the order that WAL segments are archived when a > standby is promoted is not fully deterministic. Oh, of course. > I find it a bit surprising that pg_stat_archiver.last_archived_wal is > not necessarily the highest-numbered segment that was ar

Race conditions in 019_replslot_limit.pl

2022-02-15 Thread Heikki Linnakangas
While looking at recent failures in the new 028_pitr_timelines.pl recovery test, I noticed that there have been a few failures in the buildfarm in the recoveryCheck phase even before that, in the 019_replslot_limit.pl test. For example: https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=

Re: adding 'zstd' as a compression algorithm

2022-02-15 Thread Andres Freund
Hi, On 2022-02-15 15:09:37 -0500, Robert Haas wrote: > On Tue, Feb 15, 2022 at 2:54 PM Andres Freund wrote: > > There's a difference between downloading a source tarball of 1.5x the size, > > and 3x the decompression cost (made up numbers), because the cost of either > > is > > not a relevant fa

Re: Observability in Postgres

2022-02-15 Thread Magnus Hagander
On Tue, Feb 15, 2022 at 1:30 PM Dave Page wrote: > > Hi Greg, > > On Mon, 14 Feb 2022 at 20:16, Greg Stark wrote: >> >> So I've been dealing a lot with building and maintaining dashboards >> for (fleets of) Postgres servers. And it's a pain. I have a few >> strongly held ideas about where the pai

Re: fixing bookindex.html bloat

2022-02-15 Thread Andres Freund
On 2022-02-15 11:16:12 +0100, Peter Eisentraut wrote: > On 15.02.22 00:06, Andres Freund wrote: > > On 2022-02-14 23:06:20 +0100, Peter Eisentraut wrote: > > > For the xlink business, I don't have a better idea than you, so your > > > workaround proposal seems fine. > > > > K. Will you apply your

Re: adding 'zstd' as a compression algorithm

2022-02-15 Thread Peter Geoghegan
On Tue, Feb 15, 2022 at 12:00 PM Robert Haas wrote: > I'm not sure I completely follow this. There are cases where we use > compression algorithms for internal purposes, and we can change the > defaults without users knowing or caring. For example, we could decide > that LZ4-compressing FPIs in WA

Re: Observability in Postgres

2022-02-15 Thread Greg Stark
On Tue, 15 Feb 2022 at 16:43, Magnus Hagander wrote: > > On Tue, Feb 15, 2022 at 1:30 PM Dave Page wrote: > > > > - Does it really matter if metrics are exposed on a separate port from the > > postmaster? I actually think doing that is a good thing as it allows use of > > alternative listen add

Re: Observability in Postgres

2022-02-15 Thread Magnus Hagander
On Tue, Feb 15, 2022 at 11:24 PM Greg Stark wrote: > > On Tue, 15 Feb 2022 at 16:43, Magnus Hagander wrote: > > > > On Tue, Feb 15, 2022 at 1:30 PM Dave Page wrote: > > > > > > - Does it really matter if metrics are exposed on a separate port from > > > the postmaster? I actually think doing th

Re: Avoid erroring out when unable to remove or parse logical rewrite files to save checkpoint work

2022-02-15 Thread Nathan Bossart
On Tue, Feb 15, 2022 at 10:37:58AM -0800, Nathan Bossart wrote: > On Tue, Feb 15, 2022 at 10:10:34AM -0800, Andres Freund wrote: >> I generally think it'd be a good exercise to go through an use >> get_dirent_type() in nearly all ReadDir() style loops - it's a nice >> efficiency >> win in general,

Re: do only critical work during single-user vacuum?

2022-02-15 Thread Peter Geoghegan
On Tue, Feb 15, 2022 at 9:28 AM Peter Geoghegan wrote: > On Mon, Feb 14, 2022 at 10:04 PM John Naylor > wrote: > > Well, the point of inventing this new vacuum mode was because I > > thought that upon reaching xidStopLimit, we couldn't issue commands, > > period, under the postmaster. If it was e

Re: last_archived_wal is not necessary the latest WAL file (was Re: pgsql: Add test case for an archive recovery corner case.)

2022-02-15 Thread Heikki Linnakangas
On 15/02/2022 23:28, Tom Lane wrote: Heikki Linnakangas writes: That was interesting: the order that WAL segments are archived when a standby is promoted is not fully deterministic. Oh, of course. I find it a bit surprising that pg_stat_archiver.last_archived_wal is not necessarily the high

Re: Race conditions in 019_replslot_limit.pl

2022-02-15 Thread Andres Freund
Hi, On 2022-02-15 23:29:20 +0200, Heikki Linnakangas wrote: > https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=desmoxytes&dt=2022-02-14%2006%3A30%3A04 > > [07:42:23] t/018_wal_optimize.pl ok12403 ms ( 0.00 usr > 0.00 sys + 1.40 cusr 0.63 csys = 2.03 CPU) > # poll_qu

Re: Column Filtering in Logical Replication

2022-02-15 Thread Tomas Vondra
Hi Peter, Thanks for the review and sorry for taking so long. I've addressed most of the comments in the patch I sent a couple minutes ago. More comments in-line: On 1/28/22 09:39, Peter Smith wrote: Here are some review comments for the v17-0001 patch. ~~~ 1. Commit message If no column

USE_BARRIER_SMGRRELEASE on Linux?

2022-02-15 Thread Nathan Bossart
I've noticed that my WAL pre-allocation patches [0] routinely fail with "tablespace is not empty" errors on Linux [1]: DROP TABLESPACE regress_tblspace_renamed; +ERROR: tablespace "regress_tblspace_renamed" is not empty This appears to have been discussed elsewhere (and fixed) f

Re: adding 'zstd' as a compression algorithm

2022-02-15 Thread David Steele
On 2/15/22 16:10, Peter Geoghegan wrote: On Tue, Feb 15, 2022 at 12:00 PM Robert Haas wrote: I'm not sure I completely follow this. There are cases where we use compression algorithms for internal purposes, and we can change the defaults without users knowing or caring. For example, we could de

Fix a comment in worker.c

2022-02-15 Thread Masahiko Sawada
Hi, While reading the code, I realized that the second sentence of the following comment in worker.c is not correct: /* * Exit if the subscription was disabled. This normally should not happen * as the worker gets killed during ALTER SUBSCRIPTION ... DISABLE. */ if (!newsub->en

Re: Column Filtering in Logical Replication

2022-02-15 Thread Alvaro Herrera
On 2022-Feb-16, Tomas Vondra wrote: > Here's an updated version of the patch, rebased to current master. Parts > 0002 and 0003 include various improvements based on review by me and another > one by Peter Smith [1]. Thanks for doing this! > 1) partitioning with pubviaroot=true I agree that prev

Re: Column Filtering in Logical Replication

2022-02-15 Thread Tomas Vondra
On 2/16/22 01:33, Alvaro Herrera wrote: > On 2022-Feb-16, Tomas Vondra wrote: > >> Here's an updated version of the patch, rebased to current master. Parts >> 0002 and 0003 include various improvements based on review by me and another >> one by Peter Smith [1]. > > Thanks for doing this! > >

Re: adding 'zstd' as a compression algorithm

2022-02-15 Thread Michael Paquier
On Tue, Feb 15, 2022 at 01:42:55PM -0800, Andres Freund wrote: > I think well before removing stuff we should default to decent compression > algorithms. E.g. -Z/--compress should probably not continue to use gzip if > better things are available. Which one of lz4 or zstd would it be though? LZ4

Re: adding 'zstd' as a compression algorithm

2022-02-15 Thread Robert Haas
On Tue, Feb 15, 2022 at 7:09 PM David Steele wrote: > I'm not sure that this is entirely true. lz4 is available on most > non-EOL distros but you don't need to look to far to find a distro that > does not have it. So, choosing lz4 by default could impact binary > portability. Of course, there are

Re: adding 'zstd' as a compression algorithm

2022-02-15 Thread Tom Lane
Robert Haas writes: > On Tue, Feb 15, 2022 at 7:09 PM David Steele wrote: >> This is even more true for zstd since it is not as ubiquitous as lz4. In >> fact, it is not even included with base RHEL8. You need to install EPEL >> to get zstd. > Yeah, I agree. One thing I was thinking about but did

Re: USE_BARRIER_SMGRRELEASE on Linux?

2022-02-15 Thread Thomas Munro
Hi Nathan, On Wed, Feb 16, 2022 at 12:58 PM Nathan Bossart wrote: > I've noticed that my WAL pre-allocation patches [0] routinely fail with > "tablespace is not empty" errors on Linux [1]: > > DROP TABLESPACE regress_tblspace_renamed; > +ERROR: tablespace "regress_tblspace_renam

initdb / bootstrap design

2022-02-15 Thread Andres Freund
Hi, [1] reminded me of a topic that I wanted to bring up at some point: To me the division of labor between initdb and bootstrap doesn't make much sense anymore: initdb reads postgres.bki, replaces a few tokens, starts postgres in bootstrap mode, and then painstakenly feeds bootstrap.bki lines

Re: Mark all GUC variable as PGDLLIMPORT

2022-02-15 Thread John Naylor
On Tue, Feb 15, 2022 at 11:07 PM Andres Freund wrote: > > diff --git a/src/include/common/relpath.h b/src/include/common/relpath.h > > index a4b5dc853b..13849a3790 100644 > > --- a/src/include/common/relpath.h > > +++ b/src/include/common/relpath.h > > @@ -56,7 +56,7 @@ typedef enum ForkNumber >

Re: pgsql: Add TAP test to automate the equivalent of check_guc

2022-02-15 Thread Michael Paquier
On Mon, Feb 14, 2022 at 02:11:37PM +0900, Michael Paquier wrote: > A run through the CI shows that this is working, and it also works > with Debian's patch for the config data. I still tend to prefer the > readability of a TAP test over the main regression test suite for this > facility. Hearing

  1   2   >