Re: pgbench doc typos

2018-03-29 Thread Fabien COELHO
Hello Edmund, Thanks for the check. You might consider turning the patch as ready in the cf app. Fixing the abs/hash bracketing seems clear. The wasn't sure about rewriting "mod(i, bj)" as "mod(i, j)", because there could be some convention about parameter names, but I can't think of anyth

Re: [HACKERS] SERIALIZABLE with parallel query

2018-03-29 Thread Thomas Munro
On Thu, Mar 8, 2018 at 10:28 AM, Robert Haas wrote: > +SerializableXactHandle > +ShareSerializableXact(void) > +{ > +Assert(!IsParallelWorker()); > + > +return MySerializableXact; > +} > > Uh, how's that OK? There's no rule that you can't create a > ParallelContext in a worker. Parallel

Re: Question about WalSndWriteData

2018-03-29 Thread Kyotaro HORIGUCHI
Hello, At Thu, 29 Mar 2018 20:11:03 +0300, Konstantin Knizhnik wrote in <04171363-a07d-62b7-4362-32de54149...@postgrespro.ru> > > > On 21.03.2018 10:08, Konstantin Knizhnik wrote: > > > > > > On 21.03.2018 04:50, Peter Eisentraut wrote: > >> On 3/16/18 12:08, Konstantin Knizhnik wrote: > >>>

Re: [HACKERS] path toward faster partition pruning

2018-03-29 Thread Amit Langote
Thanks Tomas for the review. On 2018/03/30 1:55, Tomas Vondra wrote: > Hi, > > I think there's a bug in generate_pruning_steps_from_opexprs, which does > this for PARTITION_STRATEGY_HASH: > > > for_each_cell(lc1, lc) > { > pc = lfirst(lc1); > > /* > * Note that

Re: [PATCH] Verify Checksums during Basebackups

2018-03-29 Thread David Steele
On 3/24/18 10:32 AM, Michael Banck wrote: > Am Freitag, den 23.03.2018, 17:43 +0100 schrieb Michael Banck: >> Am Freitag, den 23.03.2018, 10:54 -0400 schrieb David Steele: >>> In my experience actual block errors are relatively rare, so there >>> aren't likely to be more than a few in a file. More

Re: Foreign keys and partitioned tables

2018-03-29 Thread Alvaro Herrera
Here's an updated version. After wasting some time trying to resolve "minor last minute issues", I decided to reduce the scope for now: in the current patch, it's allowed to have foreign keys in partitioned tables, but it is not possible to have foreign keys that point to partitioned tables. I ha

RE: Speedup of relation deletes during recovery

2018-03-29 Thread Tsunakawa, Takayuki
From: Fujii Masao [mailto:masao.fu...@gmail.com] > When multiple relations are deleted at the same transaction, the files of > those relations are deleted by one call to smgrdounlinkall(), which leads > to scan whole shared_buffers only one time. OTOH, during recovery, > smgrdounlink() (not smgrdou

Re: PATCH: Configurable file mode mask

2018-03-29 Thread Michael Paquier
On Thu, Mar 29, 2018 at 10:59:59AM -0400, David Steele wrote: > On 3/28/18 1:59 AM, Michael Paquier wrote: >> On Tue, Mar 27, 2018 at 04:21:09PM -0400, David Steele wrote: >>> These updates address Michael's latest review and implement group access >>> for pg_basebackup, pg_receivewal, and pg_recvl

Re: Speedup of relation deletes during recovery

2018-03-29 Thread Michael Paquier
On Fri, Mar 30, 2018 at 11:19:58AM +0900, Kyotaro HORIGUCHI wrote: > At Fri, 30 Mar 2018 08:31:29 +0900, Fujii Masao wrote > in >> When multiple relations are deleted at the same transaction, >> the files of those relations are deleted by one call to smgrdounlinkall(), >> which leads to scan who

Re: [HACKERS] A design for amcheck heapam verification

2018-03-29 Thread Peter Geoghegan
On Thu, Mar 29, 2018 at 6:18 PM, Andres Freund wrote: >> This commit adds a test harness extension module, test_bloomfilter. It >> can be used to get a sense of how the Bloom filter implementation >> performs under varying conditions. > > Maybe add a short paragraph explaining what this'll be use

Re: Change RangeVarGetRelidExtended() to take flags argument?

2018-03-29 Thread Michael Paquier
On Thu, Mar 29, 2018 at 05:15:14PM -0700, Andres Freund wrote: > On 2018-03-22 15:45:23 +, Bossart, Nathan wrote: >> Here is a set of patches for this approach. > > To me this looks like a reasonable approach that'd solve the VACUUM > use-case. I think we can live with the API breakage, but I'

Re: Protect syscache from bloating with negative cache entries

2018-03-29 Thread Kyotaro HORIGUCHI
At Thu, 29 Mar 2018 18:51:45 -0700, Andres Freund wrote in <20180330015145.pvsr6kjtf6tw4...@alap3.anarazel.de> > Hi, > > On 2018-03-30 10:35:48 +0900, Kyotaro HORIGUCHI wrote: > > 0002-0004 is new, in response to the comment that caches other > > than the catcache ought to get the same feature.

Re: Speedup of relation deletes during recovery

2018-03-29 Thread Kyotaro HORIGUCHI
Hello. At Fri, 30 Mar 2018 08:31:29 +0900, Fujii Masao wrote in > Hi, > > When multiple relations are deleted at the same transaction, > the files of those relations are deleted by one call to smgrdounlinkall(), > which leads to scan whole shared_buffers only one time. OTOH, > during recovery,

Re: pgbench doc typos

2018-03-29 Thread Edmund Horner
I did a quick review of this. The patch is just a doc typo fix and it applies cleanly to master (as of this email). I was able to build the docs, and they look ok. Fixing the abs/hash bracketing seems clear. The wasn't sure about rewriting "mod(i, bj)" as "mod(i, j)", because there could be s

Re: [HACKERS] Re: Improve OR conditions on joined columns (common star schema problem)

2018-03-29 Thread Andres Freund
Hi, I've only skimmed the thread, looking at the patch on its own. On 2018-01-04 17:50:48 -0500, Tom Lane wrote: > diff --git a/src/backend/optimizer/plan/plaindex ...dd11e72 . > --- a/src/backend/optimizer/plan/planunionor.c > +++ b/src/backend/optimizer/plan/planunionor.c > @@ -0,0 +1,667 @@ >

Re: Protect syscache from bloating with negative cache entries

2018-03-29 Thread Andres Freund
Hi, On 2018-03-30 10:35:48 +0900, Kyotaro HORIGUCHI wrote: > 0002-0004 is new, in response to the comment that caches other > than the catcache ought to get the same feature. These can be a > separate development from 0001 for v12. I don't find a measures > to catch the all case at once. > > If w

Re: Protect syscache from bloating with negative cache entries

2018-03-29 Thread Kyotaro HORIGUCHI
At Thu, 29 Mar 2018 18:22:59 -0700, Andres Freund wrote in <20180330012259.7k3442yz7jigh...@alap3.anarazel.de> > On 2018-03-23 17:01:11 +0900, Kyotaro HORIGUCHI wrote: > > Hello. > > > > At Wed, 21 Mar 2018 15:28:07 -0400, David Steele > > wrote in <43095b16-14fc-e4d8-3310-2b86eaaab...@pgmaste

Re: Fix missing spaces in docs

2018-03-29 Thread Bruce Momjian
Patch applied. --- On Wed, Mar 7, 2018 at 04:13:17PM -0300, Fabrízio de Royes Mello wrote: > Hi all, > > The attached patch just fix missing spaces in documentation of CREATE SERVER > and CREATE USER MAPPING. > > Regards,

Re: Protect syscache from bloating with negative cache entries

2018-03-29 Thread Andres Freund
On 2018-03-23 17:01:11 +0900, Kyotaro HORIGUCHI wrote: > Hello. > > At Wed, 21 Mar 2018 15:28:07 -0400, David Steele wrote > in <43095b16-14fc-e4d8-3310-2b86eaaab...@pgmasters.net> > > On 3/15/18 1:12 AM, Kyotaro HORIGUCHI wrote: > > > At Mon, 12 Mar 2018 17:34:08 +0900 (Tokyo Standard Time), Ky

Re: [HACKERS] AdvanceXLInsertBuffer vs. WAL segment compressibility

2018-03-29 Thread Chapman Flack
On 03/27/18 20:09, Tomas Vondra wrote: > Not sure what's up with gitweb, but git finds it without any issue: > > https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=2dd9322ba6eea76800b38bfea0599fbc459458f2 Thanks, that worked. On 03/27/18 22:10, Michael Paquier wrote: > Here you go fo

Re: [HACKERS] A design for amcheck heapam verification

2018-03-29 Thread Andres Freund
Hi, On 2018-03-26 20:20:57 -0700, Peter Geoghegan wrote: > From ede1ba731dc818172a94adbb6331323c1f2b1170 Mon Sep 17 00:00:00 2001 > From: Peter Geoghegan > Date: Thu, 24 Aug 2017 20:58:21 -0700 > Subject: [PATCH v7 1/2] Add Bloom filter data structure implementation. > > A Bloom filter is a spac

Re: cannot drop replication slot if server is running in single-user mode

2018-03-29 Thread Bruce Momjian
On Thu, Mar 29, 2018 at 06:09:28PM -0700, Andres Freund wrote: > On 2018-03-29 21:07:36 -0400, Bruce Momjian wrote: > > I think the question is whether this is exposing a bug or is expected > > behavior. > > It's unsurprising. Acquiring a slot uses a condition variable, which > uses latches to sl

Re: cannot drop replication slot if server is running in single-user mode

2018-03-29 Thread Andres Freund
On 2018-03-29 21:07:36 -0400, Bruce Momjian wrote: > I think the question is whether this is exposing a bug or is expected > behavior. It's unsurprising. Acquiring a slot uses a condition variable, which uses latches to sleep. Latches don't work in single user mode. Boom. Greetings, Andres Freu

Re: [HACKERS] WAL logging problem in 9.4.3?

2018-03-29 Thread Kyotaro HORIGUCHI
Hello. I found that c203d6cf81 hit this and this is the rebased version on the current master. regards, -- Kyotaro Horiguchi NTT Open Source Software Center >From 3dac5baf787dc949cfb22a698a0d72b6eb48e75e Mon Sep 17 00:00:00 2001 From: Kyotaro Horiguchi Date: Tue, 12 Sep 2017 13:01:33 +0900 Sub

Re: cannot drop replication slot if server is running in single-user mode

2018-03-29 Thread Bruce Momjian
On Thu, Mar 29, 2018 at 02:51:24PM -0700, Andres Freund wrote: > On 2018-03-29 17:42:57 -0400, Bruce Momjian wrote: > > On Tue, Mar 6, 2018 at 06:59:33PM +0530, tushar wrote: > > > Hi, > > > > > > I found that if server is running in single-user mode , there we can > > > create > > > replication

Re: [HACKERS] [PATCH] Lockable views

2018-03-29 Thread Tatsuo Ishii
Andres, I have just pushed the v10 patch. Yugo will reply back to your point but I will look into your review as well. Thanks. Best regards, -- Tatsuo Ishii SRA OSS, Inc. Japan English: http://www.sraoss.co.jp/index_en.php Japanese:http://www.sraoss.co.jp > Hi, > > On 2018-03-28 20:26:48 +0900

Re: Enhance pg_stat_wal_receiver view to display connected host

2018-03-29 Thread Michael Paquier
On Fri, Mar 30, 2018 at 10:52:02AM +1100, Haribabu Kommi wrote: > On Fri, Mar 30, 2018 at 7:26 AM, Fujii Masao wrote: >> @@ -753,4 +753,6 @@ CREATE VIEW pg_stat_wal_receiver AS >> s.latest_end_time, >> s.slot_name, >> +s.remote_server, >> +s.remote

Re: [HACKERS] [PATCH] Lockable views

2018-03-29 Thread Andres Freund
Hi, On 2018-03-28 20:26:48 +0900, Yugo Nagata wrote: > diff --git a/doc/src/sgml/ref/lock.sgml b/doc/src/sgml/ref/lock.sgml > index b2c7203..96d477c 100644 > --- a/doc/src/sgml/ref/lock.sgml > +++ b/doc/src/sgml/ref/lock.sgml > @@ -46,6 +46,11 @@ LOCK [ TABLE ] [ ONLY ] class="parameter">name [ *

Re: Incorrect use of "an" and "a" in code comments and docs

2018-03-29 Thread Michael Paquier
On Thu, Mar 29, 2018 at 03:29:24PM -0400, Bruce Momjian wrote: > I am planning to look into this, and will convert to "an" in my proposed > patch. Thanks. Let's see that on another thread.. -- Michael signature.asc Description: PGP signature

Re: Incorrect use of "an" and "a" in code comments and docs

2018-03-29 Thread Michael Paquier
On Thu, Mar 29, 2018 at 03:28:32PM -0400, Bruce Momjian wrote: > Attached patch applied. It includes a suggested fix by Abhijit > Menon-Sen. Thanks Bruce. -- Michael signature.asc Description: PGP signature

Re: Creating streaming replication standby

2018-03-29 Thread Michael Paquier
On Fri, Mar 30, 2018 at 07:49:37AM +0900, Tatsuo Ishii wrote: > It would be nice if we could have an SQL command or a function which > creates a streaming replication standby from existing primary. Some of > public cloud already provide such that feature. Pgpool-II also > provides it. Of course we

Re: Change RangeVarGetRelidExtended() to take flags argument?

2018-03-29 Thread Andres Freund
Hi Everyone, On 2018-03-22 15:45:23 +, Bossart, Nathan wrote: > Here is a set of patches for this approach. To me this looks like a reasonable approach that'd solve the VACUUM use-case. I think we can live with the API breakage, but I'd like to have some more comments? Pertinent parts quoted

Re: Enhance pg_stat_wal_receiver view to display connected host

2018-03-29 Thread Haribabu Kommi
On Fri, Mar 30, 2018 at 7:26 AM, Fujii Masao wrote: > On Wed, Mar 28, 2018 at 3:09 PM, Michael Paquier > wrote: > > On Wed, Mar 28, 2018 at 03:41:33PM +1100, Haribabu Kommi wrote: > >> On Wed, Mar 28, 2018 at 12:54 PM, Michael Paquier > >> wrote: > >> Updated patch attached. > > Thanks for the

Re: ALTER TABLE ADD COLUMN fast default

2018-03-29 Thread Andres Freund
On 2018-03-29 16:40:29 -0700, Andres Freund wrote: > Hi, > > On 2018-03-30 10:08:54 +1030, Andrew Dunstan wrote: > > On Fri, Mar 30, 2018 at 5:00 AM, Andres Freund wrote: > > > this'll trigger one slot_getsomeattrs(slot, 2) call from within qual > > > evaluation, and then a slot_getsomeattrs(slot,

Re: ALTER TABLE ADD COLUMN fast default

2018-03-29 Thread Andres Freund
Hi, On 2018-03-30 10:08:54 +1030, Andrew Dunstan wrote: > On Fri, Mar 30, 2018 at 5:00 AM, Andres Freund wrote: > > this'll trigger one slot_getsomeattrs(slot, 2) call from within qual > > evaluation, and then a slot_getsomeattrs(slot, 4) from within the > > projection code. If you then imagine

Re: ALTER TABLE ADD COLUMN fast default

2018-03-29 Thread Andrew Dunstan
On Fri, Mar 30, 2018 at 5:00 AM, Andres Freund wrote: > Hi, > > On 2018-03-29 10:16:23 +1030, Andrew Dunstan wrote: >> On Wed, Mar 28, 2018 at 5:30 PM, Andres Freund wrote: >> > Hi, >> > >> > On 2018-03-26 09:02:10 +1030, Andrew Dunstan wrote: >> >> Thanks for this, all looks good. Here is the co

Re: WIP: Covering + unique indexes.

2018-03-29 Thread Peter Geoghegan
On Wed, Mar 28, 2018 at 7:59 AM, Anastasia Lubennikova wrote: > Here is the new version of the patch set. > All patches are rebased to apply without conflicts. > > Besides, they contain following fixes: > - pg_dump bug is fixed > - index_truncate_tuple() now has 3rd argument new_indnatts. > - new

Speedup of relation deletes during recovery

2018-03-29 Thread Fujii Masao
Hi, When multiple relations are deleted at the same transaction, the files of those relations are deleted by one call to smgrdounlinkall(), which leads to scan whole shared_buffers only one time. OTOH, during recovery, smgrdounlink() (not smgrdounlinkall()) is called for each file to delete, which

Re: JIT compiling with LLVM v12.2

2018-03-29 Thread Andres Freund
Hi, On 2018-03-29 19:57:42 +0700, John Naylor wrote: > Hi Andres, > I spent some time over pouring over the JIT README, and I've attached > a patch with some additional corrections as well as some stylistic > suggestions. The latter may be debatable, but I'm sure you can take > and pick as you see

Re: [HACKERS] [PATCH] Vacuum: Update FSM more frequently

2018-03-29 Thread Tom Lane
I wrote: > I have to go do something > else right now, but I'll take a closer look at 0004 later. OK, so after studying 0004, it seems to me that we could do it more simply as attached; that is, move the IndexFreeSpaceMapVacuum calls into btvacuumscan/spgvacuumscan, do them only if we found any re

Creating streaming replication standby

2018-03-29 Thread Tatsuo Ishii
It would be nice if we could have an SQL command or a function which creates a streaming replication standby from existing primary. Some of public cloud already provide such that feature. Pgpool-II also provides it. Of course we can do it today by combining existing functions/SQL/tools but the feat

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

2018-03-29 Thread Petr Jelinek
On 30/03/18 00:30, Petr Jelinek wrote: > On 29/03/18 23:58, Andres Freund wrote: >> On 2018-03-29 23:52:18 +0200, Tomas Vondra wrote: I have added details about this in src/backend/storage/lmgr/README as suggested by you. >>> >>> Thanks. I think the README is a good start, but I thin

Re: pgsql: Add documentation for the JIT feature.

2018-03-29 Thread Andres Freund
Hi, On 2018-03-29 09:59:55 -0300, Alvaro Herrera wrote: > I agree. In some email threads Andres has been using "JIT" as a verb, > too, such as "JITing expressions" and such; that's a bit shocking, in a > way. Honestly I don't care in a pgsql-hackers thread, I mean we all > understand what it mea

Re: ALTER TABLE ADD COLUMN fast default

2018-03-29 Thread Andres Freund
Hi, On 2018-03-30 00:28:43 +0200, Tomas Vondra wrote: > > Why is that unlikely? In the field it's definitely not uncommon to > > define default values for just about every column. And in a lot of cases > > that'll mean we'll end up with pg_attribute containing default values > > for most columns

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

2018-03-29 Thread Petr Jelinek
On 29/03/18 23:58, Andres Freund wrote: > On 2018-03-29 23:52:18 +0200, Tomas Vondra wrote: >>> I have added details about this in src/backend/storage/lmgr/README as >>> suggested by you. >>> >> >> Thanks. I think the README is a good start, but I think we also need to >> improve the comments, whic

Re: ALTER TABLE ADD COLUMN fast default

2018-03-29 Thread Tomas Vondra
On 03/29/2018 11:31 PM, Andres Freund wrote: > Hi, > > On 2018-03-29 17:27:47 -0400, Tom Lane wrote: >> Andres Freund writes: >>> There's plenty databases with pg_attribute being many gigabytes large, >>> and this is going to make that even worse. >> >> Only if you imagine that a sizable fracti

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

2018-03-29 Thread Andres Freund
Hi, On 2018-03-30 00:23:00 +0200, Tomas Vondra wrote: > On 03/29/2018 11:58 PM, Andres Freund wrote: > > FWIW, for me that's ground to not accept the feature. Burdening output > > plugins with this will make their development painful (because they'll > > have to adapt regularly) and correctness do

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

2018-03-29 Thread Tomas Vondra
On 03/29/2018 11:58 PM, Andres Freund wrote: > On 2018-03-29 23:52:18 +0200, Tomas Vondra wrote: >>> I have added details about this in src/backend/storage/lmgr/README as >>> suggested by you. >>> >> >> Thanks. I think the README is a good start, but I think we also need to >> improve the comment

Re: Proposal: http2 wire format

2018-03-29 Thread Andres Freund
On 2018-03-29 17:52:07 -0400, Peter Eisentraut wrote: > On 3/29/18 14:20, Andres Freund wrote: > > On 2018-03-28 20:34:13 -0400, Peter Eisentraut wrote: > >> On 3/28/18 12:09, Andres Freund wrote: > >>> Yea, not the most descriptive... Returning multiple different resultsets > >>> from a function /

Re: Changing WAL Header to reduce contention during ReserveXLogInsertLocation()

2018-03-29 Thread Tomas Vondra
On 03/29/2018 11:18 PM, Tom Lane wrote: > Tomas Vondra writes: >> If each WAL record has xl_curr, then we know to which position the >> record belongs (after verifying the checksum). And we do know the size >> of each WAL record, so we should be able to deduce if two records are >> immediately a

Re: csv format for psql

2018-03-29 Thread David G. Johnston
On Thu, Mar 29, 2018 at 7:30 AM, Daniel Verite wrote: > Personally I think the benefit of sharing fieldsep is not worth these > problems, but I'm waiting for the discussion to continue with > more opinions. ​Apologies in advance if I mis-represent someone's position.​ ​It seems like having a d

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

2018-03-29 Thread Andres Freund
On 2018-03-29 23:52:18 +0200, Tomas Vondra wrote: > > I have added details about this in src/backend/storage/lmgr/README as > > suggested by you. > > > > Thanks. I think the README is a good start, but I think we also need to > improve the comments, which is usually more detailed than the README.

Re: Proposal: http2 wire format

2018-03-29 Thread Peter Eisentraut
On 3/29/18 14:20, Andres Freund wrote: > On 2018-03-28 20:34:13 -0400, Peter Eisentraut wrote: >> On 3/28/18 12:09, Andres Freund wrote: >>> Yea, not the most descriptive... Returning multiple different resultsets >>> from a function / procedure. Inability to do so is a serious limitation >>> of po

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

2018-03-29 Thread Tomas Vondra
Hi, I've been reviewing the last patch version, focusing mostly on the decoding group part. Let me respond to several points first, then new review bits. On 03/28/2018 05:28 PM, Nikhil Sontakke wrote: > Hi Tomas, > >> Now, about the interlock implementation - I see you've reused the "lock >> gro

Re: cannot drop replication slot if server is running in single-user mode

2018-03-29 Thread Andres Freund
On 2018-03-29 17:42:57 -0400, Bruce Momjian wrote: > On Tue, Mar 6, 2018 at 06:59:33PM +0530, tushar wrote: > > Hi, > > > > I found that if server is running in single-user mode , there we can create > > replication slot but cannot drop it . > > > > backend> SELECT * FROM pg_create_physical_repl

Re: cannot drop replication slot if server is running in single-user mode

2018-03-29 Thread Bruce Momjian
On Tue, Mar 6, 2018 at 06:59:33PM +0530, tushar wrote: > Hi, > > I found that if server is running in single-user mode , there we can create > replication slot but cannot drop it . > > backend> SELECT * FROM pg_create_physical_replication_slot('p'); > 2018-03-06 13:20:03.441 GMT [14869] LOG:  st

Re: ALTER TABLE ADD COLUMN fast default

2018-03-29 Thread Andres Freund
Hi, On 2018-03-29 17:27:47 -0400, Tom Lane wrote: > Andres Freund writes: > > There's plenty databases with pg_attribute being many gigabytes large, > > and this is going to make that even worse. > > Only if you imagine that a sizable fraction of the columns have fast > default values, which see

Re: ALTER TABLE ADD COLUMN fast default

2018-03-29 Thread Tom Lane
Andres Freund writes: > There's plenty databases with pg_attribute being many gigabytes large, > and this is going to make that even worse. Only if you imagine that a sizable fraction of the columns have fast default values, which seems somewhat unlikely. regards, tom lan

Re: PostgreSQL's handling of fsync() errors is unsafe and risks data loss at least on XFS

2018-03-29 Thread Thomas Munro
On Fri, Mar 30, 2018 at 5:20 AM, Catalin Iacob wrote: > Jeff's comments in the pull request that merged errseq_t are worth > reading as well: > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=088737f44bbf6378745f5b57b035e57ee3dc4750 Wow. It looks like there may be a

Re: Changing WAL Header to reduce contention during ReserveXLogInsertLocation()

2018-03-29 Thread Tom Lane
Tomas Vondra writes: > If each WAL record has xl_curr, then we know to which position the > record belongs (after verifying the checksum). And we do know the size > of each WAL record, so we should be able to deduce if two records are > immediately after each other. Per my point earlier, XLOG_SWI

Re: [HACKERS] Replication status in logical replication

2018-03-29 Thread Fujii Masao
On Wed, Jan 17, 2018 at 2:16 AM, Simon Riggs wrote: > On 16 January 2018 at 06:21, Michael Paquier > wrote: >> On Tue, Jan 16, 2018 at 10:40:43AM +0900, Masahiko Sawada wrote: >>> On Sun, Jan 14, 2018 at 12:43 AM, Simon Riggs wrote: On 9 January 2018 at 04:36, Masahiko Sawada wrote:

Re: Enhance pg_stat_wal_receiver view to display connected host

2018-03-29 Thread Fujii Masao
On Wed, Mar 28, 2018 at 3:09 PM, Michael Paquier wrote: > On Wed, Mar 28, 2018 at 03:41:33PM +1100, Haribabu Kommi wrote: >> On Wed, Mar 28, 2018 at 12:54 PM, Michael Paquier >> wrote: >> Updated patch attached. Thanks for the patch! I'd like to commit this feature for v11. @@ -753,4 +753,6 @@

Re: Changing WAL Header to reduce contention during ReserveXLogInsertLocation()

2018-03-29 Thread Simon Riggs
On 29 March 2018 at 21:03, Tomas Vondra wrote: > > On 03/29/2018 08:02 PM, Robert Haas wrote: >> On Thu, Mar 29, 2018 at 1:13 PM, Tomas Vondra >> wrote: >>> On 03/29/2018 06:42 PM, Tom Lane wrote: The long and the short of it is that this is a very dangerous-looking proposal, we are at

Re: [HACKERS] why not parallel seq scan for slow functions

2018-03-29 Thread Robert Haas
On Thu, Mar 29, 2018 at 12:55 AM, Amit Kapila wrote: > I think that is under acceptable range. I am seeing few regression > failures with the patch series. The order of targetlist seems to have > changed for Remote SQL. Kindly find the failure report attached. I > have requested my colleague A

Re: Changing WAL Header to reduce contention during ReserveXLogInsertLocation()

2018-03-29 Thread Simon Riggs
On 29 March 2018 at 19:02, Robert Haas wrote: > >>> Also, I will say it once more: this change DOES decrease robustness. >>> It's like blockchain without the chain aspect, or git commits without >>> a parent pointer. We are not only interested in whether individual >>> WAL records are valid, but

Re: Changing WAL Header to reduce contention during ReserveXLogInsertLocation()

2018-03-29 Thread Tomas Vondra
On 03/29/2018 08:02 PM, Robert Haas wrote: > On Thu, Mar 29, 2018 at 1:13 PM, Tomas Vondra > wrote: >> On 03/29/2018 06:42 PM, Tom Lane wrote: >>> The long and the short of it is that this is a very dangerous-looking >>> proposal, we are at the tail end of a development cycle, and there are >>> ~

Re: Changing WAL Header to reduce contention during ReserveXLogInsertLocation()

2018-03-29 Thread Simon Riggs
On 29 March 2018 at 18:13, Tomas Vondra wrote: > On 03/29/2018 06:42 PM, Tom Lane wrote: >> Simon Riggs writes: >>> I know the approach is new and surprising but I thought about it a lot >>> before proposing it and I couldn't see any holes; still can't. Please >>> give this some thought so we can

Poc: pg_stat_statements with planid

2018-03-29 Thread legrand legrand
Hello Hackers As described in http://www.postgresql-archive.org/pg-stat-statements-HLD-for-futur-developments-td6012381.html here is a proposal to add a planid identifier to pg_stat_statements. The new key for the view is userid, dbid, queryid, planid. planid is calculated using code from pg_s

Re: [HACKERS] WIP Patch: Pgbench Serialization and deadlock errors

2018-03-29 Thread Fabien COELHO
Conception of max-retry option seems strange for me. if number of retries reaches max-retry option, then we just increment counter of failed transaction and try again (possibly, with different random numbers). At the end we should distinguish number of error transaction and failed transaction,

Re: pgsql: Add documentation for the JIT feature.

2018-03-29 Thread David Steele
On 3/29/18 3:27 PM, Andres Freund wrote: > > There's an entire section explaining what JIT is and what we currently > can JIT. We can't just say "compiling of routines (also ...)", because > a) we don't do that. b) even if you take expressions being JIT compiled > as that, we also JIT compile tup

Re: Flexible permissions for REFRESH MATERIALIZED VIEW

2018-03-29 Thread Isaac Morland
Thanks for pointing me to this. I also did a search in the archives and found a 2006 thread on TRUNCATE, VACUUM, and ANALYZE privileges: https://www.postgresql.org/message-id/flat/20060105140406.GX6026%40ns.snowman.net I'm not seeing much else. As far as I can see, the only demand for using more

Re: pgsql: Add documentation for the JIT feature.

2018-03-29 Thread Peter Geoghegan
On Thu, Mar 29, 2018 at 12:22 PM, Robert Haas wrote: > This technique has bene called JIT since about 1983, and is well-known > under that name, mostly because of Java. Calling it some made-up name > we create ourselves is not going to make this more comprehensible to > users. +1. You make a goo

Re: Cast jsonb to numeric, int, float, bool

2018-03-29 Thread Robert Haas
On Thu, Mar 29, 2018 at 9:35 AM, Teodor Sigaev wrote: > Thanks for everyone, pushed with some editorization I would like to complain about this patch. First, I think that it would've been a better idea to use functions for this rather than operators, because now ::text does something totally unl

Re: pgsql: Add documentation for the JIT feature.

2018-03-29 Thread David G. Johnston
On Thursday, March 29, 2018, Andres Freund wrote: > On 2018-03-29 13:26:31 -0400, Robert Haas wrote: > > > Also, in a way, you could argue that v10 already did "compilation of > > expressions". It didn't compile them to machine language, true, but > > it translated them into a form which is fast

Re: Incorrect use of "an" and "a" in code comments and docs

2018-03-29 Thread Bruce Momjian
On Mon, Mar 5, 2018 at 07:42:40PM +1300, Thomas Munro wrote: > On Mon, Mar 5, 2018 at 6:51 PM, Abhijit Menon-Sen > wrote: > > At 2018-03-05 14:42:14 +0900, mich...@paquier.xyz wrote: > >> > - sinval is a signal invalidation, so it seems to me that "a" is > >> > correct, not "an". > > > > I guess

Re: Incorrect use of "an" and "a" in code comments and docs

2018-03-29 Thread Bruce Momjian
On Mon, Mar 5, 2018 at 01:58:54PM +0900, Michael Paquier wrote: > Hi all, > > While looking at something else, I have one one occurence of $subject. > Looking more deeply at the code I have found 10 more of them, like: > - sinval is a signal invalidation, so it seems to me that "a" is > correct,

Re: pgsql: Add documentation for the JIT feature.

2018-03-29 Thread Andres Freund
On 2018-03-29 15:00:36 -0400, Stephen Frost wrote: > Greetings, > > * Andres Freund (and...@anarazel.de) wrote: > > On 2018-03-29 13:26:31 -0400, Robert Haas wrote: > > > On Thu, Mar 29, 2018 at 9:44 AM, Tom Lane wrote: > > > > I'd go a little further and drop "JIT" from user-facing documentation

Re: pgsql: Add documentation for the JIT feature.

2018-03-29 Thread Robert Haas
On Thu, Mar 29, 2018 at 3:00 PM, Stephen Frost wrote: > What we've done elsewhere when there's been similar jargon is to say > something along the lines of: > > "compiling of routines (also known as Just-In-Time or JIT compilation)" That strike me as roughly analogous to saying: "hiding rows use

Re: [HACKERS] [PATCH] Incremental sort

2018-03-29 Thread Alexander Kuzmenkov
Hi Alexander, I took a quick look at the patch. Some things I fixed myself in the attached patch v.21. Here is the summary: Typo in compare_fractional_path_costs() should be fixed as a separate patch. Remove unused function estimate_pathkeys_groups. Extra MemoryContextReset before tuplesort_en

Re: Incorrect use of "an" and "a" in code comments and docs

2018-03-29 Thread Bruce Momjian
On Mon, Mar 5, 2018 at 07:23:22PM +1300, David Rowley wrote: > On 5 March 2018 at 18:42, Michael Paquier wrote: > > On Mon, Mar 05, 2018 at 01:58:54PM +0900, Michael Paquier wrote: > >> Attached is a proposal of patch to fix all those things. > > > > And of course I forgot to attach the actual pa

Re: pgsql: Add documentation for the JIT feature.

2018-03-29 Thread Stephen Frost
Greetings, * Andres Freund (and...@anarazel.de) wrote: > On 2018-03-29 13:26:31 -0400, Robert Haas wrote: > > On Thu, Mar 29, 2018 at 9:44 AM, Tom Lane wrote: > > > I'd go a little further and drop "JIT" from user-facing documentation > > > altogether. Instead refer to the feature as "compilatio

Re: Typo in src/backend/access/hash/README

2018-03-29 Thread Bruce Momjian
On Mon, Mar 5, 2018 at 12:23:31PM +0530, Amit Kapila wrote: > On Mon, Mar 5, 2018 at 9:10 AM, Justin Pryzby wrote: > > On Mon, Mar 05, 2018 at 04:30:28PM +1300, Thomas Munro wrote: > >> Hi, > >> > >> Not sure what word was missed here, but I guess "count": > >> > >> our the number of buckets sto

Re: ALTER TABLE ADD COLUMN fast default

2018-03-29 Thread Andres Freund
Hi, On 2018-03-29 10:16:23 +1030, Andrew Dunstan wrote: > On Wed, Mar 28, 2018 at 5:30 PM, Andres Freund wrote: > > Hi, > > > > On 2018-03-26 09:02:10 +1030, Andrew Dunstan wrote: > >> Thanks for this, all looks good. Here is the consolidate patch > >> rebased. If there are no further comments I

Re: Proposal: http2 wire format

2018-03-29 Thread Andres Freund
On 2018-03-28 20:34:13 -0400, Peter Eisentraut wrote: > On 3/28/18 12:09, Andres Freund wrote: > > Yea, not the most descriptive... Returning multiple different resultsets > > from a function / procedure. Inability to do so is a serious limitation > > of postgres in comparison to some other languag

Re: Changing WAL Header to reduce contention during ReserveXLogInsertLocation()

2018-03-29 Thread Robert Haas
On Thu, Mar 29, 2018 at 1:13 PM, Tomas Vondra wrote: > On 03/29/2018 06:42 PM, Tom Lane wrote: >> The long and the short of it is that this is a very dangerous-looking >> proposal, we are at the tail end of a development cycle, and there are >> ~100 other patches remaining in the commitfest that a

Re: pgsql: Add documentation for the JIT feature.

2018-03-29 Thread Andres Freund
On 2018-03-29 13:26:31 -0400, Robert Haas wrote: > On Thu, Mar 29, 2018 at 9:44 AM, Tom Lane wrote: > > I'd go a little further and drop "JIT" from user-facing documentation > > altogether. Instead refer to the feature as "compilation of expressions" > > or some such. JIT is just jargon. Plus,

Re: [HACKERS] A design for amcheck heapam verification

2018-03-29 Thread Peter Geoghegan
On Thu, Mar 29, 2018 at 2:28 AM, Simon Riggs wrote: > I understand we are adding a check to verify heap against index and > this will take longer than before. When it runs does it report > progress of the run via pg_stat_activity, so we can monitor how long > it will take? My point to Pavan was t

RE: pgstat_report_activity() and parallel CREATE INDEX (was: Parallel index creation & pg_stat_activity)

2018-03-29 Thread Phil Florent
Thanks, ran the original test and it works great after the patch. Phil De : Robert Haas Envoyé : jeudi 22 mars 2018 18:17 À : Peter Geoghegan Cc : Andres Freund; Phil Florent; PostgreSQL Hackers Objet : Re: pgstat_report_activity() and parallel CREATE INDEX (was

Re: pgsql: Add documentation for the JIT feature.

2018-03-29 Thread Robert Haas
On Thu, Mar 29, 2018 at 9:44 AM, Tom Lane wrote: > I'd go a little further and drop "JIT" from user-facing documentation > altogether. Instead refer to the feature as "compilation of expressions" > or some such. JIT is just jargon. Plus, the timing of the compilation is > actually the least imp

Re: [HACKERS] GSoC 2017: weekly progress reports (week 6)

2018-03-29 Thread Alvaro Herrera
Teodor Sigaev wrote: > > Alvaro Herrera wrote: > > I don't quite understand the new call in gininsert -- I mean I see that > > it wants to check for conflicts even when fastupdate is set, but why? > If fastupdate is set then we check conflict with whole index, not a > particular pages in it. Predi

Feature Request - DDL deployment with logical replication

2018-03-29 Thread Jeremy Finzel
Hello! I have not seen much discussion about what the plans are for being able to manage schema changes when using logical replication. In our own infrastructure, mechanisms that have been provided to manage DDL statements at the same transactional point as they happen on the master have been imm

Re: Changing WAL Header to reduce contention during ReserveXLogInsertLocation()

2018-03-29 Thread Tomas Vondra
On 03/29/2018 06:42 PM, Tom Lane wrote: > Simon Riggs writes: >> I know the approach is new and surprising but I thought about it a lot >> before proposing it and I couldn't see any holes; still can't. Please >> give this some thought so we can get comfortable with this idea and >> increase perfor

Re: Fix src/test/subscription/t/003_constraints.pl header comment

2018-03-29 Thread Magnus Hagander
On Thu, Mar 29, 2018 at 1:32 PM, Alexander Korotkov < a.korot...@postgrespro.ru> wrote: > Hi! > > src/test/subscription/t/003_constraints.pl starts from the line > > # Basic logical replication test > > It seems that this line was copy-pasted from src/test/subscription/t/001_ > rep_changes.pl. > F

Re: Question about WalSndWriteData

2018-03-29 Thread Konstantin Knizhnik
On 21.03.2018 10:08, Konstantin Knizhnik wrote: On 21.03.2018 04:50, Peter Eisentraut wrote: On 3/16/18 12:08, Konstantin Knizhnik wrote: pq_putmessage_noblock copies data from ctx->out buffer to libpq buffers. After it we write timestamp to ctx->out buffer. And comments says that we shoul

Re: Typo in pg_backup_custom.c

2018-03-29 Thread Magnus Hagander
On Thu, Mar 29, 2018 at 3:43 PM, Daniel Gustafsson wrote: > Attached fixes a typo, which according to Git is close to being allowed to > drive. > Applied, thanks. -- Magnus Hagander Me: https://www.hagander.net/ Work: https://www.redpill-linpro.com/

Re: [HACKERS] [PATCH] Vacuum: Update FSM more frequently

2018-03-29 Thread Tom Lane
Claudio Freire writes: > On Wed, Mar 28, 2018 at 6:54 PM, Tom Lane wrote: >> After 0001, >> there's no reason to assume that vacuum is particularly likely to get >> cancelled between having made cleanups and having updated the upper FSM >> levels. (Maybe the odds are a bit more for the no-indexe

Re: [HACKERS] GSoC 2017: weekly progress reports (week 6)

2018-03-29 Thread Teodor Sigaev
Alvaro Herrera wrote: I don't quite understand the new call in gininsert -- I mean I see that it wants to check for conflicts even when fastupdate is set, but why? If fastupdate is set then we check conflict with whole index, not a particular pages in it. Predicate lock on penging list pages w

Re: [HACKERS] path toward faster partition pruning

2018-03-29 Thread Tomas Vondra
Hi, I think there's a bug in generate_pruning_steps_from_opexprs, which does this for PARTITION_STRATEGY_HASH: for_each_cell(lc1, lc) { pc = lfirst(lc1); /* * Note that we pass nullkeys for step_nullkeys, * because we need to tell hash partition bound s

Re: Changing WAL Header to reduce contention during ReserveXLogInsertLocation()

2018-03-29 Thread Tom Lane
Simon Riggs writes: > I know the approach is new and surprising but I thought about it a lot > before proposing it and I couldn't see any holes; still can't. Please > give this some thought so we can get comfortable with this idea and > increase performance as a result. Thanks. The long and the s

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

2018-03-29 Thread Konstantin Knizhnik
On 11.01.2018 22:41, Peter Eisentraut wrote: On 12/22/17 23:57, Tomas Vondra wrote: PART 1: adding logical_work_mem memory limit (0001) --- Currently, limiting the amount of memory consumed by logical decoding is tricky (or you might say impossi

  1   2   >