The Vertica Forum recently got a makeover! Let us know what you think by filling out this short, anonymous survey.

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 ?

Comments

  • 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.
  • 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.
  • 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.
  • 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
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file

Can't find what you're looking for? Search the Vertica Documentation, Knowledge Base, or Blog for more information.