1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-06 07:49:08 +03:00

Add transform functions for various temporal typmod coercisions.

This enables ALTER TABLE to skip table and index rebuilds in some cases.

Noah Misch, with trivial changes by me.
This commit is contained in:
Robert Haas
2012-02-08 09:33:02 -05:00
parent 1a01560cbb
commit c13897983a
8 changed files with 150 additions and 6 deletions

View File

@@ -1210,6 +1210,17 @@ timetypmodout(PG_FUNCTION_ARGS)
}
/* time_transform()
* Flatten calls to time_scale() and timetz_scale() that solely represent
* increases in allowed precision.
*/
Datum
time_transform(PG_FUNCTION_ARGS)
{
PG_RETURN_POINTER(TemporalTransform(MAX_TIME_PRECISION,
(Node *) PG_GETARG_POINTER(0)));
}
/* time_scale()
* Adjust time type for specified scale factor.
* Used by PostgreSQL type system to stuff columns.