Skip to main content
Question

Different formatting of array column in vsql and JDBC

  • July 2, 2024
  • 2 replies
  • 8 views

scherepanov
Forum|alt.badge.img+1

Hi,

I just stumbled that vsql and Vertica JDBC are using different formatting for array datatypes.

$ /opt/vertica/bin/vsql -h myhost -U myuser -w mypwd -c "select array[1,2,3]"

array

[1,2,3]
(1 row)

JDBC (I am using DbVisualizer):

select ARRAY[1,2,3];

{1,2,3}

I thought that DbVisualizer tool has formatting for array datatypes - but it does not.
Vertica JDBC driver v 24.2 API docs are not mentioning anything about handling array type.

Looks like really Vertica JDBC driver return array as string in curly brackets? While vsql return in square brackets?

Thank you
Sergey

2 replies

mosheg
Forum|alt.badge.img+2
  • Participating Frequently
  • July 3, 2024

This behavior is not necessarily related to the Vertica JDBC client, as DBeaver, using the same JDBC client, displays arrays in square brackets [], while DbVisualizer uses curly brackets {} for array formatting.


scherepanov
Forum|alt.badge.img+1
  • Author
  • Participating Frequently
  • July 3, 2024

Thanks for checking it!
It appears this behaviour is specific to client.