Re: [SQL] Use of 'default TEXT now()'

From: Rich Shepard <rshepard(at)appl-ecosys(dot)com>
To: "Ing(dot) Roberto Andrade" <randrade(at)campus(dot)iztacala(dot)unam(dot)mx>
Cc: sql <pgsql-sql(at)postgreSQL(dot)org>
Subject: Re: [SQL] Use of 'default TEXT now()'
Date: 1999-03-24 13:55:37
Message-ID: Pine.LNX.4.04.9903240552430.1624-100000@salmo.appl-ecosys.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Wed, 24 Mar 1999, Ing. Roberto Andrade wrote:

> I'm writing an application where I have to use a datetime field. In this
> field we'll keep the date and time of the coments about some tasks.
>
> I am not sure about the right use of 'default', should I use:
>
> fecha_obs datetime default TEXT now()
>
> or
>
> fecha_obs datetime default now() ?
>
> When I must use TEXT ?

Unless I've missed something important, you want to use the latter form.
Text is a field data type for a variable length field without limit. Like
the memo field in dBASE and Paradox.

The variable length field with a limit to the number of characters it can
contain is varchar(n). The data type, char(n), holds a fixed length string,
padded with blanks, to the maximum of 'n'.

These are most of the character data types. What you want is one of the
date/time data types.

Hope this helps,

Rich

Dr. Richard B. Shepard, President
Applied Ecosystem Services, Inc.
2404 SW 22nd Street
Troutdale, OR 97060-1247 U.S.A.
+ 1 503-667-4517 (voice) | + 1 503-667-8863 (fax)
rshepard(at)appl-ecosys(dot)com

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Ross J. Reedstrom 1999-03-24 16:26:55 Re: [SQL] DEFAULT TEXT 'now'
Previous Message Herouth Maoz 1999-03-24 12:42:30 Re: [SQL] transaction-lock?