Re: pl/pgsql and returns timestamp type

Поиск
Список
Период
Сортировка
От Josh Berkus
Тема Re: pl/pgsql and returns timestamp type
Дата
Msg-id 200209101112.59105.josh@agliodbs.com
обсуждение исходный текст
Ответ на Re: pl/pgsql and returns timestamp type  (Terry Yapt <yapt@technovell.com>)
Ответы Re: pl/pgsql and returns timestamp type  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-novice
Terry,

> > --Problem #1:  A TIMESTAMP minus another TIMESTAMP returns an
> > --INTERVAL, not a TIMESTAMP.   See my paper on timestamps and
> > --intervals on http://techdocs.postgresql.org/
>
> 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


В списке pgsql-novice по дате отправления:

Предыдущее
От: Terry Yapt
Дата:
Сообщение: Re: pl/pgsql and returns timestamp type
Следующее
От: Tom Lane
Дата:
Сообщение: Re: pl/pgsql and returns timestamp type