Preferring index-only-scan when the cost is equal

2018-07-10 Thread Yugo Nagata
Hi, I found that there is a situation that even when index only scan can be effective, the planner doesn't select this. The planner makes indexe paths in descending order of indexrelid, and the new path is discarded if its cost is not less than the existing paths' cost. As a result,

Re: patch to allow disable of WAL recycling

2018-07-10 Thread Thomas Munro
On Wed, Jul 11, 2018 at 8:25 AM, Joshua D. Drake wrote: > On 07/10/2018 01:15 PM, Jerry Jelinek wrote: >> >> Thanks to everyone who took the time to look at the patch and send me >> feedback. I'm happy to work on improving the documentation of this new >> tunable to clarify when it should be

Re: no partition pruning when partitioning using array type

2018-07-10 Thread Amit Langote
On 2018/07/11 13:12, Alvaro Herrera wrote: > On 2018-Jul-11, Amit Langote wrote: > >> What's the solution here then? Prevent domains as partition key? > > Maybe if a domain is used in a partition key somewhere, prevent > constraints from being added? Maybe, but I guess you mean only prevent

Re: Concurrency bug in UPDATE of partition-key

2018-07-10 Thread Amit Khandekar
On 11 July 2018 at 09:48, Amit Kapila wrote: > On Wed, Jul 11, 2018 at 8:56 AM, Amit Kapila wrote: >> On Wed, Jul 11, 2018 at 5:59 AM, Alvaro Herrera >> >> >>> Please move the output arguments at the end of argument lists; >> >> make sense. >> >>> also, it >>> would be great if you add

Re: Concurrency bug in UPDATE of partition-key

2018-07-10 Thread Amit Kapila
On Wed, Jul 11, 2018 at 8:56 AM, Amit Kapila wrote: > On Wed, Jul 11, 2018 at 5:59 AM, Alvaro Herrera > > >> Please move the output arguments at the end of argument lists; > > make sense. > >> also, it >> would be great if you add commentary about ExecDelete other undocumented >> arguments

Re: Tips on committing

2018-07-10 Thread Noah Misch
On Thu, Jun 28, 2018 at 10:52:42AM -0700, Peter Geoghegan wrote: > On Thu, Jun 28, 2018 at 9:52 AM, Alvaro Herrera > wrote: > >> FWIW, I developed a document on committing for my own reference, with > >> some help from Andres. My rule has been to add to my private checklist anytime I mail or

Re: no partition pruning when partitioning using array type

2018-07-10 Thread Alvaro Herrera
On 2018-Jul-11, Amit Langote wrote: > What's the solution here then? Prevent domains as partition key? Maybe if a domain is used in a partition key somewhere, prevent constraints from being added? Another thing worth considering: are you prevented from dropping a domain that's used in a

Re: Shared buffer access rule violations?

2018-07-10 Thread Tom Lane
Asim R P writes: > In order to make changes to a shared buffer, one must hold a pin on it > and the content lock in exclusive mode. This rule seems to be > followed in most of the places but there are a few exceptions. > One can find several PageInit() calls with no content lock held. See, >

Re: [HACKERS] WAL logging problem in 9.4.3?

2018-07-10 Thread Michael Paquier
On Tue, Jul 10, 2018 at 05:35:58PM +0300, Heikki Linnakangas wrote: > Thanks for picking this up! > > (I hope this gets through the email filters this time, sending a shell > script seems to be difficult. I also trimmed the CC list, if that helps.) > > On 04/07/18 07:59, Michael Paquier wrote:

Re: Concurrency bug in UPDATE of partition-key

2018-07-10 Thread Amit Kapila
On Wed, Jul 11, 2018 at 5:59 AM, Alvaro Herrera wrote: > On 2018-Jul-09, Amit Kapila wrote: > >> Alvaro, >> >> Can you please comment whether this addresses your concern? > > I was thinking that it would be a matter of passing the tuple slot to > EvalPlanQual for it to fill, rather than requiring

RE: ON CONFLICT DO NOTHING on pg_dump

2018-07-10 Thread Ideriha, Takeshi
Hi, > The new structure member appears out of place, can you move up along > with other "command-line long options" ? > > > >Done > I did regression tests (make check-world) and checked manually pg_dump --on-conflict-do-nothing works properly. Also it seems to me the code has no

Re: user-friendliness improvement of pageinspect

2018-07-10 Thread Yang Jie
Simple queries are fine, but pageinspect can query previous data. If you return the same result as a simple query, this is similar to the oracle flashback version query. On 7/11/2018 09:51,Peter Geoghegan wrote: On Tue, Jul 10, 2018 at 6:44 PM, Yang Jie wrote: my question is not split the

Re: user-friendliness improvement of pageinspect

2018-07-10 Thread Peter Geoghegan
On Tue, Jul 10, 2018 at 6:55 PM, Yang Jie wrote: > Simple queries are fine, but pageinspect can query previous data. If you > return the same result as a simple query, this is similar to the oracle > flashback version query. Please don't top-post. That may be true in some limited sense, but

Re: [HACKERS] SERIALIZABLE with parallel query

2018-07-10 Thread Masahiko Sawada
On Mon, Jul 2, 2018 at 3:12 PM, Masahiko Sawada wrote: > On Fri, Jun 29, 2018 at 7:28 PM, Thomas Munro > wrote: >> On Thu, Jun 28, 2018 at 7:55 PM, Masahiko Sawada >> wrote: >>> I'd like to test and review this patches but they seem to conflict >>> with current HEAD. Could you please rebase

Re: no partition pruning when partitioning using array type

2018-07-10 Thread Amit Langote
On 2018/07/11 4:50, Alvaro Herrera wrote: > On 2018-Jul-10, Tom Lane wrote: > >> And what about those partition bound values? They are now illegal >> for the domain, so I would expect a dump/reload to fail, regardless >> of whether there are any values in the table. > > Hmm, true. There is a

回复: user-friendliness improvement of pageinspect

2018-07-10 Thread Yang Jie
Thank you for your answer. my question is not split the data into individual attributes. I want to see the data in the table, but I don't want to be a bytea type. 在2018年7月11日 02:48,Peter Geoghegan 写道: On Tue, Jul 10, 2018 at 12:41 AM, 杨杰 wrote: Why does the heap_page_item () of the

Re: user-friendliness improvement of pageinspect

2018-07-10 Thread Peter Geoghegan
On Tue, Jul 10, 2018 at 6:44 PM, Yang Jie wrote: > my question is not split the data into individual attributes. > I want to see the data in the table, but I don't want to be a bytea type. What's wrong with simply using an SQL query? -- Peter Geoghegan

Re: Speeding up INSERTs and UPDATEs to partitioned tables

2018-07-10 Thread David Rowley
On 6 July 2018 at 21:25, Kato, Sho wrote: > 2. 11beta2 + patch1 + patch2 > > patch1: Allow direct lookups of AppendRelInfo by child relid > commit 7d872c91a3f9d49b56117557cdbb0c3d4c620687 > patch2: 0001-Speed-up-INSERT-and-UPDATE-on-partitioned-tables.patch > > part_num | tps_ex|

Re: Excessive PostmasterIsAlive calls slow down WAL redo

2018-07-10 Thread Thomas Munro
On Tue, Jul 10, 2018 at 11:39 PM, Heikki Linnakangas wrote: > The 'postmaster_possibly_dead' flag is not reset anywhere. So if a process > receives a spurious death signal, even though postmaster is still alive, > PostmasterIsAlive() will continue to use the slow path. +1 >

RE: How can we submit code patches that implement our (pending) patents?

2018-07-10 Thread Tsunakawa, Takayuki
From: Tom Lane [mailto:t...@sss.pgh.pa.us] > The core team has considered this matter, and has concluded that it's > time to establish a firm project policy that we will not accept any code > that is known to be patent-encumbered. The long-term legal risks and > complications involved in doing

Re: no partition pruning when partitioning using array type

2018-07-10 Thread Amit Langote
On 2018/07/11 4:48, Alvaro Herrera wrote: > On 2018-Jul-10, Alvaro Herrera wrote: > >> alvherre=# explain update p set a = a || a where a = '{1}'; >> QUERY PLAN >> ── >> Update on p

Re: _isnan() on Windows

2018-07-10 Thread Michael Paquier
On Tue, Jul 10, 2018 at 04:23:42PM -0400, Tom Lane wrote: > Alvaro Herrera writes: >> On 2018-Jul-10, Tom Lane wrote: >>> I disagree --- including in c.h, as this would have us do, >>> seems like a huge expansion of the visibility of that header. Moreover, >>> doing that only on Windows seems

RE: How can we submit code patches that implement our (pending) patents?

2018-07-10 Thread Tsunakawa, Takayuki
From: Dave Page [mailto:dp...@pgadmin.org] > SFLC have acted as the projects counsel in the past, so I'm not surprised > they aren't talking to you; you won't be a known contact to them as a PG > contributor, and as a Fujitsu employee there would likely be a conflict > of interest for them to talk

Re: Concurrency bug in UPDATE of partition-key

2018-07-10 Thread Alvaro Herrera
On 2018-Jul-09, Amit Kapila wrote: > Alvaro, > > Can you please comment whether this addresses your concern? I was thinking that it would be a matter of passing the tuple slot to EvalPlanQual for it to fill, rather than requiring it to fill some other slot obtained from who-knows-where, but I

Re: no partition pruning when partitioning using array type

2018-07-10 Thread Amit Langote
On 2018/07/11 3:18, Alvaro Herrera wrote: > On 2018-May-08, Amit Langote wrote: > >> In HEAD, since we already fixed that case in e5dcbb88a15d [1] which is a >> different piece of code anyway, the patch only serves to improve the >> deparse output emitted by ruleutils.c for partition constraint

Shared buffer access rule violations?

2018-07-10 Thread Asim R P
Hi, In order to make changes to a shared buffer, one must hold a pin on it and the content lock in exclusive mode. This rule seems to be followed in most of the places but there are a few exceptions. One can find several PageInit() calls with no content lock held. See, for example:

TRUNCATE tables referenced by FKs on partitioned tables

2018-07-10 Thread Alvaro Herrera
$subject is broken: create table prim (a int primary key); create table partfk (a int references prim) partition by range (a); create table partfk1 partition of partfk for values from (0) to (100); create table partfk2 partition of partfk for values from (100) to (200); You can't truncate prim

Re: shared-memory based stats collector

2018-07-10 Thread Andres Freund
On 2018-07-10 14:52:13 +0200, Tomas Vondra wrote: > There's one more reason why attempts to keep stats snapshots "perfectly" > consistent are likely doomed to fail - the messages are sent over UDP, which > does not guarantee delivery etc. So there's always some level of possible > inconsistency

Re: Non-reserved replication slots and slot advancing

2018-07-10 Thread Michael Paquier
On Tue, Jul 10, 2018 at 09:51:27AM -0400, Alvaro Herrera wrote: > On 2018-Jul-10, Michael Paquier wrote: > I say please push already. We can push more fixes later if they are > needed. OK, I have pushed what I have now, with all the suggestions from upthread included. -- Michael signature.asc

Re: possible issue with array type created for every heap relation composite type

2018-07-10 Thread Tom Lane
Jimmy Yih writes: > The possible issue I would like to note is related to how the array type is > named in makeArrayTypeName() function. The composite type will take the > heap relation's relname as its typname and the array type will usually be > named with an underscore prepended (after first

Re: CVE-2017-7484-induced bugs, or, btree cmp functions are not leakproof?

2018-07-10 Thread Alvaro Herrera
On 2018-Jul-10, Tom Lane wrote: > I propose to run through the system operator classes, find any for which > the comparison function isn't marked leakproof but the operators are, > and fix them. This is clearly appropriate for HEAD and maybe it's not > too late to force an initdb for v11 ---

possible issue with array type created for every heap relation composite type

2018-07-10 Thread Jimmy Yih
Hello, In Postgres 8.3, it was decided that an array type would be automatically created for every heap relation's composite type. Reference thread: https://www.postgresql.org/message-id/flat/20070302234016.GF3665%40fetter.org The possible issue I would like to note is related to how the array

CVE-2017-7484-induced bugs, or, btree cmp functions are not leakproof?

2018-07-10 Thread Tom Lane
I poked into the odd behavior reported in bug #15251: https://www.postgresql.org/message-id/152967245839.1266.6939666809369185...@wrigleys.postgresql.org The reason for the poor plan chosen when the caller hasn't got select privilege on the child table is that statistic_proc_security_check()

Re: Desirability of client-side expressions in psql?

2018-07-10 Thread Fabien COELHO
Hello Corey, psql> \if :i >= 5 I think we're ok with that so long as none of the operators or values has a \ in it. What barriers do you see to re-using the pgbench grammar? The pgbench expression grammar mimics SQL expression grammar, on integers, floats, booleans & NULL. I'm unsure

Re: Optimze usage of immutable functions as relation

2018-07-10 Thread Tom Lane
Heikki Linnakangas writes: > But stepping back a bit, it's a bit weird that we're handling this > differently from VALUES and other subqueries. The planner knows how to > do this trick for simple subqueries: > postgres=# explain select * from tenk1, (select abs(100)) as a (a) where > unique1

Re: Jsonb transform for pl/python

2018-07-10 Thread Tom Lane
Peter Eisentraut writes: > On 6/23/18 01:44, Nikita Glukhov wrote: >> We are simply trying first to convert numeric to int64 if is does not have >> digits after the decimal point, and then construct Python Int instead of >> Decimal. Standard Python json.loads() does the same for exact integers.

Re: Optimze usage of immutable functions as relation

2018-07-10 Thread Heikki Linnakangas
On 16/05/18 13:47, Aleksandr Parfenov wrote: Hello, I reworked a patch to make more stable in different cases. I decided to use simplify_function instead of eval_const_expression to prevent inlining of the function. The only possible outputs of the simplify_function are Const node and NULL.

Re: cost_sort() improvements

2018-07-10 Thread Tomas Vondra
On 06/28/2018 06:47 PM, Teodor Sigaev wrote: > Hi! > > ... > >  - cost for i-th columns: >    Ci * log2(NGi) => Ci * log2(N/G(i-1)) >    So, here I believe, that i-th comparison function will be called only > inside >    group which number is defined by (i-1) leading columns. Note, following >   

Problem with tupdesc in jsonb_to_recordset

2018-07-10 Thread Dmitry Dolgov
Hi, I've found out that currently in some situations jsonb_to_recordset can lead to a crash. Minimal example that I've managed to create looks like this: CREATE OR REPLACE FUNCTION test(data JSONB) RETURNS INTEGER AS $$ DECLARE test_var int; BEGIN WITH jsonb_values

Re: patch to allow disable of WAL recycling

2018-07-10 Thread Alvaro Herrera
On 2018-Jul-10, Jerry Jelinek wrote: > 2) Disabling WAL recycling reduces reliability, even on COW filesystems. I think the problem here is that WAL recycling in normal filesystems helps protect the case where filesystem gets full. If you remove it, that protection goes out the window. You can

Re: patch to allow disable of WAL recycling

2018-07-10 Thread Joshua D. Drake
On 07/10/2018 01:15 PM, Jerry Jelinek wrote: Thanks to everyone who took the time to look at the patch and send me feedback.  I'm happy to work on improving the documentation of this new tunable to clarify when it should be used and the implications. I'm trying to understand more specifically

Re: _isnan() on Windows

2018-07-10 Thread Tom Lane
Alvaro Herrera writes: > On 2018-Jul-10, Tom Lane wrote: >> I disagree --- including in c.h, as this would have us do, >> seems like a huge expansion of the visibility of that header. Moreover, >> doing that only on Windows seems certain to lead to missing-header >> problems in the reverse

Re: patch to allow disable of WAL recycling

2018-07-10 Thread Jerry Jelinek
Thanks to everyone who took the time to look at the patch and send me feedback. I'm happy to work on improving the documentation of this new tunable to clarify when it should be used and the implications. I'm trying to understand more specifically what else needs to be done next. To summarize, I

Re: GiST VACUUM

2018-07-10 Thread Heikki Linnakangas
I'm now looking at the first patch in this series, to allow completely empty GiST pages to be recycled. I've got some questions: --- a/src/backend/access/gist/gist.c +++ b/src/backend/access/gist/gist.c @@ -700,6 +700,13 @@ gistdoinsert(Relation r, IndexTuple itup, Size freespace, GISTSTATE

Re: _isnan() on Windows

2018-07-10 Thread Alvaro Herrera
On 2018-Jul-10, Tom Lane wrote: > Alvaro Herrera writes: > > Oh, it looks like commits 33a7101281c6, 8e211f539146, 86dbbf20d849 > > (probably others) papered over this by the expedient of adding #include > > to random .c files rather than your patch, which seems the > > proper fix. > > I

Re: _isnan() on Windows

2018-07-10 Thread Tom Lane
Alvaro Herrera writes: > On 2018-Jul-10, Emre Hasegeli wrote: >> isnan() function is evidently not present on on Windows >> before Visual Studio 2013. We define it on win32_port.h using >> _isnan(). However _isnan() is also not present. It is on . >> The patch is attached to include this from

Re: no partition pruning when partitioning using array type

2018-07-10 Thread Alvaro Herrera
On 2018-Jul-09, Tom Lane wrote: > Alvaro Herrera writes: > > However, if we take out the > > expression_planner() and replace it with a call to > > strip_implicit_coercions(), not only it magically starts working, but > > also the regression tests start failing with the attached diff, which > >

Re: no partition pruning when partitioning using array type

2018-07-10 Thread Alvaro Herrera
On 2018-Jul-10, Tom Lane wrote: > And what about those partition bound values? They are now illegal > for the domain, so I would expect a dump/reload to fail, regardless > of whether there are any values in the table. Hmm, true. -- Álvaro Herrerahttps://www.2ndQuadrant.com/

Re: no partition pruning when partitioning using array type

2018-07-10 Thread Alvaro Herrera
On 2018-Jul-10, Alvaro Herrera wrote: > alvherre=# explain update p set a = a || a where a = '{1}'; > QUERY PLAN > ── > Update on p (cost=0.00..54.03 rows=14 width=38) >Update on p1 >

Re: Failure assertion in GROUPS mode of window function in current HEAD

2018-07-10 Thread Tom Lane
Masahiko Sawada writes: > BTW, I found an another but related issue. We can got an assertion > failure also by the following query. > =# select sum(c) over (partition by c order by c groups between 1 > preceding and current row) from test; Oh, good point, that's certainly legal per spec, so

Re: Allow COPY's 'text' format to output a header

2018-07-10 Thread Simon Muller
On 4 July 2018 at 22:44, Simon Muller wrote: > I noticed through the patch tester link at http://commitfest.cputube.org/ > that my patch caused a file_fdw test to fail (since I previously tested > only with "make check" and not with "make check-world"). > > This v2 patch should fix that. > This

Re: user-friendliness improvement of pageinspect

2018-07-10 Thread Peter Geoghegan
On Tue, Jul 10, 2018 at 12:41 AM, 杨杰 wrote: > Why does the heap_page_item () of the pageinspect extension not consider > providing better user-friendliness? > > My test table has the following data, and when I look at the t_data I see > data of type bytea instead of a more intuitive type, even

Re: Desirability of client-side expressions in psql?

2018-07-10 Thread Corey Huinker
> > >psql> \if :i >= 5 > > I think we're ok with that so long as none of the operators or values has a \ in it. What barriers do you see to re-using the pgbench grammar?

Re: New GUC to sample log queries

2018-07-10 Thread Adrien Nayrat
On 06/27/2018 11:13 PM, Adrien Nayrat wrote: >> 3) Is it intentional to only sample with log_min_duration_statement and >> not also with log_duration? It seems like it should affect both. In >> both cases, the name is too generic. Something called "log_sample_rate" >> should sample

Re: no partition pruning when partitioning using array type

2018-07-10 Thread Tom Lane
Alvaro Herrera writes: > On 2018-Jul-09, Tom Lane wrote: >> Suppose you did >> >> create domain overint as int; >> create table pt (a overint) partition by range (a); >> create table pt1 partition of pt for values from (0) to (100); >> >> and the system took it, and then you did >> >> alter

Re: no partition pruning when partitioning using array type

2018-07-10 Thread Alvaro Herrera
On 2018-May-08, Amit Langote wrote: > In HEAD, since we already fixed that case in e5dcbb88a15d [1] which is a > different piece of code anyway, the patch only serves to improve the > deparse output emitted by ruleutils.c for partition constraint expressions > where pseudo-type partition key is

Re: no partition pruning when partitioning using array type

2018-07-10 Thread Alvaro Herrera
On 2018-Jul-09, Tom Lane wrote: > Suppose you did > > create domain overint as int; > create table pt (a overint) partition by range (a); > create table pt1 partition of pt for values from (0) to (100); > > and the system took it, and then you did > > alter domain overint add check (value >

Re: _isnan() on Windows

2018-07-10 Thread Alvaro Herrera
On 2018-Jul-10, Emre Hasegeli wrote: > isnan() function is evidently not present on on Windows > before Visual Studio 2013. We define it on win32_port.h using > _isnan(). However _isnan() is also not present. It is on . > The patch is attached to include this from win32_port.h. > > Thanks to

_isnan() on Windows

2018-07-10 Thread Emre Hasegeli
isnan() function is evidently not present on on Windows before Visual Studio 2013. We define it on win32_port.h using _isnan(). However _isnan() is also not present. It is on . The patch is attached to include this from win32_port.h. Thanks to Thomas Munro for point this out to me [1]. It is

Re: [HACKERS] plpgsql - additional extra checks

2018-07-10 Thread Pavel Stehule
2018-07-09 21:44 GMT+02:00 Alvaro Herrera : > > + ereport(errlevel, > > (errcode(ERRCODE_TOO_MANY_ > ROWS), > >errmsg("query returned > more than one row"), > > -

Re: [HACKERS] [PATCH] kNN for SP-GiST

2018-07-10 Thread Andrey Borodin
Hi! > I'm reviewing this patch. Currently I'm trying to understand sp-gist scan > deeeper, but as for now have some small notices. I've passed through the code one more time. Here are few more questions: 1. Logic behind division of the patch into steps is described last time 2017-01-30, but

Re: Let's remove DSM_IMPL_NONE.

2018-07-10 Thread Peter Eisentraut
committed On 10.07.18 08:49, Kyotaro HORIGUCHI wrote: > Thank you for the notice. > > At Mon, 9 Jul 2018 12:30:22 +0300, Arthur Zakirov > wrote in <20180709093021.GA9309@zakirov.localdomain> >> Hello, >> >> On Mon, Jul 09, 2018 at 06:07:24PM +0900, Kyotaro HORIGUCHI wrote: >>> The new version

Re: [PG-11] Potential bug related to INCLUDE clause of CREATE INDEX

2018-07-10 Thread Andrey Borodin
Hi! > 10 июля 2018 г., в 17:54, Tom Lane написал(а): > > Aditya Toshniwal writes: >> I am working on a feature to support INCLUDE clause of index in PG-11. As >> per the documentation https://www.postgresql.org/docs/11/static/ >> sql-createindex.html, columns listed in INCLUDE clause cannot

Re: [HACKERS] PoC: full merge join on comparison clause

2018-07-10 Thread Alexander Kuzmenkov
I tried to fix the things you mentioned and improve the comments. Among other changes, there is now a description of how merge join works with inequalities at the top of nodeMergejoin.c. It also explains why we only support one inequality clause. Some particular points: On 07/06/2018 04:01

Re: [PG-11] Potential bug related to INCLUDE clause of CREATE INDEX

2018-07-10 Thread Dilip Kumar
On Tue, Jul 10, 2018 at 6:37 PM, Aditya Toshniwal wrote: > Hi Dave, > > I am working on a feature to support INCLUDE clause of index in PG-11. As > per the documentation > https://www.postgresql.org/docs/11/static/sql-createindex.html, columns > listed in INCLUDE clause cannot also be present as

Re: [HACKERS] WAL logging problem in 9.4.3?

2018-07-10 Thread Heikki Linnakangas
Thanks for picking this up! (I hope this gets through the email filters this time, sending a shell script seems to be difficult. I also trimmed the CC list, if that helps.) On 04/07/18 07:59, Michael Paquier wrote: Hence I propose the patch attached which disables the TRUNCATE and COPY

Re: [PG-11] Potential bug related to INCLUDE clause of CREATE INDEX

2018-07-10 Thread Tom Lane
Aditya Toshniwal writes: > I am working on a feature to support INCLUDE clause of index in PG-11. As > per the documentation https://www.postgresql.org/docs/11/static/ > sql-createindex.html, columns listed in INCLUDE clause cannot also be > present as index key columns. But I find different

Re: [HACKERS] PoC: full merge join on comparison clause

2018-07-10 Thread Ashutosh Bapat
On Tue, Jul 10, 2018 at 12:05 AM, Alexander Kuzmenkov wrote: > On 07/09/2018 04:12 PM, Ashutosh Bapat wrote: >> >> On Fri, Jul 6, 2018 at 6:31 PM, Ashutosh Bapat >> wrote: >>> >>> I will continue reviewing the patches. >>> >> Here are some more review comments > > > > Ashutosh, > > Many thanks

Re: BUG #15212: Default values in partition tables don't work as expected and allow NOT NULL violation

2018-07-10 Thread Ashutosh Bapat
I didn't see any hackers thread linked to this CF entry. Hence sending this mail through CF app. The patch looks good to me. It applies cleanly, compiles cleanly and make check passes. I think you could avoid condition + /* Do not override parent's NOT NULL constraint. */

Re: Non-reserved replication slots and slot advancing

2018-07-10 Thread Alvaro Herrera
On 2018-Jul-10, Michael Paquier wrote: > Yep, let's change that as well. If you want to look at that stuff more > deeply, please feel free. Otherwise I could always push what I have > now. I say please push already. We can push more fixes later if they are needed. -- Álvaro Herrera

Re: How can we submit code patches that implement our (pending) patents?

2018-07-10 Thread Tom Lane
"Tsunakawa, Takayuki" writes: > From: Nico Williams [mailto:n...@cryptonector.com] >> ... But that might reduce the >> size of the community, or lead to a fork. > Yes, that's one unfortunate future, which I don't want to happen of > course. I believe PostgreSQL should accept patent for further

Re: Locking B-tree leafs immediately in exclusive mode

2018-07-10 Thread 今井 良一
On 2018/07/10 20:36, Alexander Korotkov wrote: > On Tue, Jul 10, 2018 at 2:19 PM Imai, Yoshikazu > wrote: >> On Mon, July 9, 2018 at 4:44 PM, Alexander Korotkov wrote: Firstly, I did performance tests on 72-cores machines(AWS c5.18xlarge) same as you did. >>> >>> OK. But not that

Re: Retrieve memory size allocated by libpq

2018-07-10 Thread Lars Kanis
Attached is an updated patch of PQresultMemsize(). The implementation is unchanged, but I added SGML documentation about this new function. I'd be pleased about comments to adding this to libpq. -- Kind Regards, Lars From 766a7f2381ae6c9d442a7359cabc58515186f8c4 Mon Sep 17 00:00:00 2001 From:

Re: [PATCH] Add support for ON UPDATE/DELETE actions on ALTER CONSTRAINT

2018-07-10 Thread Ashutosh Bapat
On Wed, Mar 7, 2018 at 11:49 PM, Matheus de Oliveira wrote: > > > Em 3 de mar de 2018 19:32, "Peter Eisentraut" > escreveu: > > On 2/20/18 10:10, Matheus de Oliveira wrote: >> Besides that, there is a another change in this patch on current ALTER >> CONSTRAINT about deferrability options.

Re: Test for trigger condition accessing system attributes

2018-07-10 Thread Heikki Linnakangas
On 10/05/18 11:58, Ashutosh Bapat wrote: Hi, I was investigating the cases when the system attributes are accessed beyond the scans. After investigating set_plan_references(), I thought that we never access system attributes beyond scans. This lead me to assume that EEOP_INNER/OUTER_SYSVAR are

Re: [PG-11] Potential bug related to INCLUDE clause of CREATE INDEX

2018-07-10 Thread Aditya Toshniwal
Hi Team, Please ignore the name after "Hi" in the previous mail. :/ The potential bug is a mentioned in the mail. On Tue, Jul 10, 2018 at 6:37 PM, Aditya Toshniwal < aditya.toshni...@enterprisedb.com> wrote: > Hi Dave, > > I am working on a feature to support INCLUDE clause of index in PG-11.

[PG-11] Potential bug related to INCLUDE clause of CREATE INDEX

2018-07-10 Thread Aditya Toshniwal
Hi Dave, I am working on a feature to support INCLUDE clause of index in PG-11. As per the documentation https://www.postgresql.org/docs/11/static/ sql-createindex.html, columns listed in INCLUDE clause cannot also be present as index key columns. But I find different behaviour for below queries

Re: shared-memory based stats collector

2018-07-10 Thread Tomas Vondra
On 07/10/2018 02:07 PM, Kyotaro HORIGUCHI wrote: Hello. Thanks for the opinions. At Fri, 6 Jul 2018 13:10:36 -0700, Andres Freund wrote in <20180706201036.awheoi6tk556x...@alap3.anarazel.de> Hi, On 2018-07-06 22:03:12 +0200, Magnus Hagander wrote: *If* we can provide the snapshots view of

Re: EXPLAIN of Parallel Append

2018-07-10 Thread Amit Kapila
On Mon, Jul 9, 2018 at 7:00 PM, Jesper Pedersen wrote: > On 07/07/2018 01:08 AM, Amit Kapila wrote: >> >> On Wed, Mar 14, 2018 at 8:58 PM, Jesper Pedersen >>> >>> Parallel Append's ntuples is 1, but given nloops is 3 you end up with the >>> slightly confusing "(actual ... *rows=0* loops=3)". >>>

Re: shared-memory based stats collector

2018-07-10 Thread Kyotaro HORIGUCHI
Hello. Thanks for the opinions. At Fri, 6 Jul 2018 13:10:36 -0700, Andres Freund wrote in <20180706201036.awheoi6tk556x...@alap3.anarazel.de> > Hi, > > On 2018-07-06 22:03:12 +0200, Magnus Hagander wrote: > > *If* we can provide the snapshots view of them without too much overhead I > > think

Re: Excessive PostmasterIsAlive calls slow down WAL redo

2018-07-10 Thread Heikki Linnakangas
On 27/06/18 08:26, Thomas Munro wrote: On Wed, Apr 25, 2018 at 6:23 PM, Thomas Munro wrote: On Tue, Apr 24, 2018 at 7:37 PM, Michael Paquier wrote: Thomas, trying to understand here... Why this place for the signal initialization? Wouldn't InitPostmasterChild() be a more logical place as

Re: Locking B-tree leafs immediately in exclusive mode

2018-07-10 Thread Alexander Korotkov
On Tue, Jul 10, 2018 at 2:19 PM Imai, Yoshikazu wrote: > On Mon, July 9, 2018 at 4:44 PM, Alexander Korotkov wrote: > > > Firstly, I did performance tests on 72-cores machines(AWS c5.18xlarge) > > > same as you did. > > > > OK. But not that c5.18xlarge is 72-VCPU machine, which AFAIK is > >

Re: Locking B-tree leafs immediately in exclusive mode

2018-07-10 Thread Alexander Korotkov
On Mon, Jul 9, 2018 at 8:18 PM Peter Geoghegan wrote: > On Mon, Jul 9, 2018 at 9:43 AM, Alexander Korotkov > wrote: > > In this case it also looks like we observed 1% regression. Despite 1% > > may seem to be very small, I think we should clarify whether it really > > exists. I have at least

RE: Locking B-tree leafs immediately in exclusive mode

2018-07-10 Thread Imai, Yoshikazu
On Mon, July 9, 2018 at 4:44 PM, Alexander Korotkov wrote: > > Firstly, I did performance tests on 72-cores machines(AWS c5.18xlarge) same > > as you did. > > OK. But not that c5.18xlarge is 72-VCPU machine, which AFAIK is > close to the performance of 36 physical cores. Thanks for pointing

Re: Expression errors with "FOR UPDATE" and postgres_fdw with partition wise join enabled.

2018-07-10 Thread Ashutosh Bapat
On Tue, Jul 10, 2018 at 9:08 AM, Etsuro Fujita wrote: > (2018/07/09 20:43), Ashutosh Bapat wrote: >>> >>> >>> I don't have any numbers right now, so that is nothing but a concern. But >>> as >>> I said in a previous email, in the approach I proposed, we don't need to >>> spend extra cycles where

Re: Costing bug in hash join logic for semi joins

2018-07-10 Thread David Rowley
On 10 July 2018 at 11:44, RK wrote: > There is a costing bug in hash join logic seems to have been introduced by > the patch related to inner_unique enhancements(commit: > 9c7f5229ad68d7e0e4dd149e3f80257893e404d4). Specifically, "hashjointuples" > which tracks the number of matches for hash

Re: [HACKERS] PoC plpgsql - possibility to force custom or generic plan

2018-07-10 Thread Peter Eisentraut
On 23.01.18 17:08, Pavel Stehule wrote: > attached updated patch This appears to be the patch of record in this thread. I think there is general desire for adding a setting like this, and the implementation is simple enough. One change perhaps: How about naming the default setting "auto"

user-friendliness improvement of pageinspect

2018-07-10 Thread 杨杰
Hi, Why does the heap_page_item () of the pageinspect extension not consider providing better user-friendliness? My test table has the following data, and when I look at the t_data I see data of type bytea instead of a more intuitive type, even the same type as the original table. #

Costing bug in hash join logic for semi joins

2018-07-10 Thread RK
There is a costing bug in hash join logic seems to have been introduced by the patch related to inner_unique enhancements(commit: 9c7f5229ad68d7e0e4dd149e3f80257893e404d4). Specifically, "hashjointuples" which tracks the number of matches for hash clauses is computed wrong for inner unique

Re: [PATCH] Timestamp for a XLOG_BACKUP_END WAL-record

2018-07-10 Thread Andrey V. Lepikhov
On 10.07.2018 06:45, Andres Freund wrote: Hi, On 2018-07-10 06:41:32 +0500, Andrey V. Lepikhov wrote: This functionality is needed in practice when we have to determine a recovery time of specific backup. What do you mean by "recovery time of specific backup"? recovery time - is a time

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

2018-07-10 Thread Peter Eisentraut
On 09.07.18 15:49, Heikki Linnakangas wrote: > The way > forward is to test if we can get the same performance benefit from > switching to CMPXCHG16B, and keep the WAL format unchanged. I have implemented this. I didn't see any performance benefit using the benchmark that Alexander Kuzmenkov

Re: [PATCH] Improve geometric types

2018-07-10 Thread Emre Hasegeli
> The version number restriction isn't strictly needed. I only > suggested it because it'd match the #if that wraps the code that's > actually using those macros, introduced by commit cec8394b5ccd. That > was presumably done because versions >= 1800 (= Visual Studio 2013) > have their own

Re: Recovery performance of standby for multiple concurrent truncates on large tables

2018-07-10 Thread Ants Aasma
On Tue, Jul 10, 2018 at 10:05 AM Jamison, Kirk wrote: > Since in the current implementation, the replay of each TRUNCATE/DROP > TABLE scans the whole shared buffer. > > One approach (though idea is not really developed yet) is to improve the > recovery by delaying the shared buffer scan and

Re: How can we submit code patches that implement our (pending) patents?

2018-07-10 Thread Dave Page
Hi On Tue, Jul 10, 2018 at 9:29 AM, Tsunakawa, Takayuki < tsunakawa.ta...@jp.fujitsu.com> wrote: > From: Markus Wanner [mailto:markus.wan...@2ndquadrant.com] > > equally sure there are well intended ones as well. For example, I'd > > expect patent pools (including the Open Invention Network,

RE: How can we submit code patches that implement our (pending) patents?

2018-07-10 Thread Tsunakawa, Takayuki
From: Markus Wanner [mailto:markus.wan...@2ndquadrant.com] > equally sure there are well intended ones as well. For example, I'd > expect patent pools (including the Open Invention Network, cited by the > OP) to hire non-IANAL personnel who know Legalese well enough to setup > valid contracts

Re: Non-reserved replication slots and slot advancing

2018-07-10 Thread Michael Paquier
On Tue, Jul 10, 2018 at 01:16:30AM -0700, Andres Freund wrote: > On 2018-07-10 16:59:07 +0900, Michael Paquier wrote: > > if (moveto < minlsn) > > - { > > - ReplicationSlotRelease(); > > ereport(ERROR, > >

Re: [Tiny Debug Issue] Undefined Reference problem encountered during compile

2018-07-10 Thread Michael Paquier
On Tue, Jul 10, 2018 at 05:19:25PM +0900, 이재훈 wrote: > I want to use TransactionIdEquals() function in freelist.c file. > Then, I included a header file, "access/xact.h" for the function. This is in access/transam.h. -- Michael signature.asc Description: PGP signature

Re: [Tiny Debug Issue] Undefined Reference problem encountered during compile

2018-07-10 Thread Julien Rouhaud
Hi, On Tue, Jul 10, 2018 at 10:19 AM, 이재훈 wrote: > > I want to use TransactionIdEquals() function in freelist.c file. > Then, I included a header file, "access/xact.h" for the function. > > However, in make command, compiler send implicit declaration of function > warning and then undefined

RE: How can we submit code patches that implement our (pending) patents?

2018-07-10 Thread Tsunakawa, Takayuki
From: Nico Williams [mailto:n...@cryptonector.com] > On Sat, Jul 07, 2018 at 10:20:35AM -0700, Andres Freund wrote: > > It's entirely possible to dual license contributions and everything. Why > > are you making such aggressive statements about a, so far, apparently > > good faith engagement? > >

[Tiny Debug Issue] Undefined Reference problem encountered during compile

2018-07-10 Thread 이재훈
First of all, thank you for listening to this mail. As I mentioned in the title, I got a undefined reference in compiling time. The reason that I wonder is that I surely add header file for the function. In more detail, I want to use TransactionIdEquals() function in freelist.c file. Then, I

  1   2   >