Re: Add SHELL_EXIT_CODE to psql

2022-12-03 Thread Corey Huinker
Rebased. Still waiting on feedback before working on documentation. On Fri, Nov 4, 2022 at 5:23 AM Corey Huinker wrote: > Oops, that sample output was from a previous run, should have been: > > -- SHELL_EXIT_CODE is undefined > \echo :SHELL_EXIT_CODE > :SHELL_EXIT_CODE > -- bad \! > \! borp >

Re: Make ON_ERROR_STOP stop on shell script failure

2022-12-03 Thread Corey Huinker
On Tue, Nov 22, 2022 at 6:16 PM Matheus Alcantara wrote: > --- Original Message --- > On Tuesday, November 22nd, 2022 at 20:10, bt22nakamorit < > bt22nakamo...@oss.nttdata.com> wrote: > > > > There was a mistake in the error message for \! so I updated the patch. > > > > Best, > >

Re: Generate pg_stat_get_* functions with Macros

2022-12-03 Thread Drouvot, Bertrand
Hi, On 12/3/22 9:16 PM, Nathan Bossart wrote: On Sat, Dec 03, 2022 at 10:31:19AM +0100, Drouvot, Bertrand wrote: On 12/3/22 1:51 AM, Nathan Bossart wrote: Can we hard-code the prefix in the macro? It looks like all of these use the same one. Good point! Done in V2 attached. Thanks. I

Re: Error-safe user functions

2022-12-03 Thread Tom Lane
Corey Huinker writes: > My own effort was getting bogged down in the number of changes I needed to > make in code paths that would never want a failover case for their > typecasts, so I'm going to refactor my work on top of this and see where I > get stuck. +1, that would be a good way to see if

Re: Error-safe user functions

2022-12-03 Thread Corey Huinker
> > I think there are just a couple of loose ends here: > > 1. Bikeshedding on my name choices is welcome. I know Robert is > dissatisfied with "ereturn", but I'm content with that so I didn't > change it here. > 1. details_please => include_error_data as this hints the reader directly to the

Re: Improve performance of pg_strtointNN functions

2022-12-03 Thread David Rowley
On Sun, 4 Dec 2022 at 13:52, David Rowley wrote: > Thanks. I'll start looking at the patch again now. If I don't find any > problems then I'll push it. Pushed with some small adjustments. David

Re: Improve performance of pg_strtointNN functions

2022-12-03 Thread David Rowley
On Fri, 2 Dec 2022 at 20:35, Peter Eisentraut wrote: > If we are happy with this patch, then it's okay with me if you push this > first. I'll probably need to do another pass over my patch anyway, so a > bit more work isn't a problem. Thanks. I'll start looking at the patch again now. If I

Re: Error-safe user functions

2022-12-03 Thread Tom Lane
Andrew Dunstan writes: > Great. Let's hope we can get this settled early next week and then we > can get to work on the next tranche of functions, those that will let > the SQL/JSON work restart. OK, here's a draft proposal. I should start out by acknowledging that this steals a great deal from

Re: Questions regarding distinct operation implementation

2022-12-03 Thread David Rowley
On Sun, 4 Dec 2022 at 08:57, Ankit Kumar Pandey wrote: > On 04/12/22 00:50, David Rowley wrote: >> providing you can code it in such a way that you only >> allocate one of these at once, i.e not allocate one per DISTINCT >> aggregate all at once. > > I am not sure if I understand this, does it

Re: Generate pg_stat_get_* functions with Macros

2022-12-03 Thread Nathan Bossart
On Sat, Dec 03, 2022 at 10:31:19AM +0100, Drouvot, Bertrand wrote: > On 12/3/22 1:51 AM, Nathan Bossart wrote: >> Can we hard-code the prefix in the macro? It looks like all of these use >> the same one. > > Good point! Done in V2 attached. Thanks. I editorialized a bit in the attached v3.

Re: Questions regarding distinct operation implementation

2022-12-03 Thread Ankit Kumar Pandey
On 04/12/22 00:50, David Rowley wrote: We do our best to ensure that a given executor node never uses more than work_mem. Certainly, we still do have nodes that can exceed this by a long way. It would be unlikely that we'd accept anything new that could do this. Makes sense, also would

Re: Questions regarding distinct operation implementation

2022-12-03 Thread David Rowley
On Sat, 3 Dec 2022 at 20:36, Ankit Kumar Pandey wrote: > Shouldn't this be an acceptable tradeoff if someone wants to perform > extra operation in plain old aggregates? Although I am not sure how much > this extra memory and compute usage is considered as acceptable. We do our best to ensure

Re: Replace PROC_QUEUE / SHM_QUEUE with ilist.h

2022-12-03 Thread Andres Freund
Hi, On 2022-11-19 21:59:30 -0800, Andres Freund wrote: > In [1] Robert justifiably complained about the use of PROC_QUEUE. I've > previously been bothered by this in [2], but didn't get around to finishing > the patches. > > One thing that made me hesitate was the naming of the function for a)

Re: Transaction timeout

2022-12-03 Thread Andrey Borodin
On Fri, Dec 2, 2022 at 10:59 PM Nikolay Samokhvalov wrote: > > But it fails in the "worst" case I've described above – a series of small > statements: Fixed. Added test for this. Open questions: 1. Docs 2. Order of reporting if happened lock_timeout, statement_timeout, and transaction_timeout

Re: mprove tab completion for ALTER EXTENSION ADD/DROP

2022-12-03 Thread Matheus Alcantara
--- Original Message --- On Sunday, November 27th, 2022 at 10:24, vignesh C wrote: > Hi, > > Tab completion for ALTER EXTENSION ADD and DROP was missing, this > patch adds the tab completion for the same. > > Regards, > Vignesh Hi Vignesh I've tested your patched on current master

Re: pg_dump: Remove "blob" terminology

2022-12-03 Thread Andrew Dunstan
On 2022-12-02 Fr 12:40, Tom Lane wrote: > Andrew Dunstan writes: >> On 2022-12-02 Fr 09:18, Tom Lane wrote: >>> The scheme I've vaguely thought about, but not got round to writing, >>> is to merge all blobs with the same owner and ACL into one TOC entry. >>> One would hope that would get it

Re: CREATE INDEX CONCURRENTLY on partitioned index

2022-12-03 Thread Ilya Gladyshev
Hi, Thank you Justin and Alexander for working on this, I have reviewed and tested the latest patch, it works well, the problems mentioned previously are all fixed. I like the idea of sharing code of reindex and index, but I have noticed some peculiarities as a user.  The reporting is somewhat

Re: Traversing targetlist to find accessed columns

2022-12-03 Thread Tom Lane
Amin writes: > Having a query, I am trying to find out all the columns that need to be > accessed (their varattno and vartype). I have access to a targetlist > representing a tree like this. So, I am looking for a function that > recursively traverses the tree and gives me the VARs. So, for

Re: Avoid streaming the transaction which are skipped (in corner cases)

2022-12-03 Thread Amit Kapila
On Tue, Nov 29, 2022 at 12:23 PM houzj.f...@fujitsu.com wrote: > > On Tuesday, November 29, 2022 12:08 PM Dilip Kumar > wrote: > > I have few comments about the patch. > > 1. > > 1.1. > - /* For streamed transactions notify the remote node about the abort. > */ > - if

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

2022-12-03 Thread Peter Smith
(Resending this because somehow my previous post did not appear in the mail archives) -- Forwarded message - From: Peter Smith Date: Fri, Dec 2, 2022 at 7:59 PM Subject: Re: Perform streaming logical transactions by background workers and parallel apply To: houzj.f...@fujitsu.com

Traversing targetlist to find accessed columns

2022-12-03 Thread Amin
Hi, Having a query, I am trying to find out all the columns that need to be accessed (their varattno and vartype). I have access to a targetlist representing a tree like this. So, I am looking for a function that recursively traverses the tree and gives me the VARs. So, for SELECT a,b,b+c from

Re: Generate pg_stat_get_* functions with Macros

2022-12-03 Thread Drouvot, Bertrand
Hi, On 12/3/22 1:51 AM, Nathan Bossart wrote: Overall, this change looks straightforward, and it saves a couple hundred lines. Thanks for looking at it! On Tue, Nov 22, 2022 at 08:09:22AM +0100, Drouvot, Bertrand wrote: +/* pg_stat_get_numscans */