How to get position in array with JSONPath

2020-09-12 Thread Pavel Stehule
Hi I try to solve issue https://stackoverflow.com/questions/63864906/plpgsql-parse-json-in-parameter-and-compose-json-out-parameter with JSONPath and I have a problem to get index of some value in array. Is it possible with JSONPath? Regards Pavel

Re: recovering from "found xmin ... from before relfrozenxid ..."

2020-09-12 Thread Tom Lane
Robert Haas writes: > I have committed this version. This failure says that the test case is not entirely stable: https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=sungazer&dt=2020-09-12%2005%3A13%3A12 diff -U3 /home/nm/farm/gcc64/HEAD/pgsql.build/contrib/pg_surgery/expected/heap_surgery

Re: Missing "Up" navigation link between parts and doc root?

2020-09-12 Thread Peter Eisentraut
On 2020-09-11 14:58, Fabien COELHO wrote: On 2020-09-08 21:10, Bruce Momjian wrote: I see this only applied to master. Shouldn't this be backpatched? I wasn't planning to. It's not a bug fix. Other thoughts? Yep. ISTM nicer if all docs have the same navigation, especially as googling o

Re: Parallel worker hangs while handling errors.

2020-09-12 Thread Tom Lane
Robert Haas writes: > On Fri, Sep 11, 2020 at 4:20 PM Tom Lane wrote: >> It's not clear to me whether we want to institute the "accepting SIGQUIT >> is always okay" rule in processes that didn't already have code to change >> BlockSig. > I think a backend process that isn't timely handling SIGQU

Re: Function to execute a program

2020-09-12 Thread Andrew Dunstan
On 9/12/20 11:11 AM, Magnus Hagander wrote: > > > On Sat, Sep 12, 2020 at 5:06 PM Tom Lane > wrote: > > Magnus Hagander mailto:mag...@hagander.net>> > writes: > > Would it make sense to have a pg_execute_program() that > corresponds to COPY > > FROM

Re: Function to execute a program

2020-09-12 Thread Magnus Hagander
On Sat, Sep 12, 2020 at 5:06 PM Tom Lane wrote: > Magnus Hagander writes: > > Would it make sense to have a pg_execute_program() that corresponds to > COPY > > FROM PROGRAM? This would obviously have the same permissions restrictions > > as COPY FROM PROGRAM. > > The usecase would be to for exam

Re: Function to execute a program

2020-09-12 Thread Tom Lane
Magnus Hagander writes: > Would it make sense to have a pg_execute_program() that corresponds to COPY > FROM PROGRAM? This would obviously have the same permissions restrictions > as COPY FROM PROGRAM. > The usecase would be to for example execute a command that returns json > format output, which

Re: Logical Replication - detail message with names of missing columns

2020-09-12 Thread Bharath Rupireddy
On Fri, Sep 11, 2020 at 9:05 PM Alvaro Herrera wrote: > > On 2020-Sep-11, Tom Lane wrote: > > > Check, but you could imagine that the column-list string is constructed > > with code along the lines of > > > > if (first) > > appendStringInfo(buf, _("\"%s\""), colname); > > els

Re: Inconsistency in determining the timestamp of the db statfile.

2020-09-12 Thread Magnus Hagander
On Fri, Sep 11, 2020 at 4:53 AM Amit Kapila wrote: > On Thu, Sep 10, 2020 at 6:42 PM Alvaro Herrera > wrote: > > > > On 2020-Sep-10, Amit Kapila wrote: > > > > > On Thu, Sep 10, 2020 at 1:03 PM Magnus Hagander > wrote: > > > > > The comments already say what you said in the second suggestion:"T

Function to execute a program

2020-09-12 Thread Magnus Hagander
Today we have pg_read_file() and pg_read_binary_file(), which mostly correspond to COPY from a file, but reads a whole (or parts but based on bytes) into a single value rather than rows. Would it make sense to have a pg_execute_program() that corresponds to COPY FROM PROGRAM? This would obviously

Re: Inconsistency in determining the timestamp of the db statfile.

2020-09-12 Thread Amit Kapila
On Thu, Sep 10, 2020 at 1:13 PM Amit Kapila wrote: > > > BTW, do we want to backpatch this? There is no user reported bug and > not sure if the user will encounter any problem. I think it is a minor > improvement and more of code consistency. So, making HEAD only change > should be okay. > Seeing

Re: PATCH: logical_work_mem and logical streaming of large in-progress transactions

2020-09-12 Thread Amit Kapila
On Wed, Sep 9, 2020 at 2:26 PM Amit Kapila wrote: > > On Wed, Sep 9, 2020 at 2:13 PM Tomas Vondra > wrote: > > > > Hi, > > > > while looking at the streaming code I noticed two minor issues: > > > > 1) logicalrep_read_stream_stop is never defined/called, so the prototype > > in logicalproto.h is

Re: [HACKERS] logical decoding of two-phase transactions

2020-09-12 Thread Amit Kapila
On Wed, Sep 9, 2020 at 3:33 PM Ajin Cherian wrote: > > On Mon, Sep 7, 2020 at 11:17 PM Amit Kapila wrote: >> >> >> Nikhil has a test for the same >> (0004-Teach-test_decoding-plugin-to-work-with-2PC.Jan4) in his last >> email [1]. You might want to use it to test this behavior. I think you >> can

Re: Avoid incorrect allocation in buildIndexArray

2020-09-12 Thread Julien Rouhaud
Le sam. 12 sept. 2020 à 11:14, Michael Paquier a écrit : > On Fri, Sep 11, 2020 at 01:49:26PM +0200, Julien Rouhaud wrote: > > On Fri, Sep 11, 2020 at 1:39 PM Daniel Gustafsson > wrote: > >> Any reason not to bail early as per the attached? > > > > +1 > > Makes sense to me. This has also the ad

Re: Avoid incorrect allocation in buildIndexArray

2020-09-12 Thread Michael Paquier
On Fri, Sep 11, 2020 at 01:49:26PM +0200, Julien Rouhaud wrote: > On Fri, Sep 11, 2020 at 1:39 PM Daniel Gustafsson wrote: >> Any reason not to bail early as per the attached? > > +1 Makes sense to me. This has also the advantage to cause a crash if there is an attempt to refer to those empty a

Re: proposal: possibility to read dumped table's name from file

2020-09-12 Thread Pavel Stehule
Hi pá 11. 9. 2020 v 10:50 odesílatel Pavel Stehule napsal: > Hi > > po 7. 9. 2020 v 14:14 odesílatel Surafel Temesgen > napsal: > >> Hi Pavel >> >> On Fri, Sep 4, 2020 at 6:22 AM Pavel Stehule >> wrote: >> >>> >>> Here is updated patch for pg_dump >>> >>> >> pg_dumpall also has –exclude-databa