| От | Haller Christoph |
|---|---|
| Тема | Re: How to see the definition of an existing table? |
| Дата | |
| Msg-id | 200109180919.LAA22407@rodos обсуждение исходный текст |
| Ответ на | How to see the definition of an existing table? (ke wang <kw68@cornell.edu>) |
| Список | pgsql-sql |
Within psql you can do commands like \d <tablename> to learn rudimentary information about a table. Try this to learn more sophisticated information select u.usename, t.typname, a.attname, a.atttypid, a.attlen, a.attnotnull, a.attnum from pg_user u, pg_type t, pg_attribute a where u.usesysid = t.typowner and t.typrelid = a.attrelid and t.typtype = 'c' and t.typname = 'pg_attribute' where 'pg_attribute' should be replaced by the table's name you are interested in. Unfortunately, I don't know nothing about how to find the primary key in a table definition. But go for the PostgreSQL documentation - Chapter System Catalogs - this should give you at least an idea which system catalog may deliver the information. Regards, Christoph
В списке pgsql-sql по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера