Re: Are there commands to enquire about table structure?

Поиск
Список
Период
Сортировка
От Lee Harr
Тема Re: Are there commands to enquire about table structure?
Дата
Msg-id BAY2-F1585tuRj3mEJN00052360@hotmail.com
обсуждение исходный текст
Список pgsql-general
>PostgreSQL mavens, can I ask the database, in a normal database query
>command, or in other words,
>essentially using the same environment where I'd say...
>
>     SELECT count(*) FROM mytable [WHERE myconditions_obtain];
>
>...to get # records in my table,
>
>o How many fields mytable has as in:
>     SELECT fieldcount(*) from mytable
>

In 7.4 anyhow, I bet you can do much of this with the
information_schema. This one would be ...

SELECT count(*)
    FROM information_schema.columns
    WHERE table_name='mytable';

_________________________________________________________________
Add photos to your messages with MSN 8. Get 2 months FREE*.
http://join.msn.com/?page=features/featuredemail


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

Предыдущее
От: "Manuel Tejada"
Дата:
Сообщение: PostgreSQL 7.4.1 and pgdb.py
Следующее
От: "Ezra Epstein"
Дата:
Сообщение: Re: If table A value IS NULL then table B