Re: No Documentation for to_char(INTERVAL, mask) - Mailing list pgsql-sql

From Thomas Lockhart
Subject Re: No Documentation for to_char(INTERVAL, mask)
Date
Msg-id 3AA6424D.AE3AE0A1@alumni.caltech.edu
Whole thread Raw
In response to No Documentation for to_char(INTERVAL, mask)  (Josh Berkus <josh@agliodbs.com>)
List pgsql-sql
> >       Given the lack of to_char(interval), I'd like to write a PLPGSQL
> > function to fill the gap in the meantime...
>   I mean is too much difficult write a 'interval' to_char() version in
> some procedural language without access to real (internal) form of
> 'interval'.

I agree with Karel's point that it may be a pain to use a procedural
language to manipulate a "stringy" interval value. If you use a C
function instead, you can get access to the internal manipulation
functions already present, as well as access to system functions to
manipulate a tm structure.

A combination of contrib/ and src/backend/utils/adt/ information could
give you a start on the C implementation (and that is rather easily
moved into the backend later).

I haven't tried the PL/PGSQL approach however. If you decide to proceed
on that, let us know how it goes!
                        - Thomas


pgsql-sql by date:

Previous
From: Michelle Murrain
Date:
Subject: Re: [GENERAL] Re: MySQLs Describe emulator!
Next
From: Thomas Lockhart
Date:
Subject: Re: Re: why the DB file size does not reduce when 'delete'the data in DB?