Re: Runtime pruning problem

2019-04-20 Thread David Rowley
On Fri, 19 Apr 2019 at 20:01, Amit Langote wrote: > > On 2019/04/19 2:25, Tom Lane wrote: > > Amit Langote writes: > >> Another idea is to teach explain.c about this special case of run-time > >> pruning having pruned all child subplans even though appendplans contains > >> one element to cater f

Re: TM format can mix encodings in to_char()

2019-04-20 Thread Tom Lane
I wrote: > [ fix-encoding-and-error-recovery-in-cache-locale-time.patch ] On closer inspection, I'm pretty sure either version of this patch will break things on Windows, because that platform already had code to convert the result of wcsftime() to the database encoding; we were adding code to do

Re: finding changed blocks using WAL scanning

2019-04-20 Thread Bruce Momjian
On Sat, Apr 20, 2019 at 04:17:08PM -0400, Robert Haas wrote: > On Sat, Apr 20, 2019 at 9:18 AM Bruce Momjian wrote: > > > I think you've got to prevent the WAL from being removed until a > > > .modblock file has been written. In more detail, you should (a) scan > > > all the WAL segments that wil

Re: block-level incremental backup

2019-04-20 Thread Stephen Frost
Greetings, * Robert Haas (robertmh...@gmail.com) wrote: > On Sat, Apr 20, 2019 at 12:19 AM Stephen Frost wrote: > > * Robert Haas (robertmh...@gmail.com) wrote: > > > What I'm NOT willing to > > > do is build a whole bunch of infrastructure that will help pgbackrest > > > do amazing things but wi

Re: finding changed blocks using WAL scanning

2019-04-20 Thread Robert Haas
On Sat, Apr 20, 2019 at 12:42 AM Stephen Frost wrote: > > Oh. Well, I already explained my algorithm for doing that upthread, > > which I believe would be quite cheap. > > > > 1. When you generate the .modblock files, stick all the block > > references into a buffer. qsort(). Dedup. Write out

Re: finding changed blocks using WAL scanning

2019-04-20 Thread Robert Haas
On Sat, Apr 20, 2019 at 9:18 AM Bruce Momjian wrote: > > I think you've got to prevent the WAL from being removed until a > > .modblock file has been written. In more detail, you should (a) scan > > all the WAL segments that will be summarized in the .modblock file, > > (b) write the file under a

Re: block-level incremental backup

2019-04-20 Thread Robert Haas
On Sat, Apr 20, 2019 at 12:44 PM Andrey Borodin wrote: > Incremental backup of 1Tb DB made with distance of few minutes (small change > set) is few Gbs. All of this size is made of FSM (no LSN) and VM (hard to use > LSN). > Sure, this overhead size is fine if we make daily backup. But at some >

Re: block-level incremental backup

2019-04-20 Thread Robert Haas
On Sat, Apr 20, 2019 at 12:19 AM Stephen Frost wrote: > * Robert Haas (robertmh...@gmail.com) wrote: > > What I'm NOT willing to > > do is build a whole bunch of infrastructure that will help pgbackrest > > do amazing things but will not provide a simple and convenient way of > > taking incrementa

Re: TM format can mix encodings in to_char()

2019-04-20 Thread Tom Lane
I wrote: > This is a little bit off, now that I look at it, because it's > failing to account for the possibility of getting -1 from > pg_get_encoding_from_locale. It should probably do what > pg_bind_textdomain_codeset does: > if (encoding < 0) > encoding = PG_SQL_ASCII; Actu

Re: jsonpath

2019-04-20 Thread Alexander Korotkov
On Thu, Apr 18, 2019 at 4:09 AM John Naylor wrote: > On Thu, Apr 18, 2019 at 1:43 AM Tom Lane wrote: > > > > John Naylor writes: > > > Attached is a patch to fix some minor issues: > > > -misspelling of an error message > > > > Yeah, I'd noticed that one too :-(. I think the whole jsonpath patc

Re: jsonpath

2019-04-20 Thread Alexander Korotkov
On Wed, Apr 17, 2019 at 11:14 PM Alexander Korotkov wrote: > On Wed, Apr 17, 2019 at 8:43 PM Tom Lane wrote: > > John Naylor writes: > > > Attached is a patch to fix some minor issues: > > > -misspelling of an error message > > > > Yeah, I'd noticed that one too :-(. I think the whole jsonpath

Re: block-level incremental backup

2019-04-20 Thread Andrey Borodin
Hi! Sorry for the delay. > 18 апр. 2019 г., в 21:56, Robert Haas написал(а): > > On Wed, Apr 17, 2019 at 5:20 PM Stephen Frost wrote: >> As I understand it, the problem is not with backing up an individual >> database or cluster, but rather dealing with backing up thousands of >> individual cl

Re: TM format can mix encodings in to_char()

2019-04-20 Thread Tom Lane
I wrote: > Hmm. I'd always imagined that the way that libc works is that LC_CTYPE > determines the encoding (codeset) it's using across the board, so that > functions like strftime would deliver data in that encoding. > [ and much more based on that ] After further study of the code, the situatio

Re: Add missing operator <->(box, point)

2019-04-20 Thread Fabien COELHO
Hello Nikita, Attached patches add missing distance operator <->(box, point). Indeed. We already have reverse operator <->(point, box), but it can't be used for kNN search in GiST and SP-GiST. GiST and SP-GiST now support kNN searches over more complex polygons and circles, but do not su

Re: finding changed blocks using WAL scanning

2019-04-20 Thread Bruce Momjian
On Sat, Apr 20, 2019 at 12:09:42AM -0400, Robert Haas wrote: > On Thu, Apr 18, 2019 at 5:47 PM Bruce Momjian wrote: > > How would the modblock file record all the modified blocks across > > restarts and crashes? I assume that 1G of WAL would not be available > > for scanning. I suppose that writ

Re: finding changed blocks using WAL scanning

2019-04-20 Thread Bruce Momjian
On Sat, Apr 20, 2019 at 12:21:36AM -0400, Robert Haas wrote: > As to that, what I'm proposing here is no different than what we are > already doing with physical and logical replication, except that it's > probably a bit cheaper. Physical replication reads all the WAL and > sends it all out over t

Re: pgsql: Allow insert and update tuple routing and COPY for foreign table

2019-04-20 Thread Laurenz Albe
On Fri, 2018-04-06 at 23:24 +, Robert Haas wrote: > Allow insert and update tuple routing and COPY for foreign tables. > > Also enable this for postgres_fdw. > > Etsuro Fujita, based on an earlier patch by Amit Langote. The larger > patch series of which this is a part has been reviewed by Am

Re: refactoring - share str2*int64 functions

2019-04-20 Thread Fabien COELHO
As usual, it is better with the attachement. Sorry for the noise. Yep, but ISTM that it is down to 32 bits, Only on 32-bit-long machines, which are a dwindling minority (except for Windows, which I don't really care about). So the third short is now always 0. Hmmm. I'll propose another opti

refactoring - share str2*int64 functions

2019-04-20 Thread Fabien COELHO
Hello Tom, Yep, but ISTM that it is down to 32 bits, Only on 32-bit-long machines, which are a dwindling minority (except for Windows, which I don't really care about). So the third short is now always 0. Hmmm. I'll propose another option over the week-end. I suppose we could put pg_strt