pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Karel Zak <zakkr@zf.jcu.cz>
To: Josh Berkus <josh@agliodbs.com>
Cc: sqllist <pgsql-sql@postgresql.org>
Cc: Thomas Lockhart <lockhart@alumni.caltech.edu>
Subject: Re: No Documentation for to_char(INTERVAL, mask)
Date: Wed, 7 Mar 2001 11:23:36 +0100
Message-ID: <20010307112335.A6373@ara.zf.jcu.cz> (raw)
In-Reply-To: <3AA51CD1.8A55F64F@agliodbs.com>
References: <3AA469E9.DCFFC0AE@agliodbs.com>
	<20010306091316.B6115@ara.zf.jcu.cz>
	<3AA51CD1.8A55F64F@agliodbs.com>

On Tue, Mar 06, 2001 at 09:22:25AM -0800, Josh Berkus wrote:
> Karel,
> 
> >  The 'interval' version of to_char() isn't implemented -- may be in 7.2
> > (it's high in my TODO list:-)
> 
> 	Grazie.  (One of the things I love about PostgreSQL is being able to
> get definitive answers on functionality -- try asking Microsoft an "is
> this implemented?" question!)

:-)

> 	Given the lack of to_char(interval), I'd like to write a PLPGSQL
> function to fill the gap in the meantime.  If you can answer a few
> questions about how interval values work, it would be immensely helpful:
> 
> 1. Hours, minutes, and seconds are displayed as "00:00:00".  Days are
> displayed as "0 00:00:00".  How are weeks, months, and years displayed?
> 
> 2. If months have their own placeholder in the Interval data type, how
> many days make up a month?  Is it a fixed value, or does it depend on
> the calendar?

 A displayed format is external string alternate of a internal number based
form. A interval/timestamp string that you use in SQL is parsed to 'tm'
struct (see man ctime) where has each item like hours, minutes own field.
For some date/time operation is used Julian date (..etc) -- internaly PG
not works with strings for date/time.

  I mean is too much difficult write a 'interval' to_char() version in 
some procedural language without access to real (internal) form of 
'interval'. 

 Big date/time guru is Thomas (CC:), comments?

		Karel

-- 
 Karel Zak  <zakkr@zf.jcu.cz>
 http://home.zf.jcu.cz/~zakkr/
 
 C, PostgreSQL, PHP, WWW, http://docs.linux.cz, http://mape.jcu.cz



view thread (10+ messages)  latest in thread

Message-ID: <20010307112335.A6373@ara.zf.jcu.cz>
Permalink:  ../20010307112335.A6373@ara.zf.jcu.cz/
Also on:    postgresql.org/message-id/20010307112335.A6373@ara.zf.jcu.cz

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: zakkr@zf.jcu.cz, josh@agliodbs.com, lockhart@alumni.caltech.edu
  Subject: Re: No Documentation for to_char(INTERVAL, mask)
  In-Reply-To: <20010307112335.A6373@ara.zf.jcu.cz>
  References: <3AA469E9.DCFFC0AE@agliodbs.com> <20010306091316.B6115@ara.zf.jcu.cz> <3AA51CD1.8A55F64F@agliodbs.com> <20010307112335.A6373@ara.zf.jcu.cz>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox