pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedRe: [SQL] Use of 'default TEXT now()'
5+ messages / 3 participants
[nested] [flat]
* Re: [SQL] Use of 'default TEXT now()'
@ 1999-03-24 13:55 Rich Shepard <rshepard@appl-ecosys.com>
parent: Ing. Roberto Andrade <randrade@campus.iztacala.unam.mx>
0 siblings, 0 replies; 5+ messages in thread
From: Rich Shepard @ 1999-03-24 13:55 UTC (permalink / raw)
To: Ing. Roberto Andrade <randrade@campus.iztacala.unam.mx>; +Cc: 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
^ permalink raw reply [nested|flat] 5+ messages in thread
* Use of 'default TEXT now()'
@ 1999-03-24 20:19 Ing. Roberto Andrade <randrade@campus.iztacala.unam.mx>
0 siblings, 1 reply; 5+ messages in thread
From: Ing. Roberto Andrade @ 1999-03-24 20:19 UTC (permalink / raw)
To: pgsql-sql
Hi:
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 ?
I want to retrieve the fields in datetime order.
TIA
Roberto Andrade Fonseca
Universidad Nacional Autónoma de México
Teléfonos: 623-1154, 623-1119
e-mail: randrade@campus.iztacala.unam.mx
^ permalink raw reply [nested|flat] 5+ messages in thread
* RE: [SQL] Use of 'default TEXT now()'
@ 1999-03-24 21:14 Jackson, DeJuan <djackson@cpsgroup.com>
0 siblings, 1 reply; 5+ messages in thread
From: Jackson, DeJuan @ 1999-03-24 21:14 UTC (permalink / raw)
To: Ing. Roberto Andrade <randrade@campus.iztacala.unam.mx>; pgsql-sql
Use:
fecha_obs datetime default datetime(now())
The use of TEXT was for:
fecha_obs datetime default text 'now'
which will also do what you want (I believe, haven't tried it).
-DEJ
> -----Original Message-----
> From: Ing. Roberto Andrade [mailto:randrade@campus.iztacala.unam.mx]
> Sent: Wednesday, March 24, 1999 2:20 PM
> To: sql
> Subject: [SQL] Use of 'default TEXT now()'
>
>
> Hi:
>
> 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 ?
>
> I want to retrieve the fields in datetime order.
>
> TIA
>
> Roberto Andrade Fonseca
> Universidad Nacional Autónoma de México
>
> Teléfonos: 623-1154, 623-1119
> e-mail: randrade@campus.iztacala.unam.mx
>
>
^ permalink raw reply [nested|flat] 5+ messages in thread
* RE: [SQL] Use of 'default TEXT now()'
@ 1999-03-24 21:31 Ing. Roberto Andrade <randrade@campus.iztacala.unam.mx>
parent: Jackson, DeJuan <djackson@cpsgroup.com>
0 siblings, 0 replies; 5+ messages in thread
From: Ing. Roberto Andrade @ 1999-03-24 21:31 UTC (permalink / raw)
To: pgsql-sql
Hi Jackson:
On Wed, 24 Mar 1999, Jackson, DeJuan wrote:
> Use:
> fecha_obs datetime default datetime(now())
> The use of TEXT was for:
> fecha_obs datetime default text 'now'
> which will also do what you want (I believe, haven't tried it).
> -DEJ
Where can I get some help about this subject?
TIA,
Roberto Andrade Fonseca
^ permalink raw reply [nested|flat] 5+ messages in thread
* RE: [SQL] Use of 'default TEXT now()'
@ 1999-03-24 21:59 Jackson, DeJuan <djackson@cpsgroup.com>
0 siblings, 0 replies; 5+ messages in thread
From: Jackson, DeJuan @ 1999-03-24 21:59 UTC (permalink / raw)
To: Ing. Roberto Andrade <randrade@campus.iztacala.unam.mx>; pgsql-sql
You might take a look at the tutorial on the PostgreSQL web-site
(http://www.postgreSQL.ORG/docs/tutorial/index.html).
There are other references under the "Getting Help/Documentation" section in
the web-site as well
> -----Original Message-----
> From: Ing. Roberto Andrade [mailto:randrade@campus.iztacala.unam.mx]
> Sent: Wednesday, March 24, 1999 3:32 PM
> To: sql
> Subject: RE: [SQL] Use of 'default TEXT now()'
>
>
> Hi Jackson:
>
> On Wed, 24 Mar 1999, Jackson, DeJuan wrote:
>
> > Use:
> > fecha_obs datetime default datetime(now())
> > The use of TEXT was for:
> > fecha_obs datetime default text 'now'
> > which will also do what you want (I believe, haven't tried it).
> > -DEJ
>
> Where can I get some help about this subject?
>
> TIA,
>
> Roberto Andrade Fonseca
>
^ permalink raw reply [nested|flat] 5+ messages in thread
end of thread, other threads:[~1999-03-24 21:59 UTC | newest]
Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1999-03-24 20:19 Use of 'default TEXT now()' Ing. Roberto Andrade <randrade@campus.iztacala.unam.mx>
1999-03-24 13:55 ` Rich Shepard <rshepard@appl-ecosys.com>
1999-03-24 21:14 RE: [SQL] Use of 'default TEXT now()' Jackson, DeJuan <djackson@cpsgroup.com>
1999-03-24 21:31 ` Ing. Roberto Andrade <randrade@campus.iztacala.unam.mx>
1999-03-24 21:59 RE: [SQL] Use of 'default TEXT now()' Jackson, DeJuan <djackson@cpsgroup.com>
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