Re: insert a SYSTIMESTAMP value in postgres

Поиск
Список
Период
Сортировка
От Leon Match
Тема Re: insert a SYSTIMESTAMP value in postgres
Дата
Msg-id 000001cc3017$73f3f290$5bdbd7b0$@match@convergia.net
обсуждение исходный текст
Ответ на insert a SYSTIMESTAMP value in postgres  ("Leon Match" <leon.match@convergia.net>)
Список pgsql-general
Thanks a lot for your help!

The correct sentence to my solution is this:

insert into request_queue (request_id, received_time
                                      )
      values   (new.request_id, LOCALTIMESTAMP
                  );

Regards,
Leon

-----Original Message-----
From: Osvaldo Kussama [mailto:osvaldo.kussama@gmail.com]
Sent: Monday, June 20, 2011 3:45 PM
To: Leon Match
Subject: Re: [GENERAL] insert a SYSTIMESTAMP value in postgres

2011/6/20 Leon Match <leon.match@convergia.net>:
> Hello,
>
> I am trying to re-create few objects  from oracle into postgres.
>
> I have a problem inserting a timestamp value into the table:
>
> insert into request_queue (request_id, received_time)
>         values   (new.request_id, SYSTIMESTAMP);
>
> How can I insert a dynamic timestamp value in postgress, please?
>


In Oracle/PLSQL, the systimestamp function returns the current system
date and time (including fractional seconds and time zone) on your
local database.

In PostgreSQL see the manual:
http://www.postgresql.org/docs/current/interactive/functions-datetime.html#F
UNCTIONS-DATETIME-CURRENT
"CURRENT_TIME and CURRENT_TIMESTAMP deliver values with time zone.
PostgreSQL also provides functions that return the start time of the
current statement, as well as the actual current time at the instant
the function is called. The complete list of non-SQL-standard time
functions is:

transaction_timestamp()
statement_timestamp()
clock_timestamp()
timeofday()
now()

transaction_timestamp() is equivalent to CURRENT_TIMESTAMP, but is
named to clearly reflect what it returns. statement_timestamp()
returns the start time of the current statement (more specifically,
the time of receipt of the latest command message from the client).
statement_timestamp() and transaction_timestamp() return the same
value during the first command of a transaction, but might differ
during subsequent commands. clock_timestamp() returns the actual
current time, and therefore its value changes even within a single SQL
command."

Osvaldo


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

Предыдущее
От: Pawel Kukawski
Дата:
Сообщение: Limited number of simultaneous connections on Windows
Следующее
От: Vick Khera
Дата:
Сообщение: Re: getting postgres server on freebsd startup?