diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 2003-04-22 00:08:07 +0000 |
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 2003-04-22 00:08:07 +0000 |
| commit | 5ed27e35f35f6c354b1a7120ec3a3ce57f93e73e (patch) | |
| tree | 9ed912fbf02c36160a88881764735f8eab6103b9 /src/backend/access/common/printtup.c | |
| parent | ca944bd2d41814712cb4a4810ab4aa490f23a853 (diff) | |
| download | postgresql-5ed27e35f35f6c354b1a7120ec3a3ce57f93e73e.tar.gz | |
Another round of protocol changes. Backend-to-frontend messages now all
have length words. COPY OUT reimplemented per new protocol: it doesn't
need \. anymore, thank goodness. COPY BINARY to/from frontend works,
at least as far as the backend is concerned --- libpq's PQgetline API
is not up to snuff, and will have to be replaced with something that is
null-safe. libpq uses message length words for performance improvement
(no cycles wasted rescanning long messages), but not yet for error
recovery.
Diffstat (limited to 'src/backend/access/common/printtup.c')
| -rw-r--r-- | src/backend/access/common/printtup.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/src/backend/access/common/printtup.c b/src/backend/access/common/printtup.c index f1f96f1886..c88dedd93f 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 - * $Header: /cvsroot/pgsql/src/backend/access/common/printtup.c,v 1.65 2002/09/04 20:31:08 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/access/common/printtup.c,v 1.66 2003/04/22 00:08:06 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -77,15 +77,18 @@ static void printtup_setup(DestReceiver *self, int operation, const char *portalName, TupleDesc typeinfo) { - /* - * Send portal name to frontend. - * - * If portal name not specified, use "blank" portal. - */ - if (portalName == NULL) - portalName = "blank"; - - pq_puttextmessage('P', portalName); + if (PG_PROTOCOL_MAJOR(FrontendProtocol) < 3) + { + /* + * Send portal name to frontend (obsolete cruft, gone in proto 3.0) + * + * If portal name not specified, use "blank" portal. + */ + if (portalName == NULL) + portalName = "blank"; + + pq_puttextmessage('P', portalName); + } /* * if this is a retrieve, then we send back the tuple descriptor of @@ -98,8 +101,7 @@ printtup_setup(DestReceiver *self, int operation, int i; StringInfoData buf; - pq_beginmessage(&buf); - pq_sendbyte(&buf, 'T'); /* tuple descriptor message type */ + pq_beginmessage(&buf, 'T'); /* tuple descriptor message type */ pq_sendint(&buf, natts, 2); /* # of attrs in tuples */ for (i = 0; i < natts; ++i) @@ -174,8 +176,7 @@ printtup(HeapTuple tuple, TupleDesc typeinfo, DestReceiver *self) /* * tell the frontend to expect new tuple data (in ASCII style) */ - pq_beginmessage(&buf); - pq_sendbyte(&buf, 'D'); + pq_beginmessage(&buf, 'D'); /* * send a bitmap of which attributes are not null @@ -388,8 +389,7 @@ printtup_internal(HeapTuple tuple, TupleDesc typeinfo, DestReceiver *self) /* * tell the frontend to expect new tuple data (in binary style) */ - pq_beginmessage(&buf); - pq_sendbyte(&buf, 'B'); + pq_beginmessage(&buf, 'B'); /* * send a bitmap of which attributes are not null |
