Thread: Question on comment
I note from <URL:http://www.postgresql.org/docs/user/sql-comment.htm> that 'comment on' is now implemented in PostgreSQL. The documentation do not specify when this statement became available. I'm currently using v6.5.3 and it is not available there. I suggest adding information in the documentation about when (ie. which version) a new statement was implemented. Do I have to move to 7.x to get this feature? The documentation do not mention any tools for extracting these comments into text, HTML or any other format. Do these exist? Is it possible to extract these comments using some SQL query? -- ##> Petter Reinholdtsen <## | pere@td.org.uit.no
IIRC, the COMMENT command was added in 7.0. But it's just a user interface to the pg_description table, which has existed for awhile. pg_description is the thing to look at if you want to manipulate comments directly. Basically it maps OIDs to comments... regards, tom lane
> IIRC, the COMMENT command was added in 7.0. But it's just a user > interface to the pg_description table, which has existed for awhile. > pg_description is the thing to look at if you want to manipulate > comments directly. Basically it maps OIDs to comments... Hm, OK. How are the access rights to this table when 'comment on' is used? I remember trying earlier to use this table to store comments, but discovered each user had to have write access, even to add comments on their own tables. Is this problem fixed? -- ##> Petter Reinholdtsen <## | pere@td.org.uit.no
Petter Reinholdtsen <pere@hungry.com> writes: > Hm, OK. How are the access rights to this table when 'comment on' is > used? Use the source, Luke ... a quick scan of command/comment.c shows that it allows the owner of an object to comment on that object, and no one else. Access rights to pg_description itself don't matter. The general practice in Postgres is that system tables are accessible read-only to everyone, but are writable only via specialized commands (like COMMENT ON for pg_description). The database superuser is not so restricted, and can shoot himself in the foot with abandon ;-) > I remember trying earlier to use this table to store comments, but > discovered each user had to have write access, even to add comments on > their own tables. Is this problem fixed? An explicit "INSERT INTO pg_description" would be treated that way. regards, tom lane