Re: [INTERFACES] how to obtain column info

Поиск
Список
Период
Сортировка
От Cary B. O'Brien
Тема Re: [INTERFACES] how to obtain column info
Дата
Msg-id 199811110134.UAA07958@access1.digex.net
обсуждение исходный текст
Ответ на how to obtain column info  ("Ken J. Wright" <ken@ori-ind.com>)
Ответы Re: [INTERFACES] how to obtain column info
Список pgsql-interfaces
> With libpq, how do you obtain column info (like type) for a table *before*
> returning a result set? For instance, knowing the column type before
> constructing an insert statement. A date will need quotes, a number won't,
> a string will, etc.
>

I usually do a 'select * from table_x where oid < 0' or something like
that to get an empty result set.  This might be a stupid thing to do on
a big table, thought.  You might want to select a column with an index.
Anyone have a better idea?

Actually, you should be able to get the information out of the pg_ tables.

-- cary

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

Предыдущее
От: "Bryan White"
Дата:
Сообщение: Re: [INTERFACES] how to obtain column info
Следующее
От: Brett McCormick
Дата:
Сообщение: Re: [INTERFACES] how to obtain column info