diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2000-05-30 04:25:00 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2000-05-30 04:25:00 +0000 |
commit | 0f1e39643de655f5103b09d5a82cadbf26a965c1 (patch) | |
tree | 32fa30338e5065afbc28df7dae4c2d2a0bce1569 /src/backend/commands/copy.c | |
parent | a12a23f0d03cc8bf22c6c38bc2394753ec34fcdf (diff) | |
download | postgresql-0f1e39643de655f5103b09d5a82cadbf26a965c1.tar.gz postgresql-0f1e39643de655f5103b09d5a82cadbf26a965c1.zip |
Third round of fmgr updates: eliminate calls using fmgr() and
fmgr_faddr() in favor of new-style calls. Lots of cleanup of
sloppy casts to use XXXGetDatum and DatumGetXXX ...
Diffstat (limited to 'src/backend/commands/copy.c')
-rw-r--r-- | src/backend/commands/copy.c | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/src/backend/commands/copy.c b/src/backend/commands/copy.c index 5382effb198..fe8a3223c1d 100644 --- a/src/backend/commands/copy.c +++ b/src/backend/commands/copy.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.108 2000/05/30 00:49:43 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.109 2000/05/30 04:25:00 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -501,8 +501,10 @@ CopyTo(Relation rel, bool binary, bool oids, FILE *fp, char *delim, char *null_p #endif /* _DROP_COLUMN_HACK__ */ if (!isnull) { - string = (char *) (*fmgr_faddr(&out_functions[i])) - (value, elements[i], typmod[i]); + string = DatumGetCString(FunctionCall3(&out_functions[i], + value, + ObjectIdGetDatum(elements[i]), + Int32GetDatum(typmod[i]))); CopyAttributeOut(fp, string, delim); pfree(string); } @@ -814,17 +816,10 @@ CopyFrom(Relation rel, bool binary, bool oids, FILE *fp, char *delim, char *null done = 1; else { - values[i] = (Datum) (*fmgr_faddr(&in_functions[i])) (string, - elements[i], - typmod[i]); - - /* - * Sanity check - by reference attributes cannot - * return NULL - */ - if (!PointerIsValid(values[i]) && - !(rel->rd_att->attrs[i]->attbyval)) - elog(ERROR, "COPY: Bad file format"); + values[i] = FunctionCall3(&in_functions[i], + CStringGetDatum(string), + ObjectIdGetDatum(elements[i]), + Int32GetDatum(typmod[i])); } } if (!done) |