Can someone tell me how I can use PQftype() or some other mechanism to interpret a query result in terms of the data types of the columns? I need to be able to tell what data type a given column is. The 6.3.2 manual says PQftype() returns an internal coding -- is this defined in a header file I can access, or ... ? thanks, Michael
Michael Olivier <mo@local2me.com> writes:
> Can someone tell me how I can use PQftype() or some other mechanism to
> interpret a query result in terms of the data types of the columns?
The PQftype value is the OID of the row for the type in the system
pg_type catalog. Try
SELECT * FROM pg_type WHERE oid = <PQftype result>
BTW: oid's for the predefined types are consistent across installations,
but oid's for user-defined types are not (and shouldn't even be trusted
across a save/reload).
regards, tom lane
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера