Skip site navigation (1) Skip section navigation (2)

Re: pl/pgsql and returns timestamp type

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: Terry Yapt <yapt(at)technovell(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: pl/pgsql and returns timestamp type
Date: 2002-09-10 18:12:59
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-novice

> > --Problem #1:  A TIMESTAMP minus another TIMESTAMP returns an
> > --INTERVAL, not a TIMESTAMP.   See my paper on timestamps and
> > --intervals on
> Sorry.  I had no luck looking for your document... :-(

The document in your 2nd e-mail is the correct one.

> Hummm... ok.   I have read this in somewhere.  But I have too much 
information about pgsql to digest (for the moment).
> But then... How could I obtain "variable global values" (like the timestamp 
for example) in different function locations whit its "at time" values ???

Not that I know of.   I'd suggest, instead, that you call the second now() 
statement after the function completes.

> > --Problem #3: A commmit statement is entirely superflous within a
> > --function, which is transactional regardless, and will cause an error.
> But...then.. 
> Do you mean all or nothing of the function statements will be executed 
regardless how many tables and/or sentences will be involved ????

That is correct.   If you need conditional commiting or exception-handling, 
use an external middleware language such as Java, Perl, or Python.

-Josh Berkus
 Aglio Database Solutions
 San Francisco

In response to


pgsql-novice by date

Next:From: Tom LaneDate: 2002-09-10 19:27:29
Subject: Re: pl/pgsql and returns timestamp type
Previous:From: Terry YaptDate: 2002-09-10 18:03:01
Subject: Re: pl/pgsql and returns timestamp type

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group