VSQL formats boolean column values as "t" and "f"

Is there a way to make it format it in some other way, like true --> "true", and false --> "false", or true --> 1 and false --> 0 ?


  • Options
    Not sure about vsql options, but you could use SQL itself to do the formatting, something like (c1 is a boolean column in table bool): dbadmin=> select case when c1 is true then 1 else 0 end from bool; case ------ 1 0 (2 rows) HTH.
  • Options
    I was hoping to not have to do that. In the documentation, it says that for input Vertica can accept boolean data values as 't', 'y', '1', 'yes', 'true', 1 for true and 'f', 'n', '0', 'no', 0 for false respectively. It makes sense that formatting for the output should be able to do the same formats that can be used for input.
  • Options
    no worries. I just wrote something to get the column data types and just cast to int all the boolean columns. but it would be nice to be able to specify how booleans are formatted when they are being output.
  • Options
    Hi David,
    If you'd like to see this included in a future release, please feel free to create a topic in the "Ideas" section. Thanks for your input!

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file