Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm not a DBA but seem to recall that there was a SQL database that stored column labels (preferred column headings that can be printed on reports). Does Postgres support labels such as these?

share|improve this question

No. (You may be thinking of MS Access.)

But you can easily substitute with a VIEW. Like in almost any RDBMS.

share|improve this answer
Thanks. I was hoping that the labels could be read along with the column values to maintain label consistency. – Linda Jan 10 '14 at 1:43

You might be refereing to catalog level comments, which can be used to get a description of any table and or column in the database.

Those are created using:

COMMENT ON TABLE yourtable IS 'A good description';
COMMENT ON COLUMN yourtable.yourcolumn IS 'Column desc';

To query those, you can use this kind of query:

SELECT c.table_schema,c.table_name,c.column_name,pgd.description
FROM pg_catalog.pg_statio_all_tables as st
inner join pg_catalog.pg_description pgd on (pgd.objoid=st.relid)
inner join information_schema.columns c on (pgd.objsubid=c.ordinal_position
and  c.table_schema=st.schemaname and c.table_name=st.relname)
where table_name = 'yourtablename'

Beware however that this cannot be localized.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.