Re: Syntax

Поиск
Список
Период
Сортировка
От Ron Johnson
Тема Re: Syntax
Дата
Msg-id CANzqJaDAPO--6wpZPrbVAkKgtbA7Y9WGSg5wLcdy5YK0OFr+LQ@mail.gmail.com
обсуждение исходный текст
Ответ на Syntax  (arun chirappurath <arunsnmimt@gmail.com>)
Список pgsql-general
On Thu, Dec 7, 2023 at 3:01 AM arun chirappurath <arunsnmimt@gmail.com> wrote:
Hi All,

What is the difference or use case for below syntaxes?

do $$ 
declare d int; 
begin 
RAISE INFO 'Script started at %', CURRENT_TIMESTAMP;
update employees set first_name = 'g' where employee_id = 1; get diagnostics d = row_count; raise info 'selected: % rows', d; 
RAISE INFO 'Script finished at %', CURRENT_TIMESTAMP; end;$$;

Or

Just 

Begin;

Update statements 

Commit;

One shows when the statement started, and when you think it ended, while the other doesn't.


"Since these functions return the start time of the current transaction, their values do not change during the transaction."

What you really want is clock_timestamp().
 

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

Предыдущее
От: Arne Henrik Segtnan
Дата:
Сообщение: Re: PostgreSQL 12 error unrecognized configuration parameter zbx_tmp.wal_json_res
Следующее
От: Daniel Gustafsson
Дата:
Сообщение: Re: Trainning and Certification