Unix Technical Forum

Clarify use of NOW() in pl/pgsql docs

This is a discussion on Clarify use of NOW() in pl/pgsql docs within the Pgsql Patches forums, part of the PostgreSQL category; --> Folks, This one from Ben Calvert. It uses the (imho clearer) NOW() rather than 'NOW' in a PL/PgSQL function ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > Pgsql Patches

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-17-2008, 11:01 PM
David Fetter
 
Posts: n/a
Default Clarify use of NOW() in pl/pgsql docs

Folks,

This one from Ben Calvert. It uses the (imho clearer) NOW() rather
than 'NOW' in a PL/PgSQL function example.

Cheers,
D
--
David Fetter david@fetter.org http://fetter.org/
phone: +1 510 893 6100 mobile: +1 415 235 3778

Remember to vote!


---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-17-2008, 11:02 PM
Neil Conway
 
Posts: n/a
Default Re: Clarify use of NOW() in pl/pgsql docs

On Thu, 2005-01-27 at 02:28 -0800, David Fetter wrote:
> This one from Ben Calvert. It uses the (imho clearer) NOW() rather
> than 'NOW' in a PL/PgSQL function example.


Applied, thanks.

-Neil



---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-17-2008, 11:02 PM
Michael Glaesemann
 
Posts: n/a
Default Re: Clarify use of NOW() in pl/pgsql docs


On Feb 10, 2005, at 14:00, Neil Conway wrote:

> On Thu, 2005-01-27 at 02:28 -0800, David Fetter wrote:
>> This one from Ben Calvert. It uses the (imho clearer) NOW() rather
>> than 'NOW' in a PL/PgSQL function example.

>
> Applied, thanks.


I realize it's a bit late, but it might not be a bad idea to use
CURRENT_TIMESTAMP rather than NOW(), as it's per SQL spec.

Michael Glaesemann
grzm myrealbox com


---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo@postgresql.org)

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-17-2008, 11:02 PM
Christopher Kings-Lynne
 
Posts: n/a
Default Re: Clarify use of NOW() in pl/pgsql docs

>>This one from Ben Calvert. It uses the (imho clearer) NOW() rather
>>than 'NOW' in a PL/PgSQL function example.

>
>
> Applied, thanks.


Why not use CURRENT_TIMSTAMP instead of NOW() everywhere in the docs. I
mean, it's standard and NOW() isn't...

Chris

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 04-17-2008, 11:02 PM
Peter Eisentraut
 
Posts: n/a
Default Re: Clarify use of NOW() in pl/pgsql docs

Tom Lane wrote:
> Considering that the example in question is embedded in the
> 100%-not-SQL- standard language plpgsql, I can't get excited about
> this either.


I was under the impression that our PL/pgSQL is at least partially an
attempt to implement SQL:2003, part 4.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 04-17-2008, 11:02 PM
Tom Lane
 
Posts: n/a
Default Re: Clarify use of NOW() in pl/pgsql docs

Peter Eisentraut <peter_e@gmx.net> writes:
> I was under the impression that our PL/pgSQL is at least partially an
> attempt to implement SQL:2003, part 4.


No, it's an attempt to emulate Oracle's PL/SQL. Any similarity to spec
documents dated later than the original creation of plpgsql (1998) is
quite accidental...

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 04-17-2008, 11:02 PM
Tom Lane
 
Posts: n/a
Default Re: Clarify use of NOW() in pl/pgsql docs

Neil Conway <neilc@samurai.com> writes:
> On Thu, 2005-02-10 at 16:32 +0900, Michael Glaesemann wrote:
>> I realize it's a bit late, but it might not be a bad idea to use
>> CURRENT_TIMESTAMP rather than NOW(), as it's per SQL spec.


> I can't say I can get very excited about it; someone is free to submit a
> patch if they like.


Considering that the example in question is embedded in the 100%-not-SQL-
standard language plpgsql, I can't get excited about this either.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 04-17-2008, 11:03 PM
Neil Conway
 
Posts: n/a
Default Re: Clarify use of NOW() in pl/pgsql docs

On Thu, 2005-02-10 at 16:32 +0900, Michael Glaesemann wrote:
> I realize it's a bit late, but it might not be a bad idea to use
> CURRENT_TIMESTAMP rather than NOW(), as it's per SQL spec.


I can't say I can get very excited about it; someone is free to submit a
patch if they like.

-Neil



---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 08:54 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com