0

Quote from current Postgres manual

\watch [ seconds ] Repeatedly execute the current query buffer (as \g does) until interrupted or the query fails. Wait the specified number of seconds (default 2) between executions. Each query result is displayed with a header that includes the \pset title string (if any), the time as of query start, and the delay interval.

Is there some similar functionality for MariaDB or MySQL?

For example this statement I wish to repeat every 2 seconds. In Linux it's the watch command

NAME
       watch - execute a program periodically, showing output fullscreen

run statement till state changes.

SELECT * FROM TABLE WHERE state = retry
1
  • No. What query were you wanting to repeat?
    – Rick James
    Jan 12, 2017 at 18:48

1 Answer 1

1

Not quite what you want, but this shell command might suffice:

$ mysql ... -e "SELECT * FROM TABLE WHERE state = retry"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.