pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Roberto Joao Lopes Garcia <roberto@mha.com.br>
To: pgsql-sql@postgreSQL.org
Subject: DEFAULT TEXT 'now'
Date: Tue, 23 Mar 1999 15:58:24 -0300
Message-ID: <3.0.5.32.19990323155824.007fa8c0@pop.hipernet.com.br> (raw)

Hi

I´m have a table like bellow:

CREATE TABLE conex (
    id int4 PRIMARY KEY DEFAULT NEXTVAL('seq_conex'),
 
    inicio datetime DEFAULT TEXT 'now', 
    ultimo datetime DEFAULT TEXT
'now',       
                 .
                 .
                 .
)

insert into conex (ip) values(´200.200.200.200´)

Will result every time the same data and time for ´inicio´ and ´ultimo´! 

I want to insert the current date and time. Is that code correct and the
result a bug???
Is there an way to make the DEFAULT work???

I know I can insert like:  

insert into conex (ip, inicio, ultimo) values(´200.200.200.200´, ´now´, ´now´)

but I would like to use DEFAULT.

PostgreSQL 6.4 - Solaris 2.5 sparc

Thank you

Roberto





view thread (4+ messages)  latest in thread

Message-ID: <3.0.5.32.19990323155824.007fa8c0@pop.hipernet.com.br>
Permalink:  ../3.0.5.32.19990323155824.007fa8c0@pop.hipernet.com.br/
Also on:    postgresql.org/message-id/3.0.5.32.19990323155824.007fa8c0@pop.hipernet.com.br

 · 

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: roberto@mha.com.br
  Subject: Re: DEFAULT TEXT 'now'
  In-Reply-To: <3.0.5.32.19990323155824.007fa8c0@pop.hipernet.com.br>
  References: <3.0.5.32.19990323155824.007fa8c0@pop.hipernet.com.br>

* 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