\watch command does not work
See original GitHub issue(this is a minor issue as \watch
is not a well known command)
PostgreSQL has a \watch
command to repeat queries every X seconds (as documented here): https://www.postgresql.org/docs/current/static/app-psql.html
It works perfectly on the psql CLI:
gab@db > SELECT 1; \watch 1;
?column?
----------
1
(1 row)
Time: 0.187 ms
Watch every 1s Wed Jul 6 12:01:54 2016
?column?
----------
1
(1 row)
Time: 0.047 ms
Watch every 1s Wed Jul 6 12:01:55 2016
?column?
----------
1
(1 row)
Time: 0.154 ms
Watch every 1s Wed Jul 6 12:01:56 2016
?column?
----------
1
(1 row)
Time: 0.164 ms
It does not work with pgcli:
db> SELECT 1; \watch 1;
+------------+
| ?column? |
|------------|
| 1 |
+------------+
SELECT 1
syntax error at or near "\"
LINE 1: \watch 1
^
Time: 0.003s
Issue Analytics
- State:
- Created 7 years ago
- Reactions:3
- Comments:18 (9 by maintainers)
Top Results From Across the Web
Watch command does not work anymore - Ask Ubuntu
1 Answer 1 · Rename the local watch ( /usr/local/bin ) as something else, given renaming won't create any problem · Edit your...
Read more >Linux watch command not working in script - Stack Overflow
It works if you write the script into a file and execute it. Then it doesn't have to be a hideous one-liner, but...
Read more >`watch` command doesn't work properly · Issue #8869 - GitHub
Steps to reproduce. Run watch command. Expected behavior. Should look like the powershell output in the image (1) below. Actual behavior.
Read more >Linux Watch Command - Examples And How to Use It
Linux watch command lets you repeatedly run a command or utility in regular time intervals. Learn how it works and what it can...
Read more >Shell script error ONLY when using watch command
Your script doesn't have a shebang. The watch command is likely executing it using /bin/sh , which doesn't support the <(command) process ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I guess the question is more “Is
\watched
supposed to mimic thepsql
\watch
behaviour exactly (as it seems the otherpgcli
\xxxx
functions do?”If
pgcli
is just trying to be feature similar, it’s certainly there already, just fixing\?
would suffice.If
pgcli
is trying to act like a betterpsql
, it’s definitely not correct yet.Fixed in pgspecial 1.8.0.