Remove header (column names) from query result

2.1k views Asked by At

I am using a Java based program and I am writing a simple select query inside that program to retrieve data from the PostgreSQL database. The data come with the header which is an error for the rest of my codes.

How do I get rid of all column headings in an SQL query? I just want to print out the raw data without any headings.

I am using Building Controls Virtual Test Bed (BCVTB) to connect my database to EnergyPlus. This BCVTB has a database actor that you can write a query in it and receive data and send it to your other simulation program. I decided to use PostgreSQL. however when I write Select * From mydb, it brings data with the column names (header). I just want raw data without header. what should I do?

1

There are 1 answers

0
Craig Ringer On

PostgreSQL does not send table headings, not like a CSV file. The protocol (as used via JDBC) sends the rows. The driver does request a description of the rows that includes column names, but it is not part of the result set rows like the "header first" convention for CSV.

Whatever is happening must be a consequence of the BCVTB tools you are using, and I suggest pursuing it on that side of things.