pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedproblem with date/time constants
5+ messages / 5 participants
[nested] [flat]
* problem with date/time constants
@ 2001-07-03 12:44 datactrl <quals@bigfoot.com>
0 siblings, 4 replies; 5+ messages in thread
From: datactrl @ 2001-07-03 12:44 UTC (permalink / raw)
To: pgsql-sql
Hi,
server:PostgreSQl 7.1
why doesn't following statement work?
"select now;"
THANK YOU!
JACK LIU
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: problem with date/time constants
@ 2001-07-03 13:03 David Stanaway <david@netventures.com.au>
parent: datactrl <quals@bigfoot.com>
3 siblings, 0 replies; 5+ messages in thread
From: David Stanaway @ 2001-07-03 13:03 UTC (permalink / raw)
To: pgsql-sql; +Cc: quals@bigfoot.com
On Tuesday, July 3, 2001, at 10:44 PM, datactrl wrote:
> Hi,
> server:PostgreSQl 7.1
> why doesn't following statement work?
> "select now;"
Tried rtfm? :P
How about:
SELECT CURRENT_TIMESTAMP as now;
--
Best Regards
David Stanaway
========================.---------------------------------------------
Technology Manager - Australia's Premier Internet Broadcasters
david@NetVentures.com.au Office +612 9357 1699
========================'---------------------------------------------
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: problem with date/time constants
@ 2001-07-03 13:08 Alex Pilosov <alex@pilosoft.com>
parent: datactrl <quals@bigfoot.com>
3 siblings, 0 replies; 5+ messages in thread
From: Alex Pilosov @ 2001-07-03 13:08 UTC (permalink / raw)
To: datactrl <quals@bigfoot.com>; +Cc: pgsql-sql
You must either do:
select now();
or
select 'now'::timestamp;
now() is a function that takes no arguments.
it is also a special value recognized by timestamp parser.
On Tue, 3 Jul 2001, datactrl wrote:
> Hi,
> server:PostgreSQl 7.1
> why doesn't following statement work?
> "select now;"
>
> THANK YOU!
> JACK LIU
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://www.postgresql.org/search.mpl
>
>
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: problem with date/time constants
@ 2001-07-03 13:31 Jan Wieck <JanWieck@Yahoo.com>
parent: datactrl <quals@bigfoot.com>
3 siblings, 0 replies; 5+ messages in thread
From: Jan Wieck @ 2001-07-03 13:31 UTC (permalink / raw)
To: datactrl <quals@bigfoot.com>; +Cc: pgsql-sql
datactrl wrote:
> Hi,
> server:PostgreSQl 7.1
> why doesn't following statement work?
> "select now;"
Because it's not standard SQL and now is a function.
Use either
SELECT CURRENT_TIMESTAMP;
which is standard (preferred) or
SELECT now();
Jan
--
#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me. #
#================================================== JanWieck@Yahoo.com #
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: problem with date/time constants
@ 2001-07-04 04:45 Bhuvan A <bhuvanbk@yahoo.com>
parent: datactrl <quals@bigfoot.com>
3 siblings, 0 replies; 5+ messages in thread
From: Bhuvan A @ 2001-07-04 04:45 UTC (permalink / raw)
To: datactrl <quals@bigfoot.com>; +Cc: pgsql-sql
Hi,
'now' is a function...
so try 'select now();'
On Tue, 3 Jul 2001, datactrl wrote:
> Hi,
> server:PostgreSQl 7.1
> why doesn't following statement work?
> "select now;"
>
> THANK YOU!
> JACK LIU
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://www.postgresql.org/search.mpl
>
^ permalink raw reply [nested|flat] 5+ messages in thread
end of thread, other threads:[~2001-07-04 04:45 UTC | newest]
Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-07-03 12:44 problem with date/time constants datactrl <quals@bigfoot.com>
2001-07-03 13:03 ` David Stanaway <david@netventures.com.au>
2001-07-03 13:08 ` Alex Pilosov <alex@pilosoft.com>
2001-07-03 13:31 ` Jan Wieck <JanWieck@Yahoo.com>
2001-07-04 04:45 ` Bhuvan A <bhuvanbk@yahoo.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