Re: [HACKERS] create_unique_path and GEQO

2017-03-24 Thread Rushabh Lathia
On Wed, Mar 22, 2017 at 3:43 PM, Ashutosh Bapat < ashutosh.ba...@enterprisedb.com> wrote: > Hi, > In create_unique_path() there's comment > /* > * We must ensure path struct and subsidiary data are allocated in main > * planning context; otherwise GEQO memory management causes

Re: [HACKERS] BUG: pg_dump generates corrupted gzip file in Windows

2017-03-24 Thread Craig Ringer
On 24 March 2017 at 14:07, Kuntal Ghosh wrote: > On Fri, Mar 24, 2017 at 11:28 AM, Kuntal Ghosh > wrote: >> Hello, >> In Windows, if one needs to take a dump in plain text format (this is >> the default option, or can be specified using

Re: [HACKERS] [Proposal] Make the optimiser aware of partitions ordering

2017-03-24 Thread Ashutosh Bapat
On Mon, Mar 20, 2017 at 8:33 PM, Ronan Dunklau wrote: > On lundi 20 mars 2017 15:52:03 CET Robert Haas wrote: >> On Mon, Mar 20, 2017 at 6:31 AM, Ronan Dunklau > wrote: >> > With range partitioning, we guarantee that each partition contains

Re: [HACKERS] segfault in hot standby for hash indexes

2017-03-24 Thread Amit Kapila
On Fri, Mar 24, 2017 at 12:25 PM, Ashutosh Sharma wrote: >> >> I think it would have been probably okay to use *int* for ntuples as >> that matches with what you are actually assigning in the function. > > okay, corrected it. Attached is newer version of patch. > Thanks,

Re: [HACKERS] pageinspect and hash indexes

2017-03-24 Thread Amit Kapila
On Fri, Mar 24, 2017 at 9:50 AM, Ashutosh Sharma wrote: > On Fri, Mar 24, 2017 at 9:46 AM, Ashutosh Sharma > wrote: >> >> Thanks for reviewing my patch. I have removed the extra white space. >> Attached are both the patches. > > Sorry, I have

Re: [HACKERS] Parallel Append implementation

2017-03-24 Thread Amit Khandekar
On 24 March 2017 at 13:11, Rajkumar Raghuwanshi wrote: > I have given patch on latest pg sources (on commit > 457a4448732881b5008f7a3bcca76fc299075ac3). configure and make all > install ran successfully, but initdb failed with below error. >

Re: [HACKERS] Partition-wise join for join between (declaratively) partitioned tables

2017-03-24 Thread Amit Langote
Hi Ashutosh, On 2017/03/23 21:48, Ashutosh Bapat wrote: >>> I have fixed all the issues reported till now. In patch 0007, the following code in have_partkey_equi_join() looks potentially unsafe: /* * If the clause refers to different partition keys from * both

Re: [HACKERS] Logical replication existing data copy

2017-03-24 Thread Michael Banck
Hi, On Fri, Mar 24, 2017 at 12:32:28AM +0100, Petr Jelinek wrote: > Yes, I also forgot to check if the table actually exists on subscriber > when fetching them in CREATE SUBSCRIPTION (we have check during > replication but not there). > > Attached patches should fix both issues. I no longer get

Re: [pgsql-www] [HACKERS] Small issue in online devel documentation build

2017-03-24 Thread Fabien COELHO
Hello Peter, I think the fix belongs into the web site CSS, so there is nothing to commit into PostgreSQL here. Indeed, the changes were only for the "remove nesting" solution. I will close the commit fest entry, but I have added a section to the open items list so we keep track of it.

Re: [HACKERS] [PATCH] Transaction traceability - txid_status(bigint)

2017-03-24 Thread Craig Ringer
On 24 March 2017 at 02:29, Robert Haas wrote: > On Tue, Mar 21, 2017 at 11:35 PM, Craig Ringer wrote: >> Changes made per discussion. > > Committed 0001. Much appreciated. Here's the 2nd patch rebased on top of master, with the TAP test included

Re: [HACKERS] identity columns

2017-03-24 Thread Vitaly Burovoy
On 3/23/17, Peter Eisentraut wrote: > On 3/23/17 06:09, Vitaly Burovoy wrote: >> I think we'll end up with "DROP IDENTITY IF EXISTS" to avoid raising >> an exception and "ADD OR SET" if your grammar remains. > > That sounds reasonable to me. It would be great if

Re: [HACKERS] [POC] A better way to expand hash indexes.

2017-03-24 Thread Mithun Cy
On Fri, Mar 24, 2017 at 1:22 AM, Mithun Cy wrote: > Hi Amit please find the new patch The pageinspect.sgml has an example which shows the output of "hash_metapage_info()". Since we increase the spares array and eventually ovflpoint, I have updated the example with

Re: [HACKERS] ANALYZE command progress checker

2017-03-24 Thread vinayak
On 2017/03/23 15:04, Haribabu Kommi wrote: On Wed, Mar 22, 2017 at 8:11 PM, vinayak > wrote: On 2017/03/21 21:25, Haribabu Kommi wrote: On Tue, Mar 21, 2017 at 3:41 PM, vinayak

Re: [HACKERS] Logical decoding on standby

2017-03-24 Thread Craig Ringer
On 23 March 2017 at 17:44, Craig Ringer wrote: Minor update to catalog_xmin walsender patch to fix failure to parenthesize definition of PROCARRAY_PROC_FLAGS_MASK . This one's ready to go. Working on drop slots on DB drop now. -- Craig Ringer

Re: [HACKERS] segfault in hot standby for hash indexes

2017-03-24 Thread Ashutosh Sharma
>>> > I think this will work, but not sure if there is a merit to deviate >>> > from what btree does to handle this case. One thing I find slightly >>> > awkward in hash_xlog_vacuum_get_latestRemovedXid() is that you are >>> > using a number of tuples registered as part of fixed data >>> >

Re: [HACKERS] BUG: pg_dump generates corrupted gzip file in Windows

2017-03-24 Thread Kuntal Ghosh
On Fri, Mar 24, 2017 at 12:35 PM, Craig Ringer wrote: > On 24 March 2017 at 14:07, Kuntal Ghosh wrote: >> On Fri, Mar 24, 2017 at 11:28 AM, Kuntal Ghosh >> wrote: >>> Hello, >>> In Windows, if one needs to take a

Re: [HACKERS] BUG: pg_dump generates corrupted gzip file in Windows

2017-03-24 Thread Kuntal Ghosh
On Fri, Mar 24, 2017 at 11:28 AM, Kuntal Ghosh wrote: > Hello, > In Windows, if one needs to take a dump in plain text format (this is > the default option, or can be specified using -Fp) with some level of > compression (-Z[0-9]), an output file has to > be specified.

Re: [HACKERS] create_unique_path and GEQO

2017-03-24 Thread Ashutosh Bapat
On Fri, Mar 24, 2017 at 11:52 AM, Rushabh Lathia wrote: > > > On Wed, Mar 22, 2017 at 3:43 PM, Ashutosh Bapat > wrote: >> >> Hi, >> In create_unique_path() there's comment >> /* >> * We must ensure path struct and subsidiary

Re: [HACKERS] error handling in RegisterBackgroundWorker

2017-03-24 Thread Michael Paquier
On Fri, Mar 24, 2017 at 1:20 PM, Peter Eisentraut wrote: > On 2/15/17 12:11, Robert Haas wrote: >> On Wed, Feb 15, 2017 at 11:30 AM, Peter Eisentraut >> wrote: >>> If RegisterBackgroundWorker() (the non-dynamic kind that is only

Re: [HACKERS] Parallel Append implementation

2017-03-24 Thread Rajkumar Raghuwanshi
On Fri, Mar 24, 2017 at 12:38 AM, Amit Khandekar wrote: > Meanwhile, attached is a WIP patch v10. The only change in this patch > w.r.t. the last patch (v9) is that this one has a new function defined > append_nonpartial_cost(). Just sending this to show how the algorithm

Re: [HACKERS] Logical replication existing data copy

2017-03-24 Thread Mark Kirkwood
On 24/03/17 12:32, Petr Jelinek wrote: On 24/03/17 00:14, Mark Kirkwood wrote: On 24/03/17 02:00, Peter Eisentraut wrote: On 3/21/17 21:38, Peter Eisentraut wrote: This patch is looking pretty good to me, modulo the failing pg_dump tests. Attached is a fixup patch. I have mainly updated

Re: [HACKERS] Adding support for Default partition in partitioning

2017-03-24 Thread Rahila Syed
Hello Rushabh, Thank you for reviewing. Have addressed all your comments in the attached patch. The attached patch currently throws an error if a new partition is added after default partition. >Rather then adding check for default here, I think this should be handle inside >get_qual_for_list().

Re: [HACKERS] Patch: Write Amplification Reduction Method (WARM)

2017-03-24 Thread Amit Kapila
On Fri, Mar 24, 2017 at 12:25 AM, Pavan Deolasee wrote: > > > On Thu, Mar 23, 2017 at 7:53 PM, Amit Kapila > wrote: >> >> > >> >> I am not sure on what basis user can set such parameters, it will be >> quite difficult to tune those parameters.

Re: [HACKERS] Re: [COMMITTERS] pgsql: Fix and simplify check for whether we're running as Windows serv

2017-03-24 Thread Heikki Linnakangas
On 03/22/2017 07:44 PM, Robert Haas wrote: On Wed, Mar 22, 2017 at 10:13 AM, Alvaro Herrera wrote: Heikki Linnakangas wrote: I did some archeology, and found CheckTokenMembership() in MinGW's w32api packages version 3.14

Re: [HACKERS] BUG: pg_dump generates corrupted gzip file in Windows

2017-03-24 Thread Kuntal Ghosh
On Fri, Mar 24, 2017 at 2:17 PM, Kuntal Ghosh wrote: > On Fri, Mar 24, 2017 at 12:35 PM, Craig Ringer wrote: >> On 24 March 2017 at 14:07, Kuntal Ghosh wrote: >>> On Fri, Mar 24, 2017 at 11:28 AM, Kuntal Ghosh >>>

Re: [HACKERS] increasing the default WAL segment size

2017-03-24 Thread Stephen Frost
Peter, * Peter Eisentraut (peter.eisentr...@2ndquadrant.com) wrote: > There is a function for that. [...] > There is not a function for that, but there could be one. I'm not sure you've really considered what you're suggesting here. We need to to make sure we have every file between two LSNs.

Re: [HACKERS] Re: Declarative partitioning optimization for large amount of partitions

2017-03-24 Thread Aleksander Alekseev
Hi Anastasia, Thanks a lot for a review! As was mentioned above there is also a bottleneck in find_all_inheritors procedure. Turned out the problem there is similar and it could be easily fixed as well. Corresponding patch is attached to this message. To keep things in order I'm attaching the

Re: [HACKERS] increasing the default WAL segment size

2017-03-24 Thread David Steele
On 3/24/17 12:27 AM, Peter Eisentraut wrote: On 3/23/17 16:58, Stephen Frost wrote: The backup tools need to also get the LSN from the pg_stop_backup and verify that they have the WAL file associated with that LSN. There is a function for that. They also need to make sure that they have all

Re: [HACKERS] Logical replication existing data copy

2017-03-24 Thread Petr Jelinek
On 24/03/17 11:23, Erik Rijkers wrote: > On 2017-03-24 10:45, Mark Kirkwood wrote: >> >> However one minor observation - as Michael Banck noted - the elapsed >> time for slave to catch up after running: >> >> $ pgbench -c8 -T600 bench >> >> on the master was (subjectively) much longer than for

Re: [HACKERS] Monitoring roles patch

2017-03-24 Thread Stephen Frost
Peter, * Peter Eisentraut (peter.eisentr...@2ndquadrant.com) wrote: > On 3/22/17 09:17, Stephen Frost wrote: > >> If we do it via GRANTs instead, then users can easily extend it. > > The intent here is that users will *also* be able to do it via GRANTs if > > they wish to. > > But why not do it

Re: [HACKERS] Logical replication existing data copy

2017-03-24 Thread Erik Rijkers
On 2017-03-24 10:45, Mark Kirkwood wrote: However one minor observation - as Michael Banck noted - the elapsed time for slave to catch up after running: $ pgbench -c8 -T600 bench on the master was (subjectively) much longer than for physical streaming replication. Is this expected? I think

Re: [HACKERS] Backend crash on non-exclusive backup cancel

2017-03-24 Thread Teodor Sigaev
Thank you all, pushed Michael Paquier wrote: On Fri, Mar 24, 2017 at 1:45 AM, Teodor Sigaev wrote: I believe patch looks good and it's ready to commit. Thanks for the review! As I understand, it fixes bug introduced by commit 7117685461af50f50c03f43e6a622284c8d54694

Re: [HACKERS] Patch: Write Amplification Reduction Method (WARM)

2017-03-24 Thread Pavan Deolasee
On Fri, Mar 24, 2017 at 4:04 PM, Amit Kapila wrote: > On Fri, Mar 24, 2017 at 12:25 AM, Pavan Deolasee > wrote: > > > > > > On Thu, Mar 23, 2017 at 7:53 PM, Amit Kapila > > > > The general sense I've got > > here is

[HACKERS] [psql] patch to fix ordering in words_after_create array

2017-03-24 Thread Rushabh Lathia
Hi All, While looking at the code around tab-complete.c, I found the ordering in words_after_create array is not correct for DEFAULT PRIVILEGES, which been added under below commit: commit d7d77f3825122bde55be9e06f6c4851028b99795 Author: Peter Eisentraut Date: Thu Mar 16

[HACKERS] Re: [COMMITTERS] pgsql: Fix and simplify check for whether we're running as Windows serv

2017-03-24 Thread Dave Page
On Friday, March 24, 2017, Heikki Linnakangas wrote: > On 03/22/2017 07:44 PM, Robert Haas wrote: > >> On Wed, Mar 22, 2017 at 10:13 AM, Alvaro Herrera >> wrote: >> >>> Heikki Linnakangas wrote: >>> I did some archeology, and found

Re: [HACKERS] WIP: Covering + unique indexes.

2017-03-24 Thread Aleksander Alekseev
The following review has been posted through the commitfest application: make installcheck-world: tested, passed Implements feature: tested, passed Spec compliant: tested, passed Documentation:tested, passed This patch looks good to me. As I understand we have both a

Re: [HACKERS] scram and \password

2017-03-24 Thread Heikki Linnakangas
On 03/24/2017 03:02 PM, Michael Paquier wrote: In order to close this thread, I propose to reuse the patches I sent here to make scram_build_verifier() available to frontends: https://www.postgresql.org/message-id/CAB7nPqT4yc3u8wspYkWbG088Ndp6asMH3=zb___ck89ctvz...@mail.gmail.com And on top of

Re: [HACKERS] increasing the default WAL segment size

2017-03-24 Thread David Steele
On 3/23/17 4:45 PM, Peter Eisentraut wrote: On 3/22/17 17:33, David Steele wrote: I think if we don't change the default size it's very unlikely I would use alternate WAL segment sizes or recommend that anyone else does, at least in v10. I simply don't think it would get the level of testing

Re: [HACKERS] Logical replication existing data copy

2017-03-24 Thread Peter Eisentraut
On 3/23/17 19:32, Petr Jelinek wrote: > Yes, I also forgot to check if the table actually exists on subscriber > when fetching them in CREATE SUBSCRIPTION (we have check during > replication but not there). I think for this we can probably just change the missing_ok argument of RangeVarGetRelid()

Re: [HACKERS] Logical replication existing data copy

2017-03-24 Thread Petr Jelinek
On 24/03/17 15:05, Peter Eisentraut wrote: > On 3/23/17 19:32, Petr Jelinek wrote: >> Yes, I also forgot to check if the table actually exists on subscriber >> when fetching them in CREATE SUBSCRIPTION (we have check during >> replication but not there). > > I think for this we can probably just

Re: [HACKERS] Enabling parallelism for queries coming from SQL or other PL functions

2017-03-24 Thread Rafia Sabih
On Thu, Mar 23, 2017 at 11:26 PM, Robert Haas wrote: > > The changes to the plpgsql code don't look so good to me. The change > to exec_stmt_return_query fixes the same bug that I mentioned in the > email linked above, but only half of it -- it corrects the RETURN > QUERY

Re: [HACKERS] Partition-wise join for join between (declaratively) partitioned tables

2017-03-24 Thread Amit Langote
Hi Ashutosh, On 2017/03/23 21:48, Ashutosh Bapat wrote: >>> I have fixed all the issues reported till now. I've tried to fix your 0012 patch (Multi-level partitioned table expansion) considering your message earlier on this thread [1]. Especially the fact that no AppendRelInfo and RelOptInfo are

Re: [HACKERS] scram and \password

2017-03-24 Thread Heikki Linnakangas
On 03/23/2017 06:41 AM, Michael Paquier wrote: And after a lookup the failure is here: - result = get_role_password(port->user_name, _pass, logdetail); + shadow_pass = get_role_password(port->user_name, logdetail); if (result == STATUS_OK) result is never setup in this code path, so that

Re: [HACKERS] Backend crash on non-exclusive backup cancel

2017-03-24 Thread Michael Paquier
On Fri, Mar 24, 2017 at 7:58 PM, Teodor Sigaev wrote: > Thank you all, pushed. Thanks. -- Michael -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers

Re: [HACKERS] Re: Declarative partitioning optimization for large amount of partitions

2017-03-24 Thread Aleksander Alekseev
Also I would like to share some benchmark results. Before applying any patches (copied from one of previous messages): ``` latency average = 1153.495 ms latency stddev = 154.366 ms tps = 6.061104 (including connections establishing) tps = 6.061211 (excluding connections establishing) ``` After

Re: [HACKERS] Declarative partitioning optimization for large amount of partitions

2017-03-24 Thread Simon Riggs
On 1 March 2017 at 01:36, Amit Langote wrote: > I don't know which way you're thinking of fixing this, but a planner patch > to implement faster partition-pruning will have taken care of this, I > think. As you may know, even declarative partitioned tables

Re: [HACKERS] Should we cacheline align PGXACT?

2017-03-24 Thread Simon Riggs
On 10 March 2017 at 13:08, Alexander Korotkov wrote: Results look good for me. Idea of committing both of patches looks > attractive. > I'll commit mine since I understand what it does. I'll look at the other one also, but won't commit yet. > We have pretty much

Re: [HACKERS] increasing the default WAL segment size

2017-03-24 Thread Stephen Frost
Jeff, * Jeff Janes (jeff.ja...@gmail.com) wrote: > On Thu, Mar 23, 2017 at 1:45 PM, Peter Eisentraut < > peter.eisentr...@2ndquadrant.com> wrote: > > On 3/22/17 17:33, David Steele wrote: > > > and I doubt that most tool writers would be quick to > > > add support for a feature that very few

Re: [HACKERS] [PATCH] Suppress Clang 3.9 warnings

2017-03-24 Thread Aleksander Alekseev
Hi Tom, Since no one seems to be particularly excited about this patch I'm marking it as "Returned with feedback" to save reviewers time. On Wed, Mar 15, 2017 at 12:21:21PM -0400, Tom Lane wrote: > Noah Misch writes: > > On Wed, Mar 15, 2017 at 10:57:15AM -0400, Tom Lane

Re: [HACKERS] scram and \password

2017-03-24 Thread Michael Paquier
On Fri, Mar 24, 2017 at 8:36 PM, Heikki Linnakangas wrote: > On 03/23/2017 06:41 AM, Michael Paquier wrote: >> >> And after a lookup the failure is here: >> - result = get_role_password(port->user_name, _pass, logdetail); >> + shadow_pass = get_role_password(port->user_name,

Re: [HACKERS] Patch: Write Amplification Reduction Method (WARM)

2017-03-24 Thread Amit Kapila
On Thu, Mar 23, 2017 at 3:54 PM, Pavan Deolasee wrote: > Thanks Amit. v19 addresses some of the comments below. > > On Thu, Mar 23, 2017 at 10:28 AM, Amit Kapila > wrote: >> >> On Wed, Mar 22, 2017 at 4:06 PM, Amit Kapila

Re: [HACKERS] create_unique_path and GEQO

2017-03-24 Thread Tom Lane
Ashutosh Bapat writes: >> Do you have test case, which can reproduce the issue you >> explained above? > No. It would require some surgery in standard_planner() to measure the > memory consumed in the planner context OR build the code with > SHOW_MEMORY_STATS

Re: [HACKERS] Monitoring roles patch

2017-03-24 Thread Dave Page
On Fri, Mar 24, 2017 at 4:24 PM, Robert Haas wrote: > >> If we make the users run all the statements individually then they'll >> also have to get an updated script for the next version of PG too >> because we will have added things that the tools will want access to. > >

Re: [HACKERS] [COMMITTERS] pgsql: Implement multivariate n-distinct coefficients

2017-03-24 Thread Robert Haas
On Fri, Mar 24, 2017 at 1:16 PM, Alvaro Herrera wrote: > Implement multivariate n-distinct coefficients dromedary and arapaima have failures like this, which seems likely related to this commit: EXPLAIN SELECT COUNT(*) FROM ndistinct GROUP BY a, d;

Re: [HACKERS] increasing the default WAL segment size

2017-03-24 Thread Beena Emerson
Hello, On Wed, Mar 22, 2017 at 9:41 PM, Kuntal Ghosh wrote: > On Wed, Mar 22, 2017 at 3:14 PM, Beena Emerson > wrote: > > PFA an updated patch which fixes a minor bug I found. It only increases > the > > string size in pretty_wal_size

Re: [HACKERS] [COMMITTERS] pgsql: Avoid SnapshotResetXmin() during AtEOXact_Snapshot()

2017-03-24 Thread Robert Haas
On Fri, Mar 24, 2017 at 10:23 AM, Simon Riggs wrote: > Avoid SnapshotResetXmin() during AtEOXact_Snapshot() > > For normal commits and aborts we already reset PgXact->xmin > Avoiding touching highly contented shmem improves concurrent > performance. > > Simon Riggs I'm

Re: [HACKERS] Re: [BUGS] Problem in using pgbench's --connect(-C) and --rate=rate(-R rate) options together.

2017-03-24 Thread Teodor Sigaev
No, it is really needed so that the lag measure is correct. Thank you, pushed -- Teodor Sigaev E-mail: teo...@sigaev.ru WWW: http://www.sigaev.ru/ -- Sent via pgsql-hackers mailing list

Re: [HACKERS] \if, \elseif, \else, \endif (was Re: PSQL commands: \quit_if, \quit_unless)

2017-03-24 Thread Fabien COELHO
Hello Corey, v24 highlights: - finally using git format-patch - all conditional slash commands broken out into their own functions (exec_command_$NAME) , each one tests if it's in an active branch, and if it's not it consumes the same number of parameters, but discards them. comments for each

Re: [HACKERS] Patch: Write Amplification Reduction Method (WARM)

2017-03-24 Thread Pavan Deolasee
On Fri, Mar 24, 2017 at 6:46 PM, Amit Kapila wrote: > > > I was worried for the case if the index is created non-default > collation, will the datumIsEqual() suffice the need. Now again > thinking about it, I think it will because in the index tuple we are > storing the

Re: [HACKERS] BUG: pg_dump generates corrupted gzip file in Windows

2017-03-24 Thread Robert Haas
On Fri, Mar 24, 2017 at 6:44 AM, Kuntal Ghosh wrote: >> ASAICU, if we use binary mode, output is stored bit by bit. In ASCII >> mode, cmd pokes its nose and does CR / LF conversions on its own. So, >> whenever we want compression on a plain-text dump file, we can set

Re: [HACKERS] multivariate statistics (v25)

2017-03-24 Thread Alvaro Herrera
Alvaro Herrera wrote: > Here's a rebased series on top of today's a3eac988c267. I call this > v28. > > I put David's pg_dump and COMMENT patches as second in line, just after > the initial infrastructure patch. I suppose those three have to be > committed together, while the others (which add

Re: [HACKERS] Enabling parallelism for queries coming from SQL or other PL functions

2017-03-24 Thread Robert Haas
On Fri, Mar 24, 2017 at 5:57 AM, Rafia Sabih wrote: >> I suspect that code fails to achieve its goals anyway. At the top of >> exec_eval_expr(), you call exec_prepare_plan() and unconditionally >> pass CURSOR_OPT_PARALLEL_OK, so when that function returns,

Re: [HACKERS] [PATCH] Transaction traceability - txid_status(bigint)

2017-03-24 Thread Robert Haas
On Fri, Mar 24, 2017 at 2:27 AM, Craig Ringer wrote: > On 24 March 2017 at 02:29, Robert Haas wrote: >> On Tue, Mar 21, 2017 at 11:35 PM, Craig Ringer wrote: >>> Changes made per discussion. >> >> Committed 0001. > > Much

Re: [HACKERS] [COMMITTERS] pgsql: Avoid SnapshotResetXmin() during AtEOXact_Snapshot()

2017-03-24 Thread Robert Haas
On Fri, Mar 24, 2017 at 12:27 PM, Robert Haas wrote: > On Fri, Mar 24, 2017 at 12:14 PM, Robert Haas wrote: >> On Fri, Mar 24, 2017 at 10:23 AM, Simon Riggs wrote: >>> Avoid SnapshotResetXmin() during AtEOXact_Snapshot() >>>

Re: [HACKERS] pg_serial early wraparound

2017-03-24 Thread Thomas Munro
On Sat, Mar 25, 2017 at 3:11 AM, Anastasia Lubennikova wrote: > Hi, I've tried to review this patch, but it seems that I miss something > essential. Hi Anastasia, Thanks for looking at this. > You claim that SLRUs now support five digit segment name, while in slru.h >

Re: [HACKERS] Create replication slot in pg_basebackup if requested and not yet present

2017-03-24 Thread Michael Banck
Hi, On Thu, Mar 23, 2017 at 12:41:54PM +0100, Magnus Hagander wrote: > On Tue, Mar 21, 2017 at 8:34 PM, Robert Haas wrote: > > So I tend to think that there should always be some explicit user > > action to cause the creation of a slot, like --create-slot-if-needed > > or

Re: [HACKERS] Monitoring roles patch

2017-03-24 Thread Robert Haas
On Fri, Mar 24, 2017 at 8:30 AM, Stephen Frost wrote: >> But why not do it with GRANTs in the first place then? > > This is akin to asking why do we need GRANT ALL and ALTER DEFAULT PRIVs. Not really. ALTER DEFAULT PRIVILEGES affects what happens for future objects, which

Re: [HACKERS] parallel "return query" is no good

2017-03-24 Thread Robert Haas
On Thu, Mar 23, 2017 at 1:53 PM, Alvaro Herrera wrote: > Robert Haas wrote: >> I guess the downside of back-patching this is that it could cause a >> plan change for somebody which ends up being worse. On the whole, >> serial execution of queries intended to be run in

Re: [HACKERS] Report the number of skipped frozen pages by manual VACUUM

2017-03-24 Thread Fujii Masao
On Thu, Mar 23, 2017 at 4:28 AM, Fujii Masao wrote: > On Wed, Mar 15, 2017 at 7:51 PM, Masahiko Sawada > wrote: >> On Wed, Mar 15, 2017 at 1:09 PM, Yugo Nagata wrote: >>> On Fri, 10 Mar 2017 20:08:42 +0900 >>> Masahiko Sawada

Re: [HACKERS] WIP: Faster Expression Processing v4

2017-03-24 Thread Andres Freund
Hi, On 2017-03-24 11:26:27 -0400, Tom Lane wrote: > Another modest proposal: > > I'm not really sold on the approach of using EEOP_FETCHSOME opcodes to > trigger initial tupleslot de-forming. Certainly we want to have a single > slot_getsomeattrs call per source slot, but as-is, we need a

Re: [HACKERS] Re: Declarative partitioning optimization for large amount of partitions

2017-03-24 Thread Aleksander Alekseev
Hi Teodor, Thanks a lot for a review! > > step1 In pgstat_report_stat() you remove one by one entries from hash and > > remove them all. Isn't it better to hash_destroy/hash_create or even let > > hash > > lives in separate memory context and just resets it? Agree, fixed. > > step1 Again,

Re: [HACKERS] [COMMITTERS] pgsql: Avoid SnapshotResetXmin() during AtEOXact_Snapshot()

2017-03-24 Thread Andres Freund
On 2017-03-24 13:50:54 -0400, Robert Haas wrote: > On Fri, Mar 24, 2017 at 12:27 PM, Robert Haas wrote: > > On Fri, Mar 24, 2017 at 12:14 PM, Robert Haas wrote: > >> On Fri, Mar 24, 2017 at 10:23 AM, Simon Riggs > >> wrote: >

Re: [HACKERS] extended statistics: n-distinct

2017-03-24 Thread Alvaro Herrera
Pushed this after some more tweaking. -- Álvaro Herrerahttps://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription:

Re: [HACKERS] [COMMITTERS] pgsql: Avoid SnapshotResetXmin() during AtEOXact_Snapshot()

2017-03-24 Thread Robert Haas
On Fri, Mar 24, 2017 at 12:14 PM, Robert Haas wrote: > On Fri, Mar 24, 2017 at 10:23 AM, Simon Riggs wrote: >> Avoid SnapshotResetXmin() during AtEOXact_Snapshot() >> >> For normal commits and aborts we already reset PgXact->xmin >> Avoiding touching

Re: [HACKERS] Supporting huge pages on Windows

2017-03-24 Thread Ashutosh Sharma
Hi, On Fri, Mar 24, 2017 at 9:00 PM, David Steele wrote: > Hi Ashutosh, > > On 3/22/17 8:52 AM, Amit Kapila wrote: >> >> On Wed, Mar 22, 2017 at 12:07 AM, David Steele >> wrote: >>> >>> >>> Amit, Magnus, you are signed up as reviewers for this patch.

Re: [HACKERS] Monitoring roles patch

2017-03-24 Thread Robert Haas
On Fri, Mar 24, 2017 at 12:46 PM, Dave Page wrote: > On Fri, Mar 24, 2017 at 4:24 PM, Robert Haas wrote: >>> If we make the users run all the statements individually then they'll >>> also have to get an updated script for the next version of PG too >>>

Re: [HACKERS] [COMMITTERS] pgsql: Avoid SnapshotResetXmin() during AtEOXact_Snapshot()

2017-03-24 Thread Simon Riggs
On 24 March 2017 at 16:14, Robert Haas wrote: > I suspect that is the fault of this patch. Please fix or revert. Will revert then fix. -- Simon Riggshttp://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services --

Re: [HACKERS] Re: [COMMITTERS] pgsql: Implement multivariate n-distinct coefficients

2017-03-24 Thread Tom Lane
Alvaro Herrera writes: > Tom Lane wrote: >> Why not use COSTS OFF? Or I'll put that even more strongly: all the >> existing regression tests use COSTS OFF, exactly to avoid this sort of >> machine-dependent output. There had better be a really damn good >> reason not

[HACKERS] Re: [COMMITTERS] pgsql: Implement multivariate n-distinct coefficients

2017-03-24 Thread Alvaro Herrera
Robert Haas wrote: > On Fri, Mar 24, 2017 at 1:16 PM, Alvaro Herrera > wrote: > > Implement multivariate n-distinct coefficients > > dromedary and arapaima have failures like this, which seems likely > related to this commit: > > EXPLAIN >SELECT COUNT(*) FROM

Re: [HACKERS] Re: [COMMITTERS] pgsql: Implement multivariate n-distinct coefficients

2017-03-24 Thread Tom Lane
Alvaro Herrera writes: > Robert Haas wrote: >> dromedary and arapaima have failures like this, which seems likely >> related to this commit: >> >> EXPLAIN >> SELECT COUNT(*) FROM ndistinct GROUP BY a, d; >> QUERY PLAN >>

Re: [HACKERS] pg_stat_wal_write statistics view

2017-03-24 Thread Fujii Masao
On Wed, Feb 15, 2017 at 12:53 PM, Haribabu Kommi wrote: > > > On Wed, Feb 8, 2017 at 9:36 PM, Amit Kapila wrote: >> >> On Tue, Feb 7, 2017 at 11:47 AM, Haribabu Kommi >> wrote: >> > Hi Hackers, >> > >> > I just want to

Re: [HACKERS] UPDATE of partition key

2017-03-24 Thread Amit Khandekar
Thanks Amit for your review comments. I am yet to handle all of your comments, but meanwhile , attached is an updated patch, that handles RETURNING. Earlier it was not working because ExecInsert() did not return any RETURNING clause. This is because the setup needed to create RETURNIG projection

Re: [HACKERS] comment/security label for publication/subscription

2017-03-24 Thread Stephen Frost
* Robert Haas (robertmh...@gmail.com) wrote: > On Fri, Mar 24, 2017 at 12:18 AM, Peter Eisentraut > wrote: > > Here is a patch to add COMMENT support for publications and subscriptions. > > > > On a similar issue, do we need SECURITY LABEL support for those?

Re: [HACKERS] increasing the default WAL segment size

2017-03-24 Thread Robert Haas
On Wed, Mar 22, 2017 at 6:05 PM, David Steele wrote: >> Wait, really? I thought you abandoned this approach because there's >> then no principled way to handle WAL segments of less than the default >> size. > > I did say that, but I thought I had hit on a compromise. > >

Re: [HACKERS] \if, \elseif, \else, \endif (was Re: PSQL commands: \quit_if, \quit_unless)

2017-03-24 Thread Corey Huinker
> > > A few comments about the patch. > > Patch applies. "make check" ok. > > As already pointed out, there is one useless file in the patch. > > Although currently there is only one expected argument for boolean > expressions, the n² concatenation algorithm in gather_boolean_expression is > not

Re: [HACKERS] Logical replication existing data copy

2017-03-24 Thread Peter Eisentraut
On 3/24/17 05:22, Michael Banck wrote: > However, replication also seems to not work, I'm using the following > script right now: The problem is that your publication does not include any tables. -- Peter Eisentraut http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support,

Re: [HACKERS] Logical replication existing data copy

2017-03-24 Thread Peter Eisentraut
On 3/24/17 10:09, Petr Jelinek wrote: > On 24/03/17 15:05, Peter Eisentraut wrote: >> On 3/23/17 19:32, Petr Jelinek wrote: >>> Yes, I also forgot to check if the table actually exists on subscriber >>> when fetching them in CREATE SUBSCRIPTION (we have check during >>> replication but not there).

Re: [HACKERS] \if, \elseif, \else, \endif (was Re: PSQL commands: \quit_if, \quit_unless)

2017-03-24 Thread Fabien COELHO
Hello Corey, I wished for the same thing, happy to use one if it is made known to me. I pulled that pattern from somewhere else in the code, and given that the max number of args for a command is around 4, I'm not too worried about scaling. If there are expressions one day like pgbench, the

Re: [HACKERS] comment/security label for publication/subscription

2017-03-24 Thread Robert Haas
On Fri, Mar 24, 2017 at 12:18 AM, Peter Eisentraut wrote: > Here is a patch to add COMMENT support for publications and subscriptions. > > On a similar issue, do we need SECURITY LABEL support for those? Does > that make sense? IMHO, it's good to have COMMENT

Re: [HACKERS] Guidelines for GSoC student proposals / Eliminate O(N^2) scaling from rw-conflict tracking in serializable transactions

2017-03-24 Thread Kevin Grittner
On Wed, Mar 22, 2017 at 2:24 AM, Mengxing Liu wrote: > I've finished a draft proposal for "Eliminate O(N^2) scaling from > rw-conflict tracking in serializable transactions". I've attached some comments to the document; let me know if they don't show up for you

Re: [HACKERS] WIP: Faster Expression Processing v4

2017-03-24 Thread Tom Lane
Andres Freund writes: > On 2017-03-24 11:26:27 -0400, Tom Lane wrote: >> Another modest proposal: >> >> I'm not really sold on the approach of using EEOP_FETCHSOME opcodes to >> trigger initial tupleslot de-forming. Certainly we want to have a single >> slot_getsomeattrs

Re: [HACKERS] pageinspect and hash indexes

2017-03-24 Thread Robert Haas
On Fri, Mar 24, 2017 at 3:54 AM, Amit Kapila wrote: > On Fri, Mar 24, 2017 at 9:50 AM, Ashutosh Sharma > wrote: >> On Fri, Mar 24, 2017 at 9:46 AM, Ashutosh Sharma >> wrote: >>> >>> Thanks for reviewing my patch. I have

Re: [HACKERS] ANALYZE command progress checker

2017-03-24 Thread Robert Haas
On Fri, Mar 24, 2017 at 3:41 AM, vinayak wrote: > I have updated the patch. You can't change the definition of AcquireSampleRowsFunc without updating the documentation in fdwhandler.sgml, but I think I don't immediately understand why that's a thing we want to do

Re: [HACKERS] pageinspect and hash indexes

2017-03-24 Thread Ashutosh Sharma
Thanks for reviewing my patch. I have removed the extra white space. Attached are both the patches. >>> >>> Sorry, I have mistakenly attached wrong patch. Here are the correct >>> set of patches. >> >> The latest version of patches looks fine to me. > > I don't really like 0002. What

Re: [HACKERS] Logical replication existing data copy

2017-03-24 Thread Michael Banck
Am Freitag, den 24.03.2017, 14:57 -0400 schrieb Peter Eisentraut: > On 3/24/17 05:22, Michael Banck wrote: > > However, replication also seems to not work, I'm using the following > > script right now: > > The problem is that your publication does not include any tables. Oops, of course. That

Re: [HACKERS] Re: [COMMITTERS] pgsql: Implement multivariate n-distinct coefficients

2017-03-24 Thread Alvaro Herrera
Tom Lane wrote: > Why not use COSTS OFF? Or I'll put that even more strongly: all the > existing regression tests use COSTS OFF, exactly to avoid this sort of > machine-dependent output. There had better be a really damn good > reason not to use it here. If we use COSTS OFF, the test is

Re: [HACKERS] \if, \elseif, \else, \endif (was Re: PSQL commands: \quit_if, \quit_unless)

2017-03-24 Thread Corey Huinker
On Fri, Mar 24, 2017 at 4:10 PM, Fabien COELHO wrote: > > Hello Corey, > > I wished for the same thing, happy to use one if it is made known to me. >> I pulled that pattern from somewhere else in the code, and given that the >> max number of args for a command is around 4,

Re: [HACKERS] delta relations in AFTER triggers

2017-03-24 Thread Thomas Munro
On Fri, Mar 24, 2017 at 5:36 PM, Thomas Munro wrote: > On Fri, Mar 24, 2017 at 1:14 PM, Thomas Munro > wrote: >> If that's fixed and the permissions question can be waved away by >> saying it's the same as the per-row situation, my

Re: [HACKERS] Page Scan Mode in Hash Index

2017-03-24 Thread Robert Haas
On Thu, Mar 23, 2017 at 2:35 PM, Ashutosh Sharma wrote: > I take your suggestion. Please find the attachments. I think you should consider refactoring this so that it doesn't need to use goto. Maybe move the while (offnum <= maxoff) logic into a helper function and have

Re: [HACKERS] dsm.c API tweak

2017-03-24 Thread Thomas Munro
On Sat, Mar 25, 2017 at 1:59 PM, Thomas Munro wrote: > On Sat, Mar 25, 2017 at 12:35 PM, Alvaro Herrera > wrote: >> Alvaro Herrera wrote: >>> Per >>> https://postgr.es/m/CAEepm=11ma_Z1HoPxPcSCANnh5ykHORa=hca1u1v1+5s_jw...@mail.gmail.com

  1   2   >