Re: Generating code for query jumbling through gen_node_support.pl

2023-01-12 Thread Michael Paquier
On Sat, Jan 07, 2023 at 07:37:49AM +0100, Peter Eisentraut wrote: > On 07.12.22 08:56, Michael Paquier wrote: >> The location of the Nodes is quite invasive because we only care about >> that for T_Const now in the query jumbling, and this could be >> compensated with a third pg_node_attr() that

Re: Blocking execution of SECURITY INVOKER

2023-01-12 Thread Jeff Davis
Hi, On Thu, 2023-01-12 at 19:29 -0800, Andres Freund wrote: > superuser: > # CREATE FUNCTION exec_su(p_sql text) RETURNS text LANGUAGE plpgsql > SECURITY DEFINER AS $$BEGIN RAISE NOTICE 'executing %', p_sql; > EXECUTE p_sql;RETURN 'p_sql';END;$$; > # REVOKE ALL ON FUNCTION exec_su FROM PUBLIC ;

Re: PL/Python: Fix return in the middle of PG_TRY() block.

2023-01-12 Thread Andres Freund
Hi, On 2023-01-12 21:49:00 -0800, Andres Freund wrote: > Clearly this would need a bunch more work, but it seems promising? I think > there'd be other uses than this. > > I briefly tried to use it for spinlocks. Mostly works and detects things like > returning with a spinlock held. But it does

Re: allowing for control over SET ROLE

2023-01-12 Thread Noah Misch
On Thu, Jan 12, 2023 at 10:21:32AM -0500, Robert Haas wrote: > On Thu, Jan 12, 2023 at 12:09 AM Noah Misch wrote: > > > --- a/doc/src/sgml/ref/grant.sgml > > > +++ b/doc/src/sgml/ref/grant.sgml > > > @@ -298,6 +298,20 @@ GRANT > > class="parameter">role_name [, ...] TO > > This option

Re: Exposing the lock manager's WaitForLockers() to SQL

2023-01-12 Thread Will Mortensen
Hi Andres, On Thu, Jan 12, 2023 at 7:49 PM Andres Freund wrote: > Consider a scenario like this: > > tx 1: acquires RowExclusiveLock on tbl1 to insert rows > tx 2: acquires AccessShareLock on tbl1 > tx 2: WaitForLockers(ShareRowExclusiveLock, tbl1) ends up waiting for tx1 > tx 1: truncate tbl1

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

2023-01-12 Thread Peter Smith
Here are some review comments for patch v79-0002. == General 1. I saw that earlier in this thread Hou-san [1] and Amit [2] also seemed to say there is not much point for this patch. So I wanted to +1 that same opinion. I feel this patch just adds more complexity for almost no gain: -

Re: Cygwin cleanup

2023-01-12 Thread Andres Freund
Hi, On 2023-01-12 22:17:55 -0600, Justin Pryzby wrote: > On Thu, Jan 12, 2023 at 06:43:54PM -0800, Andres Freund wrote: > > Are you actually proposing that we don't PANIC after an fsync for the > > category > > of files that you list here, even with data_sync_retry set? > > Yes, but I'm

Re: PL/Python: Fix return in the middle of PG_TRY() block.

2023-01-12 Thread Andres Freund
Hi, On 2023-01-12 10:44:33 -0800, Nathan Bossart wrote: > On Thu, Jan 12, 2023 at 11:19:29PM +0800, Xing Guo wrote: > > @@ -690,12 +690,12 @@ PLy_trigger_build_args(FunctionCallInfo fcinfo, > > PLyProcedure *proc, HeapTuple *r > > PyObject *volatile pltdata = NULL; > > char

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

2023-01-12 Thread Masahiko Sawada
On Thu, Jan 12, 2023 at 9:34 PM houzj.f...@fujitsu.com wrote: > > On Thursday, January 12, 2023 7:08 PM Amit Kapila > wrote: > > > > On Thu, Jan 12, 2023 at 4:21 PM shveta malik wrote: > > > > > > On Thu, Jan 12, 2023 at 10:34 AM Amit Kapila > > wrote: > > > > > > > > On Thu, Jan 12, 2023 at

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

2023-01-12 Thread Ankit Kumar Pandey
On 13/01/23 07:48, David Rowley wrote: I don't think you can claim that one so easily. The two should have quite different scaling characteristics which will be more evident with a larger number of input rows. Also, Hash Aggregate makes use of work_mem * hash_mem_multiplier, whereas sort

Re: pg_stat_bgwriter.buffers_backend is pretty meaningless (and more?)

2023-01-12 Thread Justin Pryzby
On Thu, Jan 12, 2023 at 09:19:36PM -0500, Melanie Plageman wrote: > On Wed, Jan 11, 2023 at 4:58 PM Justin Pryzby wrote: > > > > > Subject: [PATCH v45 4/5] Add system view tracking IO ops per backend type > > > > The patch can/will fail with: > > > > CREATE TABLESPACE test_io_shared_stats_tblspc

Re: Lazy allocation of pages required for verifying FPI consistency

2023-01-12 Thread Michael Paquier
On Thu, Jan 12, 2023 at 04:37:38PM +0800, Julien Rouhaud wrote: > On Thu, Jan 12, 2023 at 4:29 PM Kyotaro Horiguchi > wrote: >> IMHO, it's a bit scaring to me to push down the execution stack by >> that large size. I tend to choose the (current) possible memory >> wasting only on startup process

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

2023-01-12 Thread Peter Smith
On Fri, Jan 13, 2023 at 2:37 PM Amit Kapila wrote: > > > 3. > > > > > > + leader_pid integer > > + > > + > > + Process ID of the leader apply worker if this process is a parallel > > + apply worker; NULL if this process is a leader apply worker or does > >

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

2023-01-12 Thread Masahiko Sawada
On Fri, Jan 13, 2023 at 1:28 PM Amit Kapila wrote: > > On Fri, Jan 13, 2023 at 9:06 AM Amit Kapila wrote: > > > > On Fri, Jan 13, 2023 at 7:56 AM Peter Smith wrote: > > > > > > > > > > > 3. > > > > > > > > > + leader_pid integer > > > + > > > + > > > + Process ID

Re: Add SHELL_EXIT_CODE to psql

2023-01-12 Thread Corey Huinker
> > I belive, we need proper includes. > Given that wait_error.c already seems to have the right includes worked out for WEXITSTATUS/WIFSTOPPED/etc, I decided to just add a function there. I named it wait_result_to_exit_code(), but I welcome suggestions of a better name. From

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

2023-01-12 Thread Amit Kapila
On Fri, Jan 13, 2023 at 9:06 AM Amit Kapila wrote: > > On Fri, Jan 13, 2023 at 7:56 AM Peter Smith wrote: > > > > > > > 3. > > > > > > + leader_pid integer > > + > > + > > + Process ID of the leader apply worker if this process is a parallel > > + apply

Re: Cygwin cleanup

2023-01-12 Thread Justin Pryzby
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 just a workaround. > > I don't follow. What does using fsync_fname() vs

Re: Exposing the lock manager's WaitForLockers() to SQL

2023-01-12 Thread Andres Freund
Hi, On 2023-01-12 19:21:00 -0800, Will Mortensen wrote: > FWIW re: deadlocks in general, I probably didn't highlight it well in my > original email, but the existing solution for this use case (as Marco > described in his blog post) is to actually lock the table momentarily. > Marco's blog post

Re: Blocking execution of SECURITY INVOKER

2023-01-12 Thread Andres Freund
On 2023-01-12 19:29:43 -0800, Andres Freund wrote: > Hi, > > On 2023-01-12 18:40:30 -0800, Jeff Davis wrote: > > On Wed, 2023-01-11 at 19:33 -0800, Andres Freund wrote: > > > > > and the > > > privilege check will be done with the rights of the admin in many of > > > these > > > contexts. > > > >

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

2023-01-12 Thread Amit Kapila
On Fri, Jan 13, 2023 at 7:56 AM Peter Smith wrote: > > Here are my review comments for v79-0001. > > == > > General > > 1. > > When Amit suggested [1] changing the name just to "leader_pid" instead > of "leader_apply_pid" I thought he was only referring to changing the > view column name, not

Re: Blocking execution of SECURITY INVOKER

2023-01-12 Thread Andres Freund
Hi, On 2023-01-12 18:40:30 -0800, Jeff Davis wrote: > On Wed, 2023-01-11 at 19:33 -0800, Andres Freund wrote: > > > and the > > privilege check will be done with the rights of the admin in many of > > these > > contexts. > > Can you explain? If the less-privileged user does *not* have execution

Re: Exposing the lock manager's WaitForLockers() to SQL

2023-01-12 Thread Will Mortensen
Hi Andres, On Thu, Jan 12, 2023 at 11:31 AM Andres Freund wrote: > I know that WaitForLockers() is an existing function :). I'm not sure it's > entirely suitable for your use case. So I mainly wanted to point out that if > you end up writing a separate version of it, you still need to integrate

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

2023-01-12 Thread shveta malik
On Thu, Jan 12, 2023 at 4:37 PM Amit Kapila wrote: > > > But then do you suggest that tomorrow if we allow parallel sync > workers then we have a separate column leader_sync_pid? I think that > doesn't sound like a good idea and moreover one can refer to docs for > clarification. > > -- okay,

Re: Cygwin cleanup

2023-01-12 Thread Andres Freund
Hi, On 2023-01-11 22:39:49 -0600, Justin Pryzby wrote: > Thomas raised a good question, which was how the tests were passing when > SnapBuildSerialize() was raising an error, which is what it would've > been doing when I used data_sync_retry=no. Presumably some test not checking for failures in

Re: Blocking execution of SECURITY INVOKER

2023-01-12 Thread Jeff Davis
On Wed, 2023-01-11 at 19:33 -0800, Andres Freund wrote: > and the > privilege check will be done with the rights of the admin in many of > these > contexts. Can you explain? > And encouraging more security definer functions to be used will cause > a lot of > other security issues. My proposal

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

2023-01-12 Thread Peter Smith
Here are my review comments for v79-0001. == General 1. When Amit suggested [1] changing the name just to "leader_pid" instead of "leader_apply_pid" I thought he was only referring to changing the view column name, not also the internal member names of the worker structure. Maybe it is OK

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

2023-01-12 Thread David Rowley
On Wed, 11 Jan 2023 at 19:21, Ankit Kumar Pandey wrote: > HashAgg has better cost than Unique even with incremental sort (tried > with other case > > where we have more columns pushed down but still hashAgg wins). I don't think you can claim that one so easily. The two should have quite

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

2023-01-12 Thread Michael Paquier
On Thu, Jan 12, 2023 at 10:10:02AM +0100, Jelte Fennema wrote: > It also makes the code simpler as we can simply reuse the > check_role function, since that. I removed the lines you quoted > since those are actually not strictly necessary. They only change > the detection logic a bit in case of a

Re: Missed condition-variable wakeups on FreeBSD

2023-01-12 Thread Thomas Munro
On Sun, Feb 27, 2022 at 8:07 AM Tom Lane wrote: > I have observed this three times in the REL_11 branch, once > in REL_12, and a couple of times last summer before it occurred > to me to start keeping notes. Over that time the machine has > been running various patchlevels of FreeBSD 13.0. FTR

Re: PL/Python: Fix return in the middle of PG_TRY() block.

2023-01-12 Thread Michael Paquier
On Thu, Jan 12, 2023 at 10:44:33AM -0800, Nathan Bossart wrote: > There's another "return" later on in this PG_TRY block. I wonder if it's > possible to detect this sort of thing at compile time. Note also: src/pl/tcl/pltcl.c- * PG_CATCH(); src/pl/tcl/pltcl.c- * { src/pl/tcl/pltcl.c- *

Re: pgsql: Add new GUC createrole_self_grant.

2023-01-12 Thread David G. Johnston
On Thu, Jan 12, 2023 at 8:11 AM Robert Haas wrote: > On Wed, Jan 11, 2023 at 7:53 PM David G. Johnston > wrote: > > Justed wanted to chime in and say Robert has eloquently put into words > much of what I have been thinking here, and that I concur that guiding the > DBA to use care with the

PG_SETMASK() archeology

2023-01-12 Thread Thomas Munro
Hi, This is a follow-up for commit c94ae9d8. It's in the spirit of other recent changes to remove noise from ancient pre-standard systems. The reason we introduced PG_SETMASK() in the first place was to support one particular system that was very slow to adopt the POSIX signals stuff: NeXTSTEP

Re: mprove tab completion for ALTER EXTENSION ADD/DROP

2023-01-12 Thread vignesh C
On Thu, 12 Jan 2023 at 05:22, Michael Paquier wrote: > > On Wed, Jan 11, 2023 at 10:29:25PM +0530, vignesh C wrote: > > I too felt keeping it simpler is better. How about using the simple > > first version of patch itself? > > Okay, I have just done that, then, after checking that all the object

Re: Beautify pg_walinspect docs a bit

2023-01-12 Thread Michael Paquier
On Thu, Jan 12, 2023 at 05:29:39PM +0530, Bharath Rupireddy wrote: > As discussed [1], here's a patch to beautify pg_walinspect docs > similar to pageinspect docs. The existing pg_walinspect docs calls out > the column names explicitly and then also shows them in the function > execution examples

Re: document the need to analyze partitioned tables

2023-01-12 Thread Nathan Bossart
On Wed, Oct 05, 2022 at 10:37:01AM +0200, Laurenz Albe wrote: > On Mon, 2022-03-28 at 15:05 +0200, Tomas Vondra wrote: >> I've pushed the last version, and backpatched it to 10 (not sure I'd >> call it a bugfix, but I certainly agree with Justin it's worth >> mentioning in the docs, even on older

Re: [EXTERNAL] Re: Support load balancing in libpq

2023-01-12 Thread Jacob Champion
On Wed, Sep 14, 2022 at 7:54 AM Maxim Orlov wrote: > For the patch itself, I think it is better to use a more precise time > function in libpq_prng_init or call it only once. > Thought it is a special corner case, imagine all the connection attempts at > first second will be seeded with the

Experimenting with Postmaster variable scope

2023-01-12 Thread Thomas Munro
Hi, While working on the postmaster latch stuff, one of the things I looked into, but de-scoped for now, is how the postmaster code would look if it didn't use global variables to track its sockets, children and state (ie now that it's no longer necessary for technical reasons). Here's the quick

Re: Patch: Global Unique Index

2023-01-12 Thread Cary Huang
On 2022-11-29 6:16 p.m., Tom Lane wrote: Assuming that you are inserting into index X, and you've checked index Y to find that it has no conflicts, what prevents another backend from inserting a conflict into index Y just after you look? AIUI the idea is to prevent that by continuing to hold an

Re: Decoupling antiwraparound autovacuum from special rules around auto cancellation

2023-01-12 Thread Peter Geoghegan
On Thu, Jan 12, 2023 at 1:08 PM Robert Haas wrote: > I doubt it. Wiggle room that's based on the XID threshold being > different for one behavior vs. another can easily fail to produce any > benefit, because there's no guarantee that the autovacuum launcher > will ever try to launch a worker

Re: Using WaitEventSet in the postmaster

2023-01-12 Thread Thomas Munro
On Fri, Jan 13, 2023 at 7:26 AM Andres Freund wrote: > On 2023-01-12 20:35:43 +1300, Thomas Munro wrote: > > Subject: [PATCH] Fix WaitEventSetWait() buffer overrun. > Makes sense. We should backpatch this, I think? Done.

Re: Decoupling antiwraparound autovacuum from special rules around auto cancellation

2023-01-12 Thread Robert Haas
On Thu, Jan 12, 2023 at 2:22 PM Peter Geoghegan wrote: > All that I really want to do here is give an autovacuum that *can* be > auto cancelled *some* non-zero chance to succeed with these kinds of > tables. TRUNCATE completes immediately, so the AEL is no big deal. > Except when it's blocked

Re: errdetail vs errdetail_log?

2023-01-12 Thread Christophe Pettus
> On Jan 12, 2023, at 12:35, Andres Freund wrote: > > On 2023-01-12 12:28:39 -0800, Christophe Pettus wrote: >> What's the distinction between errdetail and errdetail_log in the ereport >> interface? > > Only goes to the server log, not to the client. Thanks!

Re: GUC for temporarily disabling event triggers

2023-01-12 Thread Ted Yu
On Thu, Jan 12, 2023 at 12:26 PM Daniel Gustafsson wrote: > > On 11 Jan 2023, at 17:38, vignesh C wrote: > > > > On Tue, 29 Nov 2022 at 18:16, Daniel Gustafsson wrote: > >> > >>> On 3 Nov 2022, at 21:47, Daniel Gustafsson wrote: > >> > >>> The patch adds a new GUC, ignore_event_trigger with

Re: errdetail vs errdetail_log?

2023-01-12 Thread Andres Freund
On 2023-01-12 12:28:39 -0800, Christophe Pettus wrote: > What's the distinction between errdetail and errdetail_log in the ereport > interface? Only goes to the server log, not to the client.

errdetail vs errdetail_log?

2023-01-12 Thread Christophe Pettus
What's the distinction between errdetail and errdetail_log in the ereport interface?

Re: GUC for temporarily disabling event triggers

2023-01-12 Thread Daniel Gustafsson
> On 11 Jan 2023, at 17:38, vignesh C wrote: > > On Tue, 29 Nov 2022 at 18:16, Daniel Gustafsson wrote: >> >>> On 3 Nov 2022, at 21:47, Daniel Gustafsson wrote: >> >>> The patch adds a new GUC, ignore_event_trigger with two option values, 'all' >>> and 'none' (the login event patch had

Re: Transaction timeout

2023-01-12 Thread Andrey Borodin
On Thu, Jan 12, 2023 at 11:24 AM Nathan Bossart wrote: > > On Sun, Dec 18, 2022 at 12:53:31PM -0800, Andrey Borodin wrote: > > I've rewritten this part to correctly report all timeouts that did > > happen. However there's now a tricky comma-formatting code which was > > tested only manually. > >

Re: Exposing the lock manager's WaitForLockers() to SQL

2023-01-12 Thread Andres Freund
Hi, On 2023-01-11 23:03:30 -0800, Will Mortensen wrote: > On Wed, Jan 11, 2023 at 12:33 PM Andres Freund wrote: > > I think such a function would still have to integrate enough with the lock > > manager infrastructure to participate in the deadlock detector. Otherwise I > > think you'd trivially

Re: Transaction timeout

2023-01-12 Thread Nathan Bossart
On Sun, Dec 18, 2022 at 12:53:31PM -0800, Andrey Borodin wrote: > I've rewritten this part to correctly report all timeouts that did > happen. However there's now a tricky comma-formatting code which was > tested only manually. I suspect this will make translation difficult. >> > > > +

Re: Decoupling antiwraparound autovacuum from special rules around auto cancellation

2023-01-12 Thread Peter Geoghegan
On Thu, Jan 12, 2023 at 9:12 AM Robert Haas wrote: > I do agree that it's good to slowly increase the aggressiveness of > VACUUM as we get further behind, rather than having big behavior > changes all at once, but I think that should happen by smoothly > varying various parameters rather than by

Re: drop postmaster symlink

2023-01-12 Thread Devrim Gündüz
Hi, On Thu, 2023-01-12 at 13:35 -0500, Joe Conway wrote: > To be clear, I am completely in agreement with you about removing the > symlink. I just wanted to be sure Devrim was alerted because I knew > he had a strong opinion on this topic ;-) Red Hat's own packages, thus their users may be

Re: [PoC] Federated Authn/z with OAUTHBEARER

2023-01-12 Thread mahendrakar s
Hi All, Changes added to Jacob's patch(v2) as per the discussion in the thread. The changes allow the customer to send the OAUTH BEARER token through psql connection string. Example: psql -U u...@example.com -d 'dbname=postgres oauth_bearer_token=abc' To configure OAUTH, the pg_hba.conf line

Re: Can we let extensions change their dumped catalog schemas?

2023-01-12 Thread Jacob Champion
On Wed, Jan 11, 2023 at 1:03 PM Tom Lane wrote: > Jacob Champion writes: > > Right, I think it would have to be opt-in. Say, a new control file > > option dump_version or some such. > > That would require all the installed extensions to cope with this > the same way, which does not seem like a

Re: PL/Python: Fix return in the middle of PG_TRY() block.

2023-01-12 Thread Nathan Bossart
On Thu, Jan 12, 2023 at 11:19:29PM +0800, Xing Guo wrote: > I was running static analyser against PostgreSQL and found there're 2 > return statements in PL/Python module which is not safe. Patch is > attached. Is the problem that PG_exception_stack and error_context_stack aren't properly reset?

Re: Named Operators

2023-01-12 Thread David G. Johnston
On Thu, Jan 12, 2023 at 10:14 AM Tom Lane wrote: > Isaac Morland writes: > > What about backticks (`)? They are allowed as operator characters but do > > not otherwise appear in the lexical syntax as far as I can tell: > > https://www.postgresql.org/docs/current/sql-syntax-lexical.html > >

Re: drop postmaster symlink

2023-01-12 Thread Joe Conway
On 1/12/23 12:00, Peter Eisentraut wrote: On 23.11.22 21:32, Joe Conway wrote: Yeah. Also, I don't think it's generally too hard to find the parent process anyway, because at least on my system, the other ones end up with ps display that looks like "postgres: logical replication launcher" or

Re: Using WaitEventSet in the postmaster

2023-01-12 Thread Andres Freund
Hi, On 2023-01-12 20:35:43 +1300, Thomas Munro wrote: > Subject: [PATCH] Fix WaitEventSetWait() buffer overrun. > > The WAIT_USE_EPOLL and WAIT_USE_KQUEUE implementations of > WaitEventSetWaitBlock() confused the size of their internal buffer with > the size of the caller's output buffer, and

Re: Generate pg_stat_get_xact*() functions with Macros

2023-01-12 Thread Andres Freund
Hi, On 2023-01-12 08:38:57 +0100, Drouvot, Bertrand wrote: > On 1/11/23 11:59 PM, Andres Freund wrote: > > > Now that this patch renames some fields > > > > I don't mind renaming the fields - the prefixes really don't provide > > anything > > useful. But it's not clear why this is related to

Re: recovery modules

2023-01-12 Thread Nathan Bossart
On Thu, Jan 12, 2023 at 03:30:40PM +0900, Michael Paquier wrote: > On Wed, Jan 11, 2023 at 11:29:01AM -0800, Nathan Bossart wrote: >> I initially created a separate basic_restore module, but decided to fold it >> into basic_archive to simplify the patch and tests. I hesitated to rename >> it

Re: Minimal logical decoding on standbys

2023-01-12 Thread Andres Freund
Hi, On 2023-01-12 20:08:55 +0530, Ashutosh Sharma wrote: > I previously participated in the discussion on "Synchronizing the > logical replication slots from Primary to Standby" and one of the > purposes of that project was to synchronize logical slots from primary > to standby so that if

Re: Remove nonmeaningful prefixes in PgStat_* fields

2023-01-12 Thread Andres Freund
Hi, On 2023-01-12 18:12:52 +0100, Alvaro Herrera wrote: > On 2023-Jan-12, Drouvot, Bertrand wrote: > > > Please find attached a patch to $SUBJECT. > > > > It is a preliminary patch for [1]. > > > > The main ideas are: 1) to have consistent naming between the pg_stat_get*() > > functions > > and

Re: What object types should be in schemas?

2023-01-12 Thread Alvaro Herrera
On 2023-Jan-11, Peter Eisentraut wrote: > How does one decide whether something should be in a schema or not? The > current state feels intuitively correct, but I can't determine any firm way > to decide. > > Over in the column encryption thread, the patch proposes to add various key > types as

Re: Named Operators

2023-01-12 Thread Vik Fearing
On 1/12/23 18:14, Tom Lane wrote: Pretty much the only available syntax space is curly braces, and I don't really want to give those up for this either. (One has to assume that the SQL committee has their eyes on those too.) They are used in row pattern recognition. -- Vik Fearing

Re: Refactor recordExtObjInitPriv()

2023-01-12 Thread Nathan Bossart
On Thu, Jan 12, 2023 at 12:20:50PM -0500, Tom Lane wrote: > Peter Eisentraut writes: >> On 12.01.23 01:04, Nathan Bossart wrote: >> - classoid == AggregateRelationId || >>> I noticed that AggregateRelationId isn't listed in the ObjectProperty >>> array, so I think

Re: on placeholder entries in view rule action query's range table

2023-01-12 Thread Tom Lane
Andrew Dunstan writes: > On 2023-01-12 Th 09:54, Tom Lane wrote: >> I was wondering whether we could store a per-version patch or Perl >> script that edits the old dump file to remove known discrepancies >> from HEAD. > so, say in src/test/perl we have PostgreSQL/AdjustUpgrade.pm with a >

Re: Remove nonmeaningful prefixes in PgStat_* fields

2023-01-12 Thread Tom Lane
Alvaro Herrera writes: > I don't like this at all. With these prefixes in place, it's much more > likely that you'll be able to grep the whole source tree and not run > into tons of false positives. If you remove them, that tends to be not > very workable. If we use these commits as precedent

Re: Refactor recordExtObjInitPriv()

2023-01-12 Thread Tom Lane
Peter Eisentraut writes: > On 12.01.23 01:04, Nathan Bossart wrote: > - classoid == AggregateRelationId || >> I noticed that AggregateRelationId isn't listed in the ObjectProperty >> array, so I think recordExtObjInitPriv() will begin erroring for that >> classoid instead of

Re: on placeholder entries in view rule action query's range table

2023-01-12 Thread Andrew Dunstan
On 2023-01-12 Th 09:54, Tom Lane wrote: > > I was wondering whether we could store a per-version patch or Perl > script that edits the old dump file to remove known discrepancies > from HEAD. If well-maintained, that could eliminate the need for the > arbitrary "fuzz factors" that are in

Re: Remove nonmeaningful prefixes in PgStat_* fields

2023-01-12 Thread Alvaro Herrera
On 2023-Jan-12, Drouvot, Bertrand wrote: > Please find attached a patch to $SUBJECT. > > It is a preliminary patch for [1]. > > The main ideas are: 1) to have consistent naming between the pg_stat_get*() > functions > and their associated counters and 2) to define the new macros in [1] the

Re: Refactor recordExtObjInitPriv()

2023-01-12 Thread Peter Eisentraut
On 12.01.23 01:04, Nathan Bossart wrote: -classoid == AggregateRelationId || I noticed that AggregateRelationId isn't listed in the ObjectProperty array, so I think recordExtObjInitPriv() will begin erroring for that classoid instead of ignoring it like we do today.

Re: Named Operators

2023-01-12 Thread Tom Lane
Isaac Morland writes: > What about backticks (`)? They are allowed as operator characters but do > not otherwise appear in the lexical syntax as far as I can tell: > https://www.postgresql.org/docs/current/sql-syntax-lexical.html Since they're already allowed as operator characters, you can't

Re: Decoupling antiwraparound autovacuum from special rules around auto cancellation

2023-01-12 Thread Robert Haas
On Mon, Jan 9, 2023 at 8:40 PM Peter Geoghegan wrote: > That's not what the patch does. It doubles the time that the anti-wrap > no-autocancellation behaviors kick in, up to a maximum of 1 billion > XIDs/MXIDs. So it goes from autovacuum_freeze_max_age to > autovacuum_freeze_max_age x 2, without

Re: Remove source code display from \df+?

2023-01-12 Thread Isaac Morland
On Thu, 12 Jan 2023 at 10:04, Magnus Hagander wrote: We could shorten it to "See \sf" or something like that. But if we change >>> the column header to "internal name" or the like, then the column just >>> obviously doesn't apply for non-internal languages, so leaving it null >>> should be

Re: Named Operators

2023-01-12 Thread Isaac Morland
On Thu, 12 Jan 2023 at 05:59, Gurjeet Singh wrote: I'll consider using one of the other special characters. Do you have > any suggestions? > What about backticks (`)? They are allowed as operator characters but do not otherwise appear in the lexical syntax as far as I can tell:

Re: drop postmaster symlink

2023-01-12 Thread Peter Eisentraut
On 23.11.22 21:32, Joe Conway wrote: Yeah. Also, I don't think it's generally too hard to find the parent process anyway, because at least on my system, the other ones end up with ps display that looks like "postgres: logical replication launcher" or whatever. The main process doesn't set the ps

Re: Transparent column encryption

2023-01-12 Thread Peter Eisentraut
On 10.01.23 18:26, Mark Dilger wrote: I wonder if logical replication could be made to work more easily with this feature. Specifically, subscribers of encrypted columns will need the encrypted column encryption key (CEK) and the name of the column master key (CMD) as exists on the

Re: split TOAST support out of postgres.h

2023-01-12 Thread Peter Eisentraut
On 10.01.23 09:48, Peter Eisentraut wrote: On 10.01.23 08:39, Noah Misch wrote: On Tue, Jan 10, 2023 at 06:07:49AM +0100, Peter Eisentraut wrote: On 30.12.22 17:50, Tom Lane wrote: Peter Eisentraut writes: On 28.12.22 16:07, Tom Lane wrote: I dunno, #3 seems kind of unprincipled.  Also,

Re: Add SHELL_EXIT_CODE to psql

2023-01-12 Thread Maxim Orlov
Unfortunately, cirrus-ci still not happy https://cirrus-ci.com/task/6502730475241472 [23:14:34.206] time make -s -j${BUILD_JOBS} world-bin [23:14:43.174] psqlscanslash.l: In function ‘evaluate_backtick’: [23:14:43.174] psqlscanslash.l:827:11: error: implicit declaration of function ‘WIFSTOPPED’

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

2023-01-12 Thread Takamichi Osumi (Fujitsu)
Hi, Melih On Thursday, January 12, 2023 10:12 PM Melih Mutlu wrote: > I've a question about 032_apply_delay.pl. > ... > I couldn't quite see how these lines test whether ALTER SUBSCRIPTION > successfully worked. > Don't we need to check that min_apply_delay really changed as a result? Yeah,

Re: on placeholder entries in view rule action query's range table

2023-01-12 Thread Tom Lane
Justin Pryzby writes: > What about also including a dump from an old version, too ? > Then the upgrade test can test actual upgrades. The BF clients already do that (if enabled), but they work from up-to-date installations of the respective branch tips. I'd not want to have some branches

Re: on placeholder entries in view rule action query's range table

2023-01-12 Thread Justin Pryzby
On Thu, Jan 12, 2023 at 09:54:09AM -0500, Tom Lane wrote: > Andrew Dunstan writes: > > On 2023-01-12 Th 00:12, Justin Pryzby wrote: > >> It's ugly and a terrible hack, and I don't know whether anyone would say > >> it's good enough, but one could can probably avoid the diff like: > >> sed -r

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

2023-01-12 Thread Takamichi Osumi (Fujitsu)
Hi, Shveta Thanks for your comments! On Thursday, January 12, 2023 6:51 PM shveta malik wrote: > > Yes, DBAs may set wal_receiver_status_interval to more than > > wal_sender_timeout by mistake. > > > > But to handle the scenario we must compare between min_apply_delay *on > > subscriber* and

Re: daitch_mokotoff module

2023-01-12 Thread Paul Ramsey
> On Jan 12, 2023, at 7:30 AM, Dag Lem wrote: > > Paul Ramsey writes: > >> On Mon, Jan 2, 2023 at 2:03 PM Dag Lem wrote: >> >>> I also improved on the documentation example (using Full Text Search). >>> AFAIK you can't make general queries like that using arrays, however in >>> any case I

Re: PG11 to PG14 Migration Slowness

2023-01-12 Thread Tom Lane
Vigneshk Kvignesh writes: > I'm migrating our existing PG instances from PG11.4 to PG14.3. I > have around 5 Million Tables in a single database. When migrating using > pg_upgrade, its taking 3 hours for the process to complete. I'm not sure if > its the intended behaviour or we're

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

2023-01-12 Thread Takamichi Osumi (Fujitsu)
On Thursday, January 12, 2023 12:04 PM Kyotaro Horiguchi wrote: > At Wed, 11 Jan 2023 12:46:24 +, "Hayato Kuroda (Fujitsu)" > wrote in > > them. Which version is better? > > > Some comments by a quick loock, different from the above. Horiguchi-san, thanks for your review ! > +

Re: split TOAST support out of postgres.h

2023-01-12 Thread Robert Haas
On Wed, Jan 11, 2023 at 1:14 AM Noah Misch wrote: > If the patch had just made postgres.h include varatt.h, like it does elog.h, > I'd consider that change a nonnegative. Grouping things is nice, even if it > makes compilation a bit slower. That also covers your frontend use case. How > about

Re: daitch_mokotoff module

2023-01-12 Thread Dag Lem
Paul Ramsey writes: > On Mon, Jan 2, 2023 at 2:03 PM Dag Lem wrote: > >> I also improved on the documentation example (using Full Text Search). >> AFAIK you can't make general queries like that using arrays, however in >> any case I must admit that text arrays seem like more natural building >>

Re: Named Operators

2023-01-12 Thread David G. Johnston
On Thu, Jan 12, 2023 at 3:59 AM Gurjeet Singh wrote: > On Thu, Jan 12, 2023 at 1:49 AM Matthias van de Meent > wrote: > > > I'm -1 on the chosen syntax; :name: shadows common variable > > substitution patterns including those of psql. > > I'll consider using one of the other special characters.

Re: allowing for control over SET ROLE

2023-01-12 Thread Robert Haas
On Thu, Jan 12, 2023 at 12:09 AM Noah Misch wrote: > I think this is good to go modulo one or two things: > > > Subject: [PATCH v2] More documentation update for GRANT ... WITH SET OPTION. > > > > Update the reference pages for various ALTER commands that > > mentioned that you must be a member

Re: Named Operators

2023-01-12 Thread Tom Lane
Matthias van de Meent writes: > I'm -1 on the chosen syntax; :name: shadows common variable > substitution patterns including those of psql. Yeah, this syntax is DOA because of that. I think almost anything you might invent is going to have conflict risks. We could probably make it work by

PL/Python: Fix return in the middle of PG_TRY() block.

2023-01-12 Thread Xing Guo
Hi hackers, I was running static analyser against PostgreSQL and found there're 2 return statements in PL/Python module which is not safe. Patch is attached. -- Best Regards, Xing diff --git a/src/pl/plpython/plpy_exec.c b/src/pl/plpython/plpy_exec.c index 923703535a..c0e4a81283 100644 ---

Re: pgsql: Add new GUC createrole_self_grant.

2023-01-12 Thread Robert Haas
On Wed, Jan 11, 2023 at 7:53 PM David G. Johnston wrote: > Justed wanted to chime in and say Robert has eloquently put into words much > of what I have been thinking here, and that I concur that guiding the DBA to > use care with the power they have been provided is a sane position to take. > >

Re: Improving btree performance through specializing by key shape, take 2

2023-01-12 Thread David Christensen
Hi Matthias, I'm going to look at this patch series if you're still interested. What was the status of your final performance testing for the 0008 patch alone vs the specialization series? Last I saw on the thread you were going to see if the specialization was required or not. Best, David

Re: Remove source code display from \df+?

2023-01-12 Thread Magnus Hagander
On Thu, Jan 12, 2023 at 6:23 AM Pavel Stehule wrote: > > > st 11. 1. 2023 v 22:11 odesílatel Tom Lane napsal: > >> Pavel Stehule writes: >> > st 11. 1. 2023 v 19:31 odesílatel Magnus Hagander >> > napsal: >> >> This is only about Internal and C, isn't it? Isn't the oid of these >> >> static,

Re: on placeholder entries in view rule action query's range table

2023-01-12 Thread Tom Lane
Andrew Dunstan writes: > On 2023-01-12 Th 00:12, Justin Pryzby wrote: >> It's ugly and a terrible hack, and I don't know whether anyone would say >> it's good enough, but one could can probably avoid the diff like: >> sed -r '/CREATE/,/^$/{ s/\w+\.//g }' > That looks quite awful. I don't think

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

2023-01-12 Thread Masahiko Sawada
On Thu, Jan 12, 2023 at 5:21 PM John Naylor wrote: > > On Thu, Jan 12, 2023 at 12:44 PM Masahiko Sawada > wrote: > > > > On Wed, Jan 11, 2023 at 12:13 PM John Naylor > > wrote: > > > > > > On Tue, Jan 10, 2023 at 7:08 PM Masahiko Sawada > > > wrote: > > > I agree to keep this as a template.

Re: Minimal logical decoding on standbys

2023-01-12 Thread Ashutosh Sharma
Hi, On Thu, Jan 12, 2023 at 5:29 PM Drouvot, Bertrand wrote: > > Hi, > > On 1/11/23 7:04 PM, Drouvot, Bertrand wrote: > > Hi, > > > > Please find V38 attached, I'll look at the other comments you've done in > > [1] on 0004 and 0006. > > > > Sorry for joining late. I totally missed it. AFAICU,

Re: on placeholder entries in view rule action query's range table

2023-01-12 Thread Andrew Dunstan
On 2023-01-12 Th 00:12, Justin Pryzby wrote: > On Wed, Jan 11, 2023 at 10:45:33PM -0500, Tom Lane wrote: >> Amit Langote writes: >>> On Thu, Jan 12, 2023 at 10:06 AM Tom Lane wrote: I've pushed this with some cleanup --- aside from fixing outfuncs/readfuncs, I did some more work on

Re: Add index scan progress to pg_stat_progress_vacuum

2023-01-12 Thread Imseih (AWS), Sami
Thanks for the feedback and I apologize for the delay in response. >I think the problem here is that you're basically trying to work around the >lack of an asynchronous state update mechanism between leader and workers. > The >workaround is to add a lot of different places that poll

Re: Named Operators

2023-01-12 Thread Matthias van de Meent
On Thu, 12 Jan 2023 at 11:59, Gurjeet Singh wrote: > > On Thu, Jan 12, 2023 at 1:49 AM Matthias van de Meent > wrote: > > > > On Thu, 12 Jan 2023 at 10:16, Gurjeet Singh wrote: > > > > > > Technically correct name of this feature would be Readable Names for > > > Operators, or Pronounceable

  1   2   >