question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

\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:closed
  • Created 7 years ago
  • Reactions:3
  • Comments:18 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
fake-namecommented, Jan 15, 2018

I guess the question is more “Is \watched supposed to mimic the psql \watch behaviour exactly (as it seems the other pgcli \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 better psql, it’s definitely not correct yet.

2reactions
j-bennetcommented, Jun 9, 2017

Fixed in pgspecial 1.8.0.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found