pg_partman icon indicating copy to clipboard operation
pg_partman copied to clipboard

Native partitioning on numeric column

Open mewwts opened this issue 6 years ago • 7 comments

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?

mewwts avatar Aug 06 '19 10:08 mewwts

Odd that it didn't throw an error. Will see if I can fix that. Thanks!

keithf4 avatar Aug 06 '19 13:08 keithf4

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!

keithf4 avatar Aug 13 '19 21:08 keithf4

Thanks for the swift response!

mewwts avatar Aug 14 '19 07:08 mewwts

An error is now being reported as of v4.2.0

keithf4 avatar Aug 20 '19 15:08 keithf4

Thanks for this. Do you reckon we'll see support for numeric?

mewwts avatar Mar 07 '20 10:03 mewwts

Marking this as a feature for 5.0.

keithf4 avatar Jun 25 '22 21:06 keithf4

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.

keithf4 avatar Jan 24 '24 17:01 keithf4

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!

keithf4 avatar Apr 05 '24 13:04 keithf4