Re: pg_attribute.atttypmod for interval type - Mailing list pgsql-hackers

From Tom Lane
Subject Re: pg_attribute.atttypmod for interval type
Date
Msg-id 1913262.1722054745@sss.pgh.pa.us
Whole thread Raw
In response to pg_attribute.atttypmod for interval type  (Greg Rychlewski <greg.rychlewski@gmail.com>)
Responses Re: pg_attribute.atttypmod for interval type
List pgsql-hackers
Greg Rychlewski <greg.rychlewski@gmail.com> writes:
> My question is: how are the values meant to be interpreted for interval
> types? Thanks very much for your help.

Interval typmods include a fractional-seconds-precision field as well
as a bitmask indicating the allowed interval fields (per the SQL
standard's weird syntax such as INTERVAL DAY TO SECOND).  Looking at
the source code for intervaltypmodout() might be helpful:


https://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f=src/backend/utils/adt/timestamp.c;h=69fe7860ede062fc8be42e7545b35e69c3e068c4;hb=HEAD#l1136

The referenced macros are mostly in utils/timestamp.h and
utils/datetime.h.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Greg Rychlewski
Date:
Subject: pg_attribute.atttypmod for interval type
Next
From: Tatsuo Ishii
Date:
Subject: Re: Protocol question regarding Portal vs Cursor