Re: Restriction on table partition expressions

2022-08-26 Thread Ron
It certainly does make sense to have global indices on partitioned tables.  Rdd/VMS had them 20+ years ago, and they are (I still have two production systems using Rdb on OpenVMS) darned useful. Did it require dropping the index before dropping a partition? Absolutely!!  But *of course* /every

Re: Restriction on table partition expressions

2022-08-26 Thread James Vanns
Thanks for that, David. It makes sense and no, it certainly wouldn't do to have a global index across all the partitions! It sounds like the key thing that needs highlighting is if the result of an expression (function call in this case) cannot guarantee the uniqueness of the value across all parti

Re: Restriction on table partition expressions

2022-08-25 Thread David Rowley
On Fri, 26 Aug 2022 at 03:08, James Vanns wrote: > Also, is there a chance that this > limitation will be relaxed in the future? (forgot to answer this part) Certainly not in the near future, I'm afraid. It would require allowing a single index to exist over multiple tables. There has been disc

Re: Restriction on table partition expressions

2022-08-25 Thread David Rowley
On Fri, 26 Aug 2022 at 03:08, James Vanns wrote: > CREATE TABLE foobar( > id BIGINT NOT NULL PRIMARY KEY, > baz VARCHAR NULL DEFAULT NULL > ) PARTITION BY HASH(my_func(id)); > > Error: primary key constraints cannot be used when partition keys > include expressions. > I couldn't find much