Make a Cow Display Query Results in VSQL

Posted August 19, 2019 by Jim Knicely, Vertica Principal Solution Architect

Cow peering around edge of frame with blue sky and clouds in shape of a comic book thought bubble.
I used to have fun with the amusing old Linux command Cowsay. It inserts any input into a word bubble and draws an ASCII cow to talk to you.

You can make the cow display your query results in VSQL!

Example: dbadmin=> \! rpm -qa | grep cowsay cowsay-3.04-4.el7.noarch dbadmin=> \! cowsay I love VERTICA! _________________ < I love VERTICA! > ----------------- \ ^__^ \ (oo)\_______ (__)\ )\/\ ||----w | || || dbadmin=> CREATE TABLE some_data (c VARCHAR(10)); CREATE TABLE dbadmin=> INSERT INTO some_data SELECT 'A'; OUTPUT -------- 1 (1 row) dbadmin=> INSERT INTO some_data SELECT 'B'; OUTPUT -------- 1 (1 row) dbadmin=> INSERT INTO some_data SELECT 'C'; OUTPUT -------- 1 (1 row) dbadmin=> INSERT INTO some_data SELECT 'D'; OUTPUT -------- 1 (1 row) dbadmin=> COMMIT; COMMIT dbadmin=> \! vsql -Atc "SELECT c FROM some_data ORDER BY c;" | cowsay _________ < A B C D > --------- \ ^__^ \ (oo)\_______ (__)\ )\/\ ||----w | || || Helpful Links:

https://en.wikipedia.org/wiki/Cowsay https://www.vertica.com/docs/latest/HTML/Content/Authoring/ConnectingToVertica/vsql/Meta-Commands/MetaCommandReference.htm

Have fun!