Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get the postgres console output code from restore_sql #8

Open
gaborcsardi opened this issue May 2, 2015 · 0 comments
Open

Get the postgres console output code from restore_sql #8

gaborcsardi opened this issue May 2, 2015 · 0 comments

Comments

@gaborcsardi
Copy link

For a table that exists:

root@r-pkg:~# echo "select NULL foo from daily LIMIT 1" | dokku psql:restore_sql cranlogs
 foo 
-----

(1 row)

root@r-pkg:~# echo $?
0

For a table that does not exist:

root@r-pkg:~# echo "select NULL foo from foobar LIMIT 1" | dokku psql:restore_sql cranlogs
ERROR:  relation "foobar" does not exist
LINE 1: select NULL foo from foobar LIMIT 1
                             ^
root@r-pkg:~# echo $?
0

It would be useful to check if the query finished properly. I could also try to parse the output, but it would be simpler to just return the exit code of psql.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant