From 7acc237744b3e9a697959eec367adb44fff554a7 Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Fri, 15 Oct 1999 01:49:49 +0000 Subject: This patch implements ORACLE's COMMENT SQL command. >From the ORACLE 7 SQL Language Reference Manual: ----------------------------------------------------- COMMENT Purpose: To add a comment about a table, view, snapshot, or column into the data dictionary. Prerequisites: The table, view, or snapshot must be in your own schema or you must have COMMENT ANY TABLE system privilege. Syntax: COMMENT ON [ TABLE table ] | [ COLUMN table.column] IS 'text' You can effectively drop a comment from the database by setting it to the empty string ''. ----------------------------------------------------- Example: COMMENT ON TABLE workorders IS 'Maintains base records for workorder information'; COMMENT ON COLUMN workorders.hours IS 'Number of hours the engineer worked on the task'; to drop a comment: COMMENT ON COLUMN workorders.hours IS ''; The current patch will simply perform the insert into pg_description, as per the TODO. And, of course, when the table is dropped, any comments relating to it or any of its attributes are also dropped. I haven't looked at the ODBC source yet, but I do know from an ODBC client standpoint that the standard does support the notion of table and column comments. Hopefully the ODBC driver is already fetching these values from pg_description, but if not, it should be trivial. Hope this makes the grade, Mike Mascari (mascarim@yahoo.com) --- src/include/nodes/nodes.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/include/nodes/nodes.h') diff --git a/src/include/nodes/nodes.h b/src/include/nodes/nodes.h index 08705ea9f6..09f60466f4 100644 --- a/src/include/nodes/nodes.h +++ b/src/include/nodes/nodes.h @@ -6,7 +6,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: nodes.h,v 1.54 1999/10/02 21:33:33 tgl Exp $ + * $Id: nodes.h,v 1.55 1999/10/15 01:49:47 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -152,6 +152,7 @@ typedef enum NodeTag T_DefineStmt, T_DestroyStmt, T_TruncateStmt, + T_CommentStmt, T_ExtendStmt, T_FetchStmt, T_IndexStmt, -- cgit v1.2.1