Re: [SQL] Use of 'default TEXT now()' - Mailing list pgsql-sql

From Rich Shepard
Subject Re: [SQL] Use of 'default TEXT now()'
Date
Msg-id Pine.LNX.4.04.9903240552430.1624-100000@salmo.appl-ecosys.com
Whole thread Raw
In response to Use of 'default TEXT now()'  ("Ing. Roberto Andrade" <randrade@campus.iztacala.unam.mx>)
List 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@appl-ecosys.com



pgsql-sql by date:

Previous
From: "Ing. Roberto Andrade"
Date:
Subject: RE: [SQL] Use of 'default TEXT now()'
Next
From: "Jackson, DeJuan"
Date:
Subject: RE: [SQL] Use of 'default TEXT now()'