Re: [SQL] DEFAULT TEXT 'now'

From: tolik(at)icomm(dot)ru (Anatoly K(dot) Lasareff)
To: Roberto Joao Lopes Garcia <roberto(at)mha(dot)com(dot)br>
Cc: pgsql-sql(at)postgreSQL(dot)org
Subject: Re: [SQL] DEFAULT TEXT 'now'
Date: 1999-03-24 07:10:42
Message-ID: 87ogljz7kd.fsf@tolikus.hq.aaanet.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

>>>>> "RJLG" == Roberto Joao Lopes Garcia <roberto(at)mha(dot)com(dot)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(at)icomm(dot)ru
Senior programmer

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Herouth Maoz 1999-03-24 12:42:30 Re: [SQL] transaction-lock?
Previous Message Howie 1999-03-24 07:09:38 Re: [SQL] DEFAULT TEXT 'now'