do $$ declare created_at time := now(); begin raise notice '%', created_at; perform pg_sleep(10); raise notice '%', created_at; end $$; Code language: PostgreSQL SQL dialect and PL/pgSQL (pgsql)
do $$ declare created_at time := now(); begin raise notice '%', created_at; perform pg_sleep(10); raise notice '%', created_at; end $$; Code language: PostgreSQL SQL dialect and PL/pgSQL (pgsql)