niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
·  nixdoc.net ·  man pages ·  Linux HOWTOs ·  FreeBSD Tips ·  Forums
navigation Forum index » Databases » PostgreSQL
CURRENT_TIME
Post new topic   Reply to topic Page 1 of 1 [2 Posts] View previous topic :: View next topic
Author Message
FERREIRA William (COFRAMI
*nix forums beginner


Joined: 07 Mar 2005
Posts: 34

PostPosted: Tue Mar 15, 2005 1:21 pm    Post subject: CURRENT_TIME Reply with quote

hi

i need to know the execution time of a part of my pl/pgsql code

so, i tried to use CURRENT_TIME :

t_time_d TIME;
t_time_f TIME;
t_diff TIME;

select CURRENT_TIME into t_time_d;

//the traitment


select CURRENT_TIME into t_time_f;
t_diff=t_time_f-t_time_d;
raise notice 'DEBUT : % | FIN : % | DIFF : % | POUR :
%',t_time_d,t_time_f,t_diff;

my function is recursive and the problem is that i always get the same
result for each iteration
t_time_d is set at the first iteration and doesn't change

thanks
Back to top
Michael Glaesemann
*nix forums Guru Wannabe


Joined: 15 Mar 2005
Posts: 159

PostPosted: Tue Mar 15, 2005 1:41 pm    Post subject: Re: CURRENT_TIME Reply with quote

On Mar 15, 2005, at 23:21, FERREIRA William (COFRAMI) wrote:

Quote:
i need to know the execution time of a part of my pl/pgsql code
 
so, i tried to use CURRENT_TIME :

<snip />

Quote:
my function is recursive and the problem is that i always get the same
result for each iteration
t_time_d is set at the first iteration and doesn't change

You're probably looking for timeofday(). See the docs at

http://www.postgresql.org/docs/8.0/interactive/functions-
datetime.html#FUNCTIONS-DATETIME-CURRENT

Hope this helps.

Michael Glaesemann
grzm myrealbox com


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

http://www.postgresql.org/docs/faq
Back to top
Google

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [2 Posts] View previous topic :: View next topic
The time now is Thu Jan 08, 2009 8:15 am | All times are GMT
navigation Forum index » Databases » PostgreSQL
Jump to:  


Payday Advance | Credit Cards | Mortgage Loans | Modded Xbox | Telecom Expense Management
Copyright © 2004-2005 DeniX Solutions SRL
 
Other DeniX Solutions sites: Unix/Linux blog |  electronics forum |  medicine forum |  science forum | 
Privacy Policy


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 2.1372s ][ Queries: 11 (0.3557s) ][ GZIP on - Debug on ]