[HACKERS] error detail when partition not found

2017-02-20 Thread Amit Langote
Simon pointed out in a nearby thread [0] that the detail part of partition-not-found error should show just the partition keys. I posted a patch on that thread [1], but to avoid confusion being caused by multitude of patches over there I'm re-posting it here. * What the patch does: Currently we

Re: [HACKERS] Documentation improvements for partitioning

2017-02-20 Thread Amit Langote
On 2017/02/16 10:45, Amit Langote wrote: > Also attaching 0002 (unchanged) for tab-completion support for the new > partitioning syntax. Robert already spawned a new thread titled "tab completion for partitioning" for this [0]. > 0003 changes how ExecFindPartition() show

Re: [HACKERS] Documentation improvements for partitioning

2017-02-20 Thread Amit Langote
On 2017/02/21 12:10, Ashutosh Bapat wrote: > I think, that's a limitation till we implement global indexes. But > nothing in the current implementation stops us from implementing it. > In fact, I remember, a reply from Robert to another thread on > partitioning started in parallel to Amit's thread

Re: [HACKERS] dropping partitioned tables without CASCADE

2017-02-20 Thread Amit Langote
k adding these as one of the PostgreSQL 10 Open Items [0] might be better. I've done that. > On Mon, Feb 20, 2017 at 7:46 AM, Amit Langote wrote: >> So I count more than a few votes saying that we should be able to DROP >> partitioned tables without specifying CASCADE. >

Re: [HACKERS] dropping partitioned tables without CASCADE

2017-02-20 Thread Amit Langote
On 2017/02/21 15:35, Amit Langote wrote: >> drop table list_parted cascade; >> -NOTICE: drop cascades to 3 other objects >> -DETAIL: drop cascades to table part_ab_cd >> probably we should remove cascade from there, unless you are testing CASCADE >> functionali

[HACKERS] foreign partition DDL regression tests

2017-02-21 Thread Amit Langote
Ashutosh Bapat pointed out [0] that regression tests are missing for the foreign partition DDL commands. Attached patch takes care of that. Thanks, Amit [0] https://www.postgresql.org/message-id/CAFjFpRcrdzBRj0cZ%2BJAQmfSa2Tv8wSEcWAeYtDpV-YZnNna2sA%40mail.gmail.com >From 236c357b94af848663ed3d0a

Re: [HACKERS] dropping partitioned tables without CASCADE

2017-02-21 Thread Amit Langote
On 2017/02/21 20:17, Ashutosh Bapat wrote: > On Tue, Feb 21, 2017 at 12:05 PM, Amit Langote wrote: >> On 2017/02/20 21:49, Ashutosh Bapat wrote: >>> Here are some comments >>> >>> For the sake of readability you may want reverse the if and else order. >

Re: [HACKERS] dropping partitioned tables without CASCADE

2017-02-21 Thread Amit Langote
On 2017/02/22 10:49, Amit Langote wrote: > On 2017/02/21 20:17, Ashutosh Bapat wrote: >> Are you sure you have attached the right patch? > > Oops, really fixed this time. Sorry again, 3rd time's a charm. I copy-paste the hunk below from the patch file before I at

Re: [HACKERS] foreign partition DDL regression tests

2017-02-21 Thread Amit Langote
On 2017/02/22 13:26, Ashutosh Bapat wrote: > Please add this to the upcoming commitfest. Done. Thanks, Amit -- 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] dropping partitioned tables without CASCADE

2017-02-21 Thread Amit Langote
On 2017/02/22 13:46, Ashutosh Bapat wrote: > Looks good to me. In the attached patch I have added a comment > explaining the reason to make partition tables "Auto" dependent upon > the corresponding partitioned tables. Good call. + /* +* Unlike inheritance children, partition tables

[HACKERS] tablesample with partitioned tables

2017-02-21 Thread Amit Langote
Attached patch fixes an oversight that tablesample cannot be used with partitioned tables: create table p (a int) partition by list (a); select * from p tablesample bernoulli (50); ERROR: TABLESAMPLE clause can only be applied to tables and materialized views Thanks, Amit >From d9c412ea14b005b4c

Re: [HACKERS] Partitioned tables and relfilenode

2017-02-22 Thread Amit Langote
On 2017/02/21 22:21, Ashutosh Bapat wrote: > Some comments about 0003 patch. > > @@ -996,10 +996,20 @@ inheritance_planner(PlannerInfo *root) > Index rti; > + RangeTblEntry *parent_rte; > There's already another variable declared in that function within a loop > foreach(lc, root->a

Re: [HACKERS] Range Partitioning behaviour - query

2017-02-22 Thread Amit Langote
Hi, On 2017/02/23 11:55, Venkata B Nagothi wrote: > Hi Hackers, > > I have noticed the following behaviour in range partitioning which i felt > is not quite correct (i missed reporting this) - > > I have tested by creating a date ranged partition. > > I created the following table. > > db03=#

Re: [HACKERS] tablesample with partitioned tables

2017-02-22 Thread Amit Langote
On 2017/02/23 0:54, David Fetter wrote: > On Wed, Feb 22, 2017 at 04:51:46PM +0900, Amit Langote wrote: >> Attached patch fixes an oversight that tablesample cannot be used with >> partitioned tables: >> >> create table p (a int) partition by list (a); >> select *

Re: [HACKERS] Partitioned tables and relfilenode

2017-02-22 Thread Amit Langote
Thanks for the review. On 2017/02/22 21:58, Ashutosh Bapat wrote: >>> Also we should add tests to make sure the scans on partitioned tables >>> without any partitions do not get into problems. PFA patch which adds >>> those tests. >> >> I added the test case you suggest, but kept just the first on

Re: [HACKERS] dropping partitioned tables without CASCADE

2017-02-22 Thread Amit Langote
On 2017/02/22 21:24, Ashutosh Bapat wrote: > On Wed, Feb 22, 2017 at 11:11 AM, Amit Langote wrote: >> + /* >> +* Unlike inheritance children, partition tables are expected to be >> dropped >> +* when the parent partitioned table gets droppe

Re: [HACKERS] Declarative partitioning - another take

2017-02-22 Thread Amit Langote
Nagata-san, On 2017/02/23 16:17, Yugo Nagata wrote: > Hi, > > I found that a comment for PartitionRoot in ResultRelInfo is missing. > Although this is trivial, since all other members have comments, I > think it is needed. Attached is the patch to fix it. Thanks for taking care of that. + *

Re: [HACKERS] Partitioned tables and relfilenode

2017-02-22 Thread Amit Langote
Thanks for the review. On 2017/02/23 15:44, Ashutosh Bapat wrote: > On Thu, Feb 23, 2017 at 11:19 AM, Amit Langote wrote: >> Rewrote that comment block as: >> >> * >> * If the parent is a partitioned table, we already set the nominal >> * relati

Re: [HACKERS] Partitioned tables and relfilenode

2017-02-23 Thread Amit Langote
On 2017/02/23 16:48, Ashutosh Bapat wrote: > On Thu, Feb 23, 2017 at 1:08 PM, Amit Langote wrote: >> @@ -996,10 +996,20 @@ inheritance_planner(PlannerInfo *root) >> /* >> +* Partitioned tables do not have storage for themselves and should >> n

Re: [HACKERS] UPDATE of partition key

2017-02-23 Thread Amit Langote
Hi Amit, Thanks for working on this. On 2017/02/13 21:01, Amit Khandekar wrote: > Currently, an update of a partition key of a partition is not allowed, > since it requires to move the row(s) into the applicable partition. > > Attached is a WIP patch (update-partition-key.patch) that removes thi

Re: [HACKERS] Range Partitioning behaviour - query

2017-02-23 Thread Amit Langote
On 2017/02/24 8:38, Venkata B Nagothi wrote: > On Thu, Feb 23, 2017 at 3:14 PM, Amit Langote wrote: >> Upper bound of a range partition is an exclusive bound. A note was added >> recently to the CREATE TABLE page to make this clear. >> >> https://www.postgresq

Re: [HACKERS] Range Partitioning behaviour - query

2017-02-23 Thread Amit Langote
On 2017/02/24 10:38, David G. Johnston wrote: > On Thu, Feb 23, 2017 at 6:17 PM, Amit Langote > wrote: > >> On 2017/02/24 8:38, Venkata B Nagothi wrote: >>> On Thu, Feb 23, 2017 at 3:14 PM, Amit Langote wrote: >>>> Upper bound of a range partition is an e

Re: [HACKERS] dropping partitioned tables without CASCADE

2017-02-23 Thread Amit Langote
On 2017/02/24 1:33, Simon Riggs wrote: > On 23 February 2017 at 06:40, Ashutosh Bapat > wrote: > >> I think this is ready for committer. > > Thanks for writing and reviewing this. I'll be happy to review and > commit. Please add to CF. Thanks. I've added it to CF: https://commitfest.postgresql

Re: [HACKERS] dropping partitioned tables without CASCADE

2017-02-26 Thread Amit Langote
On 2017/02/26 5:30, Simon Riggs wrote: > On 23 February 2017 at 16:33, Simon Riggs wrote: > >> I'll be happy to review > > Patch looks OK so far, but fails on a partition that has partitions, > probably because of the way we test relkind in the call to > StoreCatalogInheritance1(). Thanks for

Re: [HACKERS] error detail when partition not found

2017-02-26 Thread Amit Langote
Thanks for the review. On 2017/02/27 2:39, Robert Haas wrote: > On Tue, Feb 21, 2017 at 7:28 AM, Amit Langote > wrote: >> Simon pointed out in a nearby thread [0] that the detail part of >> partition-not-found error should show just the partition keys. I posted a >>

Re: [HACKERS] dropping partitioned tables without CASCADE

2017-02-26 Thread Amit Langote
On 2017/02/27 13:35, Ashutosh Bapat wrote: > On Mon, Feb 27, 2017 at 8:08 AM, Amit Langote > wrote: >> On 2017/02/26 5:30, Simon Riggs wrote: >>> On 23 February 2017 at 16:33, Simon Riggs wrote: >>> >>>> I'll be happy to review >>> >

[HACKERS] Logical replication and inheritance

2017-02-26 Thread Amit Langote
I see that if the table is a inheritance parent, and ONLY is not specified, the child tables are also added to the publication. create table parent (a int); create table child () inherits (parent); create publication parent_pub for table parent; \d parent Table "public.parent" Colu

Re: [HACKERS] Documentation improvements for partitioning

2017-02-26 Thread Amit Langote
On 2017/02/27 3:18, Petr Jelinek wrote: > On 24/02/17 07:15, Robert Haas wrote: >> On Fri, Feb 24, 2017 at 9:53 AM, Simon Riggs wrote: >>> The good news is that logical replication DOES work with partitioning, >>> but only for a Publication with PUBLISH INSERT, pushing from a normal >>> table to a

Re: [HACKERS] Documentation improvements for partitioning

2017-02-27 Thread Amit Langote
On 2017/02/15 12:00, Robert Haas wrote: > On Fri, Feb 10, 2017 at 3:00 AM, Simon Riggs wrote: > >> Without claiming I'm happy about this, I think the best way to improve >> the number of eyeballs on this is to commit these docs as is. >> >> For me, the most important thing is understanding the fe

Re: [HACKERS] Partitioned tables and relfilenode

2017-02-27 Thread Amit Langote
On 2017/02/28 3:54, Bruce Momjian wrote: > On Fri, Feb 10, 2017 at 03:19:47PM +0900, Amit Langote wrote: >> The new partitioned tables do not contain any data by themselves. Any >> data inserted into a partitioned table is routed to and stored in one of >> its partit

Re: [HACKERS] Partitioned tables and relfilenode

2017-02-27 Thread Amit Langote
On 2017/02/28 12:29, Michael Paquier wrote: > On Tue, Feb 28, 2017 at 12:23 PM, Bruce Momjian wrote: >> I am a little confused by the above. Is a partitioned table the parent >> or the children? Reading the code it seems it is the parent, which >> explains why it works. Can I clarify that? > >

Re: [HACKERS] Partitioned tables and relfilenode

2017-02-27 Thread Amit Langote
On 2017/02/28 13:52, Ashutosh Bapat wrote: > Amit's original patch had an assertion failure in > extract_autovac_opts(). His patch adds partitioned tables in the list > of tables to be auto-analyzed. But there's an assertion in > extract_autovac_opts(), which did not consider partitioned tables. >

Re: [HACKERS] Partitioned tables and relfilenode

2017-02-27 Thread Amit Langote
Thanks for the review. I was just about to send a new version of the patches. On 2017/02/28 12:20, Robert Haas wrote: > On Thu, Feb 23, 2017 at 11:19 AM, Amit Langote > wrote: >> Thanks for the review. > > In 0001, the documentation which you are patching has a section for

Re: [HACKERS] Documentation improvements for partitioning

2017-02-28 Thread Amit Langote
On 2017/02/27 20:44, Simon Riggs wrote: > On 27 February 2017 at 10:12, Amit Langote > wrote: > >> I agree that my patch failed to de-emphasize the old partitioning method >> enough. The examples in 5.11 Partitioning chapter also did not highlight >> the new partiti

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

2017-02-28 Thread Amit Langote
Hi, On 2017/02/28 23:25, Aleksander Alekseev wrote: > Hello. > > I decided to figure out whether current implementation of declarative > partitioning has any bottlenecks when there is a lot of partitions. Here > is what I did [1]. Thanks for sharing. > Then: > > ``` > # 2580 is some pk that ex

Re: [HACKERS] [POC] hash partitioning

2017-02-28 Thread Amit Langote
Nagata-san, On 2017/02/28 23:33, Yugo Nagata wrote: > Hi all, > > Now we have a declarative partitioning, but hash partitioning is not > implemented yet. Attached is a POC patch to add the hash partitioning > feature. I know we will need more discussions about the syntax and other > specification

Re: [HACKERS] UPDATE of partition key

2017-03-01 Thread Amit Langote
On 2017/02/26 4:01, David G. Johnston wrote: > IIUC ​it is already possible, for those who care to do so, to get a > serialization failure in this scenario by upgrading isolation to repeatable > read. Maybe, this can be added as a note in the documentation. Thanks, Amit -- Sent via pgsql-hac

Re: [HACKERS] Partitioned tables and relfilenode

2017-03-02 Thread Amit Langote
On 2017/03/02 18:36, Robert Haas wrote: > On Tue, Feb 28, 2017 at 11:35 AM, Amit Langote wrote: >>> In acquire_inherited_sample_rows(), instead of inserting a whole >>> stanza of logic just above the existing dispatch on relkind, I think >>> we can get by with a

Re: [HACKERS] Partitioned tables and relfilenode

2017-03-02 Thread Amit Langote
On 2017/03/02 21:48, Robert Haas wrote: > On Thu, Mar 2, 2017 at 3:52 PM, Amit Langote > wrote: >>> think we should omit this logic (and change the documentation to >>> match). That is, a database-wide ANALYZE should update the statistics >>> for each child as w

Re: [HACKERS] error detail when partition not found

2017-03-02 Thread Amit Langote
On 2017/03/03 12:43, Robert Haas wrote: > On Mon, Feb 27, 2017 at 9:54 AM, Amit Langote > wrote: >> Updated patch is attached. > > Committed with one grammatical change to the comments. Thanks. I've marked this as fixed on the open item wiki page. Thanks, Amit --

Re: [HACKERS] Documentation improvements for partitioning

2017-03-02 Thread Amit Langote
On 2017/02/28 17:25, Simon Riggs wrote: > On 28 February 2017 at 08:14, Amit Langote > wrote: > >> OK. So, I will start writing the patch with above general skeleton and >> hopefully post it within this week and you can improve it as fit. > > Will do, thanks. At

Re: [HACKERS] dropping partitioned tables without CASCADE

2017-03-05 Thread Amit Langote
On 2017/03/05 16:20, Simon Riggs wrote: > I notice also that > \d+ > does not show which partitions have subpartitions. Do you mean showing just whether a partition is itself partitioned or showing its partitions and so on (because those partitions may themselves be partitioned)? Maybe, we cou

Re: [HACKERS] dropping partitioned tables without CASCADE

2017-03-05 Thread Amit Langote
On 2017/03/06 14:25, Simon Riggs wrote: > On 6 March 2017 at 04:00, Ashutosh Bapat wrote: >> Thinking about how to display partition which are further partitioned, >> there are two options. Assume a partitioned table t1 with partitions >> t1p1, which is further partitioned and t1p2. One could displ

Re: [HACKERS] Partitioned tables and relfilenode

2017-03-05 Thread Amit Langote
Thanks for the review. On 2017/03/06 15:41, Michael Paquier wrote: > On Fri, Mar 3, 2017 at 10:02 AM, Amit Langote > wrote: >> Thanks. I noticed that 'and' is duplicated in a line added by the commit >> to analyze.sgml. Attached 0001 fixes that. 0002 and 0003

Re: [HACKERS] Partitioned tables and relfilenode

2017-03-05 Thread Amit Langote
On 2017/03/06 16:49, Ashutosh Bapat wrote: > On Mon, Mar 6, 2017 at 12:48 PM, Amit Langote wrote: >> On 2017/03/06 15:41, Michael Paquier wrote: >>> This comment is not completely correct. Children can be temp tables, >>> they just cannot be temp tables of other ba

Re: [HACKERS] ANALYZE command progress checker

2017-03-06 Thread Amit Langote
Hi Vinayak, On 2017/02/28 18:24, vinayak wrote: > The attached patch reports the different phases of analyze command. > Added this patch to CF 2017-03. In the updated monitoring.sgml: + + computing heap stats + + VACUUM is currently computing heap stats. + + + +

[HACKERS] pg_dump segfaults with publication

2017-03-06 Thread Amit Langote
Hi, pg_dump segfaults if there are more than one DO_PUBLICATION_REL objects to dump. create table foo (a int); create publication foo_pub; alter publication foo_pub add table foo; $ pg_dump create table bar (a int); alter publication foo_pub add table bar; $ pg_dump -s Segmentation fault (cor

Re: [HACKERS] Partitioned tables and relfilenode

2017-03-06 Thread Amit Langote
On 2017/03/06 17:01, Ashutosh Bapat wrote: > On Mon, Mar 6, 2017 at 1:26 PM, Amit Langote > wrote: >> On 2017/03/06 16:49, Ashutosh Bapat wrote: >>> On Mon, Mar 6, 2017 at 12:48 PM, Amit Langote wrote: >>>> On 2017/03/06 15:41, Michael Paquier wrote: >>>

Re: [HACKERS] Logical replication and inheritance

2017-03-06 Thread Amit Langote
On 2017/03/04 4:24, Peter Eisentraut wrote: > On 2/27/17 01:57, Amit Langote wrote: >> I see that if the table is a inheritance parent, and ONLY is not >> specified, the child tables are also added to the publication. > >> If the child table is later removed from the i

Re: [HACKERS] Logical replication and inheritance

2017-03-06 Thread Amit Langote
On 2017/03/06 18:04, Amit Langote wrote: > One more option is for OpenTableList() called by CreatePublication() and > AlterPublicationTables() to not disregard inheritance, as if ONLY was > specified. Oops, meant to say: One more option is for OpenTableList to disregard inheritance..

Re: [HACKERS] UPDATE of partition key

2017-03-06 Thread Amit Langote
Hi, On 2017/03/02 15:23, Amit Khandekar wrote: > On 23 February 2017 at 16:02, Amit Langote > wrote: >> >>> 2. In the patch, as part of the row movement, ExecDelete() is called >>> followed by ExecInsert(). This is done that way, because we want to >>

Re: [HACKERS] WARNING: relcache reference leak: relation "p1" not closed

2017-03-06 Thread Amit Langote
On 2017/03/07 7:28, Tom Lane wrote: > Kevin Grittner writes: >> With e434ad39ae7316bcf35fd578dd34ad7e1ff3c25f I did a `make world`, >> `make install-world`, a fresh default initdb, a start with default >> config, `make installcheck`, connected to the regression database >> with psql as the initial

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

2017-03-06 Thread Amit Langote
Hi Aleksander, On 2017/03/07 0:22, Aleksander Alekseev wrote: > Hello. > > OK, here is a patch. > > Benchmark, before: > > ``` > number of transactions actually processed: 1823 > latency average = 1153.495 ms > latency stddev = 154.366 ms > tps = 6.061104 (including connections establishing) >

Re: [HACKERS] Partitioned tables and relfilenode

2017-03-06 Thread Amit Langote
On 2017/03/06 17:22, Michael Paquier wrote: > On Mon, Mar 6, 2017 at 4:18 PM, Amit Langote > wrote: >> About autovacuum_* parameters - we currently don't handle partitioned >> tables in autovacuum.c, because no statistics are reported for them. That >> is, relation_

Re: [HACKERS] WARNING: relcache reference leak: relation "p1" not closed

2017-03-06 Thread Amit Langote
On 2017/03/07 10:49, Michael Paquier wrote: > On Tue, Mar 7, 2017 at 10:37 AM, Amit Langote > wrote: >> On 2017/03/07 7:28, Tom Lane wrote: >>> Kevin Grittner writes: >>>> With e434ad39ae7316bcf35fd578dd34ad7e1ff3c25f I did a `make world`, >>>> `m

Re: [HACKERS] WARNING: relcache reference leak: relation "p1" not closed

2017-03-06 Thread Amit Langote
On 2017/03/07 14:04, Tom Lane wrote: > Amit Langote writes: >> Also, I found out that alter_table.sql mistakenly forgot to drop >> partitioned table "p1". Patch 0002 takes care of that. > > While that might or might not have been intentional, I think it's an

Re: [HACKERS] contrib modules and relkind check

2017-03-06 Thread Amit Langote
Sorry about the absence on this thread. On 2017/02/14 15:30, Michael Paquier wrote: > On Tue, Feb 14, 2017 at 3:18 PM, Amit Langote wrote: >> >> Added more tests in pgstattuple and the new ones for pg_visibility, >> although I may have overdone the latter. > > A bonu

Re: [HACKERS] exposing wait events for non-backends (was: Tracking wait event for latches)

2017-03-07 Thread Amit Langote
Hi Kuntal, Patches apply and compile fine. Works as advertised. Some minor comments on the patches themselves. In 0001: - * pgstat_bestart() - + * pgstat_procstart() - + * + * Initialize this process's entry in the PgBackendStatus array. + * Called from InitPostgres and AuxiliaryProcessMain.

Re: [HACKERS] Example Custom Scan Provider Implementation?

2017-03-07 Thread Amit Langote
On 2017/03/08 7:10, Eric Ridge wrote: > Hi all! > > Does anyone know of a simple, example Custom Scan Provider implementation > for 9.6+? > > I found pg_strom by searching GitHub. Its gpuscan.c looks like maybe it > implements a pattern similar to what I want to do, but there's a lot of > extran

Re: [HACKERS] WARNING: relcache reference leak: relation "p1" not closed

2017-03-07 Thread Amit Langote
On 2017/03/08 1:34, Robert Haas wrote: > On Tue, Mar 7, 2017 at 1:43 AM, Amit Langote wrote: >> On 2017/03/07 14:04, Tom Lane wrote: >>> Therefore, there should definitely be a partitioned table, hopefully with >>> a less generic name than "p1", in the final r

Re: [HACKERS] Bizarre choice of case for RELKIND_PARTITIONED_TABLE

2017-03-07 Thread Amit Langote
On 2017/03/08 2:55, Tom Lane wrote: > Is there a good reason why RELKIND_PARTITIONED_TABLE is 'P' not 'p'? > It looks rather out of place considering that seven of the eight > pre-existing relkind codes are lower case. (And no, I don't especially > approve of RELKIND_SEQUENCE being 'S' either, but

Re: [HACKERS] dropping partitioned tables without CASCADE

2017-03-07 Thread Amit Langote
Hi Ashutosh, On 2017/03/06 18:19, Ashutosh Bapat wrote: > On Mon, Mar 6, 2017 at 11:12 AM, Ashutosh Bapat wrote: >> On Mon, Mar 6, 2017 at 11:05 AM, Simon Riggs wrote: >>> "has partitions" is not part of the DDL, whereas "FOR VALUES FROM (0) >>> TO (100)" is. So ISTM sensible to differentiate bet

Re: [HACKERS] contrib modules and relkind check

2017-03-08 Thread Amit Langote
On 2017/03/08 16:47, Michael Paquier wrote: > On Tue, Mar 7, 2017 at 4:15 PM, Amit Langote wrote: > +++ b/contrib/pg_visibility/expected/pg_visibility.out > @@ -0,0 +1,85 @@ > +CREATE EXTENSION pg_visibility; > +-- > +-- check that using the module's functions with uns

Re: [HACKERS] dropping partitioned tables without CASCADE

2017-03-08 Thread Amit Langote
On 2017/03/08 18:27, Ashutosh Bapat wrote: >> >> About the other statement you changed, I just realized that we should >> perhaps do one more thing. Show the Number of partitions, even if it's 0. >> In case of inheritance, the parent table stands on its own when there are >> no child tables, but

Re: [HACKERS] Partitioned tables and relfilenode

2017-03-08 Thread Amit Langote
On 2017/03/08 2:27, Robert Haas wrote: > On Tue, Mar 7, 2017 at 12:11 AM, Ashutosh Bapat > wrote: >> I see that all the changes by Amit and myself to what was earlier 0003 >> patch are now part of 0002 patch. The patch looks ready for committer. > > Reviewing 0002: Thanks for the review. > > T

Re: [HACKERS] foreign partition DDL regression tests

2017-03-08 Thread Amit Langote
On 2017/03/09 1:28, Robert Haas wrote: > On Tue, Feb 21, 2017 at 8:40 PM, Amit Langote > wrote: >> Ashutosh Bapat pointed out [0] that regression tests are missing for the >> foreign partition DDL commands. Attached patch takes care of that. > > Committed. Thanks. >

Re: [HACKERS] contrib modules and relkind check

2017-03-08 Thread Amit Langote
On 2017/03/09 11:51, Michael Paquier wrote: > On Wed, Mar 8, 2017 at 5:10 PM, Amit Langote > wrote: >> On 2017/03/08 16:47, Michael Paquier wrote: >>> Only regular tables are tested as valid objects. Testing toast tables >>> is not worth the complication. C

Re: [HACKERS] contrib modules and relkind check

2017-03-09 Thread Amit Langote
Hi Stephen, On 2017/03/10 6:48, Stephen Frost wrote: > Amit, Michael, > > * Amit Langote (langote_amit...@lab.ntt.co.jp) wrote: >> On 2017/03/09 11:51, Michael Paquier wrote: >>> OK, I am marking that as ready for committer. >> >> Thanks. > > Thanks fo

Re: [HACKERS] Partitioning vs ON CONFLICT

2017-03-09 Thread Amit Langote
On 2017/03/09 23:25, Robert Haas wrote: > On Fri, Feb 17, 2017 at 1:47 AM, Amit Langote wrote: >> I updated the patch. Now it's reduced to simply removing the check in >> transformInsertStmt() that prevented using *any* ON CONFLICT on >> partitioned tables at all.

Re: [HACKERS] Partitioning vs ON CONFLICT

2017-03-09 Thread Amit Langote
On 2017/03/10 9:10, Amit Langote wrote: > On 2017/03/09 23:25, Robert Haas wrote: >> On Fri, Feb 17, 2017 at 1:47 AM, Amit Langote wrote: >>> I updated the patch. Now it's reduced to simply removing the check in >>> transformInsertStmt() that prevented using *any

Re: [HACKERS] [PATCH] Teach Catalog.pm how many attributes there should be per DATA() line

2017-03-09 Thread Amit Langote
On 2017/03/10 9:14, Jeff Janes wrote: > On Thu, Mar 9, 2017 at 3:20 PM, Robert Haas > wrote: > > On Mon, Mar 6, 2017 at 11:37 AM, Dagfinn Ilmari Mannsåker > mailto:ilm...@ilmari.org>> wrote: > > David Christensen mailto:da...@endpoint.com>> > writes: >

Re: [HACKERS] Documentation improvements for partitioning

2017-03-09 Thread Amit Langote
On 2017/03/10 3:26, Robert Haas wrote: > I think you might have the titles for 0002 and 0003 backwards. Oops, you're right. > On Fri, Mar 3, 2017 at 2:51 AM, Amit Langote wrote: >> 0002: some cosmetic fixes to create_table.sgml > > I think this sentence may be

Re: [HACKERS] postgres_fdw IMPORT SCHEMA and partitioned tables

2017-03-09 Thread Amit Langote
On 2017/03/10 10:26, Michael Paquier wrote: > On Thu, Mar 9, 2017 at 11:15 PM, Stephen Frost wrote: >> While reviewing Amit Langote's patch to handle partitioned tables >> properly in various contrib modules (mostly by throwing an error since >> things like pageinspect aren't going to work on the

[HACKERS] Bug in get_partition_for_tuple

2017-03-09 Thread Amit Langote
Just observed a crash due to thinko in the logic that handles NULL partition key. Absence of null-accepting partition in this case should have caused an error, instead the current code proceeds with comparison resulting in crash. create table p (a int, b char) partition by list (b); create table

Re: [HACKERS] Partitioned tables and relfilenode

2017-03-10 Thread Amit Langote
On 2017/03/08 22:36, Robert Haas wrote: > On Wed, Mar 8, 2017 at 5:36 AM, Amit Langote wrote: >>> -rel = mtstate->resultRelInfo->ri_RelationDesc; >>> +nominalRTE = rt_fetch(node->nominalRelation, estate->es_range_table); >>> +nomina

Re: [HACKERS] asynchronous execution

2017-03-12 Thread Amit Langote
On 2017/03/11 8:19, Corey Huinker wrote: > > On Thu, Feb 23, 2017 at 6:59 AM, Kyotaro HORIGUCHI > mailto:horiguchi.kyot...@lab.ntt.co.jp>> > wrote: > > 9e43e87 > > > Patch fails on current master, but correctly applies to 9e43e87. Thanks > for including the commit id. > > Regression tests

Re: [HACKERS] Bug in get_partition_for_tuple

2017-03-12 Thread Amit Langote
Hi Jeevan, On 2017/03/13 14:31, Jeevan Ladhe wrote: > Hi Amit, > > I was able to reproduce the crash, and with the attached patch the crash > goes > away. Also, "make check-world" passes clean. > > Patch looks good to me. Thanks for the review. > However, In following comment in your test: >

Re: [HACKERS] Partitioned tables and relfilenode

2017-03-13 Thread Amit Langote
On 2017/03/10 17:57, Amit Langote wrote: > On 2017/03/08 22:36, Robert Haas wrote: >> On Wed, Mar 8, 2017 at 5:36 AM, Amit Langote wrote: >>>> -rel = mtstate->resultRelInfo->ri_RelationDesc; >>>> +nominalRTE = rt_fetch(node->nominalRelation, est

Re: [HACKERS] Partitioned tables and relfilenode

2017-03-13 Thread Amit Langote
On 2017/03/13 19:24, Amit Langote wrote: > On 2017/03/10 17:57, Amit Langote wrote: >> On 2017/03/08 22:36, Robert Haas wrote: >>> On Wed, Mar 8, 2017 at 5:36 AM, Amit Langote wrote: >>>>> -rel = mtstate->resultRelInfo->ri_RelationDesc; >>>>

Re: [HACKERS] asynchronous execution

2017-03-13 Thread Amit Langote
On 2017/03/14 6:31, Corey Huinker wrote: > On Mon, Mar 13, 2017 at 1:06 AM, Corey Huinker > wrote: > >> >>> I think it will, because Append itself has been made async-capable by one >>> of the patches and UNION ALL uses Append. But as mentioned above, only >>> the postgres_fdw foreign tables wil

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

2017-03-13 Thread Amit Langote
On 2017/03/14 9:17, Robert Haas wrote: > On Mon, Mar 13, 2017 at 3:24 PM, Robert Haas wrote: >> Haven't looked at 0007 yet. > > Overall this one looks pretty good and straightforward. In the following code of find_partition_scheme(): + /* Did not find matching partition scheme. Create one

Re: [HACKERS] asynchronous execution

2017-03-13 Thread Amit Langote
On 2017/03/14 10:08, Corey Huinker wrote: >> I don't think the plan itself will change as a result of applying this >> patch. You might however be able to observe some performance improvement. > > I could see no performance improvement, even with 16 separate queries > combined with UNION ALL. Quer

Re: [HACKERS] Partitioned tables and relfilenode

2017-03-14 Thread Amit Langote
On 2017/03/13 19:30, Amit Langote wrote: >> Here is the updated patch. >> >> Since this patch proposes to avoid creating scan nodes for non-leaf tables >> in a partition tree, they won't be referenced anywhere in the resulting >> plan tree. So the executo

Re: [HACKERS] New procedural language

2017-03-14 Thread Amit Langote
Hi, On 2017/03/15 11:08, Massimo Fidanza wrote: > Hello, > > what it means to add a new procedural language such as Go or Rust? I think you're looking for how to write a "PL function call handler", most likely in C. See for example how plpython_call_handler() is defined in src/pl/plpython/plpy_

Re: [HACKERS] Partitioned tables and relfilenode

2017-03-14 Thread Amit Langote
On 2017/03/15 13:38, Ashutosh Bapat wrote: > On Wed, Mar 15, 2017 at 3:39 AM, Robert Haas wrote: >> On Mon, Mar 13, 2017 at 6:24 AM, Amit Langote >> wrote: >>> The previous proposal was for expand_inherited_rtentry to not create RT >>> entries and AppendRelInfo

Re: [HACKERS] New procedural language

2017-03-15 Thread Amit Langote
Hi, On 2017/03/15 16:20, Massimo Fidanza wrote: > Il 15 mar 2017 3:52 AM, "Amit Langote" ha > scritto: >> On 2017/03/15 11:08, Massimo Fidanza wrote: >>> Hello, >>> >>> what it means to add a new procedural language such as Go or Rust? >> &g

Re: [HACKERS] Partitioned tables and relfilenode

2017-03-16 Thread Amit Langote
On 2017/03/15 7:09, Robert Haas wrote: > On Mon, Mar 13, 2017 at 6:24 AM, Amit Langote > wrote: >> The previous proposal was for expand_inherited_rtentry to not create RT >> entries and AppendRelInfo's for the non-leaf tables, but I think that >> doesn't work

Re: [HACKERS] Partitioned tables and relfilenode

2017-03-17 Thread Amit Langote
On 2017/03/16 22:16, Robert Haas wrote: > On Thu, Mar 16, 2017 at 6:03 AM, Amit Langote > wrote: >> I think we'll need to store *somewhere* the mapping of which inh=false >> partitioned table RTE is the child of which inh=true (IOW, parent) >> partitioned table RTE.

Re: [HACKERS] Asymmetry between parent and child wrt "false" quals

2017-03-21 Thread Amit Langote
On 2017/03/21 14:59, Ashutosh Bapat wrote: > When I run a query like below on a child-less table, the plan comes out to be > > explain verbose SELECT * FROM uprt1_l WHERE a = 1 AND a = 2; > QUERY PLAN > -

Re: GIN pending list pages not recycled promptly (was Re: [HACKERS] GIN improvements part 1: additional information)

2014-06-18 Thread Amit Langote
On Wed, Jan 22, 2014 at 9:12 PM, Heikki Linnakangas wrote: > On 01/22/2014 03:39 AM, Tomas Vondra wrote: >> >> What annoys me a bit is the huge size difference between the index >> updated incrementally (by a sequence of INSERT commands), and the index >> rebuilt from scratch using VACUUM FULL. It

Re: [HACKERS] Proposal for CSN based snapshots

2014-06-19 Thread Amit Langote
Hi, On Fri, Jun 13, 2014 at 7:24 PM, Heikki Linnakangas wrote: > Yeah, that seems like a better design, after all. > > Attached is a new patch. It now keeps the current pg_clog unchanged, but > adds a new pg_csnlog besides it. pg_csnlog is more similar to pg_subtrans > than pg_clog: it's not WAL-

[HACKERS] makeAndExpr(), etc. confined to gram.y?

2014-06-24 Thread Amit Langote
Hi, A recent commit titled "Avoid recursion when processing simple lists of AND'ed or OR'ed clauses." (2146f13408cdb85c738364fe8f7965209e08c6be) got rid of AEXPR_AND, etc. and instead created makeAndExpr(), etc. in gram.y Is there a reason why they've been left out of makefuncs.h/makefuncs.c? Per

Re: [HACKERS] makeAndExpr(), etc. confined to gram.y?

2014-06-25 Thread Amit Langote
On Wed, Jun 25, 2014 at 1:27 PM, Tom Lane wrote: > Amit Langote writes: >> Is there a reason why they've been left out of >> makefuncs.h/makefuncs.c? Perhaps they are not supposed to be used >> outside gram.y at all? For example, previously a caller (potentially) &g

Re: [HACKERS] makeAndExpr(), etc. confined to gram.y?

2014-06-25 Thread Amit Langote
On Thu, Jun 26, 2014 at 12:46 AM, Tom Lane wrote: > Amit Langote writes: >> Yeah, that is true. Sorry, I am unaware as to how generic make* >> functions in gram.y are and how they differ from those in makefuncs.c. > >> So, use of make* family of functions outside parser i

Re: [HACKERS] Partitioned tables and relfilenode

2017-03-21 Thread Amit Langote
On 2017/03/21 1:16, Robert Haas wrote: > On Fri, Mar 17, 2017 at 4:57 AM, Amit Langote > wrote: >>> Yes, but on the flip side, you're having to add code in a lot of >>> places -- I think I counted 7 -- where you turn around and ignore >>> those AppendRelIn

Re: [HACKERS] Bug in get_partition_for_tuple

2017-03-22 Thread Amit Langote
On 2017/03/13 14:41, Amit Langote wrote: > On 2017/03/13 14:31, Jeevan Ladhe wrote: >> However, In following comment in your test: >> >> -- check routing error through a list partitioned table when they key is >> null >> >> I think you want to say: >

Re: [HACKERS] Partitioned tables and relfilenode

2017-03-22 Thread Amit Langote
> On Tue, Mar 21, 2017 at 10:37 AM, Robert Haas wrote: >> On Tue, Mar 21, 2017 at 9:49 AM, Robert Haas wrote: >>> On Tue, Mar 21, 2017 at 5:05 AM, Amit Langote >>> wrote: >>>> Attached updated patches. >>> >>> Committed 0001 after remov

Re: [HACKERS] UPDATE of partition key

2017-03-22 Thread Amit Langote
Hi Amit, Thanks for the updated patch. On 2017/03/23 3:09, Amit Khandekar wrote: > Attached is v2 patch which implements the above optimization. Would it be better to have at least some new tests? Also, there are a few places in the documentation mentioning that such updates cause error, which

Re: [HACKERS] Partitioned tables and relfilenode

2017-03-23 Thread Amit Langote
Hi, On Thu, Mar 23, 2017 at 11:27 PM, Maksim Milyutin wrote: > Hi! > > I have noticed that there is scheduled unlinking of nonexistent physical > storage under partitioned table when we execute DROP TABLE statement on this > partitioned table. Though this action doesn't generate any error under >

Re: [HACKERS] Partitioned tables and relfilenode

2017-03-23 Thread Amit Langote
On 2017/03/23 23:47, Amit Langote wrote: > On Thu, Mar 23, 2017 at 11:27 PM, Maksim Milyutin > wrote: >> Hi! >> >> I have noticed that there is scheduled unlinking of nonexistent physical >> storage under partitioned table when we execute DROP TABLE statement on thi

<    1   2   3   4   5   6   7   8   9   10   >