Reputation: 825
Im running the next postgres query using the next bash command.
sudo -u postgres bash -c "psql -d db -c \"SELECT ip FROM db_accounts;\"" \>/dev/null
The output is a table but before the table is printed, I get the following info prints
> psql: /usr/lib64/libssl.so.10: no version information available
> (required by psql) psql: /usr/lib64/libcrypto.so.10: no version
> information available (required by /usr/pgsql-9.4/lib/libpq.so.5)
> psql: /usr/lib64/libssl.so.10: no version information available
> (required by /usr/pgsql-9.4/lib/libpq.so.5)
I want to run my command without these prints appearing.
I tried to change the end of the command >/dev/null to 2>/dev/null and indeed the prints were disable but my table was not fully displayed (out of 800 rows only 40 were displayed), Can someone help me please?
Upvotes: 0
Views: 168
Reputation: 825
To fix want I wanted I added --pset pager=off to the psql to get the whole table and the disable the prints I change the end of the command to 2>/dev/null
final command: sudo -u postgres bash -c "psql --pset pager=off --quiet -d db -c \"SELECT ip FROM db_accounts;\"" 2>/dev/null
Upvotes: 0