Search Postgresql Archives

Re: Programmatic access to interval units

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Dec 1, 2014 at 10:42 AM, Nelson Green <nelsongreen84@xxxxxxxxx> 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


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux