I work with PostgreSQL 9.2 and bash script. I have a problem.
My DB is TestDB , Table name is config
and my bash code is
sudo -u postgres psql -c "select count(*) from public.config where var_name='url'"
result is
ERROR: relation "public.config" does not exist
Can anybody help me?
asked Jul 12, 2013 at 11:36
-
1sudo -u postgres psql TestDB -c "select count(*) from config where var_name='url'"cptPH– cptPH2013年07月12日 11:39:48 +00:00Commented Jul 12, 2013 at 11:39
-
2@Patrick You should make that an answer, so that it can be accepted.Ansgar Wiechers– Ansgar Wiechers2013年07月12日 11:44:49 +00:00Commented Jul 12, 2013 at 11:44
-
@AnsgarWiechers ok i did ;-)cptPH– cptPH2013年07月12日 11:47:44 +00:00Commented Jul 12, 2013 at 11:47
1 Answer 1
sudo -u postgres psql TestDB -c "select count(*) from config where var_name='url'
The Database was missing, so you executed the command into postgres db where you probably don't have that table ;-)
answered Jul 12, 2013 at 11:45
Sign up to request clarification or add additional context in comments.
Comments
default