Tips & Tricks

Appending Standard Output to File


This quick tip shows how to append the standard output from vsql into a file.

In vsql, the \o FILE command is used to send query results to file. When needing to append this output to a single file, it can be done in a single session such as:

The output in test.txt looks like:

However, if there’s a need to append the output to file between sessions, the \o | COMMAND is used to pipe the query results:

The output in test.txt will then look like:


About the author / 

Norbert Krupa

Norbert is the founder of and a Solutions Engineer at Talend. He is an HP Accredited Solutions Expert for Vertica Big Data Solutions. He has written the Vertica Diagnostic Queries which aim to cover monitoring, diagnostics and performance tuning. The views, opinions, and thoughts expressed here do not represent those of the user's employer.


  1. Sudhakar October 25, 2014 at 8:12 AM -  Reply

    Hi Norbert,
    First of all Thank you for this very useful help and all your effort.
    Probably simple question:
    I want to -Atc option and execute adhoc queries from vsql command line while setting timing and get explain plan (and execution path). Primarily goal is to quickly execute several query (with minor modifications) to contract and compare performance metrics.

    May be there is better way to achieve this in Vertica. Coming from Oracle background I am looking for equivalent of “set autotrace traceonly statistics explain”

    Thanks in advance for your help.

    • Norbert Krupa October 25, 2014 at 8:57 AM -  Reply

      Perhaps I’m not clear on what your goal is. The \o command is within vsql, not the CLI. An alternative is to just enable profiling and look at the profiling system tables.

  2. Karthik S R September 19, 2016 at 7:36 AM -  Reply

    hi Norbert I get permission denied when I try this \o command can please help me.

    c:: Permission denied

    • Norbert Krupa September 19, 2016 at 10:50 AM -  Reply

      What is the exact command you are trying to run? Do you have permission to write to the output directory?

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Upcoming Events

  • No upcoming events
AEC v1.0.4

Subscribe to Blog via Email

Enter your email address to subscribe and receive notifications of new posts by email.

Read more use cases here.


This site is not affiliated, endorsed or associated with HPE Vertica. This site makes no claims on ownership of trademark rights. The author contributions on this site are licensed under CC BY-SA 3.0 with attribution required.
%d bloggers like this: