Parse a statement, get parameter types and return types

Поиск
Список
Период
Сортировка
От Richard Jones
Тема Parse a statement, get parameter types and return types
Дата
Msg-id 20050718130337.GA23201@furbychan.cocan.org
обсуждение исходный текст
Ответы Re: Parse a statement, get parameter types and return types
Список pgsql-interfaces
Given a statement, eg:
 select foo from bar where col = $1

I'd really like to get the types deduced by the PostgreSQL parser for
the input variables ($1, etc.) and the result column(s).  eg. it might
be $1 :: int4 and foo :: text, or whatever.

It seems from reading about PQprepare that getting the input types
isn't yet possible, but might be in future:

http://www.postgresql.org/docs/current/static/libpq-exec.html#AEN23157

I have no idea where to start getting the result types.

Is this possible in some way?  Is the data perhaps hidden in one of
the pg_* system tables?

Note that I don't want to actually execute the statement, just parse
it.

Rich.

-- 
Richard Jones, CTO Merjis Ltd.
Merjis - web marketing and technology - http://merjis.com
Team Notepad - intranets and extranets for business - http://team-notepad.com


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

Предыдущее
От: Michael Meskes
Дата:
Сообщение: Re: ecpg and VARCHAR
Следующее
От: Zahid Khan
Дата:
Сообщение: info required about Dot net DataProvider