trunc ( numeric ) → numericTruncates to integer (towards zero)
trunc(42.8) → 42
trunc(-42.8) → -42
Truncates to integer (towards zero)
trunc ( numeric ) → numericTruncates to integer (towards zero)
trunc(42.8) → 42
trunc(-42.8) → -42
trunc ( double precision ) → double precisionTruncates to integer (towards zero)
trunc(42.8) → 42
trunc(-42.8) → -42
trunc ( v numeric, s integer ) → numericTruncates
v to s decimal placestrunc(42.4382, 2) → 42.43
trunc ( macaddr ) → macaddrSets the last 3 bytes of the address to zero. The remaining prefix can be associated with a particular manufacturer (using data not included in PostgreSQL).
trunc(macaddr '12:34:56:78:90:ab') → 12:34:56:00:00:00
trunc ( macaddr8 ) → macaddr8Sets the last 5 bytes of the address to zero. The remaining prefix can be associated with a particular manufacturer (using data not included in PostgreSQL).
trunc(macaddr8 '12:34:56:78:90:ab:cd:ef') → 12:34:56:00:00:00:00:00
Definition snapshot: 2026-09-14T13:14:25.684213+00:00@99e6866c · English manual source