Also, throughout this thread, you have given us 2 separate ports: 5472 and 5432 (default).
In _this_ example, you set the database to "postgres," not to "Server4," as well.
Then there's that whole "foo," versus "foo2," thing going on...
There are a lot of differences in what you have sent over the course of this thread.
I would back up, take a deep breath, and start over.
1) Connect to your database something like this:
psql ___name of database___
2) SELECT * from "foo2";
3) Does that work? Once you make that work, proceed to test from the command line like this:
psql ___name of database__ -c "SELECT * from \"foo2\" ; "
If you make 1 and 2 work, 3 should work. BUT ALL OF THE OPTIONS HAVE TO BE THE SAME.
You cannot select * from foo in steps 1 and 2 and select * from foo2 in step 3.
You cannot use port 5472 in step 1/2 and 5432 in step 3.
You cannot connect to the db postgres in steps 1/2 and another db in step 3.
That invalidates your process.
Journyx, Inc.
7600 Burnet Road #300
Austin, TX 78757
www.journyx.com
p 512.834.8888
f 512-834-8858
Do you receive our promotional emails? You can subscribe or unsubscribe to those emails here.