11
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-exec.c,v 1.200 2009/01/01 17:24:03 momjian Exp $
11
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-exec.c,v 1.203 2009/06/11 14:49:13 momjian Exp $
13
13
*-------------------------------------------------------------------------
64
64
static PGresult *PQexecFinish(PGconn *conn);
65
65
static int PQsendDescribe(PGconn *conn, char desc_type,
66
66
const char *desc_target);
67
static int check_field_number(const PGresult *res, int field_num);
67
static int check_field_number(const PGresult *res, int field_num);
70
70
/* ----------------
219
219
PQsetResultAttrs(PGresult *res, int numAttributes, PGresAttDesc *attDescs)
223
223
/* If attrs already exist, they cannot be overwritten. */
224
224
if (!res || res->numAttributes > 0)
262
262
* Returns a deep copy of the provided 'src' PGresult, which cannot be NULL.
263
263
* The 'flags' argument controls which portions of the result will or will
264
264
* NOT be copied. The created result is always put into the
265
* PGRES_TUPLES_OK status. The source result error message is not copied,
265
* PGRES_TUPLES_OK status. The source result error message is not copied,
266
266
* although cmdStatus is.
268
* To set custom attributes, use PQsetResultAttrs. That function requires
268
* To set custom attributes, use PQsetResultAttrs. That function requires
269
269
* that there are no attrs contained in the result, so to use that
270
270
* function you cannot use the PG_COPYRES_ATTRS or PG_COPYRES_TUPLES
271
271
* options with this function.
274
* PG_COPYRES_ATTRS - Copy the source result's attributes
276
* PG_COPYRES_TUPLES - Copy the source result's tuples. This implies
277
* copying the attrs, seeeing how the attrs are needed by the tuples.
279
* PG_COPYRES_EVENTS - Copy the source result's events.
281
* PG_COPYRES_NOTICEHOOKS - Copy the source result's notice hooks.
274
* PG_COPYRES_ATTRS - Copy the source result's attributes
276
* PG_COPYRES_TUPLES - Copy the source result's tuples. This implies
277
* copying the attrs, seeeing how the attrs are needed by the tuples.
279
* PG_COPYRES_EVENTS - Copy the source result's events.
281
* PG_COPYRES_NOTICEHOOKS - Copy the source result's notice hooks.
284
284
PQcopyResult(const PGresult *src, int flags)
296
/* Always copy these over. Is cmdStatus really useful here? */
296
/* Always copy these over. Is cmdStatus really useful here? */
297
297
dest->client_encoding = src->client_encoding;
298
298
strcpy(dest->cmdStatus, src->cmdStatus);
3219
3220
(ISOCTDIGIT(strtext[i + 1])) &&
3220
3221
(ISOCTDIGIT(strtext[i + 2])))
3224
3225
byte = OCTVAL(strtext[i++]);
3225
byte = (byte << 3) + OCTVAL(strtext[i++]);
3226
byte = (byte << 3) + OCTVAL(strtext[i++]);
3226
byte = (byte <<3) +OCTVAL(strtext[i++]);
3227
byte = (byte <<3) +OCTVAL(strtext[i++]);
3227
3228
buffer[j++] = byte;