Working on trying to get a C version of the maintenance function for my pg_partman extension working so I can hopefully make it more flexible and efficient.
https://github.com/keithf4/pg_partman/blob/master/sql/functions/run_maintenance.sql
Up until this point I've just been using SPI and the Datum conversion functions (DatumGetCString, DatumGetInt32) to get string and numeric data out of tables and things have been working fine. I'm at the first point in that function where I'll need to start dealing with timestamp data.https://github.com/keithf4/pg_partman/blob/master/sql/functions/run_maintenance.sql
https://gist.github.com/keithf4/81c32bf8b689c74b20c10ad8c91d45a3#file-pg_partman_bgw-c-L532
https://github.com/keithf4/pg_partman/blob/master/sql/functions/run_maintenance.sql#L139