Thread: How to add description for databases and tables?
Hello! I'm a PostgreSQL novice, and am currently learning PostgreSQL administration. Using \d+ exposes a column "Description". Now, how do I add a Description to a table and/or a column? There does not seem to be any option during CREATE DATABASE or CREATE TABLE. TIA. Rgds, -- FdS Pandu E Poluan ~ IT Optimizer ~ • LOPSA Member #15248 • Blog : http://pepoluan.tumblr.com • Linked-In : http://id.linkedin.com/in/pepoluan
On Tue, 6 Dec 2011 14:57:43 +0700 Pandu Poluan <pandu@poluan.info> wrote: > Hello! I'm a PostgreSQL novice, and am currently learning PostgreSQL > administration. > > Using \d+ exposes a column "Description". Now, how do I add a > Description to a table and/or a column? There does not seem to be any > option during CREATE DATABASE or CREATE TABLE. http://www.postgresql.org/docs/9.1/static/sql-comment.html > > TIA. > > Rgds, -- Carlo Ascani - 2ndQuadrant Italia PostgreSQL Training, Services and Support carlo.ascani@2ndQuadrant.it - www.2ndQuadrant.it
Use the Comment on ... syntax e.g.
comment on table my_table is 'this is a useful comment';
or
comment on column my_table.my_column is 'this contains some information' ...
look at the full comment on syntax
rgds
Didier
Thanks, Carlo & Didier :-) Rgds, On Wed, Dec 7, 2011 at 14:20, Didier Gasser-Morlay <didiergm@gmail.com> wrote: > Use the Comment on ... syntax e.g. > > comment on table my_table is 'this is a useful comment'; > > or > > comment on column my_table.my_column is 'this contains some information' ... > > look at the full comment on syntax > > rgds > Didier -- FdS Pandu E Poluan ~ IT Optimizer ~ • LOPSA Member #15248 • Blog : http://pepoluan.tumblr.com • Linked-In : http://id.linkedin.com/in/pepoluan
>> Using \d+ exposes a column "Description". Now, how do I add a >> Description to a table and/or a column? There does not seem to be any >> option during CREATE DATABASE or CREATE TABLE. > > http://www.postgresql.org/docs/9.1/static/sql-comment.html The pgAdmin app lets you enter text in the "Comment" field of a table or column's Properties dialog. --Basil Bourque
On Wed, Dec 7, 2011 at 14:50, Basil Bourque <basil.list@me.com> wrote: >>> Using \d+ exposes a column "Description". Now, how do I add a >>> Description to a table and/or a column? There does not seem to be any >>> option during CREATE DATABASE or CREATE TABLE. >> >> http://www.postgresql.org/docs/9.1/static/sql-comment.html > > The pgAdmin app lets you enter text in the "Comment" field of a table or column's Properties dialog. > Hmm... but that means I have to knock open a port on the firewall (the PostgreSQL box is cloud-hosted)... ... doable, if less secure. I'll look into it. Thanks! Rgds, -- FdS Pandu E Poluan ~ IT Optimizer ~ • LOPSA Member #15248 • Blog : http://pepoluan.tumblr.com • Linked-In : http://id.linkedin.com/in/pepoluan