Re: Dynamic table with variable number of columns

Поиск
Список
Период
Сортировка
От Bruno Wolff III
Тема Re: Dynamic table with variable number of columns
Дата
Msg-id 20060712024807.GA15900@wolff.to
обсуждение исходный текст
Ответ на Dynamic table with variable number of columns  (nkunkov@optonline.net)
Ответы Re: Dynamic table with variable number of columns  (nkunkov@optonline.net)
Список pgsql-general
On Tue, Jul 11, 2006 at 06:05:18 -0700,
  nkunkov@optonline.net wrote:
> Hello,
> I'm a pgsql novice and here is what I'm trying to do:
> 1.    I need to create a dynamic table with the column names fetched
> from the database using a select statement from some other table.  Is
> it possible?  Could you point me to a simple example on how to do it?
> 2.   I would like to compare the list of coulmn names which are values
> fetched from some table with the column names of the existing table.
> If one of the names doesn't exist as a column name of my table, I'd
> like to dynamically alter the table and add a coulmn with the name just
> fetched from the DB.
> Your help is greatly appreciated.
> Thanks
> NK

Information on the column names of tables in the database are available
from the information schema and the catlog tables. You can find more about this
in the documentation:
http://www.postgresql.org/docs/8.1/static/information-schema.html
http://www.postgresql.org/docs/8.1/static/catalogs.html

You might get better help by describing the actual problem you are trying to
solve rather than asking for help with a particular approach to solving that
problem. The approach you are trying seems to be seriously broken and it
would probably be a good idea to consider other approaches.

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

Предыдущее
От: Steve Atkins
Дата:
Сообщение: Re: Need help with quote escaping in exim for postgresql
Следующее
От: Bruno Wolff III
Дата:
Сообщение: Re: doesn't recognize "!=-" (not equal to a negative value)