Skip to content

p_epoch - Is it possible to support nanoseconds #416

Answered by keithf4
Nana-EC asked this question in Q&A
Discussion options

You must be logged in to vote

Would likely just be a matter of adding another valid option in for the v_partition_expression variable with the proper math to convert an epoch into nanoseconds

One example:
https://github.com/pgpartman/pg_partman/blob/master/sql/functions/create_partition_time.sql#L121

Doing a search for the when condition show likely places it would need to be adjusted for:

pg_partman/sql$ grep -ir "WHEN v_epoch =" *
functions/partition_data_time.sql:    WHEN v_epoch = 'seconds' THEN format('to_timestamp(%I)', v_control)
functions/partition_data_time.sql:    WHEN v_epoch = 'milliseconds' THEN format('to_timestamp((%I/1000)::float)', v_control)
functions/undo_partition.sql:    WHEN v_epoch = 'seconds' T…

Replies: 3 comments 7 replies

Comment options

You must be logged in to vote
1 reply
@Nana-EC
Comment options

Answer selected by Nana-EC
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
6 replies
@Nana-EC
Comment options

@keithf4
Comment options

@keithf4
Comment options

@Nana-EC
Comment options

@keithf4
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants