Re: [GENERAL] CURRENT_TIMESTAMP

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [GENERAL] CURRENT_TIMESTAMP
Дата
Msg-id 8770.1032827572@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [GENERAL] CURRENT_TIMESTAMP  (Bruce Momjian <pgman@candle.pha.pa.us>)
Ответы Re: [GENERAL] CURRENT_TIMESTAMP
Список pgsql-sql
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> I see what you are saying now --- that even single user statements can
> trigger multiple statements, so you would have to say transaction start
> time is time the user query starts.  I can see how that seems a little
> arbitrary.  However, don't we have separate paths for user queries and
> queries sent as part of a rule?

We could use "time of arrival of the latest client command string",
if we wanted to do something like this.  My point is that that very
arbitrarily assumes that those are the significant points within a
transaction, and that the client has no need to send multiple commands
that want to insert the same timestamp into different tables.  This is
an unwarranted assumption about the client's control structure, IMHO.

A possible compromise is to dissociate now() and current_timestamp,
allowing the former to be start of transaction and the latter to be
start of client command.
        regards, tom lane


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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: [GENERAL] Monitoring a Query
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: [GENERAL] CURRENT_TIMESTAMP