diff options
author | Vadim B. Mikheev <vadim4o@yahoo.com> | 1998-11-27 19:52:36 +0000 |
---|---|---|
committer | Vadim B. Mikheev <vadim4o@yahoo.com> | 1998-11-27 19:52:36 +0000 |
commit | 6beba218d7f6f764e946751df6dc0d0180da05fa (patch) | |
tree | 2801029d61d798d6150bb43a24561a4615aedb8b /src/backend/commands/copy.c | |
parent | 2435c7d501b0a3129f6fc597a9c85863541cd596 (diff) |
New HeapTuple structure/interface.
Diffstat (limited to 'src/backend/commands/copy.c')
-rw-r--r-- | src/backend/commands/copy.c | 27 |
1 files changed, 9 insertions, 18 deletions
diff --git a/src/backend/commands/copy.c b/src/backend/commands/copy.c index 51e91e7c8be..419874e5d49 100644 --- a/src/backend/commands/copy.c +++ b/src/backend/commands/copy.c @@ -6,7 +6,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.63 1998/10/26 00:59:21 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.64 1998/11/27 19:51:54 vadim Exp $ * *------------------------------------------------------------------------- */ @@ -277,7 +277,7 @@ CopyTo(Relation rel, bool binary, bool oids, FILE *fp, char *delim) if (oids && !binary) { - fputs(oidout(tuple->t_oid), fp); + fputs(oidout(tuple->t_data->t_oid), fp); fputc(delim[0], fp); } @@ -331,10 +331,10 @@ CopyTo(Relation rel, bool binary, bool oids, FILE *fp, char *delim) null_ct++; } - length = tuple->t_len - tuple->t_hoff; + length = tuple->t_len - tuple->t_data->t_hoff; fwrite(&length, sizeof(int32), 1, fp); if (oids) - fwrite((char *) &tuple->t_oid, sizeof(int32), 1, fp); + fwrite((char *) &tuple->t_data->t_oid, sizeof(int32), 1, fp); fwrite(&null_ct, sizeof(int32), 1, fp); if (null_ct > 0) @@ -348,7 +348,8 @@ CopyTo(Relation rel, bool binary, bool oids, FILE *fp, char *delim) } } } - fwrite((char *) tuple + tuple->t_hoff, length, 1, fp); + fwrite((char *) tuple->t_data + tuple->t_data->t_hoff, + length, 1, fp); } } @@ -678,7 +679,7 @@ CopyFrom(Relation rel, bool binary, bool oids, FILE *fp, char *delim) */ tuple = heap_formtuple(tupDesc, values, nulls); if (oids) - tuple->t_oid = loaded_oid; + tuple->t_data->t_oid = loaded_oid; skip_tuple = false; /* BEFORE ROW INSERT Triggers */ @@ -706,17 +707,7 @@ CopyFrom(Relation rel, bool binary, bool oids, FILE *fp, char *delim) */ if (rel->rd_att->constr) - { - HeapTuple newtuple; - - newtuple = ExecConstraints("CopyFrom", rel, tuple); - - if (newtuple != tuple) - { - pfree(tuple); - tuple = newtuple; - } - } + ExecConstraints("CopyFrom", rel, tuple); heap_insert(rel, tuple); @@ -746,7 +737,7 @@ CopyFrom(Relation rel, bool binary, bool oids, FILE *fp, char *delim) index_nulls, finfoP[i]); indexRes = index_insert(index_rels[i], idatum, index_nulls, - &(tuple->t_ctid), rel); + &(tuple->t_self), rel); if (indexRes) pfree(indexRes); } |