DBA Hub

📋Steps in this guide1/1

Run a query repeatedly automatically

-- You can use watch command to run a particular query repeatedly until you cancel it. -- watch 3 , means for every 3 seconds, the previous query will be executed

postgresql configurationintermediate
by PostgreSQL
30 views
1

Run a query repeatedly automatically

-- You can use watch command to run a particular query repeatedly until you cancel it. -- watch 3 , means for every 3 seconds, the previous query will be executed

Code/Command (click line numbers to comment):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
postgres=#
select count(*) from test;
count
-------
4226
(1 row)
postgres=#
\watch 3
Tue 19 Apr 2022 08:18:17 PM +03 (every 3s)
count
-------
4226
(1 row)
Tue 19 Apr 2022 08:18:20 PM +03 (every 3s)
count
-------
4226
(1 row)

Comments (0)

Please to add comments

No comments yet. Be the first to comment!