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/access | |
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/access')
-rw-r--r-- | src/backend/access/common/printtup.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/src/backend/access/common/printtup.c b/src/backend/access/common/printtup.c index 78939e2bd05..9080d047fc2 100644 --- a/src/backend/access/common/printtup.c +++ b/src/backend/access/common/printtup.c @@ -9,7 +9,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/access/common/printtup.c,v 1.90 2005/05/01 18:56:17 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/access/common/printtup.c,v 1.91 2005/06/22 17:45:45 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -19,6 +19,7 @@ #include "access/printtup.h" #include "libpq/libpq.h" #include "libpq/pqformat.h" +#include "tcop/pquery.h" #include "utils/lsyscache.h" #include "utils/portal.h" @@ -130,16 +131,9 @@ printtup_startup(DestReceiver *self, int operation, TupleDesc typeinfo) * descriptions, then we send back the tuple descriptor of the tuples. */ if (operation == CMD_SELECT && myState->sendDescrip) - { - List *targetlist; - - if (portal->strategy == PORTAL_ONE_SELECT) - targetlist = ((Query *) linitial(portal->parseTrees))->targetList; - else - targetlist = NIL; - - SendRowDescriptionMessage(typeinfo, targetlist, portal->formats); - } + SendRowDescriptionMessage(typeinfo, + FetchPortalTargetList(portal), + portal->formats); /* ---------------- * We could set up the derived attr info at this time, but we postpone it |