Re: [HACKERS] Let file_fdw access COPY FROM PROGRAM

2016-09-11 Thread Amit Langote
On 2016/09/11 8:04, Corey Huinker wrote: > V2 of this patch: > > Changes: > * rebased to most recent master > * removed non-tap test that assumed the existence of Unix sed program > * added non-tap test that assumes the existence of perl > * switched from filename/program to filename/is_program to

Re: [HACKERS] pgbench - allow to store select results into variables

2016-09-12 Thread Amit Langote
Hi Fabien, On 2016/09/07 23:01, Fabien COELHO wrote: >> Custom script looks like: >> >> \; >> select a \into a >>from tab where a = 1; >> \set i debug(:a) >> >> I get the following error: >> >> undefined variable "a" >> client 0 aborted in state 1; execution of meta-command failed > > Good ca

Re: [HACKERS] Let file_fdw access COPY FROM PROGRAM

2016-09-12 Thread Amit Langote
On 2016/09/13 2:01, Corey Huinker wrote: > Thanks for the review! > > I agree with all the code cleanups suggested and have made then in the > attached patch, to save the committer some time. Thanks. Have already marked the patch as ready for the committer. > Also in this patch, I changed sgml

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

2016-09-12 Thread Amit Langote
On 2016/09/09 18:47, Ashutosh Bapat wrote: > A related change is renaming RangeBound structure in Amit > Langote's patches to PartitionRangeBound to avoid name conflict with > rangetypes.h. That change too should vanish once we decide where to keep > that structure and its final name. This change

[HACKERS] Comment typo in execIndexing.c

2016-09-13 Thread Amit Langote
Spotted a typo in the header comment of execIndexing.c. Attached fixes it. s/exclusive constraints/exclusion constraints/g Thanks, Amit diff --git a/src/backend/executor/execIndexing.c b/src/backend/executor/execIndexing.c index 0e2d834..009c1b7 100644 --- a/src/backend/executor/execIndexing.c +

Re: [HACKERS] pgbench - allow to store select results into variables

2016-09-14 Thread Amit Langote
Hi Fabien, On 2016/09/13 17:41, Fabien COELHO wrote: > > Hello Amit, > >> [...] >> There still seems to be a change in behavior of the -r option due to the >> patch. Consider the following example: >> >> select a from a where a = 1 \; >> select a+1 from a where a = 1; >> ... >> - statement laten

Re: [HACKERS] Printing bitmap objects in the debugger

2016-09-14 Thread Amit Langote
On 2016/09/15 0:04, Tom Lane wrote: > Alvaro Herrera writes: >> I don't understand. Why don't you just use "call pprint(the bitmapset)" >> in the debugger? > > Bitmapsets aren't Nodes, so pprint doesn't work directly on them. > I usually find that I can pprint some node containing the value(s) >

Re: [HACKERS] Declarative partitioning - another take

2016-09-18 Thread Amit Langote
On Thu, Sep 15, 2016 at 10:07 PM, Robert Haas wrote: > On Thu, Sep 15, 2016 at 4:53 AM, Amit Langote > wrote: >> Wow, this is bad. What is needed in this case is "canonicalization" of >> the range partition bounds specified in the command. > > I think we sho

Re: [HACKERS] pgbench - allow to store select results into variables

2016-09-26 Thread Amit Langote
Hi Fabien, I am marking the pgbench-into-5.patch [1] as "Ready for Committer" as I have no further comments at the moment. Thanks, Amit [1] https://www.postgresql.org/message-id/alpine.DEB.2.20.1609130730380.10870%40lancre -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org

Re: [HACKERS] Declarative partitioning - another take

2016-09-26 Thread Amit Langote
Hi Ashutosh, On 2016/09/22 14:42, Ashutosh Bapat wrote: > Hi Amit, > Following sequence of DDLs gets an error > -- > -- multi-leveled partitions > -- > CREATE TABLE prt1_l (a int, b int, c varchar) PARTITION BY RANGE(a); > CREATE TABLE prt1_l_p1 PARTITION OF prt1_l FOR VALUES START (0) END > (250

Re: [HACKERS] pgbench - allow to store select results into variables

2016-09-26 Thread Amit Langote
On 2016/09/26 16:12, Amit Langote wrote: > I am marking the pgbench-into-5.patch [1] as "Ready for Committer" as I > have no further comments at the moment. Wait... Heikki's latest commit now requires this patch to be rebased. commit 12788ae49e1933f463bc59a6efe46c4a01

Re: [HACKERS] pgbench - allow to store select results into variables

2016-09-26 Thread Amit Langote
On 2016/09/26 20:27, Fabien COELHO wrote: > > Hello Amit, > >>> I am marking the pgbench-into-5.patch [1] as "Ready for Committer" as I >>> have no further comments at the moment. >> >> Wait... Heikki's latest commit now requires this patch to be rebased. > > Indeed. Here is the rebased version,

Re: [HACKERS] Declarative partitioning - another take

2016-09-26 Thread Amit Langote
On 2016/09/22 19:10, Ashutosh Bapat wrote: > On Thu, Sep 22, 2016 at 1:02 PM, Ashutosh Bapat > wrote: >> For list partitions, the ListInfo stores the index maps for values >> i.e. the index of the partition to which the value belongs. Those >> indexes are same as the indexes in partition OIDs arra

Re: [HACKERS] Declarative partitioning - another take

2016-09-27 Thread Amit Langote
Sorry about the delay in replying. On 2016/09/15 21:58, Ashutosh Bapat wrote: > Hi Amit, > > It looks like there is some problem while creating paramterized paths > for multi-level partitioned tables. Here's a longish testcase > > [ ... ] > > Please check if you are able to reproduce these err

Re: [HACKERS] Declarative partitioning - another take

2016-09-27 Thread Amit Langote
On 2016/09/27 15:44, Ashutosh Bapat wrote: >> By the way, I fixed one thinko in your patch as follows: >> >> -result->oids[i] = oids[mapping[i]]; >> +result->oids[mapping[i]] = oids[i]; > > While I can not spot any problem with this logic, when I make that > change and run partitio

Re: [HACKERS] Declarative partitioning - another take

2016-09-27 Thread Amit Langote
On 2016/09/27 18:09, Ashutosh Bapat wrote: >>> I tried to debug the problem somewhat. In set_append_rel_pathlist(), >>> it finds that at least one child has a parameterized path as the >>> cheapest path, so it doesn't create an unparameterized path for append >>> rel. At the same time there is a pa

Re: [HACKERS] Some information about the small portion of source code of postgreSQL

2016-09-27 Thread Amit Langote
On 2016/09/28 13:30, Ashutosh Bapat wrote: > This mail looks exactly same as that from Shrinivas. Please check answers > there. Here is a link to the discussion thread that Ashutosh is referring to: https://www.postgresql.org/message-id/flat/CAFjFpRfxJJJGNhtQaS2CQ7Boyfo88nu-45JcNKeREUbQUPxOEw%40

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

2017-10-03 Thread Amit Langote
On 2017/10/04 4:27, Robert Haas wrote: > On Tue, Oct 3, 2017 at 8:57 AM, Ashutosh Bapat > wrote: >>> Regarding nomenclature and my previous griping about wisdom, I was >>> wondering about just calling this a "partition join" like you have in >>> the regression test. So the GUC would be enable_par

Re: [HACKERS] Optimise default partition scanning while adding new partition

2017-10-05 Thread Amit Langote
On 2017/10/06 2:25, Robert Haas wrote: > On Tue, Sep 26, 2017 at 4:27 AM, Amit Langote wrote: >> I guess we don't need to squash, as they could be seen as implementing >> different features. Reordering the patches helps though. So, apply them >> in this order:

Re: [HACKERS] v10 bottom-listed

2017-10-05 Thread Amit Langote
On 2017/10/05 22:28, Erik Rijkers wrote: > In the 'ftp' listing, v10 appears at the bottom: >   https://www.postgresql.org/ftp/source/ > > With all the other v10* directories at the top, we could get a lot of > people installing wrong binaries... > > Maybe it can be fixed so that it appears at th

Re: [HACKERS] [POC] hash partitioning

2017-10-11 Thread Amit Langote
On 2017/09/30 1:53, Robert Haas wrote: > On Thu, Sep 28, 2017 at 1:54 AM, Amit Langote > wrote: >> I looked into how satisfies_hash_partition() works and came up with an >> idea that I think will make constraint exclusion work. What if we emitted >> the hash partition con

Re: [HACKERS] Optimise default partition scanning while adding new partition

2017-10-12 Thread Amit Langote
On 2017/10/13 4:18, Robert Haas wrote: > On Thu, Oct 5, 2017 at 9:29 PM, Amit Langote > wrote: >> Attached a patch to modify the INFO messages in check_default_allows_bound. > > Committed. However, I didn't see a reason to adopt the comment change > you proposed, so I

Re: [HACKERS] UPDATE of partition key

2017-10-12 Thread Amit Langote
On 2017/10/13 6:18, Robert Haas wrote: > Is anybody still reviewing the main patch here? (It would be good if > the answer is "yes".) I am going to try to look at the latest version over the weekend and early next week. Thanks, Amit -- Sent via pgsql-hackers mailing list (pgsql-hackers@postg

Re: [HACKERS] v10 bottom-listed

2017-10-15 Thread Amit Langote
On 2017/10/13 22:58, Magnus Hagander wrote: > On Fri, Oct 6, 2017 at 3:59 AM, Amit Langote > wrote: > >> On 2017/10/05 22:28, Erik Rijkers wrote: >>> In the 'ftp' listing, v10 appears at the bottom: >>> https://www.postgresql.org/ftp/source/ >>

Re: [HACKERS] UPDATE of partition key

2017-10-15 Thread Amit Langote
Hi Amit. On 2017/10/04 22:51, Amit Khandekar wrote: > Main patch : > update-partition-key_v20.patch Guess you're already working on it but the patch needs a rebase. A couple of hunks in the patch to execMain.c and nodeModifyTable.c fail. Meanwhile a few comments: +void +pull_child_partition_co

Re: [HACKERS] relkind check in DefineIndex

2017-10-15 Thread Amit Langote
On 2017/10/14 4:32, Robert Haas wrote: > On Fri, Oct 13, 2017 at 12:38 PM, Alvaro Herrera > wrote: >> The relkind check in DefineIndex has grown into an ugly rats nest of >> 'if' statements. I propose to change it into a switch, as per the >> attached. > > wfm +1 Thanks, Amit -- Sent via p

[HACKERS] alter table doc fix

2017-10-17 Thread Amit Langote
Hi. Noticed that a alter table sub-command's name in Description (where it's OWNER) differs from that in synopsis (where it's OWNER TO). Attached patch to make them match, if the difference is unintentional. Thanks, Amit diff --git a/doc/src/sgml/ref/alter_table.sgml b/doc/src/sgml/ref/alter_ta

Re: [HACKERS] [COMMITTERS] pgsql: Implement table partitioning.

2017-10-17 Thread Amit Langote
On 2017/10/18 1:52, Alvaro Herrera wrote: > Alvaro Herrera wrote: >> Robert Haas wrote: >>> Implement table partitioning. >> >> Is it intentional that you can use ALTER TABLE OWNER TO on the parent >> table, and that this does not recurse to modify the partitions' owners? >> This doesn't seem to be

Re: [HACKERS] Block level parallel vacuum WIP

2017-10-22 Thread Amit Langote
On 2017/10/22 5:25, Thomas Munro wrote: > On Sun, Oct 22, 2017 at 5:09 AM, Robert Haas wrote: >> On Tue, Sep 19, 2017 at 3:31 AM, Masahiko Sawada >> wrote: Down at the bottom of the build log in the regression diffs file you can see: ! ERROR: cache lookup failed for relation

Re: [HACKERS] alter table doc fix

2017-10-22 Thread Amit Langote
On 2017/10/18 20:37, Alvaro Herrera wrote: > Amit Langote wrote: >> Hi. >> >> Noticed that a alter table sub-command's name in Description (where it's >> OWNER) differs from that in synopsis (where it's OWNER TO). Attached >> patch to make them m

Re: [HACKERS] [sqlsmith] Failed assertion in adjust_appendrel_attrs_mutator

2017-10-23 Thread Amit Langote
On 2017/10/23 2:07, Tom Lane wrote: > Andreas Seltenreich writes: >> testing master as of 7c981590c2, sqlsmith just triggered the following >> assertion: >> TRAP: FailedAssertion("!(!const Node*)(node))->type) == T_SubLink))", >> File: "prepunion.c", Line: 2231) > > Hmm. adjust_appendrel_at

Re: [HACKERS] Proposal: Local indexes for partitioned table

2017-10-23 Thread Amit Langote
On 2017/10/24 1:15, Alvaro Herrera wrote: > Robert Haas wrote: >> On Mon, Oct 23, 2017 at 11:12 AM, Alvaro Herrera >> wrote: >>> I started with Maksim's submitted code, and developed according to the >>> ideas discussed in this thread. Attached is a very WIP patch series for >>> this feature. Ni

Re: [HACKERS] [sqlsmith] Failed assertion in adjust_appendrel_attrs_mutator

2017-10-23 Thread Amit Langote
On 2017/10/24 0:22, Tom Lane wrote: > Amit Langote writes: >> On 2017/10/23 2:07, Tom Lane wrote: >>> Hmm. adjust_appendrel_attrs() thinks it's only used after conversion >>> of sublinks to subplans, but this is a counterexample. I wonder if >>> that

Re: [HACKERS] path toward faster partition pruning

2017-10-26 Thread Amit Langote
On 2017/10/26 20:34, Robert Haas wrote: > On Thu, Oct 26, 2017 at 1:17 PM, Amit Langote > wrote: >> It can perhaps taught to not make that conclusion by taking into account >> the default partition's partition constraint, which includes constraint >> inherited fr

Re: [HACKERS] path toward faster partition pruning

2017-10-26 Thread Amit Langote
On 2017/10/27 13:57, Robert Haas wrote: > On Fri, Oct 27, 2017 at 3:17 AM, Amit Langote > wrote: >>> I don't think we really want to get into theorem-proving here, because >>> it's slow. >> >> Just to be clear, I'm saying we could use theorem-pr

Re: [HACKERS] path toward faster partition pruning

2017-10-31 Thread Amit Langote
Thanks for the test case. On 2017/10/30 17:09, Rajkumar Raghuwanshi wrote: > I am getting wrong output when default is sub-partitioned further, below is > a test case. > > CREATE TABLE lpd(a int, b varchar, c float) PARTITION BY LIST (a); > CREATE TABLE lpd_p1 PARTITION OF lpd FOR VALUES IN (1,2,

Re: [HACKERS] Adding column_constraint description in ALTER TABLE synopsis

2017-10-31 Thread Amit Langote
On 2017/10/31 21:31, Stephen Frost wrote: > * Lætitia Avrot (laetitia.av...@gmail.com) wrote: >> As Amit Langot pointed out, the column_constraint definition is missing >> whereas it is used in ALTER TABLE synopsis. It can be easily found in the >> CREATE TABLE synopsis, but it's not very user frie

Re: [HACKERS] UPDATE of partition key

2017-11-02 Thread Amit Langote
Hi Amit. Thanks a lot for updated patches and sorry that I couldn't get to looking at your emails sooner. Note that I'm replying here to both of your emails, but looking at only the latest v22 patch. On 2017/10/24 0:15, Amit Khandekar wrote: > On 16 October 2017 at 08:28, Amit Lang

Re: [HACKERS] Setting pd_lower in GIN metapage

2017-11-05 Thread Amit Langote
On 2017/11/03 6:24, Tom Lane wrote: > Amit Langote writes: >> On 2017/09/26 16:30, Michael Paquier wrote: >>> Cool, let's switch it back to a ready for committer status then. > >> Sure, thanks. > > Pushed with some cosmetic adjustments --- mostly, making

Re: [HACKERS] dropping partitioned tables without CASCADE

2017-11-05 Thread Amit Langote
On 2017/11/03 21:39, Alvaro Herrera wrote: > Ashutosh Bapat wrote: >> On Fri, Nov 3, 2017 at 1:42 PM, Alvaro Herrera >> wrote: > >>> I think adding "is partitioned" at end of line isn't good; looks like a >>> phrase but isn't translatable. Maybe add keyword PARTITIONED instead? >> >> In that ca

Re: [Sender Address Forgery]Re: [HACKERS] path toward faster partition pruning

2017-11-05 Thread Amit Langote
On 2017/11/06 12:53, David Rowley wrote: > On 3 November 2017 at 17:32, David Rowley > wrote: >> 2. This code is way more complex than it needs to be. >> >> if (num_parts > 0) >> { >> int j; >> >> all_indexes = (int *) palloc(num_parts * sizeof(int)); >> j = 0; >> if (min_part_idx >= 0 && max_par

Re: [Sender Address Forgery]Re: [HACKERS] path toward faster partition pruning

2017-11-06 Thread Amit Langote
On 2017/11/06 13:15, David Rowley wrote: > On 31 October 2017 at 21:43, Amit Langote > wrote: >> Attached updated version of the patches > > match_clauses_to_partkey() needs to allow for the way quals on Bool > columns are represented. > > create table pt (a bool not

Re: [Sender Address Forgery]Re: [HACKERS] path toward faster partition pruning

2017-11-06 Thread Amit Langote
On 2017/11/06 21:52, David Rowley wrote: > On 6 November 2017 at 23:01, Amit Langote > wrote: >> OK, I have gotten rid of the min/max partition index interface and instead >> adopted the bms_add_range() approach by including your patch to add the >> same in the patch s

Re: [HACKERS] UPDATE of partition key

2017-11-06 Thread Amit Langote
On 2017/11/07 14:40, Amit Khandekar wrote: > On 7 November 2017 at 00:33, Robert Haas wrote: > >> Also, +1 for Amit Langote's idea of trying to merge >> mt_perleaf_childparent_maps with mt_persubplan_childparent_maps. > > Currently I am trying to see if it simplifies things if we do that. We > w

Re: [Sender Address Forgery]Re: [HACKERS] path toward faster partition pruning

2017-11-07 Thread Amit Langote
Hi David. Thanks for the review. (..also looking at the comments you sent earlier today.) On 2017/11/07 11:14, David Rowley wrote: > On 7 November 2017 at 01:52, David Rowley > wrote: >> Thanks. I'll look over it all again starting my Tuesday morning. (UTC+13) > > I have a little more review

Re: [HACKERS] path toward faster partition pruning

2017-11-08 Thread Amit Langote
Hi Rajkumar, Thanks for testing. On 2017/11/08 15:52, Rajkumar Raghuwanshi wrote: > On Mon, Nov 6, 2017 at 3:31 PM, Amit Langote > wrote: > >> Attached updated set of patches, including the fix to make the new pruning >> code handle Boolean partitioning. >> >

Re: [HACKERS] [PATCH] fix wrong create table statement in documentation

2017-11-08 Thread Amit Langote
On 2017/11/09 7:21, Tom Lane wrote: > jotpe writes: >> In the current documentation [1] this create table statement is listed: >> CREATE TABLE measurement_y2008m01 PARTITION OF measurement >> FOR VALUES FROM ('2008-01-01') TO ('2008-02-01') >> TABLESPACE fasttablespace >> WITH (para

Re: [HACKERS] path toward faster partition pruning

2017-11-09 Thread Amit Langote
Hi Amul. On 2017/11/09 20:05, amul sul wrote: > On Mon, Nov 6, 2017 at 3:31 PM, Amit Langote > wrote: >> On 2017/11/06 14:32, David Rowley wrote: >>> On 6 November 2017 at 17:30, Amit Langote wrote: >>>> On 2017/11/03 13:32, David Rowley wrote: >>>&g

Re: [HACKERS] path toward faster partition pruning

2017-11-13 Thread Amit Langote
Horiguchi-san, Thanks for taking a look. Replying to all your emails here. On 2017/11/10 12:30, Kyotaro HORIGUCHI wrote: > In 0002, bms_add_range has a bit naive-looking loop > > + while (wordnum <= uwordnum) > + { > + bitmapword mask = (bitmapword) ~0; > + > + /

Re: [HACKERS] Declarative partitioning - another take

2016-10-02 Thread Amit Langote
On 2016/10/03 13:26, Michael Paquier wrote: > On Fri, Sep 30, 2016 at 9:10 AM, Robert Haas wrote: >> On Thu, Sep 29, 2016 at 8:09 AM, Amit Langote >> wrote: >>> I removed DEPENDENCY_IGNORE. Does the following look good or am I still >>> missing something? >

[HACKERS] Un-include access/heapam.h

2016-10-03 Thread Amit Langote
I noticed that un-including access/heapam.h from the following files leaves things just fine. src/backend/commands/aggregatecmds.c src/backend/commands/collationcmds.c src/backend/commands/conversioncmds.c src/backend/commands/lockcmds.c It seems any calls into heapam.c that there used to be have

Re: [HACKERS] Transactions involving multiple postgres foreign servers

2016-10-03 Thread Amit Langote
Hi, On 2016/10/04 13:26, Ashutosh Bapat wrote: >>> >>> Why always rollback any dangling transaction? There can be a case that >>> a foreign server has a dangling transaction which needs to be >>> committed because the portions of that transaction on the other shards >>> are committed. >> >> Right

Re: [HACKERS] Transactions involving multiple postgres foreign servers

2016-10-04 Thread Amit Langote
On 2016/10/04 16:10, Ashutosh Bapat wrote: >>> Heuristics can not become the default behavior. A user should be given >>> an option to choose a heuristic, and he should be aware of the >>> pitfalls when using this heuristic. I guess, first, we need to get a >>> solution which ensures that the trans

Re: [HACKERS] Aggregation push down, reorder of join and group by

2016-10-04 Thread Amit Langote
Hi, On 2016/10/05 14:19, Chenxi Li wrote: > Hello, > > I'm reading some papers about aggregation push down like in " > https://ub-madoc.bib.uni-mannheim.de/37228/1/main.pdf"; and " > http://www.vldb.org/conf/1995/P345.PDF";. I think it is very useful but very > complex to implement. In some comp

Re: [HACKERS] Declarative partitioning - another take

2016-10-05 Thread Amit Langote
Hi, On 2016/10/05 16:57, Rajkumar Raghuwanshi wrote: > I observed, when creating foreign table with range partition, data is not > inserting into specified partition range. below are steps to reproduce. > > [ ... ] > > postgres=# INSERT INTO test_range (a) values (5),(25),(15); > INSERT 0 3 >

Re: [HACKERS] Transactions involving multiple postgres foreign servers

2016-10-06 Thread Amit Langote
On 2016/10/06 17:45, Ashutosh Bapat wrote: > On Thu, Oct 6, 2016 at 1:34 PM, Masahiko Sawada wrote: >> On Thu, Oct 6, 2016 at 1:41 PM, Ashutosh Bapat >> wrote: My understanding is that basically the local server can not return COMMIT to the client until 2nd phase is completed. >>> >>>

Re: [HACKERS] postgres_fdw : altering foreign table not invalidating prepare statement execution plan.

2016-10-06 Thread Amit Langote
Thanks to both of you for taking this up and sorry about the delay in responding. On 2016/10/05 20:45, Etsuro Fujita wrote: > On 2016/10/05 14:09, Ashutosh Bapat wrote: >>> I think it would be a bit inefficient to use PlanCacheFuncCallback as the >>> inval callback function for those caches, beca

Re: [HACKERS] postgres_fdw : altering foreign table not invalidating prepare statement execution plan.

2016-10-06 Thread Amit Langote
On 2016/10/06 21:55, Etsuro Fujita wrote: > On 2016/10/06 20:17, Amit Langote wrote: >> On 2016/10/05 20:45, Etsuro Fujita wrote: >>> On 2016/10/05 14:09, Ashutosh Bapat wrote: >>>> IMO, maintaining that extra function and >>>> the risk of bugs because

[HACKERS] pg_dump getBlobs query broken for 7.3 servers

2016-10-06 Thread Amit Langote
Just noticed that the getBlobs() query does not work for a 7.3 server (maybe <= 7.3) due to the following change in commit 23f34fa4 [1]: else if (fout->remoteVersion >= 70100) appendPQExpBufferStr(blobQry, - "SELECT DISTINCT loid, NULL::oid, NULL::oid" +

Re: [HACKERS] pg_dump getBlobs query broken for 7.3 servers

2016-10-06 Thread Amit Langote
On 2016/10/07 11:47, Amit Langote wrote: > Just noticed that the getBlobs() query does not work for a 7.3 server > (maybe <= 7.3) due to the following change in commit 23f34fa4 [1]: > > else if (fout->remoteVersion >= 70100) > appe

Re: [HACKERS] Declarative partitioning - another take

2016-10-07 Thread Amit Langote
On 2016/10/07 18:27, Ashutosh Bapat wrote: > It's allowed to specify an non-default opclass in partition by clause, > but I do not see any testcase testing the same. Can you please add > one. OK, I will add some tests related to that. Thanks, Amit -- Sent via pgsql-hackers mailing list (pgsq

[HACKERS] Comment typo

2016-10-10 Thread Amit Langote
Attached fixes what seems like a copy-pasto in pg_cast.h. Thanks, Amit diff --git a/src/include/catalog/pg_cast.h b/src/include/catalog/pg_cast.h index ee568d8..04d11c0 100644 --- a/src/include/catalog/pg_cast.h +++ b/src/include/catalog/pg_cast.h @@ -59,7 +59,7 @@ typedef enum CoercionCodes /*

[HACKERS] int2vector and btree indexes

2016-10-10 Thread Amit Langote
If I create btree index on a int2vector column, it does not get used for queries because the query search always fails to match the index operator (family). During index creation, GetDefaultOpClass() returns array_ops for a int2vector index column, because type int2vector is binary-coercible with

Re: [HACKERS] int2vector and btree indexes

2016-10-11 Thread Amit Langote
On 2016/10/11 15:58, Amit Langote wrote: > If I create btree index on a int2vector column, it does not get used for > queries because the query search always fails to match the index operator > (family). > > During index creation, GetDefaultOpClass() returns array_ops for a >

Re: [HACKERS] int2vector and btree indexes

2016-10-11 Thread Amit Langote
On 2016/10/11 21:40, Tom Lane wrote: > Amit Langote writes: >> I was wrong that the index *never* gets used. It does in fact get used if >> the operator is an ordering search operator (<, <=, >, >=), in which case >> the query would use an array_ops operator

[HACKERS] Conflicting constraint being merged

2016-10-12 Thread Amit Langote
Currently, if child table has a non-inherited constraint and a constraint with the same name is added to the parent, it will fail with an error as illustrated below: create table parent (a int); CREATE TABLE create table child (constraint check_a check (a > 0) no inherit) inherits (parent); CREATE

Re: [HACKERS] Comment typo

2016-10-12 Thread Amit Langote
On 2016/10/12 18:10, Heikki Linnakangas wrote: > On 10/11/2016 08:52 AM, Amit Langote wrote: >> Attached fixes what seems like a copy-pasto in pg_cast.h. > > Applied, thanks. Thanks, Heikki! Regards, Amit -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)

[HACKERS] Typo in foreign.h

2016-10-12 Thread Amit Langote
Attached fixes a minor typo: s/Thes/These/g Thanks, Amit diff --git a/src/include/foreign/foreign.h b/src/include/foreign/foreign.h index 5dc2c90..143566a 100644 --- a/src/include/foreign/foreign.h +++ b/src/include/foreign/foreign.h @@ -23,7 +23,7 @@ /* * Generic option types for validation.

Re: [HACKERS] Transactions involving multiple postgres foreign servers

2016-10-13 Thread Amit Langote
On 2016/10/13 19:37, Ashutosh Bapat wrote: >> In case we can not reach a foreign server during post-commit phase, >> basically the transaction and following transaction should stop until >> the crashed server revived. > > I have repeatedly given reasons why this is not correct. You and Amit > seem

Re: [HACKERS] postgres_fdw : altering foreign table not invalidating prepare statement execution plan.

2016-10-18 Thread Amit Langote
On 2016/10/19 12:20, Etsuro Fujita wrote: > Having said that, I like the latest version (v6), so I'd vote for marking > this as Ready For Committer. +1, thanks a lot! Regards, Amit -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: htt

Re: [HACKERS] Declarative partitioning - another take

2016-10-25 Thread Amit Langote
Thanks for the review! On 2016/10/25 20:32, Amit Kapila wrote: > On Thu, Oct 6, 2016 at 12:44 PM, Amit Langote > wrote: >> On 2016/10/05 2:12, Robert Haas wrote: > >> Attached revised patches. > > Few assorted review comments for 0001-Catalog*: > > > 1.

Re: [HACKERS] Declarative partitioning - another take

2016-10-25 Thread Amit Langote
On 2016/10/25 15:58, Amit Kapila wrote: > On Thu, Oct 6, 2016 at 12:44 PM, Amit Langote > wrote: >> On 2016/10/05 2:12, Robert Haas wrote: >>> Hmm, do we ever fire triggers on the parent for operations on a child >>> table? Note this thread, which seems po

Re: [HACKERS] Declarative partitioning - another take

2016-10-25 Thread Amit Langote
On 2016/10/26 11:41, Amit Kapila wrote: > On Wed, Oct 26, 2016 at 6:36 AM, Amit Langote > wrote: >>> 1. >>> @@ -1775,6 +1775,12 @@ BeginCopyTo(ParseState *pstate, >>> { >>> .. >>> + else if (rel->rd_rel->relkind == RELKI

Re: [HACKERS] Declarative partitioning - another take

2016-10-25 Thread Amit Langote
On 2016/10/26 12:09, Amit Kapila wrote: > On Wed, Oct 26, 2016 at 8:27 AM, Amit Langote > wrote: >> On 2016/10/26 11:41, Amit Kapila wrote: >>> On Wed, Oct 26, 2016 at 6:36 AM, Amit Langote >>> wrote: >>>> >>>> Sure, CopyTo() can be be taught

Re: [HACKERS] Declarative partitioning - another take

2016-10-26 Thread Amit Langote
On 2016/10/26 17:57, Amit Kapila wrote: > @@ -123,6 +123,9 @@ typedef struct RelationData > { > .. > MemoryContext rd_partkeycxt; /* private memory cxt for the below */ > struct PartitionKeyData *rd_partkey; /* partition key, or NULL */ > + MemoryContext rd_pdcxt; /* private context for partdes

Re: [HACKERS] Declarative partitioning - another take

2016-10-26 Thread Amit Langote
On 2016/10/27 3:13, Robert Haas wrote: > On Tue, Oct 25, 2016 at 9:06 PM, Amit Langote > wrote: >> I will include these changes in the next version of patches I will post >> soon in reply to [1]. >> [1] >> https://www.postgresql.org/message-id/CA%2BTgmoYJcUTcN7vVgg54

Re: [HACKERS] Declarative partitioning - another take

2016-11-01 Thread Amit Langote
On 2016/11/02 2:53, Robert Haas wrote: > On Fri, Oct 28, 2016 at 3:53 AM, Amit Langote > wrote: >> [ new patches ] > > Reviewing 0005: > > Your proposed commit messages says this: > >> If relation is the target table (UPDATE and DELETE), flattening is >

Re: [HACKERS] Declarative partitioning - another take

2016-11-02 Thread Amit Langote
On 2016/11/02 2:34, Robert Haas wrote: > On Fri, Oct 28, 2016 at 3:53 AM, Amit Langote > wrote: >> [ new patches ] > > Reviewing 0006: Thanks for the review! > This patch seems scary. I sort of assumed from the title -- "Teach a > few places to use partition chec

Re: [HACKERS] Declarative partitioning - another take

2016-11-02 Thread Amit Langote
On 2016/11/02 16:41, Amit Langote wrote: > Having said all that, I am open to switching to the catalogued partition > constraints if the arguments I make above in favor of this patch are not > all that sound. One problem I didn't immediately see a solution for if we go with

Re: [HACKERS] Declarative partitioning - another take

2016-11-02 Thread Amit Langote
On 2016/11/02 2:44, Robert Haas wrote: > On Fri, Oct 28, 2016 at 3:53 AM, Amit Langote > wrote: >>> Insisting that you can't drop a child without detaching it first seems >>> wrong to me. If I already made this comment and you responded to it, >>> ple

Re: [HACKERS] Declarative partitioning - another take

2016-11-07 Thread Amit Langote
Hi Jaime, On 2016/11/08 2:24, Jaime Casanova wrote: > On 7 November 2016 at 12:15, Jaime Casanova > wrote: >> On 28 October 2016 at 02:53, Amit Langote >> wrote: >>> >>> Please find attached the latest version of the patches >> >> Hi, >>

Re: [HACKERS] Declarative partitioning - another take

2016-11-07 Thread Amit Langote
Hi Jaime, On 2016/11/08 2:15, Jaime Casanova wrote: > On 28 October 2016 at 02:53, Amit Langote > wrote: > > I started to review the functionality of this patch, so i applied all > 9 patches. After that i found this warning, which i guess is because > it needs a cast.

Re: [HACKERS] Do we need use more meaningful variables to replace 0 in catalog head files?

2016-11-09 Thread Amit Langote
On Wed, Nov 9, 2016 at 11:47 PM, Tom Lane wrote: > Michael Paquier writes: >> On Wed, Nov 9, 2016 at 1:44 PM, Tom Lane wrote: >>> I don't think we need "named constants", especially not >>> manually-maintained ones. The thing that would help in pg_proc.h is for >>> numeric type OIDs to be repla

Re: [HACKERS] Declarative partitioning - another take

2016-11-09 Thread Amit Langote
On 2016/11/10 2:00, Robert Haas wrote: > In this latest patch set: > > src/backend/parser/parse_utilcmd.c:3194: indent with spaces. > +*rdatum; This one I will fix. > > With all patches applied, "make check" fails with a bunch of diffs > that look like this:

Re: [HACKERS] Declarative partitioning - another take

2016-11-13 Thread Amit Langote
I forgot to quote your comments in the email I sent on Friday [1], with new patches that do take care of the following comments. On 2016/11/11 4:04, Robert Haas wrote: > On Thu, Nov 10, 2016 at 7:40 AM, Amit Langote >> >> OK, "partition key" and "partitioning me

Re: [HACKERS] Declarative partitioning - another take

2016-11-13 Thread Amit Langote
On 2016/11/04 0:49, Robert Haas wrote: > On Thu, Nov 3, 2016 at 7:46 AM, wrote: >> El 2016-10-28 07:53, Amit Langote escribió: >>> @@ -6267,6 +6416,12 @@ ATAddForeignKeyConstraint(AlteredTableInfo *tab, >>> Relation rel, >>> * Validity checks (per

Re: [HACKERS] Declarative partitioning - another take

2016-11-15 Thread Amit Langote
On 2016/11/11 20:49, Ashutosh Bapat wrote: > I have not looked at the latest set of patches, but in the version > that I have we create one composite type for every partition. This > means that if there are thousand partitions, there will be thousand > identical entries in pg_type. Since all the pa

Re: [HACKERS] Declarative partitioning - another take

2016-11-17 Thread Amit Langote
On 2016/11/18 1:43, Robert Haas wrote: > On Thu, Nov 17, 2016 at 6:27 AM, Amit Langote wrote: >> OK, I will share the performance results soon. > > Thanks. > >>> Also, in 0006: >>> >>> - I doubt that PartitionTreeNodeData's header comment will

Re: [HACKERS] Partitioned tables and relfilenode

2017-02-16 Thread Amit Langote
On 2017/02/15 16:14, Michael Paquier wrote: > On Fri, Feb 10, 2017 at 3:19 PM, 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 partitions. I

Re: [HACKERS] Partitioning vs ON CONFLICT

2017-02-16 Thread Amit Langote
On 2017/02/17 1:17, Peter Geoghegan wrote: > But surely it should be possible to use DO NOTHING without inferring some > particular unique index? That's possible with an approach based on > inheritance. Hmm. Code after the following comment fragment in ExecInsert(): * Do a non-concl

Re: [HACKERS] Partitioning vs ON CONFLICT

2017-02-16 Thread Amit Langote
On 2017/02/17 13:25, Peter Geoghegan wrote: > On Thu, Feb 16, 2017 at 8:21 PM, Amit Langote > wrote: >> would be working on a leaf partition chosen by tuple-routing after an >> insert on a partitioned table. The leaf partitions can very well have a >> unique inde

Re: [HACKERS] Partitioning vs ON CONFLICT

2017-02-16 Thread Amit Langote
On 2017/02/17 14:50, Peter Geoghegan wrote: > On Thu, Feb 16, 2017 at 9:27 PM, Amit Langote > wrote: >> Attached patch fixes that. Thom, your example query should not error out >> with the patch. As discussed here, DO UPDATE cannot be supported at the >> moment. >

Re: [HACKERS] Partitioned tables and relfilenode

2017-02-16 Thread Amit Langote
On 2017/02/16 23:40, Robert Haas wrote: > On Thu, Feb 16, 2017 at 6:32 AM, Simon Riggs wrote: >> Why not vacuum all partitions? >> Why not analyze all partitions? >> Truncate all partitions > > I agree. But, we need to be careful that a database-wide VACUUM or > ANALYZE doesn't hit the partition

[HACKERS] pg_dump emits ALTER TABLE ONLY partitioned_table

2017-02-17 Thread Amit Langote
In certain cases, pg_dump's dumpTableSchema() emits a separate ALTER TABLE command for those schema elements of a table that could not be included directly in the CREATE TABLE command for the table. For example: create table p (a int, b int) partition by range (a); create table p1 partition of p

[HACKERS] dropping partitioned tables without CASCADE

2017-02-19 Thread Amit Langote
Re-posting the patch I posted in a nearby thread [0]. On 2017/02/16 2:08, Robert Haas wrote: > On Wed, Feb 15, 2017 at 11:34 AM, Alvaro Herrera > wrote: >> I think new-style partitioning is supposed to consider each partition as >> an implementation detail of the table; the fact that you can mani

Re: [HACKERS] Documentation improvements for partitioning

2017-02-19 Thread Amit Langote
On 2017/02/20 1:04, Robert Haas wrote: > On Thu, Feb 16, 2017 at 12:43 PM, Amit Langote wrote: >> So I count more than a few votes saying that we should be able to DROP >> partitioned tables without specifying CASCADE. >> >> I tried to implement that using t

Re: [HACKERS] Partitioned tables and relfilenode

2017-02-19 Thread Amit Langote
On 2017/02/20 5:31, Simon Riggs wrote: > On 16 February 2017 at 11:32, Simon Riggs wrote: >> On 10 February 2017 at 06:19, Amit Langote >> wrote: >> >>> the "right thing" here being that the >>> command's code either throws an error or w

Re: [HACKERS] tab completion for partitioning

2017-02-19 Thread Amit Langote
On 2017/02/20 1:22, Robert Haas wrote: > On Thu, Feb 16, 2017 at 7:15 AM, Amit Langote > wrote: >> Also attaching 0002 (unchanged) for tab-completion support for the new >> partitioning syntax. > > At one point you have this: > > +/* Limited completi

Re: [HACKERS] pg_dump emits ALTER TABLE ONLY partitioned_table

2017-02-19 Thread Amit Langote
Hi Stephen, On 2017/02/17 22:32, Stephen Frost wrote: > Amit, > > * Amit Langote (langote_amit...@lab.ntt.co.jp) wrote: >> In certain cases, pg_dump's dumpTableSchema() emits a separate ALTER TABLE >> command for those schema elements of a table that could not be i

Re: [HACKERS] Partitioned tables and relfilenode

2017-02-20 Thread Amit Langote
On 2017/02/19 18:53, Robert Haas wrote: > On Fri, Feb 17, 2017 at 1:12 PM, Amit Langote wrote: >> Do you mean that if database-wide analyze is to be run, we should also >> exclude those RELKIND_RELATION relations that are partitions? >> >> So the only way to update a p

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