I am trying to get list of column names of a table in postgreSQL via query. I have searched online for some solutions, but none give expected results. Here is what I have tried.
select column_name
from information_schema.columns
where table_name = 'Accounts';
it gives me:
Column_name
----------------
character varying
What I am looking for is
Columns
-------
AccountName
AccountId
Address
ContactPerson
column_nameshould be the column name. It is unlikely that there is a column named "character varying" anywhere the in the database, but it is, of course, possible.