Re: Analyzing the types of prepared statements

From: John DeSoi <desoi(at)pgedit(dot)com>
To: Jason Dusek <jason(dot)dusek(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Analyzing the types of prepared statements
Date: 2013-03-19 02:19:25
Message-ID: B3F632A9-6D00-420C-8BB7-31F02F64BBD6@pgedit.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


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.

John DeSoi, Ph.D.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ray Stell 2013-03-19 02:45:42 Re: .backup file documentation
Previous Message Tom Lane 2013-03-19 01:40:38 Re: Enforcing Parameterised Nested Loop Join Order for Foreign Table Joins