Home:ALL Converter>Getting list of column names in a table (PostgreSQL)

Getting list of column names in a table (PostgreSQL)

Ask Time:2019-08-06T20:09:15         Author:AddyProg

Json Formatter

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

Author:AddyProg,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/57375761/getting-list-of-column-names-in-a-table-postgresql
yy