diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2005-06-22 17:45:46 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2005-06-22 17:45:46 +0000 |
commit | e98edb5555de0197ba4ffc99b4f3db134c99a86f (patch) | |
tree | f022547496d97cf1984bae42f972e5da458510a5 /src/backend/tcop/postgres.c | |
parent | 84d73a6dbc23dda43bf4d83ee71b344063524cbe (diff) | |
download | postgresql-e98edb5555de0197ba4ffc99b4f3db134c99a86f.tar.gz postgresql-e98edb5555de0197ba4ffc99b4f3db134c99a86f.zip |
Fix the mechanism for reporting the original table OID and column number
of columns of a query result so that it can "see through" cursors and
prepared statements. Per gripe a couple months back from John DeSoi.
Diffstat (limited to 'src/backend/tcop/postgres.c')
-rw-r--r-- | src/backend/tcop/postgres.c | 25 |
1 files changed, 6 insertions, 19 deletions
diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c index 454bc2577e1..a676edd9a97 100644 --- a/src/backend/tcop/postgres.c +++ b/src/backend/tcop/postgres.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/tcop/postgres.c,v 1.449 2005/06/17 22:32:46 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/tcop/postgres.c,v 1.450 2005/06/22 17:45:45 tgl Exp $ * * NOTES * this is the "main" module of the postgres backend and @@ -1928,15 +1928,9 @@ exec_describe_statement_message(const char *stmt_name) */ tupdesc = FetchPreparedStatementResultDesc(pstmt); if (tupdesc) - { - List *targetlist; - - if (ChoosePortalStrategy(pstmt->query_list) == PORTAL_ONE_SELECT) - targetlist = ((Query *) linitial(pstmt->query_list))->targetList; - else - targetlist = NIL; - SendRowDescriptionMessage(tupdesc, targetlist, NULL); - } + SendRowDescriptionMessage(tupdesc, + FetchPreparedStatementTargetList(pstmt), + NULL); else pq_putemptymessage('n'); /* NoData */ @@ -1962,16 +1956,9 @@ exec_describe_portal_message(const char *portal_name) return; /* can't actually do anything... */ if (portal->tupDesc) - { - List *targetlist; - - if (portal->strategy == PORTAL_ONE_SELECT) - targetlist = ((Query *) linitial(portal->parseTrees))->targetList; - else - targetlist = NIL; - SendRowDescriptionMessage(portal->tupDesc, targetlist, + SendRowDescriptionMessage(portal->tupDesc, + FetchPortalTargetList(portal), portal->formats); - } else pq_putemptymessage('n'); /* NoData */ } |