0

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
3
  • 1
    sudo -u postgres psql TestDB -c "select count(*) from config where var_name='url'" Commented Jul 12, 2013 at 11:39
  • 2
    @Patrick You should make that an answer, so that it can be accepted. Commented Jul 12, 2013 at 11:44
  • @AnsgarWiechers ok i did ;-) Commented Jul 12, 2013 at 11:47

1 Answer 1

3
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

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.