pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: tolik@icomm.ru
To: Roberto Joao Lopes Garcia <roberto@mha.com.br>
Cc: pgsql-sql@postgreSQL.org
Subject: Re: [SQL] DEFAULT TEXT 'now'
Date: 24 Mar 1999 10:10:42 +0300
Message-ID: <87ogljz7kd.fsf@tolikus.hq.aaanet.ru> (raw)
References: <3.0.5.32.19990323155824.007fa8c0@pop.hipernet.com.br>

>>>>> "RJLG" == Roberto Joao Lopes Garcia <roberto@mha.com.br> 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



view thread (4+ messages)  latest in thread

Message-ID: <87ogljz7kd.fsf@tolikus.hq.aaanet.ru>
Permalink:  ../87ogljz7kd.fsf@tolikus.hq.aaanet.ru/
Also on:    postgresql.org/message-id/87ogljz7kd.fsf@tolikus.hq.aaanet.ru

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: tolik@icomm.ru, roberto@mha.com.br
  Subject: Re: [SQL] DEFAULT TEXT 'now'
  In-Reply-To: <87ogljz7kd.fsf@tolikus.hq.aaanet.ru>
  References: <3.0.5.32.19990323155824.007fa8c0@pop.hipernet.com.br> <87ogljz7kd.fsf@tolikus.hq.aaanet.ru>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox