↑↓ select↵ open⌫ change scopeOpen full search

PG.CENTER connects PostgreSQL documentation, reference, and ecosystem knowledge. Maintained by Pigsty.

Wiki / Functions

age

Subtract arguments, producing a “symbolic” result that uses years and months, rather than just days

English manual coverage begins with PostgreSQL 7.1. Source history and runtime observations have their own recorded version boundaries.

Reading PG 18·Select a recorded version

group
datetime
group label
时间/日期函数和操作符
lang
en
layout
table-new
pages
functions-datetime.html, functions-info.html
prose only
false

Definition PG 18

Subtract arguments, producing a “symbolic” result that uses years and months, rather than just days

Signatures and overloads

age ( timestamp, timestamp ) → interval → interval
Subtract arguments, producing a “symbolic” result that uses years and months, rather than just days
age ( timestamp ) → interval → interval
Subtract argument from current_date (at midnight)
age ( xid ) → integer → integer
Returns the number of transactions between the supplied transaction id and the current transaction counter.

Compare versions

Complete source facts

documentation revision

{"inputs":[{"file":"functions-datetime.html","kind":"same-version-reviewed-manual","locale":"en","sha256":"8c5053713aeaacfbe4cb00effc61f10d457c98b2a29c724b10b93819a087ea95","version":"18.7"},{"file":"functions-info.html","kind":"same-version-reviewed-manual","locale":"en","sha256":"64499116227a087138bb14f29ff6652b200a176d5df3ce2a089c3d5c226b19b3","version":"18.7"},{"file":"functions-datetime.html","kind":"same-version-reviewed-manual","locale":"zh-Hans","sha256":"c3efdd1c3df6795c73dfea2ecec17ca31ff37da23d758083a581d75445851f0c","version":"18.7"},{"file":"functions-info.html","kind":"same-version-reviewed-manual","locale":"zh-Hans","sha256":"f9684137c0b9fb17a691c4d905529d114472a507a007c15058f2703962b611d2","version":"18.7"}],"release":"18.7","runtime_remeasured":false,"source_revision":"pgdoc:b9f0e7232f60f380d642ac9b99226606c254b552"}

Source references

Full definition and evidence JSON

Definition sources

center · PostgreSQL 18 · wiki-repair-20261023:290b1f8ee4bd23832970ecf498684ff096abc0a51a56bf89e838dfce5af835c9

Text language: en · wiki-repair-20261023:290b1f8ee4bd23832970ecf498684ff096abc0a51a56bf89e838dfce5af835c9