Received: from tolikus.hq.aaanet.ru (tolikus.hq.aaanet.ru [195.151.212.227]) by hub.org (8.9.2/8.9.1) with ESMTP id CAA86364 for ; Wed, 24 Mar 1999 02:18:40 -0500 (EST) (envelope-from tolik@tolikus.hq.aaanet.ru) Received: (from tolik@localhost) by tolikus.hq.aaanet.ru (8.9.1/8.9.1) id KAA00316; Wed, 24 Mar 1999 10:10:43 +0300 (MSK) (envelope-from tolik) To: Roberto Joao Lopes Garcia Cc: pgsql-sql@postgreSQL.org Subject: Re: [SQL] DEFAULT TEXT 'now' References: <3.0.5.32.19990323155824.007fa8c0@pop.hipernet.com.br> Mime-Version: 1.0 (generated by tm-edit 7.108) Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 8bit From: tolik@icomm.ru (Anatoly K. Lasareff) Date: 24 Mar 1999 10:10:42 +0300 In-Reply-To: Roberto Joao Lopes Garcia's message of "Tue, 23 Mar 1999 15:58:24 -0300" Message-ID: <87ogljz7kd.fsf@tolikus.hq.aaanet.ru> Lines: 33 X-Mailer: Gnus v5.5/XEmacs 20.4 - "Emerald" >>>>> "RJLG" == Roberto Joao Lopes Garcia writes: RJLG> Hi RJLG> I´m have a table like bellow: RJLG> CREATE TABLE conex ( RJLG> id int4 PRIMARY KEY DEFAULT NEXTVAL('seq_conex'), RJLG> inicio datetime DEFAULT TEXT 'now', RJLG> ultimo datetime DEFAULT TEXT RJLG> 'now', RJLG> . RJLG> . RJLG> . RJLG> ) RJLG> insert into conex (ip) values(´200.200.200.200´) RJLG> Will result every time the same data and time for ´inicio´ and ´ultimo´! You must type inicio datetime DEFAULT TEXT now(), ^^^^^ This is the function which calls every time you insert new record. In your case 'now' is the constant, which calculates once, when you create the table. -- Anatoly K. Lasareff Email: tolik@icomm.ru Senior programmer