DAY Function - Sybase ASE to PostgreSQL Migration

In Sybase Adaptive Server Enterprise (ASE) you can use DAY function to get the day (an integer number) of the specified datetime. In PostgreSQL you have to use EXTRACT(DAY FROM datetime) function.

Sybase ASE:

  -- Get the day
  SELECT DAY('2022-12-28'); 
  # 28

PostgreSQL:

  -- Get the day
  SELECT EXTRACT(DAY FROM DATE '2022-12-28'); 
  # 28

For more information, see Sybase ASE to PostgreSQL Migration.