Re: Allow to_date() and to_timestamp() to accept localized names

2019-09-22 Thread Juan José Santamaría Flecha
On Wed, Sep 18, 2019 at 11:09 AM Juan José Santamaría Flecha wrote: > > On Fri, Sep 13, 2019 at 10:31 PM Alvaro Herrera > wrote: > > > Thanks for taking a look at this. > > > I'm confused why we acquire the MONTH_DIM / etc definitions. Can't we > > just use lengthof() of the corresponding

Re: Wrong sentence in the README?

2019-09-22 Thread Tom Lane
"Daniel Westermann (DWE)" writes: > in the README, top level, there is this: > PostgreSQL has many language interfaces, many of which are listed here: > https://www.postgresql.org/download > I don't think the download page lists any language interfaces or do I miss > something? Not directly

JSONPATH documentation

2019-09-22 Thread Jeff Janes
I find the documentation in https://www.postgresql.org/docs/12/functions-json.html very confusing. In table 9.44 take the first entry, Example JSON {"x": [2.85, -14.7, -9.4]} Example Query + $.x.floor() Result 2, -15, -10 There are no end to end examples here. How do I apply the example

Re: Index Skip Scan

2019-09-22 Thread Dmitry Dolgov
> On Thu, Sep 5, 2019 at 9:41 PM Alvaro Herrera from 2ndQuadrant > wrote: > > On 2019-Sep-05, Dmitry Dolgov wrote: > > > Here is the version in which stepping between the pages works better. It > > seems > > sufficient to fix the case you've mentioned before, but for that we need to > >

Re: The flinfo->fn_extra question, from me this time.

2019-09-22 Thread Tom Lane
Dent John writes: > On 21 Jul 2019, at 22:54, Tom Lane wrote: >> Chapman Flack writes: >>> But looking in the code, I'm getting the impression that those >>> benefits are only theoretical future ones, as ExecMakeTableFunctionResult >>> implements SFRM_ValuePerCall mode by ... repeatedly calling

Re: WAL recycled despite logical replication slot

2019-09-22 Thread Jeff Janes
On Fri, Sep 20, 2019 at 11:27 AM Tomas Vondra wrote: > > > >Is there an innocent explanation for this? I thought logical replication > >slots provided an iron-clad guarantee that WAL would be retained until it > >was no longer needed. I am just using pub/sub, none of the lower level > >stuff.

Re: WAL recycled despite logical replication slot

2019-09-22 Thread Jeff Janes
On Fri, Sep 20, 2019 at 6:25 PM Andres Freund wrote: > Hi, > > On September 20, 2019 5:45:34 AM PDT, Jeff Janes > wrote: > >While testing something else (whether "terminating walsender process > >due to > >replication timeout" was happening spuriously), I had logical > >replication > >set up

Re: [PATCH] Improve performance of NOTIFY over many databases (v2)

2019-09-22 Thread Tom Lane
Martijn van Oosterhout writes: > On Mon, 16 Sep 2019 at 15:33, Tom Lane wrote: >> But do we care? With asyncQueueAdvanceTail gone from the listeners, >> there's no longer an exclusive lock for them to contend on. And, >> again, I failed to see any significant contention even in HEAD as it >>

Re: Unwanted expression simplification in PG12b2

2019-09-22 Thread Komяpa
Hi, On Fri, Sep 20, 2019 at 11:14 PM Robert Haas wrote: > On Wed, Jul 17, 2019 at 5:20 PM Darafei "Komяpa" Praliaskouski > wrote: > > Indeed, it seems I failed to minimize my example. > > > > Here is the actual one, on 90GB table with 16M rows: > >

Re: JSONPATH documentation

2019-09-22 Thread Tom Lane
Alexander Korotkov writes: > On Sun, Sep 22, 2019 at 9:18 PM Jeff Janes wrote: > Currently description of jsonpath is divided between datatypes section > and functions and operators section. And yes, this looks cumbersome. Agreed, but ... > I think we should move the whole description to the

Re: JSONPATH documentation

2019-09-22 Thread Alexander Korotkov
On Mon, Sep 23, 2019 at 1:03 AM Tom Lane wrote: > Alexander Korotkov writes: > > On Sun, Sep 22, 2019 at 9:18 PM Jeff Janes wrote: > > Currently description of jsonpath is divided between datatypes section > > and functions and operators section. And yes, this looks cumbersome. > > Agreed, but

Re: strong memory leak in plpgsql from handled rollback and lazy cast

2019-09-22 Thread Tom Lane
Andres Freund writes: > On 2019-09-22 18:43:23 -0400, Tom Lane wrote: >> I'm not convinced that it'd be safe to re-use an ExprState after a >> previous execution failed (though perhaps Andres has a different >> opinion?) > I don't immediately see why it'd be problematic to reuse at a later >

Re: Efficient output for integer types

2019-09-22 Thread David Fetter
On Sat, Sep 21, 2019 at 07:29:25AM +0100, Andrew Gierth wrote: > > "David" == David Fetter writes: > > David> +static inline uint32 > David> +decimalLength64(const uint64_t v) > > Should be uint64, not uint64_t. Fixed. > Also return an int, not a uint32. Fixed. > For int vs. int32, my

Re: WAL recycled despite logical replication slot

2019-09-22 Thread Andres Freund
Hi, On 2019-09-22 11:45:05 -0400, Jeff Janes wrote: > On Fri, Sep 20, 2019 at 6:25 PM Andres Freund wrote: > > Hi, > > >Is there an innocent explanation for this? I thought logical > > >replication > > >slots provided an iron-clad guarantee that WAL would be retained until > > >it > > >was no

Re: Index Skip Scan

2019-09-22 Thread Alvaro Herrera
On 2019-Sep-22, Dmitry Dolgov wrote: > > I think multiplying two ScanDirections to watch for a negative result is > > pretty ugly: > > Probably, but the only alternative I see to check if directions are opposite > is > to check that directions come in pairs (back, forth), (forth, back). Is

Re: scorpionfly needs more semaphores

2019-09-22 Thread Thomas Munro
On Wed, Sep 18, 2019 at 4:55 PM jungle boogie wrote: > $ sysctl | ag kern.seminfo.semmni > kern.seminfo.semmni=100 It still seems to be happening. Perhaps you need to increase semmns too? > > Scorpionfly also seems to be having problems with its git repo breaking on > > a regular basis. I

Re: JSONPATH documentation

2019-09-22 Thread Jeff Janes
On Sun, Sep 22, 2019 at 2:18 PM Jeff Janes wrote: > I find the documentation in > https://www.postgresql.org/docs/12/functions-json.html very confusing. > > In table 9.44 take the first entry, > > Example JSON > {"x": [2.85, -14.7, -9.4]} > > Example Query > + $.x.floor() > > Result > 2, -15,

Re: strong memory leak in plpgsql from handled rollback and lazy cast

2019-09-22 Thread Tom Lane
Pavel Stehule writes: > When I tested some hypothesis I wrote buggy code. It was surprise how fast > I lost all free memory > do $$ > begin > for i in 1..300 > loop > begin > -- do some error > if i then end if; > exception when others then > -- do nothing >

Re: strong memory leak in plpgsql from handled rollback and lazy cast

2019-09-22 Thread Andres Freund
Hi, On 2019-09-22 18:43:23 -0400, Tom Lane wrote: > I'm not convinced that it'd be safe to re-use an ExprState after a > previous execution failed (though perhaps Andres has a different > opinion?) I don't immediately see why it'd be problematic to reuse at a later time, as long as it's

Re: strong memory leak in plpgsql from handled rollback and lazy cast

2019-09-22 Thread Andres Freund
Hi, On 2019-09-22 20:16:15 -0400, Tom Lane wrote: > Andres Freund writes: > > On 2019-09-22 18:43:23 -0400, Tom Lane wrote: > >> I'm not convinced that it'd be safe to re-use an ExprState after a > >> previous execution failed (though perhaps Andres has a different > >> opinion?) > > > I don't

Re: row filtering for logical replication

2019-09-22 Thread movead li
Hello I find several problems as below when I test the patches: 1. There be some regression problem after apply 0001.patch~0005.patch The regression problem is solved in 0006.patch 2. There be a data wrong after create subscription if the relation contains inherits table, for example:

Re: [bug fix??] Fishy code in tts_cirtual_copyslot()

2019-09-22 Thread Tom Lane
"Tsunakawa, Takayuki" writes: > In the following code in execTuples.c, shouldn' srcdesc point to the source > slot's tuple descriptor? The attached fix passes make check. What kind of > failure could this cause? Yeah, sure looks like a typo to me too. I temporarily changed the Assert to be

Re: pgbench - allow to create partitioned tables

2019-09-22 Thread Amit Kapila
On Sun, Sep 22, 2019 at 12:22 PM Fabien COELHO wrote: > >>sh> pgbench -T 10 > >>... > >>partitions: 0 > > > > I am not sure how many users would be able to make out that it is a > > run where actual partitions are not present unless they beforehand > > know and detect such a condition