Received: from shaked.cc.openu.ac.il (shaked.cc.openu.ac.il [147.233.145.65]) by hub.org (8.8.8/8.7.5) with ESMTP id FAA00637 for ; Wed, 8 Jul 1998 05:54:00 -0400 (EDT) Received: from [147.233.159.109] (herouth@mac-herouth.pc.openu.ac.il [147.233.159.109]) by shaked.cc.openu.ac.il (8.8.5/8.8.5) with ESMTP id MAA25540; Wed, 8 Jul 1998 12:52:52 +0300 (IDT) X-Sender: herouth@shaked.cc.openu.ac.il Message-Id: In-Reply-To: <35A33791.3D908698@dnet.net.id> References: <3.0.1.32.19980626150540.006ab3dc@rr.pathlink.com> <3.0.1.32.19980626164554.006ac384@rr.pathlink.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Date: Wed, 8 Jul 1998 12:52:38 +0300 To: Chairudin Sentosa Harjo From: Herouth Maoz Subject: Re: [SQL] Date Cc: pgsql-sql@postgreSQL.org At 12:10 +0300 on 8/7/98, Chairudin Sentosa Harjo wrote: > I need help with date. > > create table blah > ( > custnum int, > startdate date, > enddate date > ); > > How do I get the "real date" to insert to startdate when > the data is entered? > > insert into blah > (custnum, startdate, enddate) > values > (001,???,'NULL'); > > I need a way to fill in the '???' field. > In oracle I could use > select sysdate from dual; First, I recommend that you use datetime, not date. Date is a limited type, and has less options. That said, you can use either: insert into blah (custnum, startdate, enddate) values (001, 'now', null); Or values (001, current_date, null); See the manpage "pgbuiltin". Herouth -- Herouth Maoz, Internet developer. Open University of Israel - Telem project http://telem.openu.ac.il/~herutma