If you want to run a query or a function and ditch the output, you can do something like this:
xinu=# select my_void_function() \g /dev/null