pg_partman
pg_partman copied to clipboard
Native partitioning on numeric column
Hello!
I was running into an issue where I was trying to create a range partitioned table on a numeric column. Postgres itself has no issues with this, however I was unable to get pg_partman to work. create_parent would return t, but no entry would be added to part_config. Changing the column to a bigint fixed this issue for me.
If pg_partman does not work with numeric columns it should return f or raise while calling create_parent don't you think?
Odd that it didn't throw an error. Will see if I can fix that. Thanks!
For the next version of pg_partman, it will throw an error if the data type is numeric. I'd like to test things more extensively to see if there would be any issues with supporting the numeric type with number-based partitioning, so I've changed this to a feature request for now.
Apologies for the issues you encountered and thank you for reporting them!
Thanks for the swift response!
An error is now being reported as of v4.2.0
Thanks for this. Do you reckon we'll see support for numeric?
Marking this as a feature for 5.0.
I have a beta PR up with support for numeric columns.
https://github.com/pgpartman/pg_partman/pull/615
Note that I'm still marking this as experimental in the 5.1 release. I had to touch a lot more places than I thought I would to get this to work and I'm still unsure if I've properly handled all edge cases yet. Also note that the partition interval must still be an integer at this time.
If you're able to do any testing before the 5.1 release, or after while 5.1 is out and it's marked experimental, it would be greatly appreciated.
Version 5.1 has been released with Numeric support in Experimental. Please test it out and let me know how it goes, both good and bad!