Re: how can I get the length of columns of a table by system tables/views

Поиск
Список
Период
Сортировка
От shuaixf
Тема Re: how can I get the length of columns of a table by system tables/views
Дата
Msg-id 1315633526507-4788780.post@n5.nabble.com
обсуждение исходный текст
Ответ на how can I get the length of columns of a table by system tables/views  (shuaixf <shuaixf@gmail.com>)
Список pgsql-admin
SELECT a.attname, pg_catalog.format_type(a.atttypid, a.atttypmod)
FROM pg_catalog.pg_attribute a
WHERE a.attrelid = (SELECT pg_class.oid
                    FROM pg_class INNER JOIN pg_namespace
                       ON (pg_class.relnamespace = pg_namespace.oid
                           AND lower(pg_namespace.nspname) = 'public')
                   WHERE pg_class.relname='tablename')
  AND a.attnum > 0 AND NOT a.attisdropped
ORDER BY a.attnum;

--
View this message in context:
http://postgresql.1045698.n5.nabble.com/how-can-I-get-the-length-of-columns-of-a-table-by-system-tables-views-tp4778911p4788780.html
Sent from the PostgreSQL - admin mailing list archive at Nabble.com.

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

Предыдущее
От: albert
Дата:
Сообщение: Re: MSAccess migration to Postgres through ODBC
Следующее
От: Guillaume Lelarge
Дата:
Сообщение: Re: access log for 1 table