Discussion:
Notes or comments on columns in a table
(too old to reply)
Campbell, Lance
2013-02-14 19:09:17 UTC
Permalink
PostgreSQL 9.2
When creating a table or altering a column of a table, is there a way to add notes on a column?

If not:
I have a new enhancement request. When creating a table or altering a column, it would be nice if a user could add "comments" or "notes" to a column. This note would only appear when doing "\d table_name".

Why? I was adding a new column to a table called "type". Normally I only add types as characters even though integers are much better for indexing. The problem with integers is I never remember what value means what. Does a 1 mean directory or file. So I end up creating "type" as a character so I can do a quick SELECT DISTINCT to figure out the options. I would use integers if I could do \d table_name to see in the notes section what values meant. I would think other people run into this issue all the time.


Thanks,

Lance Campbell
Software Architect
Web Services at Public Affairs
217-333-0382
[University of Illinois at Urbana-Champaign logo]<http://illinois.edu/>
Thomas Kellerer
2013-02-14 20:10:10 UTC
Permalink
Post by Campbell, Lance
PostgreSQL 9.2
When creating a table or altering a column of a table, is there a way
to add notes on a column?
comment on table foo is 'the foo table';
comment on column foo.bar is 'the bar column';

http://www.postgresql.org/docs/current/static/sql-comment.html
--
Sent via pgsql-admin mailing list (pgsql-***@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin
Campbell, Lance
2013-02-15 15:07:22 UTC
Permalink
I got it to work! You use the COMMENT in conjunction with \d+. Very nice.

PostgreSQL Development Team,
Thank you so much for having the COMMENT feature in PostgreSQL. This is great!


Thanks,

Lance Campbell
Software Architect
Web Services at Public Affairs
217-333-0382




-----Original Message-----
From: pgsql-admin-***@postgresql.org [mailto:pgsql-admin-***@postgresql.org] On Behalf Of Thomas Kellerer
Sent: Thursday, February 14, 2013 2:10 PM
To: pgsql-***@postgresql.org
Subject: Re: [ADMIN] Notes or comments on columns in a table
Post by Campbell, Lance
PostgreSQL 9.2
When creating a table or altering a column of a table, is there a way
to add notes on a column?
comment on table foo is 'the foo table'; comment on column foo.bar is 'the bar column';

http://www.postgresql.org/docs/current/static/sql-comment.html



--
Sent via pgsql-admin mailing list (pgsql-***@postgresql.org) To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin
--
Sent via pgsql-admin mailing list (pgsql-***@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin
Viktor
2013-02-20 15:48:59 UTC
Permalink
Hello,

Could explain somebody what will happen, if the slave server fails ?
Will it affect the master functionality/availability ?

I'm using simple master-slave replication with 2 servers.


--
Best regards
--
Sent via pgsql-admin mailing list (pgsql-***@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin
Gilberto Castillo
2013-02-20 15:56:53 UTC
Permalink
Post by Viktor
Hello,
Could explain somebody what will happen, if the slave server fails ?
Will it affect the master functionality/availability ?
nothing!!! the Master continuo work. ;-)))
Post by Viktor
I'm using simple master-slave replication with 2 servers.
--
Best regards
--
http://www.postgresql.org/mailpref/pgsql-admin---
This message was processed by Kaspersky Mail Gateway 5.6.28/RELEASE
running at host imx2.etecsa.cu
Visit our web-site: <http://www.kaspersky.com>, <http://www.viruslist.com>
Saludos,
Gilberto Castillo
La Habana, Cuba
Viktor
2013-02-20 16:04:31 UTC
Permalink
Ook, thanks =)
Post by Gilberto Castillo
Post by Viktor
Hello,
Could explain somebody what will happen, if the slave server fails ?
Will it affect the master functionality/availability ?
nothing!!! the Master continuo work. ;-)))
Post by Viktor
I'm using simple master-slave replication with 2 servers.
--
Best regards
--
http://www.postgresql.org/mailpref/pgsql-admin---
This message was processed by Kaspersky Mail Gateway 5.6.28/RELEASE
running at host imx2.etecsa.cu
Visit our web-site: <http://www.kaspersky.com>, <http://www.viruslist.com>
Saludos,
Gilberto Castillo
La Habana, Cuba
---
This message was processed by Kaspersky Mail Gateway 5.6.28/RELEASE running at host imx3.etecsa.cu
Visit our web-site: <http://www.kaspersky.com>, <http://www.viruslist.com>
Prashanth Ranjalkar
2013-02-21 01:40:06 UTC
Permalink
It depends on the type of replication is used.

If it's a slony replication then master continues to work and will catch up
when slave is available.

However if the Streaming replication is used, Matser continues to work if
slave is unavailable till it finds space for WAL archiving on master,
depends on the archieving strategy that implemented while configuring
replication. WAL's keep accumulating on the master server till it applies
to Slave server after it is available. As long as it find space on master,
there is no impact but once it fills all the space, master may go down.
**
*Thanks & Regards,*
*** *
*Prashanth Ranjalkar*
*Database Consultant & Architect*
*www.postgresdba.net*
Post by Viktor
Ook, thanks =)
Hello,
Could explain somebody what will happen, if the slave server fails ?
Will it affect the master functionality/availability ?
nothing!!! the Master continuo work. ;-)))
I'm using simple master-slave replication with 2 servers.
--
Best regards
--
To make changes to your subscription:http://www.postgresql.org/mailpref/pgsql-admin---
This message was processed by Kaspersky Mail Gateway 5.6.28/RELEASE
running at host imx2.etecsa.cu
Visit our web-site: <http://www.kaspersky.com> <http://www.kaspersky.com>, <http://www.viruslist.com> <http://www.viruslist.com>
Saludos,
Gilberto Castillo
La Habana, Cuba
---
This message was processed by Kaspersky Mail Gateway 5.6.28/RELEASE running at host imx3.etecsa.cu
Visit our web-site: <http://www.kaspersky.com> <http://www.kaspersky.com>, <http://www.viruslist.com> <http://www.viruslist.com>
Loading...