timestamp9

The timestamp9 module provides an efficient, nanosecond-precision timestamp data type and related functions and operators.

The Greenplum Database timestamp9 module is based on version 1.1.0 of the timestamp9 module used with PostgreSQL.

Installing and Registering the Module

The timestamp9 module is installed when you install Greenplum Database. Before you can use the data type defined in the module, you must register the timestamp9 extension in each database in which you want to use the type:

  1. CREATE EXTENSION timestamp9;

Refer to Installing Additional Supplied Modules for more information.

Module Documentation

Refer to the timestamp9 github documentation for detailed information about using the module.

Additional Documentation

You can set the TimeZone server configuration parameter to specify the time zone that Greenplum Database uses when it prints a timestamp9 timestamp. When you set this parameter, Greenplum Database displays the timestamp value in that time zone. For example:

  1. testdb=# SELECT now()::timestamp9;
  2. now
  3. -------------------------------------
  4. 2022-08-24 18:08:01.729360000 +0800
  5. (1 row)
  6. testdb=# SET timezone TO 'UTC+2';
  7. SET
  8. testdb=# SELECT now()::timestamp9;
  9. now
  10. -------------------------------------
  11. 2022-08-24 08:08:12.995542000 -0200
  12. (1 row)

Limitations

The timestamp9 data type does not support arithmetic calculations with nanoseconds.