Run a query after 1 second in postgresql

Rohit Bajaj
Rohit Bajaj used Ask the Experts™
on
Hi,
I am using postgresql database.
I want to run a query like insert into some table...
But i want to make it run say after 1 second.
Is there any way to do that...like append something to the insert query and make it a bigger query and
when you run that it runs the exact insert query but after 1 second.

Thanks
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
You may call the pg_sleep function before the INSERT command, e.g.:
SELECT pg_sleep(1);
or
PERFORM pg_sleep(1);

More info: https://www.postgresql.org/docs/9.6/functions-datetime.html

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial