You can do that in Pg date arithmetic:
# select '1 oct 2004'::date + '1 month'::interval - '1 day'::interval;
?column?
---------------------
2004-10-31 00:00:00
(1 row)
# select '1 nov 2004'::date + '1 month'::interval - '1 day'::interval;
?column?
---------------------
2004-11-30 00:00:00
(1 row)
# select '1 feb 2004'::date + '1 month'::interval - '1 day'::interval;
?column?
---------------------
2004-02-29 00:00:00
(1 row)
Thus, given the original response to your question:
select * from calendar('1 feb 2004', ( '1 feb 2004'::date +
'1 month'::interval - '1 day'::interval )::date);
--
Jeff Boes vox 269.226.9550 ext 24
http://www.nexcerpt.com fax 269.349.9076
...Nexcerpt... Extend your Expertise
> Is there a way to dump everything in a particular schema?
See the documentation for pg_dump. In PostgreSQL 7.4 and later,
pg_dump has a --schema (-n) option.
--
Michael Fuhr
http://www.fuhr.org/~mfuhr/
---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?
-n, --schema=SCHEMA dump the named schema only
> Is there a way to dump everything in a particular schema?
>
>
> Bradley Miller
> NUVIO CORPORATION
> Phone: 816-444-4422 ext. 6757
> Fax: 913-498-1810
> http://www.nuvio.com
> bmi...@nuvio.com
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings
On Feb 1, 2005, at 8:53 PM, Muhyiddin A.M Hayat wrote:
> Ok, thanks
>
> But if i would like to display date in one Month,
>
> e.g :
> date in feb 2005
>
> calendar
> ------------
> 2005-02-01
> 2005-02-02
> 2005-02-03
> 2005-02-04
> 2005-02-05
> ** SNIP **
RTFM.
man pg_dump, search for --schema
Regards, Andreas
--
Diese Message wurde erstellt mit freundlicher Unterstützung eines freilau-
fenden Pinguins aus artgerechter Freilandhaltung. Er ist garantiert frei
von Micro$oft'schen Viren. (#97922 http://counter.li.org) GPG 7F4584DA
Was, Sie wissen nicht, wo Kaufbach ist? Hier: N 51.05082°, E 13.56889° ;-)
---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majo...@postgresql.org
You could use the given function with a few changes. For example,
given an arbitrary date, you could use date_trunc() to find the
first day of that date's month, add an interval of 1 month to find
the first day of the following month, and use a loop to return the
dates up to but not including the latter value.
For more information, see the "Date/Time Functions and Operators"
section in the "Functions and Operators" chapter of the documentation:
http://www.postgresql.org/docs/8.0/static/functions-datetime.html
On Feb 2, 2005, at 9:46 AM, Adam Witney wrote:
>
> From: pg_dump --help
>
> -n, --schema=SCHEMA dump the named schema only
>
Bradley Miller