Re: Programmatic access to interval units
От | Merlin Moncure |
---|---|
Тема | Re: Programmatic access to interval units |
Дата | |
Msg-id | CAHyXU0y=bg-+PHVK6nFmGCAzj9D_Aw2Y3Gz9KeHwmeNejfo9vg@mail.gmail.com обсуждение исходный текст |
Ответ на | Programmatic access to interval units (Nelson Green <nelsongreen84@gmail.com>) |
Ответы |
Re: Programmatic access to interval units
|
Список | pgsql-general |
On Mon, Dec 1, 2014 at 10:42 AM, Nelson Green <nelsongreen84@gmail.com> wrote: > Good morning list, > > According to the documentation for interval data type inputs, the unit can > be one of microsecond, millisecond, second, minute, hour, day, week, month, > year, decade, century, or millennium. Are these units stored in a catalog > somewhere? I would like to access them programmatically if possible, to > validate input for a function I am developing. if you're writing C, you can use libpqtypes to do this. It exposes the interval as a C structure. typedef struct { int years; int mons; int days; int hours; int mins; int secs; int usecs; } PGinterval; merlin
В списке pgsql-general по дате отправления: