Re: [GENERAL] item descriptions in psql

Поиск
Список
Период
Сортировка
От Gene Selkov, Jr.
Тема Re: [GENERAL] item descriptions in psql
Дата
Msg-id 199912220757.BAA26921@mail.xnet.com
обсуждение исходный текст
Ответ на item descriptions in psql  ("J. Roeleveld" <j.roeleveld@softhome.net>)
Список pgsql-general
> Hi,
>
> I just found a reference to descriptions to functions/tables/...etc.
> and am now wondering how to add them myself?
>
> Joost Roeleveld

not sure if there is a shortcut to this (it's short enough already):

INSERT INTO pg_description (objoid, description)
  SELECT oid, 'your description' FROM pg_class WHERE relname = 'your_table_name';

INSERT INTO pg_description (objoid, description)
  SELECT oid, 'your description' FROM pg_proc WHERE proname = 'your_procedure_name';

INSERT INTO pg_description (objoid, description)
  SELECT oid, 'your description' FROM pg_type WHERE typname = 'your_type_name';

INSERT INTO pg_description (objoid, description)
  SELECT oid, 'your description' FROM pg_operator WHERE oprname = 'your_operator_name';

(in case of operators, oprname is '=', '<=', '>>~', etc.)

in older versions (pre-6.3), one had to typecast the names and descriptions:

INSERT INTO pg_description (objoid, description)
  SELECT oid, 'your description'::text FROM pg_type WHERE typname = 'your_type_name'::name;

--Gene

В списке pgsql-general по дате отправления:

Предыдущее
От: Ed Loehr
Дата:
Сообщение: Re: [GENERAL] Index pg_proc_prosrc_index: NUMBER OF INDEX' TUPLES (1071)ISNOT THE SAME AS HEAP' (1070)
Следующее
От: Kevin Lo
Дата:
Сообщение: Re: [INTERFACES] Announce: PostgreSQL-6.5.3 binaries available forWindows NT