Hallo zusammen,

@Andreas: psql -t ist das Geheimins, denn:

Code:
postgres@server:~/daily_overwriting$ psql garfield -c "select procpid from pg_stat_activity"
procpid 
---------
   30578
   30579
   30634
   30823
(4 Zeilen)
aber:

Code:
postgres@server:~/daily_overwriting$ psql garfield -t -c "select procpid from pg_stat_activity"
30578
30579
30634
30823
Und das ist das was ich brauche! Cool Danke.

@ads:

Gute Möglichkeit! Werde ich checken.

Und wenn es interessiert, wie man das machen kann ohne die postgreSQL in einem shell script:

Code:
ps aux | grep "postgres: pgadmin $DB" | grep -v grep | awk '{print $2}' | while read pid; do kill $pid;done
oder:

Code:
pgrep -f 'postgres: pgadmin' | while read pid; do kill $pid; done
oder:

Code:
pkill -f 'postgres: pgadmin'
Besten Dank und Grüße

Andreas