Re: Create Calendar

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: "Muhyiddin A(dot)M Hayat" <middink(at)indo(dot)net(dot)id>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Create Calendar
Date: 2004-12-11 04:11:52
Message-ID: 20041211041152.GA63199@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Sat, Dec 11, 2004 at 03:26:33AM +0800, Muhyiddin A.M Hayat wrote:

> How to create Calendar using Function/View.
> For example i would like to display date 2004-12-01 to 2004-12-20.

You could write a function that returns SETOF DATE. Some sections
of the documentation you'll want to study are:

"Data Types" chapter, "Date/Time Types" section

"Functions and Operators" chapter, "Date/Time Functions and
Operators" section

"PL/pgSQL - SQL Procedural Language" chapter, especially the
"Control Structures" section

If you have trouble then please post what you've tried with an
explanation of how you'd like it to work and a description of
what actually happens.

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Kenneth Gonsalves 2004-12-11 05:00:55 replacing mysql enum
Previous Message Stephan Szabo 2004-12-11 02:28:38 Re: Query is not using index when it should