Re: pg_stats and range statistics

2023-01-23 Thread Egor Rogov
On 23.01.2023 13:01, Egor Rogov wrote: On 23.01.2023 02:21, Tomas Vondra wrote: On 1/22/23 22:33, Justin Pryzby wrote: On Sun, Jan 22, 2023 at 07:19:41PM +0100, Tomas Vondra wrote: On 1/21/23 19:53, Egor Rogov wrote: Hi Tomas, On 21.01.2023 00:50, Tomas Vondra wrote: This simply adds two

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

2023-01-23 Thread Peter Smith
Here are some review comments for v86-0002 == Commit message 1. Use the use the existing developer option logical_replication_mode to test the parallel apply of large transaction on subscriber. ~ Typo “Use the use the” SUGGESTION (rewritten) Give additional functionality to the existing

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

2023-01-23 Thread Peter Smith
On Tue, Jan 24, 2023 at 5:58 PM Amit Kapila wrote: > > On Tue, Jan 24, 2023 at 8:15 AM Kyotaro Horiguchi > wrote: > > > > > Attached the updated patch v19. > > > > + maybe_delay_apply(TransactionId xid, TimestampTz finish_ts) > > > > I look this spelling strange. How about maybe_apply_delay()?

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

2023-01-23 Thread Amit Kapila
On Tue, Jan 24, 2023 at 8:15 AM Kyotaro Horiguchi wrote: > > > Attached the updated patch v19. > > + maybe_delay_apply(TransactionId xid, TimestampTz finish_ts) > > I look this spelling strange. How about maybe_apply_delay()? > +1. > > send_feedback(): > +* If the subscriber side apply

Re: Generating code for query jumbling through gen_node_support.pl

2023-01-23 Thread Michael Paquier
On Mon, Jan 23, 2023 at 02:27:13PM +0100, Peter Eisentraut wrote: > A couple of small fixes are attached. Thanks. > There is something weird in _jumbleNode(). There are two switch > (nodeTag(expr)) statements. Maybe that's intentional, but then it should be > commented better, because now it

Re: Mutable CHECK constraints?

2023-01-23 Thread Tom Lane
Laurenz Albe writes: > We throw an error if the expression in a CREATE INDEX statement is not > IMMUTABLE. > But while the documentation notes that expressions in CHECK constraints are > not > to be immutable, we don't enforce that. Why don't we call something like > CheckMutability inside

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

2023-01-23 Thread Dilip Kumar
On Mon, Jan 23, 2023 at 6:00 PM John Naylor wrote: > > Attached is a rebase to fix conflicts from recent commits. I have reviewed v22-0022* patch and I have some comments. 1. >It also changes to the column names max_dead_tuples and num_dead_tuples and to >show the progress information in bytes.

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

2023-01-23 Thread Amit Kapila
On Tue, Jan 24, 2023 at 8:35 AM Kyotaro Horiguchi wrote: > > Sorry, I forgot to write one comment. > > At Tue, 24 Jan 2023 11:45:35 +0900 (JST), Kyotaro Horiguchi > wrote in > > + /* Should we delay the current transaction? */ > + if (finish_ts) > +

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

2023-01-23 Thread Amit Kapila
On Tue, Jan 24, 2023 at 6:17 AM Kyotaro Horiguchi wrote: > > At Mon, 23 Jan 2023 17:36:13 +0530, Amit Kapila > wrote in > > On Sun, Jan 22, 2023 at 6:12 PM Takamichi Osumi (Fujitsu) > > wrote: > > > > > > > > > Attached the updated patch v19. > > Few comments: > > 2. > > + if

Re: Minimal logical decoding on standbys

2023-01-23 Thread Drouvot, Bertrand
Hi, On 1/24/23 1:46 AM, Andres Freund wrote: Hi, On 2023-01-19 10:43:27 +0100, Drouvot, Bertrand wrote: With a reload in place in my testing, now I notice that the catalog_xmin is updated on the primary physical slot after logical slots invalidation when reloading hot_standby_feedback from

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

2023-01-23 Thread Amit Kapila
On Tue, Jan 24, 2023 at 5:02 AM Euler Taveira wrote: > > On Sun, Jan 22, 2023, at 9:42 AM, Takamichi Osumi (Fujitsu) wrote: > > > Attached the updated patch v19. > > [I haven't been following this thread for a long time...] > > Good to know that you keep improving this patch. I have a few

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

2023-01-23 Thread Amit Kapila
On Tue, Jan 24, 2023 at 3:46 AM Peter Smith wrote: > > On Mon, Jan 23, 2023 at 9:44 PM Amit Kapila wrote: > > > > > > > 6. defGetMinApplyDelay > > > > ... > > > > > > 6b. > > > I thought this function should be implemented as static and located at > > > the top of the subscriptioncmds.c source

Mutable CHECK constraints?

2023-01-23 Thread Laurenz Albe
We throw an error if the expression in a CREATE INDEX statement is not IMMUTABLE. But while the documentation notes that expressions in CHECK constraints are not to be immutable, we don't enforce that. Why don't we call something like CheckMutability inside cookConstraint? Sure, that wouldn't

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

2023-01-23 Thread Amit Kapila
On Tue, Jan 24, 2023 at 9:13 AM Peter Smith wrote: > > 1. > > IIUC the GUC name was made generic 'logical_replication_mode' so that > multiple developer GUCs are not needed later. > > But IMO those current option values (buffered/immediate) for that GUC > are maybe a bit too generic. Perhaps in

Re: Logical replication timeout problem

2023-01-23 Thread Peter Smith
On Tue, Jan 24, 2023 at 1:45 PM wangw.f...@fujitsu.com wrote: > > On Tues, Jan 24, 2023 at 8:28 AM Peter Smith wrote: > > Hi Hou-san, Here are my review comments for v5-0001. > > Thanks for your comments. ... > > Changed as suggested. > > Attach the new patch. Thanks! Patch v6 LGTM. --

Re: Speed up transaction completion faster after many relations are accessed in a transaction

2023-01-23 Thread David Rowley
On Fri, 20 Jan 2023 at 00:26, vignesh C wrote: > CFBot shows some compilation errors as in [1], please post an updated > version for the same: I've attached a rebased patch. While reading over this again, I wondered if instead of allocating the memory for the LOCALLOCKOWNER in TopMemoryContext,

Re: cutting down the TODO list thread

2023-01-23 Thread John Naylor
On Wed, Jan 18, 2023 at 3:13 AM Bruce Momjian wrote: > I think we risk overloading people with too many words above, and they > will not read it fully. Can it be simplified? I wonder if some of this > belows in the developer's FAQ and linked to that from the TODO list. I think you're right.

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

2023-01-23 Thread Peter Smith
Here are my review comments for patch v86-0001. == General 1. IIUC the GUC name was made generic 'logical_replication_mode' so that multiple developer GUCs are not needed later. But IMO those current option values (buffered/immediate) for that GUC are maybe a bit too generic. Perhaps in

Re: postgres_fdw uninterruptible during connection establishment / ProcSignalBarrier

2023-01-23 Thread Andres Freund
Hi, On 2023-01-20 19:00:08 -0800, Andres Freund wrote: > Updated patch attached. I split it into multiple pieces. > 1) A fix for [1], included here because I encountered it while testing > 2) Introduction of libpq-be-fe-helpers.h > 3) Convert dblink and postgres_fdw to the helper > 4) Convert

Re: Support logical replication of DDLs

2023-01-23 Thread Zheng Li
> > Yes, CREATE/ALTER SERVER commands are also supported by the current > > DDL replication patch. > > > > >But what about data inserted by the publisher on the > > > foreign server? > > > > I thought the data inserted to a foreign table will always be stored > > on the foreign server unless I'm

Test failures of 100_bugs.pl

2023-01-23 Thread Andres Freund
Hi, cfbot, the buildfarm and locally I have seen 100_bugs.pl fail occasionally. Just rarely enough that I never got around to looking into it for real. Just now there was another failure on master: https://cirrus-ci.com/task/5279589287591936 [01:00:49.441] ok 1 - index predicates do not cause

Re: Decoupling antiwraparound autovacuum from special rules around auto cancellation

2023-01-23 Thread Peter Geoghegan
On Mon, Jan 23, 2023 at 6:56 PM Andres Freund wrote: > Why is there TABLE_ in AUTOVACUUM_TABLE_XID_AGE but not > AUTOVACUUM_DEAD_TUPLES? Both are on tables. Why does vacuum_freeze_table_age contain the word "table", while autovacuum_vacuum_scale_factor does not? To me, "table XID age" is a less

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

2023-01-23 Thread Kyotaro Horiguchi
Sorry, I forgot to write one comment. At Tue, 24 Jan 2023 11:45:35 +0900 (JST), Kyotaro Horiguchi wrote in + /* Should we delay the current transaction? */ + if (finish_ts) + maybe_delay_apply(xid, finish_ts); + if (!am_parallel_apply_worker())

Re: libpqrcv_connect() leaks PGconn

2023-01-23 Thread Andres Freund
On 2023-01-21 23:14:08 -0800, Noah Misch wrote: > On Sat, Jan 21, 2023 at 12:04:53PM -0800, Andres Freund wrote: > > On 2023-01-21 08:16:42 -0800, Noah Misch wrote: > > > On Fri, Jan 20, 2023 at 06:50:37PM -0800, Andres Freund wrote: > > > > I seems we don't have any tests for creating a

Re: Decoupling antiwraparound autovacuum from special rules around auto cancellation

2023-01-23 Thread Andres Freund
Hi, On 2023-01-18 17:54:27 -0800, Peter Geoghegan wrote: > From 0afaf310255a068d3c1ca9d2ce6f00118cbff890 Mon Sep 17 00:00:00 2001 > From: Peter Geoghegan > Date: Fri, 25 Nov 2022 11:23:20 -0800 > Subject: [PATCH v5 1/2] Add autovacuum trigger instrumentation. > > Add new instrumentation that

RE: wake up logical workers after ALTER SUBSCRIPTION

2023-01-23 Thread houzj.f...@fujitsu.com
On Monday, January 23, 2023 3:13 AM Tom Lane wrote: Hi, > > Nathan Bossart writes: > > On Tue, Jan 10, 2023 at 10:59:14AM +0530, Amit Kapila wrote: > >> I haven't looked in detail but isn't it better to explain somewhere > >> in the comments that it achieves to rate limit the restart of

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

2023-01-23 Thread Kyotaro Horiguchi
> Attached the updated patch v19. + maybe_delay_apply(TransactionId xid, TimestampTz finish_ts) I look this spelling strange. How about maybe_apply_delay()? send_feedback(): +* If the subscriber side apply is delayed (because of time-delayed +* replication) then do not tell

RE: Logical replication timeout problem

2023-01-23 Thread wangw.f...@fujitsu.com
On Tues, Jan 24, 2023 at 8:28 AM Peter Smith wrote: > Hi Hou-san, Here are my review comments for v5-0001. Thanks for your comments. > == > src/backend/replication/logical/reorderbuffer.c > > 1. > @@ -2446,6 +2452,23 @@ ReorderBufferProcessTXN(ReorderBuffer *rb, > ReorderBufferTXN *txn, >

Re: Check lateral references within PHVs for memoize cache keys

2023-01-23 Thread David Rowley
On Fri, 30 Dec 2022 at 16:00, Richard Guo wrote: > > On Fri, Dec 9, 2022 at 5:16 PM Richard Guo wrote: >> >> Actually we do have checked PHVs for lateral references, earlier in >> create_lateral_join_info. But that time we only marked lateral_relids >> and direct_lateral_relids, without

Re: Improve logging when using Huge Pages

2023-01-23 Thread Andres Freund
Hi, On 2023-01-23 19:21:00 -0600, Justin Pryzby wrote: > Michael seemed to support this idea and nobody verbalized hatred of it, > so I implemented it. In v15, we have shared_memory_size_in_huge_pages, > so this adds effective_huge_pages. > > Feel free to suggest a better name. Hm. Should this

Re: Improve logging when using Huge Pages

2023-01-23 Thread Justin Pryzby
On Wed, Nov 09, 2022 at 02:04:00PM +0900, Michael Paquier wrote: > On Wed, Nov 09, 2022 at 11:47:57AM +0900, Kyotaro Horiguchi wrote: > > Honestly I don't come up with other users of the new > > log-level. Another possible issue is it might be a bit hard for people > > to connect that level to

Re: Monotonic WindowFunc support for ntile(), percent_rank() and cume_dist()

2023-01-23 Thread David Rowley
Thanks for having a look at this. On Tue, 24 Jan 2023 at 13:26, Melanie Plageman wrote: > Silly question, but was there any reason these were omitted in the first > commit? Good question, it's just that I didn't think of it at the time and nobody else did or if they did, they didn't mention it.

Re: Fix GetWALAvailability function code comments for WALAVAIL_REMOVED return value

2023-01-23 Thread Kyotaro Horiguchi
At Thu, 19 Jan 2023 18:43:52 -0500, Tom Lane wrote in > sirisha chamarthi writes: > > On Wed, Oct 19, 2022 at 7:59 PM Kyotaro Horiguchi > > wrote: > >> In short, the proposed fix alone seems fine to me. If we want to show > >> further details, I would add a bit as follows. > >> > >> | * *

Re: Non-decimal integer literals

2023-01-23 Thread Ranier Vilela
On 13.01.23 11:01, Dean Rasheed wrote: > So I'm feeling quite good about the end result -- I set out hoping not > to make performance noticeably worse, but ended up making it > significantly better. Hi Dean, thanks for your work. But since PG_RETURN_NULL, is a simple return, now the "value" var

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

2023-01-23 Thread Kyotaro Horiguchi
At Mon, 23 Jan 2023 17:36:13 +0530, Amit Kapila wrote in > On Sun, Jan 22, 2023 at 6:12 PM Takamichi Osumi (Fujitsu) > wrote: > > > > > > Attached the updated patch v19. > Few comments: > 2. > + if (IsSet(supported_opts, SUBOPT_MIN_APPLY_DELAY) && > + opts->min_apply_delay > 0 &&

Re: Minimal logical decoding on standbys

2023-01-23 Thread Andres Freund
Hi, On 2023-01-19 10:43:27 +0100, Drouvot, Bertrand wrote: > > > With a reload in place in my testing, now I notice that the catalog_xmin > > > is updated on the primary physical slot after logical slots invalidation > > > when reloading hot_standby_feedback from "off" to "on". > > > > > > This

Re: Cygwin cleanup

2023-01-23 Thread Andres Freund
Hi, On 2023-01-23 17:28:14 -0600, Justin Pryzby wrote: > On Thu, Jan 12, 2023 at 10:17:55PM -0600, Justin Pryzby wrote: > > On Thu, Jan 12, 2023 at 06:43:54PM -0800, Andres Freund wrote: > > > > It looks like logical decoding may be the "most wrong" place that > > > > wal_sync_method is being

Re: Logical replication timeout problem

2023-01-23 Thread Peter Smith
Hi Hou-san, Here are my review comments for v5-0001. == src/backend/replication/logical/reorderbuffer.c 1. @@ -2446,6 +2452,23 @@ ReorderBufferProcessTXN(ReorderBuffer *rb, ReorderBufferTXN *txn, elog(ERROR, "tuplecid value in changequeue"); break; } + + /* + * Sending keepalive

Re: Monotonic WindowFunc support for ntile(), percent_rank() and cume_dist()

2023-01-23 Thread Melanie Plageman
On Tue, Jan 24, 2023 at 11:01:08AM +1300, David Rowley wrote: > 9d9c02ccd [1] added infrastructure in the query planner and executor > so that the executor would know to stop processing a monotonic > WindowFunc when its value went beyond what some qual in the outer > query could possibly match in

Re: Non-superuser subscription owners

2023-01-23 Thread Jacob Champion
On 1/23/23 11:52, Robert Haas wrote: > On Mon, Jan 23, 2023 at 2:47 PM Robert Haas wrote: >> Second, the reason why I described it as a manufactured issue is >> because it's a bit like asking someone to stand under a ladder and >> then complaining when they get hit in the head by a falling

Re: Non-superuser subscription owners

2023-01-23 Thread Jacob Champion
On 1/23/23 11:05, Andres Freund wrote: > There's not enough documentation for SYSTEM_USER imo. If we were to make use of SYSTEM_USER programmatically (and based on what Robert wrote downthread, that's probably not what's desired), I think we'd have to make more guarantees about how it can be

Re: Fix incorrect comment reference

2023-01-23 Thread James Coleman
On Mon, Jan 23, 2023 at 4:07 PM James Coleman wrote: > > On Mon, Jan 23, 2023 at 3:41 PM Robert Haas wrote: > > > > On Mon, Jan 23, 2023 at 3:19 PM James Coleman wrote: > > > On Mon, Jan 23, 2023 at 1:26 PM Robert Haas wrote: > > > > On Mon, Jan 23, 2023 at 8:31 AM James Coleman wrote: > > >

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

2023-01-23 Thread Euler Taveira
On Sun, Jan 22, 2023, at 9:42 AM, Takamichi Osumi (Fujitsu) wrote: > On Saturday, January 21, 2023 3:36 AM I wrote: > > Kindly have a look at the patch v18. > I've conducted some refactoring for v18. > Now the latest patch should be tidier and > the comments would be clearer and more aligned as a

Re: Improve LATERAL join case in test memoize.sql

2023-01-23 Thread David Rowley
On Mon, 16 Jan 2023 at 22:27, Richard Guo wrote: > I happened to notice we have the case in memoize.sql that tests for > memoize node with LATERAL joins, which is > > -- Try with LATERAL joins > SELECT explain_memoize(' > SELECT COUNT(*),AVG(t2.unique1) FROM tenk1 t1, > LATERAL (SELECT t2.unique1

Re: Cygwin cleanup

2023-01-23 Thread Justin Pryzby
On Thu, Jan 12, 2023 at 10:17:55PM -0600, Justin Pryzby wrote: > On Thu, Jan 12, 2023 at 06:43:54PM -0800, Andres Freund wrote: > > > It looks like logical decoding may be the "most wrong" place that > > > wal_sync_method is being used, so maybe my change is reasonable to > > > consider, and not

Re: Minimal logical decoding on standbys

2023-01-23 Thread Melanie Plageman
I'm new to this thread and subject, but I had a few basic thoughts about the first patch in the set. On Mon, Jan 23, 2023 at 12:03:35PM +0100, Drouvot, Bertrand wrote: > > Please find V42 attached. > > From 3c206bd77831d507f4f95e1942eb26855524571a Mon Sep 17 00:00:00 2001 > From: bdrouvotAWS >

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

2023-01-23 Thread Peter Smith
On Mon, Jan 23, 2023 at 9:44 PM Amit Kapila wrote: > > On Mon, Jan 23, 2023 at 1:36 PM Peter Smith wrote: > > > > Here are my review comments for v19-0001. > > > ... > > > > 5. parse_subscription_options > > > > + /* > > + * The combination of parallel streaming mode and min_apply_delay is not >

Monotonic WindowFunc support for ntile(), percent_rank() and cume_dist()

2023-01-23 Thread David Rowley
9d9c02ccd [1] added infrastructure in the query planner and executor so that the executor would know to stop processing a monotonic WindowFunc when its value went beyond what some qual in the outer query could possibly match in future evaluations due to the WindowFunc's monotonic nature. In that

Re: Add SHELL_EXIT_CODE to psql

2023-01-23 Thread Corey Huinker
> > Thanks! But CF bot still not happy. I think, we should address issues from > here https://cirrus-ci.com/task/5391002618298368 > Sure enough, exit codes are shell dependent...adjusted the tests to reflect that. From 237b892e5efe739bc8e75d4af30140520d445491 Mon Sep 17 00:00:00 2001 From:

Re: recovery modules

2023-01-23 Thread Nathan Bossart
On Mon, Jan 23, 2023 at 11:44:57AM +0900, Michael Paquier wrote: > Thanks for the rebase. Thanks for the detailed review. > The final state of the documentation is as follows: > 51. Archive and Recovery Modules > 51.1. Archive Module Initialization Functions > 51.2. Archive Module

Re: Non-decimal integer literals

2023-01-23 Thread Dean Rasheed
On Mon, 23 Jan 2023 at 20:00, Joel Jacobson wrote: > > Nice! This also simplifies when dealing with non-negative integers > represented as byte arrays, > common in e.g. cryptography code. > Ah, interesting. I hadn't thought of that use-case. > create function numeric_from_bytes(bytea) returns

Re: run pgindent on a regular basis / scripted manner

2023-01-23 Thread Bruce Momjian
On Mon, Jan 23, 2023 at 09:31:36AM -0800, Andres Freund wrote: > As long as we need typedefs.list, I think it'd be good for such a target to > add new typedefs found in the local build to typedefs.list (but *not* remove > old ones, due to platform dependent code). But that's a separate enough >

Re: v16 GRANT role TO role needs a multi-option setting capability

2023-01-23 Thread Pavel Luzanov
On 23.01.2023 23:09, David G. Johnston wrote: GRANT role_name [, ...] TO role_specification [, ...]     [ WITH { ADMIN | INHERIT | SET } { OPTION | TRUE | FALSE } ]     [ GRANTED BY role_specification ] It would be really nice to complete this new feature of INHERIT/SET FALSE/TRUE with a

Re: Fix incorrect comment reference

2023-01-23 Thread James Coleman
On Mon, Jan 23, 2023 at 3:41 PM Robert Haas wrote: > > On Mon, Jan 23, 2023 at 3:19 PM James Coleman wrote: > > On Mon, Jan 23, 2023 at 1:26 PM Robert Haas wrote: > > > On Mon, Jan 23, 2023 at 8:31 AM James Coleman wrote: > > > > See the attached for a simple comment fix -- the referenced > >

Re: run pgindent on a regular basis / scripted manner

2023-01-23 Thread Jelte Fennema
> Not sure if this should go in the git repo or in the developer wiki. I would say the git repo is currently the most fitting place, since it has all the existing docs for pgindent. The wiki even links to the pgindent source directory:

Re: Non-superuser subscription owners

2023-01-23 Thread Jeff Davis
On Fri, 2023-01-20 at 11:08 -0500, Robert Haas wrote: > On Fri, Jan 20, 2023 at 8:25 AM Robert Haas > wrote: > > I still think you're talking about a different problem here. I'm > > talking about the problem of knowing whether local files are going > > to > > be accessed by the connection string.

Re: Underscores in numeric literals

2023-01-23 Thread Dean Rasheed
On Wed, 4 Jan 2023 at 09:28, Dean Rasheed wrote: > > In addition, I think that strip_underscores() could then go away if > numeric_in() were made to handle underscores. > > Essentially then, that would move all responsibility for parsing > underscores and non-decimal integers to the datatype

Re: Fix incorrect comment reference

2023-01-23 Thread Robert Haas
On Mon, Jan 23, 2023 at 3:19 PM James Coleman wrote: > On Mon, Jan 23, 2023 at 1:26 PM Robert Haas wrote: > > On Mon, Jan 23, 2023 at 8:31 AM James Coleman wrote: > > > See the attached for a simple comment fix -- the referenced > > > generate_useful_gather_paths call isn't in grouping_planner

Re: Add SHELL_EXIT_CODE to psql

2023-01-23 Thread Corey Huinker
On Mon, Jan 23, 2023 at 2:53 PM Robert Haas wrote: > On Mon, Jan 23, 2023 at 1:59 PM Corey Huinker > wrote: > > SHELL_ERROR is helpful in that it is a ready-made boolean that works for > \if tests in the same way that ERROR is set to true any time SQLSTATE is > nonzero. We don't yet have inline

Re: Add the ability to limit the amount of memory that can be allocated to backends.

2023-01-23 Thread Andres Freund
Hi, On 2023-01-23 10:48:38 -0500, Reid Thompson wrote: > On Thu, 2023-01-19 at 16:50 +0530, vignesh C wrote: > > > > The patch does not apply on top of HEAD as in [1], please post a rebased > > patch: > > > > Regards, > > Vignesh > > rebased patch attached I think it's basically still

Re: Reduce timing overhead of EXPLAIN ANALYZE using rdtsc?

2023-01-23 Thread Andres Freund
Hi, On 2023-01-23 18:52:44 +0100, David Geier wrote: > One thing I was wondering about: why did you chose to use a signed instead > of an unsigned 64-bit integer for the ticks? That's been the case since my first post in the thread :). Mainly, it seems easier to detect underflow cases during

Re: Reduce timing overhead of EXPLAIN ANALYZE using rdtsc?

2023-01-23 Thread Andres Freund
Hi, On 2023-01-23 18:49:37 +0100, David Geier wrote: > On 1/21/23 05:12, Andres Freund wrote: > > We do currently do the conversion quite frequently. Admittedly I was > > partially motivated by trying to get the per-loop overhead in pg_test_timing > > down ;) > > > > But I think it's a real

Re: Fix incorrect comment reference

2023-01-23 Thread James Coleman
On Mon, Jan 23, 2023 at 1:26 PM Robert Haas wrote: > > On Mon, Jan 23, 2023 at 8:31 AM James Coleman wrote: > > See the attached for a simple comment fix -- the referenced > > generate_useful_gather_paths call isn't in grouping_planner it's in > > apply_scanjoin_target_to_paths. > > The intended

v16 GRANT role TO role needs a multi-option setting capability

2023-01-23 Thread David G. Johnston
Hey, GRANT role_name [, ...] TO role_specification [, ...] [ WITH { ADMIN | INHERIT | SET } { OPTION | TRUE | FALSE } ] [ GRANTED BY role_specification ] It would be really nice to complete this new feature of INHERIT/SET FALSE/TRUE with a multi-specification capability. GRANT role_name

Re: run pgindent on a regular basis / scripted manner

2023-01-23 Thread Tom Lane
Nikita Malakhov writes: > I've ran pdindent on the whole Postgres and it'd changed > an awful lot of source files. Won't it create a lot of merge conflicts? Well, yeah, you've rediscovered the fact that a lot of commits are sloppy about this, and it's been awhile since our last tree-wide

Re: Non-decimal integer literals

2023-01-23 Thread Joel Jacobson
On Fri, Jan 13, 2023, at 07:01, Dean Rasheed wrote: > Attachments: > * 0001-Add-non-decimal-integer-support-to-type-numeric.patch Nice! This also simplifies when dealing with non-negative integers represented as byte arrays, common in e.g. cryptography code. Before, one had to implement

Re: Add SHELL_EXIT_CODE to psql

2023-01-23 Thread Robert Haas
On Mon, Jan 23, 2023 at 1:59 PM Corey Huinker wrote: > SHELL_ERROR is helpful in that it is a ready-made boolean that works for \if > tests in the same way that ERROR is set to true any time SQLSTATE is nonzero. > We don't yet have inline expressions for \if so the ready-made boolean is a >

Re: Non-superuser subscription owners

2023-01-23 Thread Robert Haas
On Mon, Jan 23, 2023 at 2:47 PM Robert Haas wrote: > Second, the reason why I described it as a manufactured issue is > because it's a bit like asking someone to stand under a ladder and > then complaining when they get hit in the head by a falling object. > It's not that I think it's good for

Re: Non-superuser subscription owners

2023-01-23 Thread Robert Haas
On Mon, Jan 23, 2023 at 1:27 PM Jacob Champion wrote: > On Mon, Jan 23, 2023 at 8:35 AM Robert Haas wrote: > > I will admit that this is not an open-and-shut case, because a > > passwordless login back to the bootstrap superuser account from the > > local machine is a pretty common scenario and

Re: Add a hook to allow modification of the ldapbindpasswd

2023-01-23 Thread Andrew Dunstan
On 2022-12-19 Mo 11:29, Andrew Dunstan wrote: > This patch, mostly the work of John Naylor, provides a hook whereby a > module can modify the ldapbindpasswd before it is handed to the ldap > server. This is similar in concept to the ssl_passphrase_callback > feature, and allows the user not to

Re: Non-superuser subscription owners

2023-01-23 Thread Andres Freund
Hi, On 2023-01-23 10:27:27 -0800, Jacob Champion wrote: > On Mon, Jan 23, 2023 at 8:35 AM Robert Haas wrote: > > I will admit that this is not an open-and-shut case, because a > > passwordless login back to the bootstrap superuser account from the > > local machine is a pretty common scenario

Re: Add SHELL_EXIT_CODE to psql

2023-01-23 Thread Corey Huinker
On Fri, Jan 20, 2023 at 8:54 AM Robert Haas wrote: > On Wed, Jan 4, 2023 at 2:09 AM Corey Huinker > wrote: > > 2. There are now two psql variables, SHELL_EXIT_CODE, which has the > return code, and SHELL_ERROR, which is a true/false flag based on whether > the exit code was nonzero. These

Re: run pgindent on a regular basis / scripted manner

2023-01-23 Thread Nikita Malakhov
Hi! I've ran pdindent on the whole Postgres and it'd changed an awful lot of source files. Won't it create a lot of merge conflicts? On Mon, Jan 23, 2023 at 8:48 PM Alvaro Herrera wrote: > On 2023-Jan-23, Tom Lane wrote: > > > 1. [...] So now I think that we should > > stick to the convention

Re: run pgindent on a regular basis / scripted manner

2023-01-23 Thread Andrew Dunstan
On 2023-01-23 Mo 09:49, Jelte Fennema wrote: > Attached is a patch > that adds an updated pre-commit hook with the same behaviour > as the one before. I definitely think having a pre-commit hook > in the repo is beneficial, since writing one that works in all > cases definitely takes some time.

Re: Non-superuser subscription owners

2023-01-23 Thread Robert Haas
On Mon, Jan 23, 2023 at 1:26 PM Andres Freund wrote: > > If I'm asked to attempt to connect to a PostgreSQL server, and I > > choose to do that, and the connection succeeds, all I know is that the > > connection actually succeeded. > > Well, there is PQconnectionUsedPassword()... Not that it's a

Re: Authentication fails for md5 connections if ~/.postgresql/postgresql.{crt and key} exist

2023-01-23 Thread Jacob Champion
On Sat, Jan 21, 2023 at 4:35 AM Jim Jones wrote: > Well, I see there is indeed a significant overlap between our patches - > but yours has a much more comprehensive approach! If I got it right, > the new slcertmode=disable would indeed cancel the existing certs in > '~/.postgresql/ in case they

Re: Non-superuser subscription owners

2023-01-23 Thread Andres Freund
Hi, On 2023-01-23 12:39:50 -0500, Robert Haas wrote: > On Sun, Jan 22, 2023 at 8:52 PM Andres Freund wrote: > > > Perhaps we should have a way to directly turn on/off authentication > > > methods in libpq through API functions and/or options? > > > > Yes. There's an in-progress patch adding, I

Re: Non-superuser subscription owners

2023-01-23 Thread Jacob Champion
On Mon, Jan 23, 2023 at 8:35 AM Robert Haas wrote: > I will admit that this is not an open-and-shut case, because a > passwordless login back to the bootstrap superuser account from the > local machine is a pretty common scenario and doesn't feel > intrinsically unreasonable to me, and I hadn't

Re: Non-superuser subscription owners

2023-01-23 Thread Andres Freund
Hi, On 2023-01-23 11:34:32 -0500, Robert Haas wrote: > I will admit that this is not an open-and-shut case, because a > passwordless login back to the bootstrap superuser account from the > local machine is a pretty common scenario and doesn't feel > intrinsically unreasonable to me, and I hadn't

Re: Fix incorrect comment reference

2023-01-23 Thread Robert Haas
On Mon, Jan 23, 2023 at 8:31 AM James Coleman wrote: > See the attached for a simple comment fix -- the referenced > generate_useful_gather_paths call isn't in grouping_planner it's in > apply_scanjoin_target_to_paths. The intended reading of the comment is not clear. Is it telling you to look

Re: Non-superuser subscription owners

2023-01-23 Thread Robert Haas
On Sat, Jan 21, 2023 at 5:11 PM Andres Freund wrote: > > + /* For all these parameters, the value is a local filename. */ > > + if (strcmp(opt->keyword, "passfile") == 0 || > > + strcmp(opt->keyword, "sslcert") == 0 || > > +

Re: Schema variables - new implementation for Postgres 15 (typo)

2023-01-23 Thread Pavel Stehule
po 23. 1. 2023 v 15:25 odesílatel Dmitry Dolgov <9erthali...@gmail.com> napsal: > > On Sun, Jan 22, 2023 at 07:47:07PM +0100, Pavel Stehule wrote: > > pá 20. 1. 2023 v 21:35 odesílatel Dmitry Dolgov <9erthali...@gmail.com> > > napsal: > > > > > * I think it was already mentioned in the thread,

Re: New strategies for freezing, advancing relfrozenxid early

2023-01-23 Thread Peter Geoghegan
On Mon, Jan 23, 2023 at 3:17 AM Dilip Kumar wrote: > My final set of comments for 0002 Thanks for the review! > I do not understand much use of maintaining these two > 'scanned_pages_lazy' and 'scanned_pages_eager' variables. I think > just maintaining 'scanned_pages' should be sufficient. I

Re: Add LZ4 compression in pg_dump

2023-01-23 Thread Justin Pryzby
On Mon, Jan 23, 2023 at 05:31:55PM +, gkokola...@pm.me wrote: > Please find attached v23 which reintroduces the split. > > 0001 is reworked to have a reduced footprint than before. Also in an attempt > to facilitate the readability, 0002 splits the API's and the uncompressed > implementation

Re: Reduce timing overhead of EXPLAIN ANALYZE using rdtsc?

2023-01-23 Thread David Geier
Hi, On 1/21/23 06:31, Andres Freund wrote: I pushed the int64-ification commits. Great. I started rebasing. One thing I was wondering about: why did you chose to use a signed instead of an unsigned 64-bit integer for the ticks? If you have time to look at the pg_test_timing part, it'd be

Re: Reduce timing overhead of EXPLAIN ANALYZE using rdtsc?

2023-01-23 Thread David Geier
Hi, On 1/21/23 05:12, Andres Freund wrote: We do currently do the conversion quite frequently. Admittedly I was partially motivated by trying to get the per-loop overhead in pg_test_timing down ;) But I think it's a real issue. Places where we do, but shouldn't, convert: - ExecReScan() -

Re: run pgindent on a regular basis / scripted manner

2023-01-23 Thread Alvaro Herrera
On 2023-Jan-23, Tom Lane wrote: > 1. [...] So now I think that we should > stick to the convention that it's on the user to install > pg_bsd_indent somewhere in their PATH; all we'll be doing with > this change is eliminating the step of fetching pg_bsd_indent's > source files from somewhere

Re: Reduce timing overhead of EXPLAIN ANALYZE using rdtsc?

2023-01-23 Thread Andres Freund
Hi, On 2023-01-23 18:23:17 +0100, David Geier wrote: > On 1/21/23 05:14, Andres Freund wrote: > > The elapsed time is already inherently unstable, so we shouldn't have any > > test > > output showing the time. > > > > But I doubt showing it in every explain is a good idea - we use instr_time >

Re: Non-superuser subscription owners

2023-01-23 Thread Robert Haas
On Sun, Jan 22, 2023 at 8:52 PM Andres Freund wrote: > > Perhaps we should have a way to directly turn on/off authentication > > methods in libpq through API functions and/or options? > > Yes. There's an in-progress patch adding, I think, pretty much what is > required here: >

Re: [BUG] Autovacuum not dynamically decreasing cost_limit and cost_delay

2023-01-23 Thread Alvaro Herrera
On 2021-Feb-08, Mead, Scott wrote: > Hello, >I recently looked at what it would take to make a running autovacuum > pick-up a change to either cost_delay or cost_limit. Users frequently > will have a conservative value set, and then wish to change it when > autovacuum initiates a freeze on a

Re: run pgindent on a regular basis / scripted manner

2023-01-23 Thread Andres Freund
Hi, On 2023-01-23 10:09:06 -0500, Tom Lane wrote: > 1. I'd originally thought vaguely that we could teach pgindent > how to build pg_bsd_indent automatically. But with a little > more consideration, I doubt that would work transparently. > It's common (at least for me) to run pgindent in a

Re: wake up logical workers after ALTER SUBSCRIPTION

2023-01-23 Thread Nathan Bossart
On Sun, Jan 22, 2023 at 02:12:54PM -0500, Tom Lane wrote: > I pushed v17 with some mostly-cosmetic changes, including more comments. Thanks! -- Nathan Bossart Amazon Web Services: https://aws.amazon.com

Re: Reduce timing overhead of EXPLAIN ANALYZE using rdtsc?

2023-01-23 Thread David Geier
Hi, On 1/21/23 05:14, Andres Freund wrote: The elapsed time is already inherently unstable, so we shouldn't have any test output showing the time. But I doubt showing it in every explain is a good idea - we use instr_time in plenty of other places. Why show it in explain, but not in all those

Re: CREATEROLE users vs. role properties

2023-01-23 Thread Robert Haas
On Mon, Jan 23, 2023 at 10:25 AM tushar wrote: > Please refer to this scenario where I am able to give createrole privileges > but not replication privilege to role > > postgres=# create role t1 createrole; > CREATE ROLE > postgres=# create role t2 replication; > CREATE ROLE > postgres=# create

Re: real/float example for testlibpq3

2023-01-23 Thread Mark Wong
On Fri, Jan 20, 2023 at 01:12:07PM -0500, Robert Haas wrote: > On Fri, Jan 20, 2023 at 12:58 PM Tom Lane wrote: > > I don't mind if you write something like > > > > A float4 value is a 4-byte IEEE single-precision floating point > > number. It is transmitted in network byte order, so you

Re: MERGE ... RETURNING

2023-01-23 Thread Dean Rasheed
On Sun, 22 Jan 2023 at 19:08, Alvaro Herrera wrote: > > > diff --git a/src/backend/commands/copy.c b/src/backend/commands/copy.c > > new file mode 100644 > > index e34f583..aa3cca0 > > --- a/src/backend/commands/copy.c > > +++ b/src/backend/commands/copy.c > > @@ -274,12 +274,6 @@

Re: WARNING: outfuncs/readfuncs failed to produce an equal rewritten parse tree

2023-01-23 Thread Pavel Stehule
po 23. 1. 2023 v 17:31 odesílatel Tom Lane napsal: > Pavel Stehule writes: > > After some investigation, I found a problem in the RangeVar node. > > > The field "catalogname" is setted to NULL in _readRangeVar, but it is > > compared in _equalRangeVar function. > > > I thought so it is problem

Re: Non-superuser subscription owners

2023-01-23 Thread Robert Haas
On Sat, Jan 21, 2023 at 5:01 PM Andres Freund wrote: > There are good reasons to have 'peer' authentication set up for the user > running postgres, so admin scripts can connect without issues. Which > unfortunately then also means that postgres_fdw etc can connect to the current > database as

Re: WARNING: outfuncs/readfuncs failed to produce an equal rewritten parse tree

2023-01-23 Thread Tom Lane
Pavel Stehule writes: > After some investigation, I found a problem in the RangeVar node. > The field "catalogname" is setted to NULL in _readRangeVar, but it is > compared in _equalRangeVar function. > I thought so it is problem in my patch, but it looks like generic issue: > create table

Re: Non-decimal integer literals

2023-01-23 Thread Dean Rasheed
On Mon, 23 Jan 2023 at 15:55, Peter Eisentraut wrote: > > On 13.01.23 11:01, Dean Rasheed wrote: > > So I'm feeling quite good about the end result -- I set out hoping not > > to make performance noticeably worse, but ended up making it > > significantly better. > > This is great! How do you

  1   2   >