Re: [SQL] TO_CHAR or TO_DATE - Mailing list pgsql-sql

From Clark Evans
Subject Re: [SQL] TO_CHAR or TO_DATE
Date
Msg-id 370230D5.DA694942@manhattanproject.com
Whole thread Raw
In response to where can I get...  (ZioBudda <michel@michel.enter.it>)
List pgsql-sql
Chairudin Sentosa wrote:
> How to do it the right way to insert only month and year?

You don't, it is necessary to have a day as well.  Use
the first of the month, and ignore the day in your program.
Thus, insert into table values ( '1-MAR-1999' );

Alternatively, you could create your own type and work out
all the semantics necessary to only manage months.  This sounds
interesting actually, only I would do 'week' rather than month.

Clark


pgsql-sql by date:

Previous
From: miannaco@csc.com
Date:
Subject: merging date and time
Next
From: ZioBudda
Date:
Subject: error -dl-