Re: Analyzing the types of prepared statements

From: Jason Dusek <jason(dot)dusek(at)gmail(dot)com>
To: John DeSoi <desoi(at)pgedit(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Analyzing the types of prepared statements
Date: 2013-03-19 22:12:04
Message-ID: CAO3NbwOiRXUP=qegao=VBzwQn+_=JLW=33MH1M2eVeKDffuQJQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

2013/3/19 John DeSoi <desoi(at)pgedit(dot)com>:
> On Mar 16, 2013, at 8:30 AM, Jason Dusek <jason(dot)dusek(at)gmail(dot)com> wrote:
>> However, it is not clear to me at this juncture how to get the
>> return type for a statement, given its text. Preparing and
>> looking it up in pg_prepared_statements will retrieve the
>> argument types but not the return type. Wrapping the query in a
>> SQL stored procedure which returns record doesn't cause the
>> server to infer and store a more specific type.
>
> You might want to take a look at the extended query protocol here:
>
> http://www.postgresql.org/docs/current/interactive/protocol-flow.html
>
> If you send a "parse" (P) messaged followed by "describe" (D), you can
> get a row description for the return type without executing anything.

Thanks for the tip. I will give that a shot.

--
Jason Dusek
pgp // solidsnack // C1EBC57DC55144F35460C8DF1FD4C6C1FED18A2B

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Wasim Arif 2013-03-19 22:20:38 Re: Roadmap for Postgres on AIX
Previous Message Adrian Klaver 2013-03-19 20:18:04 Re: Dump table from schema and function from another one