1
0
mirror of https://github.com/postgres/postgres.git synced 2025-08-17 01:02:17 +03:00

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.
This commit is contained in:
Tom Lane
2005-06-22 17:45:46 +00:00
parent 84d73a6dbc
commit e98edb5555
6 changed files with 121 additions and 34 deletions

View File

@@ -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