Re: No Documentation for to_char(INTERVAL, mask)

From: Thomas Lockhart <lockhart(at)alumni(dot)caltech(dot)edu>
To: Karel Zak <zakkr(at)zf(dot)jcu(dot)cz>, Josh Berkus <josh(at)agliodbs(dot)com>
Cc: sqllist <pgsql-sql(at)postgresql(dot)org>
Subject: Re: No Documentation for to_char(INTERVAL, mask)
Date: 2001-03-07 14:14:37
Message-ID: 3AA6424D.AE3AE0A1@alumni.caltech.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Salvador Mainé 2001-03-07 14:23:23 SQL problem
Previous Message Andrzej Roszkowski 2001-03-07 14:03:59 sql functions and triggers