diff options
| author | Bruce Momjian <bruce@momjian.us> | 1999-10-15 01:49:49 +0000 |
|---|---|---|
| committer | Bruce Momjian <bruce@momjian.us> | 1999-10-15 01:49:49 +0000 |
| commit | 7acc237744b3e9a697959eec367adb44fff554a7 (patch) | |
| tree | 1650324239bd74896111cf5922c9463c60d788c5 /src/include/catalog | |
| parent | 55fa71a9e9c766ec477f4cb41c630f1851fa2adc (diff) | |
| download | postgresql-7acc237744b3e9a697959eec367adb44fff554a7.tar.gz | |
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)
Diffstat (limited to 'src/include/catalog')
| -rw-r--r-- | src/include/catalog/heap.h | 5 | ||||
| -rw-r--r-- | src/include/catalog/pg_description.h | 3 |
2 files changed, 6 insertions, 2 deletions
diff --git a/src/include/catalog/heap.h b/src/include/catalog/heap.h index faa708ff24..4720013160 100644 --- a/src/include/catalog/heap.h +++ b/src/include/catalog/heap.h @@ -6,7 +6,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: heap.h,v 1.22 1999/10/03 23:55:35 tgl Exp $ + * $Id: heap.h,v 1.23 1999/10/15 01:49:44 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -32,6 +32,9 @@ extern void heap_destroy_with_catalog(char *relname); extern void heap_truncate(char *relname); extern void heap_destroy(Relation rel); +extern void CreateComments(Oid object, char *comments); +extern void DeleteComments(Oid object); + extern void AddRelationRawConstraints(Relation rel, List *rawColDefaults, List *rawConstraints); diff --git a/src/include/catalog/pg_description.h b/src/include/catalog/pg_description.h index d50da53d92..5db9204669 100644 --- a/src/include/catalog/pg_description.h +++ b/src/include/catalog/pg_description.h @@ -6,7 +6,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: pg_description.h,v 1.8 1999/02/13 23:21:09 momjian Exp $ + * $Id: pg_description.h,v 1.9 1999/10/15 01:49:44 momjian Exp $ * * NOTES * the genbki.sh script reads this file and generates .bki @@ -65,3 +65,4 @@ typedef FormData_pg_description *Form_pg_description; */ #endif /* PG_DESCRIPTION_H */ + |
