Re: Ambigous Plan - Larger Table on Hash Side

2018-03-15 Thread Narendra Pradeep U U
Hi Jeff, I repeated the same query with a work_mem of 2000MB. It is faster than the one with two batches but still slower than hashing the smaller table. So in this case It makes more sense to hash the smaller table (less execution time and reduce hash table size). Explain a

segmentation fault in pg head with SQL function.

2018-03-15 Thread Prabhat Sahu
Hi, I found a segmentation fault on pg master Head with below steps and stacktrace. postgres=# CREATE OR REPLACE FUNCTION func1() RETURNS VOID LANGUAGE SQL AS $$ select 10; $$; CREATE FUNCTION postgres=# select func1(); server closed the connection unexpectedly This probably means the server te

RE: [bug fix] Cascaded standby cannot start after a clean shutdown

2018-03-15 Thread Tsunakawa, Takayuki
From: Michael Paquier [mailto:mich...@paquier.xyz] > We use palloc_extended with MCXT_ALLOC_NO_OOM in 9.5~, and malloc() further > down, so once you remove the FATAL error caused by a record whose length > is higher than 1GB, you discard all the hard failures, no? Ouch, you're right. If memory al

Re: [bug fix] Cascaded standby cannot start after a clean shutdown

2018-03-15 Thread Michael Paquier
On Fri, Mar 16, 2018 at 05:27:58AM +, Tsunakawa, Takayuki wrote: > Honestly, I'm fine with either patch. I like your simpler and cleaner > one that has no performance impact. But please note that the > allocation attempt could amount to nearly 1 GB. That can fail due to > memory shortage, wh

Re: [HACKERS] MERGE SQL Statement for PG11

2018-03-15 Thread Pavan Deolasee
Hi Stephen, On Fri, Mar 16, 2018 at 7:28 AM, Stephen Frost wrote: > Greetings Pavan, all, > > * Pavan Deolasee (pavan.deola...@gmail.com) wrote: > > On 9 March 2018 at 08:29, Peter Geoghegan wrote: > > > My #1 concern has become RLS, and > > > perhaps only because I haven't studied it in enou

RE: [bug fix] Cascaded standby cannot start after a clean shutdown

2018-03-15 Thread Tsunakawa, Takayuki
From: Michael Paquier [mailto:mich...@paquier.xyz] > Even with that, the resulting patch is sort of ugly... So it seems to me > that the conclusion to this thread is that there is no clear winner, and > that the problem is so unlikely to happen that it is not worth the performance > impact to zero

Re: Problem while setting the fpw with SIGHUP

2018-03-15 Thread Michael Paquier
On Tue, Mar 13, 2018 at 05:04:04PM +0900, Michael Paquier wrote: > Instead of doing what you are suggesting, why not moving > InitXLogInsert() out of InitXLOGAccess() and change InitPostgres() so as > the allocations for WAL inserts is done unconditionally? This has > the cost of also making this

pspg pager 1.0.0

2018-03-15 Thread Pavel Stehule
Hi I finished my work on pspg pager - a special pager designed for usage together with psql (but other databases, other TUI clients are supported too). I is available from source code https://github.com/okbob/pspg or from packages Regards Pavel

Re: pg_get_functiondef forgets about most GUC_LIST_INPUT GUCs

2018-03-15 Thread Michael Paquier
On Fri, Mar 16, 2018 at 10:25:35AM +0900, Michael Paquier wrote: >> But, I suppose it is a bit too big. > > That's of course not backpatchable. So in this jungle attached is my counter-proposal. As the same code pattern is repeated in three places, we could as well refactor the whole into a comm

Re: PL/pgSQL nested CALL with transactions

2018-03-15 Thread Pavel Stehule
Hi 2018-03-16 2:57 GMT+01:00 Peter Eisentraut : > On 2/28/18 14:51, Peter Eisentraut wrote: > > So far, a nested CALL or DO in PL/pgSQL would not establish a context > > where transaction control statements were allowed. This patch fixes > > that by handling CALL and DO specially in PL/pgSQL, pa

Re: PQHost() undefined behavior if connecting string contains both host and hostaddr types

2018-03-15 Thread Kyotaro HORIGUCHI
At Fri, 16 Mar 2018 09:50:41 +0900 (Tokyo Standard Time), Kyotaro HORIGUCHI wrote in <20180316.095041.241173653.horiguchi.kyot...@lab.ntt.co.jp> > I drifted to come here.. > > At Wed, 14 Mar 2018 11:17:35 +0900, Michael Paquier > wrote in <20180314021735.gi1...@paquier.xyz> > > On Fri, Mar 09

Re: fixing more format truncation issues

2018-03-15 Thread Michael Paquier
On Thu, Mar 15, 2018 at 12:12:18PM -0400, Tom Lane wrote: > FWIW, I noticed while fooling with pre-release Fedora 28 that gcc 8.0.1 > emits a whole boatload of these warnings by default. This patch doesn't > seem to have moved the needle very much, either. In a quick look, it > seemed like a lot

Re: Re: pgbench randomness initialization

2018-03-15 Thread Chapman Flack
I'm sorry, I must have missed your reply on the 5th somehow. On 03/05/18 07:01, Fabien COELHO wrote: > I must admit that I'm not too happy with the result as well, so I dropped > the octal/hexadecimal parsing. That seems perfectly reasonable to me; perfectly adequate to accept only one base. But

Re: handling of heap rewrites in logical decoding

2018-03-15 Thread Craig Ringer
On 16 March 2018 at 08:51, Peter Eisentraut < peter.eisentr...@2ndquadrant.com> wrote: > On 2/28/18 13:52, Peter Eisentraut wrote:> Second version, which uses an > OID. I added another field to the output> plugin options (next to the > output_type), to indicate whether the plugin> wants to receiv

Re: Parallel Aggregates for string_agg and array_agg

2018-03-15 Thread David Rowley
On 16 March 2018 at 13:46, Tomas Vondra wrote: > I've done more testing on this patch, and I haven't found any new issues > with it, so PFA I'm marking it as ready for committer. Great! Many thanks for the review. -- David Rowley http://www.2ndQuadrant.com/ PostgreSQL Devel

Re: [HACKERS] [PATCH] Incremental sort

2018-03-15 Thread Tomas Vondra
On 03/10/2018 06:05 PM, Alexander Korotkov wrote: > On Sat, Mar 10, 2018 at 6:42 PM, Alexander Korotkov > mailto:a.korot...@postgrespro.ru>> wrote: > > ... > > After some investigation of benchmark results, I found 2 sources of > regressions of incremental sort. > > *Case 1: Underlying node scan

Re: [PATCH] btree_gin, add support for uuid, bool, name, bpchar and anyrange types

2018-03-15 Thread Tomas Vondra
On 03/08/2018 10:20 AM, Matheus de Oliveira wrote: > Hi all. > > Em 4 de mar de 2018 16:00, "Tomas Vondra" > escreveu: > > > 1) I personally am not that sure GIN indexes on ranges are very useful, > considering those columns are usually queried for

Re: [HACKERS] MERGE SQL Statement for PG11

2018-03-15 Thread Stephen Frost
Greetings Pavan, all, * Pavan Deolasee (pavan.deola...@gmail.com) wrote: > On 9 March 2018 at 08:29, Peter Geoghegan wrote: > > My #1 concern has become RLS, and > > perhaps only because I haven't studied it in enough detail. > > Sure. I've done what I thought is the right thing to do, but plea

Re: PL/pgSQL nested CALL with transactions

2018-03-15 Thread Peter Eisentraut
On 2/28/18 14:51, Peter Eisentraut wrote: > So far, a nested CALL or DO in PL/pgSQL would not establish a context > where transaction control statements were allowed. This patch fixes > that by handling CALL and DO specially in PL/pgSQL, passing the > atomic/nonatomic execution context through and

Re: [HACKERS] plpgsql - additional extra checks

2018-03-15 Thread Tomas Vondra
On 03/04/2018 07:07 PM, Pavel Stehule wrote: > > ... > > I am sending updated patch with Tomas changes > Seems 2cf8c7aa48 broke this patch, as it tweaked a number of regression tests. Other than that, I think the patch is pretty much ready. One minor detail is that this bit from exec_stmt_exec

Re: pg_get_functiondef forgets about most GUC_LIST_INPUT GUCs

2018-03-15 Thread Michael Paquier
On Thu, Mar 15, 2018 at 06:48:36PM +0900, Kyotaro HORIGUCHI wrote: > postgres=# CREATE FUNCTION func_with_set_params() RETURNS integer > AS 'select 1;' > LANGUAGE SQL > set plpgsql.extra_errors to 'shadowed_variables' > set work_mem to '48MB' > set plpgsql.extra_warnings to 'sha

Re: User defined data types in Logical Replication

2018-03-15 Thread Alvaro Herrera
Masahiko Sawada wrote: > On Thu, Mar 15, 2018 at 9:41 AM, Alvaro Herrera > wrote: > > I think this is a worthwhile test, but IMO it should be improved a bit > > before we include it. Also, we can come up with a better name for the > > test surely, not just refer to this particular bug. Maybe "t

Re: [HACKERS] Lazy hash table for XidInMVCCSnapshot (helps Zipfian a bit)

2018-03-15 Thread Tomas Vondra
On 03/10/2018 03:11 AM, Yura Sokolov wrote: > 08.03.2018 03:42, Tomas Vondra пишет: >> On 03/06/2018 06:23 AM, Yura Sokolov wrote: >>> 05.03.2018 18:00, Tom Lane пишет: Tomas Vondra writes: > Snapshots are static (we don't really add new XIDs into existing ones, > right?), so why do

Re: pg_get_functiondef forgets about most GUC_LIST_INPUT GUCs

2018-03-15 Thread Michael Paquier
On Thu, Mar 15, 2018 at 01:33:51PM +0300, Arthur Zakirov wrote: > I think your approach has a vulnerability too. I believe that a > non GUC_LIST_INPUT extension GUC which was used to create a function may > become GUC_LIST_INPUT variable. If I'm not mistaken nothing stops from > that. In this case

Re: Fixes for missing schema qualifications

2018-03-15 Thread Michael Paquier
On Thu, Mar 15, 2018 at 01:42:08AM -0700, Noah Misch wrote: > Dozens of psql queries call pg_*_is_visible functions, which need the > search_path pertinent for user-entered queries. By itself, (3) doesn't work > for such queries. Even if you implemented (2), using psql with a hostile > search_pat

Re: User defined data types in Logical Replication

2018-03-15 Thread Masahiko Sawada
On Thu, Mar 15, 2018 at 9:41 AM, Alvaro Herrera wrote: > Masahiko Sawada wrote: > >> Regarding to regression test, I added a new test module >> test_subscription that creates a new user-defined data type. In a >> subscription regression test, using test_subscription we make >> subscriber call slot

Re: PQHost() undefined behavior if connecting string contains both host and hostaddr types

2018-03-15 Thread Kyotaro HORIGUCHI
I drifted to come here.. At Wed, 14 Mar 2018 11:17:35 +0900, Michael Paquier wrote in <20180314021735.gi1...@paquier.xyz> > On Fri, Mar 09, 2018 at 04:42:30PM -0500, Peter Eisentraut wrote: > > It seems, however, that PGhost() has always been broken for hostaddr > > use. In 9.6 (before the mult

Re: handling of heap rewrites in logical decoding

2018-03-15 Thread Peter Eisentraut
On 2/28/18 13:52, Peter Eisentraut wrote:> Second version, which uses an OID. I added another field to the output> plugin options (next to the output_type), to indicate whether the plugin> wants to receive these changes. I added some test cases to> test_decoding to show how it works either way.

Re: Parallel Aggregates for string_agg and array_agg

2018-03-15 Thread Tomas Vondra
On 03/11/2018 12:10 PM, Tomas Vondra wrote: > > ... > > Yeah, seems fine to me. I wonder what else would be needed before > switching the patch to RFC. I plan to do that after a bit more > testing sometime early next week, unless someone objects. > I've done more testing on this patch, and I

Re: Failed to request an autovacuum work-item in silence

2018-03-15 Thread Masahiko Sawada
On Thu, Mar 15, 2018 at 7:35 PM, Alvaro Herrera wrote: > Masahiko Sawada wrote: >> On Thu, Mar 15, 2018 at 12:06 AM, Alvaro Herrera >> wrote: > >> > Now I'm wondering what will we tell users to do if they get this message >> > too frequently. Neither of the obvious options (1. changing the index

Re: Clarification needed for comment in storage/file/fd.c

2018-03-15 Thread Michael Paquier
On Thu, Mar 15, 2018 at 11:22:31AM +, samuel cherukutty wrote: > It states that it behaves as native functions with the handle > registered to the current subtransaction. > If it is so, why is it intended for short operations? > Will it work if I open a file at the start of the transaction and

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

2018-03-15 Thread Alexander Korotkov
On Tue, Mar 13, 2018 at 3:25 PM, Alvaro Herrera wrote: > Alexander Korotkov wrote: > > > And what happen if somebody concurrently set (fastupdate = on)? > > Can we miss conflicts because of that? > > I think it'd be better to have that option require AccessExclusive lock, > so that it can never b

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

2018-03-15 Thread Alexander Korotkov
On Tue, Mar 13, 2018 at 3:26 PM, Andrey Borodin wrote: > > 13 марта 2018 г., в 17:02, Alexander Korotkov > написал(а): > > > > BTW to BTW. I think we should check pending list size with > GinGetPendingListCleanupSize() here > > + > > + /* > > +* If fast update is enabled, we acquir

Re: [HACKERS] Partition-wise aggregation/grouping

2018-03-15 Thread Robert Haas
On Thu, Mar 15, 2018 at 2:46 PM, Robert Haas wrote: > I wonder if we could simplify things by copying more information from > the parent grouping rel to the child grouping rels. On further review, it seems like a better idea is to generate the partial grouping relations from the grouping relation

Re: SET TRANSACTION in PL/pgSQL

2018-03-15 Thread Alexander Korotkov
Hi! On Wed, Feb 28, 2018 at 11:45 PM, Peter Eisentraut < peter.eisentr...@2ndquadrant.com> wrote: > Currently, you can't run SET TRANSACTION in PL/pgSQL. A normal SQL > command run inside PL/pgSQL acquires a snapshot, but SET > TRANSACTION does not work anymore if a snapshot is set. Here is a p

Re: worker_spi.naptime in worker_spi example

2018-03-15 Thread Jeremy Finzel
On Thu, Mar 15, 2018 at 3:54 PM, Chapman Flack wrote: > On 03/15/2018 04:19 PM, Jeremy Finzel wrote: > > > Thank you. I did see worker_spi_naptime definition, but I wanted to > > pass worker_spi_naptime > > as an argument instead into worker_spi_main so that I can control via SQL > > interface h

Re: INOUT parameters in procedures

2018-03-15 Thread Tom Lane
Jeff Janes writes: > On Thu, Mar 15, 2018 at 6:58 AM, Tom Lane wrote: >> Not fixed by 8df5a1c868cc28f89ac6221cff8e2b5c952d0eb6? > I think you meant to type "now fixed by". (unless your compiler is pickier > than mine) Actually what I meant was "doesn't that commit fix it for you?"

missing support of named convention for procedures

2018-03-15 Thread Pavel Stehule
Hi create or replace procedure proc2(in a int, in b int) as $$ begin a := a * 10; b := b * 10; end; $$ language plpgsql; postgres=# call proc2(a => 10,b => 20); ERROR: XX000: unrecognized node type: 107 LOCATION: ExecInitExprRec, execExpr.c:2114 Regards Pavel

Re: worker_spi.naptime in worker_spi example

2018-03-15 Thread Chapman Flack
On 03/15/2018 04:19 PM, Jeremy Finzel wrote: > Thank you. I did see worker_spi_naptime definition, but I wanted to > pass worker_spi_naptime > as an argument instead into worker_spi_main so that I can control via SQL > interface how frequently the worker SQL executes. Is this possible? Are you

Re: worker_spi.naptime in worker_spi example

2018-03-15 Thread Jeremy Finzel
On Thu, Mar 15, 2018 at 12:21 PM, Chapman Flack wrote: > On 03/15/2018 10:59 AM, Jeremy Finzel wrote: > > > WaitLatch function the same variable worker_spi_naptime without > referencing > > the configuration created in _PG_init. Am I missing something here? > > You can see the declaration of tha

Re: [HACKERS] Partition-wise aggregation/grouping

2018-03-15 Thread Robert Haas
On Thu, Mar 15, 2018 at 11:49 AM, Robert Haas wrote: > I'm going to go spend some time looking at 0005 next. It looks to me > like it's generally going in a very promising direction, but I need to > study the details more. On further study this patch is doing a number of things, some of which se

Re: JIT compiling with LLVM v11

2018-03-15 Thread Andres Freund
Hi, On 2018-03-15 19:14:09 +0100, Catalin Iacob wrote: > For RHEL proper, I would guess that PG11 is too late for RHEL8 which, > according to history, should be coming soon. Yea. > For RHEL9 I would really expect RedHat to add llvm and clang to proper > RHEL and build/run against those, even if

Re: INOUT parameters in procedures

2018-03-15 Thread Jeff Janes
On Thu, Mar 15, 2018 at 6:58 AM, Tom Lane wrote: > Jeff Janes writes: > > I'm getting compiler warnings: > > pl_exec.c: In function 'exec_stmt_call': > > pl_exec.c:2089:8: warning: variable 'numargs' set but not used > > Not fixed by 8df5a1c868cc28f89ac6221cff8e2b5c952d0eb6? > I think you meant

Re: JIT compiling with LLVM v11

2018-03-15 Thread Catalin Iacob
On Thu, Mar 15, 2018 at 6:19 PM, Andres Freund wrote: > What we were talking about in this subthread was about a depency on > clang, not LLVM. And that's just needed at buildtime, to generate the > bitcode files (including synchronizing types / function signatures). I was actually thinking of bot

Re: WaitLatchOrSocket optimization

2018-03-15 Thread Andres Freund
Hi, On 2018-03-15 19:01:40 +0300, Konstantin Knizhnik wrote: > Right now function WaitLatchOrSocket is implemented in very inefficient way: > for each invocation it creates epoll instance, registers events and then > closes this instance. Right, everything performance critical should be migrated

Re: worker_spi.naptime in worker_spi example

2018-03-15 Thread Chapman Flack
On 03/15/2018 10:59 AM, Jeremy Finzel wrote: > WaitLatch function the same variable worker_spi_naptime without referencing > the configuration created in _PG_init. Am I missing something here? You can see the declaration of that variable up on line 56. It's just an int variable static to worker_

Re: JIT compiling with LLVM v11

2018-03-15 Thread Andres Freund
On 2018-03-15 12:42:54 -0400, Tom Lane wrote: > Andres Freund writes: > > It'd be a build not runtime dependency, doesn't that change things? > > How could it not be a runtime dependency? What we were talking about in this subthread was about a depency on clang, not LLVM. And that's just needed

Re: jsonpath

2018-03-15 Thread Nikita Glukhov
Attached 13th version of the jsonpath patches. Syntax of .** accessor (our extension to standard) was changed to become more similar to the syntax of the standard array accessor: .**{2, 5} => .**{2 to 5} .**{3,} => .**{3 to last} -- Nikita Glukhov Postgres Professional: http://www.postgrespr

Re: JIT compiling with LLVM v11

2018-03-15 Thread Tom Lane
Andres Freund writes: > On 2018-03-15 12:33:08 -0400, Tom Lane wrote: >> The "software collections" stuff was still in its infancy when I left >> Red Hat, so things might've changed, but I'm pretty sure at the time >> it was verboten for any mainstream package to depend on an SCL one. > But we wo

Re: chained transactions

2018-03-15 Thread Alvaro Herrera
Peter Eisentraut wrote: > Subject: [PATCH v1 1/8] Update function comments > > After a6542a4b6870a019cd952d055d2e7af2da2fe102, some function comments > were misplaced. Fix that. Note typo WarnNoTranactionChain in one comment. The patch leaves CheckTransactionChain with no comment whatsoever; m

Re: JIT compiling with LLVM v11

2018-03-15 Thread Andres Freund
On 2018-03-15 12:33:08 -0400, Tom Lane wrote: > Andres Freund writes: > > On 2018-03-15 17:19:23 +0100, Catalin Iacob wrote: > >> Indeed. It might be a bit awkward for packagers to depend on something > >> from Software Collections, for example because they come as separate > >> trees in /opt that

Re: JIT compiling with LLVM v11

2018-03-15 Thread Tom Lane
Andres Freund writes: > On 2018-03-15 17:19:23 +0100, Catalin Iacob wrote: >> Indeed. It might be a bit awkward for packagers to depend on something >> from Software Collections, for example because they come as separate >> trees in /opt that are by default not in your path or dynamic loader >> pa

Re: JIT compiling with LLVM v11

2018-03-15 Thread Andres Freund
Hi, On 2018-03-15 17:19:23 +0100, Catalin Iacob wrote: > On Thu, Mar 15, 2018 at 1:20 AM, Andres Freund wrote: > > I don't really live in the RHEL world, but I wonder if > > https://developers.redhat.com/blog/2017/10/04/red-hat-adds-go-clangllvm-rust-compiler-toolsets-updates-gcc/ > > is relevant

Re: [HACKERS] Removing [Merge]Append nodes which contain a single subpath

2018-03-15 Thread Tom Lane
Robert Haas writes: > On Thu, Mar 15, 2018 at 11:01 AM, Tom Lane wrote: >> It might be worth looking at whether we couldn't fix the single-member- >> Append issue the same way we fix no-op SubqueryScans, ie let setrefs.c >> get rid of them. That's not the most beautiful solution perhaps, but >>

Re: JIT compiling with LLVM v11

2018-03-15 Thread Catalin Iacob
On Thu, Mar 15, 2018 at 1:20 AM, Andres Freund wrote: > I don't really live in the RHEL world, but I wonder if > https://developers.redhat.com/blog/2017/10/04/red-hat-adds-go-clangllvm-rust-compiler-toolsets-updates-gcc/ > is relevant? Indeed. It might be a bit awkward for packagers to depend on

Re: SSL passphrase prompt external command

2018-03-15 Thread Daniel Gustafsson
First: thanks a lot for hacking on the SSL code, I might be biased but I really appreciate it! The patch no longer applies due to ff18115ae9 and f96f48113f, but the conflicts are trivial so nothing to worry about there. Documentation exist and reads well, the added tests pass and seem quite reaso

Re: fixing more format truncation issues

2018-03-15 Thread Tom Lane
Peter Eisentraut writes: > On 3/14/18 02:52, Michael Paquier wrote: >> Enabling them by default would generate some useless noise if the patch >> is let as-is as a couple of them are not addressed. Please see the full >> report attached. Is that intentional? I am using GCC 7.3 here. > Well tha

WaitLatchOrSocket optimization

2018-03-15 Thread Konstantin Knizhnik
Hi hackers, Right now function WaitLatchOrSocket is implemented in very inefficient way: for each invocation it creates epoll instance, registers events and then closes this instance. Certainly it is possible to create wait event set once with CreateWaitEventSet and then use WaitEventSetWait.

Re: [HACKERS] Partition-wise aggregation/grouping

2018-03-15 Thread Robert Haas
On Thu, Mar 15, 2018 at 9:46 AM, Jeevan Chalke wrote: > Hmm.. you are right. Done. I don't see a reason to hold off on committing 0002 and 0003, so I've done that now; since they are closely related changes, I pushed them as a single commit. It probably could've just been included in the main pa

Re: fixing more format truncation issues

2018-03-15 Thread Peter Eisentraut
On 3/14/18 02:52, Michael Paquier wrote: > Enabling them by default would generate some useless noise if the patch > is let as-is as a couple of them are not addressed. Please see the full > report attached. Is that intentional? I am using GCC 7.3 here. Well that's weird. Apparently, the warni

Re: [HACKERS] Removing [Merge]Append nodes which contain a single subpath

2018-03-15 Thread Robert Haas
On Thu, Mar 15, 2018 at 11:01 AM, Tom Lane wrote: > It might be worth looking at whether we couldn't fix the single-member- > Append issue the same way we fix no-op SubqueryScans, ie let setrefs.c > get rid of them. That's not the most beautiful solution perhaps, but > it'd be very localized and

Re: "SELECT ... FROM DUAL" is not quite as silly as it appears

2018-03-15 Thread Robert Haas
On Thu, Mar 15, 2018 at 11:27 AM, Tom Lane wrote: > We've long made fun of Oracle(TM) for the fact that if you just want > to evaluate some expressions, you have to write "select ... from dual" > rather than just "select ...". But I've realized recently that there's > a bit of method in that madn

"SELECT ... FROM DUAL" is not quite as silly as it appears

2018-03-15 Thread Tom Lane
We've long made fun of Oracle(TM) for the fact that if you just want to evaluate some expressions, you have to write "select ... from dual" rather than just "select ...". But I've realized recently that there's a bit of method in that madness after all. Specifically, having to cope with FromExprs

Re: [HACKERS] Removing [Merge]Append nodes which contain a single subpath

2018-03-15 Thread Tom Lane
Robert Haas writes: > That said, I gather that one problem is the path might contain > references to child varnos where we need to reference parent varnos. > That does seem like something we need to handle, but I'm not sure > whether this is really the right method. I wonder if we couldn't > dedu

worker_spi.naptime in worker_spi example

2018-03-15 Thread Jeremy Finzel
Hello! I am trying to create a background worker where I can pass in via SQL interface the naptime. I'm not sure how to do this. In the worker_spi example, _PG_init creates a configuration using the static variable worker_spi_naptime, but then it appears to call in worker_spi_main in the WaitLat

Re: using index or check in ALTER TABLE SET NOT NULL

2018-03-15 Thread Ildar Musin
Hello Sergei, On 10.03.2018 12:35, Sergei Kornilov wrote: Hello My patch does not apply after commit 5748f3a0aa7cf78ac6979010273bd9d50869bb8e. Here is update to current master. Not null constraint is immutable too, so here is no changes in PartConstraintImpliedByRelConstraint excepts rename and

Re: Additional Statistics Hooks

2018-03-15 Thread Tomas Vondra
On 03/15/2018 06:00 AM, Ashutosh Bapat wrote: > On Tue, Mar 13, 2018 at 8:55 PM, Mat Arye wrote: >>> >>> Like cost associated with a function, we may associate mapping >>> cardinality with a function. It tells how many distinct input values >>> map to 1 output value. By input value, I mean input

Re: [HACKERS] Partition-wise aggregation/grouping

2018-03-15 Thread Robert Haas
On Thu, Mar 15, 2018 at 6:08 AM, Ashutosh Bapat wrote: > In current create_grouping_paths() (without any of your patches > applied) we first create partial paths in partially grouped rel and > then add parallel path to grouped rel using those partial paths. Then > we hand over this to FDW and exte

Re: INOUT parameters in procedures

2018-03-15 Thread Tom Lane
Jeff Janes writes: > I'm getting compiler warnings: > pl_exec.c: In function 'exec_stmt_call': > pl_exec.c:2089:8: warning: variable 'numargs' set but not used Not fixed by 8df5a1c868cc28f89ac6221cff8e2b5c952d0eb6? regards, tom lane

Re: [HACKERS] Partition-wise aggregation/grouping

2018-03-15 Thread Jeevan Chalke
On Thu, Mar 15, 2018 at 3:38 PM, Ashutosh Bapat < ashutosh.ba...@enterprisedb.com> wrote: > > The patchset needs rebase. I have rebased those on the latest head > and made following changes. > > Argument force_partial_agg is added after output arguments to > make_grouping_rels(). Moved it before

Re: [HACKERS] Removing [Merge]Append nodes which contain a single subpath

2018-03-15 Thread Robert Haas
On Thu, Mar 15, 2018 at 9:22 AM, Robert Haas wrote: >> Wouldn't a ProjectionPath just need the same additional translation >> fields that I've bolted onto AppendPath to make it work properly? > > Well, I guess I'm not sure. Sorry, hit send too soon there. I'm not sure I entirely understand the p

Re: [HACKERS] Removing [Merge]Append nodes which contain a single subpath

2018-03-15 Thread Robert Haas
On Tue, Mar 13, 2018 at 8:20 PM, David Rowley wrote: > On 14 March 2018 at 09:25, Robert Haas wrote: >> What do you think about the idea of using a projection path as a proxy >> path instead of inventing a new method? It seems simple enough to do: >> >> new_path = (Path *) create_projection_path

Re: Online enabling of checksums

2018-03-15 Thread Daniel Gustafsson
> On 10 Mar 2018, at 16:09, Michael Banck wrote: > I had a closer look at v3 of the patch now. Thanks, much appreciated! Sorry for the late response, just came back from a conference and have had little time for hacking. All whitespace, punctuation and capitalization comments have been address

Re: Re: [submit code] I develop a tool for pgsql, how can I submit it

2018-03-15 Thread Aleksander Alekseev
Hello leap, > I don't know how to "submit a link to Reddit and/or Hacker News". if > some people also like pgcheck after know pg_filedump, hope to help me > let more people to know it. These are sites where people involved in IT share links they find interesting and other people vote for the link

Re: [HACKERS] GSoC 2017: weekly progress reports (week 4) and patch for hash index

2018-03-15 Thread Amit Kapila
On Thu, Mar 15, 2018 at 4:29 PM, Alexander Korotkov wrote: > On Tue, Mar 13, 2018 at 4:57 PM, Amit Kapila > wrote: >> >> > >> > Valid point, I think on split we should always transfer locks from old >> > bucket to new bucket. >> > >> >> Attached patch changes it as per above suggestion. > > > OK.

Clarification needed for comment in storage/file/fd.c

2018-03-15 Thread samuel cherukutty
Hi,       I came across this comment in storage/file/fd.c while I was trying to write an FDW. " AllocateFile, AllocateDir, OpenPipeStream and OpenTransientFile arewrappers around fopen(3), opendir(3), popen(3) and open(2), respectively.They behave like the corresponding native functions, except

Re: [HACKERS] GSoC 2017: weekly progress reports (week 4) and patch for hash index

2018-03-15 Thread Alexander Korotkov
On Tue, Mar 13, 2018 at 4:57 PM, Amit Kapila wrote: > On Mon, Mar 12, 2018 at 7:18 PM, Amit Kapila > wrote: > > On Mon, Mar 12, 2018 at 12:18 AM, Alexander Korotkov > > wrote: > >> On Sat, Mar 3, 2018 at 2:53 PM, Amit Kapila > wrote: > >>> > >>> On Fri, Mar 2, 2018 at 9:27 AM, Thomas Munro > >

Passing estate to assign_simple_var()

2018-03-15 Thread Ashutosh Sharma
Hi All, I don't see any reason for passing estate variable to assign_simple_var() in the current postgreSQL code. I think, it was required earlier as we were updating param info in this function but, now, we are not doing that here. So, shouldn't it be removed. Thoughts ? I think, the ides of not

Re: Failed to request an autovacuum work-item in silence

2018-03-15 Thread Alvaro Herrera
Masahiko Sawada wrote: > On Thu, Mar 15, 2018 at 12:06 AM, Alvaro Herrera > wrote: > > Now I'm wondering what will we tell users to do if they get this message > > too frequently. Neither of the obvious options (1. changing the index's > > pages_per_range to a larger value; 2. making autovacuum

Re: pg_get_functiondef forgets about most GUC_LIST_INPUT GUCs

2018-03-15 Thread Arthur Zakirov
On Thu, Mar 15, 2018 at 06:48:36PM +0900, Kyotaro HORIGUCHI wrote: > So, we should reject to define function in the case. We don't > accept the GUC element if it is just a placeholder. > > The attached is a rush work of my idea. Diff for pg_proc.h is too > large so it is separated and gziped. > >

Re: [HACKERS] Partition-wise aggregation/grouping

2018-03-15 Thread Ashutosh Bapat
On Wed, Mar 14, 2018 at 7:51 PM, Jeevan Chalke wrote: > > > On Tue, Mar 13, 2018 at 7:43 PM, Jeevan Chalke > wrote: >> >> Hi, >> >> The patch-set is complete now. But still, there is a scope of some comment >> improvements due to all these refactorings. I will work on it. Also, need to >> update

Re: pg_get_functiondef forgets about most GUC_LIST_INPUT GUCs

2018-03-15 Thread Kyotaro HORIGUCHI
At Thu, 15 Mar 2018 15:09:54 +0900, Michael Paquier wrote in <20180315060954.ge...@paquier.xyz> > On Thu, Mar 15, 2018 at 02:03:15PM +0900, Kyotaro HORIGUCHI wrote: > > At Thu, 15 Mar 2018 00:33:25 -0400, Tom Lane wrote in > > <22193.1521088...@sss.pgh.pa.us> > >> Kyotaro HORIGUCHI writes: > >

Re: [HACKERS] path toward faster partition pruning

2018-03-15 Thread Amit Langote
On 2018/03/14 20:50, David Rowley wrote: > On 14 March 2018 at 00:37, Amit Langote wrote: >> Attached is a significantly revised version of the patch, although I admit >> it could still use some work with regard to comments and other cleanup. > > Thanks for making all those changes. There's been

Re: Fixes for missing schema qualifications

2018-03-15 Thread Noah Misch
On Wed, Mar 14, 2018 at 10:50:38AM +0900, Michael Paquier wrote: > On Sat, Mar 10, 2018 at 08:36:34AM +, Noah Misch wrote: > > This qualifies some functions, but it leaves plenty of unqualified > > operators. > > Yeah, I know that, and i don't have a perfect reply to offer to you. > There are

Re: WIP: a way forward on bootstrap data

2018-03-15 Thread John Naylor
On 3/15/18, Tom Lane wrote: > John Naylor writes: >> It didn't take that long to rebase the remaining parts of the >> patchset, so despite what I said above I went ahead and put them in >> version 10 (attached), this time via scripted bulk editing rather than >> as large patches. > > Starting to

Re: CURRENT OF causes an error when IndexOnlyScan is used

2018-03-15 Thread Yugo Nagata
On Mon, 12 Mar 2018 13:56:24 -0400 Tom Lane wrote: > Anastasia Lubennikova writes: > > [ return_heaptuple_in_btree_indexonlyscan_v2.patch ] > > I took a quick look at this, but I'm concerned about a couple of points: > > 1. What's the performance penalty of forming (and then deforming) the > a

Re: Transform for pl/perl

2018-03-15 Thread Pavel Stehule
Hi 2018-03-13 15:50 GMT+01:00 Nikita Glukhov : > Hi. > > I have reviewed this patch too. Attached new version with v8-v9 delta-patch. > > Here is my changes: > > * HV_ToJsonbValue(): > - addded missing hv_iterinit() > - used hv_iternextsv() instead of hv_iternext(), HeSVKEY_force(), HeV

Re: PATCH: Configurable file mode mask

2018-03-15 Thread Michael Paquier
On Wed, Mar 14, 2018 at 02:08:19PM -0400, David Steele wrote: > OK, that being the case a new patch set is attached that sets the mode > of postmaster.pid the same as other files in PGDATA. +1. > I also cleaned up / corrected / added comments in various places. Patches 1 and 2 look fine to me.